home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume34 / remind / patch01a / patch.01.B next >
Encoding:
Text File  |  1992-12-18  |  34.0 KB  |  1,122 lines

  1. *** ../p0/expr.h    Mon Nov  9 14:12:08 1992
  2. --- ./expr.h    Wed Dec 16 10:51:24 1992
  3. ***************
  4. *** 5,11 ****
  5.   /*  Contains a few definitions used by expression evaluator.   */
  6.   /*                                                             */
  7.   /*  This file is part of REMIND.                               */
  8. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  9.   /*                                                             */
  10.   /***************************************************************/
  11.   
  12. --- 5,11 ----
  13.   /*  Contains a few definitions used by expression evaluator.   */
  14.   /*                                                             */
  15.   /*  This file is part of REMIND.                               */
  16. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  17.   /*                                                             */
  18.   /***************************************************************/
  19.   
  20. *** ../p0/files.c    Mon Nov  9 14:12:17 1992
  21. --- ./files.c    Wed Dec 16 10:51:33 1992
  22. ***************
  23. *** 33,39 ****
  24.   #include <dos.h>
  25.   #endif
  26.   
  27. - #include "config.h"
  28.   #include "types.h"
  29.   #include "protos.h"
  30.   #include "globals.h"
  31. --- 33,38 ----
  32. ***************
  33. *** 428,434 ****
  34.   /*  file.  Not needed for UNIX.                                */
  35.   /*                                                             */
  36.   /***************************************************************/
  37. ! #ifdef __MSDOS__
  38.   /*
  39.    * WARNING WARNING WARNING WARNING
  40.    * In the version of Turbo C which I have, there is a bug in the
  41. --- 427,433 ----
  42.   /*  file.  Not needed for UNIX.                                */
  43.   /*                                                             */
  44.   /***************************************************************/
  45. ! #if defined(__MSDOS__) || defined(OS2)
  46.   /*
  47.    * WARNING WARNING WARNING WARNING
  48.    * In the version of Turbo C which I have, there is a bug in the
  49. ***************
  50. *** 449,463 ****
  51.   int jul;
  52.   #endif
  53.   {
  54. !    int y, m, d;
  55.   #ifdef __TURBOC__   
  56.      struct ftime ft;
  57. - #endif   
  58.      FILE *f;
  59.   
  60.      FromJulian(jul, &y, &m, &d);
  61. -    
  62. - #ifdef __TURBOC__   
  63.      ft.ft_tsec = 0;
  64.      ft.ft_min = 0;
  65.      ft.ft_hour = 12;  /* Arbitrarily set time to noon. */
  66. --- 448,460 ----
  67.   int jul;
  68.   #endif
  69.   {
  70.   #ifdef __TURBOC__   
  71. +    int y, m, d;
  72.      struct ftime ft;
  73.      FILE *f;
  74.   
  75.      FromJulian(jul, &y, &m, &d);
  76.      ft.ft_tsec = 0;
  77.      ft.ft_min = 0;
  78.      ft.ft_hour = 12;  /* Arbitrarily set time to noon. */
  79. ***************
  80. *** 464,488 ****
  81.      ft.ft_day = (unsigned int) d;
  82.      ft.ft_month = (unsigned int) m+1;
  83.      ft.ft_year = (unsigned int) (y - 1980);
  84. - #endif
  85.   
  86. !    f = fopen(fname, "r");
  87. ! #ifdef __TURBOC__   
  88.      if (!f || setftime(fileno(f) , &ft)) {
  89. - #endif
  90.   
  91. ! #ifdef __MSC__
  92. !    if (!f || _dos_setftime(fileno(f),
  93. !     ((y-1980)<<9) + (m+1)<<5 + d,
  94. !     (12<<11))) {
  95.   #endif       
  96.         fprintf(ErrFp, "Can't reset access date of %s\n", fname);
  97.         if (f) fclose(f);
  98.         return -1;
  99.      }
  100.   
  101.      fclose(f);
  102.      return 0;
  103.   }
  104.   #endif /* __MSDOS__ */
  105. --- 461,485 ----
  106.      ft.ft_day = (unsigned int) d;
  107.      ft.ft_month = (unsigned int) m+1;
  108.      ft.ft_year = (unsigned int) (y - 1980);
  109.   
  110. !    f = fopen(fname, "r"); 
  111.      if (!f || setftime(fileno(f) , &ft)) {
  112.   
  113. ! #else /* Must be MSC */
  114. !    if (utime(fname, (struct utimbuf *) NULL)) {
  115.   #endif       
  116.         fprintf(ErrFp, "Can't reset access date of %s\n", fname);
  117. + #ifdef __TURBOC__
  118.         if (f) fclose(f);
  119. + #endif
  120.         return -1;
  121.      }
  122.   
  123. + #ifdef __TURBOC__
  124.      fclose(f);
  125. + #endif
  126.      return 0;
  127.   }
  128.   #endif /* __MSDOS__ */
  129. *** ../p0/funcs.c    Mon Nov  9 14:23:22 1992
  130. --- ./funcs.c    Wed Dec 16 10:51:34 1992
  131. ***************
  132. *** 6,16 ****
  133.   /*  expressions.                                               */
  134.   /*                                                             */
  135.   /*  This file is part of REMIND.                               */
  136. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  137.   /*                                                             */
  138.   /***************************************************************/
  139. - #include <stdio.h>
  140.   #include "config.h"
  141.   #ifdef HAVE_STDLIB_H
  142.   #include <stdlib.h>
  143.   #endif
  144. --- 6,16 ----
  145.   /*  expressions.                                               */
  146.   /*                                                             */
  147.   /*  This file is part of REMIND.                               */
  148. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  149.   /*                                                             */
  150.   /***************************************************************/
  151.   #include "config.h"
  152. + #include <stdio.h>
  153.   #ifdef HAVE_STDLIB_H
  154.   #include <stdlib.h>
  155.   #endif
  156. ***************
  157. *** 26,32 ****
  158.   #include <sys/file.h>
  159.   #endif
  160.   #endif
  161. - /* May have to change previous line to <sys/file.h> for some unixes */
  162.   #ifdef __MSDOS__
  163.   #include <io.h>
  164.   #define R_OK 4
  165. --- 26,31 ----
  166. ***************
  167. *** 127,134 ****
  168.   #define DCOPYVAL(x, y) ( (x) = (y), (y).type = ERR_TYPE )
  169.   
  170.   /* Convenience macros */
  171. ! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
  172. ! #define LOWER(c) ( ((c) >= 'A' && (c) <= 'Z') ? (c) + 'a' - 'A' : (c) )
  173.   
  174.   /* The array holding the built-in functions. */
  175.   Operator Func[] = {
  176. --- 126,133 ----
  177.   #define DCOPYVAL(x, y) ( (x) = (y), (y).type = ERR_TYPE )
  178.   
  179.   /* Convenience macros */
  180. ! #define UPPER(c) (islower(c) ? toupper(c) : c)
  181. ! #define LOWER(c) (isupper(c) ? tolower(c) : c)
  182.   
  183.   /* The array holding the built-in functions. */
  184.   Operator Func[] = {
  185. ***************
  186. *** 834,840 ****
  187.   
  188.   /***************************************************************/
  189.   /*                                                             */
  190. ! /*  FOstype - the type of operating system (UNIX or MSDOS)     */
  191.   /*                                                             */
  192.   /***************************************************************/
  193.   #ifdef HAVE_PROTOS
  194. --- 833,840 ----
  195.   
  196.   /***************************************************************/
  197.   /*                                                             */
  198. ! /*  FOstype - the type of operating system                     */
  199. ! /*  (UNIX, OS/2, or MSDOS)                                     */
  200.   /*                                                             */
  201.   /***************************************************************/
  202.   #ifdef HAVE_PROTOS
  203. ***************
  204. *** 846,851 ****
  205. --- 846,855 ----
  206.   #ifdef UNIX
  207.      return RetStrVal("UNIX");
  208.   #else
  209. + #ifdef __MSC__
  210. +     if (_osmode == OS2_MODE)
  211. +         return RetStrVal("OS/2");
  212. + #endif
  213.      return RetStrVal("MSDOS");
  214.   #endif  
  215.   }
  216. ***************
  217. *** 1362,1368 ****
  218.   PRIVATE FILE *popen(char *cmd, char *mode)
  219.   #else
  220.   static FILE *popen(cmd, mode)
  221. ! char *cmd, *mode
  222.   #endif
  223.   {
  224.      char *s;
  225. --- 1366,1372 ----
  226.   PRIVATE FILE *popen(char *cmd, char *mode)
  227.   #else
  228.   static FILE *popen(cmd, mode)
  229. ! char *cmd, *mode;
  230.   #endif
  231.   {
  232.      char *s;
  233. *** ../p0/globals.h    Mon Nov  9 14:12:09 1992
  234. --- ./globals.h    Wed Dec 16 10:51:25 1992
  235. ***************
  236. *** 7,13 ****
  237.   /*  MK_GLOBALS.  Also contains useful macro definitions.       */
  238.   /*                                                             */
  239.   /*  This file is part of REMIND.                               */
  240. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  241.   /*                                                             */
  242.   /***************************************************************/
  243.   
  244. --- 7,13 ----
  245.   /*  MK_GLOBALS.  Also contains useful macro definitions.       */
  246.   /*                                                             */
  247.   /*  This file is part of REMIND.                               */
  248. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  249.   /*                                                             */
  250.   /***************************************************************/
  251.   
  252. ***************
  253. *** 40,45 ****
  254. --- 40,46 ----
  255.   EXTERN  INIT(    int     DebugFlag, 0);
  256.   EXTERN  INIT(   char    DoCalendar, 0);
  257.   EXTERN  INIT(   char    DoSimpleCalendar, 0);
  258. + EXTERN  INIT(   char    PsCal, 0);
  259.   EXTERN  INIT(   int     CalWidth, 80);
  260.   EXTERN  INIT(   int     CalWeeks, 0);
  261.   EXTERN  INIT(   int     CalMonths, 0);
  262. *** ../p0/init.c    Mon Nov  9 14:12:19 1992
  263. --- ./init.c    Wed Dec 16 10:51:35 1992
  264. ***************
  265. *** 36,41 ****
  266. --- 36,42 ----
  267.    *  -c[n]    = Produce a calendar for n months (default = 1)
  268.    *  -w[n]    = Specify output device width (default = 80)
  269.    *  -s[n]    = Produce calendar in "simple calendar" format
  270. +  *  -p[n]    = Produce calendar in format compatible with rem2ps
  271.    *  -v       = Verbose mode
  272.    *  -o       = Ignore ONCE directives
  273.    *  -a       = Don't issue timed reminders which will be queued
  274. ***************
  275. *** 187,192 ****
  276. --- 188,201 ----
  277.              if (!CalMonths) CalMonths = 1;
  278.              break;
  279.   
  280. +         case 'p':
  281. +         case 'P':
  282. +            DoSimpleCalendar = 1;
  283. +            PsCal = 1;
  284. +            PARSENUM(CalMonths, arg);
  285. +            if (!CalMonths) CalMonths = 1;
  286. +            break;
  287.           case 'w':
  288.           case 'W':
  289.              PARSENUM(CalWidth, arg);
  290. ***************
  291. *** 303,309 ****
  292.   #endif
  293.   {
  294.      fprintf(ErrFp, "\nREMIND %s Copyright 1992 by David F. Skoll\n\n", VERSION);
  295. !    fprintf(ErrFp, "Usage: remind [options] filename [date]\n\n");
  296.      fprintf(ErrFp, "Options:\n");
  297.      fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  298.      fprintf(ErrFp, " -r     Disable RUN directives\n");
  299. --- 312,318 ----
  300.   #endif
  301.   {
  302.      fprintf(ErrFp, "\nREMIND %s Copyright 1992 by David F. Skoll\n\n", VERSION);
  303. !    fprintf(ErrFp, "        Usage: remind [options] filename [date]\n");
  304.      fprintf(ErrFp, "Options:\n");
  305.      fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  306.      fprintf(ErrFp, " -r     Disable RUN directives\n");
  307. ***************
  308. *** 311,316 ****
  309. --- 320,326 ----
  310.      fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
  311.      fprintf(ErrFp, " -w[n]  Specify width (default 80) of calendar output\n");
  312.      fprintf(ErrFp, " -s[n]  Produce 'simple calendar' for n (1) months\n");
  313. +    fprintf(ErrFp, " -p[n]  Same as -s, but input compatible with rem2ps\n");
  314.      fprintf(ErrFp, " -v     Verbose mode\n");
  315.      fprintf(ErrFp, " -o     Ignore ONCE directives\n");
  316.      fprintf(ErrFp, " -t     Trigger all future reminders regardless of delta\n");
  317. *** ../p0/main.c    Mon Nov  9 14:12:20 1992
  318. --- ./main.c    Wed Dec 16 10:51:37 1992
  319. ***************
  320. *** 16,21 ****
  321. --- 16,24 ----
  322.   #ifdef HAVE_MALLOC_H
  323.   #include <malloc.h>
  324.   #endif
  325. + #ifdef HAVE_UNISTD
  326. + #include <unistd.h>
  327. + #endif
  328.   #include <stdio.h>
  329.   #include <string.h>
  330.   #ifdef HAVE_STDARG
  331. ***************
  332. *** 27,32 ****
  333. --- 30,38 ----
  334.   
  335.   #ifdef __MSDOS__
  336.   #include <dos.h>
  337. + # ifdef __MSC__
  338. + # include <time.h>
  339. + # endif
  340.   #endif
  341.   
  342.   
  343. ***************
  344. *** 101,108 ****
  345.   #endif
  346.      }
  347.   
  348. !    /* If it's MS-DOS, reset the file access date */
  349. ! #ifdef __MSDOS__
  350.      if (RealToday == JulianToday) SetAccessDate(InitialFile, RealToday);
  351.   #endif
  352.   
  353. --- 107,114 ----
  354.   #endif
  355.      }
  356.   
  357. !    /* If it's MS-DOS or OS2, reset the file access date */
  358. ! #if defined(__MSDOS__) || defined(OS2)
  359.      if (RealToday == JulianToday) SetAccessDate(InitialFile, RealToday);
  360.   #endif
  361.   
  362. ***************
  363. *** 569,575 ****
  364.      (void) vfprintf(ErrFp, fmt, argptr);
  365.      (void) fputc('\n', ErrFp);
  366.   #ifndef HAVE_STDARG
  367. !    va_end(argptr)
  368.   #endif
  369.      return;
  370.   }
  371. --- 575,581 ----
  372.      (void) vfprintf(ErrFp, fmt, argptr);
  373.      (void) fputc('\n', ErrFp);
  374.   #ifndef HAVE_STDARG
  375. !    va_end(argptr);
  376.   #endif
  377.      return;
  378.   }
  379. ***************
  380. *** 676,683 ****
  381.   long SystemTime()
  382.   #endif
  383.   {
  384. ! #ifdef __MSDOS__
  385. ! #ifdef __TURBOC__
  386.   /* Get time in Turbo C */
  387.   
  388.      struct time t;
  389. --- 682,688 ----
  390.   long SystemTime()
  391.   #endif
  392.   {
  393. ! #if defined( __MSDOS__ ) && defined( __TURBOC__ )
  394.   /* Get time in Turbo C */
  395.   
  396.      struct time t;
  397. ***************
  398. *** 685,701 ****
  399.      gettime(&t);
  400.      return (long) t.ti_hour * 3600L + (long) t.ti_min * 60L +
  401.         (long) t.ti_sec;
  402.   #else
  403. ! /* Get time in Microsoft C */
  404. !    struct dostime_t tloc;
  405. !    _dos_gettime(&tloc);
  406. !    return (long) tloc.hour * 3600L + (long) tloc.minute * 60L +
  407. !       (long) tloc.second;
  408. ! #endif
  409. ! #else
  410. ! /* Get time in Unix */
  411.     time_t tloc;
  412.     struct tm *t;
  413.   
  414. --- 690,697 ----
  415.      gettime(&t);
  416.      return (long) t.ti_hour * 3600L + (long) t.ti_min * 60L +
  417.         (long) t.ti_sec;
  418.   #else
  419. ! /* Get time in Unix or with MSC */
  420.     time_t tloc;
  421.     struct tm *t;
  422.   
  423. ***************
  424. *** 723,730 ****
  425.   int *y;
  426.   #endif
  427.   {
  428. ! #ifdef __MSDOS__
  429. ! #ifdef __TURBOC__
  430.   /* Get today's date in Turbo C */
  431.      struct date da;
  432.   
  433. --- 719,725 ----
  434.   int *y;
  435.   #endif
  436.   {
  437. ! #if defined( __MSDOS__ ) && defined( __TURBOC__ )
  438.   /* Get today's date in Turbo C */
  439.      struct date da;
  440.   
  441. ***************
  442. *** 733,751 ****
  443.      *m = da.da_mon - 1;
  444.      *d = da.da_day;
  445.   #else
  446. ! /* Get today's date in Microsoft C */
  447. !    struct dosdate_t buf;
  448. !    _dos_getdate(&buf);
  449. !    *d = buf.day;
  450. !    *m = buf.month - 1;
  451. !    *y = buf.year;
  452. ! #endif
  453. ! #else
  454. ! /* Get today's date in UNIX */
  455. !   time_t tloc;
  456. !   struct tm *t;
  457.   
  458.      (void) time(&tloc);
  459.      t = localtime(&tloc);
  460. --- 728,736 ----
  461.      *m = da.da_mon - 1;
  462.      *d = da.da_day;
  463.   #else
  464. ! /* Get today's date in UNIX or with MSC */
  465. !    time_t tloc;
  466. !    struct tm *t;
  467.   
  468.      (void) time(&tloc);
  469.      t = localtime(&tloc);
  470. *** ../p0/makefile.msc    Mon Nov  9 14:12:34 1992
  471. --- ./makefile.msc    Wed Dec 16 10:51:53 1992
  472. ***************
  473. *** 55,57 ****
  474. --- 55,64 ----
  475.   
  476.   remind.exe: $(OBJS)
  477.       link /NOI @lnk.msc
  478. + rem2ps.obj: rem2ps.c
  479. +     cl /c $(DEFINES) $(MODEL) /Forem2ps.obj rem2ps.c
  480. + rem2ps.exe: rem2ps.obj
  481. +     link /NOI rem2ps,rem2ps.exe,,,
  482. *** ../p0/makefile.tc    Mon Nov  9 14:12:33 1992
  483. --- ./makefile.tc    Wed Dec 16 10:51:51 1992
  484. ***************
  485. *** 1,6 ****
  486.   # Makefile for REMIND for Turbo C for MSDOS
  487.   
  488. ! VERSION= 03.00.00
  489.   
  490.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  491.   
  492. --- 1,6 ----
  493.   # Makefile for REMIND for Turbo C for MSDOS
  494.   
  495. ! VERSION= 03.00.01
  496.   
  497.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  498.   
  499. ***************
  500. *** 15,27 ****
  501.   
  502.   MANIFEST= readme.uni readme.dos copyrigh $(HDRS) $(SRCS) makefile rem rem.1 \
  503.   remind.1 remind-a.csh remind-a.sh test.rem test-rem test.cmp makefile.tc \
  504. ! makefile.msc lnk.msc lnk.tc manifest.dos manifest.unx whatsnew.30 kall kall.1
  505.   
  506.   remind.exe: $(OBJS)
  507.       tcc @lnk.tc
  508.   
  509.   .c.obj:
  510.       tcc -A -w-pia -c -O -ms {$< }
  511.   
  512.   calendar.obj: calendar.c $(STDHDRS) expr.h
  513.   
  514. --- 15,35 ----
  515.   
  516.   MANIFEST= readme.uni readme.dos copyrigh $(HDRS) $(SRCS) makefile rem rem.1 \
  517.   remind.1 remind-a.csh remind-a.sh test.rem test-rem test.cmp makefile.tc \
  518. ! makefile.msc lnk.msc lnk.tc manifest.dos manifest.unx whatsnew.30 kall kall.1 \
  519. ! defs.rem readme.os2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
  520.   
  521. + all: remind.exe rem2ps.exe
  522.   remind.exe: $(OBJS)
  523.       tcc @lnk.tc
  524.   
  525. + rem2ps.exe: rem2ps.obj
  526. +     tcc -erem2ps.exe rem2ps.obj
  527.   .c.obj:
  528.       tcc -A -w-pia -c -O -ms {$< }
  529. + rem2ps.obj: rem2ps.c rem2ps.h config.h
  530.   
  531.   calendar.obj: calendar.c $(STDHDRS) expr.h
  532.   
  533. *** ../p0/protos.h    Mon Nov  9 14:12:10 1992
  534. --- ./protos.h    Wed Dec 16 10:51:26 1992
  535. ***************
  536. *** 5,11 ****
  537.   /*  Function Prototypes.                                       */
  538.   /*                                                             */
  539.   /*  This file is part of REMIND.                               */
  540. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  541.   /*                                                             */
  542.   /***************************************************************/
  543.   #ifdef HAVE_PROTOS
  544. --- 5,11 ----
  545.   /*  Function Prototypes.                                       */
  546.   /*                                                             */
  547.   /*  This file is part of REMIND.                               */
  548. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  549.   /*                                                             */
  550.   /***************************************************************/
  551.   #ifdef HAVE_PROTOS
  552. ***************
  553. *** 110,112 ****
  554. --- 110,113 ----
  555.   int DoPreserve  ARGS ((Parser *p));
  556.   int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
  557.   int ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
  558. + int HashVal ARGS ((const char *str));
  559. *** ../p0/queue.c    Mon Nov  9 14:12:22 1992
  560. --- ./queue.c    Wed Dec 16 10:51:38 1992
  561. ***************
  562. *** 8,18 ****
  563.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  564.   /*                                                             */
  565.   /***************************************************************/
  566.   #include <stdio.h>
  567.   #include <signal.h>
  568.   #include <sys/types.h>
  569.   #include <sys/stat.h>
  570. - #include "config.h"
  571.   #ifdef HAVE_STDLIB_H
  572.   #include <stdlib.h>
  573.   #endif
  574. --- 8,18 ----
  575.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  576.   /*                                                             */
  577.   /***************************************************************/
  578. + #include "config.h"
  579.   #include <stdio.h>
  580.   #include <signal.h>
  581.   #include <sys/types.h>
  582.   #include <sys/stat.h>
  583.   #ifdef HAVE_STDLIB_H
  584.   #include <stdlib.h>
  585.   #endif
  586. ***************
  587. *** 19,24 ****
  588. --- 19,27 ----
  589.   #ifdef HAVE_MALLOC_H
  590.   #include <malloc.h>
  591.   #endif
  592. + #ifdef HAVE_UNISTD
  593. + #include <unistd.h>
  594. + #endif
  595.   #include "globals.h"
  596.   #include "err.h"
  597.   #include "types.h"
  598. ***************
  599. *** 174,179 ****
  600. --- 177,183 ----
  601.         /* Trigger the reminder */
  602.         CreateParser(q->text, &p);
  603.         trig.typ = q->typ;
  604. +       RunDisabled = q->RunDisabled;
  605.         (void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
  606.         fflush(stdout);
  607.         
  608. *** ../p0/remind.1    Mon Nov  9 14:12:29 1992
  609. --- ./remind.1    Wed Dec 16 10:51:48 1992
  610. ***************
  611. *** 1,4 ****
  612. ! .TH REMIND 1 "20 October 1992"
  613.   .UC4
  614.   .SH NAME
  615.   remind \- a sophisticated reminder service
  616. --- 1,4 ----
  617. ! .TH REMIND 1 "11 November 1992"
  618.   .UC4
  619.   .SH NAME
  620.   remind \- a sophisticated reminder service
  621. ***************
  622. *** 38,43 ****
  623. --- 38,48 ----
  624.   format" which can be used as input for more sophisticated calendar-drawing
  625.   programs.
  626.   .TP
  627. + .B \-p\fR\fIn\fR
  628. + The \fB\-p\fR option is very similar to the \fB\-s\fR option, except
  629. + that the output contains additional information for use by the
  630. + \fBrem2ps\fR program, which creates a PostScript calendar.
  631. + .TP
  632.   .B \-v
  633.   The \fB\-v\fR option makes the output of \fBRemind\fR slightly more verbose.
  634.   .TP
  635. ***************
  636. *** 1149,1163 ****
  637.   .RE
  638.   .TP
  639.   .B DATE constants
  640. ! \fBDATE\fR constants have no readable representation.  They must be
  641. ! created with the \fBdate()\fR function, which takes the year, month
  642. ! and day as arguments:
  643.   .PP
  644.   .RS
  645. ! date(1992, 2, 29), date(1996, 4, 2), date(2001, 12, 17)
  646.   .PP
  647. ! However, \fBDATE\fR constants are \fIprinted\fR as
  648. ! \fIyyyy\fR/\fImm\fR/\fIdd\fR.
  649.   .RE
  650.   .PP
  651.   .B OPERATORS
  652. --- 1154,1170 ----
  653.   .RE
  654.   .TP
  655.   .B DATE constants
  656. ! \fBDATE\fR constants are expressed as 'yyyy/mm/dd', and the single
  657. ! quotes \fImust\fR be supplied.  This distinguishes date constants
  658. ! from division of integers.  Examples:
  659.   .PP
  660.   .RS
  661. ! '1993/02/22', '1992/12/25', '1999/01/01'
  662.   .PP
  663. ! Note that \fBDATE\fR constants are \fIprinted\fR as
  664. ! \fIyyyy\fR/\fImm\fR/\fIdd\fR without the quotes.  Note also that versions
  665. ! of \fBRemind\fR prior to 03.00.01 did not support date constants.  In those
  666. ! versions, you must create dates using the \fBdate()\fR function.
  667.   .RE
  668.   .PP
  669.   .B OPERATORS
  670. ***************
  671. *** 1372,1377 ****
  672. --- 1379,1389 ----
  673.   a \fBSTRING\fR consisting of the characters specified by the arguments.
  674.   Note that none of the arguments can be 0, unless there is only one
  675.   argument.  As a special case, \fBchar(0)\fR returns "".
  676. + .PP
  677. + Note that because \fBRemind\fR does not support escaping of characters
  678. + in strings, the only way to get a double-quote in a string is to use
  679. + \fBchar(34)\fR.  Yes, I know it's not portable - it assumes ASCII
  680. + coding.
  681.   .TP
  682.   .B choose(i_index, x_arg1 [,x_arg2...])
  683.   \fBChoose\fR must take at least two arguments, the first of which is
  684. ***************
  685. *** 1525,1531 ****
  686.   \fBord(2)\fR returns "2nd", and \fBord(213)\fR returns "213th".
  687.   .TP
  688.   .B ostype()
  689. ! Returns "UNIX" on UNIX systems, and "MSDOS" on MS-DOS systems.
  690.   .TP
  691.   .B plural(i_num [,s_str1 [,s_str2]])
  692.   Can take from one to three arguments.  If one argument is supplied, returns
  693. --- 1537,1545 ----
  694.   \fBord(2)\fR returns "2nd", and \fBord(213)\fR returns "213th".
  695.   .TP
  696.   .B ostype()
  697. ! Returns "UNIX" on UNIX systems, "MSDOS" on MS-DOS systems, and "OS/2"
  698. ! on OS/2 systems.  If you run \fBRemind\fR in an MS-DOS box under OS/2,
  699. ! this function returns "MSDOS".
  700.   .TP
  701.   .B plural(i_num [,s_str1 [,s_str2]])
  702.   Can take from one to three arguments.  If one argument is supplied, returns
  703. ***************
  704. *** 1615,1621 ****
  705.   .TP
  706.   .B version()
  707.   Returns a string specifying the version of \fBRemind\fR.  For version 
  708. ! 03.00.00, returns "03.00.00".  It is guaranteed that as new versions of
  709.   \fBRemind\fR are released, the value returned by \fBversion()\fR will
  710.   strictly increase, according to the rules for string ordering.
  711.   .TP
  712. --- 1629,1635 ----
  713.   .TP
  714.   .B version()
  715.   Returns a string specifying the version of \fBRemind\fR.  For version 
  716. ! 03.00.01, returns "03.00.01".  It is guaranteed that as new versions of
  717.   \fBRemind\fR are released, the value returned by \fBversion()\fR will
  718.   strictly increase, according to the rules for string ordering.
  719.   .TP
  720. ***************
  721. *** 2009,2024 ****
  722.   .PP
  723.   .SH CALENDAR MODE
  724.   .PP
  725. ! If you supply the \fB\-c\fR or \fB\-s\fR command-line option, the \fBRemind\fR
  726.   runs in "calendar mode."  In this mode, \fBRemind\fR interprets the script
  727.   repeatedly, performing one iteration through the whole file for each day
  728.   in the calendar.  Reminders which trigger are saved in internal buffers,
  729.   and then inserted into the calendar in the appropriate places.
  730.   .PP
  731. ! For example, if you have a reminder script called ".reminders", and you
  732. ! executed this command:
  733.   .PP
  734.   .nf
  735.       remind -c .reminders jan 1993
  736.   .fi
  737.   .PP
  738. --- 2023,2049 ----
  739.   .PP
  740.   .SH CALENDAR MODE
  741.   .PP
  742. ! If you supply the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR
  743. ! command-line option, then \fBRemind\fR
  744.   runs in "calendar mode."  In this mode, \fBRemind\fR interprets the script
  745.   repeatedly, performing one iteration through the whole file for each day
  746.   in the calendar.  Reminders which trigger are saved in internal buffers,
  747.   and then inserted into the calendar in the appropriate places.
  748.   .PP
  749. ! The \fB\-p\fR option is used in conjunction with the \fBrem2ps\fR
  750. ! program to produce a calendar in PostScript format.  For example, the
  751. ! following command will send PostScript code to standard output:
  752.   .PP
  753.   .nf
  754. +     remind -p .reminders | rem2ps
  755. + .fi
  756. + .PP
  757. + You can print a PostScript calendar by piping this to the \fBlpr\fR command.
  758. + .PP
  759. + If you have a reminder script called ".reminders", and you
  760. + execute this command:
  761. + .PP
  762. + .nf
  763.       remind -c .reminders jan 1993
  764.   .fi
  765.   .PP
  766. ***************
  767. *** 2205,2210 ****
  768. --- 2230,2249 ----
  769.   that the trigger date is issued only in election years, which are
  770.   multiples of 4.  The second \fBREM\fR command actually issues the
  771.   reminder.
  772. + .PP
  773. + .B DETAILS ABOUT TRIGVALID()
  774. + .PP
  775. + The \fBtrigvalid()\fR function returns 1 if \fBRemind\fR could find a trigger
  776. + date for the previous \fBREM\fR or \fBIFTRIG\fR command.  More specifically,
  777. + it returns 1 if \fBRemind\fR finds a date \fInot in the past\fR which
  778. + satisfies the trigger.  In addition, there is one special case in which
  779. + \fBtrigvalid()\fR returns 1 and \fBtrigdate()\fR returns a meaningful result:
  780. + .PP
  781. + If the \fBREM\fR or \fBIFTRIG\fR command did not contain an \fBUNTIL\fR
  782. + clause, and contained all of the \fIday\fR, \fImonth\fR and \fIyear\fR
  783. + components, then \fBRemind\fR will correctly compute a trigger date, even
  784. + if it happens to be in the past.  Note that this behaviour is not true for
  785. + versions of \fBRemind\fR prior to 03.00.01.
  786.   .SH AUTHOR
  787.   .PP
  788.   David F. Skoll
  789. ***************
  790. *** 2212,2218 ****
  791.   .PP
  792.   Date calculation is a bit "brute force."
  793.   .PP
  794. ! The MS-DOS version of \fBRemind\fR does not support queuing or timed
  795.   activation of reminders.
  796.   .PP
  797.   \fBRemind\fR has some built-in limits on total line length,
  798. --- 2251,2257 ----
  799.   .PP
  800.   Date calculation is a bit "brute force."
  801.   .PP
  802. ! The MS-DOS and OS/2 versions of \fBRemind\fR do not support queuing or timed
  803.   activation of reminders.
  804.   .PP
  805.   \fBRemind\fR has some built-in limits on total line length,
  806. ***************
  807. *** 2220,2223 ****
  808.   .PP
  809.   .SH SEE ALSO
  810.   .pp
  811. ! rem, elm, kall
  812. --- 2259,2262 ----
  813.   .PP
  814.   .SH SEE ALSO
  815.   .pp
  816. ! rem, elm, kall, rem2ps
  817. *** ../p0/test-rem    Mon Nov  9 14:12:33 1992
  818. --- ./test-rem    Wed Dec 16 10:51:51 1992
  819. ***************
  820. *** 1,8 ****
  821. ! #!/bin/csh -f
  822. ! setenv TEST_GETENV "foo bar baz"
  823.   ./remind -e -dxtev ./test.rem 16 feb 1991 > ./test.out
  824.   cmp -s ./test.out ./test.cmp
  825. ! if ($status == 0) then
  826.      echo "Remind:  Acceptance test PASSED"
  827.      exit 0
  828.   else
  829. --- 1,8 ----
  830. ! #!/bin/sh
  831. ! TEST_GETENV="foo bar baz" ; export TEST_GETENV
  832.   ./remind -e -dxtev ./test.rem 16 feb 1991 > ./test.out
  833.   cmp -s ./test.out ./test.cmp
  834. ! if [ "$?" = "0" ]; then
  835.      echo "Remind:  Acceptance test PASSED"
  836.      exit 0
  837.   else
  838. ***************
  839. *** 11,14 ****
  840.      echo "Examine the file test.out to see where it differs from the"
  841.      echo "reference file test.cmp."
  842.      exit 1
  843. ! endif
  844. --- 11,14 ----
  845.      echo "Examine the file test.out to see where it differs from the"
  846.      echo "reference file test.cmp."
  847.      exit 1
  848. ! fi
  849. *** ../p0/test.cmp    Mon Nov  9 14:12:33 1992
  850. --- ./test.cmp    Wed Dec 16 10:51:51 1992
  851. ***************
  852. *** 349,355 ****
  853.   "a05" + "6" => "a056"
  854.   value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  855.   set a058 version()
  856. ! version() => "03.00.00"
  857.   set a059 wkday(today())
  858.   today() => 1991/02/16
  859.   wkday(1991/02/16) => "Saturday"
  860. --- 349,355 ----
  861.   "a05" + "6" => "a056"
  862.   value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  863.   set a058 version()
  864. ! version() => "03.00.01"
  865.   set a059 wkday(today())
  866.   today() => 1991/02/16
  867.   wkday(1991/02/16) => "Saturday"
  868. ***************
  869. *** 453,459 ****
  870.           a048  "foo"
  871.           a067  "INT"
  872.           a039  "February"
  873. !         a058  "03.00.00"
  874.           a049  21
  875.           a068  "STRING"
  876.           a059  "Saturday"
  877. --- 453,459 ----
  878.           a048  "foo"
  879.           a067  "INT"
  880.           a039  "February"
  881. !         a058  "03.00.01"
  882.           a049  21
  883.           a068  "STRING"
  884.           a059  "Saturday"
  885. *** ../p0/token.c    Mon Nov  9 14:12:22 1992
  886. --- ./token.c    Wed Dec 16 10:51:39 1992
  887. ***************
  888. *** 6,17 ****
  889.   /*  classifying the tokens parsed.                             */
  890.   /*                                                             */
  891.   /*  This file is part of REMIND.                               */
  892. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  893.   /*                                                             */
  894.   /***************************************************************/
  895.   #include <stdio.h>
  896.   #include <ctype.h>
  897. - #include "config.h"
  898.   #ifdef HAVE_STDLIB_H
  899.   #include <stdlib.h>
  900.   #endif
  901. --- 6,17 ----
  902.   /*  classifying the tokens parsed.                             */
  903.   /*                                                             */
  904.   /*  This file is part of REMIND.                               */
  905. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  906.   /*                                                             */
  907.   /***************************************************************/
  908. + #include "config.h"
  909.   #include <stdio.h>
  910.   #include <ctype.h>
  911.   #ifdef HAVE_STDLIB_H
  912.   #include <stdlib.h>
  913.   #endif
  914. *** ../p0/trigger.c    Mon Nov  9 14:12:23 1992
  915. --- ./trigger.c    Wed Dec 16 10:51:40 1992
  916. ***************
  917. *** 5,16 ****
  918.   /*  Routines for figuring out the trigger date of a reminder   */
  919.   /*                                                             */
  920.   /*  This file is part of REMIND.                               */
  921. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  922.   /*                                                             */
  923.   /***************************************************************/
  924.   
  925. - #include <stdio.h>
  926.   #include "config.h"
  927.   #ifdef HAVE_STDLIB_H
  928.   #include <stdlib.h>
  929.   #endif
  930. --- 5,16 ----
  931.   /*  Routines for figuring out the trigger date of a reminder   */
  932.   /*                                                             */
  933.   /*  This file is part of REMIND.                               */
  934. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  935.   /*                                                             */
  936.   /***************************************************************/
  937.   
  938.   #include "config.h"
  939. + #include <stdio.h>
  940.   #ifdef HAVE_STDLIB_H
  941.   #include <stdlib.h>
  942.   #endif
  943. ***************
  944. *** 439,448 ****
  945. --- 439,456 ----
  946.            fprintf(ErrFp, "%s(%d): Expired\n",
  947.                    FileName, LineNo);
  948.            }
  949. +          if (result != -1) {
  950. +             LastTriggerDate = result;
  951. +         LastTrigValid = 1;
  952. +          }
  953.            return -1;
  954.         }
  955.         /* Keep scanning... unless there's no point in doing it.*/
  956.         if (nextstart <= start) {
  957. +            if (result != -1) {
  958. +         LastTriggerDate = result;
  959. +         LastTrigValid = 1;
  960. +      }
  961.            if (DebugFlag & DB_PRTTRIG) {
  962.           fprintf(ErrFp, "%s(%d): Expired\n",
  963.                     FileName, LineNo);
  964. *** ../p0/types.h    Mon Nov  9 14:12:10 1992
  965. --- ./types.h    Wed Dec 16 10:51:26 1992
  966. ***************
  967. *** 5,11 ****
  968.   /*  Type definitions all dumped here.                          */
  969.   /*                                                             */
  970.   /*  This file is part of REMIND.                               */
  971. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  972.   /*                                                             */
  973.   /***************************************************************/
  974.   /* Values */
  975. --- 5,11 ----
  976.   /*  Type definitions all dumped here.                          */
  977.   /*                                                             */
  978.   /*  This file is part of REMIND.                               */
  979. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  980.   /*                                                             */
  981.   /***************************************************************/
  982.   /* Values */
  983. *** ../p0/utils.c    Mon Nov  9 14:12:24 1992
  984. --- ./utils.c    Wed Dec 16 10:51:41 1992
  985. ***************
  986. *** 5,17 ****
  987.   /*  Useful utility functions.                                  */
  988.   /*                                                             */
  989.   /*  This file is part of REMIND.                               */
  990. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  991.   /*                                                             */
  992.   /***************************************************************/
  993.   
  994.   #include <string.h>
  995.   #include <stdio.h>
  996. - #include "config.h"
  997.   #ifdef HAVE_STDLIB_H
  998.   #include <stdlib.h>
  999.   #endif
  1000. --- 5,17 ----
  1001.   /*  Useful utility functions.                                  */
  1002.   /*                                                             */
  1003.   /*  This file is part of REMIND.                               */
  1004. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1005.   /*                                                             */
  1006.   /***************************************************************/
  1007.   
  1008. + #include "config.h"
  1009.   #include <string.h>
  1010.   #include <stdio.h>
  1011.   #ifdef HAVE_STDLIB_H
  1012.   #include <stdlib.h>
  1013.   #endif
  1014. ***************
  1015. *** 18,25 ****
  1016.   #ifdef HAVE_MALLOC_H
  1017.   #include <malloc.h>
  1018.   #endif
  1019.   
  1020. ! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
  1021.   
  1022.   /***************************************************************/
  1023.   /*                                                             */
  1024. --- 18,26 ----
  1025.   #ifdef HAVE_MALLOC_H
  1026.   #include <malloc.h>
  1027.   #endif
  1028. + #include <ctype.h>
  1029.   
  1030. ! #define UPPER(c) (islower(c) ? toupper(c) : c)
  1031.   
  1032.   /***************************************************************/
  1033.   /*                                                             */
  1034. *** ../p0/var.c    Mon Nov  9 14:12:25 1992
  1035. --- ./var.c    Wed Dec 16 10:51:42 1992
  1036. ***************
  1037. *** 6,17 ****
  1038.   /*  user- and system-defined variables.                        */
  1039.   /*                                                             */
  1040.   /*  This file is part of REMIND.                               */
  1041. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  1042.   /*                                                             */
  1043.   /***************************************************************/
  1044.   
  1045. - #include <stdio.h>
  1046.   #include "config.h"
  1047.   #ifdef HAVE_STDLIB_H
  1048.   #include <stdlib.h>
  1049.   #endif
  1050. --- 6,17 ----
  1051.   /*  user- and system-defined variables.                        */
  1052.   /*                                                             */
  1053.   /*  This file is part of REMIND.                               */
  1054. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1055.   /*                                                             */
  1056.   /***************************************************************/
  1057.   
  1058.   #include "config.h"
  1059. + #include <stdio.h>
  1060.   #ifdef HAVE_STDLIB_H
  1061.   #include <stdlib.h>
  1062.   #endif
  1063. ***************
  1064. *** 18,23 ****
  1065. --- 18,24 ----
  1066.   #ifdef HAVE_MALLOC_H
  1067.   #include <malloc.h>
  1068.   #endif
  1069. + #include <ctype.h>
  1070.   #include "types.h"
  1071.   #include "expr.h"
  1072.   #include "globals.h"
  1073. ***************
  1074. *** 24,30 ****
  1075.   #include "protos.h"
  1076.   #include "err.h"
  1077.   
  1078. ! #define UPPER(c) ( ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 'A' : (c) )
  1079.   
  1080.   /* The variable hash table */
  1081.   #define VAR_HASH_SIZE 64
  1082. --- 25,31 ----
  1083.   #include "protos.h"
  1084.   #include "err.h"
  1085.   
  1086. ! #define UPPER(c) (islower(c) ? toupper(c) : c)
  1087.   
  1088.   /* The variable hash table */
  1089.   #define VAR_HASH_SIZE 64
  1090. ***************
  1091. *** 377,383 ****
  1092.   
  1093.   /***************************************************************/
  1094.   /*                                                             */
  1095. ! /*  DoPreserve - delete a bunch of variables.                  */
  1096.   /*                                                             */
  1097.   /***************************************************************/
  1098.   #ifdef HAVE_PROTOS
  1099. --- 378,384 ----
  1100.   
  1101.   /***************************************************************/
  1102.   /*                                                             */
  1103. ! /*  DoPreserve - preserve a bunch of variables.                */
  1104.   /*                                                             */
  1105.   /***************************************************************/
  1106.   #ifdef HAVE_PROTOS
  1107.