-- Added TAG, DURATION and SPECIAL keywords and associated handling.

This commit is contained in:
dfs
1997-09-16 03:16:30 +00:00
parent dd917df96f
commit 31bc3c8aa8
19 changed files with 215 additions and 70 deletions

View File

@@ -1,5 +1,5 @@
# Makefile for REMIND # Makefile for REMIND
# $Id: Makefile,v 1.20 1997-07-31 01:57:10 dfs Exp $ # $Id: Makefile,v 1.21 1997-09-16 03:16:30 dfs Exp $
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# THINGS FOR YOU TO EDIT START BELOW # THINGS FOR YOU TO EDIT START BELOW
@@ -54,7 +54,7 @@ GROUP=bin
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things # YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
# in config.h; then, you should be able to type 'make'. # in config.h; then, you should be able to type 'make'.
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
VERSION= 03.00.17 VERSION= 03.00.18
MATHLIB= -lm MATHLIB= -lm
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \ HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
@@ -133,9 +133,9 @@ tgz:
-rm -rf remind-$(VERSION) -rm -rf remind-$(VERSION)
-mkdir remind-$(VERSION) -mkdir remind-$(VERSION)
cd remind-$(VERSION); for i in www $(MANIFEST) ;do ln -s ../$$i .; done; cd .. cd remind-$(VERSION); for i in www $(MANIFEST) ;do ln -s ../$$i .; done; cd ..
tar --exclude CVS -c -h -v -f remind-3.0.17.tar remind-$(VERSION) tar --exclude CVS -c -h -v -f remind-3.0.18.tar remind-$(VERSION)
gzip -v -9 remind-3.0.17.tar gzip -v -9 remind-3.0.18.tar
mv remind-3.0.17.tar.gz remind-3.0.17.tgz mv remind-3.0.18.tar.gz remind-3.0.18.tgz
rm -rf remind-$(VERSION) rm -rf remind-$(VERSION)
shar: shar:

View File

@@ -1,4 +1,4 @@
#$Id: Makefile_QDOS,v 1.5 1997-03-30 19:07:36 dfs Exp $ #$Id: Makefile_QDOS,v 1.6 1997-09-16 03:16:30 dfs Exp $
# Makefile for REMIND for QDOS / SMSQ # Makefile for REMIND for QDOS / SMSQ
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
@@ -24,7 +24,7 @@ LDFLAGS= -bufp200K
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things # YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
# in config_h; then, you should be able to type 'make'. # in config_h; then, you should be able to type 'make'.
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
VERSION= 03.00.17 VERSION= 03.00.18
MATHLIB= -lm MATHLIB= -lm
HDRS= config_h err_h expr_h globals_h protos_h types_h version_h \ HDRS= config_h err_h expr_h globals_h protos_h types_h version_h \

View File

@@ -1,5 +1,5 @@
$Id: README_QDOS,v 1.5 1997-03-30 19:07:36 dfs Exp $ $Id: README_QDOS,v 1.6 1997-09-16 03:16:30 dfs Exp $
REMIND version 3.0.17 for QDOS / SMSQ REMIND version 3.0.18 for QDOS / SMSQ
REMIND is a sophisticated alarm/calendar program. Details are given REMIND is a sophisticated alarm/calendar program. Details are given
in the documentation file, "remind_doc" (QUILL format). in the documentation file, "remind_doc" (QUILL format).

View File

