home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-02-04 | 61.6 KB | 2,093 lines |
- Newsgroups: comp.sources.misc
- From: dfs@doe.carleton.ca (David F. Skoll)
- Subject: v35i019: remind - A replacement for calendar, Patch02b/3
- Message-ID: <1993Feb4.225748.21589@sparky.imd.sterling.com>
- X-Md4-Signature: 5b8347a9521d953bbe634a05465b7f89
- Date: Thu, 4 Feb 1993 22:57:48 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: dfs@doe.carleton.ca (David F. Skoll)
- Posting-number: Volume 35, Issue 19
- Archive-name: remind/patch02b
- Environment: UNIX, MS-DOS
- Patch-To: remind: Volume 33, Issue 58-69
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: patch.02.A
- # Wrapped by kent@sparky on Tue Feb 2 08:40:57 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 2 (of 3)."'
- if test -f 'patch.02.A' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patch.02.A'\"
- else
- echo shar: Extracting \"'patch.02.A'\" \(59033 characters\)
- sed "s/^X//" >'patch.02.A' <<'END_OF_FILE'
- XPrereq: "03.00.01"
- X*** ../patch1/version.h Wed Dec 16 10:51:27 1992
- X--- ./version.h Fri Jan 8 13:22:45 1993
- X***************
- X*** 5,12 ****
- X /* What version of remind do we have? */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X! #define VERSION "03.00.01"
- X--- 5,12 ----
- X /* What version of remind do we have? */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X! #define VERSION "03.00.02"
- X*** ../patch1/COPYRIGHT Wed Dec 16 10:51:23 1992
- X--- ./COPYRIGHT Fri Jan 8 13:26:53 1993
- X***************
- X*** 3,10 ****
- X REMIND refers to the entire set of files and documentation in the
- X REMIND package.
- X
- X! REMIND is Copyright 1990, 1991, 1992 by David Skoll, except for the
- X! file remind-all.sh, which is Copyright 1990 by Bill Aten.
- X
- X You may use REMIND for free, and may freely distribute it, providing
- X you do not charge the recipients to whom you distribute REMIND.
- X--- 3,10 ----
- X REMIND refers to the entire set of files and documentation in the
- X REMIND package.
- X
- X! REMIND is Copyright 1990, 1991, 1992, 1993 by David Skoll, except for
- X! the file remind-all.sh, which is Copyright 1990 by Bill Aten.
- X
- X You may use REMIND for free, and may freely distribute it, providing
- X you do not charge the recipients to whom you distribute REMIND.
- X***************
- X*** 16,23 ****
- X
- X You may incorporate parts of REMIND into your own programs, providing
- X you do not sell these programs. You must clearly indicate that the
- X! parts of REMIND you have incorporated are Copyright 1990, 1991, 1992
- X! by David Skoll.
- X
- X I will attempt to support REMIND as much as possible. However, you
- X use it at your own risk. I am not responsible for any damages caused
- X--- 16,23 ----
- X
- X You may incorporate parts of REMIND into your own programs, providing
- X you do not sell these programs. You must clearly indicate that the
- X! parts of REMIND you have incorporated are Copyright 1990, 1991, 1992,
- X! 1993 by David Skoll.
- X
- X I will attempt to support REMIND as much as possible. However, you
- X use it at your own risk. I am not responsible for any damages caused
- X*** ../patch1/MANIFEST.DOS Wed Dec 16 10:51:55 1992
- X--- ./MANIFEST.DOS Mon Jan 25 15:40:01 1993
- X***************
- X*** 4,19 ****
- X--- 4,22 ----
- X defs.rem
- X dorem.c
- X dosubst.c
- X+ english.h
- X err.h
- X expr.c
- X expr.h
- X files.c
- X funcs.c
- X+ german.h
- X globals.c
- X globals.h
- X init.c
- X kall
- X kall.1
- X+ lang.h
- X lnk.msc
- X lnk.tc
- X main.c
- X***************
- X*** 43,48 ****
- X--- 46,52 ----
- X test.rem
- X token.c
- X trigger.c
- X+ tstlang.rem
- X types.h
- X userfns.c
- X utils.c
- X*** ../patch1/MANIFEST.UNX Wed Dec 16 10:51:55 1992
- X--- ./MANIFEST.UNX Mon Jan 25 15:39:51 1993
- X***************
- X*** 11,26 ****
- X--- 11,29 ----
- X defs.rem
- X dorem.c
- X dosubst.c
- X+ english.h
- X err.h
- X expr.c
- X expr.h
- X files.c
- X funcs.c
- X+ german.h
- X globals.c
- X globals.h
- X init.c
- X kall
- X kall.1
- X+ lanh.h
- X lnk.msc
- X lnk.tc
- X main.c
- X***************
- X*** 44,49 ****
- X--- 47,53 ----
- X test.rem
- X token.c
- X trigger.c
- X+ tstlang.rem
- X types.h
- X userfns.c
- X utils.c
- X*** ../patch1/Makefile Wed Dec 16 10:54:10 1992
- X--- ./Makefile Mon Jan 25 15:39:39 1993
- X***************
- X*** 45,54 ****
- X # YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
- X # in config.h; then, you should be able to type 'make'.
- X #-----------------------------------------------------------------------------
- X! VERSION= 03.00.01
- X
- X! HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
- X! STDHDRS= config.h types.h protos.h globals.h err.h
- X SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
- X main.c omit.c queue.c token.c trigger.c userfns.c utils.c var.c
- X
- X--- 45,54 ----
- X # YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
- X # in config.h; then, you should be able to type 'make'.
- X #-----------------------------------------------------------------------------
- X! VERSION= 03.00.02
- X
- X! HDRS= config.h err.h expr.h globals.h protos.h types.h version.h lang.h
- X! STDHDRS= config.h types.h protos.h globals.h err.h lang.h
- X SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
- X main.c omit.c queue.c token.c trigger.c userfns.c utils.c var.c
- X
- X***************
- X*** 55,61 ****
- X MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
- X remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
- X makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
- X! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
- X
- X OBJS= $(SRCS:.c=.o)
- X
- X--- 55,62 ----
- X MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
- X remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
- X makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
- X! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
- X! lang.h english.h german.h tstlang.rem
- X
- X OBJS= $(SRCS:.c=.o)
- X
- X***************
- X*** 73,79 ****
- X clean:
- X rm -f *.o *~
- X
- X! rem2ps.o: rem2ps.c
- X calendar.o: calendar.c $(STDHDRS) expr.h
- X dorem.o: dorem.c $(STDHDRS) expr.h
- X dosubst.o: dosubst.c $(STDHDRS)
- X--- 74,86 ----
- X clean:
- X rm -f *.o *~
- X
- X! clobber:
- X! rm -f *.o *~ remind rem2ps test.out
- X!
- X! test: remind
- X! sh test-rem
- X!
- X! rem2ps.o: rem2ps.c rem2ps.h lang.h config.h
- X calendar.o: calendar.c $(STDHDRS) expr.h
- X dorem.o: dorem.c $(STDHDRS) expr.h
- X dosubst.o: dosubst.c $(STDHDRS)
- X***************
- X*** 80,86 ****
- X expr.o: expr.c $(STDHDRS) expr.h
- X files.o: files.c $(STDHDRS)
- X funcs.o: funcs.c $(STDHDRS) expr.h version.h
- X! globals.o: globals.c config.h types.h globals.h err.h
- X init.o: init.c $(STDHDRS) expr.h version.h
- X main.o: main.c $(STDHDRS) expr.h
- X omit.o: omit.c $(STDHDRS)
- X--- 87,93 ----
- X expr.o: expr.c $(STDHDRS) expr.h
- X files.o: files.c $(STDHDRS)
- X funcs.o: funcs.c $(STDHDRS) expr.h version.h
- X! globals.o: globals.c config.h types.h globals.h err.h lang.h
- X init.o: init.c $(STDHDRS) expr.h version.h
- X main.o: main.c $(STDHDRS) expr.h
- X omit.o: omit.c $(STDHDRS)
- X***************
- X*** 92,99 ****
- X var.o: var.c $(STDHDRS) expr.h
- X
- X tarZ:
- X! tar cvf remind-3.0.1.tar $(MANIFEST)
- X! compress -v remind-3.0.1.tar
- X
- X shar:
- X shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
- X--- 99,106 ----
- X var.o: var.c $(STDHDRS) expr.h
- X
- X tarZ:
- X! tar cvf remind-3.0.2.tar $(MANIFEST)
- X! compress -v remind-3.0.2.tar
- X
- X shar:
- X shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
- X*** ../patch1/README.DOS Wed Dec 16 10:51:22 1992
- X--- ./README.DOS Fri Jan 22 11:08:58 1993
- X***************
- X*** 17,22 ****
- X--- 17,43 ----
- X
- X The file "defs.rem" has some sample Remind definitions and commands.
- X
- X+ OTHER LANGUAGE SUPPORT
- X+
- X+ Remind has limited support for languages other than English. See the file
- X+ "lang.h" for details. Only the substitution filter and names of days and
- X+ months are affected - error and usage messages are still in English.
- X+
- X+ If you add support for a non-English language, Remind will accept both the
- X+ English and non-English names of months and weekdays in an input script.
- X+ However, you should not rely on this feature if you want to write portable
- X+ Remind scripts.
- X+
- X+ Take a look at the files "english.h" and "german.h" if you want to add
- X+ support for your favourite language. If you do add another language
- X+ to Remind, please let me know! Here are the basic guidelines:
- X+
- X+ - Your language file should be called "lxxx.h", where lxxx is the first 8
- X+ characters of the ENGLISH name of your language.
- X+
- X+ - You should define L_LANGNAME to be the full English name of your language,
- X+ with the first letter capitalized and the rest lower-case.
- X+
- X --
- X David F. Skoll <dfs@doe.carleton.ca>
- X 4-317 LeBreton Street South
- X*** ../patch1/README.OS2 Wed Dec 16 10:52:02 1992
- X--- ./README.OS2 Fri Jan 22 11:08:54 1993
- X***************
- X*** 25,30 ****
- X--- 25,51 ----
- X OS/2 support is courtesy of DARREL HANKERSON <HANK@DUCVAX.AUBURN.EDU>.
- X However, if you have problems, please contact me and not Darrel.
- X
- X+ OTHER LANGUAGE SUPPORT
- X+
- X+ Remind has limited support for languages other than English. See the file
- X+ "lang.h" for details. Only the substitution filter and names of days and
- X+ months are affected - error and usage messages are still in English.
- X+
- X+ If you add support for a non-English language, Remind will accept both the
- X+ English and non-English names of months and weekdays in an input script.
- X+ However, you should not rely on this feature if you want to write portable
- X+ Remind scripts.
- X+
- X+ Take a look at the files "english.h" and "german.h" if you want to add
- X+ support for your favourite language. If you do add another language
- X+ to Remind, please let me know! Here are the basic guidelines:
- X+
- X+ - Your language file should be called "lxxx.h", where lxxx is the first 8
- X+ characters of the ENGLISH name of your language.
- X+
- X+ - You should define L_LANGNAME to be the full English name of your language,
- X+ with the first letter capitalized and the rest lower-case.
- X+
- X --
- X David F. Skoll <dfs@doe.carleton.ca>
- X 4-317 LeBreton Street South
- X*** ../patch1/README.UNIX Wed Dec 16 10:51:21 1992
- X--- ./README.UNIX Fri Jan 29 13:43:01 1993
- X***************
- X*** 14,24 ****
- X
- X 4 - Examine the file config.h and adjust parameters as needed
- X
- X! 5 - Type 'make'
- X
- X! 6 - Type 'sh test-rem' to run the acceptance test
- X
- X! 7 - Type 'make install' to install Remind, kall, rem and the man
- X pages.
- X
- X Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
- X--- 14,27 ----
- X
- X 4 - Examine the file config.h and adjust parameters as needed
- X
- X! 5 - Examine lang.h and choose the language you want Remind to use.
- X
- X! 6 - Type 'make'
- X
- X! 7 - Type 'sh test-rem' or 'make test' to run the acceptance test. Note
- X! that the test script works only for the English version of Remind.
- X!
- X! 8 - Type 'make install' to install Remind, kall, rem and the man
- X pages.
- X
- X Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
- X***************
- X*** 51,56 ****
- X--- 54,81 ----
- X depends on the output of "ps", and may not be portable.
- X
- X The file "defs.rem" has some sample Remind definitions and commands.
- X+
- X+ OTHER LANGUAGE SUPPORT
- X+
- X+ Remind has limited support for languages other than English. See the file
- X+ "lang.h" for details. Only the substitution filter and names of days and
- X+ months are affected - error and usage messages are still in English.
- X+
- X+ If you add support for a non-English language, Remind will accept both the
- X+ English and non-English names of months and weekdays in an input script.
- X+ However, you should not rely on this feature if you want to write portable
- X+ Remind scripts.
- X+
- X+ Take a look at the files "english.h" and "german.h" if you want to add
- X+ support for your favourite language. If you do add another language
- X+ to Remind, please let me know! Here are the basic guidelines:
- X+
- X+ - Your language file should be called "lxxx.h", where lxxx is the first 8
- X+ characters of the ENGLISH name of your language.
- X+
- X+ - Your language file should define L_LANGNAME to be the full English
- X+ name of your language, with the first letter capitalized and the rest
- X+ lower-case.
- X
- X --
- X David F. Skoll <dfs@doe.carleton.ca>
- X*** ../patch1/WHATSNEW.30 Wed Dec 16 10:51:56 1992
- X--- ./WHATSNEW.30 Mon Feb 1 12:29:52 1993
- X***************
- X*** 2,10 ****
- X
- X *** PLEASE NOTE: AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
- X 986 Eiffel Avenue,
- X! Ottawa, Ontario
- X Canada
- X
- X * Version 3.0 Patch 1
- X
- X - Wrote the Rem2ps program to produce PostScript calendars
- X--- 2,50 ----
- X
- X *** PLEASE NOTE: AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
- X 986 Eiffel Avenue,
- X! Ottawa, Ontario K2C 0J2
- X Canada
- X
- X+ * Version 3.0 Patch 2
- X+
- X+ - Added the -u option to Remind so that root can run it as any user.
- X+ This simplifies the remind-all scripts, and makes them more efficient.
- X+ If you are worried that this option is a security hole, you can
- X+ disable it in config.h
- X+
- X+ - Changed the RUN command so that RUN OFF can be used anywhere, even
- X+ though RUN ON only works in the top-level file. This eases the
- X+ management of global files which may want to switch RUN OFF.
- X+
- X+ - Added ISO encoding (ISO 8859-1) to the PostScript output, courtesy of
- X+ Michael Salmon. This can be selected with the '-i' option in rem2ps.
- X+
- X+ - Added support for the '-' date separator as well as the '/' separator.
- X+
- X+ - Added support for languages other than English. Note that this support
- X+ is not complete - error messages are still in English. The idea and
- X+ German translation came from Wolfgang Thronicke.
- X+
- X+ - Changed the -w option to include the "padding" and "spacing" options.
- X+ NOTE INCOMPATIBILITY: In the previous patch level, creating a weekly
- X+ calendar using the -c+n option left no blank lines between the day
- X+ number and the first reminder entry. This has been changed so that one
- X+ blank line is left. To revert to the old behaviour, use the "-w,,0"
- X+ option.
- X+
- X+ - Added the -o option to Rem2ps. This allows you to specify the margins
- X+ when producing a PostScript calendar.
- X+
- X+ - Updated the copyright notices in all the files. :-)
- X+
- X+ - Added 'make clobber' and 'make test' targets to the Unix makefile.
- X+
- X+ - Corrected typos in WHATSNEW.30 and remind.1 man page. Thanks to
- X+ Dave Wolfe <dwolfe@pffft.sps.mot.com>
- X+
- X+ - Changed Remind so that supplying the -a option causes timed reminders
- X+ not to be placed into the calendar in calendar mode.
- X+
- X * Version 3.0 Patch 1
- X
- X - Wrote the Rem2ps program to produce PostScript calendars
- X***************
- X*** 66,72 ****
- X - Fixed a lurking bug in trigger date calculation which, amazingly, had not
- X been caught in the couple of years that Remind has been out!
- X
- X! * Version 2.4 Patch 5
- X
- X - Added the "c+n" option for printing a calendar by
- X weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
- X--- 106,112 ----
- X - Fixed a lurking bug in trigger date calculation which, amazingly, had not
- X been caught in the couple of years that Remind has been out!
- X
- X! * Version 2.3 Patch 5
- X
- X - Added the "c+n" option for printing a calendar by
- X weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
- X*** ../patch1/calendar.c Wed Dec 16 10:51:29 1992
- X--- ./calendar.c Fri Jan 22 10:26:13 1993
- X***************
- X*** 5,11 ****
- X /* The code for generating a calendar. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X--- 5,11 ----
- X /* The code for generating a 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***************
- X*** 105,111 ****
- X static void DoCalendarOneWeek()
- X #endif
- X {
- X! int y, m, d, done, i;
- X char buf[81];
- X int LinesWritten = 0;
- X int OrigJul = JulianToday;
- X--- 105,111 ----
- X static void DoCalendarOneWeek()
- X #endif
- X {
- X! int y, m, d, done, i, l;
- X char buf[81];
- X int LinesWritten = 0;
- X int OrigJul = JulianToday;
- X***************
- X*** 118,124 ****
- X
- X /* Output the entries */
- X
- X! /* Here come the first two lines... */
- X putchar('|');
- X for (i=0; i<7; i++) {
- X FromJulian(OrigJul+i, &y, &m, &d);
- X--- 118,124 ----
- X
- X /* Output the entries */
- X
- X! /* Here come the first few lines... */
- X putchar('|');
- X for (i=0; i<7; i++) {
- X FromJulian(OrigJul+i, &y, &m, &d);
- X***************
- X*** 131,144 ****
- X putchar('|');
- X }
- X putchar('\n');
- X! /*** Take out blank line in weekly calendar display - takes up room
- X! putchar('|');
- X! for (i=0; i<7; i++) {
- X! PrintLeft("", ColSpaces, ' ');
- X putchar('|');
- X }
- X! putchar('\n');
- X! ***/
- X /* Write the body lines */
- X done = 0;
- X while (!done) {
- X--- 131,145 ----
- X putchar('|');
- X }
- X putchar('\n');
- X! for (l=0; l<CalPad; l++) {
- X putchar('|');
- X+ for (i=0; i<7; i++) {
- X+ PrintLeft("", ColSpaces, ' ');
- X+ putchar('|');
- X+ }
- X+ putchar('\n');
- X }
- X!
- X /* Write the body lines */
- X done = 0;
- X while (!done) {
- X***************
- X*** 147,153 ****
- X }
- X
- X /* Write any blank lines required */
- X! while (LinesWritten++ < CAL_LINES) {
- X putchar('|');
- X for (i=0; i<7; i++) {
- X PrintLeft("", ColSpaces, ' ');
- X--- 148,154 ----
- X }
- X
- X /* Write any blank lines required */
- X! while (LinesWritten++ < CalLines) {
- X putchar('|');
- X for (i=0; i<7; i++) {
- X PrintLeft("", ColSpaces, ' ');
- X***************
- X*** 213,219 ****
- X static int WriteCalendarRow()
- X #endif
- X {
- X! int y, m, d, wd, i;
- X int done;
- X char buf[81];
- X int OrigJul = JulianToday;
- X--- 214,220 ----
- X static int WriteCalendarRow()
- X #endif
- X {
- X! int y, m, d, wd, i, l;
- X int done;
- X char buf[81];
- X int OrigJul = JulianToday;
- X***************
- X*** 241,247 ****
- X }
- X
- X
- X! /* Here come the first two lines... */
- X putchar('|');
- X for (i=0; i<7; i++) {
- X if (i < wd || d+i-wd>DaysInMonth(m, y))
- X--- 242,248 ----
- X }
- X
- X
- X! /* Here come the first few lines... */
- X putchar('|');
- X for (i=0; i<7; i++) {
- X if (i < wd || d+i-wd>DaysInMonth(m, y))
- X***************
- X*** 253,264 ****
- X putchar('|');
- X }
- X putchar('\n');
- X! putchar('|');
- X! for (i=0; i<7; i++) {
- X! PrintLeft("", ColSpaces, ' ');
- X putchar('|');
- X }
- X- putchar('\n');
- X
- X /* Write the body lines */
- X done = 0;
- X--- 254,267 ----
- X putchar('|');
- X }
- X putchar('\n');
- X! for (l=0; l<CalPad; l++) {
- X putchar('|');
- X+ for (i=0; i<7; i++) {
- X+ PrintLeft("", ColSpaces, ' ');
- X+ putchar('|');
- X+ }
- X+ putchar('\n');
- X }
- X
- X /* Write the body lines */
- X done = 0;
- X***************
- X*** 268,274 ****
- X }
- X
- X /* Write any blank lines required */
- X! while (LinesWritten++ < CAL_LINES) {
- X putchar('|');
- X for (i=0; i<7; i++) {
- X PrintLeft("", ColSpaces, ' ');
- X--- 271,277 ----
- X }
- X
- X /* Write any blank lines required */
- X! while (LinesWritten++ < CalLines) {
- X putchar('|');
- X for (i=0; i<7; i++) {
- X PrintLeft("", ColSpaces, ' ');
- X***************
- X*** 615,620 ****
- X--- 618,627 ----
- X /* Parse the trigger date and time */
- X if (r=ParseRem(p, &trig, &tim)) return r;
- X
- X+ /* Don't include timed reminders in calendar if -a option supplied. */
- X+ #ifdef HAVE_QUEUED
- X+ if (DontIssueAts && tim.ttime != NO_TIME) return OK;
- X+ #endif
- X if (trig.typ == NO_TYPE) return E_EOLN;
- X if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
- X /* Calculate the trigger date */
- X***************
- X*** 666,672 ****
- X
- X FromJulian(jul, &y, &m, &d);
- X while(e) {
- X! printf("%04d/%02d/%02d ", y, m+1, d);
- X printf("%s\n", e->text);
- X free(e->text);
- X n = e->next;
- X--- 673,679 ----
- X
- X FromJulian(jul, &y, &m, &d);
- X while(e) {
- X! printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
- X printf("%s\n", e->text);
- X free(e->text);
- X n = e->next;
- X***************
- X*** 812,815 ****
- X }
- X }
- X }
- X-
- X--- 819,821 ----
- X*** ../patch1/config.h Wed Dec 16 10:51:23 1992
- X--- ./config.h Mon Feb 1 12:21:15 1993
- X***************
- X*** 7,15 ****
- X /* care of certain system dependencies. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X /*---------------------------------------------------------------------*/
- X /* STRSTR: If your system does not have the "strstr" function, */
- X--- 7,29 ----
- X /* care of certain system dependencies. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X+
- X+ /*---------------------------------------------------------------------*/
- X+ /* DATESEP: The default date separator. North American usage is '/'; */
- X+ /* others may prefer '-'. */
- X+ /*---------------------------------------------------------------------*/
- X+ #define DATESEP '/'
- X+ /* #define DATESEP '-' */
- X+
- X+ /*---------------------------------------------------------------------*/
- X+ /* WANT_U_OPTION: Comment out the next define to permanently disable */
- X+ /* the -u option. If you do this, however, remind-all.[c]sh will not */
- X+ /* work. */
- X+ /*---------------------------------------------------------------------*/
- X+ #define WANT_U_OPTION 1
- X
- X /*---------------------------------------------------------------------*/
- X /* STRSTR: If your system does not have the "strstr" function, */
- X*** ../patch1/defs.rem Wed Dec 16 10:51:58 1992
- X--- ./defs.rem Fri Jan 8 13:26:17 1993
- X***************
- X*** 6,12 ****
- X # Cut and paste as desired!
- X #
- X # This file is part of REMIND.
- X! # Copyright (C) 1992 by David F. Skoll
- X #
- X # ---------------------------------------------------------------------------
- X
- X--- 6,12 ----
- X # Cut and paste as desired!
- X #
- X # This file is part of REMIND.
- X! # Copyright (C) 1992, 1993 by David F. Skoll
- X #
- X # ---------------------------------------------------------------------------
- X
- X*** ../patch1/dorem.c Wed Dec 16 10:51:30 1992
- X--- ./dorem.c Fri Jan 22 10:25:12 1993
- X***************
- X*** 7,13 ****
- X /* commands. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X--- 7,13 ----
- X /* commands. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X***************
- X*** 415,421 ****
- X if (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) return r;
- X if (!*SubstBuffer) return OK;
- X FromJulian(jul, &y, &m, &d);
- X! printf("%04d/%02d/%02d %s%s\n", y, m+1, d,
- X SimpleTime(tim->ttime, NULL),
- X SubstBuffer);
- X return OK;
- X--- 415,421 ----
- X if (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) return r;
- X if (!*SubstBuffer) return OK;
- X FromJulian(jul, &y, &m, &d);
- X! printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
- X SimpleTime(tim->ttime, NULL),
- X SubstBuffer);
- X return OK;
- X*** ../patch1/dosubst.c Wed Dec 16 10:51:30 1992
- X--- ./dosubst.c Mon Jan 25 16:09:28 1993
- X***************
- X*** 6,14 ****
- X /* reminders are triggered. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X #include <stdio.h>
- X #include <ctype.h>
- X--- 6,15 ----
- X /* reminders are triggered. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X+ #define L_IN_DOSUBST
- X #include "config.h"
- X #include <stdio.h>
- X #include <ctype.h>
- X***************
- X*** 29,36 ****
- X #define NL "\n"
- X #endif
- X
- X! static char TODAY[] = "today";
- X! static char TOMORROW[] = "tomorrow";
- X
- X /***************************************************************/
- X /* */
- X--- 30,37 ----
- X #define NL "\n"
- X #endif
- X
- X! static char TODAY[] = L_TODAY;
- X! static char TOMORROW[] = L_TOMORROW;
- X
- X /***************************************************************/
- X /* */
- X***************
- X*** 74,82 ****
- X adiff = ABS(tdiff);
- X mdiff = adiff % 60;
- X hdiff = adiff / 60;
- X! mplu = (mdiff == 1 ? "" : "s");
- X! hplu = (hdiff == 1 ? "" : "s");
- X! when = (tdiff < 0 ? "ago" : "from now");
- X
- X h = tim / 60;
- X min = tim % 60;
- X--- 75,83 ----
- X adiff = ABS(tdiff);
- X mdiff = adiff % 60;
- X hdiff = adiff / 60;
- X! mplu = (mdiff == 1 ? "" : L_MPLU);
- X! hplu = (hdiff == 1 ? "" : L_HPLU);
- X! when = (tdiff < 0 ? L_AGO : L_FROMNOW);
- X
- X h = tim / 60;
- X min = tim % 60;
- X***************
- X*** 90,95 ****
- X--- 91,99 ----
- X cpm = (ch < 12) ? "am" : "pm";
- X chh = (ch == 12) ? 12 : ch % 12;
- X
- X+ #ifdef L_ORDINAL_OVERRIDE
- X+ L_ORDINAL_OVERRIDE
- X+ #else
- X switch(d) {
- X case 1:
- X case 21:
- X***************
- X*** 103,109 ****
- X
- X default: plu = "th"; break;
- X }
- X!
- X
- X while(1) {
- X c = ParseChar(p, &err, 0);
- X--- 107,113 ----
- X
- X default: plu = "th"; break;
- X }
- X! #endif
- X
- X while(1) {
- X c = ParseChar(p, &err, 0);
- X***************
- X*** 128,146 ****
- X done = 0;
- X if (diff <= 1) {
- X switch(UPPER(c)) {
- X case 'A':
- X case 'B':
- X case 'C':
- X case 'E':
- X case 'F':
- X case 'G':
- X case 'H':
- X case 'I':
- X case 'J':
- X case 'K':
- X case 'L':
- X case 'U':
- X! case 'V': sprintf(s, "%s", (diff ? TOMORROW : TODAY));
- X s += strlen(s);
- X done = 1;
- X break;
- X--- 132,177 ----
- X done = 0;
- X if (diff <= 1) {
- X switch(UPPER(c)) {
- X+ #ifndef L_NOTOMORROW_A
- X case 'A':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_B
- X case 'B':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_C
- X case 'C':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_E
- X case 'E':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_F
- X case 'F':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_G
- X case 'G':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_H
- X case 'H':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_I
- X case 'I':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_J
- X case 'J':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_K
- X case 'K':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_L
- X case 'L':
- X+ #endif
- X+ #ifndef L_NOTOMORROW_U
- X case 'U':
- X! #endif
- X! #ifndef L_NOTOMORROW_V
- X! case 'V':
- X! #endif
- X! sprintf(s, "%s", (diff ? TOMORROW : TODAY));
- X s += strlen(s);
- X done = 1;
- X break;
- X***************
- X*** 151,348 ****
- X
- X if (!done) switch(UPPER(c)) {
- X case 'A':
- X! sprintf(s, "on %s, %d %s, %d", DayName[jul%7], d,
- X MonthName[m], y);
- X s += strlen(s);
- X break;
- X
- X case 'B':
- X! sprintf(s, "in %d days' time", diff);
- X s += strlen(s);
- X break;
- X
- X case 'C':
- X! sprintf(s, "on %s", DayName[jul%7]);
- X s += strlen(s);
- X break;
- X
- X case 'D':
- X sprintf(s, "%d", d);
- X s += strlen(s);
- X break;
- X
- X case 'E':
- X! sprintf(s, "on %02d/%02d/%04d", d, m+1, y);
- X s += strlen(s);
- X break;
- X
- X case 'F':
- X! sprintf(s, "on %02d/%02d/%04d", m+1, d, y);
- X s += strlen(s);
- X break;
- X
- X case 'G':
- X! sprintf(s, "on %s, %d %s", DayName[jul%7], d, MonthName[m]);
- X s += strlen(s);
- X break;
- X
- X case 'H':
- X! sprintf(s, "on %02d/%02d", d, m+1);
- X s += strlen(s);
- X break;
- X
- X case 'I':
- X! sprintf(s, "on %02d/%02d", m+1, d);
- X s += strlen(s);
- X break;
- X
- X case 'J':
- X! sprintf(s, "on %s, %s %d%s, %d", DayName[jul%7],
- X MonthName[m], d, plu, y);
- X s += strlen(s);
- X break;
- X
- X case 'K':
- X! sprintf(s, "on %s, %s %d%s", DayName[jul%7],
- X MonthName[m], d, plu);
- X s += strlen(s);
- X break;
- X
- X case 'L':
- X! sprintf(s, "on %04d/%02d/%02d", y, m+1, d);
- X s += strlen(s);
- X break;
- X
- X case 'M':
- X sprintf(s, "%s", MonthName[m]);
- X s += strlen(s);
- X break;
- X
- X case 'N':
- X sprintf(s, "%d", m+1);
- X s += strlen(s);
- X break;
- X
- X case 'O':
- X! if (RealToday == JulianToday) sprintf(s, " (today)");
- X s += strlen(s);
- X break;
- X
- X case 'P':
- X! sprintf(s, (diff == 1 ? "" : "s"));
- X s += strlen(s);
- X break;
- X
- X case 'Q':
- X sprintf(s, (diff == 1 ? "'s" : "s'"));
- X s += strlen(s);
- X break;
- X
- X case 'R':
- X sprintf(s, "%02d", d);
- X s += strlen(s);
- X break;
- X
- X case 'S':
- X sprintf(s, plu);
- X s += strlen(s);
- X break;
- X
- X case 'T':
- X sprintf(s, "%02d", m+1);
- X s += strlen(s);
- X break;
- X
- X case 'U':
- X! sprintf(s, "on %s, %d%s %s, %d", DayName[jul%7], d,
- X plu, MonthName[m], y);
- X s += strlen(s);
- X break;
- X
- X case 'V':
- X! sprintf(s, "on %s, %d%s %s", DayName[jul%7], d, plu,
- X MonthName[m]);
- X s += strlen(s);
- X break;
- X
- X case 'W':
- X sprintf(s, DayName[jul%7]);
- X s += strlen(s);
- X break;
- X
- X case 'X':
- X sprintf(s, "%d", diff);
- X s += strlen(s);
- X break;
- X
- X case 'Y':
- X sprintf(s, "%d", y);
- X s += strlen(s);
- X break;
- X
- X case 'Z':
- X sprintf(s, "%d", y % 100);
- X s += strlen(s);
- X break;
- X
- X case '1':
- X if (tdiff == 0)
- X! sprintf(s, "now");
- X else if (hdiff == 0)
- X! sprintf(s, "%d minute%s %s", mdiff, mplu, when);
- X else if (mdiff == 0)
- X! sprintf(s, "%d hour%s %s", hdiff, hplu, when);
- X else
- X! sprintf(s, "%d hour%s and %d minute%s %s", hdiff, hplu, mdiff, mplu, when);
- X s += strlen(s);
- X break;
- X
- X case '2':
- X! sprintf(s, "at %d:%02d%s", hh, min, pm);
- X s += strlen(s);
- X break;
- X
- X! case '3': sprintf(s, "at %02d:%02d", h, min);
- X s += strlen(s);
- X break;
- X
- X! case '4': sprintf(s, "%d", tdiff);
- X s += strlen(s);
- X break;
- X
- X! case '5': sprintf(s, "%d", adiff);
- X s += strlen(s);
- X break;
- X
- X! case '6': sprintf(s, when);
- X s += strlen(s);
- X break;
- X
- X! case '7': sprintf(s, "%d", hdiff);
- X s += strlen(s);
- X break;
- X
- X! case '8': sprintf(s, "%d", mdiff);
- X s += strlen(s);
- X break;
- X
- X! case '9': sprintf(s, mplu);
- X s += strlen(s);
- X break;
- X
- X! case '0': sprintf(s, hplu);
- X s += strlen(s);
- X break;
- X
- X! case '!': sprintf(s, (tdiff >= 0 ? "is" : "was"));
- X s += strlen(s);
- X break;
- X
- X! case '@': sprintf(s, "%d:%02d%s", chh, cmin, cpm);
- X s += strlen(s);
- X break;
- X
- X! case '#': sprintf(s, "%02d:%02d", ch, cmin);
- X s += strlen(s);
- X break;
- X
- X--- 182,549 ----
- X
- X if (!done) switch(UPPER(c)) {
- X case 'A':
- X! #ifdef L_A_OVER
- X! L_A_OVER
- X! #else
- X! sprintf(s, "%s %s, %d %s, %d", L_ON, DayName[jul%7], d,
- X MonthName[m], y);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'B':
- X! #ifdef L_B_OVER
- X! L_B_OVER
- X! #else
- X! sprintf(s, L_INXDAYS, diff);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'C':
- X! #ifdef L_C_OVER
- X! L_C_OVER
- X! #else
- X! sprintf(s, "%s %s", L_ON, DayName[jul%7]);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'D':
- X+ #ifdef L_D_OVER
- X+ L_D_OVER
- X+ #else
- X sprintf(s, "%d", d);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'E':
- X! #ifdef L_E_OVER
- X! L_E_OVER
- X! #else
- X! sprintf(s, "%s %02d%c%02d%c%04d", L_ON, d, DATESEP,
- X! m+1, DATESEP, y);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'F':
- X! #ifdef L_F_OVER
- X! L_F_OVER
- X! #else
- X! sprintf(s, "%s %02d%c%02d%c%04d", L_ON, m+1, DATESEP, d, DATESEP, y);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'G':
- X! #ifdef L_G_OVER
- X! L_G_OVER
- X! #else
- X! sprintf(s, "%s %s, %d %s", L_ON, DayName[jul%7], d, MonthName[m]);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'H':
- X! #ifdef L_H_OVER
- X! L_H_OVER
- X! #else
- X! sprintf(s, "%s %02d%c%02d", L_ON, d, DATESEP, m+1);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'I':
- X! #ifdef L_I_OVER
- X! L_I_OVER
- X! #else
- X! sprintf(s, "%s %02d%c%02d", L_ON, m+1, DATESEP, d);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'J':
- X! #ifdef L_J_OVER
- X! L_J_OVER
- X! #else
- X! sprintf(s, "%s %s, %s %d%s, %d", L_ON, DayName[jul%7],
- X MonthName[m], d, plu, y);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'K':
- X! #ifdef L_K_OVER
- X! L_K_OVER
- X! #else
- X! sprintf(s, "%s %s, %s %d%s", L_ON, DayName[jul%7],
- X MonthName[m], d, plu);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'L':
- X! #ifdef L_L_OVER
- X! L_L_OVER
- X! #else
- X! sprintf(s, "%s %04d%c%02d%c%02d", L_ON, y, DATESEP, m+1, DATESEP, d);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'M':
- X+ #ifdef L_M_OVER
- X+ L_M_OVER
- X+ #else
- X sprintf(s, "%s", MonthName[m]);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'N':
- X+ #ifdef L_N_OVER
- X+ L_N_OVER
- X+ #else
- X sprintf(s, "%d", m+1);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'O':
- X! #ifdef L_O_OVER
- X! L_O_OVER
- X! #else
- X! if (RealToday == JulianToday) sprintf(s, " (%s)", L_TODAY);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'P':
- X! #ifdef L_P_OVER
- X! L_P_OVER
- X! #else
- X! sprintf(s, (diff == 1 ? "" : L_PLURAL));
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case 'Q':
- X+ #ifdef L_Q_OVER
- X+ L_Q_OVER
- X+ #else
- X sprintf(s, (diff == 1 ? "'s" : "s'"));
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'R':
- X+ #ifdef L_R_OVER
- X+ L_R_OVER
- X+ #else
- X sprintf(s, "%02d", d);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'S':
- X+ #ifdef L_S_OVER
- X+ L_S_OVER
- X+ #else
- X sprintf(s, plu);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'T':
- X+ #ifdef L_T_OVER
- X+ L_T_OVER
- X+ #else
- X sprintf(s, "%02d", m+1);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'U':
- X! #ifdef L_U_OVER
- X! L_U_OVER
- X! #else
- X! sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], d,
- X plu, MonthName[m], y);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'V':
- X! #ifdef L_V_OVER
- X! L_V_OVER
- X! #else
- X! sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu,
- X MonthName[m]);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'W':
- X+ #ifdef L_W_OVER
- X+ L_W_OVER
- X+ #else
- X sprintf(s, DayName[jul%7]);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'X':
- X+ #ifdef L_X_OVER
- X+ L_X_OVER
- X+ #else
- X sprintf(s, "%d", diff);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'Y':
- X+ #ifdef L_Y_OVER
- X+ L_Y_OVER
- X+ #else
- X sprintf(s, "%d", y);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case 'Z':
- X+ #ifdef L_Z_OVER
- X+ L_Z_OVER
- X+ #else
- X sprintf(s, "%d", y % 100);
- X+ #endif
- X s += strlen(s);
- X break;
- X
- X case '1':
- X+ #ifdef L_1_OVER
- X+ L_1_OVER
- X+ #else
- X if (tdiff == 0)
- X! sprintf(s, L_NOW);
- X else if (hdiff == 0)
- X! sprintf(s, "%d %s%s %s", mdiff, L_MINUTE, mplu, when);
- X else if (mdiff == 0)
- X! sprintf(s, "%d %s%s %s", hdiff, L_HOUR, hplu, when);
- X else
- X! sprintf(s, "%d %s%s %s %d %s%s %s", hdiff, L_HOUR, hplu,
- X! L_AND, mdiff, L_MINUTE, mplu, when);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X case '2':
- X! #ifdef L_2_OVER
- X! L_2_OVER
- X! #else
- X! sprintf(s, "%s %d:%02d%s", L_AT, hh, min, pm);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '3':
- X! #ifdef L_3_OVER
- X! L_3_OVER
- X! #else
- X!
- X! sprintf(s, "%s %02d:%02d", L_AT, h, min);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '4':
- X! #ifdef L_4_OVER
- X! L_4_OVER
- X! #else
- X! sprintf(s, "%d", tdiff);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '5':
- X! #ifdef L_5_OVER
- X! L_5_OVER
- X! #else
- X! sprintf(s, "%d", adiff);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '6':
- X! #ifdef L_6_OVER
- X! L_6_OVER
- X! #else
- X! sprintf(s, when);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '7':
- X! #ifdef L_7_OVER
- X! L_7_OVER
- X! #else
- X! sprintf(s, "%d", hdiff);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '8':
- X! #ifdef L_8_OVER
- X! L_8_OVER
- X! #else
- X! sprintf(s, "%d", mdiff);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '9':
- X! #ifdef L_9_OVER
- X! L_9_OVER
- X! #else
- X! sprintf(s, mplu);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '0':
- X! #ifdef L_0_OVER
- X! L_0_OVER
- X! #else
- X! sprintf(s, hplu);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '!':
- X! #ifdef L_BANG_OVER
- X! L_BANG_OVER
- X! #else
- X! sprintf(s, (tdiff >= 0 ? L_IS : L_WAS));
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '@':
- X! #ifdef L_AT_OVER
- X! L_AT_OVER
- X! #else
- X! sprintf(s, "%d:%02d%s", chh, cmin, cpm);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X! case '#':
- X! #ifdef L_HASH_OVER
- X! L_HASH_OVER
- X! #else
- X! sprintf(s, "%02d:%02d", ch, cmin);
- X! #endif
- X s += strlen(s);
- X break;
- X
- X*** ../patch1/err.h Wed Dec 16 10:51:24 1992
- X--- ./err.h Fri Jan 8 13:25:56 1993
- X***************
- X*** 5,11 ****
- X /* Error definitions. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X--- 5,11 ----
- X /* Error definitions. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X*** ../patch1/expr.c Wed Dec 16 10:51:32 1992
- X--- ./expr.c Fri Jan 22 10:23:16 1993
- X***************
- X*** 5,11 ****
- X /* This file contains routines to parse and evaluate */
- X /* expressions. */
- X /* */
- X! /* Copyright 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X--- 5,11 ----
- X /* This file contains routines to parse and evaluate */
- X /* expressions. */
- X /* */
- X! /* Copyright 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X***************
- X*** 604,610 ****
- X case TIM_TYPE: sprintf(CoerceBuf, "%02d:%02d", v->v.val / 60, v->v.val % 60);
- X break;
- X case DATE_TYPE: FromJulian(v->v.val, &y, &m, &d);
- X! sprintf(CoerceBuf, "%04d/%02d/%02d", y, m+1, d);
- X break;
- X default: return E_CANT_COERCE;
- X }
- X--- 604,611 ----
- X case TIM_TYPE: sprintf(CoerceBuf, "%02d:%02d", v->v.val / 60, v->v.val % 60);
- X break;
- X case DATE_TYPE: FromJulian(v->v.val, &y, &m, &d);
- X! sprintf(CoerceBuf, "%04d%c%02d%c%02d",
- X! y, DATESEP, m+1, DATESEP, d);
- X break;
- X default: return E_CANT_COERCE;
- X }
- X***************
- X*** 1176,1182 ****
- X else if (v->type == TIM_TYPE) fprintf(fp, "%02d:%02d", v->v.val / 60, v->v.val % 60);
- X else if (v->type == DATE_TYPE) {
- X FromJulian(v->v.val, &y, &m, &d);
- X! fprintf(fp, "%04d/%02d/%02d", y, m+1, d);
- X }
- X else fprintf(fp, "ERR");
- X }
- X--- 1177,1183 ----
- X else if (v->type == TIM_TYPE) fprintf(fp, "%02d:%02d", v->v.val / 60, v->v.val % 60);
- X else if (v->type == DATE_TYPE) {
- X FromJulian(v->v.val, &y, &m, &d);
- X! fprintf(fp, "%04d%c%02d%c%02d", y, DATESEP, m+1, DATESEP, d);
- X }
- X else fprintf(fp, "ERR");
- X }
- X***************
- X*** 1233,1239 ****
- X y *= 10;
- X y += *(*s)++ - '0';
- X }
- X! if (*(*s)++ != '/') return E_BAD_DATE;
- X if (!isdigit(**s)) return E_BAD_DATE;
- X while (isdigit(**s)) {
- X m *= 10;
- X--- 1234,1241 ----
- X y *= 10;
- X y += *(*s)++ - '0';
- X }
- X! if (**s != '/' && **s != '-') return E_BAD_DATE;
- X! (*s)++;
- X if (!isdigit(**s)) return E_BAD_DATE;
- X while (isdigit(**s)) {
- X m *= 10;
- X***************
- X*** 1240,1246 ****
- X m += *(*s)++ - '0';
- X }
- X m--;
- X! if (*(*s)++ != '/') return E_BAD_DATE;
- X if (!isdigit(**s)) return E_BAD_DATE;
- X while (isdigit(**s)) {
- X d *= 10;
- X--- 1242,1249 ----
- X m += *(*s)++ - '0';
- X }
- X m--;
- X! if (**s != '/' && **s != '-') return E_BAD_DATE;
- X! (*s)++;
- X if (!isdigit(**s)) return E_BAD_DATE;
- X while (isdigit(**s)) {
- X d *= 10;
- X*** ../patch1/expr.h Wed Dec 16 10:51:24 1992
- X--- ./expr.h Fri Jan 8 13:25:45 1993
- X***************
- X*** 5,11 ****
- X /* Contains a few definitions used by expression evaluator. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X--- 5,11 ----
- X /* Contains a few definitions used by expression evaluator. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X*** ../patch1/files.c Wed Dec 16 10:51:33 1992
- X--- ./files.c Fri Jan 8 13:25:39 1993
- X***************
- X*** 7,13 ****
- X /* files. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X--- 7,13 ----
- X /* files. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X
- X*** ../patch1/funcs.c Wed Dec 16 10:51:34 1992
- X--- ./funcs.c Fri Jan 22 10:03:07 1993
- X***************
- X*** 6,12 ****
- X /* expressions. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X--- 6,12 ----
- X /* expressions. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X***************
- X*** 62,67 ****
- X--- 62,68 ----
- X PRIVATE int FIif ARGS ((void));
- X PRIVATE int FIndex ARGS ((void));
- X PRIVATE int FIsomitted ARGS ((void));
- X+ PRIVATE int FLanguage ARGS ((void));
- X PRIVATE int FMax ARGS ((void));
- X PRIVATE int FMin ARGS ((void));
- X PRIVATE int FMinute ARGS ((void));
- X***************
- X*** 151,156 ****
- X--- 152,158 ----
- X { "index", 2, 3, FIndex },
- X { "isleap", 1, 1, FIsleap },
- X { "isomitted", 1, 1, FIsomitted },
- X+ { "language", 0, 0, FLanguage },
- X { "lower", 1, 1, FLower },
- X { "max", 1, NO_MAX, FMax },
- X { "min", 1, NO_MAX, FMin },
- X***************
- X*** 1416,1419 ****
- X--- 1418,1437 ----
- X case STR_TYPE: return RetStrVal("STRING");
- X default: return RetStrVal("ERR");
- X }
- X+ }
- X+
- X+ /***************************************************************/
- X+ /* */
- X+ /* FLanguage */
- X+ /* */
- X+ /* Implement the language() function. */
- X+ /* */
- X+ /***************************************************************/
- X+ #ifdef HAVE_PROTOS
- X+ PRIVATE int FLanguage(void)
- X+ #else
- X+ static int FLanguage()
- X+ #endif
- X+ {
- X+ return RetStrVal(L_LANGNAME);
- X }
- X*** ../patch1/globals.c Wed Dec 16 10:51:34 1992
- X--- ./globals.c Thu Jan 21 16:50:15 1993
- X***************
- X*** 8,14 ****
- X /* globals.h and err.h */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X--- 8,14 ----
- X /* globals.h and err.h */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- X*** ../patch1/globals.h Wed Dec 16 10:51:25 1992
- X--- ./globals.h Thu Jan 21 16:02:55 1993
- X***************
- X*** 7,16 ****
- X /* MK_GLOBALS. Also contains useful macro definitions. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X!
- X #ifdef MK_GLOBALS
- X #undef EXTERN
- X #define EXTERN
- X--- 7,16 ----
- X /* MK_GLOBALS. Also contains useful macro definitions. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992, 1993 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X! #include "lang.h"
- X #ifdef MK_GLOBALS
- X #undef EXTERN
- X #define EXTERN
- X***************
- X*** 49,55 ****
- X EXTERN INIT( char InfiniteDelta, 0);
- X EXTERN INIT( char RunDisabled, 0);
- X EXTERN INIT( char IgnoreOnce, 0);
- X! EXTERN INIT( char Banner[LINELEN], "Reminders for %w, %d%s %m, %y%o:");
- X EXTERN char *InitialFile;
- X EXTERN int FileAccessDate;
- X
- X--- 49,55 ----
- X EXTERN INIT( char InfiniteDelta, 0);
- X EXTERN INIT( char RunDisabled, 0);
- X EXTERN INIT( char IgnoreOnce, 0);
- X! EXTERN INIT( char Banner[LINELEN], L_BANNER);
- X EXTERN char *InitialFile;
- X EXTERN int FileAccessDate;
- X
- X***************
- X*** 76,94 ****
- X EXTERN INIT( int NumTriggered, 0);
- X EXTERN int ArgC;
- X EXTERN char **ArgV;
- X
- X /* List of months */
- X EXTERN char *MonthName[]
- X #ifdef MK_GLOBALS
- X! = {"January", "February", "March", "April", "May", "June",
- X! "July", "August", "September", "October", "November", "December" }
- X #endif
- X ;
- X
- X EXTERN char *DayName[]
- X #ifdef MK_GLOBALS
- X! = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
- X! "Sunday"}
- X #endif
- X ;
- X
- X--- 76,96 ----
- X EXTERN INIT( int NumTriggered, 0);
- X EXTERN int ArgC;
- X EXTERN char **ArgV;
- X+ EXTERN INIT( int CalLines, CAL_LINES);
- X+ EXTERN INIT( int CalPad, 1);
- X
- X /* List of months */
- X EXTERN char *MonthName[]
- X #ifdef MK_GLOBALS
- X! = {L_JAN, L_FEB, L_MAR, L_APR, L_MAY, L_JUN,
- X! L_JUL, L_AUG, L_SEP, L_OCT, L_NOV, L_DEC}
- X #endif
- X ;
- X
- X EXTERN char *DayName[]
- X #ifdef MK_GLOBALS
- X! = {L_MONDAY, L_TUESDAY, L_WEDNESDAY, L_THURSDAY, L_FRIDAY,
- X! L_SATURDAY, L_SUNDAY}
- X #endif
- X ;
- X
- X*** ../patch1/init.c Wed Dec 16 10:51:35 1992
- X--- ./init.c Mon Feb 1 15:47:17 1993
- X***************
- X*** 7,13 ****
- X /* in normal mode. */
- X /* */
- X /* This file is part of REMIND. */
- X! /* Copyright (C) 1992 by David F. Skoll. */
- X /* */
- X /***************************************************************/
- X #include "config.h"
- 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 #include "config.h"
- X***************
- X*** 18,23 ****
- X--- 18,27 ----
- X #ifdef HAVE_MALLOC_H
- X #include <malloc.h>
- X #endif
- X+ #ifdef UNIX
- X+ #include <sys/types.h>
- X+ #include <pwd.h>
- X+ #endif
- X #include <ctype.h>
- X #include "types.h"
- X #include "protos.h"
- X***************
- X*** 34,40 ****
- X * simple calendar format.
- X * -r = Disallow RUN mode
- X * -c[n] = Produce a calendar for n months (default = 1)
- X! * -w[n] = Specify output device width (default = 80)
- X * -s[n] = Produce calendar in "simple calendar" format
- X * -p[n] = Produce calendar in format compatible with rem2ps
- X * -v = Verbose mode
- X--- 38,44 ----
- X * simple calendar format.
- X * -r = Disallow RUN mode
- X * -c[n] = Produce a calendar for n months (default = 1)
- X! * -w[n,n,n] = Specify output device width, padding and spacing
- X * -s[n] = Produce calendar in "simple calendar" format
- X * -p[n] = Produce calendar in format compatible with rem2ps
- X * -v = Verbose mode
- X***************
- X*** 54,59 ****
- X--- 58,64 ----
- X * -z[n] = Daemon mode waking up every n (def 5) minutes.
- X * -bn = Time format for cal (0, 1, or 2)
- X * -xn = Max. number of iterations for SATISFY
- X+ * -uname = Run as user 'name' - only valid when run by root.
- X *
- X **************************************************************/
- X
- X***************
- X*** 66,71 ****
- X--- 71,80 ----
- X s++; \
- X }
- X
- X+ #ifdef UNIX
- X+ PRIVATE void ChgUser ARGS((char *uname));
- X+ #endif
- X+
- X static char *BadDate = "Illegal date on command line\n";
- X
- X /***************************************************************/
- X***************
- X*** 144,149 ****
- X--- 153,166 ----
- X Hush = 1;
- X break;
- X
- X+ #if defined(UNIX) && defined(WANT_U_OPTION)
- X+ case 'u':
- X+ case 'U':
- X+ ChgUser(arg);
- X+ while (*arg) arg++;
- X+ break;
- X+ #endif
- X+
- X #ifdef HAVE_QUEUED
- X case 'z':
- X case 'Z':
- X***************
- X*** 198,205 ****
- X
- X case 'w':
- X case 'W':
- X! PARSENUM(CalWidth, arg);
- X! if (CalWidth < 80) CalWidth = 80;
- X break;
- X
- X case 'd':
- X--- 215,236 ----
- X
- X case 'w':
- X case 'W':
- X! if (*arg != ',') {
- X! PARSENUM(CalWidth, arg);
- X! if (CalWidth < 80) CalWidth = 80;
- X! }
- X! if (*arg == ',') {
- X! arg++;
- X! if (*arg != ',') {
- X! PARSENUM(CalLines, arg);
- X! if (CalLines > 20) CalLines = 20;
- X! }
- X! if (*arg == ',') {
- X! arg++;
- X! PARSENUM(CalPad, arg);
- X! if (CalPad > 20) CalPad = 20;
- X! }
- X! }
- X break;
- X
- X case 'd':
- X***************
- X*** 311,317 ****
- X void Usage()
- X #endif
- X {
- X! fprintf(ErrFp, "\nREMIND %s Copyright 1992 by David F. Skoll\n\n", VERSION);
- X fprintf(ErrFp, " Usage: remind [options] filename [date]\n");
- X fprintf(ErrFp, "Options:\n");
- X fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
- X--- 342,348 ----
- X void Usage()
- X #endif
- X {
- X! fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992, 1993 by David F. Skoll\n\n", VERSION, L_LANGNAME);
- X fprintf(ErrFp, " Usage: remind [options] filename [date]\n");
- X fprintf(ErrFp, "Options:\n");
- X fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
- X***************
- X*** 318,324 ****
- X fprintf(ErrFp, " -r Disable RUN directives\n");
- X fprintf(ErrFp, " -c[n] Produce a calendar for n (default 1) months\n");
- X fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
- X! fprintf(ErrFp, " -w[n] Specify width (default 80) of calendar output\n");
- X fprintf(ErrFp, " -s[n] Produce 'simple calendar' for n (1) months\n");
- X fprintf(ErrFp, " -p[n] Same as -s, but input compatible with rem2ps\n");
- X fprintf(ErrFp, " -v Verbose mode\n");
- X--- 349,355 ----
- X fprintf(ErrFp, " -r Disable RUN directives\n");
- X fprintf(ErrFp, " -c[n] Produce a calendar for n (default 1) months\n");
- X fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
- X! fprintf(ErrFp, " -w[n[,p[,s]]] Specify width, padding and spacing of calendar\n");
- X fprintf(ErrFp, " -s[n] Produce 'simple calendar' for n (1) months\n");
- X fprintf(ErrFp, " -p[n] Same as -s, but input compatible with rem2ps\n");
- X fprintf(ErrFp, " -v Verbose mode\n");
- X***************
- X*** 337,339 ****
- X--- 368,450 ----
- X fprintf(ErrFp, " -x[n] Iteration limit for SATISFY clause (def=150)\n");
- X exit(1);
- X }
- X+
- X+ /***************************************************************/
- X+ /* */
- X+ /* ChgUser */
- X+ /* */
- X+ /* Run as a specified user. Can only be used if Remind is */
- X+ /* started by root. This changes the real and effective uid, */
- X+ /* the real and effective gid, and sets the HOME, SHELL and */
- X+ /* USER environment variables. */
- X+ /* */
- X+ /***************************************************************/
- X+ #if defined(UNIX) && defined(WANT_U_OPTION)
- X+ #ifdef HAVE_PROTOS
- X+ PRIVATE void ChgUser(char *user)
- X+ #else
- X+ static void ChgUser(user)
- X+ char *user;
- X+ #endif /* HAVE_PROTOS */
- X+ {
- X+ #ifdef SYSV
- X+ uid_t myuid;
- X+ #else
- X+ int myuid;
- X+ #endif
- X+
- X+ static char *NoEnvMem = "Remind: Out of memory for environment\n";
- X+ struct passwd *pwent;
- X+ static char *home, *shell, *username;
- X+
- X+ myuid = getuid();
- X+ if (myuid) {
- X+ fprintf(ErrFp, "Remind: Only the super-user can use the '-u' option.\n");
- X+ exit(1);
- X+ }
- X+
- X+ pwent = getpwnam(user);
- X+
- X+ if (!pwent) {
- X+ fprintf(ErrFp, "Remind: Unknown user '%s'\n", user);
- X+ exit(1);
- X+ }
- X+
- X+ if (setgid(pwent->pw_gid)) {
- X+ fprintf(ErrFp, "Remind: Could not change gid to %d\n", pwent->pw_gid);
- X+ exit(1);
- X+ }
- X+
- X+ if (setuid(pwent->pw_uid)) {
- X+ fprintf(ErrFp, "Remind: Could not change uid to %d\n", pwent->pw_uid);
- X+ exit(1);
- X+ }
- X+
- X+ home = malloc(strlen(pwent->pw_dir) + 6);
- X+ if (!home) {
- X+ fprintf(ErrFp, NoEnvMem);
- X+ exit(1);
- X+ }
- X+ sprintf(home, "HOME=%s", pwent->pw_dir);
- X+ putenv(home);
- X+
- X+ shell = malloc(strlen(pwent->pw_dir) + 7);
- X+ if (!shell) {
- X+ fprintf(ErrFp, NoEnvMem);
- X+ exit(1);
- X+ }
- X+ sprintf(shell, "SHELL=%s", pwent->pw_shell);
- X+ putenv(shell);
- X+
- X+ if (pwent->pw_uid) {
- X+ username = malloc(strlen(pwent->pw_dir) + 6);
- X+ if (!username) {
- X+ fprintf(ErrFp, NoEnvMem);
- X+ exit(1);
- X+ }
- X+ sprintf(username, "USER=%s", pwent->pw_dir);
- X+ putenv(username);
- X+ }
- X+ }
- X+ #endif /* UNIX && WANT_U_OPTION */
- X+
- END_OF_FILE
- if test 59033 -ne `wc -c <'patch.02.A'`; then
- echo shar: \"'patch.02.A'\" unpacked with wrong size!
- elif test -f 'patch.02.B'; then
- echo shar: Combining \"'patch.02'\" \(113702 characters\)
- cat 'patch.02.A' 'patch.02.B' > 'patch.02'
- if test 113702 -ne `wc -c <'patch.02'`; then
- echo shar: \"'patch.02'\" combined with wrong size!
- else
- rm patch.02.A patch.02.B
- fi
- fi
- # end of 'patch.02.A'
- fi
- echo shar: End of archive 2 \(of 3\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-