home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume38 / remind / patch07b < prev    next >
Encoding:
Text File  |  1993-07-22  |  41.1 KB  |  1,245 lines

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