home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume37 / remind / patch05b < prev    next >
Encoding:
Text File  |  1993-04-27  |  54.7 KB  |  1,678 lines

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