home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-03-07 | 52.0 KB | 1,801 lines |
- Prereq: "03.00.03"
- *** ../patch3/version.h Tue Feb 2 14:36:05 1993
- --- ./version.h Mon Feb 15 13:24:00 1993
- ***************
- *** 9,12 ****
- /* */
- /***************************************************************/
-
- ! #define VERSION "03.00.03"
- --- 9,12 ----
- /* */
- /***************************************************************/
-
- ! #define VERSION "03.00.04"
- *** ../patch3/COPYRIGHT Fri Jan 8 13:26:53 1993
- --- ./COPYRIGHT Wed Mar 3 17:13:09 1993
- ***************
- *** 1,29 ****
- THE REMIND COPYRIGHT
-
- ! 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.
-
- ! You may modify REMIND. However, you must clearly indicate such
- modifications when you distribute REMIND, and must tell the recipients
- of the modified version that it is modified. Place that notice in the
- WHATSNEW.xx file.
-
- ! 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
- by the use or misuse of REMIND.
-
- ! If you wish to contribute ideas or money to help the production of
- software like REMIND, you can reply to the address shown at the end of
- this file. Note that you are under no obligation to send me money.
- If you don't donate, you have full rights to use REMIND just as if you
- --- 1,40 ----
- THE REMIND COPYRIGHT
-
- ! 1. REMIND refers to the entire set of files and documentation in the
- REMIND package.
-
- ! 2. REMIND is Copyright 1990, 1991, 1992, 1993 by David Skoll, except for
- the file remind-all.sh, which is Copyright 1990 by Bill Aten.
-
- ! 3. You may use REMIND for free, and may freely distribute it, providing
- you do not charge the recipients to whom you distribute REMIND.
-
- ! 4. This means that if you distribute REMIND:
- !
- ! - You may not charge more than cost for distribution media.
- ! - If you run a BBS or network service, you cannot charge more than
- ! the regular access fee for REMIND. That is, REMIND must be accessible
- ! at the basic BBS access rate, with no surcharge.
- ! - You may not charge users support fees for REMIND.
- ! - No other fees may be levied for REMIND.
- ! - You cannot use REMIND to solicit donations.
- !
- ! 5. You may modify REMIND. However, you must clearly indicate such
- modifications when you distribute REMIND, and must tell the recipients
- of the modified version that it is modified. Place that notice in the
- WHATSNEW.xx file.
-
- ! 6. 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. These programs can be distributed according to
- ! the terms of paragraphs 3 and 4.
-
- ! 7. 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
- by the use or misuse of REMIND.
-
- ! 8. If you wish to contribute ideas or money to help the production of
- software like REMIND, you can reply to the address shown at the end of
- this file. Note that you are under no obligation to send me money.
- If you don't donate, you have full rights to use REMIND just as if you
- ***************
- *** 32,37 ****
- --- 43,52 ----
- of software like REMIND. Should you wish to donate, the suggested
- amount is $18.00 (Canadian)
-
- + If you wish to incorporate Remind into a commercial product, or to
- + charge support fees for products incorporating Remind, contact
- + me for licensing arrangements.
- +
- ACKNOWLEDGEMENTS:
-
- I would like to thank the following people:
- ***************
- *** 52,57 ****
- --- 67,83 ----
- Dave Wolfe <dwolfe@pffft.sps.mot.com> and Raphael Manfredi
- <ram@eiffel.com> for noticing bugs and sending me fixes.
-
- + Dave Rickel and George M. Sipe for sample reminders and holidays.
- +
- + Michael Salmon for ISO encoding of PostScript output.
- +
- + Darrel Hankerson for helping me provide some OS/2 support. Sorry
- + it's not complete, Darrel!
- +
- + Phillipp Slusallek for suggesting the -k option.
- +
- + All of the language translators whose names are listed in lang.h
- +
- Timo Salmi, Keith Petersen, Bill Davidsen and Kent Landfield for
- maintaining the uwasa and SIMTEL archives, and comp.binaries.ibm.pc
- and comp.sources.misc in the face of a flurry of updates to REMIND.
- ***************
- *** 64,72 ****
-
- --
- David F. Skoll <dfs@doe.carleton.ca>
- ! 4-317 LeBreton Street South
- ! Ottawa, Ontario K1S 4L4
- CANADA
-
- ! Tel. (613) 567-3662
-
- --- 90,98 ----
-
- --
- David F. Skoll <dfs@doe.carleton.ca>
- ! 986 Eiffel Avenue
- ! Ottawa, Ontario K2C 0J2
- CANADA
-
- ! Tel. (613) 225-8687
-
- *** ../patch3/MANIFEST.DOS Mon Jan 25 15:40:01 1993
- --- ./MANIFEST.DOS Mon Mar 1 16:52:01 1993
- ***************
- *** 4,14 ****
- --- 4,16 ----
- defs.rem
- dorem.c
- dosubst.c
- + dutch.h
- english.h
- err.h
- expr.c
- expr.h
- files.c
- + finnish.h
- funcs.c
- german.h
- globals.c
- ***************
- *** 41,46 ****
- --- 43,49 ----
- remind-a.sh
- remind.1
- remind.def
- + sort.c
- test-rem
- test.cmp
- test.rem
- *** ../patch3/MANIFEST.UNX Mon Feb 8 14:26:43 1993
- --- ./MANIFEST.UNX Mon Mar 1 16:51:53 1993
- ***************
- *** 11,21 ****
- --- 11,23 ----
- defs.rem
- dorem.c
- dosubst.c
- + dutch.h
- english.h
- err.h
- expr.c
- expr.h
- files.c
- + finnish.h
- funcs.c
- german.h
- globals.c
- ***************
- *** 42,47 ****
- --- 44,50 ----
- remind-all.sh
- remind.1
- remind.def
- + sort.c
- test-rem
- test.cmp
- test.rem
- *** ../patch3/Makefile Tue Feb 2 14:36:58 1993
- --- ./Makefile Tue Mar 2 11:03:25 1993
- ***************
- *** 13,21 ****
- # Uncomment the next line if you want to use gcc instead of default compiler
- CC= gcc
-
- ! # Put any additional flags for the C compiler here
- CFLAGS= -O -ansi
- CDEFS=
-
- #### INSTALLATION LOCATIONS ####
- # Note that I use 'cp' rather than 'install' for improved portability.
- --- 13,22 ----
- # Uncomment the next line if you want to use gcc instead of default compiler
- CC= gcc
-
- ! # Put any additional flags for the C compiler or linker here
- CFLAGS= -O -ansi
- CDEFS=
- + LDFLAGS=
-
- #### INSTALLATION LOCATIONS ####
- # Note that I use 'cp' rather than 'install' for improved portability.
- ***************
- *** 45,62 ****
- # 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.03
-
- ! 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
-
- 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)
-
- --- 46,66 ----
- # 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.04
-
- ! HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
- ! lang.h english.h german.h dutch.h finnish.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 sort.c queue.c token.c trigger.c userfns.c utils.c var.c
-
- 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 \
- ! tstlang.rem
-
- OBJS= $(SRCS:.c=.o)
-
- ***************
- *** 66,75 ****
- $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
-
- rem2ps: rem2ps.o
- ! $(CC) -o rem2ps rem2ps.o
-
- remind: $(OBJS)
- ! $(CC) -o remind $(OBJS)
-
- clean:
- rm -f *.o *~
- --- 70,79 ----
- $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
-
- rem2ps: rem2ps.o
- ! $(CC) $(LDFLAGS) -o rem2ps rem2ps.o
-
- remind: $(OBJS)
- ! $(CC) $(LDFLAGS) -o remind $(OBJS)
-
- clean:
- rm -f *.o *~
- ***************
- *** 91,96 ****
- --- 95,101 ----
- init.o: init.c $(STDHDRS) expr.h version.h
- main.o: main.c $(STDHDRS) expr.h
- omit.o: omit.c $(STDHDRS)
- + sort.o: sort.c $(STDHDRS)
- queue.o: queue.c $(STDHDRS)
- token.o: token.c $(STDHDRS)
- trigger.o: trigger.c $(STDHDRS) expr.h
- ***************
- *** 99,106 ****
- var.o: var.c $(STDHDRS) expr.h
-
- tarZ:
- ! tar cvf remind-3.0.3.tar $(MANIFEST)
- ! compress -v remind-3.0.3.tar
-
- shar:
- shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
- --- 104,111 ----
- var.o: var.c $(STDHDRS) expr.h
-
- tarZ:
- ! tar cvf remind-3.0.4.tar $(MANIFEST)
- ! compress -v remind-3.0.4.tar
-
- shar:
- shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
- *** ../patch3/README.DOS Fri Jan 22 11:08:58 1993
- --- ./README.DOS Wed Mar 3 17:15:06 1993
- ***************
- *** 40,48 ****
-
- --
- David F. Skoll <dfs@doe.carleton.ca>
- ! 4-317 LeBreton Street South
- ! Ottawa, Ontario K1S 4L4
- CANADA
-
- ! Tel. (613) 567-3662
-
- --- 40,48 ----
-
- --
- David F. Skoll <dfs@doe.carleton.ca>
- ! 986 Eiffel Avenue
- ! Ottawa, Ontario K2C 0J2
- CANADA
-
- ! Tel. (613) 225-8687
-
- *** ../patch3/README.OS2 Fri Jan 22 11:08:54 1993
- --- ./README.OS2 Wed Mar 3 17:14:49 1993
- ***************
- *** 48,56 ****
-
- --
- David F. Skoll <dfs@doe.carleton.ca>
- ! 4-317 LeBreton Street South
- ! Ottawa, Ontario K1S 4L4
- CANADA
-
- ! Tel. (613) 567-3662
-
- --- 48,56 ----
-
- --
- David F. Skoll <dfs@doe.carleton.ca>
- ! 986 Eiffel Avenue
- ! Ottawa, Ontario K2C 0J2
- CANADA
-
- ! Tel. (613) 225-8687
-
- *** ../patch3/README.UNIX Fri Jan 29 13:43:01 1993
- --- ./README.UNIX Wed Mar 3 17:14:29 1993
- ***************
- *** 79,86 ****
-
- --
- David F. Skoll <dfs@doe.carleton.ca>
- ! 4-317 LeBreton Street South
- ! Ottawa, Ontario K1S 4L4
- CANADA
-
- ! Tel. (613) 567-3662
- --- 79,86 ----
-
- --
- David F. Skoll <dfs@doe.carleton.ca>
- ! 986 Eiffel Avenue
- ! Ottawa, Ontario K2C 0J2
- CANADA
-
- ! Tel. (613) 225-8687
- *** ../patch3/WHATSNEW.30 Mon Feb 8 14:43:57 1993
- --- ./WHATSNEW.30 Wed Mar 3 17:16:40 1993
- ***************
- *** 1,9 ****
- CHANGES TO REMIND
-
- ! *** PLEASE NOTE: AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
- ! 986 Eiffel Avenue,
- ! Ottawa, Ontario K2C 0J2
- ! Canada
-
- * Version 3.0 Patch 3
-
- --- 1,63 ----
- CHANGES TO REMIND
-
- ! * Version 3.0 Patch 4
- !
- ! - Added the -g option - this sorts reminders by date/time before
- ! issuing them. (You can see I'm running out of letters to
- ! name options!) This feature was suggested by George M. Sipe,
- ! Paul D. Smith, and Francois Pinard.
- !
- ! - Added the "args()" and "dosubst()" built-in functions - see the
- ! man page for details.
- !
- ! - Added more support for the ISO 8859-1 character set, and
- ! modified the german.h file to take advantage of this, thanks
- ! to Robert Joop.
- !
- ! - Allowed any character to be used as date and time separator
- ! characters (not just "/-:.")
- !
- ! - Added support for the Dutch and Finnish languages, thanks to
- ! Willem Kasdorp and Mikko Silvonen. (Anyone care to contribute
- ! French? Italian? Spanish?)
- !
- ! - Made Remind issue a warning if you try to redefine a built-in
- ! function. This warning is disabled in 'Hush' mode.
- !
- ! - Added the SCANFROM clause to the REM command. This allows reasonably
- ! safe moveable OMITs such as the Labour Day example in the manual.
- !
- ! - Added more examples to the defs.rem file, and cleaned up some old
- ! examples. Note that there are now safe moveable holidays for most
- ! U.S. holidays provided in the defs.rem file.
- !
- ! - Added the '-k' option, which allows MSG-type reminders to be passed
- ! to any system command. (Idea and patch courtesy of Philipp Slusallek.)
- !
- ! - Allowed selection of ':' or '.' as time separator characters at
- ! compile-time.
- !
- ! - Edited the COPYRIGHT file to clarify the rules. Please read them.
- !
- ! - Removed hard-coding of "am" and "pm" and placed them in language-specific
- ! header files as #defines L_AM and L_PM
- !
- ! - Fixed a bug in the FindToken() routine which had, through sheer luck,
- ! never been activated until the SCANFROM clause was added!
- !
- ! - Fixed the UNTIL clause to check for a valid expiry date.
- !
- ! - Removed identifiers in the C source beginning with "_" to conform
- ! to ANSI practice.
- !
- ! - Fixed a bug in the -u option which resulted in environment variables
- ! SHELL and USER not being set correctly. Also made -u set the LOGNAME
- ! environment variable.
- !
- ! - Fixed a couple of typos in the man page; added LDFLAGS to the
- ! Makefile. (Thanks to Dave Wolfe.)
- !
- ! - Put my new mailing address in the README files.
-
- * Version 3.0 Patch 3
-
- *** ../patch3/calendar.c Fri Feb 5 14:47:40 1993
- --- ./calendar.c Mon Mar 1 13:00:46 1993
- ***************
- *** 24,31 ****
- #include "err.h"
-
- /* Data structures used by the calendar */
- ! typedef struct _cal_entry {
- ! struct _cal_entry *next;
- char *text;
- char *pos;
- int time;
- --- 24,31 ----
- #include "err.h"
-
- /* Data structures used by the calendar */
- ! typedef struct cal_entry {
- ! struct cal_entry *next;
- char *text;
- char *pos;
- int time;
- ***************
- *** 328,334 ****
- int i;
-
- for (i=0; i<d; i++) putchar(pad);
- ! printf("%s", s);
- for (i=d+len; i<width; i++) putchar(pad);
- }
-
- --- 328,336 ----
- int i;
-
- for (i=0; i<d; i++) putchar(pad);
- ! for (i=0; i<width; i++) {
- ! if (*s) putchar(*s++); else break;
- ! }
- for (i=d+len; i<width; i++) putchar(pad);
- }
-
- ***************
- *** 625,631 ****
- if (trig.typ == NO_TYPE) return E_EOLN;
- if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
- /* Calculate the trigger date */
- ! jul = ComputeTrigger(JulianToday, &trig, &r);
- if (r) return r;
-
- /* If trigger date == today, add it to the current entry */
- --- 627,633 ----
- if (trig.typ == NO_TYPE) return E_EOLN;
- if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
- /* Calculate the trigger date */
- ! jul = ComputeTrigger(trig.scanfrom, &trig, &r);
- if (r) return r;
-
- /* If trigger date == today, add it to the current entry */
- ***************
- *** 765,771 ****
- if (h == 0) hh=12;
- else if (h > 12) hh=h-12;
- else hh=h;
- ! sprintf(out, "%2d:%02d%s ", hh, min, (h>=12) ? "pm" : "am");
- }
- break;
-
- --- 767,773 ----
- if (h == 0) hh=12;
- else if (h > 12) hh=h-12;
- else hh=h;
- ! sprintf(out, "%2d%c%02d%s ", hh, TIMESEP, min, (h>=12) ? L_PM : L_AM);
- }
- break;
-
- ***************
- *** 774,780 ****
- else {
- h = tim / 60;
- min = tim % 60;
- ! sprintf(out, "%02d:%02d ", h, min);
- }
- break;
- }
- --- 776,782 ----
- else {
- h = tim / 60;
- min = tim % 60;
- ! sprintf(out, "%02d%c%02d ", h, TIMESEP, min);
- }
- break;
- }
- *** ../patch3/config.h Mon Feb 1 12:21:15 1993
- --- ./config.h Tue Mar 2 12:12:49 1993
- ***************
- *** 19,24 ****
- --- 19,37 ----
- /* #define DATESEP '-' */
-
- /*---------------------------------------------------------------------*/
- + /* TIMESEP: The default time separator. North American usage is ':'; */
- + /* others may prefer '.'. */
- + /*---------------------------------------------------------------------*/
- + #define TIMESEP ':'
- + /* #define TIMESEP '.' */
- +
- + /*---------------------------------------------------------------------*/
- + /* ISOLATIN1: uncomment the following line if your system uses the */
- + /* ISO 8859-1 character set instead of ASCII. */
- + /*---------------------------------------------------------------------*/
- + /* #define ISOLATIN1 1 */
- +
- + /*---------------------------------------------------------------------*/
- /* 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. */
- *** ../patch3/defs.rem Fri Jan 8 13:26:17 1993
- --- ./defs.rem Fri Mar 5 11:46:11 1993
- ***************
- *** 3,15 ****
- # DEFS.REM
- #
- # This file is a reminder script, which contains a few handy definitions.
- ! # Cut and paste as desired!
- #
- # This file is part of REMIND.
- # Copyright (C) 1992, 1993 by David F. Skoll
- #
- # ---------------------------------------------------------------------------
-
- # It's handy to have symbolic constants for weekdays and month names
- SET Sunday 0
- SET Monday 1
- --- 3,28 ----
- # DEFS.REM
- #
- # This file is a reminder script, which contains a few handy definitions.
- ! # Cut and paste as desired! Also, near the end, there are a bunch of holiday
- ! # definitions for the U.S.
- #
- + # Some examples provided by George M. Sipe <gsipe@pyratl.ga.pyramid.com>
- + #
- + # U.S. holidays provided by Dave Rickel <drickel@sjc.mentorg.com>
- + #
- # This file is part of REMIND.
- # Copyright (C) 1992, 1993 by David F. Skoll
- #
- # ---------------------------------------------------------------------------
-
- + # Bombproofing
- + RUN OFF
- + IF version() < "03.00.04"
- + ERRMSG This file requires at least version 03.00.04 of Remind.%
- + ERRMSG This version is [version()].
- + EXIT
- + ENDIF
- +
- # It's handy to have symbolic constants for weekdays and month names
- SET Sunday 0
- SET Monday 1
- ***************
- *** 19,24 ****
- --- 32,45 ----
- SET Friday 5
- SET Saturday 6
-
- + SET Sun 0
- + SET Mon 1
- + SET Tue 2
- + SET Wed 3
- + SET Thu 4
- + SET Fri 5
- + SET Sat 6
- +
- # ---------------------------------------------------------------------------
-
- SET Jan 1
- ***************
- *** 53,67 ****
-
- # A function which, given a time, returns a string in "AM/PM" format.
- # Unfortunately, has a leading zero. Example call:
- ! # set a ampm(now())
-
- ! FSET ampm(x) iif(x<1:00, x+12*60+"am", \
- ! iif(x<12:00, x+"am", \
- ! iif(x<13:00, x+"pm", x-12*60+"pm")))
-
- # A function which knocks off a single leading zero from a string
-
- ! FSET no_lz(s) iif(substr(s, 1, 1)=="0", substr(s, 2), s)
-
- # ---------------------------------------------------------------------------
-
- --- 74,88 ----
-
- # A function which, given a time, returns a string in "AM/PM" format.
- # Unfortunately, has a leading zero. Example call:
- ! # set a _am_pm(now())
-
- ! FSET _am_pm(tm) IIF (tm<1:00, tm+12*60+"am", \
- ! IIF (tm<12:00, tm+"am", \
- ! IIF (tm<13:00, tm+"pm", tm-12*60+"pm")))
-
- # A function which knocks off a single leading zero from a string
-
- ! FSET _no_lz(s) IIF(SUBSTR(s, 1, 1)=="0", SUBSTR(s, 2), s)
-
- # ---------------------------------------------------------------------------
-
- ***************
- *** 76,110 ****
- # dependent upon the current date, it's tricky and results may not be
- # what you expect. You should try to make sure that the OMIT context
- # "near" any current reminders will not change during a calendar run.
-
- ! set thisyear year(today())
-
- ! OMIT 4 July MSG The real thing!
-
- ! # Check for Saturday case
- ! if wkdaynum(date(thisyear, 7, 4)) == Saturday
- ! OMIT 3 July [thisyear] MSG 4 July (observed)
- ! endif
-
- ! # Check for Sunday case
- ! if wkdaynum(date(thisyear, 7, 4)) == Sunday
- ! OMIT 5 July [thisyear] MSG 4 July (observed)
- ! endif
-
- ! # ---------------------------------------------------------------------------
-
- ! # Here's the since() function - quite useful for remembering how
- ! # old kids are:
-
- ! fset since(x) ord(year(trigdate())-x)
-
- ! # Here's an example of how to use it:
- ! REM 1 Nov ++12 MSG %"Dean's [since(1984)] birthday%" is %b.
-
- # ---------------------------------------------------------------------------
-
- # How do we get a double-quote into a string???? Only works on ASCII
- # machines
-
- set example "The last word of this sentence is in " \
- ! + char(34) + "quotes." + char(34)
- --- 97,299 ----
- # dependent upon the current date, it's tricky and results may not be
- # what you expect. You should try to make sure that the OMIT context
- # "near" any current reminders will not change during a calendar run.
- + # The SCANFROM clause should help make these OMITs very safe.
-
- ! # Convenient function and variable for safe moveable OMITs
- ! FSET _safe(x) trigger(today()-x)
- ! # Usually, a safety margin of 7 is sufficient. We can stick it in a
- ! # variable. Note that you must NOT preserve this variable, because
- ! # it must be updated as today() is incremented.
- ! SET safe7 _safe(7)
-
- ! # The usual holiday
- ! OMIT 4 July MSG Independence day
-
- ! # Calculate a "potential" advanced holiday
- ! REM 3 July SCANFROM [safe7] SATISFY 1
-
- ! # But only trigger it if it falls on a Friday
- ! IF WKDAYNUM(TRIGDATE()) == 5
- ! OMIT [TRIGGER(TRIGDATE())] MSG Independence day (observed)
- ! ENDIF
-
- ! # Calculate a "potential" delayed holiday
- ! REM 5 July SCANFROM [safe7] SATISFY 1
-
- ! # But only trigger it if it falls on a Monday
- ! IF WKDAYNUM(TRIGDATE()) == 1
- ! OMIT [TRIGGER(TRIGDATE())] MSG Independence day (observed)
- ! ENDIF
-
- ! # ---------------------------------------------------------------------------
- ! # Function to calculate number of years since a given year or
- ! # number of months since a given month and year... useful for kids'
- ! # birthdays.
-
- ! FSET _yr_num(yr) ORD(YEAR(TRIGDATE()) - yr)
- ! FSET _mo_num(mo, yr) ORD(12 * (YEAR(TRIGDATE()) - yr) + \
- ! MONNUM(TRIGDATE()) - mo)
-
- + # Here's an example of how to use them:
- + REM 1 Nov ++12 MSG %"Dean's [_yr_num(1984)] birthday%" is %b.
- + REM 1 MSG Dean's [_mo_num(11, 1984)] 'monthly' anniversary
- # ---------------------------------------------------------------------------
-
- # How do we get a double-quote into a string???? Only works on ASCII
- # machines
-
- + set Quote char(34)
- set example "The last word of this sentence is in " \
- ! + Quote + "quotes." + Quote
- !
- ! # ---------------------------------------------------------------------------
- !
- ! # Function to send mail via elm's "fastmail" (by George M. Sipe)...
- !
- ! #FSET _mail(from, subj) "mailx -s " + \
- ! # Quote + from + " : " + subj + Quote \
- ! # getenv("LOGNAME") + " < /dev/null 1>&0"
- !
- ! FSET _mail(from, subj) "fastmail -f " + \
- ! Quote + from + Quote + \
- ! " -s " + Quote + subj + Quote + \
- ! " /dev/null " + getenv("LOGNAME")
- !
- ! # Example of use of _mail
- ! REM Feb 14 ONCE RUN [_mail("Someone you know", "Valentine's day is today")]
- !
- ! # ---------------------------------------------------------------------------
- !
- ! # A meeting on the first Monday of every month which is moved to the
- ! # second Monday in the event of a holiday.
- !
- ! # First, the normal meeting. However, the SKIP keyword means this
- ! # one won't be triggered if the first Monday is a holiday
- ! REM Mon 1 SKIP MSG Meeting
- !
- ! # Now, calculate the "potential" delayed meeting
- ! REM Mon 8 SATISFY 1
- !
- ! # But only actually trigger the delayed meeting if the previous
- ! # Monday was a holiday
- ! IF ISOMITTED(TRIGDATE()-7)
- ! REM [TRIGGER(TRIGDATE())] MSG Delayed meeting
- ! ENDIF
- !
- ! # ---------------------------------------------------------------------------
- ! #
- ! # A very complicated reminder sent in by a Remind user.
- ! # This person gets paid every two weeks, starting from 8 January 1993.
- ! # If a pay date occurs before the twelfth of a month, then that
- ! # he pays his mortgage on that pay date. Otherwise, he pays the mortgage
- ! # on the previous pay date. Furthermore, he has to schedule his
- ! # mortgage payment six days before it is due. He wants to be reminded
- ! # a further four days before the scheduling deadline. He also
- ! # wants to be mailed a notice two weeks before the scheduling deadline.
- !
- ! # Here's the solution - if you can follow this, consider yourself a
- ! # Remind programmer extraordinaire!
- !
- ! # A function to determine whether or not a pay-date is a mortgage-date.
- !
- ! FSET _IsMortDate(x) DAY(x) < 12 || (DAY(x+14) >= 12 && DAY(x+14) <= 14)
- !
- ! # Paydays - for reference
- !
- ! REM 8 Jan 1993 *14 MSG Payday
- !
- ! # Calculate the mortgage payment six days ahead of time. Note that this
- ! # is done "implicitly" by subtracting 6 from the starting date - we start
- ! # on 2 Jan rather than 8 Jan. We add 6 to TRIGDATE() in _IsMortDate to
- ! # compensate.
- !
- ! REM 2 Jan 1993 *14 SATISFY _IsMortDate(TRIGDATE()+6)
- ! REM [TRIGGER(TRIGDATE())] ++4 MSG %"Schedule mortgage payment%" for %a.
- !
- ! # Now the mail reminder two weeks before the payment date - because two
- ! # weeks before a payment date is also a payment date, no pre-compensation
- ! # in the starting date of 8 Jan is necessary - convince yourself of this!
- ! # This uses the _mail() function defined earlier.
- !
- ! REM 8 Jan 1993 *14 SATISFY _IsMortDate(TRIGDATE()+14)
- ! REM [TRIGGER(TRIGDATE())] ONCE RUN [_mail("Decatur Federal", \
- ! "Pay mortgage by the " + ORD(DAY(TRIGDATE()+14)))]
- !
- ! # Make an entry on the calendar when the mortgage should be paid
- !
- ! REM 8 Jan 1993 *14 SATISFY _IsMortDate(TRIGDATE())
- ! REM [TRIGGER(TRIGDATE())] CAL Mortgage payment
- !
- !
- ! # ---------------------------------------------------------------------------
- ! #
- ! # The following holidays were provided by Dave Rickel
- ! # Modified by D. Skoll to give safe OMITs for moveable holidays
- !
- ! set thisyear year(today())
- ! if ! defined("eyear")
- ! set eyear 0
- ! endif
- !
- ! # Note: A shorter way to set a default value for eyear is the following:
- ! # set eyear value("eyear", 0) -- David S.
- !
- ! if eyear != thisyear
- ! set a thisyear % 19
- ! set b thisyear / 100
- ! set c thisyear % 100
- ! set d b / 4
- ! set e b % 4
- ! set f (b + 8) % 25
- ! set g (b - f + 1) / 3
- ! set h (19 * a + b - d - g + 15) % 30
- ! set i c / 4
- ! set k c % 4
- ! set l (32 + e + e + i + i - h - k) % 7
- ! set m (a + 11 * h + 22 * l) / 451
- ! set a h + l - 7 * m + 114
- ! set n a / 31
- ! set p a % 31 + 1
- !
- ! set eyear thisyear
- ! set emon mon(n)
- ! set eday p
- ! preserve eyear emon eday
- ! endif
- ! REM [emon] [eday] MSG Easter Sunday.
- !
- ! # Some holidays are omitted, some are not. You may want to change
- ! # which ones are omitted - use the general forms shown below.
- ! # You'll need the safe7 variable from way up above.
- !
- ! REM Monday Feb 15 SCANFROM [safe7] SATISFY 1
- ! OMIT [trigger(trigdate())] MSG President's Day.
- !
- ! REM Saturday Mar 31 MSG Daylight Savings Time begins tonight.
- ! REM Mon Tue Wed Thu Fri Sat 15 April MSG Income Tax Day.
- ! REM Saturday May 1 MSG Kentucky Derby Day.
- ! REM Sunday May 8 MSG Mother's Day.
- !
- ! REM Monday May 25 SCANFROM [safe7] SATISFY 1
- ! OMIT [trigger(trigdate())] MSG Memorial Day.
- !
- ! REM Sunday June 15 MSG Father's Day.
- !
- ! REM Monday Sep 1 SCANFROM [safe7] SATISFY 1
- ! OMIT [trigger(trigdate())] MSG Labor Day.
- !
- ! REM Monday Oct 8 SCANFROM [safe7] SATISFY 1
- ! OMIT [trigger(trigdate())] MSG Columbus Day.
- !
- ! REM Monday Oct 22 SCANFROM [safe7] SATISFY 1
- ! OMIT [trigger(trigdate())] MSG Veteran's Day.
- !
- ! REM Saturday Oct 24 MSG Daylight Savings Time ends tonight.
- !
- ! REM Tuesday Nov 2 SCANFROM [safe7] SATISFY (year(trigdate()) % 4) == 0
- ! OMIT [trigger(trigdate())] MSG U.S. Election Day.
- !
- ! REM Saturday Nov 12 MSG Sadie Hawkin's Day.
- !
- ! REM Thursday Nov 22 SCANFROM [safe7] SATISFY 1
- ! OMIT [trigger(trigdate())] MSG Thanksgiving.
- *** ../patch3/dorem.c Fri Feb 5 14:48:35 1993
- --- ./dorem.c Tue Mar 2 16:20:33 1993
- ***************
- *** 26,31 ****
- --- 26,32 ----
-
- PRIVATE int ParseTimeTrig ARGS ((ParsePtr s, TimeTrig *tim));
- PRIVATE int ParseLocalOmit ARGS ((ParsePtr s, Trigger *t));
- + PRIVATE int ParseScanFrom ARGS ((ParsePtr s, Trigger *t));
- PRIVATE int ParseUntil ARGS ((ParsePtr s, Trigger *t));
-
- /***************************************************************/
- ***************
- *** 54,60 ****
- if (trig.typ == NO_TYPE) return E_EOLN;
- if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
- /* Calculate the trigger date */
- ! jul = ComputeTrigger(JulianToday, &trig, &r);
- if (r) return r;
-
- /* Queue the reminder, if necessary */
- --- 55,61 ----
- if (trig.typ == NO_TYPE) return E_EOLN;
- if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
- /* Calculate the trigger date */
- ! jul = ComputeTrigger(trig.scanfrom, &trig, &r);
- if (r) return r;
-
- /* Queue the reminder, if necessary */
- ***************
- *** 108,113 ****
- --- 109,115 ----
- trig->skip = NO_SKIP;
- trig->once = NO_ONCE;
- trig->typ = NO_TYPE;
- + trig->scanfrom = NO_DATE;
- tim->ttime = NO_TIME;
- tim->delta = NO_DELTA;
- tim->rep = NO_REP;
- ***************
- *** 149,154 ****
- --- 151,161 ----
- if (r) return r;
- break;
-
- + case T_Scanfrom:
- + r=ParseScanFrom(s, trig);
- + if (r) return r;
- + break;
- +
- case T_RemType:
- trig->typ = tok.val;
- if (s->isnested) {
- ***************
- *** 155,160 ****
- --- 162,168 ----
- Eprint("Can't nest '%s' in expression", TokBuffer);
- return E_PARSE_ERR;
- }
- + if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
- return OK;
-
- case T_Until:
- ***************
- *** 216,221 ****
- --- 224,230 ----
- break;
-
- case T_Empty:
- + if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
- return OK;
-
- default:
- ***************
- *** 363,368 ****
- --- 372,378 ----
- Eprint("Incompletely specified UNTIL");
- return E_PARSE_ERR;
- }
- + if (!DateOK(y, m, d)) return E_BAD_DATE;
- t->until = Julian(y, m, d);
- PushToken(TokBuffer);
- return OK;
- ***************
- *** 372,377 ****
- --- 382,453 ----
-
- /***************************************************************/
- /* */
- + /* ParseScanFrom - parse the SCANFROM portion of a reminder */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PRIVATE int ParseScanFrom(ParsePtr s, Trigger *t)
- + #else
- + static int ParseScanFrom(s, t)
- + ParsePtr s;
- + Trigger *t;
- + #endif
- + {
- + int y = NO_YR,
- + m = NO_MON,
- + d = NO_DAY;
- +
- + Token tok;
- + int r;
- +
- + if (t->scanfrom != NO_DATE) {
- + Eprint("Cannot specify SCANFROM twice");
- + return E_PARSE_ERR;
- + }
- +
- + while(1) {
- + r = ParseToken(s, TokBuffer);
- + if (r) return r;
- + FindToken(TokBuffer, &tok);
- + switch(tok.type) {
- + case T_Year:
- + if (y != NO_YR) {
- + Eprint("Year specified twice in SCANFROM");
- + return E_PARSE_ERR;
- + }
- + y = tok.val;
- + break;
- +
- + case T_Month:
- + if (m != NO_MON) {
- + Eprint("Month specified twice in SCANFROM");
- + return E_PARSE_ERR;
- + }
- + m = tok.val;
- + break;
- +
- + case T_Day:
- + if (d != NO_DAY) {
- + Eprint("Day specified twice in SCANFROM");
- + return E_PARSE_ERR;
- + }
- + d = tok.val;
- + break;
- +
- + default:
- + if (y == NO_YR || m == NO_MON || d == NO_DAY) {
- + Eprint("Incompletely specified SCANFROM");
- + return E_PARSE_ERR;
- + }
- + if (!DateOK(y, m, d)) return E_BAD_DATE;
- + t->scanfrom = Julian(y, m, d);
- + PushToken(TokBuffer);
- + return OK;
- + }
- + }
- + }
- + /***************************************************************/
- + /* */
- /* TriggerReminder */
- /* */
- /* Trigger the reminder if it's a RUN or MSG type. */
- ***************
- *** 388,412 ****
- #endif
- {
- int r, y, m, d;
- - Trigger tempTrig;
- - TimeTrig tempTime;
- - Parser tempP;
-
- if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
- if (t->typ == CAL_TYPE) return OK;
-
- ! /* If we're in Daemon mode, do nothing over here... */
- !
- ! /* If it's a MSG-type reminder, issue the banner. */
- ! if (t->typ == MSG_TYPE && !NumTriggered && !NextMode) {
- ! CreateParser(Banner, &tempP);
- ! tempP.allownested = 0;
- ! tempTrig.typ = MSG_TYPE;
- ! tempTime.ttime = SystemTime()/60;
- ! if (!(r=DoSubst(&tempP, SubstBuffer, &tempTrig,
- ! &tempTime, JulianToday, NORMAL_MODE)))
- if (*SubstBuffer) printf("%s\n", SubstBuffer);
- - DestroyParser(&tempP);
- }
-
- /* If it's NextMode, process as a CAL-type entry, and issue simple-calendar
- --- 464,477 ----
- #endif
- {
- int r, y, m, d;
-
- if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
- if (t->typ == CAL_TYPE) return OK;
-
- ! /* If it's a MSG-type reminder, and no -k option was used, issue the banner. */
- ! if (t->typ == MSG_TYPE && !NumTriggered && !NextMode && !MsgCommand) {
- ! if (!DoSubstFromString(Banner, SubstBuffer, JulianToday, NO_TIME))
- if (*SubstBuffer) printf("%s\n", SubstBuffer);
- }
-
- /* If it's NextMode, process as a CAL-type entry, and issue simple-calendar
- ***************
- *** 424,433 ****
- /* Put the substituted string into the SubstBuffer */
- if ( (r=DoSubst(p, SubstBuffer, t, tim, jul, NORMAL_MODE)) ) return r;
-
- ! /* Go for it... */
- ! if (t->typ == MSG_TYPE) printf("%s\n", SubstBuffer);
- ! else system(SubstBuffer);
-
- NumTriggered++;
- return OK;
- }
- --- 489,517 ----
- /* Put the substituted string into the SubstBuffer */
- if ( (r=DoSubst(p, SubstBuffer, t, tim, jul, NORMAL_MODE)) ) return r;
-
- ! /* If we are sorting, just queue it up in the sort buffer */
- ! if (SortByDate) {
- ! if (InsertIntoSortBuffer(jul, tim->ttime, SubstBuffer, t->typ) == OK) {
- ! NumTriggered++;
- ! return OK;
- ! }
- ! /* If we failed to insert the reminder into the sort buffer, issue the
- ! reminder now. */
- ! }
-
- + /* Otherwise, issue the reminder now */
- + if (t->typ == MSG_TYPE) {
- + if (!MsgCommand)
- + printf("%s\n", SubstBuffer);
- + else {
- + char buf[LINELEN+TOKSIZE];
- + sprintf(buf, MsgCommand, SubstBuffer);
- + system(buf);
- + }
- + } else { /* Must be RUN_TYPE */
- + system(SubstBuffer);
- + }
- +
- NumTriggered++;
- return OK;
- }
- ***************
- *** 519,525 ****
- char *s;
-
- iter = 0;
- ! jul = JulianToday;
- while (iter++ < MaxSatIter) {
- jul = ComputeTrigger(jul, trig, &r);
- if (r) {
- --- 603,609 ----
- char *s;
-
- iter = 0;
- ! jul = trig->scanfrom;
- while (iter++ < MaxSatIter) {
- jul = ComputeTrigger(jul, trig, &r);
- if (r) {
- *** ../patch3/dosubst.c Mon Jan 25 16:09:28 1993
- --- ./dosubst.c Fri Mar 5 11:57:34 1993
- ***************
- *** 42,48 ****
- /* mode==CAL_MODE, process the %" sequence. */
- /* */
- /***************************************************************/
- -
- #ifdef HAVE_PROTOS
- PUBLIC int DoSubst(ParsePtr p, char *out, Trigger *t, TimeTrig *tt, int jul, int mode)
- #else
- --- 42,47 ----
- ***************
- *** 82,94 ****
- h = tim / 60;
- min = tim % 60;
-
- ! pm = (h < 12) ? "am" : "pm";
- hh = (h == 12) ? 12 : h % 12;
-
- ch = curtime / 60;
- cmin = curtime % 60;
-
- ! cpm = (ch < 12) ? "am" : "pm";
- chh = (ch == 12) ? 12 : ch % 12;
-
- #ifdef L_ORDINAL_OVERRIDE
- --- 81,101 ----
- h = tim / 60;
- min = tim % 60;
-
- ! #ifdef L_AMPM_OVERRIDE
- ! L_AMPM_OVERRIDE (pm, h)
- ! #else
- ! pm = (h < 12) ? L_AM : L_PM;
- ! #endif
- hh = (h == 12) ? 12 : h % 12;
-
- ch = curtime / 60;
- cmin = curtime % 60;
-
- ! #ifdef L_AMPM_OVERRIDE
- ! L_AMPM_OVERRIDE (cpm, ch)
- ! #else
- ! cpm = (ch < 12) ? L_AM : L_PM;
- ! #endif
- chh = (ch == 12) ? 12 : ch % 12;
-
- #ifdef L_ORDINAL_OVERRIDE
- ***************
- *** 114,120 ****
- if (err) return err;
- if (c == '\n') continue;
- if (!c) {
- ! if (mode != CAL_MODE && t->typ != RUN_TYPE) *s++ = '\n';
- *s++ = 0;
- break;
- }
- --- 121,128 ----
- if (err) return err;
- if (c == '\n') continue;
- if (!c) {
- ! if (mode != CAL_MODE && t->typ != RUN_TYPE && !MsgCommand)
- ! *s++ = '\n';
- *s++ = 0;
- break;
- }
- ***************
- *** 452,458 ****
- L_3_OVER
- #else
-
- ! sprintf(s, "%s %02d:%02d", L_AT, h, min);
- #endif
- s += strlen(s);
- break;
- --- 460,466 ----
- L_3_OVER
- #else
-
- ! sprintf(s, "%s %02d%c%02d", L_AT, h, TIMESEP, min);
- #endif
- s += strlen(s);
- break;
- ***************
- *** 542,554 ****
- #ifdef L_HASH_OVER
- L_HASH_OVER
- #else
- ! sprintf(s, "%02d:%02d", ch, cmin);
- #endif
- s += strlen(s);
- break;
-
- case '_':
- ! if (mode != CAL_MODE)
- sprintf(s, "%s", NL);
- else
- sprintf(s, " ");
- --- 550,562 ----
- #ifdef L_HASH_OVER
- L_HASH_OVER
- #else
- ! sprintf(s, "%02d%c%02d", ch, TIMESEP, cmin);
- #endif
- s += strlen(s);
- break;
-
- case '_':
- ! if (mode != CAL_MODE && !MsgCommand)
- sprintf(s, "%s", NL);
- else
- sprintf(s, " ");
- ***************
- *** 611,613 ****
- --- 619,656 ----
- }
-
-
- + /***************************************************************/
- + /* */
- + /* DoSubstFromString */
- + /* */
- + /* DoSubst consumes input from a parser. This function */
- + /* consumes characters from a string. It also provides */
- + /* default triggers and a mode of NORMAL_MODE. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PUBLIC int DoSubstFromString(char *source, char *dest, int jul, int tim)
- + #else
- + int DoSubstFromString(source, dest, jul, tim)
- + char *source;
- + char *dest;
- + int jul;
- + int tim;
- + #endif
- + {
- + Trigger tempTrig;
- + TimeTrig tempTime;
- + Parser tempP;
- + int r;
- +
- + if (jul == NO_DATE) jul=JulianToday;
- + if (tim == NO_TIME) tim=SystemTime()/60;
- + CreateParser(source, &tempP);
- + tempP.allownested = 0;
- + tempTrig.typ = MSG_TYPE;
- + tempTime.ttime = tim;
- +
- + r = DoSubst(&tempP, dest, &tempTrig, &tempTime, jul, NORMAL_MODE);
- + DestroyParser(&tempP);
- + return r;
- + }
- *** ../patch3/english.h Fri Jan 22 14:41:34 1993
- --- ./english.h Tue Feb 16 17:19:32 1993
- ***************
- *** 45,50 ****
- --- 45,54 ----
- /* The default banner */
- #define L_BANNER "Reminders for %w, %d%s %m, %y%o:"
-
- + /* "am" and "pm" */
- + #define L_AM "am"
- + #define L_PM "pm"
- +
- /*** The following are only used in dosubst.c ***/
- #ifdef L_IN_DOSUBST
-
- *** ../patch3/err.h Fri Jan 8 13:25:56 1993
- --- ./err.h Mon Feb 15 20:41:25 1993
- ***************
- *** 70,76 ****
- = {
- "Ok",
- "Missing ']'",
- ! "Missing double-quote",
- "Expression too complex - too many operators",
- "Expression too complex - too many operands",
- "Missing ')'",
- --- 70,76 ----
- = {
- "Ok",
- "Missing ']'",
- ! "Missing quote",
- "Expression too complex - too many operators",
- "Expression too complex - too many operands",
- "Missing ')'",
- *** ../patch3/expr.c Fri Feb 5 14:51:35 1993
- --- ./expr.c Wed Mar 3 17:35:34 1993
- ***************
- *** 44,50 ****
- GreaterOrEqual(void), LogAND(void), LogOR(void),
- UnMinus(void), LogNot(void),
- Compare(int);
- - PRIVATE Operator *FindFunc(char *name, Operator where[], int num);
- #else
- PRIVATE int Multiply(), Divide(), Mod(), Add(),
- Subtract(), GreaterThan(), LessThan(),
- --- 44,49 ----
- ***************
- *** 51,57 ****
- EqualTo(), NotEqual(), LessOrEqual(),
- GreaterOrEqual(), LogAND(), LogOR(),
- UnMinus(), LogNot(), Compare();
- - PRIVATE Operator *FindFunc();
- #endif
-
- PRIVATE int MakeValue ARGS ((char *s, Value *v, Var *locals));
- --- 50,55 ----
- ***************
- *** 227,232 ****
- --- 225,231 ----
-
- /* Handle the parsing of quoted strings */
- if (c == '\"') {
- + if (!*(*in+1)) return E_MISS_QUOTE;
- while (**in) if ((c = *out++ = *(*in)++) == '\"') break;
- *out = 0;
- if (c == '\"') return OK ; else return E_MISS_QUOTE;
- ***************
- *** 234,239 ****
- --- 233,239 ----
-
- /* Dates can be specified with single-quotes */
- if (c == '\'') {
- + if (!*(*in+1)) return E_MISS_QUOTE;
- while (**in) if ((c = *out++ = *(*in)++) == '\'') break;
- *out = 0;
- if (c == '\'') return OK ; else return E_MISS_QUOTE;
- ***************
- *** 245,251 ****
- }
-
- /* Parse a constant, variable name or function */
- ! while (ISID(**in) || **in == ':') *out++ = *(*in)++;
-
- /* Chew up any remaining white space */
- while (**in && isspace(**in)) (*in)++;
- --- 245,252 ----
- }
-
- /* Parse a constant, variable name or function */
- ! while (ISID(**in) || **in == ':' || **in == '.' || **in == TIMESEP)
- ! *out++ = *(*in)++;
-
- /* Chew up any remaining white space */
- while (**in && isspace(**in)) (*in)++;
- ***************
- *** 341,349 ****
- while(1) {
- args++;
- r = Evaluate(s, locals);
- ! if (r) return r;
- if (*ExprBuf == ')') break;
- else if (*ExprBuf != ',') {
- Eprint("Expecting comma, found '%c'", *ExprBuf);
- return E_ILLEGAL_CHAR;
- }
- --- 342,354 ----
- while(1) {
- args++;
- r = Evaluate(s, locals);
- ! if (r) {
- ! if (!f) free(ufname);
- ! return r;
- ! }
- if (*ExprBuf == ')') break;
- else if (*ExprBuf != ',') {
- + if (!f) free(ufname);
- Eprint("Expecting comma, found '%c'", *ExprBuf);
- return E_ILLEGAL_CHAR;
- }
- ***************
- *** 458,464 ****
- len *= 10;
- len += (*s++ - '0');
- }
- ! if (*s == ':') { /* Must be a literal time */
- s++;
- if (!isdigit(*s)) return E_BAD_TIME;
- h = len;
- --- 463,469 ----
- len *= 10;
- len += (*s++ - '0');
- }
- ! if (*s == ':' || *s == '.' || *s == TIMESEP) { /* Must be a literal time */
- s++;
- if (!isdigit(*s)) return E_BAD_TIME;
- h = len;
- ***************
- *** 601,607 ****
- case STR_TYPE:
- switch(v->type) {
- case INT_TYPE: sprintf(CoerceBuf, "%d", v->v.val); break;
- ! 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",
- --- 606,613 ----
- case STR_TYPE:
- switch(v->type) {
- case INT_TYPE: sprintf(CoerceBuf, "%d", v->v.val); break;
- ! case TIM_TYPE: sprintf(CoerceBuf, "%02d%c%02d", v->v.val / 60,
- ! TIMESEP, v->v.val % 60);
- break;
- case DATE_TYPE: FromJulian(v->v.val, &y, &m, &d);
- sprintf(CoerceBuf, "%04d%c%02d%c%02d",
- ***************
- *** 686,692 ****
- h *= 10;
- h += *s++ - '0';
- }
- ! if (*s++ != ':') return E_CANT_COERCE;
- if (!isdigit(*s)) return E_CANT_COERCE;
- while (isdigit(*s)) {
- m *= 10;
- --- 692,700 ----
- h *= 10;
- h += *s++ - '0';
- }
- ! if (*s != ':' && *s != '.' && *s != TIMESEP)
- ! return E_CANT_COERCE;
- ! s++;
- if (!isdigit(*s)) return E_CANT_COERCE;
- while (isdigit(*s)) {
- m *= 10;
- ***************
- *** 754,759 ****
- --- 762,768 ----
- if ((v1.type == DATE_TYPE && v2.type == INT_TYPE) ||
- (v1.type == INT_TYPE && v2.type == DATE_TYPE)) {
- v1.v.val += v2.v.val;
- + if (v1.v.val < 0) return E_DATE_OVER;
- v1.type = DATE_TYPE;
- return PushValStack(&v1);
- }
- ***************
- *** 1128,1136 ****
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PRIVATE Operator *FindFunc(char *name, Operator where[], int num)
- #else
- ! static Operator *FindFunc(name, where, num)
- char *name;
- Operator where[];
- int num;
- --- 1137,1145 ----
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! Operator *FindFunc(char *name, Operator where[], int num)
- #else
- ! Operator *FindFunc(name, where, num)
- char *name;
- Operator where[];
- int num;
- ***************
- *** 1174,1180 ****
- if (*s) fprintf(fp, "...");
- }
- else if (v->type == INT_TYPE) fprintf(fp, "%d", v->v.val);
- ! 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);
- --- 1183,1190 ----
- if (*s) fprintf(fp, "...");
- }
- else if (v->type == INT_TYPE) fprintf(fp, "%d", v->v.val);
- ! else if (v->type == TIM_TYPE) fprintf(fp, "%02d%c%02d", v->v.val / 60,
- ! TIMESEP, 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);
- ***************
- *** 1234,1240 ****
- y *= 10;
- y += *(*s)++ - '0';
- }
- ! if (**s != '/' && **s != '-') return E_BAD_DATE;
- (*s)++;
- if (!isdigit(**s)) return E_BAD_DATE;
- while (isdigit(**s)) {
- --- 1244,1250 ----
- y *= 10;
- y += *(*s)++ - '0';
- }
- ! if (**s != '/' && **s != '-' && **s != DATESEP) return E_BAD_DATE;
- (*s)++;
- if (!isdigit(**s)) return E_BAD_DATE;
- while (isdigit(**s)) {
- ***************
- *** 1242,1248 ****
- m += *(*s)++ - '0';
- }
- m--;
- ! if (**s != '/' && **s != '-') return E_BAD_DATE;
- (*s)++;
- if (!isdigit(**s)) return E_BAD_DATE;
- while (isdigit(**s)) {
- --- 1252,1258 ----
- m += *(*s)++ - '0';
- }
- m--;
- ! if (**s != '/' && **s != '-' && **s != DATESEP) return E_BAD_DATE;
- (*s)++;
- if (!isdigit(**s)) return E_BAD_DATE;
- while (isdigit(**s)) {
- ***************
- *** 1249,1257 ****
- d *= 10;
- d += *(*s)++ - '0';
- }
- ! if (y < BASE || y > BASE+YR_RANGE || m<0 ||
- ! m>11 || d<1 || d>DaysInMonth(m, y)) return E_BAD_DATE;
- !
- *jul = Julian(y, m, d);
-
- return OK;
- --- 1259,1266 ----
- d *= 10;
- d += *(*s)++ - '0';
- }
- ! if (!DateOK(y, m, d)) return E_BAD_DATE;
- !
- *jul = Julian(y, m, d);
-
- return OK;
- *** ../patch3/files.c Fri Feb 5 14:52:12 1993
- --- ./files.c Mon Mar 1 13:00:30 1993
- ***************
- *** 39,52 ****
- #include "err.h"
-
- /* Define the structures needed by the file caching system */
- ! typedef struct _cache_ {
- ! struct _cache_ *next;
- char *text;
- int LineNo;
- } CachedLine;
-
- ! typedef struct _cheader_ {
- ! struct _cheader_ *next;
- char *filename;
- CachedLine *cache;
- } CachedFile;
- --- 39,52 ----
- #include "err.h"
-
- /* Define the structures needed by the file caching system */
- ! typedef struct cache {
- ! struct cache *next;
- char *text;
- int LineNo;
- } CachedLine;
-
- ! typedef struct cheader {
- ! struct cheader *next;
- char *filename;
- CachedLine *cache;
- } CachedFile;
- *** ../patch3/funcs.c Fri Feb 5 14:43:14 1993
- --- ./funcs.c Tue Mar 2 16:27:55 1993
- ***************
- *** 47,52 ****
- --- 47,53 ----
- /* Function prototypes */
- PRIVATE int FAbs ARGS ((void));
- PRIVATE int FAccess ARGS ((void));
- + PRIVATE int FArgs ARGS ((void));
- PRIVATE int FAsc ARGS ((void));
- PRIVATE int FBaseyr ARGS ((void));
- PRIVATE int FChar ARGS ((void));
- ***************
- *** 56,61 ****
- --- 57,63 ----
- PRIVATE int FDay ARGS ((void));
- PRIVATE int FDaysinmon ARGS ((void));
- PRIVATE int FDefined ARGS ((void));
- + PRIVATE int FDosubst ARGS ((void));
- PRIVATE int FFilename ARGS ((void));
- PRIVATE int FGetenv ARGS ((void));
- PRIVATE int FHour ARGS ((void));
- ***************
- *** 136,141 ****
- --- 138,144 ----
-
- { "abs", 1, 1, FAbs },
- { "access", 2, 2, FAccess },
- + { "args", 1, 1, FArgs },
- { "asc", 1, 1, FAsc },
- { "baseyr", 0, 0, FBaseyr },
- { "char", 1, NO_MAX, FChar },
- ***************
- *** 145,150 ****
- --- 148,154 ----
- { "day", 1, 1, FDay },
- { "daysinmon", 2, 2, FDaysinmon },
- { "defined", 1, 1, FDefined },
- + { "dosubst", 1, 3, FDosubst },
- { "filename", 0, 0, FFilename },
- { "getenv", 1, 1, FGetenv },
- { "hour", 1, 1, FHour },
- ***************
- *** 370,377 ****
- m = ARG(1).v.val - 1;
- d = ARG(2).v.val;
-
- ! if (y < BASE || y > BASE+YR_RANGE || m < 0 || m > 11 || d < 1 ||
- ! d > DaysInMonth(m, y)) return E_BAD_DATE;
-
- RetVal.type = DATE_TYPE;
- RetVal.v.val = Julian(y, m, d);
- --- 374,380 ----
- m = ARG(1).v.val - 1;
- d = ARG(2).v.val;
-
- ! if (!DateOK(y, m, d)) return E_BAD_DATE;
-
- RetVal.type = DATE_TYPE;
- RetVal.v.val = Julian(y, m, d);
- ***************
- *** 1435,1437 ****
- --- 1438,1492 ----
- {
- return RetStrVal(L_LANGNAME);
- }
- +
- + /***************************************************************/
- + /* */
- + /* FArgs */
- + /* */
- + /* Implement the args() function. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PRIVATE int FArgs(void)
- + #else
- + static int FArgs()
- + #endif
- + {
- + if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
- + RetVal.type = INT_TYPE;
- + RetVal.v.val = UserFuncExists(ARG(0).v.str);
- + return OK;
- + }
- +
- + /***************************************************************/
- + /* */
- + /* FDosubst */
- + /* */
- + /* Implement the dosubst() function. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PRIVATE int FDosubst(void)
- + #else
- + static int FDosubst()
- + #endif
- + {
- + int jul, tim, r;
- + char TmpBuf[LINELEN];
- +
- + jul = NO_DATE;
- + tim = NO_TIME;
- + if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
- + if (Nargs >= 2) {
- + if (ARG(1).type != DATE_TYPE) return E_BAD_TYPE;
- + jul = ARG(1).v.val;
- + if (Nargs >= 3) {
- + if (ARG(2).type != TIM_TYPE) return E_BAD_TYPE;
- + tim = ARG(2).v.val;
- + }
- + }
- +
- + if ((r=DoSubstFromString(ARG(0).v.str, TmpBuf, jul, tim))) return r;
- + return RetStrVal(TmpBuf);
- + }
- +
- *** ../patch3/german.h Fri Jan 22 14:41:16 1993
- --- ./german.h Tue Mar 2 12:15:26 1993
- ***************
- *** 31,37 ****
- /* Month names */
- #define L_JAN "Januar"
- #define L_FEB "Februar"
- ! #define L_MAR "Maerz"
- #define L_APR "April"
- #define L_MAY "Mai"
- #define L_JUN "Juni"
- --- 31,41 ----
- /* Month names */
- #define L_JAN "Januar"
- #define L_FEB "Februar"
- ! #ifdef ISOLATIN1
- ! # define L_MAR "M\344rz"
- ! #else
- ! # define L_MAR "Maerz"
- ! #endif
- #define L_APR "April"
- #define L_MAY "Mai"
- #define L_JUN "Juni"
- ***************
- *** 47,54 ****
- #define L_TOMORROW "morgen"
-
- /* The default banner */
- ! #define L_BANNER "Termine fuer %w, den %d %m %y%o:"
-
- /*** The following are only used in dosubst.c ***/
- #ifdef L_IN_DOSUBST
-
- --- 51,66 ----
- #define L_TOMORROW "morgen"
-
- /* The default banner */
- ! #ifdef ISOLATIN1
- ! # define L_BANNER "Termine f\374r %w, den %d. %m %y%o:"
- ! #else
- ! # define L_BANNER "Termine fuer %w, den %d. %m %y%o:"
- ! #endif
-
- + /* "am" and "pm" */
- + #define L_AM "am"
- + #define L_PM "pm"
- +
- /*** The following are only used in dosubst.c ***/
- #ifdef L_IN_DOSUBST
-
-