home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / remind / patch02b < prev    next >
Encoding:
Text File  |  1993-02-04  |  61.6 KB  |  2,093 lines

  1. Newsgroups: comp.sources.misc
  2. From: dfs@doe.carleton.ca (David F. Skoll)
  3. Subject: v35i019:  remind - A replacement for calendar, Patch02b/3
  4. Message-ID: <1993Feb4.225748.21589@sparky.imd.sterling.com>
  5. X-Md4-Signature: 5b8347a9521d953bbe634a05465b7f89
  6. Date: Thu, 4 Feb 1993 22:57:48 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: dfs@doe.carleton.ca (David F. Skoll)
  10. Posting-number: Volume 35, Issue 19
  11. Archive-name: remind/patch02b
  12. Environment: UNIX, MS-DOS
  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.02.A
  20. # Wrapped by kent@sparky on Tue Feb  2 08:40:57 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.02.A' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'patch.02.A'\"
  26. else
  27.   echo shar: Extracting \"'patch.02.A'\" \(59033 characters\)
  28.   sed "s/^X//" >'patch.02.A' <<'END_OF_FILE'
  29. XPrereq: "03.00.01"
  30. X*** ../patch1/version.h    Wed Dec 16 10:51:27 1992
  31. X--- ./version.h    Fri Jan  8 13:22:45 1993
  32. X***************
  33. X*** 5,12 ****
  34. X  /*  What version of remind do we have?                         */
  35. X  /*                                                             */
  36. X  /*  This file is part of REMIND.                               */
  37. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  38. X  /*                                                             */
  39. X  /***************************************************************/
  40. X  
  41. X! #define VERSION "03.00.01"
  42. X--- 5,12 ----
  43. X  /*  What version of remind do we have?                         */
  44. X  /*                                                             */
  45. X  /*  This file is part of REMIND.                               */
  46. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  47. X  /*                                                             */
  48. X  /***************************************************************/
  49. X  
  50. X! #define VERSION "03.00.02"
  51. X*** ../patch1/COPYRIGHT    Wed Dec 16 10:51:23 1992
  52. X--- ./COPYRIGHT    Fri Jan  8 13:26:53 1993
  53. X***************
  54. X*** 3,10 ****
  55. X  REMIND refers to the entire set of files and documentation in the
  56. X  REMIND package.
  57. X  
  58. X! REMIND is Copyright 1990, 1991, 1992 by David Skoll, except for the
  59. X! file remind-all.sh, which is Copyright 1990 by Bill Aten.
  60. X  
  61. X  You may use REMIND for free, and may freely distribute it, providing
  62. X  you do not charge the recipients to whom you distribute REMIND.
  63. X--- 3,10 ----
  64. X  REMIND refers to the entire set of files and documentation in the
  65. X  REMIND package.
  66. X  
  67. X! REMIND is Copyright 1990, 1991, 1992, 1993 by David Skoll, except for
  68. X! the file remind-all.sh, which is Copyright 1990 by Bill Aten.
  69. X  
  70. X  You may use REMIND for free, and may freely distribute it, providing
  71. X  you do not charge the recipients to whom you distribute REMIND.
  72. X***************
  73. X*** 16,23 ****
  74. X  
  75. X  You may incorporate parts of REMIND into your own programs, providing
  76. X  you do not sell these programs.  You must clearly indicate that the
  77. X! parts of REMIND you have incorporated are Copyright 1990, 1991, 1992
  78. X! by David Skoll.
  79. X  
  80. X  I will attempt to support REMIND as much as possible.  However, you
  81. X  use it at your own risk.  I am not responsible for any damages caused
  82. X--- 16,23 ----
  83. X  
  84. X  You may incorporate parts of REMIND into your own programs, providing
  85. X  you do not sell these programs.  You must clearly indicate that the
  86. X! parts of REMIND you have incorporated are Copyright 1990, 1991, 1992,
  87. X! 1993 by David Skoll.
  88. X  
  89. X  I will attempt to support REMIND as much as possible.  However, you
  90. X  use it at your own risk.  I am not responsible for any damages caused
  91. X*** ../patch1/MANIFEST.DOS    Wed Dec 16 10:51:55 1992
  92. X--- ./MANIFEST.DOS    Mon Jan 25 15:40:01 1993
  93. X***************
  94. X*** 4,19 ****
  95. X--- 4,22 ----
  96. X  defs.rem
  97. X  dorem.c
  98. X  dosubst.c
  99. X+ english.h
  100. X  err.h
  101. X  expr.c
  102. X  expr.h
  103. X  files.c
  104. X  funcs.c
  105. X+ german.h
  106. X  globals.c
  107. X  globals.h
  108. X  init.c
  109. X  kall
  110. X  kall.1
  111. X+ lang.h
  112. X  lnk.msc
  113. X  lnk.tc
  114. X  main.c
  115. X***************
  116. X*** 43,48 ****
  117. X--- 46,52 ----
  118. X  test.rem
  119. X  token.c
  120. X  trigger.c
  121. X+ tstlang.rem
  122. X  types.h
  123. X  userfns.c
  124. X  utils.c
  125. X*** ../patch1/MANIFEST.UNX    Wed Dec 16 10:51:55 1992
  126. X--- ./MANIFEST.UNX    Mon Jan 25 15:39:51 1993
  127. X***************
  128. X*** 11,26 ****
  129. X--- 11,29 ----
  130. X  defs.rem
  131. X  dorem.c
  132. X  dosubst.c
  133. X+ english.h
  134. X  err.h
  135. X  expr.c
  136. X  expr.h
  137. X  files.c
  138. X  funcs.c
  139. X+ german.h
  140. X  globals.c
  141. X  globals.h
  142. X  init.c
  143. X  kall
  144. X  kall.1
  145. X+ lanh.h
  146. X  lnk.msc
  147. X  lnk.tc
  148. X  main.c
  149. X***************
  150. X*** 44,49 ****
  151. X--- 47,53 ----
  152. X  test.rem
  153. X  token.c
  154. X  trigger.c
  155. X+ tstlang.rem
  156. X  types.h
  157. X  userfns.c
  158. X  utils.c
  159. X*** ../patch1/Makefile    Wed Dec 16 10:54:10 1992
  160. X--- ./Makefile    Mon Jan 25 15:39:39 1993
  161. X***************
  162. X*** 45,54 ****
  163. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  164. X  # in config.h; then, you should be able to type 'make'.
  165. X  #-----------------------------------------------------------------------------
  166. X! VERSION= 03.00.01
  167. X  
  168. X! HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
  169. X! STDHDRS= config.h types.h protos.h globals.h err.h
  170. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  171. X  main.c omit.c queue.c token.c trigger.c userfns.c utils.c var.c
  172. X  
  173. X--- 45,54 ----
  174. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  175. X  # in config.h; then, you should be able to type 'make'.
  176. X  #-----------------------------------------------------------------------------
  177. X! VERSION= 03.00.02
  178. X  
  179. X! HDRS= config.h err.h expr.h globals.h protos.h types.h version.h lang.h
  180. X! STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  181. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  182. X  main.c omit.c queue.c token.c trigger.c userfns.c utils.c var.c
  183. X  
  184. X***************
  185. X*** 55,61 ****
  186. X  MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  187. X  remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  188. X  makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
  189. X! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
  190. X  
  191. X  OBJS= $(SRCS:.c=.o)
  192. X  
  193. X--- 55,62 ----
  194. X  MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  195. X  remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  196. X  makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
  197. X! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
  198. X! lang.h english.h german.h tstlang.rem
  199. X  
  200. X  OBJS= $(SRCS:.c=.o)
  201. X  
  202. X***************
  203. X*** 73,79 ****
  204. X  clean:
  205. X      rm -f *.o *~
  206. X  
  207. X! rem2ps.o: rem2ps.c
  208. X  calendar.o: calendar.c $(STDHDRS) expr.h
  209. X  dorem.o: dorem.c $(STDHDRS) expr.h
  210. X  dosubst.o: dosubst.c $(STDHDRS)
  211. X--- 74,86 ----
  212. X  clean:
  213. X      rm -f *.o *~
  214. X  
  215. X! clobber:
  216. X!     rm -f *.o *~ remind rem2ps test.out
  217. X! 
  218. X! test: remind
  219. X!     sh test-rem
  220. X! 
  221. X! rem2ps.o: rem2ps.c rem2ps.h lang.h config.h
  222. X  calendar.o: calendar.c $(STDHDRS) expr.h
  223. X  dorem.o: dorem.c $(STDHDRS) expr.h
  224. X  dosubst.o: dosubst.c $(STDHDRS)
  225. X***************
  226. X*** 80,86 ****
  227. X  expr.o: expr.c $(STDHDRS) expr.h
  228. X  files.o: files.c $(STDHDRS)
  229. X  funcs.o: funcs.c $(STDHDRS) expr.h version.h
  230. X! globals.o: globals.c config.h types.h globals.h err.h
  231. X  init.o: init.c $(STDHDRS) expr.h version.h
  232. X  main.o: main.c $(STDHDRS) expr.h
  233. X  omit.o: omit.c $(STDHDRS)
  234. X--- 87,93 ----
  235. X  expr.o: expr.c $(STDHDRS) expr.h
  236. X  files.o: files.c $(STDHDRS)
  237. X  funcs.o: funcs.c $(STDHDRS) expr.h version.h
  238. X! globals.o: globals.c config.h types.h globals.h err.h lang.h
  239. X  init.o: init.c $(STDHDRS) expr.h version.h
  240. X  main.o: main.c $(STDHDRS) expr.h
  241. X  omit.o: omit.c $(STDHDRS)
  242. X***************
  243. X*** 92,99 ****
  244. X  var.o: var.c $(STDHDRS) expr.h
  245. X  
  246. X  tarZ:
  247. X!     tar cvf remind-3.0.1.tar $(MANIFEST)
  248. X!     compress -v remind-3.0.1.tar
  249. X  
  250. X  shar:
  251. X      shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  252. X--- 99,106 ----
  253. X  var.o: var.c $(STDHDRS) expr.h
  254. X  
  255. X  tarZ:
  256. X!     tar cvf remind-3.0.2.tar $(MANIFEST)
  257. X!     compress -v remind-3.0.2.tar
  258. X  
  259. X  shar:
  260. X      shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  261. X*** ../patch1/README.DOS    Wed Dec 16 10:51:22 1992
  262. X--- ./README.DOS    Fri Jan 22 11:08:58 1993
  263. X***************
  264. X*** 17,22 ****
  265. X--- 17,43 ----
  266. X  
  267. X  The file "defs.rem" has some sample Remind definitions and commands.
  268. X  
  269. X+ OTHER LANGUAGE SUPPORT
  270. X+ 
  271. X+ Remind has limited support for languages other than English.  See the file
  272. X+ "lang.h" for details.  Only the substitution filter and names of days and
  273. X+ months are affected - error and usage messages are still in English.
  274. X+ 
  275. X+ If you add support for a non-English language, Remind will accept both the
  276. X+ English and non-English names of months and weekdays in an input script.
  277. X+ However, you should not rely on this feature if you want to write portable
  278. X+ Remind scripts.
  279. X+ 
  280. X+ Take a look at the files "english.h" and "german.h" if you want to add
  281. X+ support for your favourite language.  If you do add another language
  282. X+ to Remind, please let me know!  Here are the basic guidelines:
  283. X+ 
  284. X+ - Your language file should be called "lxxx.h", where lxxx is the first 8
  285. X+ characters of the ENGLISH name of your language.
  286. X+ 
  287. X+ - You should define L_LANGNAME to be the full English name of your language,
  288. X+   with the first letter capitalized and the rest lower-case.
  289. X+ 
  290. X  --
  291. X  David F. Skoll <dfs@doe.carleton.ca>
  292. X  4-317 LeBreton Street South
  293. X*** ../patch1/README.OS2    Wed Dec 16 10:52:02 1992
  294. X--- ./README.OS2    Fri Jan 22 11:08:54 1993
  295. X***************
  296. X*** 25,30 ****
  297. X--- 25,51 ----
  298. X  OS/2 support is courtesy of DARREL HANKERSON <HANK@DUCVAX.AUBURN.EDU>.
  299. X  However, if you have problems, please contact me and not Darrel.
  300. X  
  301. X+ OTHER LANGUAGE SUPPORT
  302. X+ 
  303. X+ Remind has limited support for languages other than English.  See the file
  304. X+ "lang.h" for details.  Only the substitution filter and names of days and
  305. X+ months are affected - error and usage messages are still in English.
  306. X+ 
  307. X+ If you add support for a non-English language, Remind will accept both the
  308. X+ English and non-English names of months and weekdays in an input script.
  309. X+ However, you should not rely on this feature if you want to write portable
  310. X+ Remind scripts.
  311. X+ 
  312. X+ Take a look at the files "english.h" and "german.h" if you want to add
  313. X+ support for your favourite language.  If you do add another language
  314. X+ to Remind, please let me know!  Here are the basic guidelines:
  315. X+ 
  316. X+ - Your language file should be called "lxxx.h", where lxxx is the first 8
  317. X+ characters of the ENGLISH name of your language.
  318. X+ 
  319. X+ - You should define L_LANGNAME to be the full English name of your language,
  320. X+   with the first letter capitalized and the rest lower-case.
  321. X+ 
  322. X  --
  323. X  David F. Skoll <dfs@doe.carleton.ca>
  324. X  4-317 LeBreton Street South
  325. X*** ../patch1/README.UNIX    Wed Dec 16 10:51:21 1992
  326. X--- ./README.UNIX    Fri Jan 29 13:43:01 1993
  327. X***************
  328. X*** 14,24 ****
  329. X  
  330. X  4 - Examine the file config.h and adjust parameters as needed
  331. X  
  332. X! 5 - Type 'make'
  333. X  
  334. X! 6 - Type 'sh test-rem' to run the acceptance test
  335. X  
  336. X! 7 - Type 'make install' to install Remind, kall, rem and the man
  337. X      pages.
  338. X  
  339. X  Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
  340. X--- 14,27 ----
  341. X  
  342. X  4 - Examine the file config.h and adjust parameters as needed
  343. X  
  344. X! 5 - Examine lang.h and choose the language you want Remind to use.
  345. X  
  346. X! 6 - Type 'make'
  347. X  
  348. X! 7 - Type 'sh test-rem' or 'make test' to run the acceptance test.  Note
  349. X!     that the test script works only for the English version of Remind.
  350. X! 
  351. X! 8 - Type 'make install' to install Remind, kall, rem and the man
  352. X      pages.
  353. X  
  354. X  Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
  355. X***************
  356. X*** 51,56 ****
  357. X--- 54,81 ----
  358. X  depends on the output of "ps", and may not be portable.
  359. X  
  360. X  The file "defs.rem" has some sample Remind definitions and commands.
  361. X+ 
  362. X+ OTHER LANGUAGE SUPPORT
  363. X+ 
  364. X+ Remind has limited support for languages other than English.  See the file
  365. X+ "lang.h" for details.  Only the substitution filter and names of days and
  366. X+ months are affected - error and usage messages are still in English.
  367. X+ 
  368. X+ If you add support for a non-English language, Remind will accept both the
  369. X+ English and non-English names of months and weekdays in an input script.
  370. X+ However, you should not rely on this feature if you want to write portable
  371. X+ Remind scripts.
  372. X+ 
  373. X+ Take a look at the files "english.h" and "german.h" if you want to add
  374. X+ support for your favourite language.  If you do add another language
  375. X+ to Remind, please let me know!  Here are the basic guidelines:
  376. X+ 
  377. X+ - Your language file should be called "lxxx.h", where lxxx is the first 8
  378. X+   characters of the ENGLISH name of your language.
  379. X+ 
  380. X+ - Your language file should define L_LANGNAME to be the full English
  381. X+   name of your language, with the first letter capitalized and the rest
  382. X+   lower-case.
  383. X  
  384. X  --
  385. X  David F. Skoll <dfs@doe.carleton.ca>
  386. X*** ../patch1/WHATSNEW.30    Wed Dec 16 10:51:56 1992
  387. X--- ./WHATSNEW.30    Mon Feb  1 12:29:52 1993
  388. X***************
  389. X*** 2,10 ****
  390. X  
  391. X  *** PLEASE NOTE:  AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
  392. X  986 Eiffel Avenue,
  393. X! Ottawa, Ontario
  394. X  Canada
  395. X  
  396. X  * Version 3.0 Patch 1
  397. X  
  398. X  - Wrote the Rem2ps program to produce PostScript calendars
  399. X--- 2,50 ----
  400. X  
  401. X  *** PLEASE NOTE:  AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
  402. X  986 Eiffel Avenue,
  403. X! Ottawa, Ontario K2C 0J2
  404. X  Canada
  405. X  
  406. X+ * Version 3.0 Patch 2
  407. X+ 
  408. X+ - Added the -u option to Remind so that root can run it as any user.
  409. X+   This simplifies the remind-all scripts, and makes them more efficient.
  410. X+   If you are worried that this option is a security hole, you can
  411. X+   disable it in config.h
  412. X+ 
  413. X+ - Changed the RUN command so that RUN OFF can be used anywhere, even
  414. X+   though RUN ON only works in the top-level file.  This eases the
  415. X+   management of global files which may want to switch RUN OFF.
  416. X+ 
  417. X+ - Added ISO encoding (ISO 8859-1) to the PostScript output, courtesy of
  418. X+   Michael Salmon.  This can be selected with the '-i' option in rem2ps.
  419. X+ 
  420. X+ - Added support for the '-' date separator as well as the '/' separator.
  421. X+ 
  422. X+ - Added support for languages other than English.  Note that this support
  423. X+   is not complete - error messages are still in English.  The idea and
  424. X+   German translation came from Wolfgang Thronicke.
  425. X+ 
  426. X+ - Changed the -w option to include the "padding" and "spacing" options.
  427. X+   NOTE INCOMPATIBILITY:  In the previous patch level, creating a weekly
  428. X+   calendar using the -c+n option left no blank lines between the day
  429. X+   number and the first reminder entry.  This has been changed so that one
  430. X+   blank line is left.  To revert to the old behaviour, use the "-w,,0"
  431. X+   option.
  432. X+ 
  433. X+ - Added the -o option to Rem2ps.  This allows you to specify the margins
  434. X+   when producing a PostScript calendar.
  435. X+ 
  436. X+ - Updated the copyright notices in all the files. :-)
  437. X+ 
  438. X+ - Added 'make clobber' and 'make test' targets to the Unix makefile.
  439. X+ 
  440. X+ - Corrected typos in WHATSNEW.30 and remind.1 man page.  Thanks to
  441. X+   Dave Wolfe <dwolfe@pffft.sps.mot.com>
  442. X+ 
  443. X+ - Changed Remind so that supplying the -a option causes timed reminders
  444. X+   not to be placed into the calendar in calendar mode.
  445. X+ 
  446. X  * Version 3.0 Patch 1
  447. X  
  448. X  - Wrote the Rem2ps program to produce PostScript calendars
  449. X***************
  450. X*** 66,72 ****
  451. X  - Fixed a lurking bug in trigger date calculation which, amazingly, had not
  452. X    been caught in the couple of years that Remind has been out!
  453. X  
  454. X! * Version 2.4 Patch 5 
  455. X  
  456. X  - Added the "c+n" option for printing a calendar by
  457. X    weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
  458. X--- 106,112 ----
  459. X  - Fixed a lurking bug in trigger date calculation which, amazingly, had not
  460. X    been caught in the couple of years that Remind has been out!
  461. X  
  462. X! * Version 2.3 Patch 5 
  463. X  
  464. X  - Added the "c+n" option for printing a calendar by
  465. X    weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
  466. X*** ../patch1/calendar.c    Wed Dec 16 10:51:29 1992
  467. X--- ./calendar.c    Fri Jan 22 10:26:13 1993
  468. X***************
  469. X*** 5,11 ****
  470. X  /*  The code for generating a calendar.                        */
  471. X  /*                                                             */
  472. X  /*  This file is part of REMIND.                               */
  473. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  474. X  /*                                                             */
  475. X  /***************************************************************/
  476. X  #include "config.h"
  477. X--- 5,11 ----
  478. X  /*  The code for generating a calendar.                        */
  479. X  /*                                                             */
  480. X  /*  This file is part of REMIND.                               */
  481. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  482. X  /*                                                             */
  483. X  /***************************************************************/
  484. X  #include "config.h"
  485. X***************
  486. X*** 105,111 ****
  487. X  static void DoCalendarOneWeek()
  488. X  #endif
  489. X  {
  490. X!    int y, m, d, done, i;
  491. X     char buf[81];
  492. X     int LinesWritten = 0;
  493. X     int OrigJul = JulianToday;
  494. X--- 105,111 ----
  495. X  static void DoCalendarOneWeek()
  496. X  #endif
  497. X  {
  498. X!    int y, m, d, done, i, l;
  499. X     char buf[81];
  500. X     int LinesWritten = 0;
  501. X     int OrigJul = JulianToday;
  502. X***************
  503. X*** 118,124 ****
  504. X  
  505. X  /* Output the entries */
  506. X  
  507. X! /* Here come the first two lines... */
  508. X     putchar('|');
  509. X     for (i=0; i<7; i++) {
  510. X        FromJulian(OrigJul+i, &y, &m, &d);
  511. X--- 118,124 ----
  512. X  
  513. X  /* Output the entries */
  514. X  
  515. X! /* Here come the first few lines... */
  516. X     putchar('|');
  517. X     for (i=0; i<7; i++) {
  518. X        FromJulian(OrigJul+i, &y, &m, &d);
  519. X***************
  520. X*** 131,144 ****
  521. X        putchar('|');
  522. X     }
  523. X     putchar('\n');
  524. X! /*** Take out blank line in weekly calendar display - takes up room
  525. X!    putchar('|');
  526. X!    for (i=0; i<7; i++) {
  527. X!       PrintLeft("", ColSpaces, ' ');
  528. X        putchar('|');
  529. X     }
  530. X!    putchar('\n');
  531. X! ***/
  532. X  /* Write the body lines */
  533. X     done = 0;
  534. X     while (!done) {
  535. X--- 131,145 ----
  536. X        putchar('|');
  537. X     }
  538. X     putchar('\n');
  539. X!    for (l=0; l<CalPad; l++) {
  540. X        putchar('|');
  541. X+       for (i=0; i<7; i++) {
  542. X+          PrintLeft("", ColSpaces, ' ');
  543. X+          putchar('|');
  544. X+       }
  545. X+       putchar('\n');
  546. X     }
  547. X! 
  548. X  /* Write the body lines */
  549. X     done = 0;
  550. X     while (!done) {
  551. X***************
  552. X*** 147,153 ****
  553. X     }
  554. X  
  555. X  /* Write any blank lines required */
  556. X!    while (LinesWritten++ < CAL_LINES) {
  557. X        putchar('|');
  558. X        for (i=0; i<7; i++) {
  559. X           PrintLeft("", ColSpaces, ' ');
  560. X--- 148,154 ----
  561. X     }
  562. X  
  563. X  /* Write any blank lines required */
  564. X!    while (LinesWritten++ < CalLines) {
  565. X        putchar('|');
  566. X        for (i=0; i<7; i++) {
  567. X           PrintLeft("", ColSpaces, ' ');
  568. X***************
  569. X*** 213,219 ****
  570. X  static int WriteCalendarRow()
  571. X  #endif
  572. X  {
  573. X!    int y, m, d, wd, i;
  574. X     int done;
  575. X     char buf[81];
  576. X     int OrigJul = JulianToday;
  577. X--- 214,220 ----
  578. X  static int WriteCalendarRow()
  579. X  #endif
  580. X  {
  581. X!    int y, m, d, wd, i, l;
  582. X     int done;
  583. X     char buf[81];
  584. X     int OrigJul = JulianToday;
  585. X***************
  586. X*** 241,247 ****
  587. X     }
  588. X   
  589. X  
  590. X! /* Here come the first two lines... */
  591. X     putchar('|');
  592. X     for (i=0; i<7; i++) {
  593. X        if (i < wd || d+i-wd>DaysInMonth(m, y))
  594. X--- 242,248 ----
  595. X     }
  596. X   
  597. X  
  598. X! /* Here come the first few lines... */
  599. X     putchar('|');
  600. X     for (i=0; i<7; i++) {
  601. X        if (i < wd || d+i-wd>DaysInMonth(m, y))
  602. X***************
  603. X*** 253,264 ****
  604. X        putchar('|');
  605. X     }
  606. X     putchar('\n');
  607. X!    putchar('|');
  608. X!    for (i=0; i<7; i++) {
  609. X!       PrintLeft("", ColSpaces, ' ');
  610. X        putchar('|');
  611. X     }
  612. X-    putchar('\n');
  613. X  
  614. X  /* Write the body lines */
  615. X     done = 0;
  616. X--- 254,267 ----
  617. X        putchar('|');
  618. X     }
  619. X     putchar('\n');
  620. X!    for (l=0; l<CalPad; l++) {
  621. X        putchar('|');
  622. X+       for (i=0; i<7; i++) {
  623. X+          PrintLeft("", ColSpaces, ' ');
  624. X+          putchar('|');
  625. X+       }
  626. X+       putchar('\n');
  627. X     }
  628. X  
  629. X  /* Write the body lines */
  630. X     done = 0;
  631. X***************
  632. X*** 268,274 ****
  633. X     }
  634. X  
  635. X  /* Write any blank lines required */
  636. X!    while (LinesWritten++ < CAL_LINES) {
  637. X        putchar('|');
  638. X        for (i=0; i<7; i++) {
  639. X           PrintLeft("", ColSpaces, ' ');
  640. X--- 271,277 ----
  641. X     }
  642. X  
  643. X  /* Write any blank lines required */
  644. X!    while (LinesWritten++ < CalLines) {
  645. X        putchar('|');
  646. X        for (i=0; i<7; i++) {
  647. X           PrintLeft("", ColSpaces, ' ');
  648. X***************
  649. X*** 615,620 ****
  650. X--- 618,627 ----
  651. X     /* Parse the trigger date and time */
  652. X     if (r=ParseRem(p, &trig, &tim)) return r;
  653. X  
  654. X+ /* Don't include timed reminders in calendar if -a option supplied. */
  655. X+ #ifdef HAVE_QUEUED
  656. X+    if (DontIssueAts && tim.ttime != NO_TIME) return OK;
  657. X+ #endif
  658. X     if (trig.typ == NO_TYPE) return E_EOLN;
  659. X     if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
  660. X     /* Calculate the trigger date */
  661. X***************
  662. X*** 666,672 ****
  663. X  
  664. X     FromJulian(jul, &y, &m, &d);
  665. X     while(e) {
  666. X!       printf("%04d/%02d/%02d ", y, m+1, d);
  667. X        printf("%s\n", e->text);
  668. X        free(e->text);
  669. X        n = e->next;
  670. X--- 673,679 ----
  671. X  
  672. X     FromJulian(jul, &y, &m, &d);
  673. X     while(e) {
  674. X!       printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
  675. X        printf("%s\n", e->text);
  676. X        free(e->text);
  677. X        n = e->next;
  678. X***************
  679. X*** 812,815 ****
  680. X        }
  681. X     }
  682. X  }
  683. X- 
  684. X--- 819,821 ----
  685. X*** ../patch1/config.h    Wed Dec 16 10:51:23 1992
  686. X--- ./config.h    Mon Feb  1 12:21:15 1993
  687. X***************
  688. X*** 7,15 ****
  689. X  /*  care of certain system dependencies.                       */
  690. X  /*                                                             */
  691. X  /*  This file is part of REMIND.                               */
  692. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  693. X  /*                                                             */
  694. X  /***************************************************************/
  695. X  
  696. X  /*---------------------------------------------------------------------*/
  697. X  /* STRSTR:  If your system does not have the "strstr" function,        */
  698. X--- 7,29 ----
  699. X  /*  care of certain system dependencies.                       */
  700. X  /*                                                             */
  701. X  /*  This file is part of REMIND.                               */
  702. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  703. X  /*                                                             */
  704. X  /***************************************************************/
  705. X+ 
  706. X+ /*---------------------------------------------------------------------*/
  707. X+ /* DATESEP:  The default date separator.  North American usage is '/'; */
  708. X+ /* others may prefer '-'.                                              */
  709. X+ /*---------------------------------------------------------------------*/
  710. X+ #define DATESEP '/'
  711. X+ /* #define DATESEP '-' */
  712. X+ 
  713. X+ /*---------------------------------------------------------------------*/
  714. X+ /* WANT_U_OPTION: Comment out the next define to permanently disable   */
  715. X+ /* the -u option.  If you do this, however, remind-all.[c]sh will not  */
  716. X+ /* work.                                                               */
  717. X+ /*---------------------------------------------------------------------*/
  718. X+ #define WANT_U_OPTION 1
  719. X  
  720. X  /*---------------------------------------------------------------------*/
  721. X  /* STRSTR:  If your system does not have the "strstr" function,        */
  722. X*** ../patch1/defs.rem    Wed Dec 16 10:51:58 1992
  723. X--- ./defs.rem    Fri Jan  8 13:26:17 1993
  724. X***************
  725. X*** 6,12 ****
  726. X  # Cut and paste as desired!
  727. X  #
  728. X  # This file is part of REMIND.
  729. X! # Copyright (C) 1992 by David F. Skoll
  730. X  #
  731. X  # ---------------------------------------------------------------------------
  732. X  
  733. X--- 6,12 ----
  734. X  # Cut and paste as desired!
  735. X  #
  736. X  # This file is part of REMIND.
  737. X! # Copyright (C) 1992, 1993 by David F. Skoll
  738. X  #
  739. X  # ---------------------------------------------------------------------------
  740. X  
  741. X*** ../patch1/dorem.c    Wed Dec 16 10:51:30 1992
  742. X--- ./dorem.c    Fri Jan 22 10:25:12 1993
  743. X***************
  744. X*** 7,13 ****
  745. X  /*  commands.                                                  */
  746. X  /*                                                             */
  747. X  /*  This file is part of REMIND.                               */
  748. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  749. X  /*                                                             */
  750. X  /***************************************************************/
  751. X  #include "config.h"
  752. X--- 7,13 ----
  753. X  /*  commands.                                                  */
  754. X  /*                                                             */
  755. X  /*  This file is part of REMIND.                               */
  756. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  757. X  /*                                                             */
  758. X  /***************************************************************/
  759. X  #include "config.h"
  760. X***************
  761. X*** 415,421 ****
  762. X        if (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) return r;
  763. X        if (!*SubstBuffer) return OK;
  764. X        FromJulian(jul, &y, &m, &d);
  765. X!       printf("%04d/%02d/%02d %s%s\n", y, m+1, d,
  766. X                                        SimpleTime(tim->ttime, NULL),
  767. X                                        SubstBuffer);
  768. X        return OK;
  769. X--- 415,421 ----
  770. X        if (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) return r;
  771. X        if (!*SubstBuffer) return OK;
  772. X        FromJulian(jul, &y, &m, &d);
  773. X!       printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
  774. X                                        SimpleTime(tim->ttime, NULL),
  775. X                                        SubstBuffer);
  776. X        return OK;
  777. X*** ../patch1/dosubst.c    Wed Dec 16 10:51:30 1992
  778. X--- ./dosubst.c    Mon Jan 25 16:09:28 1993
  779. X***************
  780. X*** 6,14 ****
  781. X  /*  reminders are triggered.                                   */
  782. X  /*                                                             */
  783. X  /*  This file is part of REMIND.                               */
  784. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  785. X  /*                                                             */
  786. X  /***************************************************************/
  787. X  #include "config.h"
  788. X  #include <stdio.h>
  789. X  #include <ctype.h>
  790. X--- 6,15 ----
  791. X  /*  reminders are triggered.                                   */
  792. X  /*                                                             */
  793. X  /*  This file is part of REMIND.                               */
  794. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  795. X  /*                                                             */
  796. X  /***************************************************************/
  797. X+ #define L_IN_DOSUBST
  798. X  #include "config.h"
  799. X  #include <stdio.h>
  800. X  #include <ctype.h>
  801. X***************
  802. X*** 29,36 ****
  803. X  #define NL "\n"
  804. X  #endif
  805. X  
  806. X! static char TODAY[] = "today";
  807. X! static char TOMORROW[] = "tomorrow";
  808. X  
  809. X  /***************************************************************/
  810. X  /*                                                             */
  811. X--- 30,37 ----
  812. X  #define NL "\n"
  813. X  #endif
  814. X  
  815. X! static char TODAY[] = L_TODAY;
  816. X! static char TOMORROW[] = L_TOMORROW;
  817. X  
  818. X  /***************************************************************/
  819. X  /*                                                             */
  820. X***************
  821. X*** 74,82 ****
  822. X     adiff = ABS(tdiff);
  823. X     mdiff = adiff % 60;
  824. X     hdiff = adiff / 60;
  825. X!    mplu = (mdiff == 1 ? "" : "s");
  826. X!    hplu = (hdiff == 1 ? "" : "s");
  827. X!    when = (tdiff < 0 ? "ago" : "from now");
  828. X     
  829. X     h = tim / 60;
  830. X     min = tim % 60;
  831. X--- 75,83 ----
  832. X     adiff = ABS(tdiff);
  833. X     mdiff = adiff % 60;
  834. X     hdiff = adiff / 60;
  835. X!    mplu = (mdiff == 1 ? "" : L_MPLU);
  836. X!    hplu = (hdiff == 1 ? "" : L_HPLU);
  837. X!    when = (tdiff < 0 ? L_AGO : L_FROMNOW);
  838. X     
  839. X     h = tim / 60;
  840. X     min = tim % 60;
  841. X***************
  842. X*** 90,95 ****
  843. X--- 91,99 ----
  844. X     cpm = (ch < 12) ? "am" : "pm";
  845. X     chh = (ch == 12) ? 12 : ch % 12;
  846. X  
  847. X+ #ifdef L_ORDINAL_OVERRIDE
  848. X+ L_ORDINAL_OVERRIDE
  849. X+ #else
  850. X     switch(d) {
  851. X        case 1:
  852. X        case 21:
  853. X***************
  854. X*** 103,109 ****
  855. X        
  856. X        default: plu = "th"; break;
  857. X     }
  858. X!       
  859. X     
  860. X     while(1) {
  861. X        c = ParseChar(p, &err, 0);
  862. X--- 107,113 ----
  863. X        
  864. X        default: plu = "th"; break;
  865. X     }
  866. X! #endif      
  867. X     
  868. X     while(1) {
  869. X        c = ParseChar(p, &err, 0);
  870. X***************
  871. X*** 128,146 ****
  872. X        done = 0;
  873. X        if (diff <= 1) {
  874. X           switch(UPPER(c)) {
  875. X              case 'A':
  876. X              case 'B':
  877. X          case 'C':
  878. X          case 'E':
  879. X          case 'F':
  880. X          case 'G':
  881. X          case 'H':
  882. X          case 'I':
  883. X          case 'J':
  884. X          case 'K':
  885. X          case 'L':
  886. X          case 'U':
  887. X!         case 'V': sprintf(s, "%s", (diff ? TOMORROW : TODAY));
  888. X                   s += strlen(s);
  889. X                   done = 1;
  890. X                    break;
  891. X--- 132,177 ----
  892. X        done = 0;
  893. X        if (diff <= 1) {
  894. X           switch(UPPER(c)) {
  895. X+ #ifndef L_NOTOMORROW_A
  896. X              case 'A':
  897. X+ #endif
  898. X+ #ifndef L_NOTOMORROW_B
  899. X              case 'B':
  900. X+ #endif
  901. X+ #ifndef L_NOTOMORROW_C
  902. X          case 'C':
  903. X+ #endif
  904. X+ #ifndef L_NOTOMORROW_E
  905. X          case 'E':
  906. X+ #endif
  907. X+ #ifndef L_NOTOMORROW_F
  908. X          case 'F':
  909. X+ #endif
  910. X+ #ifndef L_NOTOMORROW_G
  911. X          case 'G':
  912. X+ #endif
  913. X+ #ifndef L_NOTOMORROW_H
  914. X          case 'H':
  915. X+ #endif
  916. X+ #ifndef L_NOTOMORROW_I
  917. X          case 'I':
  918. X+ #endif
  919. X+ #ifndef L_NOTOMORROW_J
  920. X          case 'J':
  921. X+ #endif
  922. X+ #ifndef L_NOTOMORROW_K
  923. X          case 'K':
  924. X+ #endif
  925. X+ #ifndef L_NOTOMORROW_L
  926. X          case 'L':
  927. X+ #endif
  928. X+ #ifndef L_NOTOMORROW_U
  929. X          case 'U':
  930. X! #endif
  931. X! #ifndef L_NOTOMORROW_V
  932. X!         case 'V':
  933. X! #endif
  934. X!                      sprintf(s, "%s", (diff ? TOMORROW : TODAY));
  935. X                   s += strlen(s);
  936. X                   done = 1;
  937. X                    break;
  938. X***************
  939. X*** 151,348 ****
  940. X       
  941. X        if (!done) switch(UPPER(c)) {
  942. X           case 'A':
  943. X!             sprintf(s, "on %s, %d %s, %d", DayName[jul%7], d,
  944. X              MonthName[m], y);
  945. X              s += strlen(s);
  946. X          break;
  947. X             
  948. X       case 'B':
  949. X!             sprintf(s, "in %d days' time", diff);
  950. X          s += strlen(s);
  951. X              break;
  952. X             
  953. X       case 'C':
  954. X!         sprintf(s, "on %s", DayName[jul%7]);
  955. X          s += strlen(s);
  956. X          break;
  957. X  
  958. X       case 'D':
  959. X          sprintf(s, "%d", d);
  960. X          s += strlen(s);
  961. X          break;
  962. X  
  963. X       case 'E':
  964. X!         sprintf(s, "on %02d/%02d/%04d", d, m+1, y);
  965. X          s += strlen(s);
  966. X          break;
  967. X  
  968. X       case 'F':
  969. X!         sprintf(s, "on %02d/%02d/%04d", m+1, d, y);
  970. X          s += strlen(s);
  971. X          break;
  972. X  
  973. X       case 'G':
  974. X!         sprintf(s, "on %s, %d %s", DayName[jul%7], d, MonthName[m]);
  975. X          s += strlen(s);
  976. X          break;
  977. X  
  978. X       case 'H':
  979. X!         sprintf(s, "on %02d/%02d", d, m+1);
  980. X          s += strlen(s);
  981. X          break;
  982. X  
  983. X       case 'I':
  984. X!         sprintf(s, "on %02d/%02d", m+1, d);
  985. X          s += strlen(s);
  986. X          break;
  987. X  
  988. X       case 'J':
  989. X!         sprintf(s, "on %s, %s %d%s, %d", DayName[jul%7],
  990. X                 MonthName[m], d, plu, y);
  991. X          s += strlen(s);
  992. X          break;
  993. X  
  994. X       case 'K':
  995. X!         sprintf(s, "on %s, %s %d%s", DayName[jul%7],
  996. X                 MonthName[m], d, plu);
  997. X          s += strlen(s);
  998. X          break;
  999. X  
  1000. X       case 'L':
  1001. X!         sprintf(s, "on %04d/%02d/%02d", y, m+1, d);
  1002. X          s += strlen(s);
  1003. X          break;
  1004. X  
  1005. X       case 'M':
  1006. X          sprintf(s, "%s", MonthName[m]);
  1007. X          s += strlen(s);
  1008. X          break;
  1009. X  
  1010. X       case 'N':
  1011. X          sprintf(s, "%d", m+1);
  1012. X          s += strlen(s);
  1013. X          break;
  1014. X  
  1015. X       case 'O':
  1016. X!         if (RealToday == JulianToday) sprintf(s, " (today)");
  1017. X          s += strlen(s);
  1018. X          break;
  1019. X  
  1020. X       case 'P':
  1021. X!         sprintf(s, (diff == 1 ? "" : "s"));
  1022. X          s += strlen(s);
  1023. X          break;
  1024. X  
  1025. X       case 'Q':
  1026. X          sprintf(s, (diff == 1 ? "'s" : "s'"));
  1027. X          s += strlen(s);
  1028. X          break;
  1029. X  
  1030. X       case 'R':
  1031. X          sprintf(s, "%02d", d);
  1032. X          s += strlen(s);
  1033. X          break;
  1034. X  
  1035. X       case 'S':
  1036. X          sprintf(s, plu);
  1037. X          s += strlen(s);
  1038. X          break;
  1039. X  
  1040. X       case 'T':
  1041. X          sprintf(s, "%02d", m+1);
  1042. X          s += strlen(s);
  1043. X          break;
  1044. X  
  1045. X       case 'U':
  1046. X!         sprintf(s, "on %s, %d%s %s, %d", DayName[jul%7], d,
  1047. X                 plu, MonthName[m], y);
  1048. X          s += strlen(s);
  1049. X          break;
  1050. X  
  1051. X       case 'V':
  1052. X!         sprintf(s, "on %s, %d%s %s", DayName[jul%7], d, plu,
  1053. X                 MonthName[m]);
  1054. X          s += strlen(s);
  1055. X          break;
  1056. X  
  1057. X       case 'W':
  1058. X          sprintf(s, DayName[jul%7]);
  1059. X          s += strlen(s);
  1060. X          break;
  1061. X  
  1062. X       case 'X':
  1063. X          sprintf(s, "%d", diff);
  1064. X          s += strlen(s);
  1065. X          break;
  1066. X  
  1067. X       case 'Y':
  1068. X          sprintf(s, "%d", y);
  1069. X          s += strlen(s);
  1070. X          break;
  1071. X  
  1072. X       case 'Z':
  1073. X          sprintf(s, "%d", y % 100);
  1074. X          s += strlen(s);
  1075. X          break;
  1076. X  
  1077. X       case '1':
  1078. X          if (tdiff == 0) 
  1079. X!            sprintf(s, "now");
  1080. X          else if (hdiff == 0) 
  1081. X!            sprintf(s, "%d minute%s %s", mdiff, mplu, when);
  1082. X          else if (mdiff == 0)
  1083. X!            sprintf(s, "%d hour%s %s", hdiff, hplu, when);
  1084. X          else
  1085. X!            sprintf(s, "%d hour%s and %d minute%s %s", hdiff, hplu, mdiff, mplu, when);
  1086. X          s += strlen(s);
  1087. X          break;
  1088. X  
  1089. X       case '2':
  1090. X!         sprintf(s, "at %d:%02d%s", hh, min, pm);
  1091. X          s += strlen(s);
  1092. X          break;
  1093. X  
  1094. X!      case '3': sprintf(s, "at %02d:%02d", h, min);
  1095. X          s += strlen(s);
  1096. X          break;
  1097. X  
  1098. X!      case '4': sprintf(s, "%d", tdiff);
  1099. X          s += strlen(s);
  1100. X          break;
  1101. X  
  1102. X!      case '5': sprintf(s, "%d", adiff);
  1103. X          s += strlen(s);
  1104. X          break;
  1105. X  
  1106. X!      case '6': sprintf(s, when);
  1107. X          s += strlen(s);
  1108. X          break;
  1109. X  
  1110. X!      case '7': sprintf(s, "%d", hdiff);
  1111. X          s += strlen(s);
  1112. X          break;
  1113. X  
  1114. X!      case '8': sprintf(s, "%d", mdiff);
  1115. X          s += strlen(s);
  1116. X          break;
  1117. X  
  1118. X!      case '9': sprintf(s, mplu);
  1119. X          s += strlen(s);
  1120. X          break;
  1121. X  
  1122. X!      case '0': sprintf(s, hplu);
  1123. X          s += strlen(s);
  1124. X          break;
  1125. X  
  1126. X!      case '!': sprintf(s, (tdiff >= 0 ? "is" : "was"));
  1127. X          s += strlen(s);
  1128. X          break;
  1129. X  
  1130. X!      case '@': sprintf(s, "%d:%02d%s", chh, cmin, cpm);
  1131. X          s += strlen(s);
  1132. X          break;
  1133. X  
  1134. X!      case '#': sprintf(s, "%02d:%02d", ch, cmin);
  1135. X          s += strlen(s);
  1136. X          break;
  1137. X  
  1138. X--- 182,549 ----
  1139. X       
  1140. X        if (!done) switch(UPPER(c)) {
  1141. X           case 'A':
  1142. X! #ifdef L_A_OVER
  1143. X! L_A_OVER
  1144. X! #else     
  1145. X!             sprintf(s, "%s %s, %d %s, %d", L_ON, DayName[jul%7], d,
  1146. X              MonthName[m], y);
  1147. X+ #endif
  1148. X              s += strlen(s);
  1149. X          break;
  1150. X             
  1151. X       case 'B':
  1152. X! #ifdef L_B_OVER
  1153. X! L_B_OVER
  1154. X! #else     
  1155. X!             sprintf(s, L_INXDAYS, diff);
  1156. X! #endif
  1157. X          s += strlen(s);
  1158. X              break;
  1159. X             
  1160. X       case 'C':
  1161. X! #ifdef L_C_OVER
  1162. X! L_C_OVER
  1163. X! #else     
  1164. X!         sprintf(s, "%s %s", L_ON, DayName[jul%7]);
  1165. X! #endif
  1166. X          s += strlen(s);
  1167. X          break;
  1168. X  
  1169. X       case 'D':
  1170. X+ #ifdef L_D_OVER
  1171. X+ L_D_OVER
  1172. X+ #else     
  1173. X          sprintf(s, "%d", d);
  1174. X+ #endif
  1175. X          s += strlen(s);
  1176. X          break;
  1177. X  
  1178. X       case 'E':
  1179. X! #ifdef L_E_OVER
  1180. X! L_E_OVER
  1181. X! #else     
  1182. X!         sprintf(s, "%s %02d%c%02d%c%04d", L_ON, d, DATESEP,
  1183. X!             m+1, DATESEP, y);
  1184. X! #endif
  1185. X          s += strlen(s);
  1186. X          break;
  1187. X  
  1188. X       case 'F':
  1189. X! #ifdef L_F_OVER
  1190. X! L_F_OVER
  1191. X! #else     
  1192. X!         sprintf(s, "%s %02d%c%02d%c%04d", L_ON, m+1, DATESEP, d, DATESEP, y);
  1193. X! #endif
  1194. X          s += strlen(s);
  1195. X          break;
  1196. X  
  1197. X       case 'G':
  1198. X! #ifdef L_G_OVER
  1199. X! L_G_OVER
  1200. X! #else     
  1201. X!         sprintf(s, "%s %s, %d %s", L_ON, DayName[jul%7], d, MonthName[m]);
  1202. X! #endif
  1203. X          s += strlen(s);
  1204. X          break;
  1205. X  
  1206. X       case 'H':
  1207. X! #ifdef L_H_OVER
  1208. X! L_H_OVER
  1209. X! #else     
  1210. X!         sprintf(s, "%s %02d%c%02d", L_ON, d, DATESEP, m+1);
  1211. X! #endif
  1212. X          s += strlen(s);
  1213. X          break;
  1214. X  
  1215. X       case 'I':
  1216. X! #ifdef L_I_OVER
  1217. X! L_I_OVER
  1218. X! #else     
  1219. X!         sprintf(s, "%s %02d%c%02d", L_ON, m+1, DATESEP, d);
  1220. X! #endif
  1221. X          s += strlen(s);
  1222. X          break;
  1223. X  
  1224. X       case 'J':
  1225. X! #ifdef L_J_OVER
  1226. X! L_J_OVER
  1227. X! #else
  1228. X!         sprintf(s, "%s %s, %s %d%s, %d", L_ON, DayName[jul%7],
  1229. X                 MonthName[m], d, plu, y);
  1230. X+ #endif
  1231. X          s += strlen(s);
  1232. X          break;
  1233. X  
  1234. X       case 'K':
  1235. X! #ifdef L_K_OVER
  1236. X! L_K_OVER
  1237. X! #else
  1238. X!         sprintf(s, "%s %s, %s %d%s", L_ON, DayName[jul%7],
  1239. X                 MonthName[m], d, plu);
  1240. X+ #endif
  1241. X          s += strlen(s);
  1242. X          break;
  1243. X  
  1244. X       case 'L':
  1245. X! #ifdef L_L_OVER
  1246. X! L_L_OVER
  1247. X! #else
  1248. X!         sprintf(s, "%s %04d%c%02d%c%02d", L_ON, y, DATESEP, m+1, DATESEP, d);
  1249. X! #endif
  1250. X          s += strlen(s);
  1251. X          break;
  1252. X  
  1253. X       case 'M':
  1254. X+ #ifdef L_M_OVER
  1255. X+ L_M_OVER
  1256. X+ #else
  1257. X          sprintf(s, "%s", MonthName[m]);
  1258. X+ #endif
  1259. X          s += strlen(s);
  1260. X          break;
  1261. X  
  1262. X       case 'N':
  1263. X+ #ifdef L_N_OVER
  1264. X+ L_N_OVER
  1265. X+ #else
  1266. X          sprintf(s, "%d", m+1);
  1267. X+ #endif
  1268. X          s += strlen(s);
  1269. X          break;
  1270. X  
  1271. X       case 'O':
  1272. X! #ifdef L_O_OVER
  1273. X! L_O_OVER
  1274. X! #else
  1275. X!         if (RealToday == JulianToday) sprintf(s, " (%s)", L_TODAY);
  1276. X! #endif
  1277. X          s += strlen(s);
  1278. X          break;
  1279. X  
  1280. X       case 'P':
  1281. X! #ifdef L_P_OVER
  1282. X! L_P_OVER
  1283. X! #else
  1284. X!         sprintf(s, (diff == 1 ? "" : L_PLURAL));
  1285. X! #endif
  1286. X          s += strlen(s);
  1287. X          break;
  1288. X  
  1289. X       case 'Q':
  1290. X+ #ifdef L_Q_OVER
  1291. X+ L_Q_OVER
  1292. X+ #else
  1293. X          sprintf(s, (diff == 1 ? "'s" : "s'"));
  1294. X+ #endif
  1295. X          s += strlen(s);
  1296. X          break;
  1297. X  
  1298. X       case 'R':
  1299. X+ #ifdef L_R_OVER
  1300. X+ L_R_OVER
  1301. X+ #else
  1302. X          sprintf(s, "%02d", d);
  1303. X+ #endif
  1304. X          s += strlen(s);
  1305. X          break;
  1306. X  
  1307. X       case 'S':
  1308. X+ #ifdef L_S_OVER
  1309. X+ L_S_OVER
  1310. X+ #else
  1311. X          sprintf(s, plu);
  1312. X+ #endif
  1313. X          s += strlen(s);
  1314. X          break;
  1315. X  
  1316. X       case 'T':
  1317. X+ #ifdef L_T_OVER
  1318. X+ L_T_OVER
  1319. X+ #else
  1320. X          sprintf(s, "%02d", m+1);
  1321. X+ #endif
  1322. X          s += strlen(s);
  1323. X          break;
  1324. X  
  1325. X       case 'U':
  1326. X! #ifdef L_U_OVER
  1327. X! L_U_OVER
  1328. X! #else
  1329. X!         sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], d,
  1330. X                 plu, MonthName[m], y);
  1331. X+ #endif
  1332. X          s += strlen(s);
  1333. X          break;
  1334. X  
  1335. X       case 'V':
  1336. X! #ifdef L_V_OVER
  1337. X! L_V_OVER
  1338. X! #else
  1339. X!         sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu,
  1340. X                 MonthName[m]);
  1341. X+ #endif
  1342. X          s += strlen(s);
  1343. X          break;
  1344. X  
  1345. X       case 'W':
  1346. X+ #ifdef L_W_OVER
  1347. X+ L_W_OVER
  1348. X+ #else
  1349. X          sprintf(s, DayName[jul%7]);
  1350. X+ #endif
  1351. X          s += strlen(s);
  1352. X          break;
  1353. X  
  1354. X       case 'X':
  1355. X+ #ifdef L_X_OVER
  1356. X+ L_X_OVER
  1357. X+ #else
  1358. X          sprintf(s, "%d", diff);
  1359. X+ #endif
  1360. X          s += strlen(s);
  1361. X          break;
  1362. X  
  1363. X       case 'Y':
  1364. X+ #ifdef L_Y_OVER
  1365. X+ L_Y_OVER
  1366. X+ #else
  1367. X          sprintf(s, "%d", y);
  1368. X+ #endif
  1369. X          s += strlen(s);
  1370. X          break;
  1371. X  
  1372. X       case 'Z':
  1373. X+ #ifdef L_Z_OVER
  1374. X+ L_Z_OVER
  1375. X+ #else
  1376. X          sprintf(s, "%d", y % 100);
  1377. X+ #endif
  1378. X          s += strlen(s);
  1379. X          break;
  1380. X  
  1381. X       case '1':
  1382. X+ #ifdef L_1_OVER
  1383. X+ L_1_OVER
  1384. X+ #else
  1385. X          if (tdiff == 0) 
  1386. X!            sprintf(s, L_NOW);
  1387. X          else if (hdiff == 0) 
  1388. X!            sprintf(s, "%d %s%s %s", mdiff, L_MINUTE, mplu, when);
  1389. X          else if (mdiff == 0)
  1390. X!            sprintf(s, "%d %s%s %s", hdiff, L_HOUR, hplu, when);
  1391. X          else
  1392. X!            sprintf(s, "%d %s%s %s %d %s%s %s", hdiff, L_HOUR, hplu,
  1393. X!                                L_AND, mdiff, L_MINUTE, mplu, when);
  1394. X! #endif
  1395. X          s += strlen(s);
  1396. X          break;
  1397. X  
  1398. X       case '2':
  1399. X! #ifdef L_2_OVER
  1400. X! L_2_OVER
  1401. X! #else
  1402. X!         sprintf(s, "%s %d:%02d%s", L_AT, hh, min, pm);
  1403. X! #endif
  1404. X          s += strlen(s);
  1405. X          break;
  1406. X  
  1407. X!      case '3':
  1408. X! #ifdef L_3_OVER
  1409. X! L_3_OVER
  1410. X! #else
  1411. X! 
  1412. X!         sprintf(s, "%s %02d:%02d", L_AT, h, min);
  1413. X! #endif
  1414. X          s += strlen(s);
  1415. X          break;
  1416. X  
  1417. X!      case '4':
  1418. X! #ifdef L_4_OVER
  1419. X! L_4_OVER
  1420. X! #else
  1421. X!         sprintf(s, "%d", tdiff);
  1422. X! #endif
  1423. X          s += strlen(s);
  1424. X          break;
  1425. X  
  1426. X!      case '5':
  1427. X! #ifdef L_5_OVER
  1428. X! L_5_OVER
  1429. X! #else
  1430. X!         sprintf(s, "%d", adiff);
  1431. X! #endif
  1432. X          s += strlen(s);
  1433. X          break;
  1434. X  
  1435. X!      case '6':
  1436. X! #ifdef L_6_OVER
  1437. X! L_6_OVER
  1438. X! #else
  1439. X!         sprintf(s, when);
  1440. X! #endif
  1441. X          s += strlen(s);
  1442. X          break;
  1443. X  
  1444. X!      case '7':
  1445. X! #ifdef L_7_OVER
  1446. X! L_7_OVER
  1447. X! #else
  1448. X!         sprintf(s, "%d", hdiff);
  1449. X! #endif
  1450. X          s += strlen(s);
  1451. X          break;
  1452. X  
  1453. X!      case '8':
  1454. X! #ifdef L_8_OVER
  1455. X! L_8_OVER
  1456. X! #else
  1457. X!         sprintf(s, "%d", mdiff);
  1458. X! #endif
  1459. X          s += strlen(s);
  1460. X          break;
  1461. X  
  1462. X!      case '9':
  1463. X! #ifdef L_9_OVER
  1464. X! L_9_OVER
  1465. X! #else
  1466. X!         sprintf(s, mplu);
  1467. X! #endif
  1468. X          s += strlen(s);
  1469. X          break;
  1470. X  
  1471. X!      case '0':
  1472. X! #ifdef L_0_OVER
  1473. X! L_0_OVER
  1474. X! #else
  1475. X!         sprintf(s, hplu);
  1476. X! #endif
  1477. X          s += strlen(s);
  1478. X          break;
  1479. X  
  1480. X!      case '!':
  1481. X! #ifdef L_BANG_OVER
  1482. X! L_BANG_OVER
  1483. X! #else
  1484. X!         sprintf(s, (tdiff >= 0 ? L_IS : L_WAS));
  1485. X! #endif
  1486. X          s += strlen(s);
  1487. X          break;
  1488. X  
  1489. X!      case '@':
  1490. X! #ifdef L_AT_OVER
  1491. X! L_AT_OVER
  1492. X! #else
  1493. X!         sprintf(s, "%d:%02d%s", chh, cmin, cpm);
  1494. X! #endif
  1495. X          s += strlen(s);
  1496. X          break;
  1497. X  
  1498. X!      case '#':
  1499. X! #ifdef L_HASH_OVER
  1500. X! L_HASH_OVER
  1501. X! #else
  1502. X!         sprintf(s, "%02d:%02d", ch, cmin);
  1503. X! #endif
  1504. X          s += strlen(s);
  1505. X          break;
  1506. X  
  1507. X*** ../patch1/err.h    Wed Dec 16 10:51:24 1992
  1508. X--- ./err.h    Fri Jan  8 13:25:56 1993
  1509. X***************
  1510. X*** 5,11 ****
  1511. X  /*  Error definitions.                                         */
  1512. X  /*                                                             */
  1513. X  /*  This file is part of REMIND.                               */
  1514. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1515. X  /*                                                             */
  1516. X  /***************************************************************/
  1517. X  
  1518. X--- 5,11 ----
  1519. X  /*  Error definitions.                                         */
  1520. X  /*                                                             */
  1521. X  /*  This file is part of REMIND.                               */
  1522. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1523. X  /*                                                             */
  1524. X  /***************************************************************/
  1525. X  
  1526. X*** ../patch1/expr.c    Wed Dec 16 10:51:32 1992
  1527. X--- ./expr.c    Fri Jan 22 10:23:16 1993
  1528. X***************
  1529. X*** 5,11 ****
  1530. X  /*  This file contains routines to parse and evaluate          */
  1531. X  /*  expressions.                                               */
  1532. X  /*                                                             */
  1533. X! /*  Copyright 1992 by David F. Skoll.                          */
  1534. X  /*                                                             */
  1535. X  /***************************************************************/
  1536. X  
  1537. X--- 5,11 ----
  1538. X  /*  This file contains routines to parse and evaluate          */
  1539. X  /*  expressions.                                               */
  1540. X  /*                                                             */
  1541. X! /*  Copyright 1992, 1993 by David F. Skoll.                    */
  1542. X  /*                                                             */
  1543. X  /***************************************************************/
  1544. X  
  1545. X***************
  1546. X*** 604,610 ****
  1547. X              case TIM_TYPE: sprintf(CoerceBuf, "%02d:%02d", v->v.val / 60, v->v.val % 60);
  1548. X                 break;
  1549. X          case DATE_TYPE: FromJulian(v->v.val, &y, &m, &d);
  1550. X!                 sprintf(CoerceBuf, "%04d/%02d/%02d", y, m+1, d);
  1551. X                  break;
  1552. X              default: return E_CANT_COERCE;
  1553. X           }
  1554. X--- 604,611 ----
  1555. X              case TIM_TYPE: sprintf(CoerceBuf, "%02d:%02d", v->v.val / 60, v->v.val % 60);
  1556. X                 break;
  1557. X          case DATE_TYPE: FromJulian(v->v.val, &y, &m, &d);
  1558. X!                 sprintf(CoerceBuf, "%04d%c%02d%c%02d",
  1559. X!                     y, DATESEP, m+1, DATESEP, d);
  1560. X                  break;
  1561. X              default: return E_CANT_COERCE;
  1562. X           }
  1563. X***************
  1564. X*** 1176,1182 ****
  1565. X     else if (v->type == TIM_TYPE) fprintf(fp, "%02d:%02d", v->v.val / 60, v->v.val % 60);
  1566. X     else if (v->type == DATE_TYPE) {
  1567. X        FromJulian(v->v.val, &y, &m, &d);
  1568. X!       fprintf(fp, "%04d/%02d/%02d", y, m+1, d);
  1569. X     }
  1570. X     else fprintf(fp, "ERR");
  1571. X  }
  1572. X--- 1177,1183 ----
  1573. X     else if (v->type == TIM_TYPE) fprintf(fp, "%02d:%02d", v->v.val / 60, v->v.val % 60);
  1574. X     else if (v->type == DATE_TYPE) {
  1575. X        FromJulian(v->v.val, &y, &m, &d);
  1576. X!       fprintf(fp, "%04d%c%02d%c%02d", y, DATESEP, m+1, DATESEP, d);
  1577. X     }
  1578. X     else fprintf(fp, "ERR");
  1579. X  }
  1580. X***************
  1581. X*** 1233,1239 ****
  1582. X        y *= 10;
  1583. X        y += *(*s)++ - '0';
  1584. X     }
  1585. X!    if (*(*s)++ != '/') return E_BAD_DATE;
  1586. X     if (!isdigit(**s)) return E_BAD_DATE;
  1587. X     while (isdigit(**s)) {
  1588. X        m *= 10;
  1589. X--- 1234,1241 ----
  1590. X        y *= 10;
  1591. X        y += *(*s)++ - '0';
  1592. X     }
  1593. X!    if (**s != '/' && **s != '-') return E_BAD_DATE;
  1594. X!    (*s)++;
  1595. X     if (!isdigit(**s)) return E_BAD_DATE;
  1596. X     while (isdigit(**s)) {
  1597. X        m *= 10;
  1598. X***************
  1599. X*** 1240,1246 ****
  1600. X        m += *(*s)++ - '0';
  1601. X     }
  1602. X     m--;
  1603. X!    if (*(*s)++ != '/') return E_BAD_DATE;
  1604. X     if (!isdigit(**s)) return E_BAD_DATE;
  1605. X     while (isdigit(**s)) {
  1606. X        d *= 10;
  1607. X--- 1242,1249 ----
  1608. X        m += *(*s)++ - '0';
  1609. X     }
  1610. X     m--;
  1611. X!    if (**s != '/' && **s != '-') return E_BAD_DATE;
  1612. X!    (*s)++;
  1613. X     if (!isdigit(**s)) return E_BAD_DATE;
  1614. X     while (isdigit(**s)) {
  1615. X        d *= 10;
  1616. X*** ../patch1/expr.h    Wed Dec 16 10:51:24 1992
  1617. X--- ./expr.h    Fri Jan  8 13:25:45 1993
  1618. X***************
  1619. X*** 5,11 ****
  1620. X  /*  Contains a few definitions used by expression evaluator.   */
  1621. X  /*                                                             */
  1622. X  /*  This file is part of REMIND.                               */
  1623. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1624. X  /*                                                             */
  1625. X  /***************************************************************/
  1626. X  
  1627. X--- 5,11 ----
  1628. X  /*  Contains a few definitions used by expression evaluator.   */
  1629. X  /*                                                             */
  1630. X  /*  This file is part of REMIND.                               */
  1631. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1632. X  /*                                                             */
  1633. X  /***************************************************************/
  1634. X  
  1635. X*** ../patch1/files.c    Wed Dec 16 10:51:33 1992
  1636. X--- ./files.c    Fri Jan  8 13:25:39 1993
  1637. X***************
  1638. X*** 7,13 ****
  1639. X  /*  files.                                                     */
  1640. X  /*                                                             */
  1641. X  /*  This file is part of REMIND.                               */
  1642. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1643. X  /*                                                             */
  1644. X  /***************************************************************/
  1645. X  
  1646. X--- 7,13 ----
  1647. X  /*  files.                                                     */
  1648. X  /*                                                             */
  1649. X  /*  This file is part of REMIND.                               */
  1650. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1651. X  /*                                                             */
  1652. X  /***************************************************************/
  1653. X  
  1654. X*** ../patch1/funcs.c    Wed Dec 16 10:51:34 1992
  1655. X--- ./funcs.c    Fri Jan 22 10:03:07 1993
  1656. X***************
  1657. X*** 6,12 ****
  1658. X  /*  expressions.                                               */
  1659. X  /*                                                             */
  1660. X  /*  This file is part of REMIND.                               */
  1661. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1662. X  /*                                                             */
  1663. X  /***************************************************************/
  1664. X  #include "config.h"
  1665. X--- 6,12 ----
  1666. X  /*  expressions.                                               */
  1667. X  /*                                                             */
  1668. X  /*  This file is part of REMIND.                               */
  1669. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1670. X  /*                                                             */
  1671. X  /***************************************************************/
  1672. X  #include "config.h"
  1673. X***************
  1674. X*** 62,67 ****
  1675. X--- 62,68 ----
  1676. X  PRIVATE    int    FIif        ARGS ((void));
  1677. X  PRIVATE    int    FIndex        ARGS ((void));
  1678. X  PRIVATE    int    FIsomitted    ARGS ((void));
  1679. X+ PRIVATE    int    FLanguage    ARGS ((void));
  1680. X  PRIVATE    int    FMax        ARGS ((void));
  1681. X  PRIVATE    int    FMin        ARGS ((void));
  1682. X  PRIVATE    int    FMinute        ARGS ((void));
  1683. X***************
  1684. X*** 151,156 ****
  1685. X--- 152,158 ----
  1686. X      {   "index",    2,    3,    FIndex     },
  1687. X      {   "isleap",    1,    1,    FIsleap },
  1688. X      {   "isomitted",    1,    1,    FIsomitted },
  1689. X+     {   "language",     0,      0,      FLanguage },
  1690. X      {   "lower",    1,    1,    FLower    },
  1691. X      {   "max",        1,    NO_MAX,    FMax    },
  1692. X      {   "min",        1,    NO_MAX, FMin    },
  1693. X***************
  1694. X*** 1416,1419 ****
  1695. X--- 1418,1437 ----
  1696. X        case STR_TYPE:  return RetStrVal("STRING");
  1697. X        default:        return RetStrVal("ERR");
  1698. X     }
  1699. X+ }
  1700. X+ 
  1701. X+ /***************************************************************/
  1702. X+ /*                                                             */
  1703. X+ /*  FLanguage                                                  */
  1704. X+ /*                                                             */
  1705. X+ /*  Implement the language() function.                         */
  1706. X+ /*                                                             */
  1707. X+ /***************************************************************/
  1708. X+ #ifdef HAVE_PROTOS
  1709. X+ PRIVATE int FLanguage(void)
  1710. X+ #else
  1711. X+ static int FLanguage()
  1712. X+ #endif
  1713. X+ {
  1714. X+    return RetStrVal(L_LANGNAME);
  1715. X  }
  1716. X*** ../patch1/globals.c    Wed Dec 16 10:51:34 1992
  1717. X--- ./globals.c    Thu Jan 21 16:50:15 1993
  1718. X***************
  1719. X*** 8,14 ****
  1720. X  /*  globals.h and err.h                                        */
  1721. X  /*                                                             */
  1722. X  /*  This file is part of REMIND.                               */
  1723. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1724. X  /*                                                             */
  1725. X  /***************************************************************/
  1726. X  #include "config.h"
  1727. X--- 8,14 ----
  1728. X  /*  globals.h and err.h                                        */
  1729. X  /*                                                             */
  1730. X  /*  This file is part of REMIND.                               */
  1731. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1732. X  /*                                                             */
  1733. X  /***************************************************************/
  1734. X  #include "config.h"
  1735. X*** ../patch1/globals.h    Wed Dec 16 10:51:25 1992
  1736. X--- ./globals.h    Thu Jan 21 16:02:55 1993
  1737. X***************
  1738. X*** 7,16 ****
  1739. X  /*  MK_GLOBALS.  Also contains useful macro definitions.       */
  1740. X  /*                                                             */
  1741. X  /*  This file is part of REMIND.                               */
  1742. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1743. X  /*                                                             */
  1744. X  /***************************************************************/
  1745. X! 
  1746. X  #ifdef MK_GLOBALS
  1747. X  #undef EXTERN
  1748. X  #define EXTERN
  1749. X--- 7,16 ----
  1750. X  /*  MK_GLOBALS.  Also contains useful macro definitions.       */
  1751. X  /*                                                             */
  1752. X  /*  This file is part of REMIND.                               */
  1753. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1754. X  /*                                                             */
  1755. X  /***************************************************************/
  1756. X! #include "lang.h"
  1757. X  #ifdef MK_GLOBALS
  1758. X  #undef EXTERN
  1759. X  #define EXTERN
  1760. X***************
  1761. X*** 49,55 ****
  1762. X  EXTERN  INIT(    char    InfiniteDelta, 0);
  1763. X  EXTERN  INIT(   char    RunDisabled, 0);
  1764. X  EXTERN  INIT(   char    IgnoreOnce, 0);
  1765. X! EXTERN  INIT(   char    Banner[LINELEN], "Reminders for %w, %d%s %m, %y%o:");
  1766. X  EXTERN    char    *InitialFile;
  1767. X  EXTERN    int    FileAccessDate;
  1768. X  
  1769. X--- 49,55 ----
  1770. X  EXTERN  INIT(    char    InfiniteDelta, 0);
  1771. X  EXTERN  INIT(   char    RunDisabled, 0);
  1772. X  EXTERN  INIT(   char    IgnoreOnce, 0);
  1773. X! EXTERN  INIT(   char    Banner[LINELEN], L_BANNER);
  1774. X  EXTERN    char    *InitialFile;
  1775. X  EXTERN    int    FileAccessDate;
  1776. X  
  1777. X***************
  1778. X*** 76,94 ****
  1779. X  EXTERN  INIT(   int     NumTriggered, 0);
  1780. X  EXTERN  int ArgC;
  1781. X  EXTERN  char **ArgV;
  1782. X  
  1783. X  /* List of months */
  1784. X  EXTERN    char    *MonthName[]
  1785. X  #ifdef MK_GLOBALS
  1786. X! = {"January", "February", "March", "April", "May", "June",
  1787. X!    "July", "August", "September", "October", "November", "December" }
  1788. X  #endif
  1789. X  ;
  1790. X  
  1791. X  EXTERN    char    *DayName[]
  1792. X  #ifdef MK_GLOBALS
  1793. X! = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
  1794. X!    "Sunday"}
  1795. X  #endif
  1796. X  ;
  1797. X  
  1798. X--- 76,96 ----
  1799. X  EXTERN  INIT(   int     NumTriggered, 0);
  1800. X  EXTERN  int ArgC;
  1801. X  EXTERN  char **ArgV;
  1802. X+ EXTERN  INIT(   int     CalLines, CAL_LINES);
  1803. X+ EXTERN  INIT(   int     CalPad, 1);
  1804. X  
  1805. X  /* List of months */
  1806. X  EXTERN    char    *MonthName[]
  1807. X  #ifdef MK_GLOBALS
  1808. X! = {L_JAN, L_FEB, L_MAR, L_APR, L_MAY, L_JUN,
  1809. X!    L_JUL, L_AUG, L_SEP, L_OCT, L_NOV, L_DEC}
  1810. X  #endif
  1811. X  ;
  1812. X  
  1813. X  EXTERN    char    *DayName[]
  1814. X  #ifdef MK_GLOBALS
  1815. X! = {L_MONDAY, L_TUESDAY, L_WEDNESDAY, L_THURSDAY, L_FRIDAY,
  1816. X!    L_SATURDAY, L_SUNDAY}
  1817. X  #endif
  1818. X  ;
  1819. X  
  1820. X*** ../patch1/init.c    Wed Dec 16 10:51:35 1992
  1821. X--- ./init.c    Mon Feb  1 15:47:17 1993
  1822. X***************
  1823. X*** 7,13 ****
  1824. X  /*  in normal mode.                                            */
  1825. X  /*                                                             */
  1826. X  /*  This file is part of REMIND.                               */
  1827. X! /*  Copyright (C) 1992 by David F. Skoll.                      */
  1828. X  /*                                                             */
  1829. X  /***************************************************************/
  1830. X  #include "config.h"
  1831. X--- 7,13 ----
  1832. X  /*  in normal mode.                                            */
  1833. X  /*                                                             */
  1834. X  /*  This file is part of REMIND.                               */
  1835. X! /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  1836. X  /*                                                             */
  1837. X  /***************************************************************/
  1838. X  #include "config.h"
  1839. X***************
  1840. X*** 18,23 ****
  1841. X--- 18,27 ----
  1842. X  #ifdef HAVE_MALLOC_H
  1843. X  #include <malloc.h>
  1844. X  #endif
  1845. X+ #ifdef UNIX
  1846. X+ #include <sys/types.h>
  1847. X+ #include <pwd.h>
  1848. X+ #endif
  1849. X  #include <ctype.h>
  1850. X  #include "types.h"
  1851. X  #include "protos.h"
  1852. X***************
  1853. X*** 34,40 ****
  1854. X   *             simple calendar format.
  1855. X   *  -r       = Disallow RUN mode
  1856. X   *  -c[n]    = Produce a calendar for n months (default = 1)
  1857. X!  *  -w[n]    = Specify output device width (default = 80)
  1858. X   *  -s[n]    = Produce calendar in "simple calendar" format
  1859. X   *  -p[n]    = Produce calendar in format compatible with rem2ps
  1860. X   *  -v       = Verbose mode
  1861. X--- 38,44 ----
  1862. X   *             simple calendar format.
  1863. X   *  -r       = Disallow RUN mode
  1864. X   *  -c[n]    = Produce a calendar for n months (default = 1)
  1865. X!  *  -w[n,n,n] = Specify output device width, padding and spacing
  1866. X   *  -s[n]    = Produce calendar in "simple calendar" format
  1867. X   *  -p[n]    = Produce calendar in format compatible with rem2ps
  1868. X   *  -v       = Verbose mode
  1869. X***************
  1870. X*** 54,59 ****
  1871. X--- 58,64 ----
  1872. X   *  -z[n]    = Daemon mode waking up every n (def 5) minutes.
  1873. X   *  -bn      = Time format for cal (0, 1, or 2)
  1874. X   *  -xn      = Max. number of iterations for SATISFY
  1875. X+  *  -uname   = Run as user 'name' - only valid when run by root.
  1876. X   *
  1877. X   **************************************************************/
  1878. X  
  1879. X***************
  1880. X*** 66,71 ****
  1881. X--- 71,80 ----
  1882. X        s++;                 \
  1883. X     }
  1884. X  
  1885. X+ #ifdef UNIX
  1886. X+ PRIVATE void ChgUser ARGS((char *uname));
  1887. X+ #endif
  1888. X+ 
  1889. X  static char *BadDate = "Illegal date on command line\n";
  1890. X  
  1891. X  /***************************************************************/
  1892. X***************
  1893. X*** 144,149 ****
  1894. X--- 153,166 ----
  1895. X             Hush = 1;
  1896. X             break;
  1897. X  
  1898. X+ #if defined(UNIX) && defined(WANT_U_OPTION)
  1899. X+         case 'u':
  1900. X+         case 'U':
  1901. X+            ChgUser(arg);
  1902. X+            while (*arg) arg++;
  1903. X+            break;
  1904. X+ #endif           
  1905. X+ 
  1906. X  #ifdef HAVE_QUEUED
  1907. X          case 'z':
  1908. X          case 'Z':
  1909. X***************
  1910. X*** 198,205 ****
  1911. X  
  1912. X          case 'w':
  1913. X          case 'W':
  1914. X!            PARSENUM(CalWidth, arg);
  1915. X!            if (CalWidth < 80) CalWidth = 80;
  1916. X             break;
  1917. X  
  1918. X          case 'd':
  1919. X--- 215,236 ----
  1920. X  
  1921. X          case 'w':
  1922. X          case 'W':
  1923. X!            if (*arg != ',') {
  1924. X!               PARSENUM(CalWidth, arg);
  1925. X!               if (CalWidth < 80) CalWidth = 80;
  1926. X!            }
  1927. X!            if (*arg == ',') {
  1928. X!               arg++;
  1929. X!           if (*arg != ',') {
  1930. X!                 PARSENUM(CalLines, arg);
  1931. X!              if (CalLines > 20) CalLines = 20;
  1932. X!           }
  1933. X!           if (*arg == ',') {
  1934. X!              arg++;
  1935. X!              PARSENUM(CalPad, arg);
  1936. X!              if (CalPad > 20) CalPad = 20;
  1937. X!           }
  1938. X!            }
  1939. X             break;
  1940. X  
  1941. X          case 'd':
  1942. X***************
  1943. X*** 311,317 ****
  1944. X  void Usage()
  1945. X  #endif
  1946. X  {
  1947. X!    fprintf(ErrFp, "\nREMIND %s Copyright 1992 by David F. Skoll\n\n", VERSION);
  1948. X     fprintf(ErrFp, "        Usage: remind [options] filename [date]\n");
  1949. X     fprintf(ErrFp, "Options:\n");
  1950. X     fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  1951. X--- 342,348 ----
  1952. X  void Usage()
  1953. X  #endif
  1954. X  {
  1955. X!    fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992, 1993 by David F. Skoll\n\n", VERSION, L_LANGNAME);
  1956. X     fprintf(ErrFp, "        Usage: remind [options] filename [date]\n");
  1957. X     fprintf(ErrFp, "Options:\n");
  1958. X     fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  1959. X***************
  1960. X*** 318,324 ****
  1961. X     fprintf(ErrFp, " -r     Disable RUN directives\n");
  1962. X     fprintf(ErrFp, " -c[n]  Produce a calendar for n (default 1) months\n");
  1963. X     fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
  1964. X!    fprintf(ErrFp, " -w[n]  Specify width (default 80) of calendar output\n");
  1965. X     fprintf(ErrFp, " -s[n]  Produce 'simple calendar' for n (1) months\n");
  1966. X     fprintf(ErrFp, " -p[n]  Same as -s, but input compatible with rem2ps\n");
  1967. X     fprintf(ErrFp, " -v     Verbose mode\n");
  1968. X--- 349,355 ----
  1969. X     fprintf(ErrFp, " -r     Disable RUN directives\n");
  1970. X     fprintf(ErrFp, " -c[n]  Produce a calendar for n (default 1) months\n");
  1971. X     fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
  1972. X!    fprintf(ErrFp, " -w[n[,p[,s]]]  Specify width, padding and spacing of calendar\n");
  1973. X     fprintf(ErrFp, " -s[n]  Produce 'simple calendar' for n (1) months\n");
  1974. X     fprintf(ErrFp, " -p[n]  Same as -s, but input compatible with rem2ps\n");
  1975. X     fprintf(ErrFp, " -v     Verbose mode\n");
  1976. X***************
  1977. X*** 337,339 ****
  1978. X--- 368,450 ----
  1979. X     fprintf(ErrFp, " -x[n]  Iteration limit for SATISFY clause (def=150)\n");
  1980. X     exit(1);
  1981. X  }
  1982. X+ 
  1983. X+ /***************************************************************/
  1984. X+ /*                                                             */
  1985. X+ /*  ChgUser                                                    */
  1986. X+ /*                                                             */
  1987. X+ /*  Run as a specified user.  Can only be used if Remind is    */
  1988. X+ /*  started by root.  This changes the real and effective uid, */
  1989. X+ /*  the real and effective gid, and sets the HOME, SHELL and   */
  1990. X+ /*  USER environment variables.                                */
  1991. X+ /*                                                             */
  1992. X+ /***************************************************************/
  1993. X+ #if defined(UNIX) && defined(WANT_U_OPTION)
  1994. X+ #ifdef HAVE_PROTOS
  1995. X+ PRIVATE void ChgUser(char *user)
  1996. X+ #else
  1997. X+ static void ChgUser(user)
  1998. X+ char *user;
  1999. X+ #endif /* HAVE_PROTOS */
  2000. X+ {
  2001. X+ #ifdef SYSV
  2002. X+    uid_t myuid;
  2003. X+ #else
  2004. X+    int myuid;
  2005. X+ #endif
  2006. X+ 
  2007. X+    static char *NoEnvMem = "Remind: Out of memory for environment\n";
  2008. X+    struct passwd *pwent;
  2009. X+    static char *home, *shell, *username;
  2010. X+ 
  2011. X+    myuid = getuid();
  2012. X+    if (myuid) {
  2013. X+       fprintf(ErrFp, "Remind: Only the super-user can use the '-u' option.\n");
  2014. X+       exit(1);
  2015. X+    }
  2016. X+ 
  2017. X+    pwent = getpwnam(user);
  2018. X+ 
  2019. X+    if (!pwent) {
  2020. X+       fprintf(ErrFp, "Remind: Unknown user '%s'\n", user);
  2021. X+       exit(1);
  2022. X+    }
  2023. X+ 
  2024. X+    if (setgid(pwent->pw_gid)) {
  2025. X+       fprintf(ErrFp, "Remind: Could not change gid to %d\n", pwent->pw_gid);
  2026. X+       exit(1);
  2027. X+    }
  2028. X+ 
  2029. X+    if (setuid(pwent->pw_uid)) {
  2030. X+       fprintf(ErrFp, "Remind: Could not change uid to %d\n", pwent->pw_uid);
  2031. X+       exit(1);
  2032. X+    }
  2033. X+ 
  2034. X+    home = malloc(strlen(pwent->pw_dir) + 6);
  2035. X+    if (!home) {
  2036. X+       fprintf(ErrFp, NoEnvMem);
  2037. X+       exit(1);
  2038. X+    }
  2039. X+    sprintf(home, "HOME=%s", pwent->pw_dir);
  2040. X+    putenv(home);
  2041. X+ 
  2042. X+    shell = malloc(strlen(pwent->pw_dir) + 7);
  2043. X+    if (!shell) {
  2044. X+       fprintf(ErrFp, NoEnvMem);
  2045. X+       exit(1);
  2046. X+    }
  2047. X+    sprintf(shell, "SHELL=%s", pwent->pw_shell);
  2048. X+    putenv(shell);
  2049. X+ 
  2050. X+    if (pwent->pw_uid) {
  2051. X+       username = malloc(strlen(pwent->pw_dir) + 6);
  2052. X+       if (!username) {
  2053. X+          fprintf(ErrFp, NoEnvMem);
  2054. X+          exit(1);
  2055. X+       }
  2056. X+       sprintf(username, "USER=%s", pwent->pw_dir);
  2057. X+       putenv(username);
  2058. X+    }
  2059. X+ }
  2060. X+ #endif /* UNIX && WANT_U_OPTION */
  2061. X+    
  2062. END_OF_FILE
  2063.   if test 59033 -ne `wc -c <'patch.02.A'`; then
  2064.     echo shar: \"'patch.02.A'\" unpacked with wrong size!
  2065.   elif test -f 'patch.02.B'; then
  2066.     echo shar: Combining  \"'patch.02'\" \(113702 characters\)    
  2067.     cat 'patch.02.A' 'patch.02.B' > 'patch.02'
  2068.     if test 113702 -ne `wc -c <'patch.02'`; then
  2069.       echo shar: \"'patch.02'\" combined with wrong size!
  2070.     else
  2071.       rm patch.02.A patch.02.B 
  2072.     fi
  2073.   fi
  2074.   # end of 'patch.02.A'
  2075. fi
  2076. echo shar: End of archive 2 \(of 3\).
  2077. cp /dev/null ark2isdone
  2078. MISSING=""
  2079. for I in 1 2 3 ; do
  2080.     if test ! -f ark${I}isdone ; then
  2081.     MISSING="${MISSING} ${I}"
  2082.     fi
  2083. done
  2084. if test "${MISSING}" = "" ; then
  2085.     echo You have unpacked all 3 archives.
  2086.     rm -f ark[1-9]isdone
  2087. else
  2088.     echo You still must unpack the following archives:
  2089.     echo "        " ${MISSING}
  2090. fi
  2091. exit 0
  2092. exit 0 # Just in case...
  2093.