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

  1. Newsgroups: comp.sources.misc
  2. From: <dfs@doe.carleton.ca> (David F. Skoll)
  3. Subject: v37i035:  remind - A replacement for calendar, Patch06
  4. Message-ID: <1993May4.151305.17307@sparky.imd.sterling.com>
  5. X-Md4-Signature: f0cc56879d4ba5da04df0c4638c2c7a5
  6. Date: Tue, 4 May 1993 15:13:05 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 35
  11. Archive-name: remind/patch06
  12. Environment: UNIX, MS-DOS, OS/2
  13. Patch-To: remind: Volume 33, Issue 58-69
  14.  
  15. This is patch 6 for version 3.0 of Remind.
  16.  
  17. Remind is a sophisticated calendar/alarm program, which runs under
  18. MS-DOS, UNIX and OS/2.
  19.  
  20. >From the WHATSNEW file:
  21.  
  22. * Version 3.0 Patch 6
  23.  
  24. + MINOR ENHANCEMENTS
  25.  
  26. - Added the PS- and PSFILE-type reminders - these allow you to include
  27.   arbitrary PostScript code in your PostScript calendars.  Useful for
  28.   shading, drawing graphics on calendars, etc.  Use with care, though!
  29.  
  30. - Added the "-ivar=val" option to initialize variables from the command
  31.   line.  Changed the remind-all.* shell scripts to predefine the variable
  32.   "remind_all".
  33.  
  34. + BUG FIXES
  35.  
  36. - Fixed a bug in the hebmon(), hebday() and hebyear() functions - there
  37.   was an off-by-one error.  Sorry!
  38.  
  39. - Fixed a bug in the hebdate() function which resulted in infinite loops
  40.   for dates after about 2075
  41.  
  42. - Fixed a bug in the -u option which sometimes caused a core dump
  43.   (embarrassed grin!)  The fix is due to Tina Hoeltig.  Thanks, Tina!
  44.  
  45. Availability:
  46.  
  47. You can get Remind via ftp from ftp.doe.carleton.ca (134.117.9.35)
  48. in the directory "pub/remind-3.0".  See the file README.1st for
  49. a description of the files.
  50.  
  51. David F. Skoll
  52. ---------------------------------------------
  53. #! /bin/sh
  54. # This is a shell archive.  Remove anything before this line, then feed it
  55. # into a shell via "sh file" or similar.  To overwrite existing files,
  56. # type "sh file -c".
  57. # Contents:  patch.06
  58. # Wrapped by kent@sparky on Tue May  4 10:07:16 1993
  59. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  60. echo If this archive is complete, you will see the following message:
  61. echo '          "shar: End of archive 1 (of 1)."'
  62. if test -f 'patch.06' -a "${1}" != "-c" ; then 
  63.   echo shar: Will not clobber existing file \"'patch.06'\"
  64. else
  65.   echo shar: Extracting \"'patch.06'\" \(46327 characters\)
  66.   sed "s/^X//" >'patch.06' <<'END_OF_FILE'
  67. XPrereq: "03.00.05"
  68. X*** ../p5rel/version.h    Thu Apr 22 10:24:22 1993
  69. X--- ./version.h    Fri Apr 23 12:59:49 1993
  70. X***************
  71. X*** 9,12 ****
  72. X  /*                                                             */
  73. X  /***************************************************************/
  74. X  
  75. X! #define VERSION "03.00.05"
  76. X--- 9,12 ----
  77. X  /*                                                             */
  78. X  /***************************************************************/
  79. X  
  80. X! #define VERSION "03.00.06"
  81. X*** ../p5rel/COPYRIGHT    Thu Apr 22 10:24:02 1993
  82. X--- ./COPYRIGHT    Mon May  3 10:13:51 1993
  83. X***************
  84. X*** 30,38 ****
  85. X  1993 by David Skoll.  These programs can be distributed according to
  86. X  the terms of paragraphs 3 and 4.
  87. X  
  88. X! 7. I will attempt to support REMIND as much as possible.  However, you
  89. X! use it at your own risk.  I am not responsible for any damages caused
  90. X! by the use or misuse of REMIND.
  91. X  
  92. X  8. If you wish to contribute ideas or money to help the production of
  93. X  software like REMIND, you can reply to the address shown at the end of
  94. X--- 30,39 ----
  95. X  1993 by David Skoll.  These programs can be distributed according to
  96. X  the terms of paragraphs 3 and 4.
  97. X  
  98. X! 7. I will attempt to support REMIND as much as possible.  However,
  99. X! REMIND is supplied on an "as-is" basis with no warranty.  You use it
  100. X! at your own risk.  I am not responsible for any damages caused by the
  101. X! use or misuse of REMIND.
  102. X  
  103. X  8. If you wish to contribute ideas or money to help the production of
  104. X  software like REMIND, you can reply to the address shown at the end of
  105. X*** ../p5rel/Makefile    Thu Apr 22 10:24:10 1993
  106. X--- ./Makefile    Fri Apr 23 13:00:44 1993
  107. X***************
  108. X*** 46,52 ****
  109. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  110. X  # in config.h; then, you should be able to type 'make'.
  111. X  #-----------------------------------------------------------------------------
  112. X! VERSION= 03.00.05
  113. X  
  114. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  115. X  lang.h english.h german.h dutch.h finnish.h
  116. X--- 46,52 ----
  117. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  118. X  # in config.h; then, you should be able to type 'make'.
  119. X  #-----------------------------------------------------------------------------
  120. X! VERSION= 03.00.06
  121. X  
  122. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  123. X  lang.h english.h german.h dutch.h finnish.h
  124. X***************
  125. X*** 105,112 ****
  126. X  var.o: var.c $(STDHDRS) expr.h
  127. X  
  128. X  tarZ:
  129. X!     tar cvf remind-3.0.5.tar $(MANIFEST)
  130. X!     compress -v remind-3.0.5.tar
  131. X  
  132. X  shar:
  133. X      shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  134. X--- 105,112 ----
  135. X  var.o: var.c $(STDHDRS) expr.h
  136. X  
  137. X  tarZ:
  138. X!     tar cvf remind-3.0.6.tar $(MANIFEST)
  139. X!     compress -v remind-3.0.6.tar
  140. X  
  141. X  shar:
  142. X      shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
  143. X*** ../p5rel/WHATSNEW.30    Thu Apr 22 10:24:22 1993
  144. X--- ./WHATSNEW.30    Mon May  3 11:00:51 1993
  145. X***************
  146. X*** 1,5 ****
  147. X--- 1,28 ----
  148. X  CHANGES TO REMIND
  149. X  
  150. X+ * Version 3.0 Patch 6
  151. X+ 
  152. X+ + MINOR ENHANCEMENTS
  153. X+ 
  154. X+ - Added the PS- and PSFILE-type reminders - these allow you to include
  155. X+   arbitrary PostScript code in your PostScript calendars.  Useful for
  156. X+   shading, drawing graphics on calendars, etc.  Use with care, though!
  157. X+ 
  158. X+ - Added the "-ivar=val" option to initialize variables from the command
  159. X+   line.  Changed the remind-all.* shell scripts to predefine the variable
  160. X+   "remind_all".
  161. X+ 
  162. X+ + BUG FIXES
  163. X+ 
  164. X+ - Fixed a bug in the hebmon(), hebday() and hebyear() functions - there
  165. X+   was an off-by-one error.  Sorry!
  166. X+ 
  167. X+ - Fixed a bug in the hebdate() function which resulted in infinite loops
  168. X+   for dates after about 2075
  169. X+ 
  170. X+ - Fixed a bug in the -u option which sometimes caused a core dump
  171. X+   (embarrassed grin!)  The fix is due to Tina Hoeltig.  Thanks, Tina!
  172. X+ 
  173. X  * Version 3.0 Patch 5
  174. X  
  175. X  + MAJOR ENHANCEMENTS:
  176. X*** ../p5rel/calendar.c    Thu Apr 22 10:24:00 1993
  177. X--- ./calendar.c    Mon May  3 12:01:29 1993
  178. X***************
  179. X*** 33,38 ****
  180. X--- 33,39 ----
  181. X  
  182. X  /* Global variables */
  183. X  static CalEntry *CalColumn[7];
  184. X+ static CalEntry *CalPs[7];
  185. X  
  186. X  static int ColSpaces;
  187. X  
  188. X***************
  189. X*** 614,619 ****
  190. X--- 615,621 ----
  191. X     int r;
  192. X     int jul;
  193. X     CalEntry *CurCol = CalColumn[col];
  194. X+    CalEntry *CurPs = CalPs[col];
  195. X     CalEntry *e;
  196. X     char *s;
  197. X  
  198. X***************
  199. X*** 626,635 ****
  200. X--- 628,642 ----
  201. X  #endif
  202. X     if (trig.typ == NO_TYPE) return E_EOLN;
  203. X     if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
  204. X+ 
  205. X     /* Calculate the trigger date */
  206. X     jul = ComputeTrigger(trig.scanfrom, &trig, &r);
  207. X     if (r) return r;
  208. X+    if (!PsCal && (trig.typ == PS_TYPE || trig.typ == PSF_TYPE)) return OK;
  209. X  
  210. X+    /* Remove any "at" times from PS or PSFILE reminders */
  211. X+    if (trig.typ == PS_TYPE || trig.typ == PSF_TYPE) tim.ttime = NO_TIME;
  212. X+ 
  213. X     /* If trigger date == today, add it to the current entry */   
  214. X     if (jul == JulianToday) {
  215. X        s = SubstBuffer;
  216. X***************
  217. X*** 646,656 ****
  218. X           free(e);
  219. X       return E_NO_MEM;
  220. X        }
  221. X!       e->pos = e->text;
  222. X!       e->time = tim.ttime;
  223. X!       e->next = CurCol;
  224. X!       CalColumn[col] = e;
  225. X!       SortColByTime(col);
  226. X     }
  227. X     return OK;
  228. X  }
  229. X--- 653,670 ----
  230. X           free(e);
  231. X       return E_NO_MEM;
  232. X        }
  233. X!       if (trig.typ == PS_TYPE || trig.typ == PSF_TYPE) {
  234. X!          e->pos = (trig.typ == PS_TYPE) ? "P" : "F";
  235. X!      e->time = NO_TIME;
  236. X!      e->next = CurPs;
  237. X!      CalPs[col] = e;
  238. X!       } else {
  239. X!          e->pos = e->text;
  240. X!          e->time = tim.ttime;
  241. X!          e->next = CurCol;
  242. X!          CalColumn[col] = e;
  243. X!          SortColByTime(col);
  244. X!       }
  245. X     }
  246. X     return OK;
  247. X  }
  248. X***************
  249. X*** 669,679 ****
  250. X  int col, jul;
  251. X  #endif
  252. X  {
  253. X!    CalEntry *e = CalColumn[col];
  254. X     CalEntry *n;
  255. X     int y, m, d;
  256. X  
  257. X     FromJulian(jul, &y, &m, &d);
  258. X     while(e) {
  259. X        printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
  260. X        printf("%s\n", e->text);
  261. X--- 683,707 ----
  262. X  int col, jul;
  263. X  #endif
  264. X  {
  265. X!    CalEntry *e = CalPs[col];
  266. X     CalEntry *n;
  267. X     int y, m, d;
  268. X  
  269. X+ /* Do all the PostScript entries first, if any */
  270. X     FromJulian(jul, &y, &m, &d);
  271. X+    while(e) {
  272. X+       printf("%c%c%c%c%c%02d%c%02d ", *(e->pos), *(e->pos),
  273. X+                                      *(e->pos), *(e->pos), DATESEP,
  274. X+                      m+1, DATESEP, d);
  275. X+       printf("%s\n", e->text);
  276. X+       free(e->text);
  277. X+       n = e->next;
  278. X+       free(e);
  279. X+       e = n;
  280. X+    }
  281. X+    CalPs[col] = NULL;
  282. X+ 
  283. X+    e = CalColumn[col];                     
  284. X     while(e) {
  285. X        printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
  286. X        printf("%s\n", e->text);
  287. X*** ../p5rel/defs.rem    Thu Apr 22 10:24:03 1993
  288. X--- ./defs.rem    Mon May  3 10:29:12 1993
  289. X***************
  290. X*** 13,18 ****
  291. X--- 13,19 ----
  292. X  # Use your text editor to search for:                        #
  293. X  #  "#USHOLS" for U.S. holidays                            #
  294. X  #  "#JHOLS"  for Jewish holidays                        #
  295. X+ #  "#PSSTUFF" for nifty PostScript examples                    #
  296. X  #                                         #
  297. X  # This file is part of REMIND.                            #
  298. X  # Copyright (C) 1992, 1993 by David F. Skoll                    #
  299. X***************
  300. X*** 24,31 ****
  301. X  ################################################
  302. X  # Ensure required version of remind is used... #
  303. X  ################################################
  304. X! IF version() < "03.00.05"
  305. X!    ERRMSG This file requires at least version 03.00.05 of Remind.%
  306. X     ERRMSG This version is version [version()].
  307. X     EXIT
  308. X  ENDIF
  309. X--- 25,32 ----
  310. X  ################################################
  311. X  # Ensure required version of remind is used... #
  312. X  ################################################
  313. X! IF version() < "03.00.06"
  314. X!    ERRMSG This file requires at least version 03.00.06 of Remind.%
  315. X     ERRMSG This version is version [version()].
  316. X     EXIT
  317. X  ENDIF
  318. X***************
  319. X*** 442,444 ****
  320. X--- 443,476 ----
  321. X     ENDIF
  322. X     CAL [ORD(odays)] of Omer
  323. X  ENDIF
  324. X+ 
  325. X+ #PSSTUFF
  326. X+ ##########################################################################
  327. X+ #                                         #
  328. X+ # This portion of the file contains some cute examples of the new        #
  329. X+ # PS-type reminders.  You need a PostScript printer or viewer to         #
  330. X+ # appreciate these.  To use them, pipe the output of remind -p into the  #
  331. X+ # rem2ps program.                                                        #
  332. X+ #                                         #
  333. X+ ##########################################################################
  334. X+ 
  335. X+ # Convenient to stick all the PostScript code in a string var - makes
  336. X+ # reminders easier to understand.  The variable "shade" will contain
  337. X+ # PostScript code to shade in a particular box on the calendar.
  338. X+ SET shade \
  339. X+ "/_A LineWidth 2 div def \
  340. X+ _A _A moveto \
  341. X+ BoxWidth _A sub _A lineto \
  342. X+ BoxWidth _A sub BoxHeight _A sub lineto \
  343. X+ _A BoxHeight _A sub lineto \
  344. X+ closepath 0.95 setgray fill 0.0 setgray"
  345. X+ 
  346. X+ # The following reminder will shade the Saturday and Sunday calendar
  347. X+ # entries. 
  348. X+ REM Sat Sun PS [shade]
  349. X+ 
  350. X+ # The following will fill in the Hebrew dates on the calendar.  For this
  351. X+ # example, I recommend that you use the "-sd 10" option for rem2ps.
  352. X+ REM PS Border BoxHeight Border sub DaySize sub moveto \
  353. X+    /DayFont findfont DaySize scalefont setfont \
  354. X+    ([hebday(today())] [hebmon(today())]) show
  355. X*** ../p5rel/dorem.c    Thu Apr 22 10:24:03 1993
  356. X--- ./dorem.c    Fri Apr 30 13:16:27 1993
  357. X***************
  358. X*** 466,472 ****
  359. X     int r, y, m, d;
  360. X  
  361. X     if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
  362. X!    if (t->typ == CAL_TYPE) return OK;
  363. X  
  364. X  /* If it's a MSG-type reminder, and no -k option was used, issue the banner. */
  365. X     if (t->typ == MSG_TYPE && !NumTriggered && !NextMode && !MsgCommand) {
  366. X--- 466,473 ----
  367. X     int r, y, m, d;
  368. X  
  369. X     if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
  370. X!    if (t->typ == CAL_TYPE || t->typ == PS_TYPE || t->typ == PSF_TYPE)
  371. X!       return OK;
  372. X  
  373. X  /* If it's a MSG-type reminder, and no -k option was used, issue the banner. */
  374. X     if (t->typ == MSG_TYPE && !NumTriggered && !NextMode && !MsgCommand) {
  375. X*** ../p5rel/hbcal.c    Thu Apr 22 10:24:38 1993
  376. X--- ./hbcal.c    Mon May  3 11:34:29 1993
  377. X***************
  378. X*** 237,243 ****
  379. X     ylen = DaysInHebYear(y);
  380. X     monlen = DaysInHebMonths(ylen);
  381. X     m = 0;
  382. X!    while((jul > monlen[m]) || !monlen[m]) {
  383. X        jul -= monlen[m];
  384. X        m++;
  385. X     }
  386. X--- 237,243 ----
  387. X     ylen = DaysInHebYear(y);
  388. X     monlen = DaysInHebMonths(ylen);
  389. X     m = 0;
  390. X!    while((jul >= monlen[m]) || !monlen[m]) {
  391. X        jul -= monlen[m];
  392. X        m++;
  393. X     }
  394. X***************
  395. X*** 424,431 ****
  396. X  int julstart, hm, hd, jahr, *ans;
  397. X  #endif
  398. X  {
  399. X!    int r, yout, mout, dout, jul;
  400. X  
  401. X     JulToHeb(julstart, &yout, &mout, &dout);
  402. X  
  403. X     r = 1;
  404. X--- 424,435 ----
  405. X  int julstart, hm, hd, jahr, *ans;
  406. X  #endif
  407. X  {
  408. X!    int r, yout, mout, dout, jul=1;
  409. X  
  410. X+    /* I initialize jul above to stop gcc from complaining about
  411. X+       possible use of uninitialized variable.  You can take it
  412. X+       out if the small inefficiency really bothers you. */
  413. X+ 
  414. X     JulToHeb(julstart, &yout, &mout, &dout);
  415. X  
  416. X     r = 1;
  417. X***************
  418. X*** 437,442 ****
  419. X--- 441,447 ----
  420. X       continue;
  421. X        }
  422. X        jul = HebToJul(yout, mout, dout);
  423. X+       if (jul < 0) return E_DATE_OVER;
  424. X        if (jul >= julstart) break;
  425. X        else {
  426. X           yout++;
  427. X*** ../p5rel/init.c    Thu Apr 22 10:24:09 1993
  428. X--- ./init.c    Thu Apr 29 15:08:41 1993
  429. X***************
  430. X*** 63,68 ****
  431. X--- 63,69 ----
  432. X   *  -xn      = Max. number of iterations for SATISFY
  433. X   *  -uname   = Run as user 'name' - only valid when run by root.
  434. X   *  -kcmd    = Run 'cmd' for MSG-type reminders instead of printing to stdout
  435. X+  *  -iVAR=EXPR = Initialize and preserve VAR.
  436. X   *
  437. X   **************************************************************/
  438. X  
  439. X***************
  440. X*** 79,84 ****
  441. X--- 80,87 ----
  442. X  PRIVATE void ChgUser ARGS((char *uname));
  443. X  #endif
  444. X  
  445. X+ PRIVATE void InitializeVar ARGS ((char *str));
  446. X+ 
  447. X  static char *BadDate = "Illegal date on command line\n";
  448. X  
  449. X  /***************************************************************/
  450. X***************
  451. X*** 123,128 ****
  452. X--- 126,137 ----
  453. X  
  454. X        while (*arg) {
  455. X           switch(*arg++) {
  456. X+             case 'i':
  457. X+         case 'I':
  458. X+            InitializeVar(arg);
  459. X+            while(*arg) arg++;
  460. X+            break;
  461. X+        
  462. X          case 'n':
  463. X          case 'N':
  464. X             NextMode = 1;
  465. X***************
  466. X*** 393,398 ****
  467. X--- 402,408 ----
  468. X     fprintf(ErrFp, " -x[n]  Iteration limit for SATISFY clause (def=150)\n");
  469. X     fprintf(ErrFp, " -kcmd  Run 'cmd' for MSG-type reminders\n");
  470. X     fprintf(ErrFp, " -g[d[d]] Sort reminders by date and time before issuing\n");
  471. X+    fprintf(ErrFp, "-ivar=val Initialize var to val and preserve var\n");
  472. X     exit(1);
  473. X  }
  474. X  
  475. X***************
  476. X*** 456,462 ****
  477. X     sprintf(home, "HOME=%s", pwent->pw_dir);
  478. X     putenv(home);
  479. X  
  480. X!    shell = malloc(strlen(pwent->pw_dir) + 7);
  481. X     if (!shell) {
  482. X        fprintf(ErrFp, NoEnvMem);
  483. X        exit(1);
  484. X--- 466,472 ----
  485. X     sprintf(home, "HOME=%s", pwent->pw_dir);
  486. X     putenv(home);
  487. X  
  488. X!    shell = malloc(strlen(pwent->pw_shell) + 7);
  489. X     if (!shell) {
  490. X        fprintf(ErrFp, NoEnvMem);
  491. X        exit(1);
  492. X***************
  493. X*** 483,485 ****
  494. X--- 493,550 ----
  495. X  }
  496. X  #endif /* UNIX && WANT_U_OPTION */
  497. X     
  498. X+ /***************************************************************/
  499. X+ /*                                                             */
  500. X+ /*  InitializeVar                                              */
  501. X+ /*                                                             */
  502. X+ /*  Initialize and preserve a variable                         */
  503. X+ /*                                                             */
  504. X+ /***************************************************************/
  505. X+ #ifdef HAVE_PROTOS
  506. X+ PRIVATE void InitializeVar(char *str)
  507. X+ #else
  508. X+ static void InitializeVar(str)
  509. X+ char *str;
  510. X+ #endif
  511. X+ {
  512. X+    char *varname, *expr;
  513. X+    static char Err[] = "Remind: -i option: %s\n";
  514. X+ 
  515. X+    Value val;
  516. X+ 
  517. X+    int r;
  518. X+ 
  519. X+    /* Scan for an '=' sign */
  520. X+    varname = str;
  521. X+    while (*str && *str != '=') str++;
  522. X+    if (!*str) {
  523. X+       fprintf(ErrFp, Err, "Missing '=' sign");
  524. X+       return;
  525. X+    }
  526. X+    *str = 0;
  527. X+    if (!*varname) {
  528. X+       fprintf(ErrFp, Err, "Missing varname");
  529. X+       return;
  530. X+    }
  531. X+    expr = str+1;
  532. X+    if (!*expr) {
  533. X+       fprintf(ErrFp, Err, "Missing expr");
  534. X+       return;
  535. X+    }
  536. X+ 
  537. X+    r=EvalExpr(&expr, &val);
  538. X+    if (r) {
  539. X+       fprintf(ErrFp, Err, ErrMsg[r]);
  540. X+       return;
  541. X+    }
  542. X+ 
  543. X+    r=SetVar(varname, &val);
  544. X+    if (r) {
  545. X+       fprintf(ErrFp, Err, ErrMsg[r]);
  546. X+       return;
  547. X+    }
  548. X+    r=PreserveVar(varname);
  549. X+    if (r) fprintf(ErrFp, Err, ErrMsg[r]);
  550. X+    return;
  551. X+ }
  552. X+ 
  553. X*** ../p5rel/makefile.os2    Thu Apr 22 10:24:11 1993
  554. X--- ./makefile.os2    Fri Apr 23 13:00:11 1993
  555. X***************
  556. X*** 25,31 ****
  557. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  558. X  # in config.h; then, you should be able to type 'make'.
  559. X  #-----------------------------------------------------------------------------
  560. X! VERSION= 03.00.05
  561. X  
  562. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  563. X  lang.h english.h german.h dutch.h finish.h
  564. X--- 25,31 ----
  565. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  566. X  # in config.h; then, you should be able to type 'make'.
  567. X  #-----------------------------------------------------------------------------
  568. X! VERSION= 03.00.06
  569. X  
  570. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  571. X  lang.h english.h german.h dutch.h finish.h
  572. X*** ../p5rel/makefile.tc    Thu Apr 22 10:24:11 1993
  573. X--- ./makefile.tc    Fri Apr 23 13:00:07 1993
  574. X***************
  575. X*** 1,6 ****
  576. X  # Makefile for REMIND for Turbo C for MSDOS
  577. X  
  578. X! VERSION= 03.00.05
  579. X  
  580. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  581. X  lang.h english.h german.h dutch.h finnish.h
  582. X--- 1,6 ----
  583. X  # Makefile for REMIND for Turbo C for MSDOS
  584. X  
  585. X! VERSION= 03.00.06
  586. X  
  587. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  588. X  lang.h english.h german.h dutch.h finnish.h
  589. X*** ../p5rel/queue.c    Thu Apr 22 10:24:12 1993
  590. X--- ./queue.c    Thu Apr 29 16:29:18 1993
  591. X***************
  592. X*** 270,282 ****
  593. X     printf("Contents of AT queue:%s", NL);
  594. X  
  595. X     while (q) {
  596. X!       printf("Trigger: %02d%c%02d  Activate: %02d%c%02d  Rep: %d  Delta: %d%s",
  597. X!               q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
  598. X!           q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
  599. X!               q->tt.rep, q->tt.delta, NL);
  600. X!       printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" : "RUN"),
  601. X!               q->text,
  602. X!               NL, NL);
  603. X        q = q->next;
  604. X     }
  605. X     printf(NL);
  606. X--- 270,284 ----
  607. X     printf("Contents of AT queue:%s", NL);
  608. X  
  609. X     while (q) {
  610. X!       if (q->tt.nexttime != NO_TIME) {
  611. X!          printf("Trigger: %02d%c%02d  Activate: %02d%c%02d  Rep: %d  Delta: %d%s",
  612. X!                  q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
  613. X!                  q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
  614. X!                  q->tt.rep, q->tt.delta, NL);
  615. X!          printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" : "RUN"),
  616. X!                  q->text,
  617. X!                  NL, NL);
  618. X!       }
  619. X        q = q->next;
  620. X     }
  621. X     printf(NL);
  622. X*** ../p5rel/rem2ps.1    Thu Apr 22 10:24:28 1993
  623. X--- ./rem2ps.1    Mon May  3 15:27:50 1993
  624. X***************
  625. X*** 10,15 ****
  626. X--- 10,21 ----
  627. X  draws a calendar) to the standard output.
  628. X  .SH OPTIONS
  629. X  .TP
  630. X+ .B \-p file
  631. X+ Include the contents of \fIfile\fR in the PostScript prologue.  This
  632. X+ allows you to define procedures, variables etc. which can be used
  633. X+ by the \fBPS\fR and \fBPSFILE\fR reminders.  You should not
  634. X+ include any document structuring comments in your prologue.
  635. X+ .TP
  636. X  .B \-l
  637. X  Produce the calendar in landscape mode rather than the default
  638. X  portrait mode.
  639. X***************
  640. X*** 147,152 ****
  641. X--- 153,269 ----
  642. X  entries from the reminder file "~/.reminders."  The calendar is produced
  643. X  in landscape mode, with a font size of 18 for the day numbers.  The result
  644. X  is put in the PostScript file "cal.ps."
  645. X+ .PP
  646. X+ .SH VARIABLES AVAILABLE TO USER-SUPPLIED POSTSCRIPT CODE
  647. X+ .PP
  648. X+ The following variables are available to \fBPS\fR and 
  649. X+ \fBPSFILE\fR-type reminders.  (This material is duplicated
  650. X+ in the \fBRemind\fR manual page.)
  651. X+ .TP
  652. X+ LineWidth
  653. X+ The width of the black grid lines making up the calendar.
  654. X+ .TP
  655. X+ Border
  656. X+ The border between the center of the grid lines and the space used to print
  657. X+ calendar entries.  This border is normally blank space.
  658. X+ .TP
  659. X+ BoxWidth and BoxHeight
  660. X+ The width and height of the calendar box, from center-to-center of the
  661. X+ black gridlines.
  662. X+ .TP
  663. X+ InBoxHeight
  664. X+ The height from the center of the bottom black gridline to the top
  665. X+ of the regular calendar entry area.  The space from here to the top
  666. X+ of the box is used only to draw the day number.
  667. X+ .TP
  668. X+ /DayFont, /EntryFont, /SmallFont and /HeadFont
  669. X+ The fonts used to draw the day numbers, the calendar entries, the small
  670. X+ calendars, and the month and day headings, respectively.
  671. X+ .TP
  672. X+ DaySize, EntrySize and HeadSize
  673. X+ The sizes of the above fonts.  (The size of the small calendar font
  674. X+ is \fInot\fR defined here.)  For example, if you wanted to print
  675. X+ the Hebrew date next to the regular day number in the calendar, use:
  676. X+ .PP
  677. X+ .nf
  678. X+     REM PS Border BoxHeight Border sub DaySize sub moveto \\
  679. X+        /DayFont findfont DaySize scalefont setfont \\
  680. X+        ([hebday(today())] [hebmon(today())]) show
  681. X+ .fi
  682. X+ .PP
  683. X+ .RS
  684. X+ Note how /DayFont and DaySize are used.
  685. X+ .RE
  686. X+ .PP
  687. X+ Note that if you supply PostScript code, it is possible to produce invalid
  688. X+ PostScript files.  Always test your PostScript thoroughly with a PostScript
  689. X+ viewer before sending it to the printer.  You should not use any document
  690. X+ structuring comments in your PostScript code.
  691. X+ .PP
  692. X+ In addition, prior to drawing a calendar page, \fBRem2ps\fR emits
  693. X+ the following PostScript code:
  694. X+ .PP
  695. X+ .nf
  696. X+     save (mon) (yr) PreCal restore
  697. X+ .fi
  698. X+ .PP
  699. X+ where \fImon\fR and \fIyr\fR are the month and year of the calendar
  700. X+ page.  The default \fBPreCal\fR procedure simply pops
  701. X+ the arguments and does nothing.  However, you can define a \fBPreCal\fR
  702. X+ function in your prologue file to do whatever you want - it can draw a
  703. X+ background for the entire calendar, for instance.
  704. X+ .PP
  705. X+ In the context of the \fBPreCal\fR procedure, the following conditions
  706. X+ hold:
  707. X+ .TP
  708. X+ o
  709. X+ The PostScript origin is at the bottom left-hand corner of the page, and
  710. X+ PostScript units of 1/72" are in effect.
  711. X+ .TP
  712. X+ o
  713. X+ The variables MinX, MinY, MaxX and MaxY define the bounding box within
  714. X+ which the calendar will be drawn.
  715. X+ .TP
  716. X+ o
  717. X+ The font and font-size variables, as well as Border and LineWidth described
  718. X+ previously, are valid.
  719. X+ .PP
  720. X+ For an example, create a file called "myprolog" whose contents are:
  721. X+ .PP
  722. X+ .nf
  723. X+         /PreCal {
  724. X+          /yr exch def
  725. X+          /mon exch def
  726. X+          /xsiz1 MaxX MinX sub def
  727. X+          /ysiz1 MaxY MinY sub def
  728. X+          /xsiz xsiz1 MinX sub MinX sub def
  729. X+          /ysiz ysiz1 MinY sub MinY sub def
  730. X+          xsiz
  731. X+          ysiz
  732. X+          lt
  733. X+          {/len xsiz 1.41 mul def
  734. X+           MinX MinX add ysiz1 xsiz1 sub 2 div MinY add MinY add moveto}
  735. X+          {/len ysiz 1.41 mul def
  736. X+           xsiz1 ysiz1 sub 2 div MinX add MinX add MinY MinY add moveto}
  737. X+          ifelse
  738. X+          /Helvetica-Bold findfont 1 scalefont setfont
  739. X+          mon stringwidth pop
  740. X+          ( ) stringwidth pop add
  741. X+          yr stringwidth pop add
  742. X+          len exch div /len exch def
  743. X+          /Helvetica-Bold findfont len scalefont setfont
  744. X+          0.95 setgray
  745. X+          45 rotate
  746. X+          mon show
  747. X+          ( ) show
  748. X+          yr show
  749. X+         } bind def
  750. X+ .fi
  751. X+ .PP
  752. X+ Use that file with the \fBRem2ps\fR \fB\-p\fR option to create calendars
  753. X+ with the year and month in large grey letters in the background of the
  754. X+ calendar.
  755. X+ .PP
  756. X  .SH AUTHOR
  757. X  David F. Skoll
  758. X  .SH BUGS
  759. X*** ../p5rel/rem2ps.c    Thu Apr 22 10:24:26 1993
  760. X--- ./rem2ps.c    Mon May  3 10:37:57 1993
  761. X***************
  762. X*** 68,74 ****
  763. X  
  764. X  #define NUMPAGES (sizeof(Pages)/sizeof(Pages[0]))
  765. X  
  766. X! CalEntry *CurEntries;
  767. X  PageType *CurPage;
  768. X  char PortraitMode;
  769. X  char NoSmallCal;
  770. X--- 68,75 ----
  771. X  
  772. X  #define NUMPAGES (sizeof(Pages)/sizeof(Pages[0]))
  773. X  
  774. X! CalEntry *CurEntries = NULL;
  775. X! CalEntry *PsEntries[32];
  776. X  PageType *CurPage;
  777. X  char PortraitMode;
  778. X  char NoSmallCal;
  779. X***************
  780. X*** 87,92 ****
  781. X--- 88,95 ----
  782. X  char *EntrySize="8";
  783. X  char *BorderSize = "6";
  784. X  
  785. X+ char *UserProlog = NULL;
  786. X+ 
  787. X  int validfile = 0;
  788. X  
  789. X  int CurDay;
  790. X***************
  791. X*** 99,104 ****
  792. X--- 102,108 ----
  793. X  void Init ARGS ((int argc, char *argv[]));
  794. X  void Usage ARGS ((char *s));
  795. X  void DoPsCal ARGS ((void));
  796. X+ int DoQueuedPs ARGS ((void));
  797. X  void DoSmallCal ARGS((char *m, int days, int first, int col));
  798. X  void WriteProlog ARGS ((void));
  799. X  void WriteCalEntry ARGS ((void));
  800. X***************
  801. X*** 160,165 ****
  802. X--- 164,170 ----
  803. X     int sfirst;
  804. X     int i;
  805. X     int smallcol;
  806. X+    int is_ps;
  807. X     CalEntry *c, *d;
  808. X  
  809. X     printf("%%%%Page: %d %d\n", validfile, validfile);
  810. X***************
  811. X*** 175,180 ****
  812. X--- 180,186 ----
  813. X  
  814. X  /* Emit PostScript to do the heading */
  815. X     if (!PortraitMode) printf("XSIZE 0 translate 90 rotate\n");
  816. X+    printf("/SAVESTATE save def (%s) (%s) PreCal SAVESTATE restore\n", month, year);
  817. X     printf("(%s %s) doheading\n", month, year);
  818. X  
  819. X  /* Calculate the minimum box size */
  820. X***************
  821. X*** 215,234 ****
  822. X           fprintf(stderr, "malloc failed - aborting.\n");
  823. X       exit(1);
  824. X        }
  825. X        c->next = NULL;
  826. X!       c->entry = malloc(strlen(LineBuffer+10) + 1);
  827. X        if (!c->entry) {
  828. X           fprintf(stderr, "malloc failed - aborting.\n");
  829. X       exit(1);
  830. X        }
  831. X!       strcpy(c->entry, LineBuffer+10);
  832. X  
  833. X  /* Put on linked list */
  834. X!       if (!CurEntries) CurEntries = c;
  835. X!       else {
  836. X!          d = CurEntries;
  837. X!      while(d->next) d = d->next;
  838. X!      d->next = c;
  839. X        }
  840. X     }
  841. X     for(; CurDay<=days; CurDay++) {
  842. X--- 221,248 ----
  843. X           fprintf(stderr, "malloc failed - aborting.\n");
  844. X       exit(1);
  845. X        }
  846. X+       is_ps = (*LineBuffer == 'F' || *LineBuffer == 'P');
  847. X        c->next = NULL;
  848. X!       c->entry = malloc(strlen(LineBuffer+10) + 1 + is_ps);
  849. X        if (!c->entry) {
  850. X           fprintf(stderr, "malloc failed - aborting.\n");
  851. X       exit(1);
  852. X        }
  853. X!       strcpy(c->entry+is_ps, LineBuffer+10);
  854. X  
  855. X+       if (is_ps) {
  856. X+ /* Save the 'P' or 'F' flag */
  857. X+          *(c->entry) = *LineBuffer;
  858. X+      c->next = PsEntries[DayNum];
  859. X+      PsEntries[DayNum] = c;
  860. X+       } else {
  861. X  /* Put on linked list */
  862. X!          if (!CurEntries) CurEntries = c;
  863. X!          else {
  864. X!             d = CurEntries;
  865. X!            while(d->next) d = d->next;
  866. X!         d->next = c;
  867. X!      }
  868. X        }
  869. X     }
  870. X     for(; CurDay<=days; CurDay++) {
  871. X***************
  872. X*** 281,286 ****
  873. X--- 295,303 ----
  874. X     int x = CurPage->xsize;
  875. X     int y = CurPage->ysize;
  876. X     char *isostuff;
  877. X+    FILE *fp;
  878. X+    int nread;
  879. X+    char buffer[LINELEN];
  880. X  
  881. X     if (!PortraitMode) {
  882. X        i = x; x = y; y = i;
  883. X***************
  884. X*** 325,330 ****
  885. X--- 342,348 ----
  886. X     printf("/MaxX %d def\n", x-RightMarg);
  887. X     printf("/MaxY %d def\n", y-TopMarg);
  888. X     printf("/Border %s def\n", BorderSize);
  889. X+    printf("/LineWidth %s def\n", LineWidth);
  890. X     printf("%s setlinewidth\n", LineWidth);
  891. X  
  892. X  /* Check if smallfont is fixed pitch */
  893. X***************
  894. X*** 335,343 ****
  895. X        printf("{/SmallString (WW ) def}\n");
  896. X        printf("{/SmallString (WW) def}\nifelse\n");
  897. X     }
  898. X     printf("%%%%EndProlog\n");
  899. X- /* Set the minimum box size */
  900. X  
  901. X  }
  902. X  
  903. X  /***************************************************************/
  904. X--- 353,377 ----
  905. X        printf("{/SmallString (WW ) def}\n");
  906. X        printf("{/SmallString (WW) def}\nifelse\n");
  907. X     }
  908. X+ 
  909. X+ /* Do the user-supplied prolog file, if any */
  910. X+    if (UserProlog) {
  911. X+       fp = fopen(UserProlog, "r");
  912. X+       if (!fp) {
  913. X+          fprintf(stderr, "Could not open prologue file '%s'\n", UserProlog);
  914. X+       } else {
  915. X+          while(1) {
  916. X+         nread = fread(buffer, sizeof(char), LINELEN, fp);
  917. X+         if (!nread) break;
  918. X+         fwrite(buffer, sizeof(char), nread, stdout);
  919. X+          }
  920. X+          fclose(fp);
  921. X+       }
  922. X+    }
  923. X+ 
  924. X     printf("%%%%EndProlog\n");
  925. X  
  926. X+ 
  927. X  }
  928. X  
  929. X  /***************************************************************/
  930. X***************
  931. X*** 353,360 ****
  932. X--- 387,396 ----
  933. X  {
  934. X     CalEntry *c = CurEntries;
  935. X     CalEntry *d;
  936. X+    int begin, end, i, HadQPS;
  937. X  
  938. X  /* Move to appropriate location */
  939. X+    printf("/CAL%d {\n", CurDay);
  940. X     printf("Border ytop %d xincr mul MinX add xincr\n", WkDayNum);
  941. X  
  942. X  /* Set up the text array */
  943. X***************
  944. X*** 378,386 ****
  945. X  
  946. X  /* Update ymin */
  947. X     printf("/y exch def y ymin lt {/ymin y def} if\n");
  948. X  
  949. X! /* If WkDayNum is a Sunday, move to next row. */
  950. X     if (WkDayNum == 6 || CurDay == MaxDay) {
  951. X        printf("/y ytop MinBoxSize sub def y ymin lt {/ymin y def} if\n");
  952. X  
  953. X  /* Draw the line at the bottom of the row */
  954. X--- 414,440 ----
  955. X  
  956. X  /* Update ymin */
  957. X     printf("/y exch def y ymin lt {/ymin y def} if\n");
  958. X+    printf("} def\n");
  959. X  
  960. X! /* If WkDayNum is a Sunday, move to next row.  Also handle the queued
  961. X!    PS and PSFILE reminders */
  962. X     if (WkDayNum == 6 || CurDay == MaxDay) {
  963. X+       HadQPS = 0;
  964. X+       begin = CurDay - WkDayNum;
  965. X+       if (begin < 1) begin = 1;
  966. X+       end = CurDay;
  967. X+       for (i=begin; i<=end; i++) {
  968. X+      if (PsEntries[i]) {
  969. X+         HadQPS = 1;
  970. X+         break;
  971. X+          }
  972. X+       }
  973. X+       /* Avoid problems with blotching if PS printer has roundoff errors */
  974. X+       if (HadQPS) printf("1 setgray\n");
  975. X+       for (i=begin; i<=end; i++) {
  976. X+          printf("CAL%d\n", i);
  977. X+       }
  978. X+       if (HadQPS) printf("0 setgray\n");
  979. X        printf("/y ytop MinBoxSize sub def y ymin lt {/ymin y def} if\n");
  980. X  
  981. X  /* Draw the line at the bottom of the row */
  982. X***************
  983. X*** 389,394 ****
  984. X--- 443,462 ----
  985. X  /* Update ytop */
  986. X        printf("/ylast ytop def\n");
  987. X        printf("/ytop ymin def\n");
  988. X+ 
  989. X+       (void) DoQueuedPs();
  990. X+ 
  991. X+ /* Re-do the calendar stuff if there was any included PS code */
  992. X+       if (HadQPS) {
  993. X+          printf("/ytop ylast def\n");
  994. X+          for (i=begin; i<=end; i++) {
  995. X+             printf("CAL%d\n", i);
  996. X+          }
  997. X+          printf("/y ytop MinBoxSize sub def y ymin lt {/ymin y def} if\n");
  998. X+          printf("MinX ymin MaxX ymin L\n");
  999. X+          printf("/ylast ytop def\n");
  1000. X+      printf("/ytop ymin def\n");
  1001. X+       }
  1002. X     }
  1003. X  }
  1004. X  
  1005. X***************
  1006. X*** 454,459 ****
  1007. X--- 522,529 ----
  1008. X     BotMarg = 36;
  1009. X     UseISO = 0;
  1010. X  
  1011. X+    for(j=0; j<32; j++) PsEntries[i] = NULL;
  1012. X+ 
  1013. X     CurPage = DefaultPage;  /* Letter size by default */
  1014. X  
  1015. X     while (i < argc) {
  1016. X***************
  1017. X*** 463,468 ****
  1018. X--- 533,543 ----
  1019. X        if (*s++ != '-') Usage("Options must begin with '-'");
  1020. X  
  1021. X        switch(*s++) {
  1022. X+          case 'p':
  1023. X+         if (i == argc) Usage("Prologue filename must be supplied");
  1024. X+         UserProlog = argv[i++];
  1025. X+         break;
  1026. X+ 
  1027. X           case 's':
  1028. X          if (i == argc) Usage("Size must be supplied");
  1029. X          t = argv[i++];
  1030. X***************
  1031. X*** 564,580 ****
  1032. X     fprintf(stderr, "Rem2PS: Produce a PostScript calendar from output of Remind.\n\n");
  1033. X     fprintf(stderr, "Usage: rem2ps [options]\n\n");
  1034. X     fprintf(stderr, "Options:\n\n");
  1035. X!    fprintf(stderr, "-l            Do calendar in landscape mode.\n");
  1036. X     fprintf(stderr, "-c            Do NOT generate small calendars for previous\n");
  1037. X!    fprintf(stderr, "              and next month.\n");
  1038. X     fprintf(stderr, "-i            Use ISO 8859-1 encoding in PostScript output\n");
  1039. X     fprintf(stderr, "-m media      Set page size (eg, Letter, Legal, A4.)  Case sensitive!\n");
  1040. X     fprintf(stderr, "              (Default page size is %s)\n", DefaultPage[0].name);
  1041. X!    fprintf(stderr, "-f[shed] font Set font for small cal, hdr, cal entries and/or day numbers.\n");
  1042. X!    fprintf(stderr, "-s[hed] size  Set size for header, calendar entries and/or day numbers.\n");
  1043. X!    fprintf(stderr, "-b size       Set border size for calendar entries.\n");
  1044. X!    fprintf(stderr, "-t size       Set line thickness.\n");
  1045. X!    fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins.\n");
  1046. X     exit(1);
  1047. X  }
  1048. X  
  1049. X--- 639,656 ----
  1050. X     fprintf(stderr, "Rem2PS: Produce a PostScript calendar from output of Remind.\n\n");
  1051. X     fprintf(stderr, "Usage: rem2ps [options]\n\n");
  1052. X     fprintf(stderr, "Options:\n\n");
  1053. X!    fprintf(stderr, "-p file       Include user-supplied PostScript code in prologue\n");
  1054. X!    fprintf(stderr, "-l            Do calendar in landscape mode\n");
  1055. X     fprintf(stderr, "-c            Do NOT generate small calendars for previous\n");
  1056. X!    fprintf(stderr, "              and next month\n");
  1057. X     fprintf(stderr, "-i            Use ISO 8859-1 encoding in PostScript output\n");
  1058. X     fprintf(stderr, "-m media      Set page size (eg, Letter, Legal, A4.)  Case sensitive!\n");
  1059. X     fprintf(stderr, "              (Default page size is %s)\n", DefaultPage[0].name);
  1060. X!    fprintf(stderr, "-f[shed] font Set font for small cal, hdr, cal entries and/or day numbers\n");
  1061. X!    fprintf(stderr, "-s[hed] size  Set size for header, calendar entries and/or day numbers\n");
  1062. X!    fprintf(stderr, "-b size       Set border size for calendar entries\n");
  1063. X!    fprintf(stderr, "-t size       Set line thickness\n");
  1064. X!    fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins\n");
  1065. X     exit(1);
  1066. X  }
  1067. X  
  1068. X***************
  1069. X*** 632,634 ****
  1070. X--- 708,782 ----
  1071. X     printf("grestore\n");
  1072. X  }
  1073. X  
  1074. X+ /***************************************************************/
  1075. X+ /*                                                             */
  1076. X+ /*  DoQueuedPs - do the queued PS and PSFILE reminders.        */
  1077. X+ /*                                                             */
  1078. X+ /***************************************************************/
  1079. X+ #ifdef HAVE_PROTOS
  1080. X+ PUBLIC int DoQueuedPs(void)
  1081. X+ #else
  1082. X+ int DoQueuedPs()
  1083. X+ #endif
  1084. X+ {
  1085. X+    int i;
  1086. X+    int HadPS = 0;
  1087. X+    int wd;
  1088. X+    int begin, end;
  1089. X+    int nread;
  1090. X+    CalEntry *e, *n;
  1091. X+    FILE *fp;
  1092. X+    int fnoff;
  1093. X+    char buffer[LINELEN];
  1094. X+ 
  1095. X+    begin = CurDay - WkDayNum;
  1096. X+    wd = 0;
  1097. X+    while (begin < 1) begin++, wd++;
  1098. X+    end = CurDay;
  1099. X+    for (i=begin; i<=end; i++, wd++) {
  1100. X+       e = PsEntries[i];
  1101. X+ 
  1102. X+       if (e) {
  1103. X+          HadPS = 1;
  1104. X+          printf("/SAVESTATE save def\n");
  1105. X+ 
  1106. X+          /* Translate coordinates to bottom of calendar box */
  1107. X+          printf("%d xincr mul MinX add ytop translate\n", wd);
  1108. X+ 
  1109. X+          /* Set up convenient variables */
  1110. X+          printf("/BoxWidth xincr def\n/BoxHeight ylast ytop sub def\n");
  1111. X+      printf("/InBoxHeight BoxHeight border sub DaySize sub DaySize sub 2 add EntrySize add def \n");
  1112. X+       }
  1113. X+ 
  1114. X+       while (e) {
  1115. X+ 
  1116. X+ /* Now do the user's PostScript code */
  1117. X+          fnoff = 1;
  1118. X+      while (isspace(*(e->entry+fnoff))) fnoff++;
  1119. X+          if (*(e->entry) == 'P') {
  1120. X+         printf("%s\n", e->entry+fnoff);
  1121. X+          } else {
  1122. X+         fp = fopen(e->entry+fnoff, "r");
  1123. X+         if (!fp) {
  1124. X+            fprintf(stderr, "Could not open PostScript file '%s'\n", e->entry+1);
  1125. X+             } else {
  1126. X+            while(1) {
  1127. X+               nread = fread(buffer, sizeof(char), LINELEN, fp);
  1128. X+           if (!nread) break;
  1129. X+           fwrite(buffer, sizeof(char), nread, stdout);
  1130. X+                }
  1131. X+            fclose(fp);
  1132. X+             }
  1133. X+          }
  1134. X+ 
  1135. X+ /* Free the entry */
  1136. X+          free(e->entry);
  1137. X+      n = e->next;
  1138. X+      free(e);
  1139. X+      e = n;
  1140. X+       }
  1141. X+       if (PsEntries[i]) printf("\n SAVESTATE restore\n");
  1142. X+       PsEntries[i] = NULL;
  1143. X+    }
  1144. X+    return HadPS;
  1145. X+ }
  1146. X*** ../p5rel/rem2ps.h    Thu Apr 22 10:24:26 1993
  1147. X--- ./rem2ps.h    Mon May  3 10:36:51 1993
  1148. X***************
  1149. X*** 11,16 ****
  1150. X--- 11,18 ----
  1151. X  
  1152. X  char *PSProlog1[] =
  1153. X  {
  1154. X+    "% This file was produced by Remind and Rem2PS, written by",
  1155. X+    "% David F. Skoll.",
  1156. X     "/ISOLatin1Encoding where { pop save true }{ false } ifelse",
  1157. X     "  /ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus",
  1158. X     "    StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute",
  1159. X***************
  1160. X*** 200,204 ****
  1161. X--- 202,208 ----
  1162. X     "    forall",
  1163. X     "} bind def",
  1164. X     "2 setlinecap",
  1165. X+    "% Define a default PreCal procedure",
  1166. X+    "/PreCal { pop pop } bind def",
  1167. X     NULL
  1168. X  };
  1169. X*** ../p5rel/remind-all.csh    Thu Apr 22 10:24:14 1993
  1170. X--- ./remind-all.csh    Tue Apr 27 11:00:15 1993
  1171. X***************
  1172. X*** 31,40 ****
  1173. X  # Scan each user's directory for a .reminders file
  1174. X  foreach i ($USERS)
  1175. X     if (-r ~$i/.reminders) then
  1176. X- 
  1177. X  #     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  1178. X  
  1179. X!       $REMIND -u$i -h -r -q ~$i/.reminders < /dev/null > $REMFILE
  1180. X        if (! -z $REMFILE) then
  1181. X  #        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  1182. X  
  1183. X--- 31,39 ----
  1184. X  # Scan each user's directory for a .reminders file
  1185. X  foreach i ($USERS)
  1186. X     if (-r ~$i/.reminders) then
  1187. X  #     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  1188. X  
  1189. X!       $REMIND -u$i -h -r -q -iremind_all=1 ~$i/.reminders < /dev/null > $REMFILE
  1190. X        if (! -z $REMFILE) then
  1191. X  #        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  1192. X  
  1193. X*** ../p5rel/remind-all.sh    Thu Apr 22 10:24:14 1993
  1194. X--- ./remind-all.sh    Tue Apr 27 10:59:25 1993
  1195. X***************
  1196. X*** 36,42 ****
  1197. X  
  1198. X  #     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  1199. X  
  1200. X!       $REMIND -u$i -h -r -q $HOME/.reminders < /dev/null > $REMFILE
  1201. X        if [ -s $REMFILE ]; then
  1202. X  #        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  1203. X           $MAIL -s "Reminders" $i < $REMFILE
  1204. X--- 36,42 ----
  1205. X  
  1206. X  #     echo "$i has a .reminders file."     DEBUGGING PURPOSES ONLY
  1207. X  
  1208. X!       $REMIND -u$i -h -r -q -iremind_all=1 $HOME/.reminders < /dev/null > $REMFILE
  1209. X        if [ -s $REMFILE ]; then
  1210. X  #        echo "Sending mail to $i"         DEBUGGING PURPOSES ONLY
  1211. X           $MAIL -s "Reminders" $i < $REMFILE
  1212. X*** ../p5rel/remind.1    Thu Apr 22 10:24:17 1993
  1213. X--- ./remind.1    Mon May  3 15:28:18 1993
  1214. X***************
  1215. X*** 175,180 ****
  1216. X--- 175,185 ----
  1217. X  and user name, respectively, of the specified user.  LOGNAME is also
  1218. X  set to the specified user name.  This option is meant for
  1219. X  use in shell scripts which mail reminders to all users.
  1220. X+ .TP
  1221. X+ \fB\-i\fR\fIvar\fR\fB=\fR\fIexpr\fR
  1222. X+ Sets the value of the specified \fIvar\fR to \fIexpr\fR, and \fBpreserves\fR
  1223. X+ \fIvar\fR.  \fIExpr\fR can be any valid \fBRemind\fR expression.  See the
  1224. X+ section "Initializing Variables on the Command Line" for more details.
  1225. X  .PP
  1226. X  If you supply a \fIdate\fR on the command line, it must consist of
  1227. X  \fIday month year\fR, where \fIday\fR is the day of the month,
  1228. X***************
  1229. X*** 233,245 ****
  1230. X  [\fBAT\fR \fItime\fR [\fItdelta\fR] [\fItrepeat\fR]]
  1231. X  [\fBUNTIL\fR \fIexpiry_date\fR]
  1232. X  [\fBSCANFROM\fR \fIscan_date\fR]
  1233. X! \fBMSG\fR | \fBRUN\fR | \fBCAL\fR | \fBSATISFY\fR
  1234. X  .I body
  1235. X  .RE
  1236. X  .PP
  1237. X  The parts of the \fBREM\fR command can be specified in any order, except
  1238. X  that the \fIbody\fR must come immediately after the \fBMSG\fR,
  1239. X! \fBRUN\fR, \fBCAL\fR or \fBSATISFY\fR keyword.
  1240. X  .PP
  1241. X  The \fBREM\fR token is optional, providing that the remainder
  1242. X  of the command cannot be mistaken for another \fBRemind\fR command
  1243. X--- 238,250 ----
  1244. X  [\fBAT\fR \fItime\fR [\fItdelta\fR] [\fItrepeat\fR]]
  1245. X  [\fBUNTIL\fR \fIexpiry_date\fR]
  1246. X  [\fBSCANFROM\fR \fIscan_date\fR]
  1247. X! \fBMSG\fR | \fBRUN\fR | \fBCAL\fR | \fBSATISFY\fR | \fBPS\fR | \fBPSFILE\fR
  1248. X  .I body
  1249. X  .RE
  1250. X  .PP
  1251. X  The parts of the \fBREM\fR command can be specified in any order, except
  1252. X  that the \fIbody\fR must come immediately after the \fBMSG\fR,
  1253. X! \fBRUN\fR, \fBCAL\fR, \fBPS\fR, \fBPSFILE\fR or \fBSATISFY\fR keyword.
  1254. X  .PP
  1255. X  The \fBREM\fR token is optional, providing that the remainder
  1256. X  of the command cannot be mistaken for another \fBRemind\fR command
  1257. X***************
  1258. X*** 247,255 ****
  1259. X  before the \fBMSG\fR, \fBRUN\fR, \fBCAL\fR or \fBSATISFY\fR clause
  1260. X  is called a \fItrigger\fR.
  1261. X  .PP
  1262. X! .B MSG, RUN, and CAL
  1263. X  .PP
  1264. X! The keywords \fBMSG\fR, \fBRUN\fR and \fBCAL\fR denote the \fItype\fR
  1265. X  of the reminder.  (\fBSATISFY\fR is more complicated and will be explained
  1266. X  later.)  A \fBMSG\fR-type reminder normally prints a message to the standard
  1267. X  output, after passing the \fIbody\fR through a special substitution filter,
  1268. X--- 252,260 ----
  1269. X  before the \fBMSG\fR, \fBRUN\fR, \fBCAL\fR or \fBSATISFY\fR clause
  1270. X  is called a \fItrigger\fR.
  1271. X  .PP
  1272. X! .B MSG, RUN, CAL, PS and PSFILE
  1273. X  .PP
  1274. X! These keywords denote the \fItype\fR
  1275. X  of the reminder.  (\fBSATISFY\fR is more complicated and will be explained
  1276. X  later.)  A \fBMSG\fR-type reminder normally prints a message to the standard
  1277. X  output, after passing the \fIbody\fR through a special substitution filter,
  1278. X***************
  1279. X*** 264,269 ****
  1280. X--- 269,283 ----
  1281. X  is used only to place entries in the calendar produced when \fBRemind\fR
  1282. X  is run with the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR options.
  1283. X  .PP
  1284. X+ A \fBPS\fR or \fBPSFILE\fR-type reminder is used to pass PostScript code
  1285. X+ directly to the printer when producing PostScript calendars.  This can
  1286. X+ be used to shade certain calendar entries, include graphics in the calendar,
  1287. X+ or almost any other purpose you can think of.  You
  1288. X+ should not use these types of reminders unless you are an expert PostScript
  1289. X+ programmer.  The \fBPS\fR and \fBPSFILE\fR reminders are ignored unless
  1290. X+ \fBRemind\fR is run with the \fB\-p\fR option.  See the section
  1291. X+ "More about PostScript" for more details.
  1292. X+ .PP
  1293. X  .B DATE SPECIFICATIONS
  1294. X  .PP
  1295. X  A \fIdate_spec\fR consists of zero to four parts.
  1296. X***************
  1297. X*** 2267,2272 ****
  1298. X--- 2281,2389 ----
  1299. X  places the time of timed reminders in the calendar according to the
  1300. X  \fB\-b\fR command-line option.
  1301. X  .PP
  1302. X+ .SH INITIALIZING VARIABLES ON THE COMMAND LINE
  1303. X+ .PP
  1304. X+ The \fB\-i\fR option is used to initialize variables on the \fBRemind\fR
  1305. X+ command line.  The format is \fB\-i\fR\fIvar\fR\fB=\fR\fIexpr\fR, where
  1306. X+ \fIexpr\fR is any valid expression.  Note that you may have to use quotes
  1307. X+ or escapes to prevent the shell from interpreting special characters in
  1308. X+ \fIexpr\fR.  You can have as many \fB\-i\fR options as you want on the
  1309. X+ command line, and they are processed in order.  Thus, if a variable is defined
  1310. X+ in one \fB\-i\fR option, it can be referred to by subsequent \fB\-i\fR
  1311. X+ options.
  1312. X+ .PP
  1313. X+ Note that if you supply a date on the command line, it is not parsed until
  1314. X+ all options have been processed.  Thus, if you use \fBtoday()\fR in any
  1315. X+ of the \fB\-i\fR expressions, it will return the same value as
  1316. X+ \fBrealtoday()\fR and not the date supplied on the command line.
  1317. X+ .PP
  1318. X+ Any variables defined on the command line are \fBpreserved\fR as with the
  1319. X+ \fBPRESERVE\fR command.
  1320. X+ .PP
  1321. X+ You should not have any spaces between the \fB\-i\fR option and the equal
  1322. X+ sign; otherwise, strange variable names are created which can only be accessed
  1323. X+ with the \fBvalue()\fR or \fBdefined()\fR functions.
  1324. X+ .PP
  1325. X+ If your site uses the \fBRemind-all\fR shell script to mail reminders
  1326. X+ to users, the script will initialize the variable \fIremind_all\fR to 1
  1327. X+ using the \fB\-i\fR option.  Thus, you can detect when your reminder
  1328. X+ script is being processed by \fBRemind-all\fR and can use this information
  1329. X+ to control which reminders you want mailed to you.
  1330. X+ .PP
  1331. X+ .SH MORE ABOUT POSTSCRIPT
  1332. X+ .PP
  1333. X+ The \fBPS\fR and \fBPSFILE\fR reminders pass PostScript code directly
  1334. X+ to the printer.  They differ in that the \fBPS\fR-type reminder passes
  1335. X+ its body directly to the PostScript output (after processing by the
  1336. X+ substitution filter) while the \fBPSFILE\fR-type's body should
  1337. X+ simply consist of a filename.  The \fBRem2ps\fR program will open the
  1338. X+ file named in the \fBPSFILE\fR-type reminder, and include its contents in
  1339. X+ the PostScript output.
  1340. X+ .PP
  1341. X+ The PostScript-type reminders for a particular day are included in the
  1342. X+ PostScript output in the same order they were triggered in the \fBRemind\fR
  1343. X+ script file.  All of the PostScript code for a particular date is enclosed
  1344. X+ in a \fBsave\fR-\fBrestore\fR pair.  However, if several PostScript-type
  1345. X+ reminders are triggered for a single day, each section of PostScript is
  1346. X+ not enclosed in a \fBsave\fR-\fBrestore\fR pair - instead, the entire
  1347. X+ body of included PostScript is enclosed.
  1348. X+ .PP
  1349. X+ PostScript-type reminders are executed by the PostScript printer before any
  1350. X+ regular calendar entries.  Thus, regular calendar entries will overlay
  1351. X+ the PostScript-type reminders, allowing you to create shaded or graphical
  1352. X+ backgrounds for particular days.
  1353. X+ .PP
  1354. X+ Before executing your PostScript code, the origin of the PostScript coordinate
  1355. X+ system is positioned to the bottom left-hand corner of the "box" in the
  1356. X+ calendar representing \fBtoday()\fR.  This location is exactly in the middle
  1357. X+ of the intersection of the bottom and left black lines delineating the box -
  1358. X+ you may have to account for the thickness of these lines when calculating
  1359. X+ positions.
  1360. X+ .PP
  1361. X+ Several PostScript variables are available to the PostScript code you supply.
  1362. X+ All distance and size variables are in PostScript units (1/72 inch.)  The
  1363. X+ variables are:
  1364. X+ .TP
  1365. X+ LineWidth
  1366. X+ The width of the black grid lines making up the calendar.
  1367. X+ .TP
  1368. X+ Border
  1369. X+ The border between the center of the grid lines and the space used to print
  1370. X+ calendar entries.  This border is normally blank space.
  1371. X+ .TP
  1372. X+ BoxWidth and BoxHeight
  1373. X+ The width and height of the calendar box, from center-to-center of the
  1374. X+ black gridlines.
  1375. X+ .TP
  1376. X+ InBoxHeight
  1377. X+ The height from the center of the bottom black gridline to the top
  1378. X+ of the regular calendar entry area.  The space from here to the top
  1379. X+ of the box is used only to draw the day number.
  1380. X+ .TP
  1381. X+ /DayFont, /EntryFont, /SmallFont and /HeadFont
  1382. X+ The fonts used to draw the day numbers, the calendar entries, the small
  1383. X+ calendars, and the month and day headings, respectively.
  1384. X+ .TP
  1385. X+ DaySize, EntrySize and HeadSize
  1386. X+ The sizes of the above fonts.  (The size of the small calendar font
  1387. X+ is \fInot\fR defined here.)  For example, if you wanted to print
  1388. X+ the Hebrew date next to the regular day number in the calendar, use:
  1389. X+ .PP
  1390. X+ .nf
  1391. X+     REM PS Border BoxHeight Border sub DaySize sub moveto \\
  1392. X+        /DayFont findfont DaySize scalefont setfont \\
  1393. X+        ([hebday(today())] [hebmon(today())]) show
  1394. X+ .fi
  1395. X+ .PP
  1396. X+ .RS
  1397. X+ Note how /DayFont and DaySize are used.
  1398. X+ .RE
  1399. X+ .PP
  1400. X+ Note that if you supply PostScript code, it is possible to produce invalid
  1401. X+ PostScript files.  Always test your PostScript thoroughly with a PostScript
  1402. X+ viewer before sending it to the printer.  You should not use any document
  1403. X+ structuring comments in your PostScript code.
  1404. X+ .PP
  1405. X  .SH DAEMON MODE
  1406. X  .PP
  1407. X  If you use the \fB\-z\fR command-line option, \fBRemind\fR runs in the
  1408. X***************
  1409. X*** 2732,2736 ****
  1410. X  substitution buffer length, number of global \fBOMIT\fRs, etc.
  1411. X  .PP
  1412. X  .SH SEE ALSO
  1413. X! .pp
  1414. X  rem, elm, kall, rem2ps
  1415. X--- 2849,2853 ----
  1416. X  substitution buffer length, number of global \fBOMIT\fRs, etc.
  1417. X  .PP
  1418. X  .SH SEE ALSO
  1419. X! .PP
  1420. X  rem, elm, kall, rem2ps
  1421. X*** ../p5rel/test.cmp    Thu Apr 22 10:24:19 1993
  1422. X--- ./test.cmp    Fri Apr 23 12:59:58 1993
  1423. X***************
  1424. X*** 631,637 ****
  1425. X  "a05" + "6" => "a056"
  1426. X  value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  1427. X  set a058 version()
  1428. X! version() => "03.00.05"
  1429. X  set a059 wkday(today())
  1430. X  today() => 1991/02/16
  1431. X  wkday(1991/02/16) => "Saturday"
  1432. X--- 631,637 ----
  1433. X  "a05" + "6" => "a056"
  1434. X  value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  1435. X  set a058 version()
  1436. X! version() => "03.00.06"
  1437. X  set a059 wkday(today())
  1438. X  today() => 1991/02/16
  1439. X  wkday(1991/02/16) => "Saturday"
  1440. X***************
  1441. X*** 735,741 ****
  1442. X          a048  "foo"
  1443. X          a067  "INT"
  1444. X          a039  "February"
  1445. X!         a058  "03.00.05"
  1446. X          a049  21
  1447. X          a068  "STRING"
  1448. X          a059  "Saturday"
  1449. X--- 735,741 ----
  1450. X          a048  "foo"
  1451. X          a067  "INT"
  1452. X          a039  "February"
  1453. X!         a058  "03.00.06"
  1454. X          a049  21
  1455. X          a068  "STRING"
  1456. X          a059  "Saturday"
  1457. X*** ../p5rel/token.c    Thu Apr 22 10:59:12 1993
  1458. X--- ./token.c    Fri Apr 30 13:14:20 1993
  1459. X***************
  1460. X*** 75,80 ****
  1461. X--- 75,82 ----
  1462. X     { "once",         3,     T_Once,        0 },
  1463. X     { "pop-omit-context", 3,    T_Pop,        0 },
  1464. X     { "preserve",        8,      T_Preserve,     0 },
  1465. X+    { "ps",         2,     T_RemType,     PS_TYPE },
  1466. X+    { "psfile",         6,     T_RemType,     PSF_TYPE },
  1467. X     { "push-omit-context", 4,     T_Push,        0 },
  1468. X     { "rem",        3,    T_Rem,        0 },
  1469. X     { "run",         3,     T_RemType,     RUN_TYPE },
  1470. X*** ../p5rel/types.h    Thu Apr 22 10:24:21 1993
  1471. X--- ./types.h    Fri Apr 30 13:13:31 1993
  1472. X***************
  1473. X*** 98,103 ****
  1474. X--- 98,105 ----
  1475. X  #define RUN_TYPE 2
  1476. X  #define CAL_TYPE 3
  1477. X  #define SAT_TYPE 4
  1478. X+ #define PS_TYPE  5
  1479. X+ #define PSF_TYPE 6
  1480. X  
  1481. X  /* DEFINES for debugging flags */
  1482. X  #define DB_PRTLINE   1
  1483. END_OF_FILE
  1484.   if test 46327 -ne `wc -c <'patch.06'`; then
  1485.     echo shar: \"'patch.06'\" unpacked with wrong size!
  1486.   fi
  1487.   # end of 'patch.06'
  1488. fi
  1489. echo shar: End of archive 1 \(of 1\).
  1490. cp /dev/null ark1isdone
  1491. MISSING=""
  1492. for I in 1 ; do
  1493.     if test ! -f ark${I}isdone ; then
  1494.     MISSING="${MISSING} ${I}"
  1495.     fi
  1496. done
  1497. if test "${MISSING}" = "" ; then
  1498.     echo You have the archive.
  1499.     rm -f ark[1-9]isdone
  1500. else
  1501.     echo You still must unpack the following archives:
  1502.     echo "        " ${MISSING}
  1503. fi
  1504. exit 0
  1505. exit 0 # Just in case...
  1506.