home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume38 / remind / patch07b / patch.07.A
Text File  |  1993-07-22  |  39KB  |  1,184 lines

  1. Prereq: "03.00.06"
  2. See the patched file "WHATSNEW.30" for a list of
  3. changes in this patch.
  4. *** ../p6/version.h    Fri Apr 23 12:59:49 1993
  5. --- ./version.h    Mon Jun 28 12:29:33 1993
  6. ***************
  7. *** 9,12 ****
  8.   /*                                                             */
  9.   /***************************************************************/
  10.   
  11. ! #define VERSION "03.00.06"
  12. --- 9,12 ----
  13.   /*                                                             */
  14.   /***************************************************************/
  15.   
  16. ! #define VERSION "03.00.07"
  17. *** ../p6/Makefile    Fri Apr 23 13:00:44 1993
  18. --- ./Makefile    Mon Jun 28 12:30:00 1993
  19. ***************
  20. *** 12,18 ****
  21.   
  22.   # Uncomment the next line if you want to use gcc instead of default compiler
  23.   CC= gcc
  24.   # Put any additional flags for the C compiler or linker here
  25.   CFLAGS= -O -ansi
  26.   CDEFS=
  27. --- 12,18 ----
  28.   
  29.   # Uncomment the next line if you want to use gcc instead of default compiler
  30.   CC= gcc
  31. ! LD= gcc
  32.   # Put any additional flags for the C compiler or linker here
  33.   CFLAGS= -O -ansi
  34.   CDEFS=
  35. ***************
  36. *** 46,52 ****
  37.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  38.   # in config.h; then, you should be able to type 'make'.
  39.   #-----------------------------------------------------------------------------
  40. ! VERSION= 03.00.06
  41.   
  42.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  43.   lang.h english.h german.h dutch.h finnish.h
  44. --- 46,53 ----
  45.   # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  46.   # in config.h; then, you should be able to type 'make'.
  47.   #-----------------------------------------------------------------------------
  48. ! VERSION= 03.00.07
  49. ! MATHLIB= -lm
  50.   
  51.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  52.   lang.h english.h german.h dutch.h finnish.h
  53. ***************
  54. *** 70,79 ****
  55.       $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
  56.   
  57.   rem2ps: rem2ps.o
  58. !     $(CC) $(LDFLAGS) -o rem2ps rem2ps.o
  59.   
  60.   remind: $(OBJS)
  61. !     $(CC) $(LDFLAGS) -o remind $(OBJS)
  62.   
  63.   clean:
  64.       rm -f *.o *~
  65. --- 71,80 ----
  66.       $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
  67.   
  68.   rem2ps: rem2ps.o
  69. !     $(LD) $(LDFLAGS) -o rem2ps rem2ps.o
  70.   
  71.   remind: $(OBJS)
  72. !     $(LD) $(LDFLAGS) -o remind $(OBJS) $(MATHLIB)
  73.   
  74.   clean:
  75.       rm -f *.o *~
  76. ***************
  77. *** 105,112 ****
  78.   var.o: var.c $(STDHDRS) expr.h
  79.   
  80.   tarZ:
  81. !     tar cvf remind-3.0.6.tar $(MANIFEST)
  82. !     compress -v remind-3.0.6.tar
  83.   
  84.   shar:
  85.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  86. --- 106,113 ----
  87.   var.o: var.c $(STDHDRS) expr.h
  88.   
  89.   tarZ:
  90. !     tar cvf remind-3.0.7.tar $(MANIFEST)
  91. !     compress -v remind-3.0.7.tar
  92.   
  93.   shar:
  94.       shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  95. *** ../p6/README.UNIX    Thu Apr 22 10:24:13 1993
  96. --- ./README.UNIX    Mon Jun 28 12:29:27 1993
  97. ***************
  98. *** 32,38 ****
  99.   script.
  100.   
  101.   *** NOTE *** Please be aware that "remind-all.csh" and "remind-all.sh"
  102. ! have been changed since the last release of Remind.  If you install
  103.   the new remind executable, make sure you switch over to the new
  104.   "remind-all" scripts.
  105.   
  106. --- 32,38 ----
  107.   script.
  108.   
  109.   *** NOTE *** Please be aware that "remind-all.csh" and "remind-all.sh"
  110. ! have been changed since version 03.00.05 of Remind.  If you install
  111.   the new remind executable, make sure you switch over to the new
  112.   "remind-all" scripts.
  113.   
  114. *** ../p6/WHATSNEW.30    Mon May  3 11:00:51 1993
  115. --- ./WHATSNEW.30    Mon Jul 19 10:59:32 1993
  116. ***************
  117. *** 1,5 ****
  118. --- 1,48 ----
  119.   CHANGES TO REMIND
  120.   
  121. + * Version 3.0 Patch 7
  122. + + MAJOR ENHANCEMENTS
  123. + - Added "system variables" to allow the user more control over
  124. +   Remind operation, and to allow queries about the command-line
  125. +   options from within a reminder script.  They allow for specification
  126. +   of longitude and latitude for use by sunrise/sunset calculations.
  127. + - Added sunrise(), sunset(), isdst() and minsfromutc() functions -
  128. +   these are needed to support sunrise and sunset calculations.
  129. + + MINOR ENHANCEMENTS
  130. + - Allowed the MSG, RUN, CAL, PS and PSF keywords to be used in the
  131. +   same reminder as the SATISFY keyword.  This makes many complex
  132. +   reminders more compact.
  133. + - Added the filedir() function to enable Remind's include to emulate
  134. +   CPP's #include more closely.
  135. + - Allowed non-root users to use the "-u" option.  It only affects
  136. +   the "SHELL", "HOME", "USER" and "LOGNAME" environment variables -
  137. +   it doesn't change the effective uid and gid when run by non-root.
  138. + - Added built-in function "easterdate" to calculate date of Easter
  139. +   Sunday - function courtesy of Michael Salmon.
  140. + - Improved the Jewish holiday reminders in "defs.rem" to give advance
  141. +   notice of holidays.
  142. + - Allowed the "simple calendar" option (-s) to specify a number of
  143. +   weeks as well as a number of months, in the same fashion as the
  144. +   -c option.  Thanks to Dave Rickel.
  145. + + BUG FIXES
  146. + - Corrected the behaviour of "hebdate" for jahrzeits; added an additional
  147. +   parameter to specify the behaviour of dates in Adar during leap years.
  148. + - Changed kall so that "kall sh" doesn't commit suicide - patch courtesy
  149. +   of Michael Salmon.
  150.   * Version 3.0 Patch 6
  151.   
  152.   + MINOR ENHANCEMENTS
  153. *** ../p6/calendar.c    Mon May  3 12:01:29 1993
  154. --- ./calendar.c    Mon Jun 28 13:08:26 1993
  155. ***************
  156. *** 83,91 ****
  157.      } else {
  158.         JulianToday -= ((JulianToday+1)%7);
  159.   
  160. !       WriteIntermediateCalLine();
  161. !       WriteCalDays();
  162. !       WriteIntermediateCalLine();
  163.   
  164.         while (CalWeeks--)
  165.            DoCalendarOneWeek();
  166. --- 83,93 ----
  167.      } else {
  168.         JulianToday -= ((JulianToday+1)%7);
  169.   
  170. !       if (!DoSimpleCalendar) {
  171. !          WriteIntermediateCalLine();
  172. !          WriteCalDays();
  173. !          WriteIntermediateCalLine();
  174. !       }
  175.   
  176.         while (CalWeeks--)
  177.            DoCalendarOneWeek();
  178. ***************
  179. *** 106,112 ****
  180.   static void DoCalendarOneWeek()
  181.   #endif
  182.   {
  183. !    int y, m, d, done, i, l;
  184.      char buf[81];
  185.      int LinesWritten = 0;
  186.      int OrigJul = JulianToday;
  187. --- 108,114 ----
  188.   static void DoCalendarOneWeek()
  189.   #endif
  190.   {
  191. !    int y, m, d, done, i, l, wd;
  192.      char buf[81];
  193.      int LinesWritten = 0;
  194.      int OrigJul = JulianToday;
  195. ***************
  196. *** 119,124 ****
  197. --- 121,135 ----
  198.   
  199.   /* Output the entries */
  200.   
  201. + /* If it's "Simple Calendar" format, do it simply... */
  202. +    if (DoSimpleCalendar) {
  203. +       wd = (JulianToday + 1) % 7;
  204. +       for (i=0; i<7; i++) {
  205. +          WriteSimpleEntries(i, OrigJul+i-wd);
  206. +       }
  207. +       return;
  208. +    }
  209.   /* Here come the first few lines... */
  210.      putchar('|');
  211.      for (i=0; i<7; i++) {
  212. ***************
  213. *** 464,469 ****
  214. --- 475,481 ----
  215.      ClearGlobalOmits();
  216.      DestroyOmitContexts();
  217.      DestroyVars();
  218. +    NumTriggered = 0;
  219.   
  220.      r=OpenFile(InitialFile);
  221.      if (r) {
  222. ***************
  223. *** 618,623 ****
  224. --- 630,637 ----
  225.      CalEntry *CurPs = CalPs[col];
  226.      CalEntry *e;
  227.      char *s;
  228. +    char buf[TOKSIZE];
  229. +    Token tok;
  230.   
  231.      /* Parse the trigger date and time */
  232.      if ( (r=ParseRem(p, &trig, &tim)) ) return r;
  233. ***************
  234. *** 627,637 ****
  235.      if (DontIssueAts && tim.ttime != NO_TIME) return OK;
  236.   #endif
  237.      if (trig.typ == NO_TYPE) return E_EOLN;
  238. !    if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
  239.      /* Calculate the trigger date */
  240. !    jul = ComputeTrigger(trig.scanfrom, &trig, &r);
  241. !    if (r) return r;
  242.      if (!PsCal && (trig.typ == PS_TYPE || trig.typ == PSF_TYPE)) return OK;
  243.   
  244.      /* Remove any "at" times from PS or PSFILE reminders */
  245. --- 641,663 ----
  246.      if (DontIssueAts && tim.ttime != NO_TIME) return OK;
  247.   #endif
  248.      if (trig.typ == NO_TYPE) return E_EOLN;
  249. !    if (trig.typ == SAT_TYPE) {
  250. !       r=DoSatRemind(&trig, &tim, p);
  251. !       if (r) return r;
  252. !       r=ParseToken(p, buf);
  253. !       if (r) return r;
  254. !       FindToken(buf, &tok);
  255. !       if (tok.type == T_Empty || tok.type == T_Comment) return OK;
  256. !       if (tok.type != T_RemType || tok.val == SAT_TYPE) return E_PARSE_ERR;
  257. !       trig.typ = tok.val;
  258. !       jul = LastTriggerDate;
  259. !       if (!LastTrigValid) return OK;
  260. !    } else {
  261.      /* Calculate the trigger date */
  262. !       jul = ComputeTrigger(trig.scanfrom, &trig, &r);
  263. !       if (r) return r;
  264. !    }
  265.      if (!PsCal && (trig.typ == PS_TYPE || trig.typ == PSF_TYPE)) return OK;
  266.   
  267.      /* Remove any "at" times from PS or PSFILE reminders */
  268. ***************
  269. *** 639,644 ****
  270. --- 665,671 ----
  271.   
  272.      /* If trigger date == today, add it to the current entry */   
  273.      if (jul == JulianToday) {
  274. +       NumTriggered++;
  275.         s = SubstBuffer;
  276.         if (DoSimpleCalendar || tim.ttime != NO_TIME)
  277.            s += strlen(SimpleTime(tim.ttime, s));
  278. *** ../p6/config.h    Thu Apr 22 10:24:02 1993
  279. --- ./config.h    Mon Jun 28 12:29:29 1993
  280. ***************
  281. *** 12,17 ****
  282. --- 12,41 ----
  283.   /***************************************************************/
  284.   
  285.   /*---------------------------------------------------------------------*/
  286. + /* LAT_DEG, LAT_MIN and LAT_SEC:  Latitude of your location            */
  287. + /* LONG_DEG, LONG_MIN and LONG_SEC: Longitude of your location         */
  288. + /* For latitude, north is positive, south is negative.                 */
  289. + /* For longitude, west is positive, east is negative.                  */
  290. + /* NOTE:  For negative numbers, all three of DEG, MIN, SEC should be   */
  291. + /*        negative.  To indicate -20deg22'33" use                      */
  292. + /*        DEG=-20, MIN=-22 and SEC=-33.                                */
  293. + /* The default values are initially set to Ottawa, Ontario, Canada.    */
  294. + /*---------------------------------------------------------------------*/
  295. + #define LAT_DEG  45
  296. + #define LAT_MIN  24
  297. + #define LAT_SEC  00
  298. + #define LONG_DEG 75
  299. + #define LONG_MIN 39
  300. + #define LONG_SEC  0
  301. + /*---------------------------------------------------------------------*/
  302. + /* HAVE_MKTIME: Define this if your C library includes the mktime()    */
  303. + /*              function.  Otherwise, will attempt to use the Unix     */
  304. + /*              style time manipulations.                              */
  305. + /*---------------------------------------------------------------------*/
  306. + #define HAVE_MKTIME 1
  307. + /*---------------------------------------------------------------------*/
  308.   /* DEFAULT_PAGE:  The default page size to use for Rem2PS.             */
  309.   /* The Letter version is appropriate for North America; the A4 version */
  310.   /* is appropriate for Europe.                                          */
  311. ***************
  312. *** 72,78 ****
  313.   /*       IMPORTANT NOTE:  The Hebrew date routines depend on BASE      */
  314.   /*       being set to 1990.  If you change it, you'll have to add the  */
  315.   /*       number of days between 1 Jan <NEWBASE> and 1 Jan 1990 to the  */
  316. ! /*       manifest constant CORRECTION in hbcal.c                       */
  317.   /*---------------------------------------------------------------------*/
  318.   #define BASE 1990
  319.   
  320. --- 96,103 ----
  321.   /*       IMPORTANT NOTE:  The Hebrew date routines depend on BASE      */
  322.   /*       being set to 1990.  If you change it, you'll have to add the  */
  323.   /*       number of days between 1 Jan <NEWBASE> and 1 Jan 1990 to the  */
  324. ! /*       manifest constant CORRECTION in hbcal.c.  Also, the year      */
  325. ! /*       folding mechanism in main.c depends on BASE<2001.             */
  326.   /*---------------------------------------------------------------------*/
  327.   #define BASE 1990
  328.   
  329. ***************
  330. *** 86,92 ****
  331.   #define YR_RANGE 88
  332.   
  333.   /*---------------------------------------------------------------------*/
  334. ! /* VAR_NAME_LEN: The maximum length of variable names                  */
  335.   /*---------------------------------------------------------------------*/
  336.   #define VAR_NAME_LEN 12
  337.   
  338. --- 111,118 ----
  339.   #define YR_RANGE 88
  340.   
  341.   /*---------------------------------------------------------------------*/
  342. ! /* VAR_NAME_LEN: The maximum length of variable names.  Don't make it  */
  343. ! /*               any less than 12.                                     */
  344.   /*---------------------------------------------------------------------*/
  345.   #define VAR_NAME_LEN 12
  346.   
  347. *** ../p6/defs.rem    Mon May  3 10:29:12 1993
  348. --- ./defs.rem    Fri Jul 16 15:28:09 1993
  349. ***************
  350. *** 25,32 ****
  351.   ################################################
  352.   # Ensure required version of remind is used... #
  353.   ################################################
  354. ! IF version() < "03.00.06"
  355. !    ERRMSG This file requires at least version 03.00.06 of Remind.%
  356.      ERRMSG This version is version [version()].
  357.      EXIT
  358.   ENDIF
  359. --- 25,32 ----
  360.   ################################################
  361.   # Ensure required version of remind is used... #
  362.   ################################################
  363. ! IF version() < "03.00.07"
  364. !    ERRMSG This file requires at least version 03.00.07 of Remind.%
  365.      ERRMSG This version is version [version()].
  366.      EXIT
  367.   ENDIF
  368. ***************
  369. *** 100,105 ****
  370. --- 100,145 ----
  371.   FSET _back(days)    TRIGGER(TODAY()-days)
  372.   
  373.   ###########################################################
  374. + # On MS-DOS systems, the standard C library functions are #
  375. + # not reliable for computing offsets from local time to   #
  376. + # UTC.  The following provides a work-around for the      #
  377. + # sunrise() and sunset() functions.  Note, however, that  #
  378. + # if Daylight Savings Time is in effect for today(), the  #
  379. + # sun functions return times in DST even for dates on     #
  380. + # which DST is not in effect; the converse can also occur.#
  381. + #                                                         #
  382. + # Change the timezone to your timezone - the default is   #
  383. + # for EST which is 5 hours (300 minutes) behind UTC.      #
  384. + # The code is correct for places in which Daylight Savings#
  385. + # Time begins on the last Sunday in March and ends on the #
  386. + # last Sunday in October.                                 #
  387. + ###########################################################
  388. + IF OSTYPE() == "MSDOS"
  389. +     # Eastern Standard Time
  390. +     SET TimeZone -300
  391. +     # Use --8 rather than --7 because we want the last day BEFORE
  392. +     # the time switch occurs.
  393. +     REM Sun 1 Apr --8 SATISFY 1
  394. +     SET BegDst TRIGDATE()
  395. +     REM Sun 1 Nov --8 SATISFY 1
  396. +     SET EndDst TRIGDATE()
  397. +     SET $CalcUTC 0
  398. +     # Check out the following IF statement and figure out why it works!
  399. +     IF EndDst < BegDst
  400. +         # Daylight Savings Time
  401. +         SET $MinsFromUTC TimeZone+60
  402. +     ELSE
  403. +         # Standard Time
  404. +         SET $MinsFromUTC TimeZone
  405. +     ENDIF
  406. + ENDIF
  407. + ###########################################################
  408.   # Function which returns a string in "am/pm" format based #
  409.   # on the time.  For example, set a am_pm(NOW())...        #
  410.   ###########################################################
  411. ***************
  412. *** 219,226 ****
  413.   # on 2 Jan rather than 8 Jan.  We add 6 to TRIGDATE() in _IsMortDate to
  414.   # compensate.
  415.   
  416. ! REM 2 Jan 1993 *14 SATISFY _IsMortDate(TRIGDATE()+6)
  417. ! REM [TRIGGER(TRIGDATE())] ++4 MSG %"Schedule mortgage payment%" for %a.
  418.   
  419.   # Now the mail reminder two weeks before the payment date - because two
  420.   # weeks before a payment date is also a payment date, no pre-compensation
  421. --- 259,266 ----
  422.   # on 2 Jan rather than 8 Jan.  We add 6 to TRIGDATE() in _IsMortDate to
  423.   # compensate.
  424.   
  425. ! REM 2 Jan 1993 *14 ++4 SATISFY [_IsMortDate(TRIGDATE()+6)] \
  426. !     MSG %"Schedule mortgage payment%" for %a.
  427.   
  428.   # Now the mail reminder two weeks before the payment date - because two
  429.   # weeks before a payment date is also a payment date, no pre-compensation
  430. ***************
  431. *** 227,242 ****
  432.   # in the starting date of 8 Jan is necessary - convince yourself of this!
  433.   # This uses the _mail() function defined earlier.
  434.   
  435. ! REM 8 Jan 1993 *14 SATISFY _IsMortDate(TRIGDATE()+14)
  436. ! REM [TRIGGER(TRIGDATE())] ONCE RUN [_mail("Decatur Federal", \
  437. !     "Pay mortgage by the " + ORD(DAY(TRIGDATE()+14)))]
  438.   
  439.   # Make an entry on the calendar when the mortgage should be paid
  440.   
  441. ! REM 8 Jan 1993 *14 SATISFY _IsMortDate(TRIGDATE())
  442. ! REM [TRIGGER(TRIGDATE())] CAL Mortgage payment
  443.   
  444.   
  445.   #USHOLS
  446.   #############################################################################
  447.   #                                           #
  448. --- 267,312 ----
  449.   # in the starting date of 8 Jan is necessary - convince yourself of this!
  450.   # This uses the _mail() function defined earlier.
  451.   
  452. ! REM ONCE 8 Jan 1993 *14 SATISFY [_IsMortDate(TRIGDATE()+14)] \
  453. !     RUN [_mail("Decatur Federal", \
  454. !         "Pay mortgage by the " + ORD(DAY(TRIGDATE()+14)))]
  455.   
  456.   # Make an entry on the calendar when the mortgage should be paid
  457.   
  458. ! REM 8 Jan 1993 *14 SATISFY [_IsMortDate(TRIGDATE())] \
  459. !     CAL Mortgage payment
  460.   
  461. + #PSSTUFF
  462. + ##########################################################################
  463. + #                                         #
  464. + # This portion of the file contains some cute examples of the new        #
  465. + # PS-type reminders.  You need a PostScript printer or viewer to         #
  466. + # appreciate these.  To use them, pipe the output of remind -p into the  #
  467. + # rem2ps program.                                                        #
  468. + #                                         #
  469. + ##########################################################################
  470.   
  471. + # Convenient to stick all the PostScript code in a string var - makes
  472. + # reminders easier to understand.  The variable "shade" will contain
  473. + # PostScript code to shade in a particular box on the calendar.
  474. + SET shade \
  475. + "/_A LineWidth 2 div def \
  476. + _A _A moveto \
  477. + BoxWidth _A sub _A lineto \
  478. + BoxWidth _A sub BoxHeight _A sub lineto \
  479. + _A BoxHeight _A sub lineto \
  480. + closepath 0.95 setgray fill 0.0 setgray"
  481. + # The following reminder will shade the Saturday and Sunday calendar
  482. + # entries. 
  483. + REM Sat Sun PS [shade]
  484. + # The following will fill in the Hebrew dates on the calendar.  For this
  485. + # example, I recommend that you use the "-sd 10" option for rem2ps.
  486. + REM PS Border BoxHeight Border sub DaySize sub moveto \
  487. +    /DayFont findfont DaySize scalefont setfont \
  488. +    ([hebday(today())] [hebmon(today())]) show
  489.   #USHOLS
  490.   #############################################################################
  491.   #                                           #
  492. ***************
  493. *** 245,260 ****
  494.   #                                        #
  495.   #############################################################################
  496.   
  497. ! IF !DEFINED("easter")
  498. !     SET a YEAR(TODAY())
  499. !     SET b (a/100 - (a/100 + 8) % 25 + 1) / 3
  500. !     SET c (a%19*19 + a/100 - a/400 - b + 15) % 30
  501. !     SET d (32 + a/100%4*2 + (a%100/4*2) - c - a%100%4) % 7
  502. !     SET e c + d - (((a%19) + c*11 + d*22) / 451) * 7 + 114
  503. !     SET easter DATE(a, e / 31, e % 31 + 1)
  504. !     PRESERVE easter
  505. ! ENDIF
  506.   REM  [TRIGGER(easter-46)] MSG %"Ash Wednesday%"
  507.   REM  [TRIGGER(easter-7)]  MSG %"Palm Sunday%"
  508.   OMIT [TRIGGER(easter-2)]  MSG %"Good Friday%"
  509. --- 315,322 ----
  510.   #                                        #
  511.   #############################################################################
  512.   
  513. ! SET SaveTrig $NumTrig
  514. ! SET easter EASTERDATE(YEAR(TODAY()))
  515.   REM  [TRIGGER(easter-46)] MSG %"Ash Wednesday%"
  516.   REM  [TRIGGER(easter-7)]  MSG %"Palm Sunday%"
  517.   OMIT [TRIGGER(easter-2)]  MSG %"Good Friday%"
  518. ***************
  519. *** 292,299 ****
  520.   REM  Sun [_last(Oct)]    MSG Daylight Savings Time - %"DST over%"
  521.   REM      Oct 30        MSG %"Mischief Night%"
  522.   REM      Oct 31        MSG %"Halloween%"
  523. ! REM  Tue Nov  2        SCANFROM [_back(7)] SATISFY (YEAR(TRIGDATE()) % 4) == 0
  524. !             REM [_trig()] MSG %"Election%" Day
  525.   REM  Thu Nov [Week_4]    SCANFROM [_back(7)] SATISFY 1
  526.               OMIT [_trig()] MSG %"Thanksgiving%" Day
  527.   REM  Fri Nov [Week_4+1]    SCANFROM [_back(7)] SATISFY 1
  528. --- 354,362 ----
  529.   REM  Sun [_last(Oct)]    MSG Daylight Savings Time - %"DST over%"
  530.   REM      Oct 30        MSG %"Mischief Night%"
  531.   REM      Oct 31        MSG %"Halloween%"
  532. ! REM  Tue Nov  2        SCANFROM [_back(7)] \
  533. !     SATISFY [(YEAR(TRIGDATE()) % 4) == 0] \
  534. !     MSG %"Election%" Day
  535.   REM  Thu Nov [Week_4]    SCANFROM [_back(7)] SATISFY 1
  536.               OMIT [_trig()] MSG %"Thanksgiving%" Day
  537.   REM  Fri Nov [Week_4+1]    SCANFROM [_back(7)] SATISFY 1
  538. ***************
  539. *** 301,306 ****
  540. --- 364,381 ----
  541.   OMIT     Dec 24        MSG %"Christmas Eve%"
  542.   OMIT     Dec 25        MSG %"Christmas%" Day
  543.   
  544. + ##########################################################################
  545. + #                                         #
  546. + # The next block uses the shade variable defined in PSSTUFF above.       #
  547. + # If any US holidays were triggered above, shade in the calendar         #
  548. + # entry in PostScript.  This is not quite correct, as it blots out the   #
  549. + # other PostScript stuff above.  I was too lazy to do it properly :-)    #
  550. + #                                         #
  551. + ##########################################################################
  552. + if $NumTrig > SaveTrig
  553. +     REM PS [shade]
  554. + endif
  555.   # Seasons (valid from 1992 to 2000)...
  556.   REM Mar 20 MSG %"Spring%" begins
  557.   REM Jun [IIF(YEAR(TODAY())%4, 21, 20)] MSG %"Summer%" begins
  558. ***************
  559. *** 315,325 ****
  560.   # dates were obtained from "The First Jewish Catalog" by Richard Siegel     #
  561.   # and Michael and Sharon Strassfeld, published by the Jewish Publication #
  562.   # Society of America.  The Reform version of the calendar was guessed     #
  563. ! # at by David Skoll based on experience # I welcome corrections.     #
  564.   #                                     #
  565. - # You (probably) want to add deltas to some of the reminders so that     #
  566. - # you are given advance notice of Jewish holidays.             #
  567. - #                                         #
  568.   ##########################################################################
  569.   
  570.   # Here are some general functions that you might find nice to use
  571. --- 390,397 ----
  572.   # dates were obtained from "The First Jewish Catalog" by Richard Siegel     #
  573.   # and Michael and Sharon Strassfeld, published by the Jewish Publication #
  574.   # Society of America.  The Reform version of the calendar was guessed     #
  575. ! # at by David Skoll based on experience.  I welcome corrections.         #
  576.   #                                     #
  577.   ##########################################################################
  578.   
  579.   # Here are some general functions that you might find nice to use
  580. ***************
  581. *** 348,429 ****
  582.   SET InIsrael VALUE("InIsrael", 0)
  583.   SET Reform   VALUE("Reform", 0)
  584.   
  585. ! [_h(1,  "Tishrey")] MSG Rosh Hashana 1
  586.   
  587.   # No RH-2 or Tzom Gedalia in Reform
  588.   IF !Reform
  589. !    [_h(2,  "Tishrey")] MSG Rosh Hashana 2
  590. !    [_h(3,  "Tishrey")] MSG Tzom Gedalia
  591.   ENDIF
  592.   
  593. ! [_h(10, "Tishrey")] MSG Yom Kippur
  594. ! [_h(15, "Tishrey")] MSG Sukkot 1
  595.   
  596.   IF !InIsrael
  597. !    [_h(16, "Tishrey")] MSG Sukkot 2
  598.   ENDIF
  599.   
  600. ! [_h(21, "Tishrey")] MSG Hashana Rabba
  601. ! [_h(22, "Tishrey")] MSG Shemini Atzeret
  602.   
  603.   IF InIsrael
  604. !    [_h(22, "Tishrey")] MSG Simchat Torah
  605.   ELSE
  606. !    [_h(23, "Tishrey")] MSG Simchat Torah
  607.   ENDIF
  608.   
  609.   # Because Kislev can change length, we must be more careful about Chanukah
  610.   FSET _chan(x) TRIGGER(HEBDATE(24, "Kislev", today()-9)+x)
  611. ! [_chan(1)] MSG Chanukah 1
  612. ! [_chan(2)] MSG Chanukah 2
  613. ! [_chan(3)] MSG Chanukah 3
  614. ! [_chan(4)] MSG Chanukah 4
  615. ! [_chan(5)] MSG Chanukah 5
  616. ! [_chan(6)] MSG Chanukah 6
  617. ! [_chan(7)] MSG Chanukah 7
  618. ! [_chan(8)] MSG Chanukah 8
  619.   
  620.   # Not sure about Reform's position on the next one.
  621.   IF !Reform
  622. !    [_h(10, "Tevet")] MSG Asara B'Tevet
  623.   ENDIF
  624.   
  625. ! [_h(15, "Shvat")] MSG Tu B'Shvat
  626. ! [_h(15, "Adar A")] MSG Purim Katan
  627. ! [_h(13, "Adar")] MSG Fast of Esther
  628. ! [_h(14, "Adar")] MSG Purim
  629. ! [_h(15, "Nisan")] MSG Pesach
  630.   
  631.   IF !InIsrael
  632. !    [_h(16, "Nisan")] MSG Pesach 2
  633.   ENDIF
  634.   
  635. ! [_h(21, "Nisan")] MSG Pesach 7
  636.   
  637.   IF !InIsrael && !Reform
  638. !    [_h(22, "Nisan")] MSG Pesach 8
  639.   ENDIF
  640.   
  641. ! [_h(27, "Nisan")] MSG Yom HaShoah
  642. ! [_h(4,  "Iyar")] MSG Yom HaZikaron
  643. ! [_h(5,  "Iyar")] MSG Yom Ha'atzmaut
  644.   
  645.   # Not sure about Reform's position on Lag B'Omer
  646.   IF !Reform
  647. !    [_h(18, "Iyar")] MSG Lag B'Omer
  648.   ENDIF
  649.   
  650. ! [_h(28, "Iyar")] MSG Yom Yerushalayim
  651. ! [_h(6,  "Sivan")] MSG Shavuot
  652.   
  653.   IF !InIsrael && !Reform
  654. !    [_h(7, "Sivan")] MSG Shavuot 2
  655.   ENDIF
  656.   
  657.   # Fairly sure Reform Jews don't observe the next two
  658.   IF !Reform
  659. !    [_h(17, "Tamuz")] MSG Fast of 17th of Tammuz
  660. !    [_h(9,  "Av")] MSG Tish'a B'Av
  661.   ENDIF
  662.   
  663.   # Counting the omer - do the whole spiel, i.e:
  664. --- 420,501 ----
  665.   SET InIsrael VALUE("InIsrael", 0)
  666.   SET Reform   VALUE("Reform", 0)
  667.   
  668. ! [_h(1,  "Tishrey")] ++4 MSG %"Rosh Hashana 1%" is %b.
  669.   
  670.   # No RH-2 or Tzom Gedalia in Reform
  671.   IF !Reform
  672. !    [_h(2,  "Tishrey")] ++4 MSG %"Rosh Hashana 2%" is %b.
  673. !    [_h(3,  "Tishrey")] ++4 MSG %"Tzom Gedalia%" is %b.
  674.   ENDIF
  675.   
  676. ! [_h(10, "Tishrey")] ++4 MSG %"Yom Kippur%" is %b.
  677. ! [_h(15, "Tishrey")] ++4 MSG %"Sukkot 1%" is %b.
  678.   
  679.   IF !InIsrael
  680. !    [_h(16, "Tishrey")] MSG %"Sukkot 2%"
  681.   ENDIF
  682.   
  683. ! [_h(21, "Tishrey")] ++4 MSG %"Hashana Rabba%" is %b.
  684. ! [_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b.
  685.   
  686.   IF InIsrael
  687. !    [_h(22, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
  688.   ELSE
  689. !    [_h(23, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
  690.   ENDIF
  691.   
  692.   # Because Kislev can change length, we must be more careful about Chanukah
  693.   FSET _chan(x) TRIGGER(HEBDATE(24, "Kislev", today()-9)+x)
  694. ! [_chan(1)] ++4 MSG %"Chanukah 1%" is %b.
  695. ! [_chan(2)] MSG %"Chanukah 2%"
  696. ! [_chan(3)] MSG %"Chanukah 3%"
  697. ! [_chan(4)] MSG %"Chanukah 4%"
  698. ! [_chan(5)] MSG %"Chanukah 5%"
  699. ! [_chan(6)] MSG %"Chanukah 6%"
  700. ! [_chan(7)] MSG %"Chanukah 7%"
  701. ! [_chan(8)] MSG %"Chanukah 8%"
  702.   
  703.   # Not sure about Reform's position on the next one.
  704.   IF !Reform
  705. !    [_h(10, "Tevet")] ++4 MSG %"Asara B'Tevet%" is %b.
  706.   ENDIF
  707.   
  708. ! [_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b.
  709. ! [_h(15, "Adar A")] ++4 MSG %"Purim Katan%" is %b.
  710. ! [_h(13, "Adar")] ++4 MSG %"Fast of Esther%" is %b.
  711. ! [_h(14, "Adar")] ++4 MSG %"Purim%" is %b.
  712. ! [_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b.
  713.   
  714.   IF !InIsrael
  715. !    [_h(16, "Nisan")] MSG %"Pesach 2%"
  716.   ENDIF
  717.   
  718. ! [_h(21, "Nisan")] MSG %"Pesach 7%"
  719.   
  720.   IF !InIsrael && !Reform
  721. !    [_h(22, "Nisan")] MSG %"Pesach 8%"
  722.   ENDIF
  723.   
  724. ! [_h(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
  725. ! [_h(4,  "Iyar")] ++4 MSG %"Yom HaZikaron%" is %b.
  726. ! [_h(5,  "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
  727.   
  728.   # Not sure about Reform's position on Lag B'Omer
  729.   IF !Reform
  730. !    [_h(18, "Iyar")] ++4 MSG %"Lag B'Omer%" is %b.
  731.   ENDIF
  732.   
  733. ! [_h(28, "Iyar")] ++4 MSG %"Yom Yerushalayim%" is %b.
  734. ! [_h(6,  "Sivan")] ++4 MSG %"Shavuot%" is %b.
  735.   
  736.   IF !InIsrael && !Reform
  737. !    [_h(7, "Sivan")] MSG %"Shavuot 2%"
  738.   ENDIF
  739.   
  740.   # Fairly sure Reform Jews don't observe the next two
  741.   IF !Reform
  742. !    [_h(17, "Tamuz")] ++4 MSG %"Fast of 17th of Tammuz%" is %b.
  743. !    [_h(9,  "Av")] ++4 MSG %"Tish'a B'Av%" is %b.
  744.   ENDIF
  745.   
  746.   # Counting the omer - do the whole spiel, i.e:
  747. ***************
  748. *** 444,476 ****
  749.      CAL [ORD(odays)] of Omer
  750.   ENDIF
  751.   
  752. ! #PSSTUFF
  753. ! ##########################################################################
  754. ! #                                         #
  755. ! # This portion of the file contains some cute examples of the new        #
  756. ! # PS-type reminders.  You need a PostScript printer or viewer to         #
  757. ! # appreciate these.  To use them, pipe the output of remind -p into the  #
  758. ! # rem2ps program.                                                        #
  759. ! #                                         #
  760. ! ##########################################################################
  761.   
  762. ! # Convenient to stick all the PostScript code in a string var - makes
  763. ! # reminders easier to understand.  The variable "shade" will contain
  764. ! # PostScript code to shade in a particular box on the calendar.
  765. ! SET shade \
  766. ! "/_A LineWidth 2 div def \
  767. ! _A _A moveto \
  768. ! BoxWidth _A sub _A lineto \
  769. ! BoxWidth _A sub BoxHeight _A sub lineto \
  770. ! _A BoxHeight _A sub lineto \
  771. ! closepath 0.95 setgray fill 0.0 setgray"
  772. ! # The following reminder will shade the Saturday and Sunday calendar
  773. ! # entries. 
  774. ! REM Sat Sun PS [shade]
  775. ! # The following will fill in the Hebrew dates on the calendar.  For this
  776. ! # example, I recommend that you use the "-sd 10" option for rem2ps.
  777. ! REM PS Border BoxHeight Border sub DaySize sub moveto \
  778. !    /DayFont findfont DaySize scalefont setfont \
  779. !    ([hebday(today())] [hebmon(today())]) show
  780. --- 516,525 ----
  781.      CAL [ORD(odays)] of Omer
  782.   ENDIF
  783.   
  784. ! ### Candle lighting and Havdalah.  You should probably add candle lighting
  785. ! ### for other holidays besides Shabbat.  These just create calendar entries
  786. ! ### for Friday and Saturday.  Note:  You must set your latitude, longitude
  787. ! ### and possibly time zone for these to work properly!
  788.   
  789. ! REM Friday   CAL Candle lighting at [sunset(trigdate())-18]
  790. ! REM Saturday CAL Havdalah at [sunset(trigdate())+42]
  791. *** ../p6/dorem.c    Fri Apr 30 13:16:27 1993
  792. --- ./dorem.c    Mon Jun 28 12:58:03 1993
  793. ***************
  794. *** 48,62 ****
  795.      TimeTrig tim;
  796.      int r;
  797.      int jul;
  798.   
  799.      /* Parse the trigger date and time */
  800.      if ( (r=ParseRem(p, &trig, &tim)) ) return r;
  801.   
  802.      if (trig.typ == NO_TYPE) return E_EOLN;
  803. !    if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
  804.      /* Calculate the trigger date */
  805. !    jul = ComputeTrigger(trig.scanfrom, &trig, &r);
  806. !    if (r) return r;
  807.      
  808.   /* Queue the reminder, if necessary */
  809.   #ifdef HAVE_QUEUED
  810. --- 48,76 ----
  811.      TimeTrig tim;
  812.      int r;
  813.      int jul;
  814. +    char buf[TOKSIZE];
  815. +    Token tok;
  816.   
  817.      /* Parse the trigger date and time */
  818.      if ( (r=ParseRem(p, &trig, &tim)) ) return r;
  819.   
  820.      if (trig.typ == NO_TYPE) return E_EOLN;
  821. !    if (trig.typ == SAT_TYPE) {
  822. !       r=DoSatRemind(&trig, &tim, p);
  823. !       if (r) return r;
  824. !       r=ParseToken(p, buf);
  825. !       if (r) return r;
  826. !       FindToken(buf, &tok);
  827. !       if (tok.type == T_Empty || tok.type == T_Comment) return OK;
  828. !       if (tok.type != T_RemType || tok.val == SAT_TYPE) return E_PARSE_ERR;
  829. !       trig.typ = tok.val;
  830. !       jul = LastTriggerDate;
  831. !       if (!LastTrigValid) return OK;
  832. !    } else {
  833.      /* Calculate the trigger date */
  834. !       jul = ComputeTrigger(trig.scanfrom, &trig, &r);
  835. !       if (r) return r;
  836. !    }
  837.      
  838.   /* Queue the reminder, if necessary */
  839.   #ifdef HAVE_QUEUED
  840. ***************
  841. *** 228,234 ****
  842.           return OK;
  843.   
  844.        default:
  845. !         Eprint("Unknown token in REM command: %s", TokBuffer);
  846.           return E_PARSE_ERR;
  847.         }
  848.      }
  849. --- 242,248 ----
  850.           return OK;
  851.   
  852.        default:
  853. !         Eprint("Unknown token in trigger: %s", TokBuffer);
  854.           return E_PARSE_ERR;
  855.         }
  856.      }
  857. ***************
  858. *** 601,608 ****
  859.   {
  860.      int iter, jul, r;
  861.      Value v;
  862. !    char *s;
  863.   
  864.      iter = 0;
  865.      jul = trig->scanfrom;
  866.      while (iter++ < MaxSatIter) {
  867. --- 615,623 ----
  868.   {
  869.      int iter, jul, r;
  870.      Value v;
  871. !    char *s, *t;
  872.   
  873. +    t = p->pos;
  874.      iter = 0;
  875.      jul = trig->scanfrom;
  876.      while (iter++ < MaxSatIter) {
  877. ***************
  878. *** 612,624 ****
  879.         }
  880.         s = p->pos;
  881.         r = EvaluateExpr(p, &v);
  882. !       p->pos = s;
  883.         if (r) return r;
  884.         if (v.type != INT_TYPE && v.type != STR_TYPE) return E_BAD_TYPE;
  885.         if (v.type == INT_TYPE && v.v.val) return OK;
  886.         if (v.type == STR_TYPE && *v.v.str) return OK;
  887.         jul++;
  888.      }
  889.      LastTrigValid = 0;
  890.      return OK;
  891.   }
  892. --- 627,641 ----
  893.         }
  894.         s = p->pos;
  895.         r = EvaluateExpr(p, &v);
  896. !       t = p->pos;
  897.         if (r) return r;
  898.         if (v.type != INT_TYPE && v.type != STR_TYPE) return E_BAD_TYPE;
  899.         if (v.type == INT_TYPE && v.v.val) return OK;
  900.         if (v.type == STR_TYPE && *v.v.str) return OK;
  901. +       p->pos = s;
  902.         jul++;
  903.      }
  904. +    p->pos = t;
  905.      LastTrigValid = 0;
  906.      return OK;
  907.   }
  908. *** ../p6/err.h    Thu Apr 22 10:24:04 1993
  909. --- ./err.h    Mon Jun 28 12:29:30 1993
  910. ***************
  911. *** 56,61 ****
  912. --- 56,63 ----
  913.   #define E_PARSE_AS_REM       44 /* Not really an error - just returned by
  914.                                      DoOmit to indicate line should be executed
  915.                                      as a REM statement, also. */
  916. + #define E_CANT_MODIFY        45
  917. + #define E_MKTIME_PROBLEM     46
  918.   #ifdef MK_GLOBALS
  919.   #undef EXTERN
  920.   #define EXTERN
  921. ***************
  922. *** 112,118 ****
  923.      "Domain error",
  924.      "Invalid identifier",
  925.      "Recursive function call detected",
  926. !    ""
  927.   }
  928.   #endif
  929.   ;
  930. --- 114,122 ----
  931.      "Domain error",
  932.      "Invalid identifier",
  933.      "Recursive function call detected",
  934. !    "",
  935. !    "Cannot modify system variable",
  936. !    "C library function can't represent date/time"
  937.   }
  938.   #endif
  939.   ;
  940. *** ../p6/expr.c    Thu Apr 22 11:00:23 1993
  941. --- ./expr.c    Mon Jun 28 12:29:43 1993
  942. ***************
  943. *** 239,245 ****
  944.         if (c == '\'') return OK ; else return E_MISS_QUOTE;
  945.      }
  946.   
  947. !    if (!ISID(c)) {
  948.         Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], c);
  949.         return E_ILLEGAL_CHAR;
  950.      }
  951. --- 239,245 ----
  952.         if (c == '\'') return OK ; else return E_MISS_QUOTE;
  953.      }
  954.   
  955. !    if (!ISID(c) && c != '$') {
  956.         Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], c);
  957.         return E_ILLEGAL_CHAR;
  958.      }
  959. ***************
  960. *** 306,312 ****
  961.      int args; /* Number of function arguments */
  962.      Operator op, op2;
  963.      Value va;
  964. !    char *ufname;
  965.      
  966.      OpBase = OpStackPtr;
  967.      ValBase = ValStackPtr;
  968. --- 306,312 ----
  969.      int args; /* Number of function arguments */
  970.      Operator op, op2;
  971.      Value va;
  972. !    char *ufname = NULL; /* Stop GCC from complaining about use of uninit var */
  973.      
  974.      OpBase = OpStackPtr;
  975.      ValBase = ValStackPtr;
  976. ***************
  977. *** 366,372 ****
  978.               r = PushOpStack(f);
  979.               if (r) return r;
  980.           continue;  /* Still looking for an atomic vlue */
  981. !      } else if (!ISID(*ExprBuf) && *ExprBuf != '"' && *ExprBuf != '\'') {
  982.               Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
  983.           return E_ILLEGAL_CHAR;
  984.        } else { /* Must be a literal value */
  985. --- 366,373 ----
  986.               r = PushOpStack(f);
  987.               if (r) return r;
  988.           continue;  /* Still looking for an atomic vlue */
  989. !      } else if (!ISID(*ExprBuf) && *ExprBuf != '$' 
  990. !                 && *ExprBuf != '"' && *ExprBuf != '\'') {
  991.               Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
  992.           return E_ILLEGAL_CHAR;
  993.        } else { /* Must be a literal value */
  994. ***************
  995. *** 483,488 ****
  996. --- 484,500 ----
  997.         v->type = INT_TYPE;
  998.         v->v.val = len;
  999.         return OK;
  1000. +    } else if (*s == '$') { /* A system variable */
  1001. +      if (DebugFlag & DB_PRTEXPR)
  1002. +         fprintf(ErrFp, "%s => ", s);
  1003. +      r = GetSysVar(s+1, v);
  1004. +    
  1005. +      if (! (DebugFlag & DB_PRTEXPR)) return r;
  1006. +      if (r == OK) {
  1007. +         PrintValue(v, ErrFp);
  1008. +     putc('\n', ErrFp);
  1009. +      }
  1010. +      return r;
  1011.      } else /* Must be a symbol */
  1012.        if (DebugFlag & DB_PRTEXPR)
  1013.           fprintf(ErrFp, "%s => ", s);
  1014. *** ../p6/funcs.c    Mon May  3 12:30:00 1993
  1015. --- ./funcs.c    Fri Jul 16 15:23:44 1993
  1016. ***************
  1017. *** 19,24 ****
  1018. --- 19,25 ----
  1019.   #endif
  1020.   #include <string.h>
  1021.   #include <ctype.h>
  1022. + #include <math.h>
  1023.   #ifdef UNIX
  1024.   #ifdef HAVE_UNISTD
  1025.   #include <unistd.h>
  1026. ***************
  1027. *** 58,63 ****
  1028. --- 59,66 ----
  1029.   PRIVATE    int    FDaysinmon    ARGS ((void));
  1030.   PRIVATE    int    FDefined    ARGS ((void));
  1031.   PRIVATE    int    FDosubst    ARGS ((void));
  1032. + PRIVATE    int    FEasterdate    ARGS ((void));
  1033. + PRIVATE    int    FFiledir    ARGS ((void));
  1034.   PRIVATE    int    FFilename    ARGS ((void));
  1035.   PRIVATE    int    FGetenv        ARGS ((void));
  1036.   PRIVATE int     FHebdate    ARGS ((void));
  1037. ***************
  1038. *** 67,77 ****
  1039. --- 70,82 ----
  1040.   PRIVATE    int    FHour        ARGS ((void));
  1041.   PRIVATE    int    FIif        ARGS ((void));
  1042.   PRIVATE    int    FIndex        ARGS ((void));
  1043. + PRIVATE    int    FIsdst        ARGS ((void));
  1044.   PRIVATE    int    FIsomitted    ARGS ((void));
  1045.   PRIVATE    int    FLanguage    ARGS ((void));
  1046.   PRIVATE    int    FMax        ARGS ((void));
  1047.   PRIVATE    int    FMin        ARGS ((void));
  1048.   PRIVATE    int    FMinute        ARGS ((void));
  1049. + PRIVATE    int    FMinsfromutc    ARGS ((void));
  1050.   PRIVATE    int    FMon        ARGS ((void));
  1051.   PRIVATE    int    FMonnum        ARGS ((void));
  1052.   PRIVATE    int    FOrd        ARGS ((void));
  1053. ***************
  1054. *** 81,86 ****
  1055. --- 86,93 ----
  1056.   PRIVATE    int    FShell        ARGS ((void));
  1057.   PRIVATE    int    FStrlen        ARGS ((void));
  1058.   PRIVATE    int    FSubstr        ARGS ((void));
  1059. + PRIVATE    int    FSunrise    ARGS ((void));
  1060. + PRIVATE    int    FSunset        ARGS ((void));
  1061.   PRIVATE    int    FTime        ARGS ((void));
  1062.   PRIVATE    int    FTrigdate    ARGS ((void));
  1063.   PRIVATE    int    FTrigtime    ARGS ((void));
  1064. ***************
  1065. *** 100,105 ****
  1066. --- 107,113 ----
  1067.   PRIVATE int    FTrigger        ARGS ((void));
  1068.   PRIVATE int    CheckArgs       ARGS ((Operator *f, int nargs));
  1069.   PRIVATE int    CleanUpAfterFunc ARGS ((void));
  1070. + PRIVATE int    SunStuff    ARGS ((int rise, double cosz, int jul));
  1071.   
  1072.   #ifdef __MSDOS__
  1073.   PRIVATE FILE *popen  ARGS((char *cmd, char *mode));
  1074. ***************
  1075. *** 161,169 ****
  1076.       {   "daysinmon",    2,    2,    FDaysinmon },
  1077.       {   "defined",    1,    1,    FDefined },
  1078.       {   "dosubst",    1,    3,    FDosubst },
  1079.       {   "filename",    0,    0,    FFilename },
  1080.       {   "getenv",    1,    1,    FGetenv },
  1081. !     {   "hebdate",    2,    4,    FHebdate },
  1082.       {   "hebday",    1,    1,    FHebday },
  1083.       {   "hebmon",    1,    1,    FHebmon },
  1084.       {   "hebyear",    1,    1,    FHebyear },
  1085. --- 169,179 ----
  1086.       {   "daysinmon",    2,    2,    FDaysinmon },
  1087.       {   "defined",    1,    1,    FDefined },
  1088.       {   "dosubst",    1,    3,    FDosubst },
  1089. +     {   "easterdate",    1,    1,    FEasterdate },
  1090. +     {    "filedir",    0,    0,    FFiledir },
  1091.       {   "filename",    0,    0,    FFilename },
  1092.       {   "getenv",    1,    1,    FGetenv },
  1093. !     {   "hebdate",    2,    5,    FHebdate },
  1094.       {   "hebday",    1,    1,    FHebday },
  1095.       {   "hebmon",    1,    1,    FHebmon },
  1096.       {   "hebyear",    1,    1,    FHebyear },
  1097. ***************
  1098. *** 170,175 ****
  1099. --- 180,186 ----
  1100.       {   "hour",        1,    1,    FHour    },
  1101.       {   "iif",        1,    NO_MAX,    FIif    },
  1102.       {   "index",    2,    3,    FIndex     },
  1103. +     {   "isdst",    0,    2,    FIsdst },
  1104.       {   "isleap",    1,    1,    FIsleap },
  1105.       {   "isomitted",    1,    1,    FIsomitted },
  1106.       {   "language",     0,      0,      FLanguage },
  1107. ***************
  1108. *** 176,181 ****
  1109. --- 187,193 ----
  1110.       {   "lower",    1,    1,    FLower    },
  1111.       {   "max",        1,    NO_MAX,    FMax    },
  1112.       {   "min",        1,    NO_MAX, FMin    },
  1113. +     {   "minsfromutc",    0,    2,    FMinsfromutc },
  1114.       {   "minute",    1,    1,    FMinute },
  1115.       {   "mon",        1,    1,    FMon    },
  1116.       {   "monnum",    1,    1,    FMonnum },
  1117. ***************
  1118. *** 188,193 ****
  1119. --- 200,207 ----
  1120.       {   "shell",    1,    1,    FShell    },
  1121.       {   "strlen",    1,    1,    FStrlen    },
  1122.       {   "substr",    2,    3,    FSubstr    },
  1123. +     {   "sunrise",    0,    1,    FSunrise},
  1124. +     {   "sunset",    0,    1,    FSunset },
  1125.       {   "time",        2,    2,    FTime    },
  1126.       {   "today",    0,    0,    FToday    },
  1127.       {   "trigdate",    0,    0,    FTrigdate },
  1128. ***************
  1129. *** 417,426 ****
  1130.         it won't be destroyed */
  1131.      DCOPYVAL(RetVal, ARG(1));
  1132.   
  1133. !    if (StriEq(s, "int")) return DoCoerce(INT_TYPE, &RetVal);
  1134. !    else if (StriEq(s, "date")) return DoCoerce(DATE_TYPE, &RetVal);
  1135. !    else if (StriEq(s, "time")) return DoCoerce(TIM_TYPE, &RetVal);
  1136. !    else if (StriEq(s, "string")) return DoCoerce(STR_TYPE, &RetVal);
  1137.      else return E_CANT_COERCE;
  1138.   }
  1139.   
  1140. --- 431,440 ----
  1141.         it won't be destroyed */
  1142.      DCOPYVAL(RetVal, ARG(1));
  1143.   
  1144. !    if (! StrCmpi(s, "int")) return DoCoerce(INT_TYPE, &RetVal);
  1145. !    else if (! StrCmpi(s, "date")) return DoCoerce(DATE_TYPE, &RetVal);
  1146. !    else if (! StrCmpi(s, "time")) return DoCoerce(TIM_TYPE, &RetVal);
  1147. !    else if (! StrCmpi(s, "string")) return DoCoerce(STR_TYPE, &RetVal);
  1148.      else return E_CANT_COERCE;
  1149.   }
  1150.   
  1151.