home *** CD-ROM | disk | FTP | other *** search
- From: dfs@doe.carleton.ca (David F. Skoll)
- Newsgroups: comp.sources.misc
- Subject: v42i065: remind - A replacement for calendar, Patch13b/3
- Date: 6 May 1994 12:27:37 -0500
- Organization: Carleton University
- Sender: kent@sparky.sterling.com
- Approved: kent@sparky.sterling.com
- Message-ID: <2qdum9$itm@sparky.sterling.com>
- X-Md4-Signature: 4c86bb635aafc36341faac359d44ca59
-
- Submitted-by: dfs@doe.carleton.ca (David F. Skoll)
- Posting-number: Volume 42, Issue 65
- Archive-name: remind/patch13b
- Environment: UNIX, MS-DOS, OS/2
- Patch-To: remind: Volume 33, Issue 58-69
-
- #!/bin/sh
- # this is Shar.02 (part 2 of Remind-3.0/Patch-13/part)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file patch.13 continued
- #
- if touch 2>&1 | fgrep 'amc' > /dev/null
- then TOUCH=touch
- else TOUCH=true
- fi
- if test ! -r shar3_seq_.tmp; then
- echo "Please unpack part 1 first!"
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 2; then
- echo "Please unpack part $Scheck next!"
- exit 1
- else
- exit 0
- fi
- ) < shar3_seq_.tmp || exit 1
- echo "x - Continuing file patch.13"
- sed 's/^X//' << 'SHAR_EOF' >> patch.13 &&
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #ifdef MK_GLOBALS
- X--- 7,13 ----
- X /* MK_GLOBALS. Also contains useful macro definitions. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #ifdef MK_GLOBALS
- X***************
- X*** 56,61 ****
- X--- 56,62 ----
- X EXTERN INIT( int SortByDate, 0);
- X EXTERN INIT( int SortByPrio, 0);
- X EXTERN INIT( int DefaultPrio, NO_PRIORITY);
- X+ EXTERN INIT( long SysTime, -1L);
- X
- X EXTERN char *InitialFile;
- X EXTERN int FileAccessDate;
- X*** ../prev/hbcal.c Tue Oct 12 16:22:43 1993
- X--- ./hbcal.c Mon Jan 31 16:53:22 1994
- X***************
- X*** 5,11 ****
- X /* Support for the Hebrew calendar */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /* Derived from code written by Amos Shapir in 1978; revised */
- X /* 1985. */
- X--- 5,11 ----
- X /* Support for the Hebrew calendar */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll. */
- X /* */
- X /* Derived from code written by Amos Shapir in 1978; revised */
- X /* 1985. */
- X*** ../prev/init.c Mon Nov 15 14:25:30 1993
- X--- ./init.c Wed Apr 6 17:09:40 1994
- X***************
- X*** 7,13 ****
- X /* in normal mode. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #define L_IN_INIT 1
- X--- 7,13 ----
- X /* in normal mode. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #define L_IN_INIT 1
- X***************
- X*** 162,167 ****
- X--- 162,168 ----
- X NextMode = 1;
- X #ifdef HAVE_QUEUED
- X DontQueue = 1;
- X+ Daemon = 0;
- X #endif
- X break;
- X
- X***************
- X*** 362,367 ****
- X--- 363,379 ----
- X arg = argv[i++];
- X FindToken(arg, &tok);
- X switch (tok.type) {
- X+ case T_Time:
- X+ if (SysTime != -1L) Usage();
- X+ else {
- X+ SysTime = (long) tok.val * 60L;
- X+ #ifdef HAVE_QUEUED
- X+ DontQueue = 1;
- X+ Daemon = 0;
- X+ #endif
- X+ }
- X+ break;
- X+
- X case T_Month:
- X if (m != NO_MON) Usage();
- X else m = tok.val;
- X***************
- X*** 378,384 ****
- X break;
- X
- X case T_Rep:
- X! rep = tok.val;
- X break;
- X
- X default: Usage();
- X--- 390,397 ----
- X break;
- X
- X case T_Rep:
- X! if (rep != NO_REP) Usage();
- X! else rep = tok.val;
- X break;
- X
- X default: Usage();
- X***************
- X*** 392,425 ****
- X }
- X
- X /* Must supply date in the form: day, mon, yr OR mon, yr */
- X! if (m == NO_MON || y == NO_YR) {
- X! if (rep == NO_REP) Usage();
- X! else if (m != NO_MON || y != NO_YR) Usage();
- X! else {
- X! m = CurMon;
- X! y = CurYear;
- X! if (d == NO_DAY) d = CurDay;
- X! }
- X }
- X- if (d == NO_DAY) d=1;
- X- if (d > DaysInMonth(m, y)) {
- X- fprintf(ErrFp, BadDate);
- X- Usage();
- X- }
- X- JulianToday = Julian(y, m, d);
- X- if (JulianToday == -1) {
- X- fprintf(ErrFp, BadDate);
- X- Usage();
- X- }
- X- CurYear = y;
- X- CurMon = m;
- X- CurDay = d;
- X- if (JulianToday != RealToday) IgnoreOnce = 1;
- X
- X }
- X /* Figure out the offset from UTC */
- X if (CalculateUTC)
- X! (void) CalcMinsFromUTC(JulianToday, SystemTime()/60,
- X &MinsFromUTC, NULL);
- X }
- X
- X--- 405,440 ----
- X }
- X
- X /* Must supply date in the form: day, mon, yr OR mon, yr */
- X! if (m != NO_MON || y != NO_YR || d != NO_DAY) {
- X! if (m == NO_MON || y == NO_YR) {
- X! if (rep == NO_REP) Usage();
- X! else if (m != NO_MON || y != NO_YR) Usage();
- X! else {
- X! m = CurMon;
- X! y = CurYear;
- X! if (d == NO_DAY) d = CurDay;
- X! }
- X! }
- X! if (d == NO_DAY) d=1;
- X! if (d > DaysInMonth(m, y)) {
- X! fprintf(ErrFp, BadDate);
- X! Usage();
- X! }
- X! JulianToday = Julian(y, m, d);
- X! if (JulianToday == -1) {
- X! fprintf(ErrFp, BadDate);
- X! Usage();
- X! }
- X! CurYear = y;
- X! CurMon = m;
- X! CurDay = d;
- X! if (JulianToday != RealToday) IgnoreOnce = 1;
- X }
- X
- X }
- X /* Figure out the offset from UTC */
- X if (CalculateUTC)
- X! (void) CalcMinsFromUTC(JulianToday, SystemTime(1)/60,
- X &MinsFromUTC, NULL);
- X }
- X
- X***************
- X*** 437,447 ****
- X void Usage()
- X #endif /* HAVE_PROTOS */
- X {
- X! fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992, 1993 by David F. Skoll\n", VERSION, L_LANGNAME);
- X #ifdef BETA
- X fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
- X #endif
- X! fprintf(ErrFp, "Usage: remind [options] filename [date] [*rep]\n");
- X fprintf(ErrFp, "Options:\n");
- X fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
- X fprintf(ErrFp, " -r Disable RUN directives\n");
- X--- 452,462 ----
- X void Usage()
- X #endif /* HAVE_PROTOS */
- X {
- X! fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1994 by David F. Skoll\n", VERSION, L_LANGNAME);
- X #ifdef BETA
- X fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
- X #endif
- X! fprintf(ErrFp, "Usage: remind [options] filename [date] [time] [*rep]\n");
- X fprintf(ErrFp, "Options:\n");
- X fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
- X fprintf(ErrFp, " -r Disable RUN directives\n");
- X*** ../prev/lang.h Mon Jan 31 10:37:10 1994
- X--- ./lang.h Mon Jan 31 16:53:00 1994
- X***************
- X*** 5,11 ****
- X /* Header file for language support for various languages. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X--- 5,11 ----
- X /* Header file for language support for various languages. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X*** ../prev/main.c Mon Jan 31 10:34:45 1994
- X--- ./main.c Wed Apr 6 16:47:12 1994
- X***************
- X*** 6,12 ****
- X /* routines, etc. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X--- 6,12 ----
- X /* routines, etc. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X***************
- X*** 107,113 ****
- X
- X if (!Hush) {
- X if (DestroyOmitContexts())
- X! Eprint("%s", E_PUSH_NOPOP);
- X #ifdef HAVE_QUEUED
- X if (!Daemon && !NextMode && !NumTriggered && !NumQueued) printf("%s\n", ErrMsg[E_NOREMINDERS]);
- X else
- X--- 107,113 ----
- X
- X if (!Hush) {
- X if (DestroyOmitContexts())
- X! Eprint("%s", ErrMsg[E_PUSH_NOPOP]);
- X #ifdef HAVE_QUEUED
- X if (!Daemon && !NextMode && !NumTriggered && !NumQueued) printf("%s\n", ErrMsg[E_NOREMINDERS]);
- X else
- X***************
- X*** 708,716 ****
- X /* */
- X /***************************************************************/
- X #ifdef HAVE_PROTOS
- X! PUBLIC long SystemTime(void)
- X #else
- X! long SystemTime()
- X #endif
- X {
- X #if defined( __MSDOS__ ) && defined( __TURBOC__ )
- X--- 708,717 ----
- X /* */
- X /***************************************************************/
- X #ifdef HAVE_PROTOS
- X! PUBLIC long SystemTime(int realtime)
- X #else
- X! long SystemTime(realtime)
- X! int realtime;
- X #endif
- X {
- X #if defined( __MSDOS__ ) && defined( __TURBOC__ )
- X***************
- X*** 718,731 ****
- X
- X struct time t;
- X
- X gettime(&t);
- X return (long) t.ti_hour * 3600L + (long) t.ti_min * 60L +
- X (long) t.ti_sec;
- X #else
- X /* Get time in Unix or with MSC */
- X! time_t tloc;
- X! struct tm *t;
- X
- X (void) time(&tloc);
- X t = localtime(&tloc);
- X return (long) t->tm_hour * 3600L + (long) t->tm_min * 60L +
- X--- 719,737 ----
- X
- X struct time t;
- X
- X+ /* If time was supplied on command line, return it. */
- X+ if (!realtime && (SysTime != -1L)) return SysTime;
- X+
- X gettime(&t);
- X return (long) t.ti_hour * 3600L + (long) t.ti_min * 60L +
- X (long) t.ti_sec;
- X #else
- X /* Get time in Unix or with MSC */
- X! time_t tloc;
- X! struct tm *t;
- X
- X+ if (!realtime && (SysTime != -1L)) return SysTime;
- X+
- X (void) time(&tloc);
- X t = localtime(&tloc);
- X return (long) t->tm_hour * 3600L + (long) t->tm_min * 60L +
- X***************
- X*** 1149,1155 ****
- X char *s;
- X
- X t.typ = MSG_TYPE;
- X! tt.ttime = SystemTime() / 60;
- X if ( (r=DoSubst(p, SubstBuffer, &t, &tt, JulianToday, NORMAL_MODE)) )
- X return r;
- X s = SubstBuffer;
- X--- 1155,1161 ----
- X char *s;
- X
- X t.typ = MSG_TYPE;
- X! tt.ttime = SystemTime(0) / 60;
- X if ( (r=DoSubst(p, SubstBuffer, &t, &tt, JulianToday, NORMAL_MODE)) )
- X return r;
- X s = SubstBuffer;
- X*** ../prev/makefile.bcc Mon Jan 31 10:41:07 1994
- X--- ./makefile.bcc Mon Jan 31 16:48:22 1994
- X***************
- X*** 1,6 ****
- X # Makefile for REMIND for Borland C++
- X
- X! VERSION= 03.00.12
- X
- X MODEL=l
- X
- X--- 1,6 ----
- X # Makefile for REMIND for Borland C++
- X
- X! VERSION= 03.00.13
- X
- X MODEL=l
- X
- X*** ../prev/makefile.tc Mon Jan 31 10:40:39 1994
- X--- ./makefile.tc Mon Jan 31 16:48:13 1994
- X***************
- X*** 1,7 ****
- X # Makefile for REMIND for Turbo C for MSDOS
- X
- X CC= tcc
- X! VERSION= 03.00.12
- X
- X HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
- X lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \
- X--- 1,7 ----
- X # Makefile for REMIND for Turbo C for MSDOS
- X
- X CC= tcc
- X! VERSION= 03.00.13
- X
- X HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
- X lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \
- X*** ../prev/moon.c Mon Jan 31 10:29:38 1994
- X--- ./moon.c Mon Jan 31 17:03:20 1994
- X***************
- X*** 5,11 ****
- X /* Calculations for figuring out moon phases. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X--- 5,11 ----
- X /* Calculations for figuring out moon phases. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll */
- X /* */
- X /***************************************************************/
- X
- X*** ../prev/norwgian.h Tue Oct 12 16:22:49 1993
- X--- ./norwgian.h Mon Jan 31 17:03:14 1994
- X***************
- X*** 6,11 ****
- X--- 6,12 ----
- X /* */
- X /* This file is part of REMIND. */
- X /* This file is Copyright (C) 1993 by Trygve Randen. */
- X+ /* Remind is Copyright (C) 1992, 1993, 1994 by David F. Skoll */
- X /* */
- X /***************************************************************/
- X
- X*** ../prev/omit.c Tue Oct 12 16:22:49 1993
- X--- ./omit.c Mon Jan 31 17:02:47 1994
- X***************
- X*** 6,12 ****
- X /* the data structures for OMITted dates. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X--- 6,12 ----
- X /* the data structures for OMITted dates. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X*** ../prev/os2func.c Wed Nov 17 10:12:21 1993
- X--- ./os2func.c Mon Jan 31 17:02:43 1994
- X***************
- X*** 7,13 ****
- X /* This file is part of REMIND. */
- X /* */
- X /* This file is Copyright (C) 1993 by Russ Herman. */
- X! /* REMIND is Copyright (C) 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #ifdef OS2_POPUP
- X--- 7,13 ----
- X /* This file is part of REMIND. */
- X /* */
- X /* This file is Copyright (C) 1993 by Russ Herman. */
- X! /* REMIND is Copyright (C) 1993, 1994 by David F. Skoll */
- X /* */
- X /***************************************************************/
- X #ifdef OS2_POPUP
- X*** ../prev/polish.h Mon Jan 31 10:39:33 1994
- X--- ./polish.h Thu Apr 7 13:36:01 1994
- X***************
- X*** 396,407 ****
- X void Usage()
- X #endif /* HAVE_PROTOS */
- X {
- X! fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992, 1993 by David F. Skoll\n", VERSION, L_LANGNAME);
- X #ifdef BETA
- X fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
- X #endif
- X #ifdef ISOLATIN1
- X! fprintf(ErrFp, "\nSpos\363b u\277ycia: remind [opcje] plik [data] [*powt\363rzenie]\n");
- X fprintf(ErrFp, "Opcje:\n");
- X fprintf(ErrFp, " -n Wypisz nast\352pne przypomnienia w prostym formacie\n");
- X fprintf(ErrFp, " -r Zablokuj dyrektywy RUN\n");
- X--- 396,407 ----
- X void Usage()
- X #endif /* HAVE_PROTOS */
- X {
- X! fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1994 by David F. Skoll\n", VERSION, L_LANGNAME);
- X #ifdef BETA
- X fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
- X #endif
- X #ifdef ISOLATIN1
- X! fprintf(ErrFp, "\nSpos\363b u\277ycia: remind [opcje] plik [data] [czas] [*powt\363rzenie]\n");
- X fprintf(ErrFp, "Opcje:\n");
- X fprintf(ErrFp, " -n Wypisz nast\352pne przypomnienia w prostym formacie\n");
- X fprintf(ErrFp, " -r Zablokuj dyrektywy RUN\n");
- X***************
- X*** 429,435 ****
- X fprintf(ErrFp, " -ivar=val Zainicjuj zmienn\261 var warto\266cia val i zachowaj ja\n");
- X fprintf(ErrFp, " -m Rozpocznij kalendarz od poniedzia\263ku zamiast od niedzieli\n");
- X #else /* ISOLATIN1 */
- X! fprintf(ErrFp, "\nSposob uzycia: remind [opcje] plik [data] [*powtorzenie]\n");
- X fprintf(ErrFp, "Opcje:\n");
- X fprintf(ErrFp, " -n Wypisz nastepne przypomnienia w prostym formacie\n");
- X fprintf(ErrFp, " -r Zablokuj dyrektywy RUN\n");
- X--- 429,435 ----
- X fprintf(ErrFp, " -ivar=val Zainicjuj zmienn\261 var warto\266cia val i zachowaj ja\n");
- X fprintf(ErrFp, " -m Rozpocznij kalendarz od poniedzia\263ku zamiast od niedzieli\n");
- X #else /* ISOLATIN1 */
- X! fprintf(ErrFp, "\nSposob uzycia: remind [opcje] plik [data] [czas] [*powtorzenie]\n");
- X fprintf(ErrFp, "Opcje:\n");
- X fprintf(ErrFp, " -n Wypisz nastepne przypomnienia w prostym formacie\n");
- X fprintf(ErrFp, " -r Zablokuj dyrektywy RUN\n");
- X*** ../prev/protos.h Mon Jan 31 10:35:37 1994
- X--- ./protos.h Wed Apr 6 16:46:17 1994
- X***************
- X*** 5,11 ****
- X /* Function Prototypes. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #ifdef HAVE_PROTOS
- X--- 5,11 ----
- X /* Function Prototypes. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll */
- X /* */
- X /***************************************************************/
- X #ifdef HAVE_PROTOS
- X***************
- X*** 43,49 ****
- X int DoSubstFromString ARGS ((char *source, char *dest, int jul, int tim));
- X int EvalExpr ARGS ((char **e, Value *v));
- X int DoCoerce ARGS ((char type, Value *v));
- X- void DestroyValue ARGS ((Value *v));
- X void PrintValue ARGS ((Value *v, FILE *fp));
- X int CopyValue ARGS ((Value *dest, const Value *src));
- X int ReadLine ARGS ((void));
- X--- 43,48 ----
- X***************
- X*** 71,77 ****
- X void CreateParser ARGS ((char *s, ParsePtr p));
- X void DestroyParser ARGS ((ParsePtr p));
- X void PushToken ARGS ((const char *tok));
- X! long SystemTime ARGS ((void));
- X int SystemDate ARGS ((int *y, int *m, int *d));
- X int DoIf ARGS ((ParsePtr p));
- X int DoElse ARGS ((ParsePtr p));
- X--- 70,76 ----
- X void CreateParser ARGS ((char *s, ParsePtr p));
- X void DestroyParser ARGS ((ParsePtr p));
- X void PushToken ARGS ((const char *tok));
- X! long SystemTime ARGS ((int realtime));
- X int SystemDate ARGS ((int *y, int *m, int *d));
- X int DoIf ARGS ((ParsePtr p));
- X int DoElse ARGS ((ParsePtr p));
- X***************
- X*** 113,118 ****
- X--- 112,118 ----
- X int PreserveVar ARGS ((char *name));
- X int DoPreserve ARGS ((Parser *p));
- X int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
- X+ void DoMsgCommand ARGS ((char *cmd, char *msg));
- X int ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
- X unsigned int HashVal ARGS ((const char *str));
- X int DateOK ARGS ((int y, int m, int d));
- X*** ../prev/queue.c Wed Nov 17 12:56:07 1993
- X--- ./queue.c Wed Apr 6 16:45:51 1994
- X***************
- X*** 5,11 ****
- X /* Queue up reminders for subsequent execution. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X--- 5,11 ----
- X /* Queue up reminders for subsequent execution. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X***************
- X*** 86,92 ****
- X if (DontQueue ||
- X tim->ttime == NO_TIME ||
- X typ == CAL_TYPE ||
- X! tim->ttime < SystemTime() / 60 ||
- X ((typ == RUN_TYPE) && RunDisabled)) return OK;
- X
- X qelem = NEW(QueuedRem);
- X--- 86,92 ----
- X if (DontQueue ||
- X tim->ttime == NO_TIME ||
- X typ == CAL_TYPE ||
- X! tim->ttime < SystemTime(0) / 60 ||
- X ((typ == RUN_TYPE) && RunDisabled)) return OK;
- X
- X qelem = NEW(QueuedRem);
- X***************
- X*** 157,163 ****
- X /* Initialize the queue - initialize all the entries time of issue */
- X
- X while (q) {
- X! q->tt.nexttime = (int) (SystemTime()/60 - 1);
- X q->tt.nexttime = CalculateNextTime(q);
- X q = q->next;
- X }
- X--- 157,163 ----
- X /* Initialize the queue - initialize all the entries time of issue */
- X
- X while (q) {
- X! q->tt.nexttime = (int) (SystemTime(0)/60 - 1);
- X q->tt.nexttime = CalculateNextTime(q);
- X q = q->next;
- X }
- X***************
- X*** 178,184 ****
- X if (Daemon && !q)
- X TimeToSleep = (long) 60*Daemon;
- X else
- X! TimeToSleep = (long) q->tt.nexttime * 60L - SystemTime();
- X
- X while (TimeToSleep > 0L) {
- X SleepTime = (unsigned) ((TimeToSleep > 30000L) ? 30000 : TimeToSleep);
- X--- 178,184 ----
- X if (Daemon && !q)
- X TimeToSleep = (long) 60*Daemon;
- X else
- X! TimeToSleep = (long) q->tt.nexttime * 60L - SystemTime(0);
- X
- X while (TimeToSleep > 0L) {
- X SleepTime = (unsigned) ((TimeToSleep > 30000L) ? 30000 : TimeToSleep);
- X***************
- X*** 192,198 ****
- X if (Daemon && !q)
- X TimeToSleep = (long) 60*Daemon;
- X else
- X! TimeToSleep = (long) q->tt.nexttime * 60L - SystemTime();
- X }
- X
- X /* Trigger the reminder */
- X--- 192,198 ----
- X if (Daemon && !q)
- X TimeToSleep = (long) 60*Daemon;
- X else
- X! TimeToSleep = (long) q->tt.nexttime * 60L - SystemTime(0);
- X }
- X
- X /* Trigger the reminder */
- X*** ../prev/rem2ps.1 Tue Oct 12 16:22:50 1993
- X--- ./rem2ps.1 Wed Feb 2 11:28:54 1994
- X***************
- X*** 1,4 ****
- X! .TH REM2PS 1 "30 September 1993"
- X .UC4
- X .SH NAME
- X rem2ps \- draw a PostScript calendar from Remind output
- X--- 1,4 ----
- X! .TH REM2PS 1 "2 February 1994"
- X .UC4
- X .SH NAME
- X rem2ps \- draw a PostScript calendar from Remind output
- X***************
- X*** 9,14 ****
- X--- 9,18 ----
- X \fBRemind\fR with the \fB\-p\fR option. It emits PostScript code (which
- X draws a calendar) to the standard output.
- X .SH OPTIONS
- X+ .TP
- X+ .B \-v
- X+ Be more verbose. This causes \fBRem2ps\fR to print progress messages
- X+ to the standard error stream. Normally, it is silent.
- X .TP
- X .B \-n
- X Produce a calendar whose first column is Monday (rather than Sunday.)
- X*** ../prev/rem2ps.c Wed Oct 13 10:46:21 1993
- X--- ./rem2ps.c Mon Apr 18 10:17:29 1994
- X***************
- X*** 5,11 ****
- X /* Print a PostScript calendar. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X--- 5,11 ----
- X /* Print a PostScript calendar. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X***************
- X*** 17,22 ****
- X--- 17,23 ----
- X #include <unistd.h>
- X #endif
- X #include "rem2ps.h"
- X+ #include "version.h"
- X #ifdef HAVE_MALLOC_H
- X #include <malloc.h>
- X #endif
- X***************
- X*** 117,122 ****
- X--- 118,124 ----
- X int MondayFirst;
- X int LeftMarg, RightMarg, TopMarg, BotMarg;
- X int FillPage;
- X+ int Verbose = 0;
- X
- X void Init ARGS ((int argc, char *argv[]));
- X void Usage ARGS ((char *s));
- X***************
- X*** 153,170 ****
- X while (!feof(stdin)) {
- X gets(LineBuffer);
- X if (!strcmp(LineBuffer, PSBEGIN)) {
- X! if (!validfile) WriteProlog();
- X validfile++;
- X DoPsCal();
- X }
- X }
- X if (!validfile) {
- X! fprintf(stderr, "rem2ps: Couldn't find any calendar data - are you\n");
- X fprintf(stderr, " sure you fed me input produced by remind -p ...?\n");
- X exit(1);
- X }
- X printf("%%%%Trailer\n");
- X printf("%%%%Pages: %d\n", validfile);
- X return 0;
- X }
- X
- X--- 155,179 ----
- X while (!feof(stdin)) {
- X gets(LineBuffer);
- X if (!strcmp(LineBuffer, PSBEGIN)) {
- X! if (!validfile) {
- X! if (Verbose) {
- X! fprintf(stderr, "Rem2PS: Version %s Copyright 1992-1994 by David F. Skoll\n\n", VERSION);
- X! fprintf(stderr, "Generating PostScript calendar\n");
- X! }
- X! WriteProlog();
- X! }
- X validfile++;
- X DoPsCal();
- X }
- X }
- X if (!validfile) {
- X! fprintf(stderr, "Rem2PS: Couldn't find any calendar data - are you\n");
- X fprintf(stderr, " sure you fed me input produced by remind -p ...?\n");
- X exit(1);
- X }
- X printf("%%%%Trailer\n");
- X printf("%%%%Pages: %d\n", validfile);
- X+ if (Verbose) fprintf(stderr, "Rem2PS: Done\n");
- X return 0;
- X }
- X
- X***************
- X*** 185,194 ****
- X int sfirst;
- X int i;
- X int is_ps;
- X CalEntry *c, *d;
- X
- X /* Read the month and year name, followed by # days in month and 1st day of
- X! month, followed by the MondayFirst flag */
- X gets(LineBuffer);
- X sscanf(LineBuffer, "%s %s %d %d", month, year, &days, &wkday);
- X gets(LineBuffer);
- X--- 194,205 ----
- X int sfirst;
- X int i;
- X int is_ps;
- X+ int firstcol;
- X+
- X CalEntry *c, *d;
- X
- X /* Read the month and year name, followed by # days in month and 1st day of
- X! month */
- X gets(LineBuffer);
- X sscanf(LineBuffer, "%s %s %d %d", month, year, &days, &wkday);
- X gets(LineBuffer);
- X***************
- X*** 198,203 ****
- X--- 209,217 ----
- X MaxDay = days;
- X FirstWkDay = wkday;
- X
- X+ /* Print a message for the user */
- X+ if (Verbose) fprintf(stderr, " %s %s\n", month, year);
- X+
- X printf("%%%%Page: %c%c%c%c%c %d\n", month[0], month[1], month[2],
- X year[2], year[3], validfile);
- X
- X***************
- X*** 206,218 ****
- X printf("/SAVESTATE save def (%s) (%s) PreCal SAVESTATE restore\n", month, year);
- X printf("(%s %s) doheading\n", month, year);
- X
- X /* Calculate the minimum box size */
- X if (!FillPage) {
- X printf("/MinBoxSize ytop MinY sub 7 div def\n");
- X } else {
- X! if ((days == 31 && wkday >= 5) || (days == 30 && wkday == 6))
- X printf("/MinBoxSize ytop MinY sub 6 div def\n");
- X! else if (days == 28 && wkday == 0 && NoSmallCal)
- X printf("/MinBoxSize ytop MinY sub 4 div def\n");
- X else
- X printf("/MinBoxSize ytop MinY sub 5 div def\n");
- X--- 220,241 ----
- X printf("/SAVESTATE save def (%s) (%s) PreCal SAVESTATE restore\n", month, year);
- X printf("(%s %s) doheading\n", month, year);
- X
- X+ /* Figure out the column of the first day in the calendar */
- X+
- X+ if (MondayFirst) {
- X+ firstcol = wkday-1;
- X+ if (firstcol < 0) firstcol = 6;
- X+ } else {
- X+ firstcol = wkday;
- X+ }
- X+
- X /* Calculate the minimum box size */
- X if (!FillPage) {
- X printf("/MinBoxSize ytop MinY sub 7 div def\n");
- X } else {
- X! if ((days == 31 && firstcol >= 5) || (days == 30 && firstcol == 6))
- X printf("/MinBoxSize ytop MinY sub 6 div def\n");
- X! else if (days == 28 && firstcol == 0 && NoSmallCal)
- X printf("/MinBoxSize ytop MinY sub 4 div def\n");
- X else
- X printf("/MinBoxSize ytop MinY sub 5 div def\n");
- X***************
- X*** 616,621 ****
- X--- 639,648 ----
- X }
- X break;
- X
- X+ case 'v':
- X+ Verbose = 1;
- X+ break;
- X+
- X case 'm':
- X if (i == argc) Usage("Media must be supplied");
- X t = argv[i++];
- X***************
- X*** 698,708 ****
- X char *s;
- X #endif
- X {
- X! if (s) fprintf(stderr, "\nrem2ps: %s\n\n", s);
- X
- X fprintf(stderr, "Rem2PS: Produce a PostScript calendar from output of Remind.\n\n");
- X fprintf(stderr, "Usage: rem2ps [options]\n\n");
- X fprintf(stderr, "Options:\n\n");
- X fprintf(stderr, "-p file Include user-supplied PostScript code in prologue\n");
- X fprintf(stderr, "-l Do calendar in landscape mode\n");
- X fprintf(stderr, "-c[n] Control small calendars: 0=none; 1=bt; 2=tb; 3=sbt\n");
- X--- 725,736 ----
- X char *s;
- X #endif
- X {
- X! if (s) fprintf(stderr, "Rem2PS: %s\n\n", s);
- X
- X fprintf(stderr, "Rem2PS: Produce a PostScript calendar from output of Remind.\n\n");
- X fprintf(stderr, "Usage: rem2ps [options]\n\n");
- X fprintf(stderr, "Options:\n\n");
- X+ fprintf(stderr, "-v Print progress messages to standard error\n");
- X fprintf(stderr, "-p file Include user-supplied PostScript code in prologue\n");
- X fprintf(stderr, "-l Do calendar in landscape mode\n");
- X fprintf(stderr, "-c[n] Control small calendars: 0=none; 1=bt; 2=tb; 3=sbt\n");
- X*** ../prev/rem2ps.h Tue Oct 12 16:22:50 1993
- X--- ./rem2ps.h Mon Jan 31 17:02:22 1994
- X***************
- X*** 5,11 ****
- X /* Define the PostScript prologue */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X--- 5,11 ----
- X /* Define the PostScript prologue */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll */
- X /* */
- X /***************************************************************/
- X
- X*** ../prev/remind-all.sh Tue Oct 12 16:22:51 1993
- X--- ./remind-all.sh Mon Jan 31 17:02:16 1994
- X***************
- X*** 2,8 ****
- X
- X # This file is part of REMIND
- X #
- X! # REMIND is Copyright (C) 1992, 1993 by David F. Skoll
- X # This file is Copyright (C) 1990 by Bill Aten
- X
- X # Thanks to Bill Aten for this script.
- X--- 2,8 ----
- X
- X # This file is part of REMIND
- X #
- X! # REMIND is Copyright (C) 1992, 1993, 1994 by David F. Skoll
- X # This file is Copyright (C) 1990 by Bill Aten
- X
- X # Thanks to Bill Aten for this script.
- X*** ../prev/remind.1 Mon Jan 31 11:01:39 1994
- X--- ./remind.1 Thu Apr 7 12:39:49 1994
- X***************
- X*** 1,9 ****
- X! .TH REMIND 1 "31 January 1994"
- X .UC 4
- X .SH NAME
- X remind \- a sophisticated reminder service
- X .SH SYNOPSIS
- X! .B remind [\fIoptions\fR] \fIfilename\fR [\fIdate\fR]
- X .SH DESCRIPTION
- X \fBRemind\fR reads the supplied \fIfilename\fR and executes the commands
- X found in it. The commands are used to issue reminders and alarms. Each
- X--- 1,9 ----
- X! .TH REMIND 1 "6 April 1994"
- X .UC 4
- X .SH NAME
- X remind \- a sophisticated reminder service
- X .SH SYNOPSIS
- X! .B remind [\fIoptions\fR] \fIfilename\fR [\fIdate\fR] [\fI*rep\fR] [\fItime\fR]
- X .SH DESCRIPTION
- X \fBRemind\fR reads the supplied \fIfilename\fR and executes the commands
- X found in it. The commands are used to issue reminders and alarms. Each
- X***************
- X*** 139,149 ****
- X command. Defaults to 150.
- X .TP
- X \fB\-k\fR\fIcmd\fR
- X! Instead of simply printing \fBMSG\fR-type reminders, this causes them to be
- X! passed to the specific \fIcmd\fR. You must use '%s' where you want the body to
- X! appear, and may need to enclose this option in quotes. Also, because
- X! \fIcmd\fR is run using the \fBsystem()\fR library function, shell quotes in
- X! the body of the message may cause problems. Note that this option
- X \fBoverrides\fR the \fB\-r\fR option and the \fBRUN OFF\fR command.
- X .PP
- X .RS
- X--- 139,150 ----
- X command. Defaults to 150.
- X .TP
- X \fB\-k\fR\fIcmd\fR
- X! Instead of simply printing \fBMSG\fR-type
- X! reminders, this causes them to be passed to the specific \fIcmd\fR.
- X! You must use '%s' where you want the body to appear, and may need to
- X! enclose this option in quotes. Note that all shell characters in the
- X! body of the reminder are escaped with a backslash, and the entire body
- X! of the reminder is passed as a single argument. Note that this option
- X \fBoverrides\fR the \fB\-r\fR option and the \fBRUN OFF\fR command.
- X .PP
- X .RS
- X***************
- X*** 160,175 ****
- X with the above technique. So be very careful. Also, the \fIcmd\fR is passed
- X as an argument to \fBsprintf()\fR. If you use formatting directives other
- X than %s, or use more than one %s directive, there's a good chance that
- X! you'll crash \fBRemind\fR. Finally, because \fIcmd\fR is executed using
- X! the \fBsystem()\fR library function, shell delimiters in \fBMSG\fR-type
- X! reminders could cause problems. \fIIn particular, never run untrusted
- X! reminders using the \fR\fB\-k\fR\fI option\fR. A reminder like:
- X! .PP
- X! .nf
- X! REM msg foo ; rm -Rf .
- X! .fi
- X! .PP
- X! would cause havoc if run with the \fB\-k\fR option.
- X .RE
- X .TP
- X \fB\-z\fR[\fIn\fR] (UNIX and OS/2 only)
- X--- 161,169 ----
- X with the above technique. So be very careful. Also, the \fIcmd\fR is passed
- X as an argument to \fBsprintf()\fR. If you use formatting directives other
- X than %s, or use more than one %s directive, there's a good chance that
- X! you'll crash \fBRemind\fR. Finally, because all shell and whitespace
- X! characters are escaped, the program you execute with the \fB\-k\fR
- X! option must be prepared to handle the entire message as a single argument.
- X .RE
- X .TP
- X \fB\-z\fR[\fIn\fR] (UNIX and OS/2 only)
- X***************
- X*** 207,220 ****
- X If you do supply a \fIdate\fR on the command line, then \fBRemind\fR uses
- X it, rather than the actual system date, as its notion of "today."
- X This lets you create calendars for future months, or test to see
- X! how your reminders will be triggered in the future.
- X .PP
- X! In addition, as part of the \fIdate\fR component, you can supply a
- X! \fIrepeat\fR parameter, which has the form *\fInum\fR. This causes
- X! \fBRemind\fR to be run \fInum\fR times, with the date incrementing
- X! on each iteration. You may have to enclose the parameter in quotes
- X! to avoid shell expansion. See the subsection "Repeated Execution"
- X! in the section "Calendar Mode" for more information.
- X .SH REMINDER FILES
- X .PP
- X \fBRemind\fR uses scripts to control its operation. You can use any
- X--- 201,218 ----
- X If you do supply a \fIdate\fR on the command line, then \fBRemind\fR uses
- X it, rather than the actual system date, as its notion of "today."
- X This lets you create calendars for future months, or test to see
- X! how your reminders will be triggered in the future. Similarly,
- X! you can supply a \fItime\fR (in 24-hour format -- for example, 17:15) to
- X! set \fBRemind\fR's notion of "now" to a particular time. Supplying
- X! a \fItime\fR on the command line also implicitly enables the \fB\-q\fR
- X! option and disables the \fB\-z\fR option.
- X .PP
- X! In addition, you can supply a \fIrepeat\fR parameter, which has the
- X! form *\fInum\fR. This causes \fBRemind\fR to be run \fInum\fR times,
- X! with the date incrementing on each iteration. You may have to enclose
- X! the parameter in quotes to avoid shell expansion. See the subsection
- X! "Repeated Execution" in the section "Calendar Mode" for more
- X! information.
- X .SH REMINDER FILES
- X .PP
- X \fBRemind\fR uses scripts to control its operation. You can use any
- X***************
- X*** 2045,2051 ****
- X in degrees. 0 is a new moon, 180 is a full moon, 90 is first-quarter, etc.
- X .TP
- X .B now()
- X! Returns the current system time, as a \fBTIME\fR type.
- X .TP
- X .B ord(i_num)
- X Returns a string which is the ordinal number \fInum\fR. For example,
- X--- 2043,2050 ----
- X in degrees. 0 is a new moon, 180 is a full moon, 90 is first-quarter, etc.
- X .TP
- X .B now()
- X! Returns the current system time, as a \fBTIME\fR type. This may be
- X! the actual time, or a time supplied on the command line.
- X .TP
- X .B ord(i_num)
- X Returns a string which is the ordinal number \fInum\fR. For example,
- X***************
- X*** 2068,2081 ****
- X \fIstr2\fR otherwise.
- X .RE
- X .TP
- X! .B psmoon(i_phase [,i_size])
- X! Returns a \fBSTRING\fR consisting of PostScript code to draw a moon
- X! in the upper-left hand corner of the calendar box. \fIPhase\fR specifies
- X! the phase of the moon, and is 0 (new moon), 1 (first quarter), 2 (full moon)
- X! or 3 (third quarter). If \fIsize\fR is specified, it controls the radius of
- X! the moon in PostScript units (1/72 inch.) If it is not specified, the size
- X! of the day-number font is used.
- X .PP
- X .RS
- X For example, the following four lines place moon symbols on the PostScript
- X calendar:
- X--- 2067,2081 ----
- X \fIstr2\fR otherwise.
- X .RE
- X .TP
- X! .B psmoon(i_phase [,i_size [,s_note [,i_notesize]]])
- X! Returns a \fBSTRING\fR consisting of PostScript code to draw a moon in
- X! the upper-left hand corner of the calendar box. \fIPhase\fR specifies
- X! the phase of the moon, and is 0 (new moon), 1 (first quarter), 2 (full
- X! moon) or 3 (third quarter). If \fIsize\fR is specified, it controls
- X! the radius of the moon in PostScript units (1/72 inch.) If it is not
- X! specified or is negative, the size of the day-number font is used.
- X .PP
- X+ .PP
- X .RS
- X For example, the following four lines place moon symbols on the PostScript
- X calendar:
- X***************
- X*** 2087,2092 ****
- X--- 2087,2106 ----
- X REM [trigger(moondate(3))] PS [psmoon(3)]
- X .fi
- X .PP
- X+ If \fInote\fR is specified, the text is used to annotate the moon
- X+ display. The font is the same font used for calendar entries. If
- X+ \fInotesize\fR is given, it specifies the font size to use for the
- X+ annotation, in PostScript units (1/72 inch.) If \fInotesize\fR is not
- X+ given, it defaults to the size used for calendar entries. (If you annotate
- X+ the display, be careful not to overwrite the day number -- \fBRemind\fR
- X+ does not check for this.) For example, if you want the time of each new
- X+ moon displayed, you could use this in your reminder script:
- X+ .PP
- X+ .nf
- X+ REM [trigger(moondate(0))] PS [psmoon(0, -1, moontime(0)+"")]
- X+ .fi
- X+ .PP
- X+ Note how the time is coerced to a string by concatenating the null string.
- X .RE
- X .TP
- X .B psshade(i_num)
- X***************
- X*** 2102,2107 ****
- X--- 2116,2126 ----
- X The above command emits PostScript code to lightly shade the boxes
- X for Saturday and Sunday in a PostScript calendar.
- X .RE
- X+ .TP
- X+ .B realnow()
- X+ Returns the true time of day as provided by the operating system.
- X+ This is in contrast to \fBnow()\fR, which may return a time supplied
- X+ on the command line.
- X .TP
- X .B realtoday()
- X Returns the date as provided by the operating system. This is in contrast to
- X*** ../prev/sort.c Tue Nov 16 17:40:25 1993
- X--- ./sort.c Thu Feb 10 16:50:06 1994
- X***************
- X*** 5,11 ****
- X /* Routines for sorting reminders by trigger date */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X--- 5,11 ----
- X /* Routines for sorting reminders by trigger date */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993, 1994 by David F. Skoll */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X***************
- X*** 158,166 ****
- X switch(cur->typ) {
- X case MSG_TYPE:
- X if (MsgCommand) {
- X! char buf[LINELEN+TOKSIZE];
- X! sprintf(buf, MsgCommand, cur->text);
- X! system(buf);
- X } else {
- X if (cur->trigdate != olddate) {
- X IssueSortBanner(cur->trigdate);
- X--- 158,164 ----
- X switch(cur->typ) {
- X case MSG_TYPE:
- X if (MsgCommand) {
- X! DoMsgCommand(MsgCommand, cur->text);
- X } else {
- X if (cur->trigdate != olddate) {
- X IssueSortBanner(cur->trigdate);
- X*** ../prev/test-rem Tue Oct 12 16:22:52 1993
- X--- ./test-rem Mon Jan 31 17:05:05 1994
- X***************
- X*** 7,13 ****
- X # in the build directory.
- X #
- X # This file is part of REMIND.
- X! # Copyright (C) 1992, 1993 by David F. Skoll
- X # ---------------------------------------------------------------------------
- X
- X TEST_GETENV="foo bar baz" ; export TEST_GETENV
- X--- 7,13 ----
- X # in the build directory.
- X #
- X # This file is part of REMIND.
- X! # Copyright (C) 1992, 1993, 1994 by David F. Skoll
- X # ---------------------------------------------------------------------------
- X
- X TEST_GETENV="foo bar baz" ; export TEST_GETENV
- X*** ../prev/test-rem.bat Mon Nov 15 14:25:36 1993
- X--- ./test-rem.bat Mon Jan 31 17:04:57 1994
- X***************
- X*** 7,13 ****
- X rem in the build directory.
- X rem
- X rem This file is part of REMIND.
- X! rem Copyright (C) 1992, 1993 by David F. Skoll
- X rem ---------------------------------------------------------------------------
- X
- X del test.out > nul
- X--- 7,13 ----
- X rem in the build directory.
- X rem
- X rem This file is part of REMIND.
- X! rem Copyright (C) 1992, 1993, 1994 by David F. Skoll
- SHAR_EOF
- echo "End of Remind-3.0/Patch-13/part part 2"
- echo "File patch.13 is continued in part 3"
- echo "3" > shar3_seq_.tmp
- exit 0
-
-
-
- exit 0 # Just in case...
-