home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-27 | 51.1 KB | 1,619 lines |
- Prereq: "03.00.04"
- *** ../p4rel/version.h Mon Feb 15 13:24:00 1993
- --- ./version.h Thu Apr 22 10:24:22 1993
- ***************
- *** 9,12 ****
- /* */
- /***************************************************************/
-
- ! #define VERSION "03.00.04"
- --- 9,12 ----
- /* */
- /***************************************************************/
-
- ! #define VERSION "03.00.05"
- *** ../p4rel/COPYRIGHT Wed Mar 3 17:13:09 1993
- --- ./COPYRIGHT Thu Apr 22 10:24:02 1993
- ***************
- *** 76,81 ****
- --- 76,84 ----
-
- Phillipp Slusallek for suggesting the -k option.
-
- + Amos Shapir, David W. Tamkin and Frank Yellin for help with the Hebrew
- + calendar.
- +
- All of the language translators whose names are listed in lang.h
-
- Timo Salmi, Keith Petersen, Bill Davidsen and Kent Landfield for
- *** ../p4rel/MANIFEST.DOS Mon Mar 1 16:52:01 1993
- --- ./MANIFEST.DOS Thu Apr 22 10:24:11 1993
- ***************
- *** 15,20 ****
- --- 15,21 ----
- german.h
- globals.c
- globals.h
- + hbcal.c
- init.c
- kall
- kall.1
- *** ../p4rel/MANIFEST.UNX Mon Mar 1 16:51:53 1993
- --- ./MANIFEST.UNX Thu Apr 22 10:24:11 1993
- ***************
- *** 22,27 ****
- --- 22,28 ----
- german.h
- globals.c
- globals.h
- + hbcal.c
- init.c
- kall
- kall.1
- *** ../p4rel/Makefile Tue Mar 2 11:03:25 1993
- --- ./Makefile Thu Apr 22 10:24:10 1993
- ***************
- *** 46,52 ****
- # 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
- --- 46,52 ----
- # 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.05
-
- 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
- ***************
- *** 53,60 ****
-
- 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 \
- --- 53,60 ----
-
- 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 hbcal.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 \
- ***************
- *** 92,97 ****
- --- 92,98 ----
- 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
- + hbcal.o: hbcal.c $(STDHDRS)
- init.o: init.c $(STDHDRS) expr.h version.h
- main.o: main.c $(STDHDRS) expr.h
- omit.o: omit.c $(STDHDRS)
- ***************
- *** 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)
- --- 105,112 ----
- var.o: var.c $(STDHDRS) expr.h
-
- tarZ:
- ! tar cvf remind-3.0.5.tar $(MANIFEST)
- ! compress -v remind-3.0.5.tar
-
- shar:
- shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
- *** ../p4rel/README.DOS Wed Mar 3 17:15:06 1993
- --- ./README.DOS Thu Apr 22 10:24:12 1993
- ***************
- *** 15,21 ****
-
- This will create REMIND.EXE, which is ready to be executed.
-
- ! The file "defs.rem" has some sample Remind definitions and commands.
-
- OTHER LANGUAGE SUPPORT
-
- --- 15,22 ----
-
- This will create REMIND.EXE, which is ready to be executed.
-
- ! The file "defs.rem" has some sample Remind definitions and commands,
- ! as well as U.S. and Jewish holidays.
-
- OTHER LANGUAGE SUPPORT
-
- *** ../p4rel/README.OS2 Wed Mar 3 17:14:49 1993
- --- ./README.OS2 Thu Apr 22 10:24:12 1993
- ***************
- *** 17,23 ****
- This will make 'remind.exe' which is an OS/2 1.x--2.0 executable, and
- 'remindb.exe' which is an OS/2 and MSDOS bound executable.
-
- ! The file "defs.rem" has some sample Remind definitions and commands.
-
- NOTE that I do not have access to an OS/2 system, so support for this
- system may not be as good as I'd like.
- --- 17,24 ----
- This will make 'remind.exe' which is an OS/2 1.x--2.0 executable, and
- 'remindb.exe' which is an OS/2 and MSDOS bound executable.
-
- ! The file "defs.rem" has some sample Remind definitions and commands,
- ! as well as U.S. and Jewish holidays.
-
- NOTE that I do not have access to an OS/2 system, so support for this
- system may not be as good as I'd like.
- *** ../p4rel/README.UNIX Wed Mar 3 17:14:29 1993
- --- ./README.UNIX Thu Apr 22 10:24:13 1993
- ***************
- *** 53,59 ****
- remind processes when you log out. See the man page. Note that kall
- 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
-
- --- 53,60 ----
- remind processes when you log out. See the man page. Note that kall
- depends on the output of "ps", and may not be portable.
-
- ! The file "defs.rem" has some sample Remind definitions and commands,
- ! as well as U.S. and Jewish holidays.
-
- OTHER LANGUAGE SUPPORT
-
- *** ../p4rel/WHATSNEW.30 Wed Mar 3 17:16:40 1993
- --- ./WHATSNEW.30 Thu Apr 22 10:24:22 1993
- ***************
- *** 1,5 ****
- --- 1,40 ----
- CHANGES TO REMIND
-
- + * Version 3.0 Patch 5
- +
- + + MAJOR ENHANCEMENTS:
- +
- + - Added support for the Hebrew calendar - can now specify Jewish holidays
- + easily. Thanks to Amos Shapir for explaining the Hebrew calendar, and
- + to Danny Sadinoff, from whose HEBCAL program I got some inspiration.
- + Also thanks to David W. Tamkin and Frank Yellin for explaining the rules
- + for jahrzeits.
- +
- + + MINOR ENHANCEMENTS:
- +
- + - Allowed the default page size used by Rem2PS to be selected in config.h
- +
- + - Edited the defs.rem file to contain Jewish holidays. Cleaned up some
- + of the examples and improved the layout - thanks to George M. Sipe.
- +
- + - Modified the IIF function to be more general
- +
- + - Updated finnish.h to support the ISO 8859-1 character set, courtesy
- + of Mikko Silvonen.
- +
- + - Changed the date conversion routines to greatly speed up conversion from
- + Julian to yyyy/mm/dd form.
- +
- + + BUG FIXES:
- +
- + - Fixed a bug in which Remind complained incorrectly about a missing quote
- + in the command SET foo ""
- +
- + - Fixed bugs in dosubst.c which caused the %o, %1 and %@ substitutions
- + to be incorrect
- +
- + - Fixed a bug in the man page - thanks to Ed Oskiewicz.
- +
- * Version 3.0 Patch 4
-
- - Added the -g option - this sorts reminders by date/time before
- *** ../p4rel/config.h Tue Mar 2 12:12:49 1993
- --- ./config.h Thu Apr 22 10:24:02 1993
- ***************
- *** 12,17 ****
- --- 12,25 ----
- /***************************************************************/
-
- /*---------------------------------------------------------------------*/
- + /* DEFAULT_PAGE: The default page size to use for Rem2PS. */
- + /* The Letter version is appropriate for North America; the A4 version */
- + /* is appropriate for Europe. */
- + /*---------------------------------------------------------------------*/
- + #define DEFAULT_PAGE {"Letter", 612, 792}
- + /* #define DEFAULT_PAGE {"A4", 595, 842} */
- +
- + /*---------------------------------------------------------------------*/
- /* DATESEP: The default date separator. North American usage is '/'; */
- /* others may prefer '-'. */
- /*---------------------------------------------------------------------*/
- ***************
- *** 61,66 ****
- --- 69,78 ----
- /*---------------------------------------------------------------------*/
- /* BASE: The base year for date calculation. NOTE! January 1 of the */
- /* base year MUST be a Monday, else Remind will not work! */
- + /* IMPORTANT NOTE: The Hebrew date routines depend on BASE */
- + /* being set to 1990. If you change it, you'll have to add the */
- + /* number of days between 1 Jan <NEWBASE> and 1 Jan 1990 to the */
- + /* manifest constant CORRECTION in hbcal.c */
- /*---------------------------------------------------------------------*/
- #define BASE 1990
-
- *** ../p4rel/defs.rem Fri Mar 5 11:46:11 1993
- --- ./defs.rem Thu Apr 22 10:24:03 1993
- ***************
- *** 1,29 ****
- ! # ---------------------------------------------------------------------------
- ! #
- ! # 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
- SET Tuesday 2
- --- 1,38 ----
- ! #############################################################################
- ! # #
- ! # 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> #
- ! # #
- ! # Use your text editor to search for: #
- ! # "#USHOLS" for U.S. holidays #
- ! # "#JHOLS" for Jewish holidays #
- ! # #
- ! # This file is part of REMIND. #
- ! # Copyright (C) 1992, 1993 by David F. Skoll #
- ! # #
- ! #############################################################################
-
- RUN OFF
- !
- ! ################################################
- ! # Ensure required version of remind is used... #
- ! ################################################
- ! IF version() < "03.00.05"
- ! ERRMSG This file requires at least version 03.00.05 of Remind.%
- ! ERRMSG This version is version [version()].
- EXIT
- ENDIF
-
- ! ######################################
- ! # Symbolic constants for weekdays... #
- ! ######################################
- SET Sunday 0
- SET Monday 1
- SET Tuesday 2
- ***************
- *** 40,46 ****
- SET Fri 5
- SET Sat 6
-
- ! # ---------------------------------------------------------------------------
-
- SET Jan 1
- SET Feb 2
- --- 49,57 ----
- SET Fri 5
- SET Sat 6
-
- ! #########################################
- ! # Symbolic constants for month names... #
- ! #########################################
-
- SET Jan 1
- SET Feb 2
- ***************
- *** 55,62 ****
- SET Nov 11
- SET Dec 12
-
- - # ---------------------------------------------------------------------------
- -
- SET January 1
- SET February 2
- SET March 3
- --- 66,71 ----
- ***************
- *** 70,172 ****
- SET November 11
- SET December 12
-
- ! # ---------------------------------------------------------------------------
-
- ! # 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)
-
- ! # ---------------------------------------------------------------------------
-
- ! # Here's a tricky problem: The 4th of July is a holiday in the U.S.
- ! # However, if it falls on a Saturday, the previous Friday is a holiday.
- ! # If it falls on a Sunday, the next Monday is a holiday. Here's how
- ! # to do it. NOTE that the following procedure makes the OMIT context
- ! # dependent upon the current date. SInce it only depends on the current
- ! # year, which is not likely to change while producing a calendar, we
- ! # are fairly safe. However, reminders with huge DELTA or BACK components
- ! # may not operate as expected. In general, any time you make OMIT
- ! # 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
- --- 79,181 ----
- SET November 11
- SET December 12
-
- ! ###########################################################
- ! # Other symbolic constants and functions for "pasting"... #
- ! ###########################################################
-
- ! SET Quote CHAR(34)
-
- ! # Handy constants/function for specifing week of month...
- ! SET Week_1 1
- ! SET Week_2 8
- ! SET Week_3 15
- ! SET Week_4 22
- ! FSET _last(mo) "1 " + MON((mo%12)+1)+" --7"
-
- ! # Shorthand for commonly used expression...
- ! FSET _trig() TRIGGER(TRIGDATE())
-
- ! # Handy function to provide SCANFROM dates...
- ! FSET _back(days) TRIGGER(TODAY()-days)
-
- ! ###########################################################
- ! # Function which returns a string in "am/pm" format based #
- ! # on the time. For example, set a am_pm(NOW())... #
- ! ###########################################################
-
- ! FSET _am_pm(tm) IIF(tm<01:00, tm+12*60+"am", \
- ! tm<12:00, tm+"am", \
- ! tm<13:00, tm+"pm", \
- ! tm-12*60+"pm")
-
- ! #################################################################
- ! # Function which removes a single leading zero from a string... #
- ! #################################################################
-
- ! FSET _no_lz(s) IIF(SUBSTR(s, 1, 1)=="0", SUBSTR(s, 2), s)
-
- ! ############################################################
- ! # Function to calculate number of years since a given year #
- ! # or number of months since a given month and year... #
- ! ############################################################
-
- ! 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
-
- ! ###########################################################
- ! # Function to send mail via elm's "fastmail" (by GMS!)... #
- ! ###########################################################
-
- #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")
-
- ! #############################################################################
- ! # Here's a tricky problem: The 4th of July is a holiday in the U.S.
- ! # However, if it falls on a Saturday, the previous Friday is a holiday.
- ! # If it falls on a Sunday, the next Monday is a holiday. Here's how
- ! # to do it. NOTE that the following procedure makes the OMIT context
- ! # dependent upon the current date. SInce it only depends on the current
- ! # year, which is not likely to change while producing a calendar, we
- ! # are fairly safe. However, reminders with huge DELTA or BACK components
- ! # may not operate as expected. In general, any time you make OMIT
- ! # 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.
- ! ############################################################################
-
- ! # Calculate the weekday of the holiday.
- ! REM 4 July SCANFROM [_back(7)] SATISFY 1
-
- ! IF WKDAYNUM(TRIGDATE()) == Sat
- ! REM [TRIGGER(TRIGDATE())] MSG Independence day (actual)
- ! OMIT [TRIGGER(TRIGDATE()-1)] MSG Independence day (observed)
- ! ELSE
- ! IF WKDAYNUM(TRIGDATE()) == Sun
- ! REM [TRIGGER(TRIGDATE())] MSG Independence day (actual)
- ! OMIT [TRIGGER(TRIGDATE()+1)] MSG Independence day (observed)
- ! ELSE
- ! OMIT [TRIGGER(TRIGDATE())] MSG Independence day
- ! ENDIF
- ! ENDIF
-
- + ############################################################################
- + # #
- + # 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
- ***************
- *** 180,199 ****
- 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)
- --- 189,210 ----
- 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)
- ***************
- *** 225,299 ****
- 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.
- --- 236,444 ----
- REM [TRIGGER(TRIGDATE())] CAL Mortgage payment
-
-
- ! #USHOLS
- ! #############################################################################
- ! # #
- ! # The following holidays were provided by Dave Rickel #
- ! # Modified by D. Skoll to give safe OMITs for moveable holidays #
- ! # #
- ! #############################################################################
-
- ! IF !DEFINED("easter")
- ! SET a YEAR(TODAY())
- ! SET b (a/100 - (a/100 + 8) % 25 + 1) / 3
- ! SET c (a%19*19 + a/100 - a/400 - b + 15) % 30
- ! SET d (32 + a/100%4*2 + (a%100/4*2) - c - a%100%4) % 7
- ! SET e c + d - (((a%19) + c*11 + d*22) / 451) * 7 + 114
- ! SET easter DATE(a, e / 31, e % 31 + 1)
- ! PRESERVE easter
- ! ENDIF
-
- ! REM [TRIGGER(easter-46)] MSG %"Ash Wednesday%"
- ! REM [TRIGGER(easter-7)] MSG %"Palm Sunday%"
- ! OMIT [TRIGGER(easter-2)] MSG %"Good Friday%"
- ! OMIT [TRIGGER(easter)] MSG %"Easter%" Sunday
- ! REM [TRIGGER(easter+39)] MSG %"Ascension Day%"
- ! REM [TRIGGER(easter+49)] MSG %"Pentecost%"
-
- # 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 _back() function and the Week_n variables defined
- ! # way up in the file.
-
- ! OMIT Jan 1 MSG %"New Year's%" Day
- ! REM Mon Jan [Week_3] MSG Martin Luther King - %"MLK Day%"
- ! REM Feb 2 MSG %"Ground Hog Day%"
- ! REM Feb 14 MSG %"Valentine's%" Day
- ! REM Mon Feb [Week_3] SCANFROM [_back(7)] SATISFY 1
- ! OMIT [_trig()] MSG %"President's Day%"
- ! REM Mar 17 MSG %"St. Patrick's%" Day
- ! REM Sun Apr 1 ++2 MSG Daylight Savings Time - %"DST starts%" %b
- ! REM Apr 1 MSG %"April Fool's%" Day
- ! REM Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
- ! REM May 5 MSG %"Cinco de Mayo%"
- ! REM Sat May [Week_1] MSG %"Kentucky Derby%"
- ! REM Sun May [Week_2] MSG %"Mother's Day%"
- ! REM Sat May [Week_3] MSG %"Armed Forces Day%"
- ! REM Mon [_last(May)] SCANFROM [_back(7)] SATISFY 1
- ! OMIT [_trig()] MSG %"Memorial Day%"
- ! REM Jun 14 MSG %"Flag Day%"
- ! REM Sun Jun [Week_3] MSG %"Father's Day%"
- ! REM Mon Sep [Week_1] SCANFROM [_back(7)] SATISFY 1
- ! OMIT [_trig()] MSG %"Labor Day%"
- ! REM Mon Oct [Week_2] MSG %"Columbus Day%"
- ! REM Nov 11 MSG %"Veterans Day%"
- ! REM Sun [_last(Oct)] MSG Daylight Savings Time - %"DST over%"
- ! REM Oct 30 MSG %"Mischief Night%"
- ! REM Oct 31 MSG %"Halloween%"
- ! REM Tue Nov 2 SCANFROM [_back(7)] SATISFY (YEAR(TRIGDATE()) % 4) == 0
- ! REM [_trig()] MSG %"Election%" Day
- ! REM Thu Nov [Week_4] SCANFROM [_back(7)] SATISFY 1
- ! OMIT [_trig()] MSG %"Thanksgiving%" Day
- ! REM Fri Nov [Week_4+1] SCANFROM [_back(7)] SATISFY 1
- ! OMIT [_trig()] MSG %"Thanksgiving%" (cont.)
- ! OMIT Dec 24 MSG %"Christmas Eve%"
- ! OMIT Dec 25 MSG %"Christmas%" Day
-
- ! # Seasons (valid from 1992 to 2000)...
- ! REM Mar 20 MSG %"Spring%" begins
- ! REM Jun [IIF(YEAR(TODAY())%4, 21, 20)] MSG %"Summer%" begins
- ! REM Sep [CHOOSE(YEAR(TODAY())-1991, 22,22,23,23,22,22,22,23,22)] \
- ! MSG %"Fall%" begins
- ! REM Dec [IIF((YEAR(TODAY())+1)%4, 21, 22)] MSG %"Winter%" begins
-
- ! #JHOLS
- ! ##########################################################################
- ! # #
- ! # This portion of the file contains reminders for Jewish holidays. The #
- ! # dates were obtained from "The First Jewish Catalog" by Richard Siegel #
- ! # and Michael and Sharon Strassfeld, published by the Jewish Publication #
- ! # Society of America. The Reform version of the calendar was guessed #
- ! # at by David Skoll based on experience # I welcome corrections. #
- ! # #
- ! # You (probably) want to add deltas to some of the reminders so that #
- ! # you are given advance notice of Jewish holidays. #
- ! # #
- ! ##########################################################################
-
- ! # Here are some general functions that you might find nice to use
-
- ! # _hstr: Returns a string which is the full Hebrew date of its argument.
- ! # Example: hstr('1994/02/02') returns "21 Shvat 5754"
- ! FSET _hstr(x) HEBDAY(x) + " " + HEBMON(x) + " " + HEBYEAR(x)
-
- ! # _hyrlen: Return the length of the specified Hebrew year
- ! # Example: _hyrlen(5754) returns 355
- ! FSET _hyrlen(x) HEBDATE(1, "Tishrey", x+1) - HEBDATE(1, "Tishrey", x)
-
- ! # --- HERE ARE THE JEWISH HOLIDAYS ---
- ! # Set the variable InIsrael to 1 if you live in Israel. Otherwise,
- ! # you get the Diaspora versions of Jewish holidays
- ! SET InIsrael 0
-
- ! # Set the variable Reform to 1 if you want the Reform version of the
- ! # Jewish calendar. Otherwise, you get the traditional version
- ! SET Reform 0
-
- ! # Convenient function definition to save typing
- ! FSET _h(x, y) TRIGGER(HEBDATE(x,y))
-
- ! # Default values in case InIsrael and Reform are not set
- ! SET InIsrael VALUE("InIsrael", 0)
- ! SET Reform VALUE("Reform", 0)
-
- ! [_h(1, "Tishrey")] MSG Rosh Hashana 1
- !
- ! # No RH-2 or Tzom Gedalia in Reform
- ! IF !Reform
- ! [_h(2, "Tishrey")] MSG Rosh Hashana 2
- ! [_h(3, "Tishrey")] MSG Tzom Gedalia
- ! ENDIF
- !
- ! [_h(10, "Tishrey")] MSG Yom Kippur
- ! [_h(15, "Tishrey")] MSG Sukkot 1
- !
- ! IF !InIsrael
- ! [_h(16, "Tishrey")] MSG Sukkot 2
- ! ENDIF
- !
- ! [_h(21, "Tishrey")] MSG Hashana Rabba
- ! [_h(22, "Tishrey")] MSG Shemini Atzeret
- !
- ! IF InIsrael
- ! [_h(22, "Tishrey")] MSG Simchat Torah
- ! ELSE
- ! [_h(23, "Tishrey")] MSG Simchat Torah
- ! ENDIF
- !
- ! # Because Kislev can change length, we must be more careful about Chanukah
- ! FSET _chan(x) TRIGGER(HEBDATE(24, "Kislev", today()-9)+x)
- ! [_chan(1)] MSG Chanukah 1
- ! [_chan(2)] MSG Chanukah 2
- ! [_chan(3)] MSG Chanukah 3
- ! [_chan(4)] MSG Chanukah 4
- ! [_chan(5)] MSG Chanukah 5
- ! [_chan(6)] MSG Chanukah 6
- ! [_chan(7)] MSG Chanukah 7
- ! [_chan(8)] MSG Chanukah 8
- !
- ! # Not sure about Reform's position on the next one.
- ! IF !Reform
- ! [_h(10, "Tevet")] MSG Asara B'Tevet
- ! ENDIF
- !
- ! [_h(15, "Shvat")] MSG Tu B'Shvat
- ! [_h(15, "Adar A")] MSG Purim Katan
- ! [_h(13, "Adar")] MSG Fast of Esther
- ! [_h(14, "Adar")] MSG Purim
- ! [_h(15, "Nisan")] MSG Pesach
- !
- ! IF !InIsrael
- ! [_h(16, "Nisan")] MSG Pesach 2
- ! ENDIF
- !
- ! [_h(21, "Nisan")] MSG Pesach 7
- !
- ! IF !InIsrael && !Reform
- ! [_h(22, "Nisan")] MSG Pesach 8
- ! ENDIF
- !
- ! [_h(27, "Nisan")] MSG Yom HaShoah
- ! [_h(4, "Iyar")] MSG Yom HaZikaron
- ! [_h(5, "Iyar")] MSG Yom Ha'atzmaut
- !
- ! # Not sure about Reform's position on Lag B'Omer
- ! IF !Reform
- ! [_h(18, "Iyar")] MSG Lag B'Omer
- ! ENDIF
- !
- ! [_h(28, "Iyar")] MSG Yom Yerushalayim
- ! [_h(6, "Sivan")] MSG Shavuot
- !
- ! IF !InIsrael && !Reform
- ! [_h(7, "Sivan")] MSG Shavuot 2
- ! ENDIF
- !
- ! # Fairly sure Reform Jews don't observe the next two
- ! IF !Reform
- ! [_h(17, "Tamuz")] MSG Fast of 17th of Tammuz
- ! [_h(9, "Av")] MSG Tish'a B'Av
- ! ENDIF
- !
- ! # Counting the omer - do the whole spiel, i.e:
- ! # "This is the xth day of the omer, being y weeks and z days of the omer."
- ! # Nice Remind programming example here!
- ! SET ostart HEBDATE(16, "Nisan", TODAY()-50)
- ! IF ostart <= TODAY() && (TODAY() - ostart < 49)
- ! SET odays TODAY()-ostart+1
- ! IF odays < 7
- ! MSG %"%"Today is the [ORD(odays)] day of the Omer.
- ! ELSE
- ! IF !(odays % 7)
- ! MSG %"%"Today is the [ORD(odays)] day of the Omer, being [odays / 7] [PLURAL(odays/7, "week")] of the Omer.
- ! ELSE
- ! MSG %"%"Today is the [ORD(odays)] day of the Omer, being [odays/7] [PLURAL(odays/7, "week")] and [odays%7] [PLURAL(odays%7, "day")] of the Omer.
- ! ENDIF
- ! ENDIF
- ! CAL [ORD(odays)] of Omer
- ! ENDIF
- *** ../p4rel/dosubst.c Fri Mar 5 11:57:34 1993
- --- ./dosubst.c Thu Apr 22 10:24:04 1993
- ***************
- *** 324,329 ****
- --- 324,330 ----
- L_O_OVER
- #else
- if (RealToday == JulianToday) sprintf(s, " (%s)", L_TODAY);
- + else *s = 0;
- #endif
- s += strlen(s);
- break;
- ***************
- *** 450,456 ****
- #ifdef L_2_OVER
- L_2_OVER
- #else
- ! sprintf(s, "%s %d:%02d%s", L_AT, hh, min, pm);
- #endif
- s += strlen(s);
- break;
- --- 451,457 ----
- #ifdef L_2_OVER
- L_2_OVER
- #else
- ! sprintf(s, "%s %d%c%02d%s", L_AT, hh, TIMESEP, min, pm);
- #endif
- s += strlen(s);
- break;
- ***************
- *** 541,547 ****
- #ifdef L_AT_OVER
- L_AT_OVER
- #else
- ! sprintf(s, "%d:%02d%s", chh, cmin, cpm);
- #endif
- s += strlen(s);
- break;
- --- 542,548 ----
- #ifdef L_AT_OVER
- L_AT_OVER
- #else
- ! sprintf(s, "%d%c%02d%s", chh, TIMESEP, cmin, cpm);
- #endif
- s += strlen(s);
- break;
- *** ../p4rel/expr.c Wed Mar 3 17:35:34 1993
- --- ./expr.c Thu Apr 22 11:00:23 1993
- ***************
- *** 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;
- --- 225,231 ----
-
- /* Handle the parsing of quoted strings */
- if (c == '\"') {
- ! if (!**in) return E_MISS_QUOTE;
- while (**in) if ((c = *out++ = *(*in)++) == '\"') break;
- *out = 0;
- if (c == '\"') return OK ; else return E_MISS_QUOTE;
- ***************
- *** 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;
- --- 233,239 ----
-
- /* Dates can be specified with single-quotes */
- if (c == '\'') {
- ! if (!**in) return E_MISS_QUOTE;
- while (**in) if ((c = *out++ = *(*in)++) == '\'') break;
- *out = 0;
- if (c == '\'') return OK ; else return E_MISS_QUOTE;
- ***************
- *** 771,776 ****
- --- 771,777 ----
- if ((v1.type == TIM_TYPE && v2.type == INT_TYPE) ||
- (v1.type == INT_TYPE && v2.type == TIM_TYPE)) {
- v1.v.val = (v1.v.val + v2.v.val) % 1440;
- + if (v1.v.val < 0) v1.v.val += 1440;
- v1.type = TIM_TYPE;
- return PushValStack(&v1);
- }
- ***************
- *** 839,844 ****
- --- 840,846 ----
- /* If it's a time minus an int, do subtraction mod 1440 */
- if (v1.type == TIM_TYPE && v2.type == INT_TYPE) {
- v1.v.val = (v1.v.val - v2.v.val) % 1440;
- + if (v1.v.val < 0) v1.v.val += 1440;
- return PushValStack(&v1);
- }
-
- *** ../p4rel/finnish.h Tue Feb 16 17:19:19 1993
- --- ./finnish.h Thu Apr 22 10:24:36 1993
- ***************
- *** 11,19 ****
- /* */
- /***************************************************************/
-
- - /* All Finnish words in this file are in "7-bit Finnish ASCII";
- - they can be converted to other character sets if needed. */
- -
- /* The very first define in a language support file must be L_LANGNAME: */
- #define L_LANGNAME "Finnish"
-
- --- 11,16 ----
- ***************
- *** 35,42 ****
- --- 32,44 ----
- #define L_MAR "maaliskuu"
- #define L_APR "huhtikuu"
- #define L_MAY "toukokuu"
- + #ifdef ISOLATIN1
- + #define L_JUN "kes\xE4kuu"
- + #define L_JUL "hein\xE4kuu"
- + #else
- #define L_JUN "kes{kuu"
- #define L_JUL "hein{kuu"
- + #endif
- #define L_AUG "elokuu"
- #define L_SEP "syyskuu"
- #define L_OCT "lokakuu"
- ***************
- *** 44,50 ****
- --- 46,56 ----
- #define L_DEC "joulukuu"
-
- /* Today and tomorrow */
- + #ifdef ISOLATIN1
- + #define L_TODAY "t\xE4n\xE4\xE4n"
- + #else
- #define L_TODAY "t{n{{n"
- + #endif
- #define L_TOMORROW "huomenna"
-
- /* The default banner */
- ***************
- *** 62,68 ****
- --- 68,78 ----
- #define L_FROMNOW "kuluttua"
-
- /* "in %d days' time" */
- + #ifdef ISOLATIN1
- + #define L_INXDAYS "%d p\xE4iv\xE4n kuluttua"
- + #else
- #define L_INXDAYS "%d p{iv{n kuluttua"
- + #endif
-
- /* "on" as in "on date...", but in Finnish it is a case ending;
- L_PARTIT is the partitive ending appended to -kuu and -tai */
- ***************
- *** 72,78 ****
- --- 82,92 ----
- /* Pluralizing - this is a problem for many languages and may require
- a more drastic fix */
- /* The partitive ending of "day" */
- + #ifdef ISOLATIN1
- + #define L_PLURAL "\xE4"
- + #else
- #define L_PLURAL "{"
- + #endif
-
- /* Minutes, hours, at, etc */
- #define L_NOW "nyt"
- ***************
- *** 96,102 ****
- --- 110,130 ----
- /* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
- See the file dosubst.c for more info. */
-
- + #ifdef ISOLATIN1
- #define L_ORDINAL_OVERRIDE switch(d) { \
- + case 1: plu = ":sen\xE4"; break; \
- + case 2: plu = ":sena"; break; \
- + default: \
- + switch(d%10) { \
- + case 2: \
- + case 3: \
- + case 6: \
- + case 8: plu = ":ntena"; break; \
- + default: plu = ":nten\xE4"; break; \
- + } \
- + }
- + #else
- + #define L_ORDINAL_OVERRIDE switch(d) { \
- case 1: plu = ":sen{"; break; \
- case 2: plu = ":sena"; break; \
- default: \
- ***************
- *** 108,113 ****
- --- 136,142 ----
- default: plu = ":nten{"; break; \
- } \
- }
- + #endif
- #define L_A_OVER sprintf(s, "%s%s, %d. %s%s %d", DayName[jul%7], L_ON, d, \
- MonthName[m], L_PARTIT, y);
- #define L_C_OVER sprintf(s, "%s%s", DayName[jul%7], L_ON);
- *** ../p4rel/funcs.c Tue Mar 2 16:27:55 1993
- --- ./funcs.c Thu Apr 22 10:24:25 1993
- ***************
- *** 60,65 ****
- --- 60,69 ----
- PRIVATE int FDosubst ARGS ((void));
- PRIVATE int FFilename ARGS ((void));
- PRIVATE int FGetenv ARGS ((void));
- + PRIVATE int FHebdate ARGS ((void));
- + PRIVATE int FHebday ARGS ((void));
- + PRIVATE int FHebmon ARGS ((void));
- + PRIVATE int FHebyear ARGS ((void));
- PRIVATE int FHour ARGS ((void));
- PRIVATE int FIif ARGS ((void));
- PRIVATE int FIndex ARGS ((void));
- ***************
- *** 96,102 ****
- PRIVATE int FTrigger ARGS ((void));
- PRIVATE int CheckArgs ARGS ((Operator *f, int nargs));
- PRIVATE int CleanUpAfterFunc ARGS ((void));
- !
- #ifdef __MSDOS__
- PRIVATE FILE *popen ARGS((char *cmd, char *mode));
- PRIVATE int pclose ARGS((FILE *fp));
- --- 100,106 ----
- PRIVATE int FTrigger ARGS ((void));
- PRIVATE int CheckArgs ARGS ((Operator *f, int nargs));
- PRIVATE int CleanUpAfterFunc ARGS ((void));
- !
- #ifdef __MSDOS__
- PRIVATE FILE *popen ARGS((char *cmd, char *mode));
- PRIVATE int pclose ARGS((FILE *fp));
- ***************
- *** 117,122 ****
- --- 121,134 ----
- /* Temp string buffer */
- static char Buffer[32];
-
- + /* Caches for extracting months, days, years from dates - may
- + improve performance slightly. */
- + static int CacheJul = -1;
- + static int CacheYear, CacheMon, CacheDay;
- +
- + static int CacheHebJul = -1;
- + static int CacheHebYear, CacheHebMon, CacheHebDay;
- +
- /* We need access to the value stack */
- extern Value ValStack[];
- extern int ValStackPtr;
- ***************
- *** 151,158 ****
- { "dosubst", 1, 3, FDosubst },
- { "filename", 0, 0, FFilename },
- { "getenv", 1, 1, FGetenv },
- { "hour", 1, 1, FHour },
- ! { "iif", 3, 3, FIif },
- { "index", 2, 3, FIndex },
- { "isleap", 1, 1, FIsleap },
- { "isomitted", 1, 1, FIsomitted },
- --- 163,174 ----
- { "dosubst", 1, 3, FDosubst },
- { "filename", 0, 0, FFilename },
- { "getenv", 1, 1, FGetenv },
- + { "hebdate", 2, 4, FHebdate },
- + { "hebday", 1, 1, FHebday },
- + { "hebmon", 1, 1, FHebmon },
- + { "hebyear", 1, 1, FHebyear },
- { "hour", 1, 1, FHour },
- ! { "iif", 1, NO_MAX, FIif },
- { "index", 2, 3, FIndex },
- { "isleap", 1, 1, FIsleap },
- { "isomitted", 1, 1, FIsomitted },
- ***************
- *** 189,195 ****
-
- /* Need a variable here - Func[] array not really visible to outside. */
- int NumFuncs = sizeof(Func) / sizeof(Operator) ;
- !
- /***************************************************************/
- /* */
- /* CallFunc */
- --- 205,211 ----
-
- /* Need a variable here - Func[] array not really visible to outside. */
- int NumFuncs = sizeof(Func) / sizeof(Operator) ;
- !
- /***************************************************************/
- /* */
- /* CallFunc */
- ***************
- *** 545,551 ****
- {
- int y, m, d;
- if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- ! FromJulian(ARG(0).v.val, &y, &m, &d);
- RetVal.type = INT_TYPE;
- RetVal.v.val = d;
- return OK;
- --- 561,575 ----
- {
- int y, m, d;
- if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- ! if (ARG(0).v.val == CacheJul)
- ! d = CacheDay;
- ! else {
- ! FromJulian(ARG(0).v.val, &y, &m, &d);
- ! CacheJul = ARG(0).v.val;
- ! CacheYear = y;
- ! CacheMon = m;
- ! CacheDay = d;
- ! }
- RetVal.type = INT_TYPE;
- RetVal.v.val = d;
- return OK;
- ***************
- *** 559,565 ****
- {
- int y, m, d;
- if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- ! FromJulian(ARG(0).v.val, &y, &m, &d);
- RetVal.type = INT_TYPE;
- RetVal.v.val = m+1;
- return OK;
- --- 583,597 ----
- {
- int y, m, d;
- if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- ! if (ARG(0).v.val == CacheJul)
- ! m = CacheMon;
- ! else {
- ! FromJulian(ARG(0).v.val, &y, &m, &d);
- ! CacheJul = ARG(0).v.val;
- ! CacheYear = y;
- ! CacheMon = m;
- ! CacheDay = d;
- ! }
- RetVal.type = INT_TYPE;
- RetVal.v.val = m+1;
- return OK;
- ***************
- *** 573,579 ****
- {
- int y, m, d;
- if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- ! FromJulian(ARG(0).v.val, &y, &m, &d);
- RetVal.type = INT_TYPE;
- RetVal.v.val = y;
- return OK;
- --- 605,619 ----
- {
- int y, m, d;
- if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- ! if (ARG(0).v.val == CacheJul)
- ! y = CacheYear;
- ! else {
- ! FromJulian(ARG(0).v.val, &y, &m, &d);
- ! CacheJul = ARG(0).v.val;
- ! CacheYear = y;
- ! CacheMon = m;
- ! CacheDay = d;
- ! }
- RetVal.type = INT_TYPE;
- RetVal.v.val = y;
- return OK;
- ***************
- *** 628,634 ****
- m = ARG(0).v.val - 1;
- if (m < 0) return E_2LOW;
- if (m > 11) return E_2HIGH;
- ! } else FromJulian(ARG(0).v.val, &y, &m, &d);
- s = MonthName[m];
- return RetStrVal(s);
- }
- --- 668,684 ----
- m = ARG(0).v.val - 1;
- if (m < 0) return E_2LOW;
- if (m > 11) return E_2HIGH;
- ! } else {
- ! if (ARG(0).v.val == CacheJul)
- ! m = CacheMon;
- ! else {
- ! FromJulian(ARG(0).v.val, &y, &m, &d);
- ! CacheJul = ARG(0).v.val;
- ! CacheYear = y;
- ! CacheMon = m;
- ! CacheDay = d;
- ! }
- ! }
- s = MonthName[m];
- return RetStrVal(s);
- }
- ***************
- *** 856,862 ****
- return RetStrVal("OS/2");
- #endif
- return RetStrVal("MSDOS");
- ! #endif
- }
-
- /***************************************************************/
- --- 906,912 ----
- return RetStrVal("OS/2");
- #endif
- return RetStrVal("MSDOS");
- ! #endif
- }
-
- /***************************************************************/
- ***************
- *** 949,955 ****
- if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
- return RetStrVal(getenv(ARG(0).v.str));
- }
- !
- /***************************************************************/
- /* */
- /* FValue */
- --- 999,1005 ----
- if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
- return RetStrVal(getenv(ARG(0).v.str));
- }
- !
- /***************************************************************/
- /* */
- /* FValue */
- ***************
- *** 1282,1298 ****
- #endif
- {
- int istrue;
-
- ! if (ARG(0).type != STR_TYPE && ARG(0).type != INT_TYPE) return E_BAD_TYPE;
-
- ! if (ARG(0).type == INT_TYPE)
- ! istrue = ARG(0).v.val;
- ! else
- ! istrue = *(ARG(0).v.str);
-
- ! if (istrue) DCOPYVAL(RetVal, ARG(1));
- ! else DCOPYVAL(RetVal, ARG(2));
-
- return OK;
- }
-
- --- 1332,1360 ----
- #endif
- {
- int istrue;
- + int arg;
-
- ! if (!(Nargs % 2)) {
- ! Eprint("IIF needs odd number of args");
- ! return E_2FEW_ARGS;
- ! }
-
- ! for (arg=0; arg<Nargs-1; arg += 2) {
- ! if (ARG(arg).type != STR_TYPE && ARG(arg).type != INT_TYPE)
- ! return E_BAD_TYPE;
-
- ! if (ARG(arg).type == INT_TYPE)
- ! istrue = ARG(arg).v.val;
- ! else
- ! istrue = *(ARG(arg).v.str);
-
- + if (istrue) {
- + DCOPYVAL(RetVal, ARG(arg+1));
- + return OK;
- + }
- + }
- +
- + DCOPYVAL(RetVal, ARG(Nargs-1));
- return OK;
- }
-
- ***************
- *** 1327,1334 ****
- {
- int amode;
- char *s;
- !
- ! if (ARG(0).type != STR_TYPE ||
- (ARG(1).type != INT_TYPE && ARG(1).type != STR_TYPE)) return E_BAD_TYPE;
-
- if (ARG(1).type == INT_TYPE) amode = ARG(1).v.val;
- --- 1389,1396 ----
- {
- int amode;
- char *s;
- !
- ! if (ARG(0).type != STR_TYPE ||
- (ARG(1).type != INT_TYPE && ARG(1).type != STR_TYPE)) return E_BAD_TYPE;
-
- if (ARG(1).type == INT_TYPE) amode = ARG(1).v.val;
- ***************
- *** 1345,1351 ****
- case 'X': amode |= X_OK; break;
- }
- }
- ! }
- RetVal.type = INT_TYPE;
- RetVal.v.val = access(ARG(0).v.str, amode);
- return OK;
- --- 1407,1413 ----
- case 'X': amode |= X_OK; break;
- }
- }
- ! }
- RetVal.type = INT_TYPE;
- RetVal.v.val = access(ARG(0).v.str, amode);
- return OK;
- ***************
- *** 1490,1492 ****
- --- 1552,1684 ----
- return RetStrVal(TmpBuf);
- }
-
- + /***************************************************************/
- + /* */
- + /* FHebdate */
- + /* FHebday */
- + /* FHebmon */
- + /* FHebyear */
- + /* */
- + /* Hebrew calendar support functions */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PRIVATE int FHebdate(void)
- + #else
- + static int FHebdate()
- + #endif
- + {
- + int year, day, mon, jahr;
- + int mout, dout;
- + int ans, r;
- +
- + if (ARG(0).type != INT_TYPE || ARG(1).type != STR_TYPE) return E_BAD_TYPE;
- + day = ARG(0).v.val;
- + mon = HebNameToNum(ARG(1).v.str);
- + if (mon < 0) {
- + Eprint("Invalid Hebrew month");
- + return E_BAD_DATE;
- + }
- + if (Nargs == 2) {
- + r = GetNextHebrewDate(JulianToday, mon, day, 0, &ans);
- + if (r) return r;
- + RetVal.type = DATE_TYPE;
- + RetVal.v.val = ans;
- + return OK;
- + }
- + if (Nargs == 4) {
- + if (ARG(3).type != INT_TYPE) return E_BAD_TYPE;
- + jahr = ARG(3).v.val;
- + if (jahr < 0) return E_2LOW;
- + if (jahr > 2) {
- + r = ComputeJahr(jahr, mon, day, &jahr);
- + if (r) return r;
- + }
- + } else jahr = 0;
- +
- +
- + if (ARG(2).type == INT_TYPE) {
- + year = ARG(2).v.val;
- + r = GetValidHebDate(year, mon, day, &mout, &dout, jahr);
- + if (r) return r;
- + r = HebToJul(year, mout, dout);
- + if (r<0) return E_DATE_OVER;
- + RetVal.v.val = r;
- + RetVal.type = DATE_TYPE;
- + return OK;
- + } else if (ARG(2).type == DATE_TYPE) {
- + r = GetNextHebrewDate(ARG(2).v.val, mon, day, jahr, &ans);
- + if (r) return r;
- + RetVal.v.val = ans;
- + RetVal.type = DATE_TYPE;
- + return OK;
- + } else return E_BAD_TYPE;
- + }
- +
- + #ifdef HAVE_PROTOS
- + PRIVATE int FHebday(void)
- + #else
- + static int FHebday()
- + #endif
- + {
- + int y, m, d;
- +
- + if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- + if (ARG(0).v.val == CacheHebJul)
- + d = CacheHebDay;
- + else {
- + JulToHeb(ARG(0).v.val, &y, &m, &d);
- + CacheHebJul = ARG(0).v.val;
- + CacheHebYear = y;
- + CacheHebMon = m;
- + CacheHebDay = d;
- + }
- + RetVal.type = INT_TYPE;
- + RetVal.v.val = d;
- + return OK;
- + }
- +
- + #ifdef HAVE_PROTOS
- + PRIVATE int FHebmon(void)
- + #else
- + static int FHebmon()
- + #endif
- + {
- + int y, m, d;
- +
- + if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- + if (ARG(0).v.val == CacheHebJul) {
- + m = CacheHebMon;
- + y = CacheHebYear;
- + } else {
- + JulToHeb(ARG(0).v.val, &y, &m, &d);
- + CacheHebJul = ARG(0).v.val;
- + CacheHebYear = y;
- + CacheHebMon = m;
- + CacheHebDay = d;
- + }
- + return RetStrVal(HebMonthName(m, y));
- + }
- +
- + #ifdef HAVE_PROTOS
- + PRIVATE int FHebyear(void)
- + #else
- + static int FHebyear()
- + #endif
- + {
- + int y, m, d;
- +
- + if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- + if (ARG(0).v.val == CacheHebJul)
- + y = CacheHebYear;
- + else {
- + JulToHeb(ARG(0).v.val, &y, &m, &d);
- + CacheHebJul = ARG(0).v.val;
- + CacheHebYear = y;
- + CacheHebMon = m;
- + CacheHebDay = d;
- + }
- + RetVal.type = INT_TYPE;
- + RetVal.v.val = y;
- + return OK;
- + }
- *** ../p4rel/globals.h Mon Mar 1 16:56:30 1993
- --- ./globals.h Thu Apr 22 10:24:07 1993
- ***************
- *** 30,36 ****
- EXTERN int CurDay;
- EXTERN int CurMon;
- EXTERN int CurYear;
- - EXTERN int FirstYear;
- EXTERN int LineNo;
- EXTERN char FreshLine;
- EXTERN char LineBuffer[LINELEN];
- --- 30,35 ----
- ***************
- *** 69,75 ****
- EXTERN INIT( int MaxSatIter, 150);
- EXTERN INIT( char *FileName, NULL);
- EXTERN FILE *ErrFp;
- - EXTERN INIT( int JulFirst, -1);
- EXTERN INIT( int NumIfs, 0);
- EXTERN INIT( unsigned int IfFlags, 0);
- EXTERN INIT( int LastTriggerDate, 0);
- --- 68,73 ----
- ***************
- *** 115,118 ****
- }
- #endif
- ;
- -
- --- 113,115 ----
- *** ../p4rel/init.c Mon Mar 1 17:37:26 1993
- --- ./init.c Thu Apr 22 10:24:09 1993
- ***************
- *** 111,117 ****
- exit(1);
- }
- JulianToday = RealToday;
- - FirstYear = -1;
- FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
-
- /* Parse the command-line options */
- --- 111,116 ----
- ***************
- *** 350,358 ****
- CurDay = d;
- if (JulianToday != RealToday) IgnoreOnce = 1;
- }
- - /* Set JulFirst */
- - JulFirst = Julian(CurYear, 0, 1);
- - FirstYear = CurYear;
- }
-
- /***************************************************************/
- --- 349,354 ----
- ***************
- *** 369,374 ****
- --- 365,373 ----
- #endif
- {
- fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992, 1993 by David F. Skoll\n", VERSION, L_LANGNAME);
- + #ifdef BETA
- + fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
- + #endif
- fprintf(ErrFp, "Usage: remind [options] filename [date]\n");
- fprintf(ErrFp, "Options:\n");
- fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
-