@@ -10,7 +10,7 @@
/***************************************************************/ /***************************************************************/
#include "config.h" #include "config.h"
static char const RCSID[] = "$Id: calendar.c,v 1.4 1997-03-30 19:07:37 dfs Exp $"; static char const RCSID[] = "$Id: calendar.c,v 1.5 1997-09-16 03:16:30 dfs Exp $";
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -34,6 +34,9 @@ typedef struct cal_entry {
char *pos; char *pos;
int time; int time;
int priority; int priority;
char tag[TAG_LEN+1];
char passthru[PASSTHRU_LEN+1];
int duration;
} CalEntry; } CalEntry;
/* Global variables */ /* Global variables */
@@ -661,6 +664,12 @@ int col;
FindToken(buf, &tok); FindToken(buf, &tok);
if (tok.type == T_Empty || tok.type == T_Comment) return OK; if (tok.type == T_Empty || tok.type == T_Comment) return OK;
if (tok.type != T_RemType || tok.val == SAT_TYPE) return E_PARSE_ERR; if (tok.type != T_RemType || tok.val == SAT_TYPE) return E_PARSE_ERR;
if (tok.val == PASSTHRU_TYPE) {
r=ParseToken(p, buf);
if (r) return r;
if (!*buf) return E_EOLN;
StrnCpy(trig.passthru, buf, PASSTHRU_LEN);
}
trig.typ = tok.val; trig.typ = tok.val;
jul = LastTriggerDate; jul = LastTriggerDate;
if (!LastTrigValid) return OK; if (!LastTrigValid) return OK;
@@ -670,10 +679,21 @@ int col;
if (r) return r; if (r) return r;
} }
if (!PsCal && (trig.typ == PS_TYPE || trig.typ == PSF_TYPE)) return OK; /* Convert PS and PSF to PASSTHRU */
if (trig.typ == PS_TYPE) {
strcpy(trig.passthru, "PPPP");
trig.typ = PASSTHRU_TYPE;
} else if (trig.typ == PSF_TYPE) {
strcpy(trig.passthru, "FFFF");
trig.typ = PASSTHRU_TYPE;
}
if (!PsCal && trig.typ == PASSTHRU_TYPE) return OK;
/* Remove any "at" times from PS or PSFILE reminders */ /* Remove any "at" times from PS or PSFILE reminders */
if (trig.typ == PS_TYPE || trig.typ == PSF_TYPE) tim.ttime = NO_TIME; if (trig.typ == PASSTHRU_TYPE) {
tim.ttime = NO_TIME;
tim.duration = NO_TIME;
}
/* If trigger date == today, add it to the current entry */ /* If trigger date == today, add it to the current entry */
if (jul == JulianToday) { if (jul == JulianToday) {
@@ -682,7 +702,7 @@ int col;
*s = 0; *s = 0;
if (DoSimpleCalendar || tim.ttime != NO_TIME) if (DoSimpleCalendar || tim.ttime != NO_TIME)
s += strlen(SimpleTime(tim.ttime, s)); s += strlen(SimpleTime(tim.ttime, s));
if (trig.typ != PS_TYPE && trig.typ != PSF_TYPE && if (trig.typ != PASSTHRU_TYPE &&
UserFuncExists("calprefix")==1) { UserFuncExists("calprefix")==1) {
sprintf(buf, "calprefix(%d)", trig.priority); sprintf(buf, "calprefix(%d)", trig.priority);
s2 = buf; s2 = buf;
@@ -697,7 +717,7 @@ int col;
} }
if ( (r=DoSubst(p, s, &trig, &tim, jul, CAL_MODE)) ) return r; if ( (r=DoSubst(p, s, &trig, &tim, jul, CAL_MODE)) ) return r;
if (!*s) return OK; if (!*s) return OK;
if (trig.typ != PS_TYPE && trig.typ != PSF_TYPE && if (trig.typ != PASSTHRU_TYPE &&
UserFuncExists("calsuffix")==1) { UserFuncExists("calsuffix")==1) {
sprintf(buf, "calsuffix(%d)", trig.priority); sprintf(buf, "calsuffix(%d)", trig.priority);
s2 = buf; s2 = buf;
@@ -719,9 +739,15 @@ int col;
free(e); free(e);
return E_NO_MEM; return E_NO_MEM;
} }
StrnCpy(e->tag, trig.tag, TAG_LEN);
if (!e->tag[0]) {
strcpy(e->tag, "*");
}
e->duration = tim.duration;
e->priority = trig.priority; e->priority = trig.priority;
if (trig.typ == PS_TYPE || trig.typ == PSF_TYPE) { if (trig.typ == PASSTHRU_TYPE) {
e->pos = (trig.typ == PS_TYPE) ? "P" : "F"; StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
e->pos = e->passthru;
e->time = NO_TIME; e->time = NO_TIME;
e->next = CurPs; e->next = CurPs;
CalPs[col] = e; CalPs[col] = e;
@@ -753,14 +779,34 @@ int col, jul;
{ {
CalEntry *e = CalPs[col]; CalEntry *e = CalPs[col];
CalEntry *n; CalEntry *n;
int y, m, d; int y, m, d, i, j;
/* Do all the PostScript entries first, if any */ /* Do all the PASSTHRU entries first, if any */
FromJulian(jul, &y, &m, &d); FromJulian(jul, &y, &m, &d);
while(e) { while(e) {
printf("%c%c%c%c%c%02d%c%02d ", *(e->pos), *(e->pos), /* Print the PASSTHRU */
*(e->pos), *(e->pos), DATESEP, j = 0;
for(i=0; i<PASSTHRU_LEN; i++) {
printf("%c", *(e->pos+j));
if (*(e->pos+j+1)) {
j++;
} else {
j=0;
}
}
printf("%c%02d%c%02d ", DATESEP,
m+1, DATESEP, d); m+1, DATESEP, d);
printf("%s ", e->tag);
if (e->duration != NO_TIME) {
printf("%d ", e->duration);
} else {
printf("* ");
}
if (e->time != NO_TIME) {
printf("%d ", e->time);
} else {
printf("* ");
}
printf("%s\n", e->text); printf("%s\n", e->text);
free(e->text); free(e->text);
n = e->next; n = e->next;
@@ -772,6 +818,17 @@ int col, jul;
e = CalColumn[col]; e = CalColumn[col];
while(e) { while(e) {
printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d); printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
printf("%s ", e->tag);
if (e->duration != NO_TIME) {
printf("%d ", e->duration);
} else {
printf("* ");
}
if (e->time != NO_TIME) {
printf("%d ", e->time);
} else {
printf("* ");
}
printf("%s\n", e->text); printf("%s\n", e->text);
free(e->text); free(e->text);
n = e->next; n = e->next;
@@ -859,8 +916,7 @@ char *out;
switch(ScFormat) { switch(ScFormat) {
case SC_AMPM: case SC_AMPM:
if (tim == NO_TIME) sprintf(out, " "); if (tim != NO_TIME) {
else {
h = tim / 60; h = tim / 60;
min = tim % 60; min = tim % 60;
if (h == 0) hh=12; if (h == 0) hh=12;
@@ -871,8 +927,7 @@ char *out;
break; break;
case SC_MIL: case SC_MIL:
if (tim == NO_TIME) sprintf(out, " "); if (tim != NO_TIME) {
else {
h = tim / 60; h = tim / 60;
min = tim % 60; min = tim % 60;
sprintf(out, "%02d%c%02d ", h, TIMESEP, min); sprintf(out, "%02d%c%02d ", h, TIMESEP, min);

View File

@@ -11,7 +11,7 @@
/* */ /* */
/***************************************************************/ /***************************************************************/
/* $Id: config.h,v 1.8 1997-07-13 16:18:48 dfs Exp $ */ /* $Id: config.h,v 1.9 1997-09-16 03:16:31 dfs Exp $ */
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */ /* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
@@ -267,6 +267,14 @@
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
/* Don't change the next definitions */ /* Don't change the next definitions */
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
/*---------------------------------------------------------------------*/
/* TAG_LEN: The maximum length of tags. Don't change it */
/*---------------------------------------------------------------------*/
#define TAG_LEN 32
#define PASSTHRU_LEN 4
#define PUBLIC #define PUBLIC
#define PRIVATE static #define PRIVATE static

44
dorem.c
View File

@@ -12,7 +12,7 @@
/***************************************************************/ /***************************************************************/
#include "config.h" #include "config.h"
static char const RCSID[] = "$Id: dorem.c,v 1.5 1997-03-30 19:07:37 dfs Exp $"; static char const RCSID[] = "$Id: dorem.c,v 1.6 1997-09-16 03:16:31 dfs Exp $";
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
@@ -77,7 +77,15 @@ ParsePtr p;
if (r) return r; if (r) return r;
FindToken(buf, &tok); FindToken(buf, &tok);
if (tok.type == T_Empty || tok.type == T_Comment) return OK; if (tok.type == T_Empty || tok.type == T_Comment) return OK;
if (tok.type != T_RemType || tok.val == SAT_TYPE) return E_PARSE_ERR; if (tok.type != T_RemType || tok.val == SAT_TYPE) {
return E_PARSE_ERR;
}
if (tok.val == PASSTHRU_TYPE) {
r=ParseToken(p, buf);
if (r) return r;
if (!*buf) return E_EOLN;
StrnCpy(trig.passthru, buf, PASSTHRU_LEN);
}
trig.typ = tok.val; trig.typ = tok.val;
jul = LastTriggerDate; jul = LastTriggerDate;
if (!LastTrigValid) return OK; if (!LastTrigValid) return OK;
@@ -148,9 +156,11 @@ ParsePtr p;
trig->priority = DefaultPrio; trig->priority = DefaultPrio;
trig->sched[0] = 0; trig->sched[0] = 0;
trig->warn[0] = 0; trig->warn[0] = 0;
trig->tag[0] = 0;
tim->ttime = NO_TIME; tim->ttime = NO_TIME;
tim->delta = NO_DELTA; tim->delta = NO_DELTA;
tim->rep = NO_REP; tim->rep = NO_REP;
tim->duration = NO_TIME;
while(1) { while(1) {
/* Read space-delimited string */ /* Read space-delimited string */
@@ -194,6 +204,12 @@ ParsePtr p;
trig->typ = tok.val; trig->typ = tok.val;
if (s->isnested) return E_CANT_NEST_RTYPE; if (s->isnested) return E_CANT_NEST_RTYPE;
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday; if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
if (trig->typ == PASSTHRU_TYPE) {
r = ParseToken(s, TokBuffer);
if (r) return r;
if (!*TokBuffer) return E_EOLN;
StrnCpy(trig->passthru, TokBuffer, PASSTHRU_LEN);
}
return OK; return OK;
case T_Until: case T_Until:
@@ -246,6 +262,25 @@ ParsePtr p;
StrnCpy(trig->warn, TokBuffer, VAR_NAME_LEN); StrnCpy(trig->warn, TokBuffer, VAR_NAME_LEN);
break; break;
case T_Tag:
r = ParseToken(s, TokBuffer);
if (r) return r;
StrnCpy(trig->tag, TokBuffer, TAG_LEN);
break;
case T_Duration:
r = ParseToken(s, TokBuffer);
if (r) return r;
FindToken(TokBuffer, &tok);
switch(tok.type) {
case T_Time:
tim->duration = tok.val;
break;
default:
return E_BAD_TIME;
}
break;
case T_Sched: case T_Sched:
r=ParseToken(s, TokBuffer); r=ParseToken(s, TokBuffer);
if(r) return r; if(r) return r;
@@ -500,7 +535,10 @@ ParsePtr p;
Value v; Value v;
if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED; if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
if (t->typ == CAL_TYPE || t->typ == PS_TYPE || t->typ == PSF_TYPE) if (t->typ == PASSTHRU_TYPE ||
t->typ == CAL_TYPE ||
t->typ == PS_TYPE ||
t->typ == PSF_TYPE)
return OK; return OK;
/* If it's a MSG-type reminder, and no -k option was used, issue the banner. */ /* If it's a MSG-type reminder, and no -k option was used, issue the banner. */

View File

@@ -1,7 +1,7 @@
# Makefile for REMIND for Borland C++ # Makefile for REMIND for Borland C++
# $Id: makefile.bcc,v 1.5 1997-03-30 19:07:41 dfs Exp $ # $Id: makefile.bcc,v 1.6 1997-09-16 03:16:32 dfs Exp $
VERSION= 03.00.17 VERSION= 03.00.18
MODEL=l MODEL=l

View File

@@ -1,8 +1,8 @@
# Makefile for REMIND for Turbo C for MSDOS # Makefile for REMIND for Turbo C for MSDOS
# $Id: makefile.tc,v 1.5 1997-03-30 19:07:41 dfs Exp $ # $Id: makefile.tc,v 1.6 1997-09-16 03:16:32 dfs Exp $
CC= tcc CC= tcc
VERSION= 03.00.17 VERSION= 03.00.18
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \ HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \ lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \

4
omit.c
View File

@@ -11,7 +11,7 @@
/***************************************************************/ /***************************************************************/
#include "config.h" #include "config.h"
static char const RCSID[] = "$Id: omit.c,v 1.4 1997-03-30 19:07:42 dfs Exp $"; static char const RCSID[] = "$Id: omit.c,v 1.5 1997-09-16 03:16:32 dfs Exp $";
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_STDLIB_H #ifdef HAVE_STDLIB_H
@@ -328,6 +328,8 @@ ParsePtr p;
case T_Comment: case T_Comment:
case T_RemType: case T_RemType:
case T_Priority: case T_Priority:
case T_Tag:
case T_Duration:
parsing = 0; parsing = 0;
break; break;

View File

@@ -10,7 +10,7 @@
/***************************************************************/ /***************************************************************/
#include "config.h" #include "config.h"
static char const RCSID[] = "$Id: rem2ps.c,v 1.7 1997-03-30 19:07:45 dfs Exp $"; static char const RCSID[] = "$Id: rem2ps.c,v 1.8 1997-09-16 03:16:32 dfs Exp $";
#include "lang.h" #include "lang.h"
#include <stdio.h> #include <stdio.h>
@@ -197,6 +197,7 @@ void DoPsCal()
int i; int i;
int is_ps; int is_ps;
int firstcol; int firstcol;
char *startOfBody;
CalEntry *c, *d; CalEntry *c, *d;
@@ -282,14 +283,37 @@ void DoPsCal()
fprintf(stderr, "malloc failed - aborting.\n"); fprintf(stderr, "malloc failed - aborting.\n");
exit(1); exit(1);
} }
is_ps = (*LineBuffer == 'F' || *LineBuffer == 'P');
c->next = NULL; c->next = NULL;
c->entry = malloc(strlen(LineBuffer+10) + 1 + is_ps);
is_ps = ((LineBuffer[0] == 'F' &&
LineBuffer[1] == 'F' &&
LineBuffer[2] == 'F' &&
LineBuffer[3] == 'F') ||
(LineBuffer[0] == 'P' &&
LineBuffer[1] == 'P' &&
LineBuffer[2] == 'P' &&
LineBuffer[3] == 'P'));
/* Skip the tag, duration and time */
startOfBody = LineBuffer+10;
while(*startOfBody && isspace(*startOfBody)) startOfBody++;
while(*startOfBody && !isspace(*startOfBody)) startOfBody++;
while(*startOfBody && isspace(*startOfBody)) startOfBody++;
while(*startOfBody && !isspace(*startOfBody)) startOfBody++;
while(*startOfBody && isspace(*startOfBody)) startOfBody++;
while(*startOfBody && !isspace(*startOfBody)) startOfBody++;
while(*startOfBody && isspace(*startOfBody)) startOfBody++;
/* If no time, skip it */
if (*startOfBody == '*') {
startOfBody++;
}
c->entry = malloc(strlen(startOfBody) + 1 + is_ps);
if (!c->entry) { if (!c->entry) {
fprintf(stderr, "malloc failed - aborting.\n"); fprintf(stderr, "malloc failed - aborting.\n");
exit(1); exit(1);
} }
strcpy(c->entry+is_ps, LineBuffer+10); strcpy(c->entry+is_ps, startOfBody);
if (is_ps) { if (is_ps) {
/* Save the 'P' or 'F' flag */ /* Save the 'P' or 'F' flag */

View File

@@ -1,6 +1,6 @@
Begin3 Begin3
Title: Remind Title: Remind
Version: 03.00.17 Version: 03.00.18
Entered-date: 10 February 1997 Entered-date: 10 February 1997
Description: Full-featured calendar/reminder program featuring Description: Full-featured calendar/reminder program featuring
sophisticated date calculation, moon phases, sunrise/sunset, sophisticated date calculation, moon phases, sunrise/sunset,
@@ -13,7 +13,7 @@ Keywords: calendar reminder alarm datebook PostScript www
Author: aa775@freenet.carleton.ca (David F. Skoll) Author: aa775@freenet.carleton.ca (David F. Skoll)
Maintained-by: aa775@freenet.carleton.ca (David F. Skoll) Maintained-by: aa775@freenet.carleton.ca (David F. Skoll)
Primary-site: ftp.doe.carleton.ca /pub/Remind-3.0 Primary-site: ftp.doe.carleton.ca /pub/Remind-3.0
230kB remind-3.0.17.tgz 230kB remind-3.0.18.tgz
Alternate-site: Alternate-site:
Original-site: Original-site:
Platform: Linux, Solaris, SunOS, HP-UX -- virtually any UN*X-like Platform: Linux, Solaris, SunOS, HP-UX -- virtually any UN*X-like

View File

@@ -631,7 +631,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056" "a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH" value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version() set a058 version()
version() => "03.00.17" version() => "03.00.18"
set a059 wkday(today()) set a059 wkday(today())
today() => 1991/02/16 today() => 1991/02/16
wkday(1991/02/16) => "Saturday" wkday(1991/02/16) => "Saturday"
@@ -772,7 +772,7 @@ dump
a048 "foo" a048 "foo"
a067 "INT" a067 "INT"
a039 "February" a039 "February"
a058 "03.00.17" a058 "03.00.18"
a077 "1992 92 a077 "1992 92
" "
a049 21 a049 21

View File

@@ -631,7 +631,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056" "a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH" value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version() set a058 version()
version() => "03.00.17" version() => "03.00.18"
set a059 wkday(today()) set a059 wkday(today())
today() => 1991/02/16 today() => 1991/02/16
wkday(1991/02/16) => "Saturday" wkday(1991/02/16) => "Saturday"
@@ -772,7 +772,7 @@ dump
a048 "foo" a048 "foo"
a067 "INT" a067 "INT"
a039 "February" a039 "February"
a058 "03.00.17" a058 "03.00.18"
a077 "1992 92 a077 "1992 92
" "
a049 21 a049 21

View File

@@ -1,6 +1,6 @@
# Test file for REMIND # Test file for REMIND
# #
# $Id: test1.cmp,v 1.6 1997-03-30 19:07:49 dfs Exp $ # $Id: test1.cmp,v 1.7 1997-09-16 03:16:34 dfs Exp $
# #
# Use this file to test the date calculation routines # Use this file to test the date calculation routines
# of the REMIND program by typing: # of the REMIND program by typing:
@@ -633,7 +633,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056" "a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH" value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version() set a058 version()
version() => "03.00.17" version() => "03.00.18"
set a059 wkday(today()) set a059 wkday(today())
today() => 1991/02/16 today() => 1991/02/16
wkday(1991/02/16) => "Saturday" wkday(1991/02/16) => "Saturday"
@@ -774,7 +774,7 @@ dump
a048 "foo" a048 "foo"
a067 "INT" a067 "INT"
a039 "February" a039 "February"
a058 "03.00.17" a058 "03.00.18"
a077 "1992 92 a077 "1992 92
" "
a049 21 a049 21

View File

@@ -1,6 +1,6 @@
# Test file for REMIND # Test file for REMIND
# #
# $Id: test2.cmp,v 1.6 1997-03-30 19:07:49 dfs Exp $ # $Id: test2.cmp,v 1.7 1997-09-16 03:16:34 dfs Exp $
# #
# Use this file to test the date calculation routines # Use this file to test the date calculation routines
# of the REMIND program by typing: # of the REMIND program by typing:
@@ -633,7 +633,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056" "a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH" value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version() set a058 version()
version() => "03.00.17" version() => "03.00.18"
set a059 wkday(today()) set a059 wkday(today())
today() => 1991/02/16 today() => 1991/02/16
wkday(1991/02/16) => "Saturday" wkday(1991/02/16) => "Saturday"
@@ -774,7 +774,7 @@ dump
a048 "foo" a048 "foo"
a067 "INT" a067 "INT"
a039 "February" a039 "February"
a058 "03.00.17" a058 "03.00.18"
a077 "1992 92 a077 "1992 92
" "
a049 21 a049 21

27
token.c
View File

@@ -11,7 +11,7 @@
/***************************************************************/ /***************************************************************/
#include "config.h" #include "config.h"
static char const RCSID[] = "$Id: token.c,v 1.5 1997-07-13 16:18:49 dfs Exp $"; static char const RCSID[] = "$Id: token.c,v 1.6 1997-09-16 03:16:35 dfs Exp $";
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@@ -52,13 +52,14 @@ Token TokArray[] = {
{ "banner", 3, T_Banner, 0 }, { "banner", 3, T_Banner, 0 },
{ "before", 3, T_Skip, BEFORE_SKIP }, { "before", 3, T_Skip, BEFORE_SKIP },
{ "cal", 3, T_RemType, CAL_TYPE }, { "cal", 3, T_RemType, CAL_TYPE },
{ "clear-omit-context", 5, T_Clr, 0 }, { "clear-omit-context", 5, T_Clr, 0 },
{ "debug", 5, T_Debug, 0 }, { "debug", 5, T_Debug, 0 },
{ "december", 3, T_Month, 11 }, { "december", 3, T_Month, 11 },
{ "dumpvars", 4, T_Dumpvars, 0 }, { "dumpvars", 4, T_Dumpvars, 0 },
{ "duration", 3, T_Duration, 0 },
{ "else", 4, T_Else, 0 }, { "else", 4, T_Else, 0 },
{ "endif", 5, T_EndIf, 0 }, { "endif", 5, T_EndIf, 0 },
{ "errmsg", 6, T_ErrMsg, 0 }, { "errmsg", 6, T_ErrMsg, 0 },
{ "exit", 4, T_Exit, 0 }, { "exit", 4, T_Exit, 0 },
{ "february", 3, T_Month, 1 }, { "february", 3, T_Month, 1 },
{ "flush", 5, T_Flush, 0 }, { "flush", 5, T_Flush, 0 },
@@ -67,7 +68,7 @@ Token TokArray[] = {
{ "if", 2, T_If, 0 }, { "if", 2, T_If, 0 },
{ "iftrig", 6, T_IfTrig, 0 }, { "iftrig", 6, T_IfTrig, 0 },
{ "include", 3, T_Include, 0 }, { "include", 3, T_Include, 0 },
{ "january", 3, T_Month, 0 }, { "january", 3, T_Month, 0 },
{ "july", 3, T_Month, 6 }, { "july", 3, T_Month, 6 },
{ "june", 3, T_Month, 5 }, { "june", 3, T_Month, 5 },
{ "march", 3, T_Month, 2 }, { "march", 3, T_Month, 2 },
@@ -76,27 +77,29 @@ Token TokArray[] = {
{ "msf", 3, T_RemType, MSF_TYPE }, { "msf", 3, T_RemType, MSF_TYPE },
{ "msg", 3, T_RemType, MSG_TYPE }, { "msg", 3, T_RemType, MSG_TYPE },
{ "november", 3, T_Month, 10 }, { "november", 3, T_Month, 10 },
{ "october", 3, T_Month, 9 }, { "october", 3, T_Month, 9 },
{ "omit", 3, T_Omit, 0 }, { "omit", 3, T_Omit, 0 },
{ "once", 3, T_Once, 0 }, { "once", 3, T_Once, 0 },
{ "pop-omit-context", 3, T_Pop, 0 }, { "pop-omit-context", 3, T_Pop, 0 },
{ "preserve", 8, T_Preserve, 0 }, { "preserve", 8, T_Preserve, 0 },
{ "priority", 8, T_Priority, 0 }, { "priority", 8, T_Priority, 0 },
{ "ps", 2, T_RemType, PS_TYPE }, { "ps", 2, T_RemType, PS_TYPE },
{ "psfile", 6, T_RemType, PSF_TYPE }, { "psfile", 6, T_RemType, PSF_TYPE },
{ "push-omit-context", 4, T_Push, 0 }, { "push-omit-context", 4, T_Push, 0 },
{ "rem", 3, T_Rem, 0 }, { "rem", 3, T_Rem, 0 },
{ "run", 3, T_RemType, RUN_TYPE }, { "run", 3, T_RemType, RUN_TYPE },
{ "satisfy", 7, T_RemType, SAT_TYPE }, { "satisfy", 7, T_RemType, SAT_TYPE },
{ "saturday", 3, T_WkDay, 5 }, { "saturday", 3, T_WkDay, 5 },
{ "scanfrom", 4, T_Scanfrom, 0 }, { "scanfrom", 4, T_Scanfrom, 0 },
{ "sched", 5, T_Sched, 0 }, { "sched", 5, T_Sched, 0 },
{ "september", 3, T_Month, 8 }, { "september", 3, T_Month, 8 },
{ "set", 3, T_Set, 0 }, { "set", 3, T_Set, 0 },
{ "skip", 3, T_Skip, SKIP_SKIP }, { "skip", 3, T_Skip, SKIP_SKIP },
{ "special", 7, T_RemType, PASSTHRU_TYPE },
{ "sunday", 3, T_WkDay, 6 }, { "sunday", 3, T_WkDay, 6 },
{ "tag", 3, T_Tag, 0 },
{ "thursday", 3, T_WkDay, 3 }, { "thursday", 3, T_WkDay, 3 },
{ "tuesday", 3, T_WkDay, 1 }, { "tuesday", 3, T_WkDay, 1 },
{ "unset", 5, T_UnSet, 0 }, { "unset", 5, T_UnSet, 0 },
{ "until", 3, T_Until, 0 }, { "until", 3, T_Until, 0 },
{ "warn", 4, T_Warn, 0 }, { "warn", 4, T_Warn, 0 },

11
types.h
View File

@@ -9,7 +9,7 @@
/* */ /* */
/***************************************************************/ /***************************************************************/
/* $Id: types.h,v 1.4 1997-08-31 17:03:27 dfs Exp $ */ /* $Id: types.h,v 1.5 1997-09-16 03:16:35 dfs Exp $ */
/* Values */ /* Values */
typedef struct { typedef struct {
@@ -58,6 +58,8 @@ typedef struct {
int priority; int priority;
char sched[VAR_NAME_LEN+1]; /* Scheduling function */ char sched[VAR_NAME_LEN+1]; /* Scheduling function */
char warn[VAR_NAME_LEN+1]; /* Warning function */ char warn[VAR_NAME_LEN+1]; /* Warning function */
char tag[TAG_LEN+1];
char passthru[PASSTHRU_LEN+1];
} Trigger; } Trigger;
/* A time trigger */ /* A time trigger */
@@ -66,6 +68,7 @@ typedef struct {
int nexttime; int nexttime;
int delta; int delta;
int rep; int rep;
int duration;
} TimeTrig; } TimeTrig;
/* The parse pointer */ /* The parse pointer */
@@ -109,6 +112,8 @@ typedef Parser *ParsePtr; /* Pointer to parser structure */
#define PS_TYPE 5 #define PS_TYPE 5
#define PSF_TYPE 6 #define PSF_TYPE 6
#define MSF_TYPE 7 #define MSF_TYPE 7
#define PASSTHRU_TYPE 8
/* DEFINES for debugging flags */ /* DEFINES for debugging flags */
#define DB_PRTLINE 1 #define DB_PRTLINE 1
@@ -138,7 +143,9 @@ enum TokTypes
T_Flush, T_Flush,
T_Priority, T_Priority,
T_Sched, T_Sched,
T_Warn T_Warn,
T_Tag,
T_Duration
}; };
/* The structure of a token */ /* The structure of a token */

View File

@@ -9,5 +9,5 @@
/* */ /* */
/***************************************************************/ /***************************************************************/
/* $Id: version.h,v 1.6 1997-03-30 19:07:52 dfs Exp $ */ /* $Id: version.h,v 1.7 1997-09-16 03:16:35 dfs Exp $ */
#define VERSION "03.00.17" #define VERSION "03.00.18"

View File

@@ -2,7 +2,7 @@
# rem2html # rem2html
# #
# $Id: rem2html,v 1.2 1997-07-06 14:36:01 dfs Exp $ # $Id: rem2html,v 1.3 1997-09-16 03:16:42 dfs Exp $
# #
# A script to convert from the output of "remind -p" to Hyper-Text Markup # A script to convert from the output of "remind -p" to Hyper-Text Markup
# Language (HTML), the text format used in WWW documents. By default, it # Language (HTML), the text format used in WWW documents. By default, it
@@ -91,6 +91,8 @@ sub parse_options {
sub parse_input { sub parse_input {
local $where = 0; local $where = 0;
local $msg; local $msg;
local $type;
local $day;
@days = (); @days = ();
while (<>) { while (<>) {
@@ -109,10 +111,16 @@ sub parse_input {
@nextsc = split(" "); @nextsc = split(" ");
} else { } else {
last if /rem2(html|ps) end/; last if /rem2(html|ps) end/;
next unless m%^(\d*)/*(\d*)/*(\d*) ([^ ]*)?\s*(.*)$%; next unless m/^(....).(\d*).(\d*)\s+(\S+)\s+(\S+)\s+(\S+)\s*(.*)$/;
$msg = $5; $type = $1;
$msg = "$4 $msg" if $4; $msg = $7;
$days[$3] .= "<P>$msg</P>"; $day = $3;
next unless ($type eq "HTML" || ($type =~ /\d\d\d\d/));
if ($type eq "HTML") {
$days[$day] .= "$msg ";
} else {
$days[$day] .= "<P>$msg</P>";
}
} }
$where++; $where++;
} }