home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume34 / remind / patch01b / patch.01.A < prev    next >
Encoding:
Text File  |  1992-12-18  |  31.9 KB  |  1,082 lines

  1. Prereq: "03.00.00"
  2. *** ../p0/version.h    Mon Nov  9 14:12:11 1992
  3. --- ./version.h    Wed Dec 16 10:51:27 1992
  4. ***************
  5. *** 5,12 ****
  6.   /*  What version of remind do we have?                         */
  7.   /*                                                             */
  8.   /*  This file is part of REMIND.                               */
  9. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  10.   /*                                                             */
  11.   /***************************************************************/
  12.   
  13. ! #define VERSION "03.00.00"
  14. --- 5,12 ----
  15.   /*  What version of remind do we have?                         */
  16.   /*                                                             */
  17.   /*  This file is part of REMIND.                               */
  18. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  19.   /*                                                             */
  20.   /***************************************************************/
  21.   
  22. ! #define VERSION "03.00.01"
  23. *** ../p0/MANIFEST.DOS    Mon Nov  9 14:12:36 1992
  24. --- ./MANIFEST.DOS    Wed Dec 16 10:51:55 1992
  25. ***************
  26. *** 1,6 ****
  27. --- 1,7 ----
  28.   calendar.c
  29.   config.h
  30.   copyrigh
  31. + defs.rem
  32.   dorem.c
  33.   dosubst.c
  34.   err.h
  35. ***************
  36. *** 18,23 ****
  37. --- 19,25 ----
  38.   main.c
  39.   makefile
  40.   makefile.msc
  41. + makefile.os2
  42.   makefile.tc
  43.   manifest.dos
  44.   manifest.unx
  45. ***************
  46. *** 25,36 ****
  47. --- 27,43 ----
  48.   protos.h
  49.   queue.c
  50.   readme.dos
  51. + readme.os2
  52.   readme.uni
  53.   rem
  54.   rem.1
  55. + rem2ps.1
  56. + rem2ps.c
  57. + rem2ps.h
  58.   remind-a.csh
  59.   remind-a.sh
  60.   remind.1
  61. + remind.def
  62.   test-rem
  63.   test.cmp
  64.   test.rem
  65. *** ../p0/MANIFEST.UNX    Mon Nov  9 14:12:36 1992
  66. --- ./MANIFEST.UNX    Wed Dec 16 10:51:55 1992
  67. ***************
  68. *** 1,6 ****
  69.   calendar.c
  70.   config.h
  71. ! COPYRIGHT
  72.   dorem.c
  73.   dosubst.c
  74.   err.h
  75. --- 1,14 ----
  76. + COPYRIGHT
  77. + MANIFEST.DOS
  78. + MANIFEST.UNX
  79. + Makefile
  80. + README.DOS
  81. + README.OS2
  82. + README.UNIX
  83. + WHATSNEW.30
  84.   calendar.c
  85.   config.h
  86. ! defs.rem
  87.   dorem.c
  88.   dosubst.c
  89.   err.h
  90. ***************
  91. *** 16,36 ****
  92.   lnk.msc
  93.   lnk.tc
  94.   main.c
  95. - Makefile
  96.   makefile.msc
  97.   makefile.tc
  98. - MANIFEST.DOS
  99. - MANIFEST.UNX
  100.   omit.c
  101.   protos.h
  102.   queue.c
  103. - README.DOS
  104. - README.UNIX
  105.   rem
  106.   rem.1
  107.   remind-all.csh
  108.   remind-all.sh
  109.   remind.1
  110.   test-rem
  111.   test.cmp
  112.   test.rem
  113. --- 24,44 ----
  114.   lnk.msc
  115.   lnk.tc
  116.   main.c
  117.   makefile.msc
  118. + makefile.os2
  119.   makefile.tc
  120.   omit.c
  121.   protos.h
  122.   queue.c
  123.   rem
  124.   rem.1
  125. + rem2ps.1
  126. + rem2ps.c
  127. + rem2ps.h
  128.   remind-all.csh
  129.   remind-all.sh
  130.   remind.1
  131. + remind.def
  132.   test-rem
  133.   test.cmp
  134.   test.rem
  135. ***************
  136. *** 41,44 ****
  137.   utils.c
  138.   var.c
  139.   version.h
  140. - WHATSNEW.30
  141. --- 49,51 ----
  142. *** ../p0/Makefile    Mon Nov  9 14:12:26 1992
  143. --- ./Makefile    Wed Dec 16 10:54:10 1992
  144. ***************
  145. *** 7,13 ****
  146.   # Uncomment the next line if you are running on a SYSV system
  147.   # SYSV= -DSYSV
  148.   
  149. ! # Uncomment the next line if you are running on any type of UNIX system
  150.   UNIX= -DUNIX
  151.   
  152.   # Uncomment the next line if you want to use gcc instead of default compiler
  153. --- 7,13 ----
  154.   # Uncomment the next line if you are running on a SYSV system
  155.   # SYSV= -DSYSV
  156.   
  157. ! # Uncomment the next line if you are running under UNIX (including SYSV!)
  158.   UNIX= -DUNIX
  159.   
  160.   # Uncomment the next line if you want to use gcc instead of default compiler
  161. ***************
  162. *** 17,27 ****
  163.   CFLAGS= -O -ansi
  164.   CDEFS=
  165.   
  166.   #-----------------------------------------------------------------------------
  167.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  168.   # in config.h; then, you should be able to type 'make'.
  169.   #-----------------------------------------------------------------------------
  170. ! VERSION= 03.00.00
  171.   
  172.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  173.   STDHDRS= config.h types.h protos.h globals.h err.h
  174. --- 17,51 ----
  175.   CFLAGS= -O -ansi
  176.   CDEFS=
  177.   
  178. + #### INSTALLATION LOCATIONS ####
  179. + # Note that I use 'cp' rather than 'install' for improved portability.
  180. + #
  181. + # BINDIR:  Where should the Remind executable be installed?
  182. + BINDIR= /usr/local/bin
  183. + # SCRIPTDIR:  Where should the kall and rem shell scripts be installed?
  184. + SCRIPTDIR= /usr/share/bin
  185. + # MANDIR:  Where should the man pages be installed?
  186. + MANDIR= /usr/local/man
  187. + # MANSECT:  Which man section should the man pages go into?
  188. + MANSECT= 1
  189. + # EXEMODE:  What file protection mode should be used for the executables?
  190. + EXEMODE= 755
  191. + # MANMODE:  What file protection mode should be used for the man pages?
  192. + MANMODE= 644
  193. + # OWNER:  What owner and group to use for executables, scripts and man pages?
  194. + OWNER=bin.bin
  195.   #-----------------------------------------------------------------------------
  196.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  197.   # in config.h; then, you should be able to type 'make'.
  198.   #-----------------------------------------------------------------------------
  199. ! VERSION= 03.00.01
  200.   
  201.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  202.   STDHDRS= config.h types.h protos.h globals.h err.h
  203. ***************
  204. *** 30,48 ****
  205.   
  206.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  207.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  208. ! makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1
  209.   
  210.   OBJS= $(SRCS:.c=.o)
  211.   
  212. ! remind: $(OBJS)
  213. !     $(CC) -o remind $(OBJS)
  214.   
  215.   .c.o:
  216.       $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
  217.   
  218.   clean:
  219.       rm -f *.o *~
  220.   
  221.   calendar.o: calendar.c $(STDHDRS) expr.h
  222.   dorem.o: dorem.c $(STDHDRS) expr.h
  223.   dosubst.o: dosubst.c $(STDHDRS)
  224. --- 54,79 ----
  225.   
  226.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  227.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  228. ! makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
  229. ! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
  230.   
  231.   OBJS= $(SRCS:.c=.o)
  232.   
  233. ! all: remind rem2ps
  234.   
  235.   .c.o:
  236.       $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
  237.   
  238. + rem2ps: rem2ps.o
  239. +     $(CC) -o rem2ps rem2ps.o
  240. + remind: $(OBJS)
  241. +     $(CC) -o remind $(OBJS)
  242.   clean:
  243.       rm -f *.o *~
  244.   
  245. + rem2ps.o: rem2ps.c
  246.   calendar.o: calendar.c $(STDHDRS) expr.h
  247.   dorem.o: dorem.c $(STDHDRS) expr.h
  248.   dosubst.o: dosubst.c $(STDHDRS)
  249. ***************
  250. *** 61,75 ****
  251.   var.o: var.c $(STDHDRS) expr.h
  252.   
  253.   tarZ:
  254. !     tar cvf remind-3.0.0.tar $(MANIFEST)
  255. !     compress -v remind-3.0.0.tar
  256.   
  257.   shar:
  258.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  259.   
  260.   todos:
  261. -     mdel 'a:*.*'
  262. -     mdel 'a:*'
  263.       mcopy -tn $(MANIFEST) a:
  264.   
  265.   fromdos:
  266. --- 92,104 ----
  267.   var.o: var.c $(STDHDRS) expr.h
  268.   
  269.   tarZ:
  270. !     tar cvf remind-3.0.1.tar $(MANIFEST)
  271. !     compress -v remind-3.0.1.tar
  272.   
  273.   shar:
  274.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  275.   
  276.   todos:
  277.       mcopy -tn $(MANIFEST) a:
  278.   
  279.   fromdos:
  280. ***************
  281. *** 76,81 ****
  282. --- 105,111 ----
  283.       mcopy -tn 'a:*' .
  284.       -mv -f copyrigh COPYRIGHT
  285.       -mv -f makefile Makefile
  286. +     -mv -f readme.os2 README.OS2
  287.       -mv -f readme.dos README.DOS
  288.       -mv -f readme.uni README.UNIX
  289.       -mv -f remind-a.csh remind-all.csh
  290. ***************
  291. *** 89,92 ****
  292.       cp $(MANIFEST) ../backup
  293.   
  294.   transmit:
  295. !     sz -a -Z -e $(MANIFEST)
  296. --- 119,154 ----
  297.       cp $(MANIFEST) ../backup
  298.   
  299.   transmit:
  300. !     sz -a -e $(MANIFEST)
  301. ! install:  install-bin install-scripts install-man
  302. ! install-bin: remind rem2ps
  303. !     cp remind $(BINDIR)/remind
  304. !     -chmod $(EXEMODE) $(BINDIR)/remind
  305. !     -chown $(OWNER) $(BINDIR)/remind
  306. !     cp rem2ps $(BINDIR)/rem2ps
  307. !     -chmod $(EXEMODE) $(BINDIR)/rem2ps
  308. !     -chown $(OWNER) $(BINDIR)/rem2ps
  309. ! install-scripts:
  310. !     cp kall $(SCRIPTDIR)/kall
  311. !     -chmod $(EXEMODE) $(SCRIPTDIR)/kall
  312. !     -chown $(OWNER) $(SCRIPTDIR)/kall
  313. !     cp rem $(SCRIPTDIR)/rem
  314. !     -chmod $(EXEMODE) $(SCRIPTDIR)/rem
  315. !     -chown $(OWNER) $(SCRIPTDIR)/rem
  316. ! install-man:
  317. !     cp remind.1 $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
  318. !     -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
  319. !     -chown $(OWNER) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
  320. !     cp rem.1 $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
  321. !     -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
  322. !     -chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
  323. !     cp kall.1 $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
  324. !     -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
  325. !     -chown $(OWNER) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
  326. !     cp rem2ps.1 $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
  327. !     -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
  328. !     -chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
  329. *** ../p0/README.DOS    Mon Nov  9 14:12:05 1992
  330. --- ./README.DOS    Wed Dec 16 10:51:22 1992
  331. ***************
  332. *** 15,19 ****
  333. --- 15,27 ----
  334.   
  335.   This will create REMIND.EXE, which is ready to be executed.
  336.   
  337. + The file "defs.rem" has some sample Remind definitions and commands.
  338.   --
  339.   David F. Skoll <dfs@doe.carleton.ca>
  340. + 4-317 LeBreton Street South
  341. + Ottawa, Ontario K1S 4L4
  342. + CANADA
  343. + Tel. (613) 567-3662
  344. *** ../p0/README.UNIX    Mon Nov  9 14:12:05 1992
  345. --- ./README.UNIX    Wed Dec 16 10:51:21 1992
  346. ***************
  347. *** 16,25 ****
  348.   
  349.   5 - Type 'make'
  350.   
  351. ! 6 - Type 'test-rem' to run the acceptance test
  352.   
  353. ! 7 - Copy the remind executable to the appropriate directory, and copy
  354. !     the man page to the man directory.
  355.   
  356.   Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
  357.   These allow automatic mailing of reminders to all users who create a
  358. --- 16,25 ----
  359.   
  360.   5 - Type 'make'
  361.   
  362. ! 6 - Type 'sh test-rem' to run the acceptance test
  363.   
  364. ! 7 - Type 'make install' to install Remind, kall, rem and the man
  365. !     pages.
  366.   
  367.   Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
  368.   These allow automatic mailing of reminders to all users who create a
  369. ***************
  370. *** 38,46 ****
  371. --- 38,61 ----
  372.   is provided.  You should examine the script to ensure that the defaults
  373.   are correct.
  374.   
  375. + Many people have asked me why I supply the "rem" script instead of
  376. + having Remind assume a default file.  The answer is: That's how I like
  377. + it!  My personal preference is for a program which normally takes
  378. + parameters to display usage information when invoked with no
  379. + parameters.  I like that behaviour so I can quickly get an idea of
  380. + what a program does without poring through the man page.  And I think
  381. + I'll keep Remind that way.  Sorry to all who dislike it. :-)
  382.   A shell script called "kall" is provided so you can kill your background
  383.   remind processes when you log out.  See the man page.  Note that kall
  384.   depends on the output of "ps", and may not be portable.
  385.   
  386. + The file "defs.rem" has some sample Remind definitions and commands.
  387.   --
  388.   David F. Skoll <dfs@doe.carleton.ca>
  389. + 4-317 LeBreton Street South
  390. + Ottawa, Ontario K1S 4L4
  391. + CANADA
  392. + Tel. (613) 567-3662
  393. *** ../p0/WHATSNEW.30    Mon Nov  9 14:12:37 1992
  394. --- ./WHATSNEW.30    Wed Dec 16 10:51:56 1992
  395. ***************
  396. *** 1,5 ****
  397. --- 1,50 ----
  398.   CHANGES TO REMIND
  399.   
  400. + *** PLEASE NOTE:  AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
  401. + 986 Eiffel Avenue,
  402. + Ottawa, Ontario
  403. + Canada
  404. + * Version 3.0 Patch 1
  405. + - Wrote the Rem2ps program to produce PostScript calendars
  406. + - Added an 'install' target to the Makefile
  407. + - Fixed a bug which allowed the shell() function to execute in timed
  408. +   reminders which were queued with RUN disabled.
  409. + - Added support for OS/2, courtesy of DARREL HANKERSON
  410. +   <HANK@DUCVAX.AUBURN.EDU>
  411. + - In expressions, can now specify literal dates as 'yyyy/mm/dd' rather than
  412. +   using the date() function.
  413. + - Fixed all the source files to include "config.h" first.
  414. + - Changed the way triggers are calculated so that trigger dates are 
  415. +   always valid if year, month and day are specified, and there is no
  416. +   UNTIL clause.  See MAN page section "DETAILS ABOUT TRIGVALID()."
  417. + - Defined _POSIX_SOURCE so Remind will compile on SGI workstations (and
  418. +   be more portable... I hope.)
  419. + - Fixed some rather brain-dead definitions of UPPER and LOWER, as pointed
  420. +   out by <rsalz@osf.org>
  421. + - Added more details to the Man page concerning how triggers are computed,
  422. +   and added warnings about computing OMIT dates.
  423. + - Added the file defs.rem which contains examples of useful definitions and
  424. +   triggers.
  425. + - Changed the script test-rem to be a sh script instead of csh for improved
  426. +   portability.
  427. + - Fixed up the README.* files to reflect the changes.
  428. + - Re-formatted the WHATSNEW.30 file.
  429.   * Version 3.0
  430.   
  431.   - Total rewrite from previous versions
  432. ***************
  433. *** 21,100 ****
  434.   - Fixed a lurking bug in trigger date calculation which, amazingly, had not
  435.     been caught in the couple of years that Remind has been out!
  436.   
  437. ! * Version 2.4 Patch 5 - Added the "c+n" option for printing a calendar by
  438. ! weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
  439.   
  440. ! * Version 2.3 Patch 4 - Made the init.c file nicer.  Made the Makefile
  441. ! prettier.  Added "make test", "make tar" and "make shar" Makefile targets.
  442.   
  443. ! * Version 2.3 Patch 3 - Added a command-line option for Remind to process
  444. ! queued reminders in the foreground.  This makes automatic termination
  445. ! of Remind processes from within X-Windows and Sunview easier.
  446.   
  447. ! * Version 2.3 Patch 2 - Fixed up a problem with timed reminders which resulted
  448. ! in cursor not starting from left side of screen on some systems.
  449.   
  450. ! Fixed the SIGINT handler for SYSV systems - this was interrupting the
  451. ! sleep(2) system call.
  452.   
  453. ! Closed stdin and stdout if remind was part of a pipe - this prevents other
  454. ! sections of the pipe from hanging as remind puts itself in the background.
  455.   
  456. ! Added the "-h" (Hush mode) option
  457.   
  458. ! Added the "%#" and "%@" modifiers for the current time.
  459.   
  460. ! Made the Makefile more portable
  461.   
  462. ! * Version 2.3 Patch 1 - Added the "-t" command-line option to get Remind
  463. ! to trigger all non-expired reminders.
  464.   
  465. ! Added Turbo C support courtesy of Rhys Weatherly
  466.   
  467. ! Added the "RUN ON" and "RUN OFF" commands for a secure interface with
  468. ! the Elm mail system.
  469.   
  470. ! Added the "rem" shell script for running Remind with a default script.
  471.   
  472. ! Added manual pages for "kall" and "rem".
  473.   
  474. ! * Version 2.3 - Added the UNTIL keyword for forcing reminders to expire.
  475.   
  476. ! Added the "++" form of 'back' and the "--" form of 'delta' for
  477. ! ignoring OMIT information.
  478.   
  479. ! Added the CLEAR-OMIT-CONTEXT, PUSH-OMIT-CONTEXT and POP-OMIT-CONTEXT
  480. ! keywords for isolating personal or peculiar reminders from the global
  481. ! OMIT context.
  482.   
  483. ! Speeded up the parsing of tokens.
  484.   
  485. ! Changed the source to recognize and exploit ANSI-C compilers which
  486. ! accept function prototypes.
  487.   
  488. ! Added the "-n" option to output the next occurrence of each reminder
  489. ! in SimpleCalendar format
  490.   
  491. ! Modified the calendar and SimpleCalendar formats so that the % escape
  492. ! substitutions ARE performed.
  493.   
  494. ! * Version 2.2 - Patch 5 - Added the BEFORE, AFTER and SKIP tokens to make the
  495. ! handling of holidays more sensible.  Also corrected a few more bugs.
  496.   
  497. ! * Version 2.2 - Patch 3  - Added the MSG or RUN tokens in an OMIT command; also
  498. ! allowed RUN-type reminders to be explicitly included in the calendar by
  499. ! using the %" escape sequence.
  500.   
  501. ! * Version 2.2 - Added the AT keyword, the timed reminders daemon, and the
  502. ! calendar facility.
  503.   
  504. ! * Version 2.1 - Added the "repeat" token for repeating reminders with a period
  505. ! other than 7 days.  Also fixed some bugs from version 2.0
  506.   
  507. ! * Version 2.0 - first public release.  Included advanced date specifications,
  508. ! character substitution, and the RUN keyword.
  509.   
  510. ! * Version 1.0 - never publicly released.
  511.   
  512.   
  513.   
  514. --- 66,169 ----
  515.   - Fixed a lurking bug in trigger date calculation which, amazingly, had not
  516.     been caught in the couple of years that Remind has been out!
  517.   
  518. ! * Version 2.4 Patch 5 
  519.   
  520. ! - Added the "c+n" option for printing a calendar by
  521. !   weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
  522.   
  523. ! * Version 2.3 Patch 4
  524.   
  525. ! - Made the init.c file nicer.  Made the Makefile
  526. !   prettier.  Added "make test", "make tar" and "make shar" Makefile targets.
  527.   
  528. ! * Version 2.3 Patch 3
  529.   
  530. ! - Added a command-line option for Remind to process
  531. !   queued reminders in the foreground.  This makes automatic termination
  532. !   of Remind processes from within X-Windows and Sunview easier.
  533.   
  534. ! * Version 2.3 Patch 2
  535.   
  536. ! - Fixed up a problem with timed reminders which resulted
  537. !   in cursor not starting from left side of screen on some systems.
  538.   
  539. ! - Fixed the SIGINT handler for SYSV systems - this was interrupting the
  540. !   sleep(2) system call.
  541.   
  542. ! - Closed stdin and stdout if remind was part of a pipe - this prevents other
  543. !   sections of the pipe from hanging as remind puts itself in the background.
  544.   
  545. ! - Added the "-h" (Hush mode) option
  546.   
  547. ! - Added the "%#" and "%@" modifiers for the current time.
  548.   
  549. ! - Made the Makefile more portable
  550.   
  551. ! * Version 2.3 Patch 1
  552.   
  553. ! - Added the "-t" command-line option to get Remind
  554. !   to trigger all non-expired reminders.
  555.   
  556. ! - Added Turbo C support courtesy of Rhys Weatherly
  557.   
  558. ! - Added the "RUN ON" and "RUN OFF" commands for a secure interface with
  559. !   the Elm mail system.
  560.   
  561. ! - Added the "rem" shell script for running Remind with a default script.
  562.   
  563. ! - Added manual pages for "kall" and "rem".
  564.   
  565. ! * Version 2.3
  566.   
  567. ! - Added the UNTIL keyword for forcing reminders to expire.
  568.   
  569. ! - Added the "++" form of 'back' and the "--" form of 'delta' for
  570. !   ignoring OMIT information.
  571.   
  572. ! - Added the CLEAR-OMIT-CONTEXT, PUSH-OMIT-CONTEXT and POP-OMIT-CONTEXT
  573. !   keywords for isolating personal or peculiar reminders from the global
  574. !   OMIT context.
  575.   
  576. ! - Speeded up the parsing of tokens.
  577.   
  578. ! - Changed the source to recognize and exploit ANSI-C compilers which
  579. !   accept function prototypes.
  580.   
  581. ! - Added the "-n" option to output the next occurrence of each reminder
  582. !   in SimpleCalendar format
  583.   
  584. ! - Modified the calendar and SimpleCalendar formats so that the % escape
  585. !   substitutions ARE performed.
  586. ! * Version 2.2 - Patch 5
  587. ! - Added the BEFORE, AFTER and SKIP tokens to make the
  588. !   handling of holidays more sensible.  Also corrected a few more bugs.
  589. ! * Version 2.2 - Patch 3
  590. ! - Added the MSG or RUN tokens in an OMIT command; also
  591. !   allowed RUN-type reminders to be explicitly included in the calendar by
  592. !   using the %" escape sequence.
  593. ! * Version 2.2
  594. ! - Added the AT keyword, the timed reminders daemon, and the
  595. !   calendar facility.
  596. ! * Version 2.1
  597. ! - Added the "repeat" token for repeating reminders with a period
  598. !   other than 7 days.  Also fixed some bugs from version 2.0
  599. ! * Version 2.0
  600. ! - first public release.  Included advanced date specifications,
  601. !   character substitution, and the RUN keyword.
  602. ! * Version 1.0
  603. ! - never publicly released.
  604.   
  605.   
  606.   
  607. *** ../p0/calendar.c    Mon Nov  9 14:12:13 1992
  608. --- ./calendar.c    Wed Dec 16 10:51:29 1992
  609. ***************
  610. *** 173,182 ****
  611. --- 173,202 ----
  612.   static void DoCalendarOneMonth()
  613.   #endif
  614.   {
  615. +    int y, m, d, mm, yy;
  616.      if (!DoSimpleCalendar) WriteCalHeader();
  617.   
  618. +    if (PsCal) {
  619. +       FromJulian(JulianToday, &y, &m, &d);
  620. +       printf("%s\n", PSBEGIN);
  621. +       printf("%s %d %d %d\n",
  622. +               MonthName[m], y, DaysInMonth(m, y), (JulianToday+1) % 7);
  623. +       mm = m-1;
  624. +       if (mm<0) {
  625. +          mm = 11; yy = y-1;
  626. +       } else yy=y;
  627. +       printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
  628. +       mm = m+1;
  629. +       if (mm>11) {
  630. +          mm = 0; yy = y+1;
  631. +       } else yy=y;
  632. +       printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
  633. +    }
  634.      while (WriteCalendarRow()) continue;
  635.   
  636. +    if (PsCal) printf("%s\n", PSEND);
  637.      if (!DoSimpleCalendar) WriteCalTrailer();
  638.   }   
  639.   
  640. *** ../p0/config.h    Mon Nov  9 14:12:07 1992
  641. --- ./config.h    Wed Dec 16 10:51:23 1992
  642. ***************
  643. *** 7,13 ****
  644.   /*  care of certain system dependencies.                       */
  645.   /*                                                             */
  646.   /*  This file is part of REMIND.                               */
  647. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  648.   /*                                                             */
  649.   /***************************************************************/
  650.   
  651. --- 7,13 ----
  652.   /*  care of certain system dependencies.                       */
  653.   /*                                                             */
  654.   /*  This file is part of REMIND.                               */
  655. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  656.   /*                                                             */
  657.   /***************************************************************/
  658.   
  659. ***************
  660. *** 109,115 ****
  661. --- 109,117 ----
  662.   /*---------------------------------------------------------------------*/
  663.   /* Do we have the <unistd.h> header?  If not, use sys/files.h          */
  664.   /*---------------------------------------------------------------------*/
  665. + #ifdef UNIX
  666.   #define HAVE_UNISTD 1
  667. + #endif
  668.   
  669.   /*---------------------------------------------------------------------*/
  670.   /* How many attempts to resolve a weird date spec?                     */
  671. ***************
  672. *** 151,153 ****
  673. --- 153,162 ----
  674.   /*---------------------------------------------------------------------*/
  675.   #define PUBLIC
  676.   #define PRIVATE static
  677. + #ifdef UNIX
  678. + #define _POSIX_SOURCE
  679. + #endif
  680. + #define PSBEGIN "# rem2ps begin"
  681. + #define PSEND   "# rem2ps end"
  682. *** ../p0/dorem.c    Mon Nov  9 14:12:13 1992
  683. --- ./dorem.c    Wed Dec 16 10:51:30 1992
  684. ***************
  685. *** 10,17 ****
  686.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  687.   /*                                                             */
  688.   /***************************************************************/
  689. - #include <stdio.h>
  690.   #include "config.h"
  691.   #ifdef HAVE_STDLIB_H
  692.   #include <stdlib.h>
  693.   #endif
  694. --- 10,17 ----
  695.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  696.   /*                                                             */
  697.   /***************************************************************/
  698.   #include "config.h"
  699. + #include <stdio.h>
  700.   #ifdef HAVE_STDLIB_H
  701.   #include <stdlib.h>
  702.   #endif
  703. *** ../p0/dosubst.c    Mon Nov  9 14:12:14 1992
  704. --- ./dosubst.c    Wed Dec 16 10:51:30 1992
  705. ***************
  706. *** 9,17 ****
  707.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  708.   /*                                                             */
  709.   /***************************************************************/
  710.   #include <stdio.h>
  711.   #include <ctype.h>
  712. - #include "config.h"
  713.   #ifdef HAVE_STDLIB_H
  714.   #include <stdlib.h>
  715.   #endif
  716. --- 9,17 ----
  717.   /*  Copyright (C) 1992 by David F. Skoll.                      */
  718.   /*                                                             */
  719.   /***************************************************************/
  720. + #include "config.h"
  721.   #include <stdio.h>
  722.   #include <ctype.h>
  723.   #ifdef HAVE_STDLIB_H
  724.   #include <stdlib.h>
  725.   #endif
  726. ***************
  727. *** 110,116 ****
  728.         if (err) return err;
  729.         if (c == '\n') continue;
  730.         if (!c) {
  731. !          if (mode != CAL_MODE) *s++ = '\n';
  732.        *s++ = 0;
  733.        break;
  734.         }
  735. --- 110,116 ----
  736.         if (err) return err;
  737.         if (c == '\n') continue;
  738.         if (!c) {
  739. !          if (mode != CAL_MODE && t->typ != RUN_TYPE) *s++ = '\n';
  740.        *s++ = 0;
  741.        break;
  742.         }
  743. ***************
  744. *** 346,352 ****
  745.           s += strlen(s);
  746.           break;
  747.   
  748. !          case '_': sprintf(s, "%s", NL);
  749.           s += strlen(s);
  750.           break;
  751.   
  752. --- 346,356 ----
  753.           s += strlen(s);
  754.           break;
  755.   
  756. !          case '_': 
  757. !             if (mode != CAL_MODE)
  758. !                sprintf(s, "%s", NL);
  759. !             else
  760. !                sprintf(s, " ");
  761.           s += strlen(s);
  762.           break;
  763.   
  764. *** ../p0/err.h    Mon Nov  9 14:12:07 1992
  765. --- ./err.h    Wed Dec 16 10:51:24 1992
  766. ***************
  767. *** 5,11 ****
  768.   /*  Error definitions.                                         */
  769.   /*                                                             */
  770.   /*  This file is part of REMIND.                               */
  771. ! /*  Copyright (C) 1991 by David F. Skoll.                      */
  772.   /*                                                             */
  773.   /***************************************************************/
  774.   
  775. --- 5,11 ----
  776.   /*  Error definitions.                                         */
  777.   /*                                                             */
  778.   /*  This file is part of REMIND.                               */
  779. ! /*  Copyright (C) 1992 by David F. Skoll.                      */
  780.   /*                                                             */
  781.   /***************************************************************/
  782.   
  783. *** ../p0/expr.c    Mon Nov  9 14:12:16 1992
  784. --- ./expr.c    Wed Dec 16 10:51:32 1992
  785. ***************
  786. *** 5,23 ****
  787.   /*  This file contains routines to parse and evaluate          */
  788.   /*  expressions.                                               */
  789.   /*                                                             */
  790. ! /*  Copyright 1991 by David F. Skoll.                          */
  791.   /*                                                             */
  792.   /***************************************************************/
  793.   
  794. ! /* If we're using Turbo C, turn off annoying warning messages! */
  795. ! #ifdef __TURBOC__
  796. ! #pragma warn -pia
  797. ! #endif
  798.   #include <stdio.h>
  799.   #include <ctype.h>
  800.   #include <string.h>
  801. - #include "config.h"
  802.   #ifdef HAVE_STDLIB_H
  803.   #include <stdlib.h>
  804.   #endif
  805. --- 5,18 ----
  806.   /*  This file contains routines to parse and evaluate          */
  807.   /*  expressions.                                               */
  808.   /*                                                             */
  809. ! /*  Copyright 1992 by David F. Skoll.                          */
  810.   /*                                                             */
  811.   /***************************************************************/
  812.   
  813. ! #include "config.h"
  814.   #include <stdio.h>
  815.   #include <ctype.h>
  816.   #include <string.h>
  817.   #ifdef HAVE_STDLIB_H
  818.   #include <stdlib.h>
  819.   #endif
  820. ***************
  821. *** 62,67 ****
  822. --- 57,63 ----
  823.   PRIVATE int MakeValue ARGS ((char *s, Value *v, Var *locals));
  824.   PRIVATE int PushOpStack ARGS ((Operator *op));
  825.   PRIVATE int PopOpStack ARGS ((Operator *op));
  826. + PRIVATE int ParseLiteralDate ARGS ((char **s, int *jul));
  827.   
  828.   /* Binary operators - all left-associative */
  829.   
  830. ***************
  831. *** 236,243 ****
  832.         if (c == '\"') return OK ; else return E_MISS_QUOTE;
  833.      }
  834.   
  835. !    if (!ISID(c)) return E_ILLEGAL_CHAR;
  836.   
  837.      /* Parse a constant, variable name or function */
  838.      while (ISID(**in) || **in == ':') *out++ = *(*in)++;
  839.   
  840. --- 232,249 ----
  841.         if (c == '\"') return OK ; else return E_MISS_QUOTE;
  842.      }
  843.   
  844. !    /* Dates can be specified with single-quotes */
  845. !    if (c == '\'') {
  846. !       while (**in) if ((c = *out++ = *(*in)++) == '\'') break;
  847. !       *out = 0;
  848. !       if (c == '\'') return OK ; else return E_MISS_QUOTE;
  849. !    }
  850.   
  851. +    if (!ISID(c)) {
  852. +       Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], c);
  853. +       return E_ILLEGAL_CHAR;
  854. +    }
  855.      /* Parse a constant, variable name or function */
  856.      while (ISID(**in) || **in == ':') *out++ = *(*in)++;
  857.   
  858. ***************
  859. *** 337,343 ****
  860.              r = Evaluate(s, locals);
  861.              if (r) return r;
  862.              if (*ExprBuf == ')') break;
  863. !            else if (*ExprBuf != ',') return E_ILLEGAL_CHAR;
  864.               }
  865.           if (f) r = CallFunc(f, args);
  866.           else {
  867. --- 343,352 ----
  868.              r = Evaluate(s, locals);
  869.              if (r) return r;
  870.              if (*ExprBuf == ')') break;
  871. !            else if (*ExprBuf != ',') {
  872. !            Eprint("Expecting comma, found '%c'", *ExprBuf);
  873. !               return E_ILLEGAL_CHAR;
  874. !                }
  875.               }
  876.           if (f) r = CallFunc(f, args);
  877.           else {
  878. ***************
  879. *** 352,358 ****
  880.               r = PushOpStack(f);
  881.               if (r) return r;
  882.           continue;  /* Still looking for an atomic vlue */
  883. !      } else if (!ISID(*ExprBuf) && *ExprBuf != '"') {
  884.           return E_ILLEGAL_CHAR;
  885.        } else { /* Must be a literal value */
  886.           r = MakeValue(ExprBuf, &va, locals);
  887. --- 361,368 ----
  888.               r = PushOpStack(f);
  889.               if (r) return r;
  890.           continue;  /* Still looking for an atomic vlue */
  891. !      } else if (!ISID(*ExprBuf) && *ExprBuf != '"' && *ExprBuf != '\'') {
  892. !             Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
  893.           return E_ILLEGAL_CHAR;
  894.        } else { /* Must be a literal value */
  895.           r = MakeValue(ExprBuf, &va, locals);
  896. ***************
  897. *** 408,415 ****
  898.   /***************************************************************/
  899.   /*                                                             */
  900.   /*  MakeValue                                                  */
  901. ! /*  Generate a literal value.  It's either a string, a number  */
  902. ! /*  or the value of a symbol.                                  */
  903.   /*                                                             */
  904.   /***************************************************************/
  905.   #ifdef HAVE_PROTOS
  906. --- 418,425 ----
  907.   /***************************************************************/
  908.   /*                                                             */
  909.   /*  MakeValue                                                  */
  910. ! /*  Generate a literal value.  It's either a string, a number, */
  911. ! /*  a date or the value of a symbol.                           */
  912.   /*                                                             */
  913.   /***************************************************************/
  914.   #ifdef HAVE_PROTOS
  915. ***************
  916. *** 435,440 ****
  917. --- 445,457 ----
  918.         strncpy(v->v.str, s+1, len-1);
  919.         *(v->v.str+len-1) = 0;
  920.         return OK;
  921. +    } else if (*s == '\'') { /* It's a literal date */
  922. +       s++;
  923. +       if ((r=ParseLiteralDate(&s, &h))) return r;
  924. +       if (*s != '\'') return E_BAD_DATE;
  925. +       v->type = DATE_TYPE;
  926. +       v->v.val = h;
  927. +       return OK;
  928.      } else if (isdigit(*s)) { /* It's a number - use len to hold it.*/
  929.         len = 0;
  930.         while (*s && isdigit(*s)) {
  931. ***************
  932. *** 640,670 ****
  933.              } else return E_2LOW;
  934.   
  935.           case STR_TYPE:
  936. -            y=0; m=0; d=0;
  937.              s = v->v.str;
  938. !            if (!isdigit(*s)) return E_CANT_COERCE;
  939. !            while (isdigit(*s)) {
  940. !           y *= 10;
  941. !           y += *s++ - '0';
  942. !            }
  943. !            if (*s++ != '/') return E_CANT_COERCE;
  944. !            if (!isdigit(*s)) return E_CANT_COERCE;
  945. !            while (isdigit(*s)) {
  946. !           m *= 10;
  947. !           m += *s++ - '0';
  948. !            }
  949. !            m--;
  950. !            if (*s++ != '/') return E_CANT_COERCE;
  951. !            if (!isdigit(*s)) return E_CANT_COERCE;
  952. !            while (isdigit(*s)) {
  953. !           d *= 10;
  954. !           d += *s++ - '0';
  955. !            }
  956. !            if (*s || y < BASE || y > BASE+YR_RANGE ||
  957. !             m>11 || d<1 || d>DaysInMonth(m, y)) return E_CANT_COERCE;
  958.              v->type = DATE_TYPE;
  959.              free(v->v.str);
  960. !            v->v.val = Julian(y, m, d);
  961.              return OK;
  962.   
  963.           default: return E_CANT_COERCE;
  964. --- 657,668 ----
  965.              } else return E_2LOW;
  966.   
  967.           case STR_TYPE:
  968.              s = v->v.str;
  969. !            if (ParseLiteralDate(&s, &i)) return E_CANT_COERCE;
  970. !            if (*s) return E_CANT_COERCE;
  971.              v->type = DATE_TYPE;
  972.              free(v->v.str);
  973. !            v->v.val = i;
  974.              return OK;
  975.   
  976.           default: return E_CANT_COERCE;
  977. ***************
  978. *** 1209,1212 ****
  979. --- 1207,1255 ----
  980.         dest->v.val = src->v.val;
  981.         return OK;
  982.      }
  983. + }
  984. + /***************************************************************/
  985. + /*                                                             */
  986. + /*  ParseLiteralDate                                           */
  987. + /*                                                             */
  988. + /*  Parse a literal date.  Return result in jul, update s.     */
  989. + /*                                                             */
  990. + /***************************************************************/
  991. + #ifdef HAVE_PROTOS
  992. + PRIVATE int ParseLiteralDate(char **s, int *jul)
  993. + #else
  994. + static int ParseLiteralDate(s, jul)
  995. + char **s;
  996. + int *jul;
  997. + #endif
  998. + {
  999. +    int y, m, d;
  1000. +    y=0; m=0; d=0;
  1001. +    if (!isdigit(**s)) return E_BAD_DATE;
  1002. +    while (isdigit(**s)) {
  1003. +       y *= 10;
  1004. +       y += *(*s)++ - '0';
  1005. +    }
  1006. +    if (*(*s)++ != '/') return E_BAD_DATE;
  1007. +    if (!isdigit(**s)) return E_BAD_DATE;
  1008. +    while (isdigit(**s)) {
  1009. +       m *= 10;
  1010. +       m += *(*s)++ - '0';
  1011. +    }
  1012. +    m--;
  1013. +    if (*(*s)++ != '/') return E_BAD_DATE;
  1014. +    if (!isdigit(**s)) return E_BAD_DATE;
  1015. +    while (isdigit(**s)) {
  1016. +       d *= 10;
  1017. +       d += *(*s)++ - '0';
  1018. +    }
  1019. +    if (y < BASE || y > BASE+YR_RANGE || m<0 ||
  1020. +         m>11 || d<1 || d>DaysInMonth(m, y)) return E_BAD_DATE;
  1021. +    *jul = Julian(y, m, d);
  1022. +    return OK;
  1023.   }
  1024.