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