home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume37 / remind / patch05b / patch.05.A
Encoding:
Text File  |  1993-04-27  |  51.1 KB  |  1,619 lines

  1. Prereq: "03.00.04"
  2. *** ../p4rel/version.h    Mon Feb 15 13:24:00 1993
  3. --- ./version.h    Thu Apr 22 10:24:22 1993
  4. ***************
  5. *** 9,12 ****
  6.   /*                                                             */
  7.   /***************************************************************/
  8.   
  9. ! #define VERSION "03.00.04"
  10. --- 9,12 ----
  11.   /*                                                             */
  12.   /***************************************************************/
  13.   
  14. ! #define VERSION "03.00.05"
  15. *** ../p4rel/COPYRIGHT    Wed Mar  3 17:13:09 1993
  16. --- ./COPYRIGHT    Thu Apr 22 10:24:02 1993
  17. ***************
  18. *** 76,81 ****
  19. --- 76,84 ----
  20.   
  21.   Phillipp Slusallek for suggesting the -k option.
  22.   
  23. + Amos Shapir, David W. Tamkin and Frank Yellin for help with the Hebrew
  24. + calendar.
  25.   All of the language translators whose names are listed in lang.h
  26.   
  27.   Timo Salmi, Keith Petersen, Bill Davidsen and Kent Landfield for
  28. *** ../p4rel/MANIFEST.DOS    Mon Mar  1 16:52:01 1993
  29. --- ./MANIFEST.DOS    Thu Apr 22 10:24:11 1993
  30. ***************
  31. *** 15,20 ****
  32. --- 15,21 ----
  33.   german.h
  34.   globals.c
  35.   globals.h
  36. + hbcal.c
  37.   init.c
  38.   kall
  39.   kall.1
  40. *** ../p4rel/MANIFEST.UNX    Mon Mar  1 16:51:53 1993
  41. --- ./MANIFEST.UNX    Thu Apr 22 10:24:11 1993
  42. ***************
  43. *** 22,27 ****
  44. --- 22,28 ----
  45.   german.h
  46.   globals.c
  47.   globals.h
  48. + hbcal.c
  49.   init.c
  50.   kall
  51.   kall.1
  52. *** ../p4rel/Makefile    Tue Mar  2 11:03:25 1993
  53. --- ./Makefile    Thu Apr 22 10:24:10 1993
  54. ***************
  55. *** 46,52 ****
  56.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  57.   # in config.h; then, you should be able to type 'make'.
  58.   #-----------------------------------------------------------------------------
  59. ! VERSION= 03.00.04
  60.   
  61.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  62.   lang.h english.h german.h dutch.h finnish.h
  63. --- 46,52 ----
  64.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  65.   # in config.h; then, you should be able to type 'make'.
  66.   #-----------------------------------------------------------------------------
  67. ! VERSION= 03.00.05
  68.   
  69.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  70.   lang.h english.h german.h dutch.h finnish.h
  71. ***************
  72. *** 53,60 ****
  73.   
  74.   STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  75.   
  76. ! SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  77. ! main.c omit.c sort.c queue.c token.c trigger.c userfns.c utils.c var.c
  78.   
  79.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  80.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  81. --- 53,60 ----
  82.   
  83.   STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  84.   
  85. ! SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c hbcal.c \
  86. ! init.c main.c omit.c sort.c queue.c token.c trigger.c userfns.c utils.c var.c
  87.   
  88.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  89.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  90. ***************
  91. *** 92,97 ****
  92. --- 92,98 ----
  93.   files.o: files.c $(STDHDRS)
  94.   funcs.o: funcs.c $(STDHDRS) expr.h version.h
  95.   globals.o: globals.c config.h types.h globals.h err.h lang.h
  96. + hbcal.o: hbcal.c $(STDHDRS)
  97.   init.o: init.c $(STDHDRS) expr.h version.h
  98.   main.o: main.c $(STDHDRS) expr.h
  99.   omit.o: omit.c $(STDHDRS)
  100. ***************
  101. *** 104,111 ****
  102.   var.o: var.c $(STDHDRS) expr.h
  103.   
  104.   tarZ:
  105. !     tar cvf remind-3.0.4.tar $(MANIFEST)
  106. !     compress -v remind-3.0.4.tar
  107.   
  108.   shar:
  109.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  110. --- 105,112 ----
  111.   var.o: var.c $(STDHDRS) expr.h
  112.   
  113.   tarZ:
  114. !     tar cvf remind-3.0.5.tar $(MANIFEST)
  115. !     compress -v remind-3.0.5.tar
  116.   
  117.   shar:
  118.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  119. *** ../p4rel/README.DOS    Wed Mar  3 17:15:06 1993
  120. --- ./README.DOS    Thu Apr 22 10:24:12 1993
  121. ***************
  122. *** 15,21 ****
  123.   
  124.   This will create REMIND.EXE, which is ready to be executed.
  125.   
  126. ! The file "defs.rem" has some sample Remind definitions and commands.
  127.   
  128.   OTHER LANGUAGE SUPPORT
  129.   
  130. --- 15,22 ----
  131.   
  132.   This will create REMIND.EXE, which is ready to be executed.
  133.   
  134. ! The file "defs.rem" has some sample Remind definitions and commands,
  135. ! as well as U.S. and Jewish holidays.
  136.   
  137.   OTHER LANGUAGE SUPPORT
  138.   
  139. *** ../p4rel/README.OS2    Wed Mar  3 17:14:49 1993
  140. --- ./README.OS2    Thu Apr 22 10:24:12 1993
  141. ***************
  142. *** 17,23 ****
  143.   This will make 'remind.exe' which is an OS/2 1.x--2.0 executable, and
  144.   'remindb.exe' which is an OS/2 and MSDOS bound executable.
  145.   
  146. ! The file "defs.rem" has some sample Remind definitions and commands.
  147.   
  148.   NOTE that I do not have access to an OS/2 system, so support for this
  149.   system may not be as good as I'd like.
  150. --- 17,24 ----
  151.   This will make 'remind.exe' which is an OS/2 1.x--2.0 executable, and
  152.   'remindb.exe' which is an OS/2 and MSDOS bound executable.
  153.   
  154. ! The file "defs.rem" has some sample Remind definitions and commands,
  155. ! as well as U.S. and Jewish holidays.
  156.   
  157.   NOTE that I do not have access to an OS/2 system, so support for this
  158.   system may not be as good as I'd like.
  159. *** ../p4rel/README.UNIX    Wed Mar  3 17:14:29 1993
  160. --- ./README.UNIX    Thu Apr 22 10:24:13 1993
  161. ***************
  162. *** 53,59 ****
  163.   remind processes when you log out.  See the man page.  Note that kall
  164.   depends on the output of "ps", and may not be portable.
  165.   
  166. ! The file "defs.rem" has some sample Remind definitions and commands.
  167.   
  168.   OTHER LANGUAGE SUPPORT
  169.   
  170. --- 53,60 ----
  171.   remind processes when you log out.  See the man page.  Note that kall
  172.   depends on the output of "ps", and may not be portable.
  173.   
  174. ! The file "defs.rem" has some sample Remind definitions and commands,
  175. ! as well as U.S. and Jewish holidays.
  176.   
  177.   OTHER LANGUAGE SUPPORT
  178.   
  179. *** ../p4rel/WHATSNEW.30    Wed Mar  3 17:16:40 1993
  180. --- ./WHATSNEW.30    Thu Apr 22 10:24:22 1993
  181. ***************
  182. *** 1,5 ****
  183. --- 1,40 ----
  184.   CHANGES TO REMIND
  185.   
  186. + * Version 3.0 Patch 5
  187. + + MAJOR ENHANCEMENTS:
  188. + - Added support for the Hebrew calendar - can now specify Jewish holidays
  189. +   easily.  Thanks to Amos Shapir for explaining the Hebrew calendar, and
  190. +   to Danny Sadinoff, from whose HEBCAL program I got some inspiration.
  191. +   Also thanks to David W. Tamkin and Frank Yellin for explaining the rules
  192. +   for jahrzeits.
  193. + + MINOR ENHANCEMENTS:
  194. + - Allowed the default page size used by Rem2PS to be selected in config.h
  195. + - Edited the defs.rem file to contain Jewish holidays.  Cleaned up some
  196. +   of the examples and improved the layout - thanks to George M. Sipe.
  197. + - Modified the IIF function to be more general
  198. + - Updated finnish.h to support the ISO 8859-1 character set, courtesy
  199. +   of Mikko Silvonen.
  200. + - Changed the date conversion routines to greatly speed up conversion from
  201. +   Julian to yyyy/mm/dd form.
  202. + + BUG FIXES:
  203. + - Fixed a bug in which Remind complained incorrectly about a missing quote
  204. +   in the command SET foo ""
  205. + - Fixed bugs in dosubst.c which caused the %o, %1 and %@ substitutions
  206. +   to be incorrect
  207. + - Fixed a bug in the man page - thanks to Ed Oskiewicz.
  208.   * Version 3.0 Patch 4
  209.   
  210.   - Added the -g option - this sorts reminders by date/time before
  211. *** ../p4rel/config.h    Tue Mar  2 12:12:49 1993
  212. --- ./config.h    Thu Apr 22 10:24:02 1993
  213. ***************
  214. *** 12,17 ****
  215. --- 12,25 ----
  216.   /***************************************************************/
  217.   
  218.   /*---------------------------------------------------------------------*/
  219. + /* DEFAULT_PAGE:  The default page size to use for Rem2PS.             */
  220. + /* The Letter version is appropriate for North America; the A4 version */
  221. + /* is appropriate for Europe.                                          */
  222. + /*---------------------------------------------------------------------*/
  223. + #define DEFAULT_PAGE {"Letter", 612, 792}
  224. + /* #define DEFAULT_PAGE {"A4", 595, 842} */
  225. +   
  226. + /*---------------------------------------------------------------------*/
  227.   /* DATESEP:  The default date separator.  North American usage is '/'; */
  228.   /* others may prefer '-'.                                              */
  229.   /*---------------------------------------------------------------------*/
  230. ***************
  231. *** 61,66 ****
  232. --- 69,78 ----
  233.   /*---------------------------------------------------------------------*/
  234.   /* BASE: The base year for date calculation.  NOTE!  January 1 of the  */
  235.   /*       base year MUST be a Monday, else Remind will not work!        */
  236. + /*       IMPORTANT NOTE:  The Hebrew date routines depend on BASE      */
  237. + /*       being set to 1990.  If you change it, you'll have to add the  */
  238. + /*       number of days between 1 Jan <NEWBASE> and 1 Jan 1990 to the  */
  239. + /*       manifest constant CORRECTION in hbcal.c                       */
  240.   /*---------------------------------------------------------------------*/
  241.   #define BASE 1990
  242.   
  243. *** ../p4rel/defs.rem    Fri Mar  5 11:46:11 1993
  244. --- ./defs.rem    Thu Apr 22 10:24:03 1993
  245. ***************
  246. *** 1,29 ****
  247. ! # ---------------------------------------------------------------------------
  248. ! #
  249. ! # DEFS.REM
  250. ! #
  251. ! # This file is a reminder script, which contains a few handy definitions.
  252. ! # Cut and paste as desired!  Also, near the end, there are a bunch of holiday
  253. ! # definitions for the U.S.
  254. ! #
  255. ! # Some examples provided by George M. Sipe <gsipe@pyratl.ga.pyramid.com>
  256. ! #
  257. ! # U.S. holidays provided by Dave Rickel <drickel@sjc.mentorg.com>
  258. ! #
  259. ! # This file is part of REMIND.
  260. ! # Copyright (C) 1992, 1993 by David F. Skoll
  261. ! #
  262. ! # ---------------------------------------------------------------------------
  263.   
  264. - # Bombproofing
  265.   RUN OFF
  266. ! IF version() < "03.00.04"
  267. !    ERRMSG This file requires at least version 03.00.04 of Remind.%
  268. !    ERRMSG This version is [version()].
  269.      EXIT
  270.   ENDIF
  271.   
  272. ! # It's handy to have symbolic constants for weekdays and month names
  273.   SET Sunday    0
  274.   SET Monday    1
  275.   SET Tuesday   2
  276. --- 1,38 ----
  277. ! #############################################################################
  278. ! #                                         #
  279. ! # DEFS.REM                                    #
  280. ! #                                         #
  281. ! # This file is a reminder script, which contains a few handy definitions.   #
  282. ! # Cut and paste as desired!  Also, near the end, there are a bunch of        #
  283. ! # holiday definitions for the U.S.                        #
  284. ! #                                         #
  285. ! # Some examples provided by George M. Sipe <gsipe@pyratl.ga.pyramid.com>    #
  286. ! #                                         #
  287. ! # U.S. holidays provided by Dave Rickel <drickel@sjc.mentorg.com>        #
  288. ! #                                         #
  289. ! # Use your text editor to search for:                        #
  290. ! #  "#USHOLS" for U.S. holidays                            #
  291. ! #  "#JHOLS"  for Jewish holidays                        #
  292. ! #                                         #
  293. ! # This file is part of REMIND.                            #
  294. ! # Copyright (C) 1992, 1993 by David F. Skoll                    #
  295. ! #                                         #
  296. ! #############################################################################
  297.   
  298.   RUN OFF
  299. ! ################################################
  300. ! # Ensure required version of remind is used... #
  301. ! ################################################
  302. ! IF version() < "03.00.05"
  303. !    ERRMSG This file requires at least version 03.00.05 of Remind.%
  304. !    ERRMSG This version is version [version()].
  305.      EXIT
  306.   ENDIF
  307.   
  308. ! ######################################
  309. ! # Symbolic constants for weekdays... #
  310. ! ######################################
  311.   SET Sunday    0
  312.   SET Monday    1
  313.   SET Tuesday   2
  314. ***************
  315. *** 40,46 ****
  316.   SET Fri 5
  317.   SET Sat 6
  318.   
  319. ! # ---------------------------------------------------------------------------
  320.   
  321.   SET Jan 1
  322.   SET Feb 2
  323. --- 49,57 ----
  324.   SET Fri 5
  325.   SET Sat 6
  326.   
  327. ! #########################################
  328. ! # Symbolic constants for month names... #
  329. ! #########################################
  330.   
  331.   SET Jan 1
  332.   SET Feb 2
  333. ***************
  334. *** 55,62 ****
  335.   SET Nov 11
  336.   SET Dec 12
  337.   
  338. - # ---------------------------------------------------------------------------
  339.   SET January   1
  340.   SET February  2
  341.   SET March     3
  342. --- 66,71 ----
  343. ***************
  344. *** 70,172 ****
  345.   SET November  11
  346.   SET December  12
  347.   
  348. ! # ---------------------------------------------------------------------------
  349.   
  350. ! # A function which, given a time, returns a string in "AM/PM" format.
  351. ! # Unfortunately, has a leading zero.  Example call:
  352. ! #    set a _am_pm(now())
  353.   
  354. ! FSET _am_pm(tm)    IIF (tm<1:00, tm+12*60+"am", \
  355. !             IIF (tm<12:00, tm+"am", \
  356. !                 IIF (tm<13:00, tm+"pm", tm-12*60+"pm")))
  357.   
  358. ! # A function which knocks off a single leading zero from a string
  359.   
  360. ! FSET _no_lz(s) IIF(SUBSTR(s, 1, 1)=="0", SUBSTR(s, 2), s)
  361.   
  362. ! # ---------------------------------------------------------------------------
  363.   
  364. ! # Here's a tricky problem:  The 4th of July is a holiday in the U.S.
  365. ! # However, if it falls on a Saturday, the previous Friday is a holiday.
  366. ! # If it falls on a Sunday, the next Monday is a holiday.  Here's how
  367. ! # to do it.  NOTE that the following procedure makes the OMIT context
  368. ! # dependent upon the current date.  SInce it only depends on the current
  369. ! # year, which is not likely to change while producing a calendar, we
  370. ! # are fairly safe.  However, reminders with huge DELTA or BACK components
  371. ! # may not operate as expected.  In general, any time you make OMIT
  372. ! # dependent upon the current date, it's tricky and results may not be
  373. ! # what you expect.  You should try to make sure that the OMIT context
  374. ! # "near" any current reminders will not change during a calendar run.
  375. ! # The SCANFROM clause should help make these OMITs very safe.
  376.   
  377. ! # Convenient function and variable for safe moveable OMITs
  378. ! FSET _safe(x) trigger(today()-x)
  379. ! # Usually, a safety margin of 7 is sufficient.  We can stick it in a
  380. ! # variable.  Note that you must NOT preserve this variable, because
  381. ! # it must be updated as today() is incremented.
  382. ! SET safe7 _safe(7)
  383.   
  384. ! # The usual holiday
  385. ! OMIT 4 July MSG Independence day
  386.   
  387. ! # Calculate a "potential" advanced holiday
  388. ! REM 3 July SCANFROM [safe7] SATISFY 1
  389.   
  390. ! # But only trigger it if it falls on a Friday
  391. ! IF WKDAYNUM(TRIGDATE()) == 5
  392. !    OMIT [TRIGGER(TRIGDATE())] MSG Independence day (observed)
  393. ! ENDIF
  394.   
  395. - # Calculate a "potential" delayed holiday
  396. - REM 5 July SCANFROM [safe7] SATISFY 1
  397. - # But only trigger it if it falls on a Monday
  398. - IF WKDAYNUM(TRIGDATE()) == 1
  399. -    OMIT [TRIGGER(TRIGDATE())] MSG Independence day (observed)
  400. - ENDIF
  401. - # ---------------------------------------------------------------------------
  402. - # Function to calculate number of years since a given year or
  403. - # number of months since a given month and year...  useful for kids'
  404. - # birthdays.
  405. - FSET _yr_num(yr)    ORD(YEAR(TRIGDATE()) - yr)
  406. - FSET _mo_num(mo, yr)    ORD(12 * (YEAR(TRIGDATE()) - yr) + \
  407. -                 MONNUM(TRIGDATE()) - mo)
  408.   # Here's an example of how to use them:
  409.   REM 1 Nov ++12 MSG %"Dean's [_yr_num(1984)] birthday%" is %b.
  410.   REM 1 MSG Dean's [_mo_num(11, 1984)] 'monthly' anniversary
  411. - # ---------------------------------------------------------------------------
  412.   
  413. ! # How do we get a double-quote into a string????  Only works on ASCII
  414. ! # machines
  415.   
  416. - set Quote char(34)
  417. - set example "The last word of this sentence is in " \
  418. -     + Quote + "quotes." + Quote
  419. - # ---------------------------------------------------------------------------
  420. - # Function to send mail via elm's "fastmail" (by George M. Sipe)...
  421.   #FSET _mail(from, subj)    "mailx -s " + \
  422.   #                Quote + from + " : " + subj + Quote \
  423. ! #                getenv("LOGNAME") + " < /dev/null 1>&0"
  424.   FSET _mail(from, subj)    "fastmail -f " + \
  425.                   Quote + from + Quote + \
  426.                   " -s " + Quote + subj + Quote + \
  427. !                 " /dev/null " + getenv("LOGNAME")
  428.   
  429. ! # Example of use of _mail
  430. ! REM Feb 14 ONCE RUN [_mail("Someone you know", "Valentine's day is today")]
  431.   
  432. ! # ---------------------------------------------------------------------------
  433.   
  434. ! # A meeting on the first Monday of every month which is moved to the
  435. ! # second Monday in the event of a holiday.
  436.   
  437.   # First, the normal meeting.  However, the SKIP keyword means this
  438.   # one won't be triggered if the first Monday is a holiday
  439.   REM Mon 1 SKIP MSG Meeting
  440. --- 79,181 ----
  441.   SET November  11
  442.   SET December  12
  443.   
  444. ! ###########################################################
  445. ! # Other symbolic constants and functions for "pasting"... #
  446. ! ###########################################################
  447.   
  448. ! SET Quote CHAR(34)
  449.   
  450. ! # Handy constants/function for specifing week of month...
  451. ! SET  Week_1         1
  452. ! SET  Week_2         8
  453. ! SET  Week_3        15
  454. ! SET  Week_4        22
  455. ! FSET _last(mo)        "1 " + MON((mo%12)+1)+" --7"
  456.   
  457. ! # Shorthand for commonly used expression...
  458. ! FSET _trig()        TRIGGER(TRIGDATE())
  459.   
  460. ! # Handy function to provide SCANFROM dates...
  461. ! FSET _back(days)    TRIGGER(TODAY()-days)
  462.   
  463. ! ###########################################################
  464. ! # Function which returns a string in "am/pm" format based #
  465. ! # on the time.  For example, set a am_pm(NOW())...        #
  466. ! ###########################################################
  467.   
  468. ! FSET _am_pm(tm)    IIF(tm<01:00, tm+12*60+"am", \
  469. !                     tm<12:00, tm+"am", \
  470. !                     tm<13:00, tm+"pm", \
  471. !                               tm-12*60+"pm")
  472.   
  473. ! #################################################################
  474. ! # Function which removes a single leading zero from a string... #
  475. ! #################################################################
  476.   
  477. ! FSET _no_lz(s) IIF(SUBSTR(s, 1, 1)=="0", SUBSTR(s, 2), s)
  478.   
  479. ! ############################################################
  480. ! # Function to calculate number of years since a given year #
  481. ! # or number of months since a given month and year...      #
  482. ! ############################################################
  483.   
  484. ! FSET _yr_num(yr)        ORD(YEAR(TRIGDATE()) - yr)
  485. ! FSET _mo_num(mo, yr)        ORD(12 * (YEAR(TRIGDATE()) - yr) + \
  486. !                     MONNUM(TRIGDATE()) - mo)
  487.   
  488.   # Here's an example of how to use them:
  489.   REM 1 Nov ++12 MSG %"Dean's [_yr_num(1984)] birthday%" is %b.
  490.   REM 1 MSG Dean's [_mo_num(11, 1984)] 'monthly' anniversary
  491.   
  492. ! ###########################################################
  493. ! # Function to send mail via elm's "fastmail" (by GMS!)... #
  494. ! ###########################################################
  495.   
  496.   #FSET _mail(from, subj)    "mailx -s " + \
  497.   #                Quote + from + " : " + subj + Quote \
  498. ! #                GETENV("LOGNAME") + " < /dev/null 1>&0"
  499.   FSET _mail(from, subj)    "fastmail -f " + \
  500.                   Quote + from + Quote + \
  501.                   " -s " + Quote + subj + Quote + \
  502. !                 " /dev/null " + GETENV("LOGNAME")
  503.   
  504. ! #############################################################################
  505. ! # Here's a tricky problem:  The 4th of July is a holiday in the U.S.
  506. ! # However, if it falls on a Saturday, the previous Friday is a holiday.
  507. ! # If it falls on a Sunday, the next Monday is a holiday.  Here's how
  508. ! # to do it.  NOTE that the following procedure makes the OMIT context
  509. ! # dependent upon the current date.  SInce it only depends on the current
  510. ! # year, which is not likely to change while producing a calendar, we
  511. ! # are fairly safe.  However, reminders with huge DELTA or BACK components
  512. ! # may not operate as expected.  In general, any time you make OMIT
  513. ! # dependent upon the current date, it's tricky and results may not be
  514. ! # what you expect.  You should try to make sure that the OMIT context
  515. ! # "near" any current reminders will not change during a calendar run.
  516. ! # The SCANFROM clause should help make these OMITs very safe.
  517. ! ############################################################################
  518.   
  519. ! # Calculate the weekday of the holiday.
  520. ! REM 4 July SCANFROM [_back(7)] SATISFY 1
  521.   
  522. ! IF WKDAYNUM(TRIGDATE()) == Sat
  523. !     REM [TRIGGER(TRIGDATE())] MSG Independence day (actual)
  524. !     OMIT [TRIGGER(TRIGDATE()-1)] MSG Independence day (observed)
  525. ! ELSE
  526. !     IF WKDAYNUM(TRIGDATE()) == Sun
  527. !         REM [TRIGGER(TRIGDATE())] MSG Independence day (actual)
  528. !         OMIT [TRIGGER(TRIGDATE()+1)] MSG Independence day (observed)
  529. !     ELSE
  530. !         OMIT [TRIGGER(TRIGDATE())] MSG Independence day
  531. !     ENDIF
  532. ! ENDIF
  533.   
  534. + ############################################################################
  535. + #                                       #
  536. + # A meeting on the first Monday of every month which is moved to the       #
  537. + # second Monday in the event of a holiday.                                 #
  538. + #                                       #
  539. + ############################################################################
  540.   # First, the normal meeting.  However, the SKIP keyword means this
  541.   # one won't be triggered if the first Monday is a holiday
  542.   REM Mon 1 SKIP MSG Meeting
  543. ***************
  544. *** 180,199 ****
  545.      REM [TRIGGER(TRIGDATE())] MSG Delayed meeting
  546.   ENDIF
  547.   
  548. ! # ---------------------------------------------------------------------------
  549. ! #
  550. ! # A very complicated reminder sent in by a Remind user.
  551. ! # This person gets paid every two weeks, starting from 8 January 1993.
  552. ! # If a pay date occurs before the twelfth of a month, then that
  553. ! # he pays his mortgage on that pay date.  Otherwise, he pays the mortgage
  554. ! # on the previous pay date.  Furthermore, he has to schedule his
  555. ! # mortgage payment six days before it is due.  He wants to be reminded
  556. ! # a further four days before the scheduling deadline.  He also
  557. ! # wants to be mailed a notice two weeks before the scheduling deadline.
  558.   
  559. - # Here's the solution - if you can follow this, consider yourself a
  560. - # Remind programmer extraordinaire!
  561.   # A function to determine whether or not a pay-date is a mortgage-date.
  562.   
  563.   FSET _IsMortDate(x) DAY(x) < 12 || (DAY(x+14) >= 12 && DAY(x+14) <= 14)
  564. --- 189,210 ----
  565.      REM [TRIGGER(TRIGDATE())] MSG Delayed meeting
  566.   ENDIF
  567.   
  568. ! ############################################################################
  569. ! #                                       #
  570. ! # A very complicated reminder sent in by a Remind user.               #
  571. ! # This person gets paid every two weeks, starting from 8 January 1993.       #
  572. ! # If a pay date occurs before the twelfth of a month, then that           #
  573. ! # he pays his mortgage on that pay date.  Otherwise, he pays the mortgage  #
  574. ! # on the previous pay date.  Furthermore, he has to schedule his       #
  575. ! # mortgage payment six days before it is due.  He wants to be reminded       #
  576. ! # a further four days before the scheduling deadline.  He also           #
  577. ! # wants to be mailed a notice two weeks before the scheduling deadline.       #
  578. ! #                                       #
  579. ! # Here's the solution - if you can follow this, consider yourself a       #
  580. ! # Remind programmer extraordinaire!                       #
  581. ! #                                       #
  582. ! ############################################################################
  583.   
  584.   # A function to determine whether or not a pay-date is a mortgage-date.
  585.   
  586.   FSET _IsMortDate(x) DAY(x) < 12 || (DAY(x+14) >= 12 && DAY(x+14) <= 14)
  587. ***************
  588. *** 225,299 ****
  589.   REM [TRIGGER(TRIGDATE())] CAL Mortgage payment
  590.   
  591.   
  592. ! # ---------------------------------------------------------------------------
  593. ! #
  594. ! # The following holidays were provided by Dave Rickel
  595. ! # Modified by D. Skoll to give safe OMITs for moveable holidays
  596.   
  597. ! set thisyear year(today())
  598. ! if ! defined("eyear")
  599. !     set eyear 0
  600. ! endif
  601.   
  602. ! # Note:  A shorter way to set a default value for eyear is the following:
  603. ! # set eyear value("eyear", 0) -- David S.
  604.   
  605. - if eyear != thisyear
  606. -     set a thisyear % 19
  607. -     set b thisyear / 100
  608. -     set c thisyear % 100
  609. -     set d b / 4
  610. -     set e b % 4
  611. -     set f (b + 8) % 25
  612. -     set g (b - f + 1) / 3
  613. -     set h (19 * a + b - d - g + 15) % 30
  614. -     set i c / 4
  615. -     set k c % 4
  616. -     set l (32 + e + e + i + i - h - k) % 7
  617. -     set m (a + 11 * h + 22 * l) / 451
  618. -     set a h + l - 7 * m + 114
  619. -     set n a / 31
  620. -     set p a % 31 + 1
  621. -     set eyear thisyear
  622. -     set emon mon(n)
  623. -     set eday p
  624. -     preserve eyear emon eday
  625. - endif
  626. - REM [emon] [eday] MSG Easter Sunday.
  627.   # Some holidays are omitted, some are not.  You may want to change
  628.   # which ones are omitted - use the general forms shown below.
  629. ! # You'll need the safe7 variable from way up above.
  630.   
  631. ! REM Monday Feb 15 SCANFROM [safe7] SATISFY 1
  632. ! OMIT [trigger(trigdate())] MSG President's Day.
  633.   
  634. ! REM Saturday Mar 31 MSG Daylight Savings Time begins tonight.
  635. ! REM Mon Tue Wed Thu Fri Sat 15 April MSG Income Tax Day.
  636. ! REM Saturday May 1 MSG Kentucky Derby Day.
  637. ! REM Sunday May 8 MSG Mother's Day.
  638.   
  639. ! REM Monday May 25 SCANFROM [safe7] SATISFY 1
  640. ! OMIT [trigger(trigdate())] MSG Memorial Day.
  641.   
  642. ! REM Sunday June 15 MSG Father's Day.
  643.   
  644. ! REM Monday Sep 1 SCANFROM [safe7] SATISFY 1
  645. ! OMIT [trigger(trigdate())] MSG Labor Day.
  646.   
  647. ! REM Monday Oct 8 SCANFROM [safe7] SATISFY 1
  648. ! OMIT [trigger(trigdate())] MSG Columbus Day.
  649.   
  650. ! REM Monday Oct 22 SCANFROM [safe7] SATISFY 1
  651. ! OMIT [trigger(trigdate())] MSG Veteran's Day.
  652.   
  653. ! REM Saturday Oct 24 MSG Daylight Savings Time ends tonight.
  654.   
  655. ! REM Tuesday Nov 2 SCANFROM [safe7] SATISFY (year(trigdate()) % 4) == 0
  656. ! OMIT [trigger(trigdate())] MSG U.S. Election Day.
  657.   
  658. ! REM Saturday Nov 12 MSG Sadie Hawkin's Day.
  659.   
  660. ! REM Thursday Nov 22 SCANFROM [safe7] SATISFY 1
  661. ! OMIT [trigger(trigdate())] MSG Thanksgiving.
  662. --- 236,444 ----
  663.   REM [TRIGGER(TRIGDATE())] CAL Mortgage payment
  664.   
  665.   
  666. ! #USHOLS
  667. ! #############################################################################
  668. ! #                                           #
  669. ! # The following holidays were provided by Dave Rickel                #
  670. ! # Modified by D. Skoll to give safe OMITs for moveable holidays            #
  671. ! #                                        #
  672. ! #############################################################################
  673.   
  674. ! IF !DEFINED("easter")
  675. !     SET a YEAR(TODAY())
  676. !     SET b (a/100 - (a/100 + 8) % 25 + 1) / 3
  677. !     SET c (a%19*19 + a/100 - a/400 - b + 15) % 30
  678. !     SET d (32 + a/100%4*2 + (a%100/4*2) - c - a%100%4) % 7
  679. !     SET e c + d - (((a%19) + c*11 + d*22) / 451) * 7 + 114
  680. !     SET easter DATE(a, e / 31, e % 31 + 1)
  681. !     PRESERVE easter
  682. ! ENDIF
  683.   
  684. ! REM  [TRIGGER(easter-46)] MSG %"Ash Wednesday%"
  685. ! REM  [TRIGGER(easter-7)]  MSG %"Palm Sunday%"
  686. ! OMIT [TRIGGER(easter-2)]  MSG %"Good Friday%"
  687. ! OMIT [TRIGGER(easter)]    MSG %"Easter%" Sunday
  688. ! REM  [TRIGGER(easter+39)] MSG %"Ascension Day%"
  689. ! REM  [TRIGGER(easter+49)] MSG %"Pentecost%"
  690.   
  691.   # Some holidays are omitted, some are not.  You may want to change
  692.   # which ones are omitted - use the general forms shown below.
  693. ! # You'll need the _back() function and the Week_n variables defined
  694. ! # way up in the file.
  695.   
  696. ! OMIT     Jan  1        MSG %"New Year's%" Day
  697. ! REM  Mon Jan [Week_3]    MSG Martin Luther King - %"MLK Day%"
  698. ! REM      Feb  2        MSG %"Ground Hog Day%"
  699. ! REM      Feb 14        MSG %"Valentine's%" Day
  700. ! REM  Mon Feb [Week_3]    SCANFROM [_back(7)] SATISFY 1
  701. !             OMIT [_trig()] MSG %"President's Day%"
  702. ! REM      Mar 17        MSG %"St. Patrick's%" Day
  703. ! REM  Sun Apr  1 ++2    MSG Daylight Savings Time - %"DST starts%" %b
  704. ! REM      Apr  1        MSG %"April Fool's%" Day
  705. ! REM  Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
  706. ! REM      May  5        MSG %"Cinco de Mayo%"
  707. ! REM  Sat May [Week_1]    MSG %"Kentucky Derby%"
  708. ! REM  Sun May [Week_2]    MSG %"Mother's Day%"
  709. ! REM  Sat May [Week_3]    MSG %"Armed Forces Day%"
  710. ! REM  Mon [_last(May)]    SCANFROM [_back(7)] SATISFY 1
  711. !             OMIT [_trig()] MSG %"Memorial Day%"
  712. ! REM      Jun 14        MSG %"Flag Day%"
  713. ! REM  Sun Jun [Week_3]    MSG %"Father's Day%"
  714. ! REM  Mon Sep [Week_1]    SCANFROM [_back(7)] SATISFY 1
  715. !             OMIT [_trig()] MSG %"Labor Day%"
  716. ! REM  Mon Oct [Week_2]    MSG %"Columbus Day%"
  717. ! REM      Nov 11        MSG %"Veterans Day%"
  718. ! REM  Sun [_last(Oct)]    MSG Daylight Savings Time - %"DST over%"
  719. ! REM      Oct 30        MSG %"Mischief Night%"
  720. ! REM      Oct 31        MSG %"Halloween%"
  721. ! REM  Tue Nov  2        SCANFROM [_back(7)] SATISFY (YEAR(TRIGDATE()) % 4) == 0
  722. !             REM [_trig()] MSG %"Election%" Day
  723. ! REM  Thu Nov [Week_4]    SCANFROM [_back(7)] SATISFY 1
  724. !             OMIT [_trig()] MSG %"Thanksgiving%" Day
  725. ! REM  Fri Nov [Week_4+1]    SCANFROM [_back(7)] SATISFY 1
  726. !             OMIT [_trig()] MSG %"Thanksgiving%" (cont.)
  727. ! OMIT     Dec 24        MSG %"Christmas Eve%"
  728. ! OMIT     Dec 25        MSG %"Christmas%" Day
  729.   
  730. ! # Seasons (valid from 1992 to 2000)...
  731. ! REM Mar 20 MSG %"Spring%" begins
  732. ! REM Jun [IIF(YEAR(TODAY())%4, 21, 20)] MSG %"Summer%" begins
  733. ! REM Sep [CHOOSE(YEAR(TODAY())-1991, 22,22,23,23,22,22,22,23,22)] \
  734. !     MSG %"Fall%" begins
  735. ! REM Dec [IIF((YEAR(TODAY())+1)%4, 21, 22)] MSG %"Winter%" begins
  736.   
  737. ! #JHOLS
  738. ! ##########################################################################
  739. ! #                                         #
  740. ! # This portion of the file contains reminders for Jewish holidays.  The     #
  741. ! # dates were obtained from "The First Jewish Catalog" by Richard Siegel     #
  742. ! # and Michael and Sharon Strassfeld, published by the Jewish Publication #
  743. ! # Society of America.  The Reform version of the calendar was guessed     #
  744. ! # at by David Skoll based on experience # I welcome corrections.     #
  745. ! #                                     #
  746. ! # You (probably) want to add deltas to some of the reminders so that     #
  747. ! # you are given advance notice of Jewish holidays.             #
  748. ! #                                         #
  749. ! ##########################################################################
  750.   
  751. ! # Here are some general functions that you might find nice to use
  752.   
  753. ! # _hstr:  Returns a string which is the full Hebrew date of its argument.
  754. ! #         Example: hstr('1994/02/02') returns "21 Shvat 5754"
  755. ! FSET _hstr(x) HEBDAY(x) + " " + HEBMON(x) + " " + HEBYEAR(x)
  756.   
  757. ! # _hyrlen:  Return the length of the specified Hebrew year
  758. ! #           Example: _hyrlen(5754) returns 355
  759. ! FSET _hyrlen(x) HEBDATE(1, "Tishrey", x+1) - HEBDATE(1, "Tishrey", x)
  760.   
  761. ! # --- HERE ARE THE JEWISH HOLIDAYS ---
  762. ! # Set the variable InIsrael to 1 if you live in Israel.  Otherwise,
  763. ! # you get the Diaspora versions of Jewish holidays
  764. ! SET InIsrael 0
  765.   
  766. ! # Set the variable Reform to 1 if you want the Reform version of the
  767. ! # Jewish calendar.  Otherwise, you get the traditional version
  768. ! SET Reform 0
  769.   
  770. ! # Convenient function definition to save typing
  771. ! FSET _h(x, y) TRIGGER(HEBDATE(x,y))
  772.   
  773. ! # Default values in case InIsrael and Reform are not set
  774. ! SET InIsrael VALUE("InIsrael", 0)
  775. ! SET Reform   VALUE("Reform", 0)
  776.   
  777. ! [_h(1,  "Tishrey")] MSG Rosh Hashana 1
  778. ! # No RH-2 or Tzom Gedalia in Reform
  779. ! IF !Reform
  780. !    [_h(2,  "Tishrey")] MSG Rosh Hashana 2
  781. !    [_h(3,  "Tishrey")] MSG Tzom Gedalia
  782. ! ENDIF
  783. ! [_h(10, "Tishrey")] MSG Yom Kippur
  784. ! [_h(15, "Tishrey")] MSG Sukkot 1
  785. ! IF !InIsrael
  786. !    [_h(16, "Tishrey")] MSG Sukkot 2
  787. ! ENDIF
  788. ! [_h(21, "Tishrey")] MSG Hashana Rabba
  789. ! [_h(22, "Tishrey")] MSG Shemini Atzeret
  790. ! IF InIsrael
  791. !    [_h(22, "Tishrey")] MSG Simchat Torah
  792. ! ELSE
  793. !    [_h(23, "Tishrey")] MSG Simchat Torah
  794. ! ENDIF
  795. ! # Because Kislev can change length, we must be more careful about Chanukah
  796. ! FSET _chan(x) TRIGGER(HEBDATE(24, "Kislev", today()-9)+x)
  797. ! [_chan(1)] MSG Chanukah 1
  798. ! [_chan(2)] MSG Chanukah 2
  799. ! [_chan(3)] MSG Chanukah 3
  800. ! [_chan(4)] MSG Chanukah 4
  801. ! [_chan(5)] MSG Chanukah 5
  802. ! [_chan(6)] MSG Chanukah 6
  803. ! [_chan(7)] MSG Chanukah 7
  804. ! [_chan(8)] MSG Chanukah 8
  805. ! # Not sure about Reform's position on the next one.
  806. ! IF !Reform
  807. !    [_h(10, "Tevet")] MSG Asara B'Tevet
  808. ! ENDIF
  809. ! [_h(15, "Shvat")] MSG Tu B'Shvat
  810. ! [_h(15, "Adar A")] MSG Purim Katan
  811. ! [_h(13, "Adar")] MSG Fast of Esther
  812. ! [_h(14, "Adar")] MSG Purim
  813. ! [_h(15, "Nisan")] MSG Pesach
  814. ! IF !InIsrael
  815. !    [_h(16, "Nisan")] MSG Pesach 2
  816. ! ENDIF
  817. ! [_h(21, "Nisan")] MSG Pesach 7
  818. ! IF !InIsrael && !Reform
  819. !    [_h(22, "Nisan")] MSG Pesach 8
  820. ! ENDIF
  821. ! [_h(27, "Nisan")] MSG Yom HaShoah
  822. ! [_h(4,  "Iyar")] MSG Yom HaZikaron
  823. ! [_h(5,  "Iyar")] MSG Yom Ha'atzmaut
  824. ! # Not sure about Reform's position on Lag B'Omer
  825. ! IF !Reform
  826. !    [_h(18, "Iyar")] MSG Lag B'Omer
  827. ! ENDIF
  828. ! [_h(28, "Iyar")] MSG Yom Yerushalayim
  829. ! [_h(6,  "Sivan")] MSG Shavuot
  830. ! IF !InIsrael && !Reform
  831. !    [_h(7, "Sivan")] MSG Shavuot 2
  832. ! ENDIF
  833. ! # Fairly sure Reform Jews don't observe the next two
  834. ! IF !Reform
  835. !    [_h(17, "Tamuz")] MSG Fast of 17th of Tammuz
  836. !    [_h(9,  "Av")] MSG Tish'a B'Av
  837. ! ENDIF
  838. ! # Counting the omer - do the whole spiel, i.e:
  839. ! # "This is the xth day of the omer, being y weeks and z days of the omer."
  840. ! # Nice Remind programming example here!
  841. ! SET ostart HEBDATE(16, "Nisan", TODAY()-50)
  842. ! IF ostart <= TODAY() && (TODAY() - ostart < 49)
  843. !    SET odays TODAY()-ostart+1
  844. !    IF odays < 7
  845. !       MSG %"%"Today is the [ORD(odays)] day of the Omer.
  846. !    ELSE
  847. !       IF !(odays % 7)
  848. !          MSG %"%"Today is the [ORD(odays)] day of the Omer, being [odays / 7] [PLURAL(odays/7, "week")] of the Omer.
  849. !       ELSE
  850. !      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.
  851. !       ENDIF
  852. !    ENDIF
  853. !    CAL [ORD(odays)] of Omer
  854. ! ENDIF
  855. *** ../p4rel/dosubst.c    Fri Mar  5 11:57:34 1993
  856. --- ./dosubst.c    Thu Apr 22 10:24:04 1993
  857. ***************
  858. *** 324,329 ****
  859. --- 324,330 ----
  860.   L_O_OVER
  861.   #else
  862.           if (RealToday == JulianToday) sprintf(s, " (%s)", L_TODAY);
  863. +         else *s = 0;
  864.   #endif
  865.           s += strlen(s);
  866.           break;
  867. ***************
  868. *** 450,456 ****
  869.   #ifdef L_2_OVER
  870.   L_2_OVER
  871.   #else
  872. !         sprintf(s, "%s %d:%02d%s", L_AT, hh, min, pm);
  873.   #endif
  874.           s += strlen(s);
  875.           break;
  876. --- 451,457 ----
  877.   #ifdef L_2_OVER
  878.   L_2_OVER
  879.   #else
  880. !         sprintf(s, "%s %d%c%02d%s", L_AT, hh, TIMESEP, min, pm);
  881.   #endif
  882.           s += strlen(s);
  883.           break;
  884. ***************
  885. *** 541,547 ****
  886.   #ifdef L_AT_OVER
  887.   L_AT_OVER
  888.   #else
  889. !         sprintf(s, "%d:%02d%s", chh, cmin, cpm);
  890.   #endif
  891.           s += strlen(s);
  892.           break;
  893. --- 542,548 ----
  894.   #ifdef L_AT_OVER
  895.   L_AT_OVER
  896.   #else
  897. !         sprintf(s, "%d%c%02d%s", chh, TIMESEP, cmin, cpm);
  898.   #endif
  899.           s += strlen(s);
  900.           break;
  901. *** ../p4rel/expr.c    Wed Mar  3 17:35:34 1993
  902. --- ./expr.c    Thu Apr 22 11:00:23 1993
  903. ***************
  904. *** 225,231 ****
  905.   
  906.      /* Handle the parsing of quoted strings */
  907.      if (c == '\"') {
  908. !       if (!*(*in+1)) return E_MISS_QUOTE;
  909.         while (**in) if ((c = *out++ = *(*in)++) == '\"') break;
  910.         *out = 0;
  911.         if (c == '\"') return OK ; else return E_MISS_QUOTE;
  912. --- 225,231 ----
  913.   
  914.      /* Handle the parsing of quoted strings */
  915.      if (c == '\"') {
  916. !       if (!**in) return E_MISS_QUOTE;
  917.         while (**in) if ((c = *out++ = *(*in)++) == '\"') break;
  918.         *out = 0;
  919.         if (c == '\"') return OK ; else return E_MISS_QUOTE;
  920. ***************
  921. *** 233,239 ****
  922.   
  923.      /* Dates can be specified with single-quotes */
  924.      if (c == '\'') {
  925. !       if (!*(*in+1)) return E_MISS_QUOTE;
  926.         while (**in) if ((c = *out++ = *(*in)++) == '\'') break;
  927.         *out = 0;
  928.         if (c == '\'') return OK ; else return E_MISS_QUOTE;
  929. --- 233,239 ----
  930.   
  931.      /* Dates can be specified with single-quotes */
  932.      if (c == '\'') {
  933. !       if (!**in) return E_MISS_QUOTE;
  934.         while (**in) if ((c = *out++ = *(*in)++) == '\'') break;
  935.         *out = 0;
  936.         if (c == '\'') return OK ; else return E_MISS_QUOTE;
  937. ***************
  938. *** 771,776 ****
  939. --- 771,777 ----
  940.      if ((v1.type == TIM_TYPE && v2.type == INT_TYPE) ||
  941.          (v1.type == INT_TYPE && v2.type == TIM_TYPE)) {
  942.         v1.v.val = (v1.v.val + v2.v.val) % 1440;
  943. +       if (v1.v.val < 0) v1.v.val += 1440;
  944.         v1.type = TIM_TYPE;
  945.         return PushValStack(&v1);
  946.      }       
  947. ***************
  948. *** 839,844 ****
  949. --- 840,846 ----
  950.      /* If it's a time minus an int, do subtraction mod 1440 */
  951.      if (v1.type == TIM_TYPE && v2.type == INT_TYPE) {
  952.         v1.v.val = (v1.v.val - v2.v.val) % 1440;
  953. +       if (v1.v.val < 0) v1.v.val += 1440;
  954.         return PushValStack(&v1);
  955.      }
  956.   
  957. *** ../p4rel/finnish.h    Tue Feb 16 17:19:19 1993
  958. --- ./finnish.h    Thu Apr 22 10:24:36 1993
  959. ***************
  960. *** 11,19 ****
  961.   /*                                                             */
  962.   /***************************************************************/
  963.   
  964. - /* All Finnish words in this file are in "7-bit Finnish ASCII";
  965. -    they can be converted to other character sets if needed. */
  966. -    
  967.   /* The very first define in a language support file must be L_LANGNAME: */
  968.   #define L_LANGNAME "Finnish"
  969.   
  970. --- 11,16 ----
  971. ***************
  972. *** 35,42 ****
  973. --- 32,44 ----
  974.   #define L_MAR "maaliskuu"
  975.   #define L_APR "huhtikuu"
  976.   #define L_MAY "toukokuu"
  977. + #ifdef ISOLATIN1
  978. + #define L_JUN "kes\xE4kuu"
  979. + #define L_JUL "hein\xE4kuu"
  980. + #else
  981.   #define L_JUN "kes{kuu"
  982.   #define L_JUL "hein{kuu"
  983. + #endif
  984.   #define L_AUG "elokuu"
  985.   #define L_SEP "syyskuu"
  986.   #define L_OCT "lokakuu"
  987. ***************
  988. *** 44,50 ****
  989. --- 46,56 ----
  990.   #define L_DEC "joulukuu"
  991.   
  992.   /* Today and tomorrow */
  993. + #ifdef ISOLATIN1
  994. + #define L_TODAY "t\xE4n\xE4\xE4n"
  995. + #else
  996.   #define L_TODAY "t{n{{n"
  997. + #endif
  998.   #define L_TOMORROW "huomenna"
  999.   
  1000.   /* The default banner */
  1001. ***************
  1002. *** 62,68 ****
  1003. --- 68,78 ----
  1004.   #define L_FROMNOW "kuluttua"
  1005.   
  1006.   /* "in %d days' time" */
  1007. + #ifdef ISOLATIN1
  1008. + #define L_INXDAYS "%d p\xE4iv\xE4n kuluttua"
  1009. + #else
  1010.   #define L_INXDAYS "%d p{iv{n kuluttua"
  1011. + #endif
  1012.   
  1013.   /* "on" as in "on date...", but in Finnish it is a case ending;
  1014.      L_PARTIT is the partitive ending appended to -kuu and -tai */
  1015. ***************
  1016. *** 72,78 ****
  1017. --- 82,92 ----
  1018.   /* Pluralizing - this is a problem for many languages and may require
  1019.      a more drastic fix */
  1020.   /* The partitive ending of "day" */
  1021. + #ifdef ISOLATIN1
  1022. + #define L_PLURAL "\xE4"
  1023. + #else
  1024.   #define L_PLURAL "{"
  1025. + #endif
  1026.   
  1027.   /* Minutes, hours, at, etc */
  1028.   #define L_NOW "nyt"
  1029. ***************
  1030. *** 96,102 ****
  1031. --- 110,130 ----
  1032.   /* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
  1033.      See the file dosubst.c for more info. */
  1034.   
  1035. + #ifdef ISOLATIN1
  1036.   #define L_ORDINAL_OVERRIDE switch(d) { \
  1037. +                                case 1:  plu = ":sen\xE4"; break; \
  1038. +                                case 2:  plu = ":sena"; break; \
  1039. +                                default: \
  1040. +                                    switch(d%10) { \
  1041. +                                        case 2: \
  1042. +                                        case 3: \
  1043. +                                        case 6: \
  1044. +                                        case 8:  plu = ":ntena"; break; \
  1045. +                                        default: plu = ":nten\xE4"; break; \
  1046. +                                    } \
  1047. +                            }
  1048. + #else
  1049. + #define L_ORDINAL_OVERRIDE switch(d) { \
  1050.                                  case 1:  plu = ":sen{"; break; \
  1051.                                  case 2:  plu = ":sena"; break; \
  1052.                                  default: \
  1053. ***************
  1054. *** 108,113 ****
  1055. --- 136,142 ----
  1056.                                          default: plu = ":nten{"; break; \
  1057.                                      } \
  1058.                              }
  1059. + #endif
  1060.   #define L_A_OVER sprintf(s, "%s%s, %d. %s%s %d", DayName[jul%7], L_ON, d, \
  1061.                            MonthName[m], L_PARTIT, y);
  1062.   #define L_C_OVER sprintf(s, "%s%s", DayName[jul%7], L_ON);
  1063. *** ../p4rel/funcs.c    Tue Mar  2 16:27:55 1993
  1064. --- ./funcs.c    Thu Apr 22 10:24:25 1993
  1065. ***************
  1066. *** 60,65 ****
  1067. --- 60,69 ----
  1068.   PRIVATE    int    FDosubst    ARGS ((void));
  1069.   PRIVATE    int    FFilename    ARGS ((void));
  1070.   PRIVATE    int    FGetenv        ARGS ((void));
  1071. + PRIVATE int     FHebdate    ARGS ((void));
  1072. + PRIVATE int     FHebday        ARGS ((void));
  1073. + PRIVATE int     FHebmon        ARGS ((void));
  1074. + PRIVATE int     FHebyear    ARGS ((void));
  1075.   PRIVATE    int    FHour        ARGS ((void));
  1076.   PRIVATE    int    FIif        ARGS ((void));
  1077.   PRIVATE    int    FIndex        ARGS ((void));
  1078. ***************
  1079. *** 96,102 ****
  1080.   PRIVATE int    FTrigger        ARGS ((void));
  1081.   PRIVATE int    CheckArgs       ARGS ((Operator *f, int nargs));
  1082.   PRIVATE int    CleanUpAfterFunc ARGS ((void));
  1083. !      
  1084.   #ifdef __MSDOS__
  1085.   PRIVATE FILE *popen  ARGS((char *cmd, char *mode));
  1086.   PRIVATE int   pclose ARGS((FILE *fp));
  1087. --- 100,106 ----
  1088.   PRIVATE int    FTrigger        ARGS ((void));
  1089.   PRIVATE int    CheckArgs       ARGS ((Operator *f, int nargs));
  1090.   PRIVATE int    CleanUpAfterFunc ARGS ((void));
  1091.   #ifdef __MSDOS__
  1092.   PRIVATE FILE *popen  ARGS((char *cmd, char *mode));
  1093.   PRIVATE int   pclose ARGS((FILE *fp));
  1094. ***************
  1095. *** 117,122 ****
  1096. --- 121,134 ----
  1097.   /* Temp string buffer */
  1098.   static char Buffer[32];
  1099.   
  1100. + /* Caches for extracting months, days, years from dates - may
  1101. +    improve performance slightly. */
  1102. + static int CacheJul = -1;
  1103. + static int CacheYear, CacheMon, CacheDay;
  1104. + static int CacheHebJul = -1;
  1105. + static int CacheHebYear, CacheHebMon, CacheHebDay;
  1106.   /* We need access to the value stack */
  1107.   extern Value ValStack[];
  1108.   extern int ValStackPtr;
  1109. ***************
  1110. *** 151,158 ****
  1111.       {   "dosubst",    1,    3,    FDosubst },
  1112.       {   "filename",    0,    0,    FFilename },
  1113.       {   "getenv",    1,    1,    FGetenv },
  1114.       {   "hour",        1,    1,    FHour    },
  1115. !     {   "iif",        3,    3,    FIif    },
  1116.       {   "index",    2,    3,    FIndex     },
  1117.       {   "isleap",    1,    1,    FIsleap },
  1118.       {   "isomitted",    1,    1,    FIsomitted },
  1119. --- 163,174 ----
  1120.       {   "dosubst",    1,    3,    FDosubst },
  1121.       {   "filename",    0,    0,    FFilename },
  1122.       {   "getenv",    1,    1,    FGetenv },
  1123. +     {   "hebdate",    2,    4,    FHebdate },
  1124. +     {   "hebday",    1,    1,    FHebday },
  1125. +     {   "hebmon",    1,    1,    FHebmon },
  1126. +     {   "hebyear",    1,    1,    FHebyear },
  1127.       {   "hour",        1,    1,    FHour    },
  1128. !     {   "iif",        1,    NO_MAX,    FIif    },
  1129.       {   "index",    2,    3,    FIndex     },
  1130.       {   "isleap",    1,    1,    FIsleap },
  1131.       {   "isomitted",    1,    1,    FIsomitted },
  1132. ***************
  1133. *** 189,195 ****
  1134.   
  1135.   /* Need a variable here - Func[] array not really visible to outside. */
  1136.   int NumFuncs = sizeof(Func) / sizeof(Operator) ;
  1137. !      
  1138.   /***************************************************************/
  1139.   /*                                                             */
  1140.   /*  CallFunc                                                   */
  1141. --- 205,211 ----
  1142.   
  1143.   /* Need a variable here - Func[] array not really visible to outside. */
  1144.   int NumFuncs = sizeof(Func) / sizeof(Operator) ;
  1145.   /***************************************************************/
  1146.   /*                                                             */
  1147.   /*  CallFunc                                                   */
  1148. ***************
  1149. *** 545,551 ****
  1150.   {
  1151.      int y, m, d;
  1152.      if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  1153. !    FromJulian(ARG(0).v.val, &y, &m, &d);
  1154.      RetVal.type = INT_TYPE;
  1155.      RetVal.v.val = d;
  1156.      return OK;
  1157. --- 561,575 ----
  1158.   {
  1159.      int y, m, d;
  1160.      if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  1161. !    if (ARG(0).v.val == CacheJul)
  1162. !       d = CacheDay;
  1163. !    else {
  1164. !       FromJulian(ARG(0).v.val, &y, &m, &d);
  1165. !       CacheJul = ARG(0).v.val;
  1166. !       CacheYear = y;
  1167. !       CacheMon = m;
  1168. !       CacheDay = d;
  1169. !    }
  1170.      RetVal.type = INT_TYPE;
  1171.      RetVal.v.val = d;
  1172.      return OK;
  1173. ***************
  1174. *** 559,565 ****
  1175.   {
  1176.      int y, m, d;
  1177.      if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  1178. !    FromJulian(ARG(0).v.val, &y, &m, &d);
  1179.      RetVal.type = INT_TYPE;
  1180.      RetVal.v.val = m+1;
  1181.      return OK;
  1182. --- 583,597 ----
  1183.   {
  1184.      int y, m, d;
  1185.      if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  1186. !    if (ARG(0).v.val == CacheJul)
  1187. !       m = CacheMon;
  1188. !    else {
  1189. !       FromJulian(ARG(0).v.val, &y, &m, &d);
  1190. !       CacheJul = ARG(0).v.val;
  1191. !       CacheYear = y;
  1192. !       CacheMon = m;
  1193. !       CacheDay = d;
  1194. !    }
  1195.      RetVal.type = INT_TYPE;
  1196.      RetVal.v.val = m+1;
  1197.      return OK;
  1198. ***************
  1199. *** 573,579 ****
  1200.   {
  1201.      int y, m, d;
  1202.      if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  1203. !    FromJulian(ARG(0).v.val, &y, &m, &d);
  1204.      RetVal.type = INT_TYPE;
  1205.      RetVal.v.val = y;
  1206.      return OK;
  1207. --- 605,619 ----
  1208.   {
  1209.      int y, m, d;
  1210.      if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  1211. !    if (ARG(0).v.val == CacheJul)
  1212. !       y = CacheYear;
  1213. !    else {
  1214. !       FromJulian(ARG(0).v.val, &y, &m, &d);
  1215. !       CacheJul = ARG(0).v.val;
  1216. !       CacheYear = y;
  1217. !       CacheMon = m;
  1218. !       CacheDay = d;
  1219. !    }
  1220.      RetVal.type = INT_TYPE;
  1221.      RetVal.v.val = y;
  1222.      return OK;
  1223. ***************
  1224. *** 628,634 ****
  1225.         m = ARG(0).v.val - 1;
  1226.         if (m < 0) return E_2LOW;
  1227.         if (m > 11) return E_2HIGH;
  1228. !    } else FromJulian(ARG(0).v.val, &y, &m, &d);
  1229.      s = MonthName[m];
  1230.      return RetStrVal(s);
  1231.   }
  1232. --- 668,684 ----
  1233.         m = ARG(0).v.val - 1;
  1234.         if (m < 0) return E_2LOW;
  1235.         if (m > 11) return E_2HIGH;
  1236. !    } else {
  1237. !       if (ARG(0).v.val == CacheJul)
  1238. !          m = CacheMon;
  1239. !       else {
  1240. !          FromJulian(ARG(0).v.val, &y, &m, &d);
  1241. !          CacheJul = ARG(0).v.val;
  1242. !          CacheYear = y;
  1243. !          CacheMon = m;
  1244. !          CacheDay = d;
  1245. !       }
  1246. !    }
  1247.      s = MonthName[m];
  1248.      return RetStrVal(s);
  1249.   }
  1250. ***************
  1251. *** 856,862 ****
  1252.           return RetStrVal("OS/2");
  1253.   #endif
  1254.      return RetStrVal("MSDOS");
  1255. ! #endif  
  1256.   }
  1257.   
  1258.   /***************************************************************/
  1259. --- 906,912 ----
  1260.           return RetStrVal("OS/2");
  1261.   #endif
  1262.      return RetStrVal("MSDOS");
  1263. ! #endif
  1264.   }
  1265.   
  1266.   /***************************************************************/
  1267. ***************
  1268. *** 949,955 ****
  1269.      if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
  1270.      return RetStrVal(getenv(ARG(0).v.str));
  1271.   }
  1272. !      
  1273.   /***************************************************************/
  1274.   /*                                                             */
  1275.   /*  FValue                                                     */
  1276. --- 999,1005 ----
  1277.      if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
  1278.      return RetStrVal(getenv(ARG(0).v.str));
  1279.   }
  1280.   /***************************************************************/
  1281.   /*                                                             */
  1282.   /*  FValue                                                     */
  1283. ***************
  1284. *** 1282,1298 ****
  1285.   #endif
  1286.   {
  1287.      int istrue;
  1288.   
  1289. !    if (ARG(0).type != STR_TYPE && ARG(0).type != INT_TYPE) return E_BAD_TYPE;
  1290.   
  1291. !    if (ARG(0).type == INT_TYPE)
  1292. !       istrue = ARG(0).v.val;
  1293. !    else
  1294. !       istrue = *(ARG(0).v.str);
  1295.   
  1296. !    if (istrue) DCOPYVAL(RetVal, ARG(1));
  1297. !    else        DCOPYVAL(RetVal, ARG(2));
  1298.   
  1299.      return OK;
  1300.   }
  1301.   
  1302. --- 1332,1360 ----
  1303.   #endif
  1304.   {
  1305.      int istrue;
  1306. +    int arg;
  1307.   
  1308. !    if (!(Nargs % 2)) {
  1309. !       Eprint("IIF needs odd number of args");
  1310. !       return E_2FEW_ARGS;
  1311. !    }
  1312.   
  1313. !    for (arg=0; arg<Nargs-1; arg += 2) {
  1314. !       if (ARG(arg).type != STR_TYPE && ARG(arg).type != INT_TYPE)
  1315. !          return E_BAD_TYPE;
  1316.   
  1317. !       if (ARG(arg).type == INT_TYPE)
  1318. !          istrue = ARG(arg).v.val;
  1319. !       else
  1320. !          istrue = *(ARG(arg).v.str);
  1321.   
  1322. +       if (istrue) {
  1323. +          DCOPYVAL(RetVal, ARG(arg+1));
  1324. +      return OK;
  1325. +       }
  1326. +    }
  1327. +    DCOPYVAL(RetVal, ARG(Nargs-1));
  1328.      return OK;
  1329.   }
  1330.   
  1331. ***************
  1332. *** 1327,1334 ****
  1333.   {
  1334.      int amode;
  1335.      char *s;
  1336. !   
  1337. !    if (ARG(0).type != STR_TYPE || 
  1338.          (ARG(1).type != INT_TYPE && ARG(1).type != STR_TYPE)) return E_BAD_TYPE;
  1339.   
  1340.      if (ARG(1).type == INT_TYPE) amode = ARG(1).v.val;
  1341. --- 1389,1396 ----
  1342.   {
  1343.      int amode;
  1344.      char *s;
  1345. !    if (ARG(0).type != STR_TYPE ||
  1346.          (ARG(1).type != INT_TYPE && ARG(1).type != STR_TYPE)) return E_BAD_TYPE;
  1347.   
  1348.      if (ARG(1).type == INT_TYPE) amode = ARG(1).v.val;
  1349. ***************
  1350. *** 1345,1351 ****
  1351.           case 'X': amode |= X_OK; break;
  1352.            }
  1353.         }
  1354. !    } 
  1355.      RetVal.type = INT_TYPE;
  1356.      RetVal.v.val = access(ARG(0).v.str, amode);
  1357.      return OK;
  1358. --- 1407,1413 ----
  1359.           case 'X': amode |= X_OK; break;
  1360.            }
  1361.         }
  1362. !    }
  1363.      RetVal.type = INT_TYPE;
  1364.      RetVal.v.val = access(ARG(0).v.str, amode);
  1365.      return OK;
  1366. ***************
  1367. *** 1490,1492 ****
  1368. --- 1552,1684 ----
  1369.      return RetStrVal(TmpBuf);
  1370.   }
  1371.   
  1372. + /***************************************************************/
  1373. + /*                                                             */
  1374. + /*  FHebdate                                                   */
  1375. + /*  FHebday                               */
  1376. + /*  FHebmon                               */
  1377. + /*  FHebyear                                                   */
  1378. + /*                                                             */
  1379. + /*  Hebrew calendar support functions                          */
  1380. + /*                                                             */
  1381. + /***************************************************************/
  1382. + #ifdef HAVE_PROTOS
  1383. + PRIVATE int FHebdate(void)
  1384. + #else
  1385. + static int FHebdate()
  1386. + #endif
  1387. + {
  1388. +    int year, day, mon, jahr;
  1389. +    int mout, dout;
  1390. +    int ans, r;
  1391. +    if (ARG(0).type != INT_TYPE || ARG(1).type != STR_TYPE) return E_BAD_TYPE;
  1392. +    day = ARG(0).v.val;
  1393. +    mon = HebNameToNum(ARG(1).v.str);
  1394. +    if (mon < 0) {
  1395. +       Eprint("Invalid Hebrew month");
  1396. +       return E_BAD_DATE;
  1397. +    }
  1398. +    if (Nargs == 2) {
  1399. +       r = GetNextHebrewDate(JulianToday, mon, day, 0, &ans);
  1400. +       if (r) return r;
  1401. +       RetVal.type = DATE_TYPE;
  1402. +       RetVal.v.val = ans;
  1403. +       return OK;
  1404. +    }
  1405. +    if (Nargs == 4) {
  1406. +       if (ARG(3).type != INT_TYPE) return E_BAD_TYPE;
  1407. +       jahr = ARG(3).v.val;
  1408. +       if (jahr < 0) return E_2LOW;
  1409. +       if (jahr > 2) {
  1410. +          r = ComputeJahr(jahr, mon, day, &jahr);
  1411. +      if (r) return r;
  1412. +       }
  1413. +    } else jahr = 0;
  1414. +    if (ARG(2).type == INT_TYPE) {
  1415. +       year = ARG(2).v.val;
  1416. +       r = GetValidHebDate(year, mon, day, &mout, &dout, jahr);
  1417. +       if (r) return r;
  1418. +       r = HebToJul(year, mout, dout);
  1419. +       if (r<0) return E_DATE_OVER;
  1420. +       RetVal.v.val = r;
  1421. +       RetVal.type = DATE_TYPE;
  1422. +       return OK;
  1423. +    } else if (ARG(2).type == DATE_TYPE) {
  1424. +       r = GetNextHebrewDate(ARG(2).v.val, mon, day, jahr, &ans);
  1425. +       if (r) return r;
  1426. +       RetVal.v.val = ans;
  1427. +       RetVal.type = DATE_TYPE;
  1428. +       return OK;
  1429. +    } else return E_BAD_TYPE;
  1430. + }
  1431. + #ifdef HAVE_PROTOS
  1432. + PRIVATE int FHebday(void)
  1433. + #else
  1434. + static int FHebday()
  1435. + #endif
  1436. + {
  1437. +    int y, m, d;
  1438. +    if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  1439. +    if (ARG(0).v.val == CacheHebJul)
  1440. +       d = CacheHebDay;
  1441. +    else {
  1442. +       JulToHeb(ARG(0).v.val, &y, &m, &d);
  1443. +       CacheHebJul = ARG(0).v.val;
  1444. +       CacheHebYear = y;
  1445. +       CacheHebMon = m;
  1446. +       CacheHebDay = d;
  1447. +    }
  1448. +    RetVal.type = INT_TYPE;
  1449. +    RetVal.v.val = d;
  1450. +    return OK;
  1451. + }
  1452. + #ifdef HAVE_PROTOS
  1453. + PRIVATE int FHebmon(void)
  1454. + #else
  1455. + static int FHebmon()
  1456. + #endif
  1457. + {
  1458. +    int y, m, d;
  1459. +    if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  1460. +    if (ARG(0).v.val == CacheHebJul) {
  1461. +       m = CacheHebMon;
  1462. +       y = CacheHebYear;
  1463. +    } else {
  1464. +       JulToHeb(ARG(0).v.val, &y, &m, &d);
  1465. +       CacheHebJul = ARG(0).v.val;
  1466. +       CacheHebYear = y;
  1467. +       CacheHebMon = m;
  1468. +       CacheHebDay = d;
  1469. +    }
  1470. +    return RetStrVal(HebMonthName(m, y));
  1471. + }
  1472. + #ifdef HAVE_PROTOS
  1473. + PRIVATE int FHebyear(void)
  1474. + #else
  1475. + static int FHebyear()
  1476. + #endif
  1477. + {
  1478. +    int y, m, d;
  1479. +    if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  1480. +    if (ARG(0).v.val == CacheHebJul)
  1481. +       y = CacheHebYear;
  1482. +    else {
  1483. +       JulToHeb(ARG(0).v.val, &y, &m, &d);
  1484. +       CacheHebJul = ARG(0).v.val;
  1485. +       CacheHebYear = y;
  1486. +       CacheHebMon = m;
  1487. +       CacheHebDay = d;
  1488. +    }
  1489. +    RetVal.type = INT_TYPE;
  1490. +    RetVal.v.val = y;
  1491. +    return OK;
  1492. + }
  1493. *** ../p4rel/globals.h    Mon Mar  1 16:56:30 1993
  1494. --- ./globals.h    Thu Apr 22 10:24:07 1993
  1495. ***************
  1496. *** 30,36 ****
  1497.   EXTERN    int    CurDay;
  1498.   EXTERN    int    CurMon;
  1499.   EXTERN    int    CurYear;
  1500. - EXTERN    int    FirstYear;
  1501.   EXTERN  int    LineNo;
  1502.   EXTERN  char    FreshLine;
  1503.   EXTERN  char    LineBuffer[LINELEN];
  1504. --- 30,35 ----
  1505. ***************
  1506. *** 69,75 ****
  1507.   EXTERN  INIT(   int     MaxSatIter, 150);
  1508.   EXTERN  INIT(    char    *FileName, NULL);
  1509.   EXTERN  FILE *ErrFp;
  1510. - EXTERN  INIT(    int    JulFirst,  -1);
  1511.   EXTERN  INIT(   int     NumIfs,    0);
  1512.   EXTERN  INIT(   unsigned int IfFlags,   0);
  1513.   EXTERN  INIT(   int     LastTriggerDate, 0);
  1514. --- 68,73 ----
  1515. ***************
  1516. *** 115,118 ****
  1517.     }
  1518.   #endif
  1519.   ;
  1520. --- 113,115 ----
  1521. *** ../p4rel/init.c    Mon Mar  1 17:37:26 1993
  1522. --- ./init.c    Thu Apr 22 10:24:09 1993
  1523. ***************
  1524. *** 111,117 ****
  1525.         exit(1);
  1526.      }
  1527.      JulianToday = RealToday;
  1528. -    FirstYear = -1;
  1529.      FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
  1530.   
  1531.      /* Parse the command-line options */
  1532. --- 111,116 ----
  1533. ***************
  1534. *** 350,358 ****
  1535.         CurDay = d;
  1536.         if (JulianToday != RealToday) IgnoreOnce = 1;
  1537.      }
  1538. - /* Set JulFirst */
  1539. -    JulFirst = Julian(CurYear, 0, 1);
  1540. -    FirstYear = CurYear;
  1541.   }
  1542.   
  1543.   /***************************************************************/
  1544. --- 349,354 ----
  1545. ***************
  1546. *** 369,374 ****
  1547. --- 365,373 ----
  1548.   #endif
  1549.   {
  1550.      fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992, 1993 by David F. Skoll\n", VERSION, L_LANGNAME);
  1551. + #ifdef BETA
  1552. +    fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
  1553. + #endif   
  1554.      fprintf(ErrFp, "Usage: remind [options] filename [date]\n");
  1555.      fprintf(ErrFp, "Options:\n");
  1556.      fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  1557.