home *** CD-ROM | disk | FTP | other *** search
- *** ../prev/makefile.os2 Mon Sep 20 15:00:08 1993
- --- ./makefile.os2 Tue Oct 12 16:28:52 1993
- ***************
- *** 25,31 ****
- # 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'.
- #-----------------------------------------------------------------------------
- ! VERSION= 03.00.09
-
- HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
- lang.h english.h german.h dutch.h finish.h french.h norwgian.h
- --- 25,31 ----
- # 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'.
- #-----------------------------------------------------------------------------
- ! VERSION= 03.00.10
-
- HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
- lang.h english.h german.h dutch.h finish.h french.h norwgian.h
- ***************
- *** 41,47 ****
- remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
- makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
- defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
- ! tstlang.rem
-
- OBJS= $(SRCS:.c=$O)
-
- --- 41,49 ----
- remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
- makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
- defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
- ! tstlang.rem README.BCC lnk.bcc makefile.bcc os2func.c \
- ! test-rem.bat test-rem.cmd test1.cmp test2.cmp
- !
-
- OBJS= $(SRCS:.c=$O)
-
- *** ../prev/makefile.tc Thu Sep 30 15:50:25 1993
- --- ./makefile.tc Tue Oct 12 16:28:35 1993
- ***************
- *** 1,6 ****
- # Makefile for REMIND for Turbo C for MSDOS
-
- ! VERSION= 03.00.09
-
- 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
- --- 1,7 ----
- # Makefile for REMIND for Turbo C for MSDOS
-
- ! CC= tcc
- ! VERSION= 03.00.10
-
- 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
- ***************
- *** 20,37 ****
- remind.1 remind-a.csh remind-a.sh test.rem test-rem test.cmp makefile.tc \
- makefile.msc lnk.msc lnk.tc manifest.dos manifest.unx whatsnew.30 kall kall.1 \
- tstlang.rem defs.rem readme.os2 makefile.os2 rem2ps.c rem2ps.h remind.def \
- ! rem2ps.1
-
- all: remind.exe rem2ps.exe
-
- remind.exe: $(OBJS)
- ! tcc @lnk.tc
-
- rem2ps.exe: rem2ps.obj
- ! tcc -erem2ps.exe rem2ps.obj
-
- .c.obj:
- ! tcc -A -w-pia -c -O -mm {$< }
-
- rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
-
- --- 21,40 ----
- remind.1 remind-a.csh remind-a.sh test.rem test-rem test.cmp makefile.tc \
- makefile.msc lnk.msc lnk.tc manifest.dos manifest.unx whatsnew.30 kall kall.1 \
- tstlang.rem defs.rem readme.os2 makefile.os2 rem2ps.c rem2ps.h remind.def \
- ! rem2ps.1 README.BCC lnk.bcc makefile.bcc os2func.c \
- ! test-rem.bat test-rem.cmd test1.cmp test2.cmp
-
- +
- all: remind.exe rem2ps.exe
-
- remind.exe: $(OBJS)
- ! $(CC) @lnk.tc
-
- rem2ps.exe: rem2ps.obj
- ! $(CC) -erem2ps.exe rem2ps.obj
-
- .c.obj:
- ! $(CC) -w-pia -c -O -mm {$< }
-
- rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
-
- *** ../prev/moon.c Thu Sep 30 15:50:08 1993
- --- ./moon.c Tue Oct 12 16:22:48 1993
- ***************
- *** 274,288 ****
- double *usek;
- #endif
- {
- - int yy, mm, dd;
- double k, t, t2, t3, nt1;
-
- ! jyear(sdate, &yy, &mm, &dd);
-
- ! k = (yy + ((mm - 1) * (1.0 / 12.0)) - 1900) * 12.3685;
-
- /* Time in Julian centuries from 1900 January 0.5 */
- ! t = (sdate - 2415020.0) / 36525;
- t2 = t * t; /* Square for frequent use */
- t3 = t2 * t; /* Cube for frequent use */
-
- --- 274,291 ----
- double *usek;
- #endif
- {
- double k, t, t2, t3, nt1;
-
- ! /*** The following was the original code: It gave roundoff errors
- ! causing moonphase info to fail for Dec 1994. ***/
- ! /* jyear(sdate, &yy, &mm, &dd);
- ! k = (yy + (mm/12.0) - 1900) * 12.368531; */
-
- ! /*** The next line is the replacement ***/
- ! k = (sdate - 2415020.0) / synmonth;
-
- /* Time in Julian centuries from 1900 January 0.5 */
- ! t = (sdate - 2415020.0) / 36525.0;
- t2 = t * t; /* Square for frequent use */
- t3 = t2 * t; /* Cube for frequent use */
-
- ***************
- *** 316,322 ****
- int apcor = 0;
-
- k += phase; /* Add phase to new moon time */
- ! t = k / 1236.85; /* Time in Julian centuries from
- 1900 January 0.5 */
- t2 = t * t; /* Square for frequent use */
- t3 = t2 * t; /* Cube for frequent use */
- --- 319,325 ----
- int apcor = 0;
-
- k += phase; /* Add phase to new moon time */
- ! t = k / 1236.8531; /* Time in Julian centuries from
- 1900 January 0.5 */
- t2 = t * t; /* Square for frequent use */
- t3 = t2 * t; /* Cube for frequent use */
- ***************
- *** 602,616 ****
- int d1, t1;
- double k1, k2, jd, jdorig;
- double nt1, nt2;
- /* Convert from local to UTC */
- LocalToUTC(startdate, starttim, &utcd, &utct);
-
- /* Convert from Remind representation to year/mon/day */
- FromJulian(utcd, &y, &m, &d);
- -
- /* Convert to a true Julian date -- sorry for the name clashes! */
- jdorig = jtime(y, m, d, (utct / 60), (utct % 60), 0);
- ! jd = jdorig - 45;
- nt1 = meanphase(jd, 0.0, &k1);
- while(1) {
- jd += synmonth;
- --- 605,619 ----
- int d1, t1;
- double k1, k2, jd, jdorig;
- double nt1, nt2;
- +
- /* Convert from local to UTC */
- LocalToUTC(startdate, starttim, &utcd, &utct);
-
- /* Convert from Remind representation to year/mon/day */
- FromJulian(utcd, &y, &m, &d);
- /* Convert to a true Julian date -- sorry for the name clashes! */
- jdorig = jtime(y, m, d, (utct / 60), (utct % 60), 0);
- ! jd = jdorig - 45.0;
- nt1 = meanphase(jd, 0.0, &k1);
- while(1) {
- jd += synmonth;
- *** ../prev/omit.c Thu Aug 19 16:16:33 1993
- --- ./omit.c Tue Oct 12 16:22:49 1993
- ***************
- *** 324,329 ****
- --- 324,330 ----
- case T_Empty:
- case T_Comment:
- case T_RemType:
- + case T_Priority:
- parsing = 0;
- break;
-
- ***************
- *** 353,359 ****
- NumFullOmits++;
- }
- }
- ! if (tok.type == T_RemType) return E_PARSE_AS_REM;
- return OK;
-
- }
- --- 354,360 ----
- NumFullOmits++;
- }
- }
- ! if (tok.type == T_RemType || tok.type == T_Priority) return E_PARSE_AS_REM;
- return OK;
-
- }
- *** ../prev/protos.h Mon Sep 20 16:53:13 1993
- --- ./protos.h Wed Oct 20 11:54:30 1993
- ***************
- *** 86,92 ****
- int PopOmitContext ARGS ((ParsePtr p));
- int IsOmitted ARGS ((int jul, int localomit));
- int DoOmit ARGS ((ParsePtr p));
- ! int QueueReminder ARGS ((ParsePtr p, int typ, TimeTrig *tim));
- void HandleQueuedReminders ARGS ((void));
- char *FindInitialToken ARGS ((Token *tok, char *s));
- void FindToken ARGS ((const char *s, Token *tok));
- --- 86,92 ----
- int PopOmitContext ARGS ((ParsePtr p));
- int IsOmitted ARGS ((int jul, int localomit));
- int DoOmit ARGS ((ParsePtr p));
- ! int QueueReminder ARGS ((ParsePtr p, int typ, TimeTrig *tim, const char *sched));
- void HandleQueuedReminders ARGS ((void));
- char *FindInitialToken ARGS ((Token *tok, char *s));
- void FindToken ARGS ((const char *s, Token *tok));
- ***************
- *** 113,119 ****
- unsigned int HashVal ARGS ((const char *str));
- int DateOK ARGS ((int y, int m, int d));
- Operator *FindFunc ARGS ((char *name, Operator where[], int num));
- ! int InsertIntoSortBuffer ARGS ((int jul, int tim, char *body, int typ));
- void IssueSortedReminders ARGS ((void));
- int UserFuncExists ARGS ((char *fn));
- void JulToHeb ARGS((int jul, int *hy, int *hm, int *hd));
- --- 113,119 ----
- unsigned int HashVal ARGS ((const char *str));
- int DateOK ARGS ((int y, int m, int d));
- Operator *FindFunc ARGS ((char *name, Operator where[], int num));
- ! int InsertIntoSortBuffer ARGS ((int jul, int tim, char *body, int typ, int prio));
- void IssueSortedReminders ARGS ((void));
- int UserFuncExists ARGS ((char *fn));
- void JulToHeb ARGS((int jul, int *hy, int *hm, int *hd));
- ***************
- *** 136,138 ****
- --- 136,148 ----
- void UTCToLocal ARGS ((int utcdate, int utctime, int *locdate, int *loctime));
- int MoonPhase ARGS ((int date, int time));
- void HuntPhase ARGS ((int startdate, int starttim, int phas, int *date, int *time));
- + int CompareRems ARGS ((int dat1, int tim1, int prio1, int dat2, int tim2, int prio2, int bydate, int bytime, int byprio));
- +
- + #if defined(__OS2__)
- + int fork ARGS ((void));
- + void StartPopUp ARGS ((void));
- + void EndPopUp ARGS ((void));
- + int PutcPopUp ARGS ((int c));
- + int PutlPopUp ARGS ((char *s));
- + int PutsPopUp ARGS ((char *s));
- + #endif
- *** ../prev/queue.c Thu Aug 19 16:12:20 1993
- --- ./queue.c Wed Oct 20 13:16:43 1993
- ***************
- *** 22,31 ****
- --- 22,39 ----
- #ifdef HAVE_UNISTD
- #include <unistd.h>
- #endif
- +
- + #ifdef __BORLANDC__
- + #include <io.h>
- + #include <dos.h>
- + #include <process.h>
- + #endif
- +
- #include "globals.h"
- #include "err.h"
- #include "types.h"
- #include "protos.h"
- + #include "expr.h"
-
- /* List structure for holding queued reminders */
- typedef struct queuedrem {
- ***************
- *** 32,38 ****
- --- 40,48 ----
- struct queuedrem *next;
- int typ;
- int RunDisabled;
- + int ntrig;
- char *text;
- + char sched[VAR_NAME_LEN+1];
- TimeTrig tt;
- } QueuedRem;
-
- ***************
- *** 45,51 ****
- --- 55,67 ----
- PRIVATE void CheckInitialFile ARGS ((void));
- PRIVATE int CalculateNextTime ARGS ((QueuedRem *q));
- PRIVATE QueuedRem *FindNextReminder ARGS ((void));
- + PRIVATE int CalculateNextTimeUsingSched ARGS ((QueuedRem *q));
- +
- + #ifdef __OS2__
- + void (__cdecl SigIntHandler(int));
- + #else
- PRIVATE void SigIntHandler ARGS ((void));
- + #endif
-
- /***************************************************************/
- /* */
- ***************
- *** 56,67 ****
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PUBLIC int QueueReminder(ParsePtr p, int typ, TimeTrig *tim)
- #else
- ! int QueueReminder(p, typ, tim)
- ParsePtr p;
- int typ;
- TimeTrig *tim;
- #endif
- {
- QueuedRem *qelem;
- --- 72,84 ----
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PUBLIC int QueueReminder(ParsePtr p, int typ, TimeTrig *tim, const char *sched)
- #else
- ! int QueueReminder(p, typ, tim, sched)
- ParsePtr p;
- int typ;
- TimeTrig *tim;
- + char *sched;
- #endif
- {
- QueuedRem *qelem;
- ***************
- *** 85,90 ****
- --- 102,109 ----
- qelem->tt = *tim;
- qelem->next = QueueHead;
- qelem->RunDisabled = RunDisabled;
- + qelem->ntrig = 0;
- + strcpy(qelem->sched, sched);
- QueueHead = qelem;
- NumQueued++;
- return OK;
- ***************
- *** 191,196 ****
- --- 210,218 ----
- /* */
- /* Calculate the next time when a reminder should be issued. */
- /* Return NO_TIME if reminder expired. */
- + /* Strategy is: If a sched() function is defined, call it. */
- + /* Otherwise, use AT time with delta and rep. If sched() */
- + /* fails, revert to AT with delta and rep. */
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ***************
- *** 204,210 ****
- --- 226,239 ----
- int rep = q->tt.rep;
- int delta = q->tt.delta;
- int curtime = q->tt.nexttime+1;
- + int r;
-
- + /* Increment number of times this one has been triggered */
- + q->ntrig++;
- + if (q->sched[0]) {
- + r = CalculateNextTimeUsingSched(q);
- + if (r != NO_TIME) return r;
- + }
- if (delta == NO_DELTA)
- if (tim < curtime) return NO_TIME; else return tim;
-
- ***************
- *** 253,263 ****
- --- 282,296 ----
- /* command-line flag is supplied. */
- /* */
- /***************************************************************/
- + #ifdef __OS2__
- + void __cdecl SigIntHandler(int d)
- + #else
- #ifdef HAVE_PROTOS
- PRIVATE void SigIntHandler(void)
- #else
- static void SigIntHandler()
- #endif
- + #endif
- {
- QueuedRem *q = QueueHead;
-
- ***************
- *** 269,278 ****
-
- while (q) {
- if (q->tt.nexttime != NO_TIME) {
- ! printf("Trigger: %02d%c%02d Activate: %02d%c%02d Rep: %d Delta: %d%s",
- q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
- q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
- ! q->tt.rep, q->tt.delta, NL);
- printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
- ((q->typ == MSF_TYPE) ? "MSF" :"RUN")),
- q->text,
- --- 302,311 ----
-
- while (q) {
- if (q->tt.nexttime != NO_TIME) {
- ! printf("Trigger: %02d%c%02d Activate: %02d%c%02d Rep: %d Delta: %d Sched: %s%s",
- q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
- q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
- ! q->tt.rep, q->tt.delta, q->sched, NL);
- printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
- ((q->typ == MSF_TYPE) ? "MSF" :"RUN")),
- q->text,
- ***************
- *** 306,308 ****
- --- 339,401 ----
- execvp(ArgV[0], ArgV);
- }
-
- + /***************************************************************/
- + /* */
- + /* CalculateNextTimeUsingSched */
- + /* */
- + /* Call the scheduling function. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PRIVATE int CalculateNextTimeUsingSched(QueuedRem *q)
- + #else
- + static int CalculateNextTimeUsingSched(q)
- + QueuedRem *q;
- + #endif
- + {
- + /* Use LineBuffer for temp. string storage. */
- + int r;
- + Value v;
- + char *s;
- + int LastTime = -1;
- + int ThisTime;
- +
- + if (UserFuncExists(q->sched) != 1) {
- + q->sched[0] = 0;
- + return NO_TIME;
- + }
- +
- + RunDisabled = q->RunDisabled; /* Don't want weird scheduling functions
- + to be a security hole! */
- + while(1) {
- + sprintf(LineBuffer, "%s(%d)", q->sched, q->ntrig);
- + s = LineBuffer;
- + r = EvalExpr(&s, &v);
- + if (r) {
- + q->sched[0] = 0;
- + return NO_TIME;
- + }
- + if (v.type == TIM_TYPE) {
- + ThisTime = v.v.val;
- + } else if (v.type == INT_TYPE) {
- + if (v.v.val > 0)
- + ThisTime = q->tt.nexttime + v.v.val;
- + else
- + ThisTime = q->tt.ttime + v.v.val;
- +
- + } else {
- + DestroyValue(&v);
- + q->sched[0] = 0;
- + return NO_TIME;
- + }
- + if (ThisTime < 0) ThisTime = 0; /* Can't be less than 00:00 */
- + if (ThisTime > 1439) ThisTime = 1439; /* or greater than 11:59 */
- + if (ThisTime > q->tt.nexttime) return ThisTime;
- + if (ThisTime <= LastTime) {
- + q->sched[0] = 0;
- + return NO_TIME;
- + }
- + LastTime = ThisTime;
- + q->ntrig++;
- + }
- + }
- *** ../prev/rem2ps.c Tue Sep 28 12:33:59 1993
- --- ./rem2ps.c Wed Oct 13 10:46:21 1993
- ***************
- *** 24,29 ****
- --- 24,33 ----
- #include <stdlib.h>
- #endif
-
- + #ifdef __TURBOC__
- + #include <io.h>
- + #endif
- +
- #ifdef HAVE_PROTOS
- #define ARGS(x) x
- #else
- ***************
- *** 183,189 ****
- int is_ps;
- CalEntry *c, *d;
-
- - printf("%%%%Page: %d %d\n", validfile, validfile);
- /* Read the month and year name, followed by # days in month and 1st day of
- month, followed by the MondayFirst flag */
- gets(LineBuffer);
- --- 187,192 ----
- ***************
- *** 195,200 ****
- --- 198,206 ----
- MaxDay = days;
- FirstWkDay = wkday;
-
- + printf("%%%%Page: %c%c%c%c%c %d\n", month[0], month[1], month[2],
- + year[2], year[3], validfile);
- +
- /* Emit PostScript to do the heading */
- if (!PortraitMode) printf("XSIZE 0 translate 90 rotate\n");
- printf("/SAVESTATE save def (%s) (%s) PreCal SAVESTATE restore\n", month, year);
- ***************
- *** 255,262 ****
- if (is_ps) {
- /* Save the 'P' or 'F' flag */
- *(c->entry) = *LineBuffer;
- ! c->next = PsEntries[DayNum];
- ! PsEntries[DayNum] = c;
- } else {
- /* Put on linked list */
- if (!CurEntries) CurEntries = c;
- --- 261,272 ----
- if (is_ps) {
- /* Save the 'P' or 'F' flag */
- *(c->entry) = *LineBuffer;
- ! if (!PsEntries[DayNum]) PsEntries[DayNum] = c;
- ! else {
- ! d = PsEntries[DayNum];
- ! while(d->next) d = d->next;
- ! d->next = c;
- ! }
- } else {
- /* Put on linked list */
- if (!CurEntries) CurEntries = c;
- *** ../prev/remind.1 Thu Sep 30 15:25:03 1993
- --- ./remind.1 Wed Oct 20 13:27:12 1993
- ***************
- *** 1,4 ****
- ! .TH REMIND 1 "30 September 1993"
- .UC 4
- .SH NAME
- remind \- a sophisticated reminder service
- --- 1,4 ----
- ! .TH REMIND 1 "13 October 1993"
- .UC 4
- .SH NAME
- remind \- a sophisticated reminder service
- ***************
- *** 119,130 ****
- Echo lines when displaying error messages
- .RE
- .TP
- ! \fB\-g\fR[\fBa|d\fR[\fBa|d\fR]]
- Normally, reminders are issued in the order in which they are encountered
- in the reminder script. The \fB\-g\fR option cause \fBRemind\fR to
- sort reminders by date and time prior to issuing them. The optional
- \fBa\fR and \fBd\fR characters specify the sort order (ascending or
- ! descending) for the date and time fields. See the section "Sorting
- Reminders" for more information.
- .TP
- \fB\-b\fR[\fIn\fR]
- --- 119,130 ----
- Echo lines when displaying error messages
- .RE
- .TP
- ! \fB\-g\fR[\fBa|d\fR[\fBa|d\fR[\fBa|d\fR]]]
- Normally, reminders are issued in the order in which they are encountered
- in the reminder script. The \fB\-g\fR option cause \fBRemind\fR to
- sort reminders by date and time prior to issuing them. The optional
- \fBa\fR and \fBd\fR characters specify the sort order (ascending or
- ! descending) for the date, time and priority fields. See the section "Sorting
- Reminders" for more information.
- .TP
- \fB\-b\fR[\fIn\fR]
- ***************
- *** 257,265 ****
- --- 257,267 ----
- [\fIback\fR]
- [\fIdelta\fR]
- [\fIrepeat\fR]
- + [\fBPRIORITY\fR \fIprio\fR]
- [\fBSKIP\fR | \fBBEFORE\fR | \fBAFTER\fR]
- [\fBOMIT\fR \fIomit_list\fR]
- [\fBAT\fR \fItime\fR [\fItdelta\fR] [\fItrepeat\fR]]
- + [\fBSCHED\fR \fIsched_function\fR]
- [\fBUNTIL\fR \fIexpiry_date\fR]
- [\fBSCANFROM\fR \fIscan_date\fR]
- \fBMSG\fR | \fBMSF\fR | \fBRUN\fR | \fBCAL\fR | \fBSATISFY\fR |
- ***************
- *** 602,607 ****
- --- 604,617 ----
- near the end of this manual. Note that \fBSCANFROM\fR is available only
- in versions of \fBRemind\fR from 03.00.04 up.
- .PP
- + .B PRIORITY
- + .PP
- + The \fBPRIORITY\fR keyword must be followed by a number from 0 to 9999.
- + It is used in calendar mode and when sorting reminders. If two reminders
- + have the same trigger date and time, then they are sorted by priority.
- + If the \fBPRIORITY\fR keyword is not supplied, a default priority of 5000
- + is used.
- + .PP
- .B EXPIRY DATES
- .PP
- Some reminders should be issued periodically for a certain time, but then
- ***************
- *** 767,772 ****
- --- 777,789 ----
- \fInot\fR necessarily be those which were in effect at the time the reminder
- was queued.
- .PP
- + .B THE SCHED KEYWORD
- + .PP
- + The \fBSCHED\fR keyword allows more precise control over the triggering
- + of timed reminders. However, discussion must be deferred until after
- + expressions and user-defined functions are explained. See the subsection
- + "Precise Scheduling" further on.
- + .PP
- .SH THE SUBSTITUTION FILTER
- .PP
- Before being processed, the body of a
- ***************
- *** 1503,1512 ****
- .TP
- .B $CalcUTC
- If 1 (the default), then \fBRemind\fR uses C library functions
- ! to calculate the number of minutes between local and universal time.
- This affects astronomical calculations (\fBsunrise()\fR for example.)
- If 0, then you must supply the number of minutes between local and
- ! universal time in the \fB$MinsFromUTC\fR system variable.
- .TP
- .B $CalMode (read-only)
- If non-zero, then the \fB\-c\fR option was supplied on the command line.
- --- 1520,1530 ----
- .TP
- .B $CalcUTC
- If 1 (the default), then \fBRemind\fR uses C library functions
- ! to calculate the number of minutes between local and Universal Time
- ! Coordinated.
- This affects astronomical calculations (\fBsunrise()\fR for example.)
- If 0, then you must supply the number of minutes between local and
- ! Universal Time Coordinated in the \fB$MinsFromUTC\fR system variable.
- .TP
- .B $CalMode (read-only)
- If non-zero, then the \fB\-c\fR option was supplied on the command line.
- ***************
- *** 1613,1619 ****
- (described later.) Must be at least 10.
- .TP
- .B $MinsFromUTC
- ! The number of minutes between Universal Time and local time. If
- \fB$CalcUTC\fR is non-zero, this is calculated upon startup of \fBRemind\fR.
- Otherwise, you must set it explicitly. If \fB$CalcUTC\fR is zero,
- then \fB$MinsFromUTC\fR is used in the astronomical calculations. You
- --- 1631,1637 ----
- (described later.) Must be at least 10.
- .TP
- .B $MinsFromUTC
- ! The number of minutes between Universal Time Coordinated and local time. If
- \fB$CalcUTC\fR is non-zero, this is calculated upon startup of \fBRemind\fR.
- Otherwise, you must set it explicitly. If \fB$CalcUTC\fR is zero,
- then \fB$MinsFromUTC\fR is used in the astronomical calculations. You
- ***************
- *** 1656,1661 ****
- --- 1674,1691 ----
- Set to a non-zero value if \fIeither\fR of the \fB\-p\fR or \fB\-s\fR
- command-line options was supplied.
- .TP
- + .B $SortByDate (read-only)
- + Set to 0 if no \fB\-g\fR option is used, 1 if sorting by date in ascending
- + order, or 2 if sorting by date in descending order.
- + .TP
- + .B $SortByPrio (read-only)
- + Set to 0 if no \fB\-g\fR option is used, 1 if sorting by priority in ascending
- + order, or 2 if sorting by priority in descending order.
- + .TP
- + .B $SortByTime (read-only)
- + Set to 0 if no \fB\-g\fR option is used, 1 if sorting by time in ascending
- + order, or 2 if sorting by time in descending order.
- + .TP
- .B $SubsIndent
- The number of spaces by which all lines (except the first) of an
- \fBMSF\fR-type reminder should be indented. The default is 0.
- ***************
- *** 1935,1944 ****
- as with the < operator.
- .TP
- .B minsfromutc([d_date [,t_time]])
- ! Returns the number of minutes from Universal Time (formerly GMT) to
- local time on the specified date and time. \fIDate\fR defaults to
- \fBtoday()\fR and \fItime\fR defaults to midnight. If local time
- ! is before UT, the result is negative. Otherwise, the result is
- positive.
- .RS
- .PP
- --- 1965,1975 ----
- as with the < operator.
- .TP
- .B minsfromutc([d_date [,t_time]])
- ! Returns the number of minutes from Universal Time Coordinated
- ! (formerly GMT) to
- local time on the specified date and time. \fIDate\fR defaults to
- \fBtoday()\fR and \fItime\fR defaults to midnight. If local time
- ! is before UTC, the result is negative. Otherwise, the result is
- positive.
- .RS
- .PP
- ***************
- *** 1982,1989 ****
- quarter, 2 full moon, and 3 third quarter. If \fIdate\fR is omitted,
- it defaults to \fBtoday()\fR. If \fItime\fR is omitted, it defaults
- to midnight. \fBMoontime()\fR is intended to be used in conjunction
- ! with \fBmoondate()\fR. Don't take the time too seriously - it's only
- ! accurate to within 15-20 minutes.
- .RS
- .PP
- For example, the following returns the date and time of the next full moon:
- --- 2013,2021 ----
- quarter, 2 full moon, and 3 third quarter. If \fIdate\fR is omitted,
- it defaults to \fBtoday()\fR. If \fItime\fR is omitted, it defaults
- to midnight. \fBMoontime()\fR is intended to be used in conjunction
- ! with \fBmoondate()\fR. The \fBmoondate()\fR and \fBmoontime()\fR
- ! functions are accurate to within a couple of minutes of the
- ! times in "Old Farmer's Almanac" for Ottawa, Ontario.
- .RS
- .PP
- For example, the following returns the date and time of the next full moon:
- ***************
- *** 2122,2131 ****
- or \fBIFTRIG\fR command. If used
- in the \fIbody\fR of a \fBREM\fR command, returns that command's trigger date.
- .TP
- ! .B trigger(d_date)
- Returns a string suitable for use in a \fBREM\fR command, allowing you to
- ! calculate trigger dates in advance. See the section "Expression pasting"
- ! for more information.
- .TP
- .B trigtime()
- Returns the time of the last \fBREM\fR command with an \fBAT\fR clause.
- --- 2154,2181 ----
- or \fBIFTRIG\fR command. If used
- in the \fIbody\fR of a \fBREM\fR command, returns that command's trigger date.
- .TP
- ! .B trigger(d_date [,t_time [,i_utcflag]])
- Returns a string suitable for use in a \fBREM\fR command, allowing you to
- ! calculate trigger dates in advance. (See the section "Expression pasting"
- ! for more information.) Normally, the \fIdate\fR and \fItime\fR are
- ! the local date and time; however, if \fIutcflag\fR is non-zero, the
- ! \fIdate\fR and \fItime\fR are interpreted as UTC times, and are
- ! converted to local time. Examples:
- ! .RS
- ! .PP
- ! trigger('1993/04/01')
- ! .PP
- ! returns "1 April 1993",
- ! .PP
- ! trigger('1994/08/09', 12:33)
- ! .PP
- ! returns "9 August 1994 AT 12:33", and
- ! .PP
- ! trigger('1994/12/01', 03:00, 1)
- ! .PP
- ! returns "30 November 1994 AT 22:00" for EST, which is 5 hours behind UTC.
- ! The value for your time zone may differ.
- ! .RE
- .TP
- .B trigtime()
- Returns the time of the last \fBREM\fR command with an \fBAT\fR clause.
- ***************
- *** 2410,2415 ****
- --- 2460,2533 ----
- functions), you may wish to name all user-defined functions beginning
- with an underscore.
- .PP
- + .SH PRECISE SCHEDULING
- + .PP
- + The \fBSCHED\fR keyword allows precise control over the scheduling of timed
- + reminders. It should be followed by the name of a user-defined function,
- + \fIsched_function\fR.
- + .PP
- + If a scheduling function is supplied, then it must take one argument of
- + type \fBINT\fR. Rather than using the \fBAT\fR time, time \fIdelta\fR, and
- + time \fIrepeat\fR, \fBRemind\fR calls the scheduling function to determine
- + when to trigger the reminder. The first time the reminder is queued, the
- + scheduling function is called with an argument of 1. Each time the reminder
- + is triggered, it is re-scheduled by calling the scheduling function again.
- + On each call, the argument is incremented by one.
- + .PP
- + The return value of the scheduling function must be an \fBINT\fR or a
- + \fBTIME\fR. If the return value is a \fBTIME\fR, then the reminder is
- + re-queued to trigger at that time. If it is a positive integer \fIn\fR,
- + then the reminder is re-queued to trigger at the previous trigger time
- + plus \fIn\fR minutes. Finally, if it is a negative integer or zero, then
- + the reminder is re-queued to trigger \fIn\fR minutes before the \fBAT\fR
- + time. Note that there must be an \fBAT\fR clause for the \fBSCHED\fR
- + clause to do anything.
- + .PP
- + Here's an example:
- + .PP
- + .nf
- + FSET _sfun(x) choose(x, -60, 30, 15, 10, 3, 1, 1, 1, 1, 0)
- + REM AT 13:00 SCHED _sfun MSG foo
- + .fi
- + .PP
- + The reminder would first be triggered at 13:00-60 minutes, or at 12:00.
- + It would next be triggered 30 minutes later, at 12:30. Then, it would
- + be triggered at 12:45, 12:55, 12:58, 12:59, 13:00, 13:01 and 13:02.
- + .PP
- + .B NOTES
- + .TP
- + 1
- + If an error occurs during the evaluation of \fIsched_func\fR, then
- + \fBRemind\fR reverts to using the \fBAT\fR time and the \fIdelta\fR
- + and \fIrepeat\fR values, and never calls \fIsched_func\fR again.
- + .TP
- + 2
- + If processing \fIsched_func\fR yields a time earlier than the current
- + system time, it is repeatedly called with increasing argument until it
- + yields a value greater than or equal to the current time. However, if
- + the sequence of values calculated during the repetition is not strictly
- + increasing, then \fBRemind\fR reverts to the default behaviour and
- + never calls \fIsched_func\fR again.
- + .TP
- + 3
- + It is quite possible using \fIsched_func\fR to keep triggering a reminder
- + even after the \fBAT\fR-time. However, it is not possible to reschedule
- + a reminder past midnight \- no crossing of date boundaries is allowed.
- + Also, it is quite possible to \fBnot\fR trigger a reminder on the \fBAT\fR
- + time when you use a scheduling function. However, if your scheduling
- + function is terminated (for reasons 1 and 2) before the \fBAT\fR time of
- + the reminder, it \fIwill\fR be triggered at the \fBAT\fR time, because
- + normal processing takes over.
- + .TP
- + 4
- + Your scheduling functions should (as a matter of good style) return
- + 0 when no more scheduling is required. See the example.
- + .TP
- + 5
- + All scheduling functions are evaluated \fIafter\fR the entire Remind
- + script has been read in. So whatever function definitions are in effect
- + at the end of the script are used.
- + .PP
- .SH THE SATISFY CLAUSE
- .PP
- The form of \fBREM\fR which uses \fBSATISFY\fR is as follows:
- ***************
- *** 2699,2705 ****
- Timed reminders are sorted and placed into the calendar in time order.
- These are followed by non-timed reminders. \fBRemind\fR automatically
- places the time of timed reminders in the calendar according to the
- ! \fB\-b\fR command-line option.
- .PP
- .B REPEATED EXECUTION
- .PP
- --- 2817,2826 ----
- Timed reminders are sorted and placed into the calendar in time order.
- These are followed by non-timed reminders. \fBRemind\fR automatically
- places the time of timed reminders in the calendar according to the
- ! \fB\-b\fR command-line option. Reminders in calendar mode are sorted as
- ! if the \fB\-g\fR option had been used; you can change the sort order
- ! in calendar mode by explicitly using the \fB\-g\fR option to specify
- ! a different order from the default.
- .PP
- .B REPEATED EXECUTION
- .PP
- ***************
- *** 2763,2770 ****
- the PostScript output.
- .PP
- The PostScript-type reminders for a particular day are included in the
- ! PostScript output in the same order they were triggered in the \fBRemind\fR
- ! script file. All of the PostScript code for a particular date is enclosed
- in a \fBsave\fR-\fBrestore\fR pair. However, if several PostScript-type
- reminders are triggered for a single day, each section of PostScript is
- not enclosed in a \fBsave\fR-\fBrestore\fR pair - instead, the entire
- --- 2884,2902 ----
- the PostScript output.
- .PP
- The PostScript-type reminders for a particular day are included in the
- ! PostScript output in sorted order of priority. Note that the order
- ! of PostScript commands has a \fImajor\fR impact on the appearance of the
- ! calendars. For example, PostScript code to shade a calendar box will
- ! obliterate code to draw a moon symbol if the moon symbol code is placed
- ! in the calendar first. For this reason, you should not provide \fBPS\fR
- ! or \fBPSFILE\fR-type reminders with priorities; instead, you should
- ! ensure that they appear in the reminder script in the correct order.
- ! PostScript code should draw objects working from the background to the
- ! foreground, so that foreground objects properly overlay background ones.
- ! If you prioritize these reminders and run the script using descending
- ! sort order for priorities, the PostScript output will not work.
- ! .PP
- ! All of the PostScript code for a particular date is enclosed
- in a \fBsave\fR-\fBrestore\fR pair. However, if several PostScript-type
- reminders are triggered for a single day, each section of PostScript is
- not enclosed in a \fBsave\fR-\fBrestore\fR pair - instead, the entire
- ***************
- *** 2855,2875 ****
- .SH SORTING REMINDERS
- .PP
- The \fB\-g\fR option causes \fBRemind\fR to sort reminders by
- ! trigger date and time before issuing them. Note that reminders are
- still calculated in the order encountered in the script. However, rather
- than being issued immediately, they are saved in an internal buffer.
- When \fBRemind\fR has finished processing the script, it issues the
- saved reminders in sorted order. The \fB\-g\fR option can be followed
- ! by one or two characters, which must be "a" or "d". The first character
- ! specifies the sort order by trigger date (ascending or descending) and
- ! the second specifies the sort order by trigger time. The default is
- ! to sort both fields in ascending order.
- .PP
- In ascending order, reminders are issued with the most imminent first.
- Descending order is the reverse. Reminders are always sorted by
- trigger date, and reminders with the same trigger date are then sorted
- by trigger time. Non-timed reminders are always issued after timed
- ! reminders in this mode.
- .PP
- You can define a user-defined function called SORTBANNER which takes one
- \fBDATE\fR-type argument. In sort mode, the following sequence happens:
- --- 2987,3010 ----
- .SH SORTING REMINDERS
- .PP
- The \fB\-g\fR option causes \fBRemind\fR to sort reminders by
- ! trigger date, time and priority before issuing them. Note that reminders are
- still calculated in the order encountered in the script. However, rather
- than being issued immediately, they are saved in an internal buffer.
- When \fBRemind\fR has finished processing the script, it issues the
- saved reminders in sorted order. The \fB\-g\fR option can be followed
- ! by up to three characters, which must be "a" or "d". The first character
- ! specifies the sort order by trigger date (ascending or descending),
- ! the second specifies the sort order by trigger time and the third
- ! specifies the sort order by priority. The default is
- ! to sort all fields in ascending order.
- .PP
- In ascending order, reminders are issued with the most imminent first.
- Descending order is the reverse. Reminders are always sorted by
- trigger date, and reminders with the same trigger date are then sorted
- by trigger time. Non-timed reminders are always issued after timed
- ! reminders in this mode. If two reminders have the same date and time,
- ! then the priority is used to break ties. Reminders with the same date,
- ! time and priority are issued in the order they were encountered.
- .PP
- You can define a user-defined function called SORTBANNER which takes one
- \fBDATE\fR-type argument. In sort mode, the following sequence happens:
- ***************
- *** 2926,2931 ****
- --- 3061,3121 ----
- endif
- .fi
- .PP
- + .SH MSGPREFIX() AND MSGSUFFIX()
- + .PP
- + You can define two functions in your script called \fBmsgprefix()\fR
- + and \fBmsgsuffix()\fR. They should each accept one argument, a number
- + from 0 to 9999.
- + .PP
- + In normal mode, for \fBMSG\fR- and \fBMSF\fR-type reminders,
- + the following sequence occurs when
- + \fBRemind\fR triggers a reminder:
- + .TP
- + o
- + If \fBmsgprefix()\fR is defined, it is evaluated with the priority
- + of the reminder as its argument. The result is printed. It is
- + \fInot\fR passed through the substitution filter.
- + .TP
- + o
- + The body of the reminder is printed.
- + .TP
- + o
- + If \fBmsgsuffix()\fR is defined, it is evaluated with the priority
- + of the reminder as its argument. The result is printed. It is
- + \fInot\fR passed through the substitution filter.
- + .PP
- + Here's an example: The following definition causes priority-0
- + reminders to be preceded by "URGENT", and priority-6000 reminders to
- + be preceded by "(not important)".
- + .PP
- + .nf
- + fset msgprefix(x) iif(x==0, "URGENT: ", \\
- + x==6000, "(not important) ", "")
- + .fi
- + .PP
- + In Calendar Mode (with the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR options),
- + an analagous pair of functions named \fBcalprefix()\fR and
- + \fBcalsuffix()\fR can be defined. They work with all reminders which
- + produce an entry in the calendar (i.e., \fBCAL\fR- and possibly
- + \fBRUN\fR-type reminders as well as \fBMSG\fR-type reminders.)
- + .PP
- + .B NOTES
- + .PP
- + Normally, the body of a reminder is followed by a carriage return.
- + Thus, the results of \fBmsgsuffix()\fR will appear on the next
- + line. If you don't want this, end the body of the reminder with a
- + percentage sign, "%". If you want a space between your reminders,
- + simply include a carriage return (\fBchar(13)\fR) as part of the
- + \fBmsgsuffix()\fR return value.
- + .PP
- + If \fBRemind\fR has problems evaluating \fBmsgprefix()\fR,
- + \fBmsgsuffix()\fR or \fBsortbanner()\fR, you will see a lot of
- + error messages. For an example of this, define the following:
- + .PP
- + .nf
- + fset msgprefix(x) x/0
- + .fi
- + .PP
- .SH FOREIGN LANGUAGE SUPPORT
- .PP
- Your version of \fBRemind\fR may have been compiled to support a
- ***************
- *** 2992,2998 ****
- .TP
- .B hebdate(i_day, s_hebmon [,id_yrstart [,i_jahr [,i_aflag]]])
- The \fBhebdate()\fR function is the most complex of the Hebrew support
- ! functions. It can take from 2 to 4 arguments. It returns a \fBDATE\fR
- corresponding to the Hebrew date.
- .PP
- .RS
- --- 3182,3188 ----
- .TP
- .B hebdate(i_day, s_hebmon [,id_yrstart [,i_jahr [,i_aflag]]])
- The \fBhebdate()\fR function is the most complex of the Hebrew support
- ! functions. It can take from 2 to 5 arguments. It returns a \fBDATE\fR
- corresponding to the Hebrew date.
- .PP
- .RS
- ***************
- *** 3307,3316 ****
- versions of \fBRemind\fR prior to 03.00.01.
- .SH AUTHOR
- .PP
- ! David F. Skoll wrote \fBRemind\fR. The moon code was copied largely verbatim
- ! from "moontool" by John Walker. The Hebrew calendar support was taken
- ! from "hdate" by Amos Shapir. The authors of the language files are
- ! listed in the header file "lang.h" which comes with \fBRemind\fR.
- .SH BUGS
- .PP
- There's no good reason why read-only system variables are not
- --- 3497,3508 ----
- versions of \fBRemind\fR prior to 03.00.01.
- .SH AUTHOR
- .PP
- ! David F. Skoll wrote \fBRemind\fR. The moon code was copied largely
- ! unmodified from "moontool" by John Walker. The Hebrew calendar
- ! support was taken from "hdate" by Amos Shapir. The authors of the
- ! language files are listed in the header file "lang.h" which comes with
- ! \fBRemind\fR. OS/2 support was provided initially by Darrel
- ! Hankerson; more complete OS/2 support was done by Russ Herman.
- .SH BUGS
- .PP
- There's no good reason why read-only system variables are not
- ***************
- *** 3321,3327 ****
- .PP
- The UTC functions are not reliable under MS-DOS.
- .PP
- ! The MS-DOS and OS/2 versions of \fBRemind\fR do not support queuing or timed
- activation of reminders.
- .PP
- \fBRemind\fR has some built-in limits on total line length,
- --- 3513,3519 ----
- .PP
- The UTC functions are not reliable under MS-DOS.
- .PP
- ! The MS-DOS version of \fBRemind\fR does not support queuing or timed
- activation of reminders.
- .PP
- \fBRemind\fR has some built-in limits on total line length,
- *** ../prev/sort.c Tue Aug 31 16:28:20 1993
- --- ./sort.c Tue Oct 19 11:19:14 1993
- ***************
- *** 33,44 ****
- int trigdate;
- int trigtime;
- int typ;
- } Sortrem;
-
- /* The sorted reminder queue */
- static Sortrem *SortedQueue = (Sortrem *) NULL;
-
- ! PRIVATE Sortrem *MakeSortRem ARGS ((int jul, int tim, char *body, int typ));
- PRIVATE void IssueSortBanner ARGS ((int jul));
-
- /***************************************************************/
- --- 33,45 ----
- int trigdate;
- int trigtime;
- int typ;
- + int priority;
- } Sortrem;
-
- /* The sorted reminder queue */
- static Sortrem *SortedQueue = (Sortrem *) NULL;
-
- ! PRIVATE Sortrem *MakeSortRem ARGS ((int jul, int tim, char *body, int typ, int prio));
- PRIVATE void IssueSortBanner ARGS ((int jul));
-
- /***************************************************************/
- ***************
- *** 49,60 ****
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PRIVATE Sortrem *MakeSortRem(int jul, int tim, char *body, int typ)
- #else
- ! static Sortrem *MakeSortRem(jul, tim, body, typ)
- int jul, tim;
- char *body;
- ! int typ;
- #endif
- {
- Sortrem *new = NEW(Sortrem);
- --- 50,61 ----
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PRIVATE Sortrem *MakeSortRem(int jul, int tim, char *body, int typ, int prio)
- #else
- ! static Sortrem *MakeSortRem(jul, tim, body, typ, prio)
- int jul, tim;
- char *body;
- ! int typ, prio;
- #endif
- {
- Sortrem *new = NEW(Sortrem);
- ***************
- *** 69,74 ****
- --- 70,76 ----
- new->trigdate = jul;
- new->trigtime = tim;
- new->typ = typ;
- + new->priority = prio;
- new->next = NULL;
- return new;
- }
- ***************
- *** 81,96 ****
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PUBLIC int InsertIntoSortBuffer(int jul, int tim, char *body, int typ)
- #else
- ! int InsertIntoSortBuffer(jul, tim, body, typ)
- int jul;
- int tim;
- char *body;
- ! int typ;
- #endif
- {
- ! Sortrem *new = MakeSortRem(jul, tim, body, typ);
- Sortrem *cur = SortedQueue, *prev = NULL;
- int ShouldGoAfter;
-
- --- 83,98 ----
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PUBLIC int InsertIntoSortBuffer(int jul, int tim, char *body, int typ, int prio)
- #else
- ! int InsertIntoSortBuffer(jul, tim, body, typ, prio)
- int jul;
- int tim;
- char *body;
- ! int typ, prio;
- #endif
- {
- ! Sortrem *new = MakeSortRem(jul, tim, body, typ, prio);
- Sortrem *cur = SortedQueue, *prev = NULL;
- int ShouldGoAfter;
-
- ***************
- *** 99,104 ****
- --- 101,107 ----
- IssueSortedReminders();
- SortByDate = 0;
- SortByTime = 0;
- + SortByPrio = 0;
- return E_NO_MEM;
- }
-
- ***************
- *** 108,126 ****
- return OK;
- }
- while (cur) {
- ! if (cur->trigdate == new->trigdate) {
- ! ShouldGoAfter =
- ! (SortByTime == SORT_ASCEND) ?
- ! (new->trigtime >= cur->trigtime) :
- ! ((new->trigtime == NO_TIME) || (new->trigtime <= cur->trigtime));
- ! } else {
- ! ShouldGoAfter =
- ! (SortByDate == SORT_ASCEND) ?
- ! (new->trigdate >= cur->trigdate) :
- ! (new->trigdate <= cur->trigdate);
- ! }
- !
- ! if (ShouldGoAfter) {
- prev = cur;
- cur = cur->next;
- } else {
- --- 111,121 ----
- return OK;
- }
- while (cur) {
- ! ShouldGoAfter = CompareRems(new->trigdate, new->trigtime, new->priority,
- ! cur->trigdate, cur->trigtime, cur->priority,
- ! SortByDate, SortByTime, SortByPrio);
- !
- ! if (ShouldGoAfter <= 0) {
- prev = cur;
- cur = cur->next;
- } else {
- ***************
- *** 160,183 ****
-
- while (cur) {
- next = cur->next;
- ! if (cur->typ == MSG_TYPE || cur->typ == MSF_TYPE) {
- ! if (!MsgCommand) {
- ! if (cur->trigdate != olddate) {
- ! IssueSortBanner(cur->trigdate);
- ! olddate = cur->trigdate;
- }
- ! if (cur->typ == MSG_TYPE)
- ! printf("%s\n", cur->text);
- ! else
- ! FillParagraph(cur->text);
- ! } else {
- ! char buf[LINELEN+TOKSIZE];
- ! sprintf(buf, MsgCommand, cur->text);
- ! system(buf);
- ! }
- ! } else { /* Must be RUN_TYPE */
- ! system(cur->text);
- }
- free(cur->text);
- free(cur);
- cur = next;
- --- 155,194 ----
-
- while (cur) {
- next = cur->next;
- ! switch(cur->typ) {
- ! case MSG_TYPE:
- ! if (MsgCommand) {
- ! char buf[LINELEN+TOKSIZE];
- ! sprintf(buf, MsgCommand, cur->text);
- ! system(buf);
- ! } else {
- ! if (cur->trigdate != olddate) {
- ! IssueSortBanner(cur->trigdate);
- ! olddate = cur->trigdate;
- ! }
- ! #ifdef __OS2__
- ! PutlPopUp(cur->text);
- ! #else
- ! printf("%s", cur->text);
- ! #endif
- }
- ! break;
- !
- ! case MSF_TYPE:
- ! #ifdef __OS2__
- ! StartPopUp();
- ! #endif
- ! FillParagraph(cur->text);
- ! #ifdef __OS2__
- ! EndPopUp();
- ! #endif
- ! break;
- !
- ! case RUN_TYPE:
- ! system(cur->text);
- ! break;
- }
- +
- free(cur->text);
- free(cur);
- cur = next;
- ***************
- *** 214,217 ****
- --- 225,267 ----
- if (!DoSubstFromString(v.v.str, SubstBuffer, jul, NO_TIME))
- if (*SubstBuffer) printf("%s\n", SubstBuffer);
- DestroyValue(&v);
- + }
- +
- + /***************************************************************/
- + /* */
- + /* CompareRems */
- + /* */
- + /* Compare two reminders for sorting. Return 0 if they */
- + /* compare equal; 1 if rem2 should come after rem1, -1 if */
- + /* rem1 should come after rem2. bydate and bytime control */
- + /* sorting direction by date and time, resp. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PUBLIC int CompareRems(int dat1, int tim1, int prio1,
- + int dat2, int tim2, int prio2,
- + int bydate, int bytime, int byprio)
- + #else
- + int CompareRems(dat1, tim1, prio1, dat2, tim2, prio2, bydate, bytime, byprio)
- + int dat1, tim1, prio1, dat2, tim2, prio2, bydate, bytime, byprio;
- + #endif
- + {
- + int dafter, tafter, pafter;
- +
- + dafter = (bydate != SORT_DESCEND) ? 1 : -1;
- + tafter = (bytime != SORT_DESCEND) ? 1 : -1;
- + pafter = (byprio != SORT_DESCEND) ? 1 : -1;
- +
- + if (dat1 < dat2) return dafter;
- + if (dat1 > dat2) return -dafter;
- +
- + if (tim1 == NO_TIME && tim2 != NO_TIME) return -1;
- + if (tim1 != NO_TIME && tim2 == NO_TIME) return 1;
- + if (tim1 < tim2) return tafter;
- + if (tim1 > tim2) return -tafter;
- +
- + if (prio1 < prio2) return pafter;
- + if (prio1 > prio2) return -pafter;
- +
- + return 0;
- }
- *** ../prev/test.cmp Tue Aug 31 13:22:46 1993
- --- ./test.cmp Tue Oct 12 16:22:53 1993
- ***************
- *** 631,637 ****
- "a05" + "6" => "a056"
- value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
- set a058 version()
- ! version() => "03.00.09"
- set a059 wkday(today())
- today() => 1991/02/16
- wkday(1991/02/16) => "Saturday"
- --- 631,637 ----
- "a05" + "6" => "a056"
- value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
- set a058 version()
- ! version() => "03.00.10"
- set a059 wkday(today())
- today() => 1991/02/16
- wkday(1991/02/16) => "Saturday"
- ***************
- *** 772,778 ****
- a048 "foo"
- a067 "INT"
- a039 "February"
- ! a058 "03.00.09"
- a077 "1992 92
- "
- a049 21
- --- 772,778 ----
- a048 "foo"
- a067 "INT"
- a039 "February"
- ! a058 "03.00.10"
- a077 "1992 92
- "
- a049 21
- *** ../prev/token.c Fri Sep 3 11:50:53 1993
- --- ./token.c Wed Oct 20 11:45:09 1993
- ***************
- *** 11,16 ****
- --- 11,17 ----
- /***************************************************************/
- #include "config.h"
- #include <stdio.h>
- + #include <string.h>
- #include <ctype.h>
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- ***************
- *** 77,82 ****
- --- 78,84 ----
- { "once", 3, T_Once, 0 },
- { "pop-omit-context", 3, T_Pop, 0 },
- { "preserve", 8, T_Preserve, 0 },
- + { "priority", 8, T_Priority, 0 },
- { "ps", 2, T_RemType, PS_TYPE },
- { "psfile", 6, T_RemType, PSF_TYPE },
- { "push-omit-context", 4, T_Push, 0 },
- ***************
- *** 85,90 ****
- --- 87,93 ----
- { "satisfy", 7, T_RemType, SAT_TYPE },
- { "saturday", 3, T_WkDay, 5 },
- { "scanfrom", 4, T_Scanfrom, 0 },
- + { "sched", 5, T_Sched, 0 },
- { "september", 3, T_Month, 8 },
- { "set", 3, T_Set, 0 },
- { "skip", 3, T_Skip, SKIP_SKIP },
- *** ../prev/types.h Fri Sep 3 11:50:48 1993
- --- ./types.h Wed Oct 20 11:50:55 1993
- ***************
- *** 52,57 ****
- --- 52,59 ----
- int typ;
- int once;
- int scanfrom;
- + int priority;
- + char sched[VAR_NAME_LEN+1]; /* Scheduling function */
- } Trigger;
-
- /* A time trigger */
- ***************
- *** 93,98 ****
- --- 95,102 ----
-
- #define NO_TIME 1500 /* >1440, ie > than the largest possible legal time */
-
- + #define NO_PRIORITY 5000 /* Default priority is midway between 0 and 9999 */
- +
- #define NO_TYPE 0
- #define MSG_TYPE 1
- #define RUN_TYPE 2
- ***************
- *** 127,133 ****
- T_Debug,
- T_Dumpvars,
- T_Scanfrom,
- ! T_Flush
- };
-
- /* The structure of a token */
- --- 131,139 ----
- T_Debug,
- T_Dumpvars,
- T_Scanfrom,
- ! T_Flush,
- ! T_Priority,
- ! T_Sched
- };
-
- /* The structure of a token */
- ***************
- *** 162,166 ****
- #define SC_NOTIME 2 /* Do not display time in SC format. */
-
- /* Flags for sorting */
- ! #define SORT_ASCEND 1
- #define SORT_DESCEND 2
- --- 168,173 ----
- #define SC_NOTIME 2 /* Do not display time in SC format. */
-
- /* Flags for sorting */
- ! #define SORT_NONE 0
- ! #define SORT_ASCEND 1
- #define SORT_DESCEND 2
- *** ../prev/var.c Tue Sep 28 16:16:07 1993
- --- ./var.c Thu Oct 14 10:21:45 1993
- ***************
- *** 474,479 ****
- --- 474,482 ----
- { "PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
- { "RunOff", 0, INT_TYPE, &RunDisabled, 0, 0 },
- { "SimpleCal", 0, INT_TYPE, &DoSimpleCalendar, 0, 0 },
- + { "SortByDate", 0, INT_TYPE, &SortByDate, 0, 0},
- + { "SortByPrio", 0, INT_TYPE, &SortByPrio, 0, 0},
- + { "SortByTime", 0, INT_TYPE, &SortByTime, 0, 0},
- { "SubsIndent", 1, INT_TYPE, &SubsIndent, 0, 132}
- };
-
-