home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume39 / remind / patch08b < prev    next >
Encoding:
Text File  |  1993-09-08  |  63.4 KB  |  2,113 lines

  1. Newsgroups: comp.sources.misc
  2. From: <dfs@doe.carleton.ca> (David F. Skoll)
  3. Subject: v39i080:  remind - A replacement for calendar, Patch08b/3
  4. Message-ID: <1993Sep8.123029.22076@sparky.sterling.com>
  5. X-Md4-Signature: 33bf37acbbe6b92f515c94fea201b8af
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Sterling Software
  8. Date: Wed, 8 Sep 1993 12:30:29 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: <dfs@doe.carleton.ca> (David F. Skoll)
  12. Posting-number: Volume 39, Issue 80
  13. Archive-name: remind/patch08b
  14. Environment: UNIX, MS-DOS, OS/2
  15. Patch-To: remind: Volume 33, Issue 58-69
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  patch.08.C
  22. # Wrapped by kent@sparky on Wed Sep  8 07:12:55 1993
  23. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 2 (of 3)."'
  26. if test -f 'patch.08.C' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'patch.08.C'\"
  28. else
  29.   echo shar: Extracting \"'patch.08.C'\" \(60678 characters\)
  30.   sed "s/^X//" >'patch.08.C' <<'END_OF_FILE'
  31. X*** ../prev/init.c    Mon Jun 28 12:29:50 1993
  32. X--- ./init.c    Fri Aug 20 11:46:29 1993
  33. X***************
  34. X*** 10,15 ****
  35. X--- 10,16 ----
  36. X  /*  Copyright (C) 1992, 1993 by David F. Skoll.                */
  37. X  /*                                                             */
  38. X  /***************************************************************/
  39. X+ #define L_IN_INIT 1
  40. X  #include "config.h"
  41. X  #include <stdio.h>
  42. X  #ifdef HAVE_STDLIB_H
  43. X***************
  44. X*** 29,37 ****
  45. X  #include "types.h"
  46. X  #include "protos.h"
  47. X  #include "expr.h"
  48. X- #include "globals.h"
  49. X  #include "err.h"
  50. X  #include "version.h"
  51. X  
  52. X  /***************************************************************
  53. X   *
  54. X--- 30,38 ----
  55. X  #include "types.h"
  56. X  #include "protos.h"
  57. X  #include "expr.h"
  58. X  #include "err.h"
  59. X  #include "version.h"
  60. X+ #include "globals.h"
  61. X  
  62. X  /***************************************************************
  63. X   *
  64. X***************
  65. X*** 65,70 ****
  66. X--- 66,72 ----
  67. X   *             by non-root, changes environment but not effective uid.
  68. X   *  -kcmd    = Run 'cmd' for MSG-type reminders instead of printing to stdout
  69. X   *  -iVAR=EXPR = Initialize and preserve VAR.
  70. X+  *  A minus sign alone indicates to take input from stdin
  71. X   *
  72. X   **************************************************************/
  73. X  
  74. X***************
  75. X*** 111,117 ****
  76. X  
  77. X     RealToday = SystemDate(&CurYear, &CurMon, &CurDay);
  78. X     if (RealToday < 0) {
  79. X!       fprintf(ErrFp, "Illegal system date: Year is less than %d\n", BASE);
  80. X        exit(1);
  81. X     }
  82. X     JulianToday = RealToday;
  83. X--- 113,119 ----
  84. X  
  85. X     RealToday = SystemDate(&CurYear, &CurMon, &CurDay);
  86. X     if (RealToday < 0) {
  87. X!       fprintf(ErrFp, ErrMsg[M_BAD_SYS_DATE], BASE);
  88. X        exit(1);
  89. X     }
  90. X     JulianToday = RealToday;
  91. X***************
  92. X*** 129,140 ****
  93. X     i = 1;
  94. X     while (i < argc) {
  95. X        arg = argv[i];
  96. X!       if (*arg != '-') break;  /* Exit the loop if it's not an option */
  97. X        i++;
  98. X        arg++;
  99. X! 
  100. X        while (*arg) {
  101. X           switch(*arg++) {
  102. X              case 'i':
  103. X          case 'I':
  104. X             InitializeVar(arg);
  105. X--- 131,148 ----
  106. X     i = 1;
  107. X     while (i < argc) {
  108. X        arg = argv[i];
  109. X!       if (*arg != '-') break; /* Exit the loop if it's not an option */
  110. X        i++;
  111. X        arg++;
  112. X!       if (!*arg) {
  113. X!          UseStdin = 1;
  114. X!      IgnoreOnce = 1;
  115. X!      i--;
  116. X!      break;
  117. X!       }
  118. X        while (*arg) {
  119. X           switch(*arg++) {
  120. X+ 
  121. X              case 'i':
  122. X          case 'I':
  123. X             InitializeVar(arg);
  124. X***************
  125. X*** 286,292 ****
  126. X               case 'v': case 'V': DebugFlag |= DB_DUMP_VARS; break;
  127. X               case 'l': case 'L': DebugFlag |= DB_PRTLINE;   break;
  128. X               default:
  129. X!                 fprintf(ErrFp, "Unknown debug flag '%c'\n", *(arg-1));
  130. X            }
  131. X                 }
  132. X             break;
  133. X--- 294,300 ----
  134. X               case 'v': case 'V': DebugFlag |= DB_DUMP_VARS; break;
  135. X               case 'l': case 'L': DebugFlag |= DB_PRTLINE;   break;
  136. X               default:
  137. X!                 fprintf(ErrFp, ErrMsg[M_BAD_DB_FLAG], *(arg-1));
  138. X            }
  139. X                 }
  140. X             break;
  141. X***************
  142. X*** 316,335 ****
  143. X             break;
  144. X  
  145. X          default:
  146. X!            fprintf(ErrFp, "Unknown option '%c'\n", *(arg-1));
  147. X       }
  148. X  
  149. X        }
  150. X     }
  151. X  
  152. X- 
  153. X     /* Get the filename. */
  154. X     if (i >= argc) {
  155. X        Usage();
  156. X        exit(1);
  157. X     }
  158. X!    InitialFile = argv[i];
  159. X!    i++;
  160. X  
  161. X     /* Get the date, if any */
  162. X     if (i < argc) {
  163. X--- 324,341 ----
  164. X             break;
  165. X  
  166. X          default:
  167. X!            fprintf(ErrFp, ErrMsg[M_BAD_OPTION], *(arg-1));
  168. X       }
  169. X  
  170. X        }
  171. X     }
  172. X  
  173. X     /* Get the filename. */
  174. X     if (i >= argc) {
  175. X        Usage();
  176. X        exit(1);
  177. X     }
  178. X!    InitialFile = argv[i++];
  179. X  
  180. X     /* Get the date, if any */
  181. X     if (i < argc) {
  182. X***************
  183. X*** 387,402 ****
  184. X  /*  Print the usage info.                                      */
  185. X  /*                                                             */
  186. X  /***************************************************************/
  187. X  #ifdef HAVE_PROTOS
  188. X  PUBLIC void Usage(void)
  189. X  #else
  190. X  void Usage()
  191. X! #endif
  192. X  {
  193. X     fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992, 1993 by David F. Skoll\n", VERSION, L_LANGNAME);
  194. X  #ifdef BETA
  195. X     fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
  196. X! #endif   
  197. X     fprintf(ErrFp, "Usage: remind [options] filename [date]\n");
  198. X     fprintf(ErrFp, "Options:\n");
  199. X     fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  200. X--- 393,409 ----
  201. X  /*  Print the usage info.                                      */
  202. X  /*                                                             */
  203. X  /***************************************************************/
  204. X+ #ifndef L_USAGE_OVERRIDE
  205. X  #ifdef HAVE_PROTOS
  206. X  PUBLIC void Usage(void)
  207. X  #else
  208. X  void Usage()
  209. X! #endif /* HAVE_PROTOS */
  210. X  {
  211. X     fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992, 1993 by David F. Skoll\n", VERSION, L_LANGNAME);
  212. X  #ifdef BETA
  213. X     fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
  214. X! #endif
  215. X     fprintf(ErrFp, "Usage: remind [options] filename [date]\n");
  216. X     fprintf(ErrFp, "Options:\n");
  217. X     fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  218. X***************
  219. X*** 425,431 ****
  220. X     fprintf(ErrFp, " -ivar=val Initialize var to val and preserve var\n");
  221. X     exit(1);
  222. X  }
  223. X! 
  224. X  /***************************************************************/
  225. X  /*                                                             */
  226. X  /*  ChgUser                                                    */
  227. X--- 432,438 ----
  228. X     fprintf(ErrFp, " -ivar=val Initialize var to val and preserve var\n");
  229. X     exit(1);
  230. X  }
  231. X! #endif /* L_USAGE_OVERRIDE */
  232. X  /***************************************************************/
  233. X  /*                                                             */
  234. X  /*  ChgUser                                                    */
  235. X***************
  236. X*** 451,457 ****
  237. X     int myuid;
  238. X  #endif
  239. X  
  240. X-    static char *NoEnvMem = "Remind: Out of memory for environment\n";
  241. X     struct passwd *pwent;
  242. X     static char *home, *shell, *username, *logname;
  243. X  
  244. X--- 458,463 ----
  245. X***************
  246. X*** 460,482 ****
  247. X     pwent = getpwnam(user);
  248. X  
  249. X     if (!pwent) {
  250. X!       fprintf(ErrFp, "Remind: Unknown user '%s'\n", user);
  251. X        exit(1);
  252. X     }
  253. X  
  254. X     if (!myuid && setgid(pwent->pw_gid)) {
  255. X!       fprintf(ErrFp, "Remind: Could not change gid to %d\n", pwent->pw_gid);
  256. X        exit(1);
  257. X     }
  258. X  
  259. X     if (!myuid && setuid(pwent->pw_uid)) {
  260. X!       fprintf(ErrFp, "Remind: Could not change uid to %d\n", pwent->pw_uid);
  261. X        exit(1);
  262. X     }
  263. X  
  264. X     home = malloc(strlen(pwent->pw_dir) + 6);
  265. X     if (!home) {
  266. X!       fprintf(ErrFp, NoEnvMem);
  267. X        exit(1);
  268. X     }
  269. X     sprintf(home, "HOME=%s", pwent->pw_dir);
  270. X--- 466,488 ----
  271. X     pwent = getpwnam(user);
  272. X  
  273. X     if (!pwent) {
  274. X!       fprintf(ErrFp, ErrMsg[M_BAD_USER], user);
  275. X        exit(1);
  276. X     }
  277. X  
  278. X     if (!myuid && setgid(pwent->pw_gid)) {
  279. X!       fprintf(ErrFp, ErrMsg[M_NO_CHG_GID], pwent->pw_gid);
  280. X        exit(1);
  281. X     }
  282. X  
  283. X     if (!myuid && setuid(pwent->pw_uid)) {
  284. X!       fprintf(ErrFp, ErrMsg[M_NO_CHG_UID], pwent->pw_uid);
  285. X        exit(1);
  286. X     }
  287. X  
  288. X     home = malloc(strlen(pwent->pw_dir) + 6);
  289. X     if (!home) {
  290. X!       fprintf(ErrFp, ErrMsg[M_NOMEM_ENV]);
  291. X        exit(1);
  292. X     }
  293. X     sprintf(home, "HOME=%s", pwent->pw_dir);
  294. X***************
  295. X*** 484,490 ****
  296. X  
  297. X     shell = malloc(strlen(pwent->pw_shell) + 7);
  298. X     if (!shell) {
  299. X!       fprintf(ErrFp, NoEnvMem);
  300. X        exit(1);
  301. X     }
  302. X     sprintf(shell, "SHELL=%s", pwent->pw_shell);
  303. X--- 490,496 ----
  304. X  
  305. X     shell = malloc(strlen(pwent->pw_shell) + 7);
  306. X     if (!shell) {
  307. X!       fprintf(ErrFp, ErrMsg[M_NOMEM_ENV]);
  308. X        exit(1);
  309. X     }
  310. X     sprintf(shell, "SHELL=%s", pwent->pw_shell);
  311. X***************
  312. X*** 493,499 ****
  313. X     if (pwent->pw_uid) {
  314. X        username = malloc(strlen(pwent->pw_name) + 6);
  315. X        if (!username) {
  316. X!          fprintf(ErrFp, NoEnvMem);
  317. X           exit(1);
  318. X        }
  319. X        sprintf(username, "USER=%s", pwent->pw_name);
  320. X--- 499,505 ----
  321. X     if (pwent->pw_uid) {
  322. X        username = malloc(strlen(pwent->pw_name) + 6);
  323. X        if (!username) {
  324. X!          fprintf(ErrFp, ErrMsg[M_NOMEM_ENV]);
  325. X           exit(1);
  326. X        }
  327. X        sprintf(username, "USER=%s", pwent->pw_name);
  328. X***************
  329. X*** 500,506 ****
  330. X        putenv(username);
  331. X        logname= malloc(strlen(pwent->pw_name) + 9);
  332. X        if (!logname) {
  333. X!          fprintf(ErrFp, NoEnvMem);
  334. X           exit(1);
  335. X        }
  336. X        sprintf(logname, "LOGNAME=%s", pwent->pw_name);
  337. X--- 506,512 ----
  338. X        putenv(username);
  339. X        logname= malloc(strlen(pwent->pw_name) + 9);
  340. X        if (!logname) {
  341. X!          fprintf(ErrFp, ErrMsg[M_NOMEM_ENV]);
  342. X           exit(1);
  343. X        }
  344. X        sprintf(logname, "LOGNAME=%s", pwent->pw_name);
  345. X***************
  346. X*** 524,530 ****
  347. X  #endif
  348. X  {
  349. X     char *varname, *expr;
  350. X-    static char Err[] = "Remind: -i option: %s\n";
  351. X  
  352. X     Value val;
  353. X  
  354. X--- 530,535 ----
  355. X***************
  356. X*** 534,576 ****
  357. X     varname = str;
  358. X     while (*str && *str != '=') str++;
  359. X     if (!*str) {
  360. X!       fprintf(ErrFp, Err, "Missing '=' sign");
  361. X        return;
  362. X     }
  363. X     *str = 0;
  364. X     if (!*varname) {
  365. X!       fprintf(ErrFp, Err, "Missing varname");
  366. X        return;
  367. X     }
  368. X     expr = str+1;
  369. X     if (!*expr) {
  370. X!       fprintf(ErrFp, Err, "Missing expr");
  371. X        return;
  372. X     }
  373. X  
  374. X     r=EvalExpr(&expr, &val);
  375. X     if (r) {
  376. X!       fprintf(ErrFp, Err, ErrMsg[r]);
  377. X        return;
  378. X     }
  379. X  
  380. X     if (*varname == '$') {
  381. X        if (val.type != INT_TYPE) {
  382. X!          fprintf(ErrFp, Err, ErrMsg[E_BAD_TYPE]);
  383. X       return;
  384. X        }
  385. X        r=SetSysVar(varname+1, val.v.val);
  386. X!       if (r) fprintf(ErrFp, Err, ErrMsg[r]);
  387. X        return;
  388. X     }
  389. X  
  390. X     r=SetVar(varname, &val);
  391. X     if (r) {
  392. X!       fprintf(ErrFp, Err, ErrMsg[r]);
  393. X        return;
  394. X     }
  395. X     r=PreserveVar(varname);
  396. X!    if (r) fprintf(ErrFp, Err, ErrMsg[r]);
  397. X     return;
  398. X  }
  399. X  
  400. X--- 539,581 ----
  401. X     varname = str;
  402. X     while (*str && *str != '=') str++;
  403. X     if (!*str) {
  404. X!       fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_EQ]);
  405. X        return;
  406. X     }
  407. X     *str = 0;
  408. X     if (!*varname) {
  409. X!       fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_VAR]);
  410. X        return;
  411. X     }
  412. X     expr = str+1;
  413. X     if (!*expr) {
  414. X!       fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_EXPR]);
  415. X        return;
  416. X     }
  417. X  
  418. X     r=EvalExpr(&expr, &val);
  419. X     if (r) {
  420. X!       fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
  421. X        return;
  422. X     }
  423. X  
  424. X     if (*varname == '$') {
  425. X        if (val.type != INT_TYPE) {
  426. X!          fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_BAD_TYPE]);
  427. X       return;
  428. X        }
  429. X        r=SetSysVar(varname+1, val.v.val);
  430. X!       if (r) fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
  431. X        return;
  432. X     }
  433. X  
  434. X     r=SetVar(varname, &val);
  435. X     if (r) {
  436. X!       fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
  437. X        return;
  438. X     }
  439. X     r=PreserveVar(varname);
  440. X!    if (r) fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
  441. X     return;
  442. X  }
  443. X  
  444. X*** ../prev/lang.h    Mon Jun 28 12:29:33 1993
  445. X--- ./lang.h    Wed Aug 18 11:11:53 1993
  446. X***************
  447. X*** 13,20 ****
  448. X  
  449. X  #define ENGLISH    0 /* original by David Skoll */
  450. X  #define GERMAN     1 /* translated by Wolfgang Thronicke */
  451. X! #define DUTCH      2 /* translated by Willem Kasdorp */
  452. X  #define FINNISH    3 /* translated by Mikko Silvonen */
  453. X  
  454. X  /* Add more languages here - but please e-mail dfs@doe.carleton.ca
  455. X     to have your favorite language assigned a number.  If you add a
  456. X--- 13,22 ----
  457. X  
  458. X  #define ENGLISH    0 /* original by David Skoll */
  459. X  #define GERMAN     1 /* translated by Wolfgang Thronicke */
  460. X! #define DUTCH      2 /* translated by Willem Kasdorp and Erik-Jan Vens */
  461. X  #define FINNISH    3 /* translated by Mikko Silvonen */
  462. X+ #define FRENCH       4 /* translated by Laurent Duperval */
  463. X+ #define NORWEGIAN  5 /* translated by Trygve Randen */
  464. X  
  465. X  /* Add more languages here - but please e-mail dfs@doe.carleton.ca
  466. X     to have your favorite language assigned a number.  If you add a
  467. X***************
  468. X*** 48,53 ****
  469. X--- 50,59 ----
  470. X  #include "dutch.h"
  471. X  #elif LANG == FINNISH
  472. X  #include "finnish.h"
  473. X+ #elif LANG == FRENCH
  474. X+ #include "french.h"
  475. X+ #elif LANG == NORWEGIAN
  476. X+ #include "norwgian.h"
  477. X  
  478. X  /* If no sensible language, choose English.  I intended to use
  479. X     the #error directive here, but some C compilers barf. */
  480. X*** ../prev/main.c    Mon Jun 28 12:39:37 1993
  481. X--- ./main.c    Wed Aug 25 13:06:26 1993
  482. X***************
  483. X*** 27,44 ****
  484. X  #include <varargs.h>
  485. X  #endif
  486. X  #include <ctype.h>
  487. X  
  488. X  #ifdef __MSDOS__
  489. X  #include <dos.h>
  490. X- #include <time.h>
  491. X  #endif
  492. X  
  493. X  
  494. X  #ifndef __MSDOS__
  495. X  #include <sys/types.h>
  496. X! #ifdef SYSV
  497. X! #include <time.h>
  498. X! #else
  499. X  #include <sys/time.h>
  500. X  #endif
  501. X  #endif /* ifndef __MSDOS__ */
  502. X--- 27,42 ----
  503. X  #include <varargs.h>
  504. X  #endif
  505. X  #include <ctype.h>
  506. X+ #include <time.h>
  507. X  
  508. X  #ifdef __MSDOS__
  509. X  #include <dos.h>
  510. X  #endif
  511. X  
  512. X  
  513. X  #ifndef __MSDOS__
  514. X  #include <sys/types.h>
  515. X! #ifndef SYSV
  516. X  #include <sys/time.h>
  517. X  #endif
  518. X  #endif /* ifndef __MSDOS__ */
  519. X***************
  520. X*** 51,56 ****
  521. X--- 49,60 ----
  522. X  
  523. X  PRIVATE void DoReminders ARGS ((void));
  524. X  
  525. X+ #if defined(NEED_TIMEGM) && !defined(HAVE_MKTIME)
  526. X+ PRIVATE long time_cheat ARGS ((int year, int month));
  527. X+ long timegm ARGS((struct tm *tm));
  528. X+ long timelocal ARGS((struct tm *tm));
  529. X+ #endif
  530. X+ 
  531. X  static char TPushBuffer[TOKSIZE+1]; /* Buffer for pushing back a token. */
  532. X  static char *TokenPushed = NULL;
  533. X  
  534. X***************
  535. X*** 97,116 ****
  536. X  
  537. X     if (!Hush) {
  538. X        if (DestroyOmitContexts())
  539. X!     Eprint("Warning: PUSH-OMIT-CONTEXT without matching POP-OMIT-CONTEXT.");
  540. X  #ifdef HAVE_QUEUED
  541. X!       if (!Daemon && !NextMode && !NumTriggered && !NumQueued) printf("No reminders.\n");
  542. X     else
  543. X!       if (!Daemon && !NextMode && !NumTriggered) printf("%d reminder%s queued for later today.\n",
  544. X!          NumQueued, (NumQueued == 1) ? "" : "s");
  545. X  #else
  546. X!       if (!NextMode && !NumTriggered) printf("No reminders.\n");
  547. X  #endif
  548. X     }
  549. X  
  550. X     /* If it's MS-DOS or OS2, reset the file access date */
  551. X  #if defined(__MSDOS__) || defined(OS2)
  552. X!    if (RealToday == JulianToday) SetAccessDate(InitialFile, RealToday);
  553. X  #endif
  554. X  
  555. X     /* If there are sorted reminders, handle them */
  556. X--- 101,121 ----
  557. X  
  558. X     if (!Hush) {
  559. X        if (DestroyOmitContexts())
  560. X!     Eprint("%s", E_PUSH_NOPOP);
  561. X  #ifdef HAVE_QUEUED
  562. X!       if (!Daemon && !NextMode && !NumTriggered && !NumQueued) printf("%s\n", ErrMsg[E_NOREMINDERS]);
  563. X     else
  564. X!       if (!Daemon && !NextMode && !NumTriggered) printf(ErrMsg[M_QUEUED],
  565. X!          NumQueued);
  566. X  #else
  567. X!       if (!NextMode && !NumTriggered) printf("%s\n", ErrMsg[E_NOREMINDERS]);
  568. X  #endif
  569. X     }
  570. X  
  571. X     /* If it's MS-DOS or OS2, reset the file access date */
  572. X  #if defined(__MSDOS__) || defined(OS2)
  573. X!    if (!UseStdin && (RealToday == JulianToday))
  574. X!       SetAccessDate(InitialFile, RealToday);
  575. X  #endif
  576. X  
  577. X     /* If there are sorted reminders, handle them */
  578. X***************
  579. X*** 130,136 ****
  580. X          return 0;
  581. X       }
  582. X       if (pid == -1) {
  583. X!         fprintf(ErrFp, "Couldn't fork to do queued reminders.\n");
  584. X          return 1;
  585. X       }
  586. X        }
  587. X--- 135,141 ----
  588. X          return 0;
  589. X       }
  590. X       if (pid == -1) {
  591. X!         fprintf(ErrFp, "%s", ErrMsg[E_CANTFORK]);
  592. X          return 1;
  593. X       }
  594. X        }
  595. X***************
  596. X*** 158,173 ****
  597. X     char *s;
  598. X     Parser p;
  599. X  
  600. X!    FileAccessDate = GetAccessDate(InitialFile);
  601. X  
  602. X     if (FileAccessDate < 0) {
  603. X!       fprintf(ErrFp, "remind: Can't access file '%s'.\n", InitialFile);
  604. X        exit(1);
  605. X     }
  606. X  
  607. X     r=OpenFile(InitialFile);
  608. X     if (r) {
  609. X!       fprintf(ErrFp, "Can't read %s: %s\n", InitialFile, ErrMsg[r]);
  610. X        exit(1);
  611. X     }
  612. X  
  613. X--- 163,180 ----
  614. X     char *s;
  615. X     Parser p;
  616. X  
  617. X!    if (!UseStdin) FileAccessDate = GetAccessDate(InitialFile);
  618. X!    else          FileAccessDate = JulianToday;
  619. X  
  620. X     if (FileAccessDate < 0) {
  621. X!       fprintf(ErrFp, "%s: '%s'.\n", ErrMsg[E_CANTACCESS], InitialFile);
  622. X        exit(1);
  623. X     }
  624. X  
  625. X     r=OpenFile(InitialFile);
  626. X     if (r) {
  627. X!       fprintf(ErrFp, "%s %s: %s\n", ErrMsg[E_ERR_READING],
  628. X!                                     InitialFile, ErrMsg[r]);
  629. X        exit(1);
  630. X     }
  631. X  
  632. X***************
  633. X*** 175,181 ****
  634. X        r = ReadLine();
  635. X        if (r == E_EOF) return;
  636. X        if (r) {
  637. X!      Eprint("Error reading file: %s", ErrMsg[r]);
  638. X       exit(1);
  639. X        }
  640. X        s = FindInitialToken(&tok, CurLine);
  641. X--- 182,188 ----
  642. X        r = ReadLine();
  643. X        if (r == E_EOF) return;
  644. X        if (r) {
  645. X!      Eprint("%s: %s", ErrMsg[E_ERR_READING], ErrMsg[r]);
  646. X       exit(1);
  647. X        }
  648. X        s = FindInitialToken(&tok, CurLine);
  649. X***************
  650. X*** 565,571 ****
  651. X  
  652. X     if (FreshLine) {
  653. X        FreshLine = 0;
  654. X!       (void) fprintf(ErrFp, "%s(%d): ", FileName, LineNo);
  655. X        if (DebugFlag & DB_PRTLINE) OutputLine(ErrFp);
  656. X     } else fprintf(ErrFp, "       ");
  657. X  
  658. X--- 572,581 ----
  659. X  
  660. X     if (FreshLine) {
  661. X        FreshLine = 0;
  662. X!       if (strcmp(FileName, "-"))
  663. X!          (void) fprintf(ErrFp, "%s(%d): ", FileName, LineNo);
  664. X!       else
  665. X!          (void) fprintf(ErrFp, "-stdin-(%d): ", LineNo);
  666. X        if (DebugFlag & DB_PRTLINE) OutputLine(ErrFp);
  667. X     } else fprintf(ErrFp, "       ");
  668. X  
  669. X***************
  670. X*** 911,917 ****
  671. X  
  672. X     if ( (r = ParseToken(p, TokBuffer)) ) return r;
  673. X     if (*TokBuffer && (*TokBuffer != '#') && (*TokBuffer != ';')) {
  674. X!       Eprint("Expecting end-of-line, found '%s'", TokBuffer);
  675. X        return E_EXTRANEOUS_TOKEN;
  676. X     }
  677. X     return OK;
  678. X--- 921,927 ----
  679. X  
  680. X     if ( (r = ParseToken(p, TokBuffer)) ) return r;
  681. X     if (*TokBuffer && (*TokBuffer != '#') && (*TokBuffer != ';')) {
  682. X!       Eprint("%s: '%s'", ErrMsg[E_EXPECTING_EOL], TokBuffer);
  683. X        return E_EXTRANEOUS_TOKEN;
  684. X     }
  685. X     return OK;
  686. X***************
  687. X*** 1162,1164 ****
  688. X--- 1172,1325 ----
  689. X     if (isdst) *isdst = temp->tm_isdst;
  690. X     return 0;
  691. X  }
  692. X+ 
  693. X+ /***************************************************************/
  694. X+ /*                                                             */
  695. X+ /*  FillParagraph                                              */
  696. X+ /*                                                             */
  697. X+ /*  Write a string to standard output, formatting it as a      */
  698. X+ /*  paragraph according to the FirstIndent, FormWidth and      */
  699. X+ /*  SubsIndent variables.  Spaces are gobbled.  Double-spaces  */
  700. X+ /*  are inserted after periods.  As a special case, if the     */
  701. X+ /*  last char in s is '\n', an extra newline is emitted.       */
  702. X+ /*                                                             */
  703. X+ /***************************************************************/
  704. X+ #ifdef HAVE_PROTOS
  705. X+ PUBLIC void FillParagraph(char *s)
  706. X+ #else
  707. X+ void FillParagraph(s)
  708. X+ char *s;
  709. X+ #endif
  710. X+ {
  711. X+ 
  712. X+    int line = 0;
  713. X+    int i, j;
  714. X+    int pendspace;
  715. X+    int len;
  716. X+    char *t;
  717. X+ 
  718. X+    int roomleft;
  719. X+ 
  720. X+    if (!s || !*s) return;
  721. X+ 
  722. X+    /* Skip leading spaces */
  723. X+    while(isspace(*s)) s++;
  724. X+ 
  725. X+    /* Start formatting */
  726. X+    while(1) {
  727. X+       if (!*s) {
  728. X+          if (*(s-1) == '\n') putchar('\n');
  729. X+          return;
  730. X+       }
  731. X+       /* Over here, we're at the beginning of a line.  Emit the correct
  732. X+          number of spaces */
  733. X+       j = line ? SubsIndent : FirstIndent;
  734. X+       for (i=0; i<j; i++) putchar(' ');
  735. X+ 
  736. X+       /* Calculate the amount of room left on this line */
  737. X+       roomleft = FormWidth - j;
  738. X+       pendspace = 0;
  739. X+ 
  740. X+       /* Emit words until the next one won't fit */
  741. X+       while(1) {
  742. X+          while(isspace(*s)) s++;
  743. X+          t = s;
  744. X+          while(*s && !isspace(*s)) s++;
  745. X+      len = s - t;
  746. X+      if (!len) {
  747. X+         putchar('\n');
  748. X+             if (*(s-1) == '\n') putchar('\n');
  749. X+         return;
  750. X+          }
  751. X+      if (!pendspace || len+pendspace <= roomleft) {
  752. X+             for (i=0; i<pendspace; i++) putchar(' ');
  753. X+            while(t < s) {
  754. X+            putchar(*t);
  755. X+            t++;
  756. X+             }
  757. X+          } else {
  758. X+         s = t;
  759. X+         putchar('\n');
  760. X+         line++;
  761. X+         break;
  762. X+          }
  763. X+      pendspace = (*(t-1) == '.') ? 2 : 1;
  764. X+      roomleft -= len+pendspace;
  765. X+       }
  766. X+    }
  767. X+ }
  768. X+ 
  769. X+ #if defined(NEED_TIMEGM) && !defined(HAVE_MKTIME)
  770. X+ #define        TGM_SEC        (1)
  771. X+ #define        TGM_MIN        (60 * TGM_SEC)
  772. X+ #define        TGM_HR        (60 * TGM_MIN)
  773. X+ #define        TGM_DAY        (24 * TGM_HR)
  774. X+ 
  775. X+ #ifdef HAVE_PROTOS
  776. X+ PRIVATE long time_cheat(int year, int month)
  777. X+ #else
  778. X+ static long time_cheat (year, month)
  779. X+ int year;
  780. X+ int month;
  781. X+ #endif
  782. X+ {
  783. X+     long guess = time((long *) NULL);
  784. X+     struct tm g;
  785. X+     int diff;
  786. X+     
  787. X+     g = *gmtime (&guess);
  788. X+     while ((diff = year - g.tm_year) > 0)
  789. X+     {
  790. X+         guess += diff * (363 - TGM_DAY);
  791. X+         g = *gmtime (&guess);
  792. X+     }
  793. X+     g.tm_mday--;
  794. X+     guess -= g.tm_sec * TGM_SEC + g.tm_min * TGM_MIN +
  795. X+          g.tm_hour * TGM_HR + g.tm_mday * TGM_DAY;
  796. X+     return (guess);
  797. X+ }
  798. X+ 
  799. X+ #ifdef HAVE_PROTOS
  800. X+ PUBLIC long timegm (struct tm *tm)
  801. X+ #else
  802. X+ long timegm(tm)
  803. X+ struct tm *tm;
  804. X+ #endif
  805. X+ {
  806. X+     long clock = time_cheat (tm->tm_year, tm->tm_mon);
  807. X+ 
  808. X+     return (clock + tm->tm_sec * TGM_SEC +
  809. X+             tm->tm_min * TGM_MIN +
  810. X+             tm->tm_hour * TGM_HR +
  811. X+             (tm->tm_mday - 1) * TGM_DAY);
  812. X+ }
  813. X+ 
  814. X+ #ifdef HAVE_PROTOS
  815. X+ PUBLIC long timelocal (struct tm *tm)
  816. X+ #else
  817. X+ long timelocal (tm)
  818. X+ struct tm *tm;
  819. X+ #endif
  820. X+ {
  821. X+     long zero = 0;
  822. X+     struct tm epoch;
  823. X+     int tzmin;
  824. X+     long clock;
  825. X+     struct tm test;
  826. X+ 
  827. X+     epoch = *localtime (&zero);
  828. X+     tzmin = epoch.tm_hour * 60 + epoch.tm_min;
  829. X+     if (tzmin > 0)
  830. X+     {
  831. X+         tzmin = 24 * 60 - tzmin;
  832. X+         if (epoch.tm_year == 70)
  833. X+             tzmin -= 24 * 60;
  834. X+     }
  835. X+     clock = timegm (tm) + tzmin * TGM_MIN;
  836. X+     test = *localtime (&clock);
  837. X+ 
  838. X+     if (test.tm_hour != tm->tm_hour)
  839. X+         clock -= TGM_HR;
  840. X+     return (clock);
  841. X+ }
  842. X+ #endif /* NEED_TIMEGM */
  843. X*** ../prev/makefile.os2    Mon Jun 28 12:30:19 1993
  844. X--- ./makefile.os2    Wed Aug 18 11:13:19 1993
  845. X***************
  846. X*** 25,37 ****
  847. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  848. X  # in config.h; then, you should be able to type 'make'.
  849. X  #-----------------------------------------------------------------------------
  850. X! VERSION= 03.00.07
  851. X  
  852. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  853. X! lang.h english.h german.h dutch.h finish.h
  854. X  
  855. X  STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  856. X  
  857. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  858. X  main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  859. X  
  860. X--- 25,39 ----
  861. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  862. X  # in config.h; then, you should be able to type 'make'.
  863. X  #-----------------------------------------------------------------------------
  864. X! VERSION= 03.00.08
  865. X  
  866. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  867. X! lang.h english.h german.h dutch.h finish.h french.h norwgian.h
  868. X  
  869. X  STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  870. X  
  871. X+ LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  872. X+ 
  873. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  874. X  main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  875. X  
  876. X***************
  877. X*** 68,74 ****
  878. X  rem2ps$O: rem2ps.c rem2ps.h config.h
  879. X  calendar$O: calendar.c $(STDHDRS) expr.h
  880. X  dorem$O: dorem.c $(STDHDRS) expr.h
  881. X! dosubst$O: dosubst.c $(STDHDRS)
  882. X  expr$O: expr.c $(STDHDRS) expr.h
  883. X  files$O: files.c $(STDHDRS)
  884. X  funcs$O: funcs.c $(STDHDRS) expr.h version.h
  885. X--- 70,76 ----
  886. X  rem2ps$O: rem2ps.c rem2ps.h config.h
  887. X  calendar$O: calendar.c $(STDHDRS) expr.h
  888. X  dorem$O: dorem.c $(STDHDRS) expr.h
  889. X! dosubst$O: dosubst.c $(STDHDRS) $(LANGHDRS)
  890. X  expr$O: expr.c $(STDHDRS) expr.h
  891. X  files$O: files.c $(STDHDRS)
  892. X  funcs$O: funcs.c $(STDHDRS) expr.h version.h
  893. X*** ../prev/makefile.tc    Mon Jun 28 12:30:09 1993
  894. X--- ./makefile.tc    Wed Aug 18 11:13:06 1993
  895. X***************
  896. X*** 1,12 ****
  897. X  # Makefile for REMIND for Turbo C for MSDOS
  898. X  
  899. X! VERSION= 03.00.07
  900. X  
  901. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  902. X! lang.h english.h german.h dutch.h finnish.h
  903. X  
  904. X  STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  905. X  
  906. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  907. X  main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  908. X  
  909. X--- 1,14 ----
  910. X  # Makefile for REMIND for Turbo C for MSDOS
  911. X  
  912. X! VERSION= 03.00.08
  913. X  
  914. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  915. X! lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
  916. X  
  917. X  STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  918. X  
  919. X+ LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  920. X+ 
  921. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  922. X  main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  923. X  
  924. X***************
  925. X*** 37,43 ****
  926. X  
  927. X  dorem.obj: dorem.c $(STDHDRS) expr.h
  928. X  
  929. X! dosubst.obj: dosubst.c $(STDHDRS)
  930. X  
  931. X  expr.obj: expr.c $(STDHDRS) expr.h
  932. X  
  933. X--- 39,45 ----
  934. X  
  935. X  dorem.obj: dorem.c $(STDHDRS) expr.h
  936. X  
  937. X! dosubst.obj: dosubst.c $(STDHDRS) $(LANGHDRS)
  938. X  
  939. X  expr.obj: expr.c $(STDHDRS) expr.h
  940. X  
  941. X*** ../prev/omit.c    Mon Jun 28 12:29:53 1993
  942. X--- ./omit.c    Thu Aug 19 16:16:33 1993
  943. X***************
  944. X*** 304,329 ****
  945. X        FindToken(TokBuffer, &tok);
  946. X        switch (tok.type) {
  947. X           case T_Year:
  948. X!         if (y != NO_YR) {
  949. X!            Eprint("Year specified twice");
  950. X!            return E_PARSE_ERR;
  951. X!         }
  952. X          y = tok.val;
  953. X          break;
  954. X  
  955. X           case T_Month:
  956. X!         if (m != NO_MON) {
  957. X!            Eprint("Month specified twice");
  958. X!            return E_PARSE_ERR;
  959. X!         }
  960. X          m = tok.val;
  961. X          break;
  962. X  
  963. X           case T_Day:
  964. X!         if (d != NO_DAY) {
  965. X!            Eprint("Day specified twice");
  966. X!            return E_PARSE_ERR;
  967. X!         }
  968. X          d = tok.val;
  969. X          break;
  970. X       
  971. X--- 304,320 ----
  972. X        FindToken(TokBuffer, &tok);
  973. X        switch (tok.type) {
  974. X           case T_Year:
  975. X!         if (y != NO_YR) return E_YR_TWICE;
  976. X          y = tok.val;
  977. X          break;
  978. X  
  979. X           case T_Month:
  980. X!         if (m != NO_MON) return E_MON_TWICE;
  981. X          m = tok.val;
  982. X          break;
  983. X  
  984. X           case T_Day:
  985. X!         if (d != NO_DAY) return E_DAY_TWICE;
  986. X          d = tok.val;
  987. X          break;
  988. X       
  989. X***************
  990. X*** 337,355 ****
  991. X          break;
  992. X  
  993. X       default:
  994. X!         Eprint("Unknown token '%s' in OMIT command", TokBuffer);
  995. X!         return E_PARSE_ERR;
  996. X        }
  997. X     }
  998. X!    if (m == NO_MON || d == NO_DAY) {
  999. X!       Eprint("Must specify month and day in OMIT command");
  1000. X!       return E_PARSE_ERR;
  1001. X!    }
  1002. X     if (y == NO_YR) {
  1003. X!       if (NumPartialOmits == MAX_PARTIAL_OMITS) {
  1004. X!          Eprint("Too many partial OMITs");
  1005. X!      return E_NO_MEM;
  1006. X!       }
  1007. X        if (d > MonthDays[m]) return E_BAD_DATE;
  1008. X        syndrome = (m<<5) + d;
  1009. X        if (!BexistsIntArray(PartialOmitArray, NumPartialOmits, syndrome)) {
  1010. X--- 328,342 ----
  1011. X          break;
  1012. X  
  1013. X       default:
  1014. X!         Eprint("%s: '%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN], TokBuffer);
  1015. X!         return E_UNKNOWN_TOKEN;
  1016. X        }
  1017. X     }
  1018. X!    if (m == NO_MON || d == NO_DAY) return E_SPEC_MON_DAY;
  1019. X! 
  1020. X     if (y == NO_YR) {
  1021. X!       if (NumPartialOmits == MAX_PARTIAL_OMITS) return E_2MANY_PART;
  1022. X! 
  1023. X        if (d > MonthDays[m]) return E_BAD_DATE;
  1024. X        syndrome = (m<<5) + d;
  1025. X        if (!BexistsIntArray(PartialOmitArray, NumPartialOmits, syndrome)) {
  1026. X***************
  1027. X*** 357,366 ****
  1028. X           NumPartialOmits++;
  1029. X        }
  1030. X     } else {
  1031. X!       if (NumFullOmits == MAX_FULL_OMITS) {
  1032. X!          Eprint("Too many full OMITs");
  1033. X!      return E_NO_MEM;
  1034. X!       }
  1035. X        if (d > DaysInMonth(m, y)) return E_BAD_DATE;
  1036. X        syndrome = Julian(y, m, d);
  1037. X        if (!BexistsIntArray(FullOmitArray, NumFullOmits, syndrome)) {
  1038. X--- 344,351 ----
  1039. X           NumPartialOmits++;
  1040. X        }
  1041. X     } else {
  1042. X!       if (NumFullOmits == MAX_FULL_OMITS) return E_2MANY_FULL;
  1043. X! 
  1044. X        if (d > DaysInMonth(m, y)) return E_BAD_DATE;
  1045. X        syndrome = Julian(y, m, d);
  1046. X        if (!BexistsIntArray(FullOmitArray, NumFullOmits, syndrome)) {
  1047. X*** ../prev/protos.h    Mon Jun 28 12:37:30 1993
  1048. X--- ./protos.h    Wed Aug 18 12:52:08 1993
  1049. X***************
  1050. X*** 108,114 ****
  1051. X  int DoPreserve  ARGS ((Parser *p));
  1052. X  int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
  1053. X  int ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
  1054. X! int HashVal ARGS ((const char *str));
  1055. X  int DateOK ARGS ((int y, int m, int d));
  1056. X  Operator *FindFunc ARGS ((char *name, Operator where[], int num));
  1057. X  int InsertIntoSortBuffer ARGS ((int jul, int tim, char *body, int typ));
  1058. X--- 108,114 ----
  1059. X  int DoPreserve  ARGS ((Parser *p));
  1060. X  int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
  1061. X  int ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
  1062. X! unsigned int HashVal ARGS ((const char *str));
  1063. X  int DateOK ARGS ((int y, int m, int d));
  1064. X  Operator *FindFunc ARGS ((char *name, Operator where[], int num));
  1065. X  int InsertIntoSortBuffer ARGS ((int jul, int tim, char *body, int typ));
  1066. X***************
  1067. X*** 129,131 ****
  1068. X--- 129,132 ----
  1069. X  int SetSysVar ARGS ((const char *name, int value));
  1070. X  void DumpSysVarByName ARGS ((const char *name));
  1071. X  int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
  1072. X+ void FillParagraph ARGS ((char *s));
  1073. X*** ../prev/queue.c    Mon Jun 28 12:29:55 1993
  1074. X--- ./queue.c    Thu Aug 19 16:12:20 1993
  1075. X***************
  1076. X*** 74,86 ****
  1077. X  
  1078. X     qelem = NEW(QueuedRem);
  1079. X     if (!qelem) {
  1080. X-       Eprint("No memory to queue reminder.");
  1081. X        return E_NO_MEM;
  1082. X     }
  1083. X     qelem->text = StrDup(p->pos);  /* Guaranteed that parser is not nested. */
  1084. X     if (!qelem->text) {
  1085. X        free(qelem);
  1086. X-       Eprint("No memory to queue reminder.");
  1087. X        return E_NO_MEM;
  1088. X     }
  1089. X     qelem->typ = typ;
  1090. X--- 74,84 ----
  1091. X***************
  1092. X*** 275,281 ****
  1093. X                   q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
  1094. X                   q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
  1095. X                   q->tt.rep, q->tt.delta, NL);
  1096. X!          printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" : "RUN"),
  1097. X                   q->text,
  1098. X                   NL, NL);
  1099. X        }
  1100. X--- 273,280 ----
  1101. X                   q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
  1102. X                   q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
  1103. X                   q->tt.rep, q->tt.delta, NL);
  1104. X!                  printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
  1105. X!                                    ((q->typ == MSF_TYPE) ? "MSF" :"RUN")),
  1106. X                   q->text,
  1107. X                   NL, NL);
  1108. X        }
  1109. X*** ../prev/rem2ps.1    Mon Jun 28 12:30:23 1993
  1110. X--- ./rem2ps.1    Wed Jul 28 10:22:25 1993
  1111. X***************
  1112. X*** 29,34 ****
  1113. X--- 29,43 ----
  1114. X  Use ISO 8859-1 standard encoding for the PostScript fonts.  If you do
  1115. X  not use this option, the default encoding is used.
  1116. X  .TP
  1117. X+ .B \-e
  1118. X+ Make the calendar fill the entire page.  By default, the calendar is
  1119. X+ slightly smaller than the page.  This allows days with many reminders
  1120. X+ to "expand" as needed.  However, if you don't have days which expand,
  1121. X+ you can use this option to make all of the boxes slightly bigger.  
  1122. X+ One caveat: If you do use the \fB\-e\fR option and one day has many
  1123. X+ reminders, the calendar may expand off the page, losing some information.
  1124. X+ Experiment!
  1125. X+ .TP
  1126. X  .B \-m media
  1127. X  Set the page size.  If you use the \-m option, you must specify the
  1128. X  media type, which can be one of the
  1129. X*** ../prev/rem2ps.c    Mon Jun 28 12:30:22 1993
  1130. X--- ./rem2ps.c    Wed Jul 28 10:15:11 1993
  1131. X***************
  1132. X*** 98,103 ****
  1133. X--- 98,104 ----
  1134. X  int WkDayNum;
  1135. X  
  1136. X  int LeftMarg, RightMarg, TopMarg, BotMarg;
  1137. X+ int FillPage;
  1138. X  
  1139. X  void Init ARGS ((int argc, char *argv[]));
  1140. X  void Usage ARGS ((char *s));
  1141. X***************
  1142. X*** 185,191 ****
  1143. X     printf("(%s %s) doheading\n", month, year);
  1144. X  
  1145. X  /* Calculate the minimum box size */
  1146. X!    printf("/MinBoxSize ytop MinY sub 7 div def\n");
  1147. X  
  1148. X  /* If wkday >= 2, then do the small calendars at the top. */
  1149. X     if (wkday >=2 && !NoSmallCal) {
  1150. X--- 186,201 ----
  1151. X     printf("(%s %s) doheading\n", month, year);
  1152. X  
  1153. X  /* Calculate the minimum box size */
  1154. X!    if (!FillPage) {
  1155. X!       printf("/MinBoxSize ytop MinY sub 7 div def\n");
  1156. X!    } else {
  1157. X!       if ((days == 31 && wkday >= 5) || (days == 30 && wkday == 6))
  1158. X!          printf("/MinBoxSize ytop MinY sub 6 div def\n");
  1159. X!       else if (days == 28 && wkday == 0 && NoSmallCal)
  1160. X!          printf("/MinBoxSize ytop MinY sub 4 div def\n");
  1161. X!       else
  1162. X!          printf("/MinBoxSize ytop MinY sub 5 div def\n");
  1163. X!    }
  1164. X  
  1165. X  /* If wkday >= 2, then do the small calendars at the top. */
  1166. X     if (wkday >=2 && !NoSmallCal) {
  1167. X***************
  1168. X*** 522,527 ****
  1169. X--- 532,538 ----
  1170. X     TopMarg = 36;
  1171. X     BotMarg = 36;
  1172. X     UseISO = 0;
  1173. X+    FillPage = 0;
  1174. X  
  1175. X     for(j=0; j<32; j++) PsEntries[i] = NULL;
  1176. X  
  1177. X***************
  1178. X*** 618,623 ****
  1179. X--- 629,636 ----
  1180. X  
  1181. X       case 'c': NoSmallCal = 1; break;
  1182. X  
  1183. X+      case 'e': FillPage = 1; break;
  1184. X+ 
  1185. X       default: Usage("Unrecognized option");
  1186. X        }
  1187. X     }
  1188. X***************
  1189. X*** 651,656 ****
  1190. X--- 664,670 ----
  1191. X     fprintf(stderr, "-s[hed] size  Set size for header, calendar entries and/or day numbers\n");
  1192. X     fprintf(stderr, "-b size       Set border size for calendar entries\n");
  1193. X     fprintf(stderr, "-t size       Set line thickness\n");
  1194. X+    fprintf(stderr, "-e            Make calendar fill entire page\n");
  1195. X     fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins\n");
  1196. X     exit(1);
  1197. X  }
  1198. X*** ../prev/remind-all.sh    Mon Jun 28 12:30:06 1993
  1199. X--- ./remind-all.sh    Thu Aug 19 17:28:47 1993
  1200. X***************
  1201. X*** 1,5 ****
  1202. X--- 1,10 ----
  1203. X  # Shell script to mail all users reminders.
  1204. X  
  1205. X+ # This file is part of REMIND
  1206. X+ #
  1207. X+ # REMIND is Copyright (C) 1992, 1993 by David F. Skoll
  1208. X+ # This file is Copyright (C) 1990 by Bill Aten
  1209. X+ 
  1210. X  # Thanks to Bill Aten for this script.
  1211. X  
  1212. X  # Run it AFTER MIDNIGHT so that date is correct!
  1213. X*** ../prev/remind.1    Mon Jul 19 11:31:13 1993
  1214. X--- ./remind.1    Thu Aug 26 10:58:39 1993
  1215. X***************
  1216. X*** 9,14 ****
  1217. X--- 9,18 ----
  1218. X  found in it.  The commands are used to issue reminders and alarms.  Each
  1219. X  reminder or alarm can consist of a message sent to standard output, or
  1220. X  a program to be executed.
  1221. X+ .PP
  1222. X+ If \fIfilename\fR is specified as a single dash '-', then \fBRemind\fR
  1223. X+ takes its input from standard input.  This also implicitly enables
  1224. X+ the \fB\-o\fR option, described below.
  1225. X  .SH OPTIONS
  1226. X  .TP
  1227. X  .B \-n
  1228. X***************
  1229. X*** 245,251 ****
  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 | \fBPS\fR | \fBPSFILE\fR
  1234. X  .I body
  1235. X  .RE
  1236. X  .PP
  1237. X--- 249,256 ----
  1238. X  [\fBAT\fR \fItime\fR [\fItdelta\fR] [\fItrepeat\fR]]
  1239. X  [\fBUNTIL\fR \fIexpiry_date\fR]
  1240. X  [\fBSCANFROM\fR \fIscan_date\fR]
  1241. X! \fBMSG\fR | \fBMSF\fR | \fBRUN\fR | \fBCAL\fR | \fBSATISFY\fR |
  1242. X! \fBPS\fR | \fBPSFILE\fR
  1243. X  .I body
  1244. X  .RE
  1245. X  .PP
  1246. X***************
  1247. X*** 256,265 ****
  1248. X  The \fBREM\fR token is optional, providing that the remainder
  1249. X  of the command cannot be mistaken for another \fBRemind\fR command
  1250. X  such as \fBOMIT\fR or \fBRUN\fR.  The portion of the \fBREM\fR command
  1251. X! before the \fBMSG\fR, \fBRUN\fR, \fBCAL\fR or \fBSATISFY\fR clause
  1252. X  is called a \fItrigger\fR.
  1253. X  .PP
  1254. X! .B MSG, RUN, CAL, PS and PSFILE
  1255. X  .PP
  1256. X  These keywords denote the \fItype\fR
  1257. X  of the reminder.  (\fBSATISFY\fR is more complicated and will be explained
  1258. X--- 261,270 ----
  1259. X  The \fBREM\fR token is optional, providing that the remainder
  1260. X  of the command cannot be mistaken for another \fBRemind\fR command
  1261. X  such as \fBOMIT\fR or \fBRUN\fR.  The portion of the \fBREM\fR command
  1262. X! before the \fBMSG\fR, \fBMSF\fR \fBRUN\fR, \fBCAL\fR or \fBSATISFY\fR clause
  1263. X  is called a \fItrigger\fR.
  1264. X  .PP
  1265. X! .B "MSG, MSF, RUN, CAL, PS and PSFILE"
  1266. X  .PP
  1267. X  These keywords denote the \fItype\fR
  1268. X  of the reminder.  (\fBSATISFY\fR is more complicated and will be explained
  1269. X***************
  1270. X*** 270,275 ****
  1271. X--- 275,288 ----
  1272. X  passed to the appropriate program.  Note that the options \fB\-c\fR,
  1273. X  \fB\-s\fR, \fB\-p\fR and \fB\-n\fR disable the \fB\-k\fR option.
  1274. X  .PP
  1275. X+ The \fBMSF\fR keyword is almost the same as the \fBMSG\fR keyword,
  1276. X+ except that the reminder is formatted to fit into a paragraph-like
  1277. X+ format.  Three system variables control the formatting of \fBMSF\fR-type
  1278. X+ reminders - they are \fB$FirstIndent\fR, \fB$SubsIndent\fR and
  1279. X+ \fB$FormWidth\fR.  They are discussed in the section "System Variables."
  1280. X+ The \fBMSF\fR keyword causes the spacing of your reminder to be altered -
  1281. X+ extra spaces are discarded, and two spaces are placed after periods.
  1282. X+ .PP
  1283. X  A \fBRUN\fR-type
  1284. X  reminder also passes the \fIbody\fR through the substitution filter, but
  1285. X  then executes the result as a system command.  A \fBCAL\fR-type reminder
  1286. X***************
  1287. X*** 1106,1111 ****
  1288. X--- 1119,1126 ----
  1289. X  .PP
  1290. X  \fBINCLUDE\fR files can be nested up to a depth of 8.
  1291. X  .PP
  1292. X+ If you specify a filename of "-" in the \fBINCLUDE\fR command, \fBRemind\fR
  1293. X+ will begin reading from standard input.
  1294. X  .SH THE RUN COMMAND
  1295. X  .PP
  1296. X  If you include other files in your reminder script, you may not always
  1297. X***************
  1298. X*** 1491,1496 ****
  1299. X--- 1506,1515 ----
  1300. X  If non-zero, then the \fB\-q\fR option was supplied on the command line.
  1301. X  For the MS-DOS version, always contains 1.
  1302. X  .TP
  1303. X+ .B $FirstIndent
  1304. X+ The number of spaces by which to indent the first line of a \fBMSF\fR-type
  1305. X+ reminder.  The default is 0.
  1306. X+ .TP
  1307. X  .B $FoldYear
  1308. X  The standard Unix library functions may have difficulty dealing with dates
  1309. X  later than 2037.  If this variable is set to 1, then the UTC calculations
  1310. X***************
  1311. X*** 1503,1508 ****
  1312. X--- 1522,1533 ----
  1313. X  this variable is 0.  Set it to 1 if the sun or UTC functions misbehave
  1314. X  for years greater than 2037.
  1315. X  .TP
  1316. X+ .B $FormWidth
  1317. X+ The maximum width of each line of text for formatting \fBMSF\fR-type
  1318. X+ reminders.  The default is 72.  If an \fBMSF\fR-type reminder contains
  1319. X+ a word too long to fit in this width, it will not be truncated - the
  1320. X+ width limit will be ignored.
  1321. X+ .TP
  1322. X  .B $HushMode (read-only)
  1323. X  If non-zero, then the \fB\-h\fR option was supplied on the command line.
  1324. X  .TP
  1325. X***************
  1326. X*** 1563,1568 ****
  1327. X--- 1588,1599 ----
  1328. X  block is greater than the saved value, then at least one holiday
  1329. X  was triggered, and you can execute the command to shade in the
  1330. X  calendar box.  (See the section "Calendar Mode".)
  1331. X+ .PP
  1332. X+ .RS
  1333. X+ Note that \fB$NumTrig\fR is affected \fIonly\fR
  1334. X+ by \fBREM\fR commands; triggers in \fBIFTRIG\fR commands do
  1335. X+ not affect it.  
  1336. X+ .RE
  1337. X  .TP
  1338. X  .B $PSCal (read-only)
  1339. X  If non-zero, then the \fB\-p\fR option was supplied on the command line.
  1340. X***************
  1341. X*** 1573,1578 ****
  1342. X--- 1604,1613 ----
  1343. X  .B $SimpleCal (read-only)
  1344. X  Set to a non-zero value if \fIeither\fR of the \fB\-p\fR or \fB\-s\fR
  1345. X  command-line options was supplied.
  1346. X+ .TP
  1347. X+ .B $SubsIndent
  1348. X+ The number of spaces by which all lines (except the first) of an
  1349. X+ \fBMSF\fR-type reminder should be indented.  The default is 0.
  1350. X  .PP
  1351. X  Note:  If any of the calendar modes are in effect, then the
  1352. X  values of $Daemon, $DontFork, $DontTrigAts, $DontQueue, $HushMode,
  1353. X***************
  1354. X*** 1741,1746 ****
  1355. X--- 1776,1786 ----
  1356. X  for the specified year.  If \fIarg\fR is a \fBDATE\fR, then returns the
  1357. X  date of the next Easter Sunday on or after \fIarg\fR.
  1358. X  .TP
  1359. X+ .B filedate(s_filename)
  1360. X+ Returns the modification date of \fIfilename\fR.  If \fIfilename\fR
  1361. X+ does not exist, or its modification date is before the year
  1362. X+ \fBbaseyr()\fR, then 1 January of \fBbaseyr()\fR is returned.
  1363. X+ .TP
  1364. X  .B filedir()
  1365. X  Returns the directory which contains the current file being
  1366. X  processed.  It may be a relative or absolute pathname, but
  1367. X***************
  1368. X*** 2510,2515 ****
  1369. X--- 2550,2558 ----
  1370. X  initialized has remained defined.  Thus, time-consuming operations which
  1371. X  do not depend on the value of \fBtoday()\fR are done only once.
  1372. X  .PP
  1373. X+ System variables (those whose names start with '$') are automatically
  1374. X+ preserved between calendar iterations.
  1375. X+ .PP
  1376. X  Note that for efficiency, \fBRemind\fR caches the reminder script
  1377. X  (and any \fBINCLUDE\fRd files) in memory when producing a calendar.
  1378. X  .PP
  1379. X***************
  1380. X*** 2723,2734 ****
  1381. X  .SH FOREIGN LANGUAGE SUPPORT
  1382. X  .PP
  1383. X  Your version of \fBRemind\fR may have been compiled to support a
  1384. X! language other than English.  This support is not complete - for
  1385. X! example, all error and usage messages, as well as documentation, are
  1386. X! still in English.  However, foreign-language versions of \fBRemind\fR
  1387. X! will output names of months and weekdays in the foreign language.
  1388. X! Also, the substitution mechanism may substitute constructs suitable
  1389. X! for the foreign language rather than for English.
  1390. X  .PP
  1391. X  A foreign-language version of \fBRemind\fR will accept either the English
  1392. X  or foreign-language names of weekdays and months in a reminder script.
  1393. X--- 2766,2777 ----
  1394. X  .SH FOREIGN LANGUAGE SUPPORT
  1395. X  .PP
  1396. X  Your version of \fBRemind\fR may have been compiled to support a
  1397. X! language other than English.  This support may or may not be complete -
  1398. X! for example, all error and usage messages may still be in English.
  1399. X! However, at a minimum, foreign-language versions of \fBRemind\fR will
  1400. X! output names of months and weekdays in the foreign language.  Also,
  1401. X! the substitution mechanism will substitute constructs suitable for the
  1402. X! foreign language rather than for English.
  1403. X  .PP
  1404. X  A foreign-language version of \fBRemind\fR will accept either the English
  1405. X  or foreign-language names of weekdays and months in a reminder script.
  1406. X*** ../prev/sort.c    Mon Jun 28 12:29:54 1993
  1407. X--- ./sort.c    Thu Aug 19 16:12:01 1993
  1408. X***************
  1409. X*** 95,101 ****
  1410. X     int ShouldGoAfter;
  1411. X  
  1412. X     if (!new) {
  1413. X!       Eprint("Out of memory for sorting.");
  1414. X        IssueSortedReminders();
  1415. X        SortByDate = 0;
  1416. X        SortByTime = 0;
  1417. X--- 95,101 ----
  1418. X     int ShouldGoAfter;
  1419. X  
  1420. X     if (!new) {
  1421. X!       Eprint("%s", ErrMsg[E_NO_MEM]);
  1422. X        IssueSortedReminders();
  1423. X        SortByDate = 0;
  1424. X        SortByTime = 0;
  1425. X***************
  1426. X*** 160,172 ****
  1427. X  
  1428. X     while (cur) {
  1429. X        next = cur->next;
  1430. X!       if (cur->typ == MSG_TYPE) {
  1431. X      if (!MsgCommand) {
  1432. X              if (cur->trigdate != olddate) {
  1433. X                 IssueSortBanner(cur->trigdate);
  1434. X             olddate = cur->trigdate;
  1435. X              }
  1436. X!             printf("%s\n", cur->text);
  1437. X           } else {
  1438. X              char buf[LINELEN+TOKSIZE];
  1439. X              sprintf(buf, MsgCommand, cur->text);
  1440. X--- 160,175 ----
  1441. X  
  1442. X     while (cur) {
  1443. X        next = cur->next;
  1444. X!       if (cur->typ == MSG_TYPE || cur->typ == MSF_TYPE) {
  1445. X      if (!MsgCommand) {
  1446. X              if (cur->trigdate != olddate) {
  1447. X                 IssueSortBanner(cur->trigdate);
  1448. X             olddate = cur->trigdate;
  1449. X              }
  1450. X!         if (cur->typ == MSG_TYPE)
  1451. X!                printf("%s\n", cur->text);
  1452. X!             else
  1453. X!            FillParagraph(cur->text);
  1454. X           } else {
  1455. X              char buf[LINELEN+TOKSIZE];
  1456. X              sprintf(buf, MsgCommand, cur->text);
  1457. X*** ../prev/test.cmp    Mon Jun 28 12:30:09 1993
  1458. X--- ./test.cmp    Thu Aug 19 17:06:48 1993
  1459. X***************
  1460. X*** 187,195 ****
  1461. X  y => "Heshvan"
  1462. X  z => 1991/02/16
  1463. X  a => 5761
  1464. X! hebdate(30, "Heshvan", 1991/02/16, 5761) => ./test.rem(33): No 30 Heshvan 5761
  1465. X! Bad date specification
  1466. X! Leaving UserFN _i() => Bad date specification
  1467. X  
  1468. X  [_i(30, "Kislev", today(), 5759)] MSG Complete-Complete
  1469. X  today() => 1991/02/16
  1470. X--- 187,195 ----
  1471. X  y => "Heshvan"
  1472. X  z => 1991/02/16
  1473. X  a => 5761
  1474. X! hebdate(30, "Heshvan", 1991/02/16, 5761) => ./test.rem(33): 30 Heshvan 5761: Invalid Hebrew date
  1475. X! Invalid Hebrew date
  1476. X! Leaving UserFN _i() => Invalid Hebrew date
  1477. X  
  1478. X  [_i(30, "Kislev", today(), 5759)] MSG Complete-Complete
  1479. X  today() => 1991/02/16
  1480. X***************
  1481. X*** 220,228 ****
  1482. X  y => "Kislev"
  1483. X  z => 1991/02/16
  1484. X  a => 5761
  1485. X! hebdate(30, "Kislev", 1991/02/16, 5761) => ./test.rem(37): No 30 Kislev 5761
  1486. X! Bad date specification
  1487. X! Leaving UserFN _i() => Bad date specification
  1488. X  
  1489. X  [_i(30, "Adar A", today(), 5755)] MSG Leap
  1490. X  today() => 1991/02/16
  1491. X--- 220,228 ----
  1492. X  y => "Kislev"
  1493. X  z => 1991/02/16
  1494. X  a => 5761
  1495. X! hebdate(30, "Kislev", 1991/02/16, 5761) => ./test.rem(37): 30 Kislev 5761: Invalid Hebrew date
  1496. X! Invalid Hebrew date
  1497. X! Leaving UserFN _i() => Invalid Hebrew date
  1498. X  
  1499. X  [_i(30, "Adar A", today(), 5755)] MSG Leap
  1500. X  today() => 1991/02/16
  1501. X***************
  1502. X*** 243,250 ****
  1503. X  z => 1991/02/16
  1504. X  a => 5756
  1505. X  hebdate(30, "Adar A", 1991/02/16, 5756) => ./test.rem(40): No Adar A in 5756
  1506. X! Bad date specification
  1507. X! Leaving UserFN _i() => Bad date specification
  1508. X  [_i(29, "Adar A", today(), 5755)] MSG Leap
  1509. X  today() => 1991/02/16
  1510. X  Entering UserFN _i(29, "Adar A", 1991/02/16, 5755)
  1511. X--- 243,250 ----
  1512. X  z => 1991/02/16
  1513. X  a => 5756
  1514. X  hebdate(30, "Adar A", 1991/02/16, 5756) => ./test.rem(40): No Adar A in 5756
  1515. X! Invalid Hebrew date
  1516. X! Leaving UserFN _i() => Invalid Hebrew date
  1517. X  [_i(29, "Adar A", today(), 5755)] MSG Leap
  1518. X  today() => 1991/02/16
  1519. X  Entering UserFN _i(29, "Adar A", 1991/02/16, 5755)
  1520. X***************
  1521. X*** 264,271 ****
  1522. X  z => 1991/02/16
  1523. X  a => 5756
  1524. X  hebdate(29, "Adar A", 1991/02/16, 5756) => ./test.rem(42): No Adar A in 5756
  1525. X! Bad date specification
  1526. X! Leaving UserFN _i() => Bad date specification
  1527. X  
  1528. X  # Test each possible case of the basic reminders.
  1529. X  
  1530. X--- 264,271 ----
  1531. X  z => 1991/02/16
  1532. X  a => 5756
  1533. X  hebdate(29, "Adar A", 1991/02/16, 5756) => ./test.rem(42): No Adar A in 5756
  1534. X! Invalid Hebrew date
  1535. X! Leaving UserFN _i() => Invalid Hebrew date
  1536. X  
  1537. X  # Test each possible case of the basic reminders.
  1538. X  
  1539. X***************
  1540. X*** 631,637 ****
  1541. X  "a05" + "6" => "a056"
  1542. X  value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  1543. X  set a058 version()
  1544. X! version() => "03.00.07"
  1545. X  set a059 wkday(today())
  1546. X  today() => 1991/02/16
  1547. X  wkday(1991/02/16) => "Saturday"
  1548. X--- 631,637 ----
  1549. X  "a05" + "6" => "a056"
  1550. X  value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  1551. X  set a058 version()
  1552. X! version() => "03.00.08"
  1553. X  set a059 wkday(today())
  1554. X  today() => 1991/02/16
  1555. X  wkday(1991/02/16) => "Saturday"
  1556. X***************
  1557. X*** 710,716 ****
  1558. X  x => "foo"
  1559. X  y => 11:33
  1560. X  "foo" * 11:33 => Type mismatch
  1561. X! ./test.rem(240): Operator '*' Type mismatch
  1562. X  Leaving UserFN h() => Type mismatch
  1563. X  set a074 dosubst("%a %b %c %d %e %f %g %h", '1992/5/5')
  1564. X  dosubst("%a %b %c %d %e %f %g %h", 1992/05/05) => "on Tuesday, 5 May, 1992 in 444 days' tim"...
  1565. X--- 710,716 ----
  1566. X  x => "foo"
  1567. X  y => 11:33
  1568. X  "foo" * 11:33 => Type mismatch
  1569. X! ./test.rem(240): '*': Type mismatch
  1570. X  Leaving UserFN h() => Type mismatch
  1571. X  set a074 dosubst("%a %b %c %d %e %f %g %h", '1992/5/5')
  1572. X  dosubst("%a %b %c %d %e %f %g %h", 1992/05/05) => "on Tuesday, 5 May, 1992 in 444 days' tim"...
  1573. X***************
  1574. X*** 772,778 ****
  1575. X          a048  "foo"
  1576. X          a067  "INT"
  1577. X          a039  "February"
  1578. X!         a058  "03.00.07"
  1579. X          a077  "1992 92
  1580. X  "
  1581. X          a049  21
  1582. X--- 772,778 ----
  1583. X          a048  "foo"
  1584. X          a067  "INT"
  1585. X          a039  "February"
  1586. X!         a058  "03.00.08"
  1587. X          a077  "1992 92
  1588. X  "
  1589. X          a049  21
  1590. X*** ../prev/token.c    Mon Jun 28 12:29:56 1993
  1591. X--- ./token.c    Tue Aug  3 12:29:05 1993
  1592. X***************
  1593. X*** 68,73 ****
  1594. X--- 68,74 ----
  1595. X     { "march",        3,    T_Month,    2 },
  1596. X     { "may",        3,     T_Month,     4 },
  1597. X     { "monday",         3,    T_WkDay,    0 },
  1598. X+    { "msf",        3,    T_RemType,    MSF_TYPE },
  1599. X     { "msg",         3,     T_RemType,     MSG_TYPE },
  1600. X     { "november",     3,     T_Month,    10 },
  1601. X     { "october",        3,     T_Month,    9 },
  1602. X*** ../prev/trigger.c    Mon Jun 28 12:29:57 1993
  1603. X--- ./trigger.c    Thu Aug 19 16:44:15 1993
  1604. X***************
  1605. X*** 246,252 ****
  1606. X       return j;
  1607. X  
  1608. X        default:
  1609. X!     Eprint("NextSimpleTrig: Bad type %d", typ);
  1610. X      *err = E_SWERR;
  1611. X      return -1;
  1612. X     }
  1613. X--- 246,252 ----
  1614. X       return j;
  1615. X  
  1616. X        default:
  1617. X!     Eprint("NextSimpleTrig %s %d", ErrMsg[E_SWERR], typ);
  1618. X      *err = E_SWERR;
  1619. X      return -1;
  1620. X     }
  1621. X***************
  1622. X*** 395,402 ****
  1623. X         (trig->d == NO_DAY ||
  1624. X      trig->m == NO_MON ||
  1625. X      trig->y == NO_YR)) {
  1626. X!       Eprint("Must fully specify date to use repeat.");
  1627. X!       *err = E_PARSE_ERR;
  1628. X        return -1;
  1629. X     }
  1630. X         
  1631. X--- 395,402 ----
  1632. X         (trig->d == NO_DAY ||
  1633. X      trig->m == NO_MON ||
  1634. X      trig->y == NO_YR)) {
  1635. X!       Eprint("%s", ErrMsg[E_REP_FULSPEC]);
  1636. X!       *err = E_REP_FULSPEC;
  1637. X        return -1;
  1638. X     }
  1639. X         
  1640. X***************
  1641. X*** 408,415 ****
  1642. X        if (*err) return -1;
  1643. X        if (result == -1) {
  1644. X           if (DebugFlag & DB_PRTTRIG) {
  1645. X!         fprintf(ErrFp, "%s(%d): Expired\n",
  1646. X!            FileName, LineNo);
  1647. X       }
  1648. X           return -1;
  1649. X        }
  1650. X--- 408,415 ----
  1651. X        if (*err) return -1;
  1652. X        if (result == -1) {
  1653. X           if (DebugFlag & DB_PRTTRIG) {
  1654. X!         fprintf(ErrFp, "%s(%d): %s\n",
  1655. X!            FileName, LineNo, ErrMsg[E_EXPIRED]);
  1656. X       }
  1657. X           return -1;
  1658. X        }
  1659. X***************
  1660. X*** 436,443 ****
  1661. X            trig->skip == NO_SKIP &&
  1662. X        trig->rep == NO_REP) {
  1663. X            if (DebugFlag & DB_PRTTRIG) {
  1664. X!          fprintf(ErrFp, "%s(%d): Expired\n",
  1665. X!                  FileName, LineNo);
  1666. X           }
  1667. X           if (result != -1) {
  1668. X              LastTriggerDate = result;
  1669. X--- 436,443 ----
  1670. X            trig->skip == NO_SKIP &&
  1671. X        trig->rep == NO_REP) {
  1672. X            if (DebugFlag & DB_PRTTRIG) {
  1673. X!          fprintf(ErrFp, "%s(%d): %s\n",
  1674. X!                  FileName, LineNo, ErrMsg[E_EXPIRED]);
  1675. X           }
  1676. X           if (result != -1) {
  1677. X              LastTriggerDate = result;
  1678. X***************
  1679. X*** 452,459 ****
  1680. X          LastTrigValid = 1;
  1681. X       }
  1682. X           if (DebugFlag & DB_PRTTRIG) {
  1683. X!         fprintf(ErrFp, "%s(%d): Expired\n",
  1684. X!                   FileName, LineNo);
  1685. X           }
  1686. X       return -1;
  1687. X        }
  1688. X--- 452,459 ----
  1689. X          LastTrigValid = 1;
  1690. X       }
  1691. X           if (DebugFlag & DB_PRTTRIG) {
  1692. X!         fprintf(ErrFp, "%s(%d): %s\n",
  1693. X!                   FileName, LineNo, ErrMsg[E_EXPIRED]);
  1694. X           }
  1695. X       return -1;
  1696. X        }
  1697. X*** ../prev/tstlang.rem    Mon Jun 28 12:30:24 1993
  1698. X--- ./tstlang.rem    Thu Aug 19 16:01:52 1993
  1699. X***************
  1700. X*** 15,23 ****
  1701. X  #
  1702. X  # ---------------------------------------------------------------------------
  1703. X  
  1704. X! if version()<"03.00.02"
  1705. X     errmsg %
  1706. X!    errmsg This file only works with Remind version 03.00.02 and later - aborting
  1707. X     exit
  1708. X  endif
  1709. X  
  1710. X--- 15,30 ----
  1711. X  #
  1712. X  # ---------------------------------------------------------------------------
  1713. X  
  1714. X! if version()<"03.00.08"
  1715. X     errmsg %
  1716. X!    errmsg This file only works with Remind version 03.00.08 and later - aborting
  1717. X!    exit
  1718. X! endif
  1719. X! 
  1720. X! if !$RunOff || !$DontQueue || $DontTrigAts
  1721. X!    errmsg %
  1722. X!    errmsg Please run [filename()] with the -q and -r options, but%
  1723. X!    errmsg not the -a option.
  1724. X     exit
  1725. X  endif
  1726. X  
  1727. X*** ../prev/types.h    Mon Jun 28 12:29:32 1993
  1728. X--- ./types.h    Tue Aug  3 12:28:45 1993
  1729. X***************
  1730. X*** 100,105 ****
  1731. X--- 100,106 ----
  1732. X  #define SAT_TYPE 4
  1733. X  #define PS_TYPE  5
  1734. X  #define PSF_TYPE 6
  1735. X+ #define MSF_TYPE 7
  1736. X  
  1737. X  /* DEFINES for debugging flags */
  1738. X  #define DB_PRTLINE   1
  1739. X*** ../prev/userfns.c    Mon Jun 28 12:38:47 1993
  1740. X--- ./userfns.c    Thu Aug 19 16:43:05 1993
  1741. X***************
  1742. X*** 87,93 ****
  1743. X     StrnCpy(func->name, TokBuffer, VAR_NAME_LEN);
  1744. X     if (!Hush) {
  1745. X        if (FindFunc(TokBuffer, Func, NumFuncs)) {
  1746. X!          Eprint("Warning:  Attempt to redefine built-in function '%s'",
  1747. X               TokBuffer);
  1748. X        }
  1749. X     }
  1750. X--- 87,93 ----
  1751. X     StrnCpy(func->name, TokBuffer, VAR_NAME_LEN);
  1752. X     if (!Hush) {
  1753. X        if (FindFunc(TokBuffer, Func, NumFuncs)) {
  1754. X!          Eprint("%s: '%s'", ErrMsg[E_REDEF_FUNC],
  1755. X               TokBuffer);
  1756. X        }
  1757. X     }
  1758. X***************
  1759. X*** 131,137 ****
  1760. X  
  1761. X     /* Copy the text over */
  1762. X     if (p->isnested) {
  1763. X!       Eprint ("Can't nest function definition in expression.");
  1764. X        DestroyUserFunc(func);
  1765. X        return E_PARSE_ERR;
  1766. X     }
  1767. X--- 131,137 ----
  1768. X  
  1769. X     /* Copy the text over */
  1770. X     if (p->isnested) {
  1771. X!       Eprint("%s", ErrMsg[E_CANTNEST_FDEF]);
  1772. X        DestroyUserFunc(func);
  1773. X        return E_PARSE_ERR;
  1774. X     }
  1775. X***************
  1776. X*** 265,276 ****
  1777. X     f = FuncHash[h];
  1778. X     while (f && StrinCmp(name, f->name, VAR_NAME_LEN)) f = f->next;
  1779. X     if (!f) {
  1780. X!       Eprint("Undefined function '%s'", name);
  1781. X        return E_UNDEF_FUNC;
  1782. X     }
  1783. X     /* Debugging stuff */
  1784. X     if (DebugFlag & DB_PRTEXPR) {
  1785. X!       fprintf(ErrFp, "Entering UserFN %s(", f->name);
  1786. X        for (i=0; i<nargs; i++) {
  1787. X           PrintValue(&ValStack[ValStackPtr - nargs + i], ErrFp);
  1788. X           if (i<nargs-1) fprintf(ErrFp, ", ");
  1789. X--- 265,276 ----
  1790. X     f = FuncHash[h];
  1791. X     while (f && StrinCmp(name, f->name, VAR_NAME_LEN)) f = f->next;
  1792. X     if (!f) {
  1793. X!       Eprint("%s: '%s'", ErrMsg[E_UNDEF_FUNC], name);
  1794. X        return E_UNDEF_FUNC;
  1795. X     }
  1796. X     /* Debugging stuff */
  1797. X     if (DebugFlag & DB_PRTEXPR) {
  1798. X!       fprintf(ErrFp, "%s %s(", ErrMsg[E_ENTER_FUN], f->name);
  1799. X        for (i=0; i<nargs; i++) {
  1800. X           PrintValue(&ValStack[ValStackPtr - nargs + i], ErrFp);
  1801. X           if (i<nargs-1) fprintf(ErrFp, ", ");
  1802. X***************
  1803. X*** 280,286 ****
  1804. X     /* Detect illegal recursive call */
  1805. X     if (f->IsActive) {
  1806. X        if (DebugFlag &DB_PRTEXPR) {
  1807. X!          fprintf(ErrFp, "Leaving UserFN %s() => ", name);
  1808. X           fprintf(ErrFp, "%s\n", ErrMsg[E_RECURSIVE]);
  1809. X        }
  1810. X        return E_RECURSIVE;
  1811. X--- 280,286 ----
  1812. X     /* Detect illegal recursive call */
  1813. X     if (f->IsActive) {
  1814. X        if (DebugFlag &DB_PRTEXPR) {
  1815. X!          fprintf(ErrFp, "%s %s() => ", ErrMsg[E_LEAVE_FUN], name);
  1816. X           fprintf(ErrFp, "%s\n", ErrMsg[E_RECURSIVE]);
  1817. X        }
  1818. X        return E_RECURSIVE;
  1819. X***************
  1820. X*** 289,295 ****
  1821. X     /* Check number of args */
  1822. X     if (nargs != f->nargs) {
  1823. X        if (DebugFlag &DB_PRTEXPR) {
  1824. X!          fprintf(ErrFp, "Leaving UserFN %s() => ", name);
  1825. X           fprintf(ErrFp, "%s\n",
  1826. X          ErrMsg[(nargs < f->nargs) ? E_2FEW_ARGS : E_2MANY_ARGS]);
  1827. X        }
  1828. X--- 289,295 ----
  1829. X     /* Check number of args */
  1830. X     if (nargs != f->nargs) {
  1831. X        if (DebugFlag &DB_PRTEXPR) {
  1832. X!          fprintf(ErrFp, "%s %s() => ", ErrMsg[E_LEAVE_FUN], name);
  1833. X           fprintf(ErrFp, "%s\n",
  1834. X          ErrMsg[(nargs < f->nargs) ? E_2FEW_ARGS : E_2MANY_ARGS]);
  1835. X        }
  1836. X***************
  1837. X*** 299,305 ****
  1838. X     h = SetUpLocalVars(f);
  1839. X     if (h) {
  1840. X        if (DebugFlag &DB_PRTEXPR) {
  1841. X!          fprintf(ErrFp, "Leaving UserFN %s() => ", name);
  1842. X           fprintf(ErrFp, "%s\n", ErrMsg[h]);
  1843. X        }
  1844. X        return h;
  1845. X--- 299,305 ----
  1846. X     h = SetUpLocalVars(f);
  1847. X     if (h) {
  1848. X        if (DebugFlag &DB_PRTEXPR) {
  1849. X!          fprintf(ErrFp, "%s %s() => ", ErrMsg[E_LEAVE_FUN], name);
  1850. X           fprintf(ErrFp, "%s\n", ErrMsg[h]);
  1851. X        }
  1852. X        return h;
  1853. X***************
  1854. X*** 316,322 ****
  1855. X     f->IsActive = 0;
  1856. X     DestroyLocalVals(f);
  1857. X     if (DebugFlag &DB_PRTEXPR) {
  1858. X!       fprintf(ErrFp, "Leaving UserFN %s() => ", name);
  1859. X        if (h) fprintf(ErrFp, "%s\n", ErrMsg[h]);
  1860. X        else {
  1861. X           PrintValue(&ValStack[ValStackPtr-1], ErrFp);
  1862. X--- 316,322 ----
  1863. X     f->IsActive = 0;
  1864. X     DestroyLocalVals(f);
  1865. X     if (DebugFlag &DB_PRTEXPR) {
  1866. X!       fprintf(ErrFp, "%s %s() => ", ErrMsg[E_LEAVE_FUN], name);
  1867. X        if (h) fprintf(ErrFp, "%s\n", ErrMsg[h]);
  1868. X        else {
  1869. X           PrintValue(&ValStack[ValStackPtr-1], ErrFp);
  1870. X*** ../prev/utils.c    Mon Jun 28 12:37:05 1993
  1871. X--- ./utils.c    Wed Aug 25 14:49:21 1993
  1872. X***************
  1873. X*** 19,25 ****
  1874. X--- 19,27 ----
  1875. X  #include <malloc.h>
  1876. X  #endif
  1877. X  #include <ctype.h>
  1878. X+ #include "types.h"
  1879. X  #include "globals.h"
  1880. X+ #include "protos.h"
  1881. X  
  1882. X  #define UPPER(c) (islower(c) ? toupper(c) : c)
  1883. X  
  1884. X*** ../prev/var.c    Mon Jul 19 10:58:54 1993
  1885. X--- ./var.c    Thu Aug 19 16:40:40 1993
  1886. X***************
  1887. X*** 29,34 ****
  1888. X--- 29,38 ----
  1889. X  
  1890. X  /* The variable hash table */
  1891. X  #define VAR_HASH_SIZE 64
  1892. X+ #define VARIABLE ErrMsg[E_VAR]
  1893. X+ #define VALUE    ErrMsg[E_VAL]
  1894. X+ #define UNDEF     ErrMsg[E_UNDEF]
  1895. X+ 
  1896. X  static Var *VHashTbl[VAR_HASH_SIZE];
  1897. X  
  1898. X  /***************************************************************/
  1899. X***************
  1900. X*** 38,55 ****
  1901. X  /*                                                             */
  1902. X  /***************************************************************/
  1903. X  #ifdef HAVE_PROTOS
  1904. X! PUBLIC int HashVal(const char *str)
  1905. X  #else
  1906. X! int HashVal(str)
  1907. X  char *str;
  1908. X  #endif
  1909. X  {
  1910. X!    register int i = 0;
  1911. X!    register int j=1;
  1912. X!    register int len=0;
  1913. X  
  1914. X     while(*str && len < VAR_NAME_LEN) {
  1915. X!       i += j * UPPER(*str);
  1916. X        str++;
  1917. X        len++;
  1918. X        j = 3-j;
  1919. X--- 42,59 ----
  1920. X  /*                                                             */
  1921. X  /***************************************************************/
  1922. X  #ifdef HAVE_PROTOS
  1923. X! PUBLIC unsigned int HashVal(const char *str)
  1924. X  #else
  1925. X! unsigned int HashVal(str)
  1926. X  char *str;
  1927. X  #endif
  1928. X  {
  1929. X!    register unsigned int i=0;
  1930. X!    register unsigned int j=1;
  1931. X!    register unsigned int len=0;
  1932. X  
  1933. X     while(*str && len < VAR_NAME_LEN) {
  1934. X!       i += j * (unsigned int) UPPER(*str);
  1935. X        str++;
  1936. X        len++;
  1937. X        j = 3-j;
  1938. X***************
  1939. X*** 187,193 ****
  1940. X     v=FindVar(str, 0);
  1941. X  
  1942. X     if (!v) {
  1943. X!      Eprint("Undefined variable: %s", str);
  1944. X       return E_NOSUCH_VAR;
  1945. X     }
  1946. X     return CopyValue(val, &v->v);
  1947. X--- 191,197 ----
  1948. X     v=FindVar(str, 0);
  1949. X  
  1950. X     if (!v) {
  1951. X!      Eprint("%s: %s", ErrMsg[E_NOSUCH_VAR], str);
  1952. X       return E_NOSUCH_VAR;
  1953. X     }
  1954. X     return CopyValue(val, &v->v);
  1955. X***************
  1956. X*** 273,279 ****
  1957. X        DumpVarTable();
  1958. X        return OK;
  1959. X     }
  1960. X!    fprintf(ErrFp, "%*s  %s\n\n", VAR_NAME_LEN, "Variable", "Value");
  1961. X     while(1) {
  1962. X        if (*TokBuffer == '$') {
  1963. X           DumpSysVarByName(TokBuffer+1);
  1964. X--- 277,283 ----
  1965. X        DumpVarTable();
  1966. X        return OK;
  1967. X     }
  1968. X!    fprintf(ErrFp, "%*s  %s\n\n", VAR_NAME_LEN, VARIABLE, VALUE);
  1969. X     while(1) {
  1970. X        if (*TokBuffer == '$') {
  1971. X           DumpSysVarByName(TokBuffer+1);
  1972. X***************
  1973. X*** 280,286 ****
  1974. X        } else {
  1975. X           v = FindVar(TokBuffer, 0);
  1976. X           TokBuffer[VAR_NAME_LEN] = 0;
  1977. X!          if (!v) fprintf(ErrFp, "%*s  *UNDEFINED*\n", VAR_NAME_LEN, TokBuffer);
  1978. X           else {
  1979. X              fprintf(ErrFp, "%*s  ", VAR_NAME_LEN, v->name);
  1980. X              PrintValue(&(v->v), ErrFp);
  1981. X--- 284,290 ----
  1982. X        } else {
  1983. X           v = FindVar(TokBuffer, 0);
  1984. X           TokBuffer[VAR_NAME_LEN] = 0;
  1985. X!          if (!v) fprintf(ErrFp, "%*s  %s\n", VAR_NAME_LEN, TokBuffer, UNDEF);
  1986. X           else {
  1987. X              fprintf(ErrFp, "%*s  ", VAR_NAME_LEN, v->name);
  1988. X              PrintValue(&(v->v), ErrFp);
  1989. X***************
  1990. X*** 309,315 ****
  1991. X     register Var *v;
  1992. X     register int i;
  1993. X  
  1994. X!    fprintf(ErrFp, "%*s  %s\n\n", VAR_NAME_LEN, "Variable", "Value");
  1995. X  
  1996. X     for (i=0; i<VAR_HASH_SIZE; i++) {
  1997. X        v = VHashTbl[i];
  1998. X--- 313,319 ----
  1999. X     register Var *v;
  2000. X     register int i;
  2001. X  
  2002. X!    fprintf(ErrFp, "%*s  %s\n\n", VAR_NAME_LEN, VARIABLE, VALUE);
  2003. X  
  2004. X     for (i=0; i<VAR_HASH_SIZE; i++) {
  2005. X        v = VHashTbl[i];
  2006. X***************
  2007. X*** 442,448 ****
  2008. X--- 446,454 ----
  2009. X     {   "DontFork",      0,        &DontFork,    0,    0   },
  2010. X     {   "DontQueue",      0,        &DontQueue,    0,    0   },
  2011. X     {   "DontTrigAts",      0,        &DontIssueAts,    0,    0   },
  2012. X+    {   "FirstIndent",      1,        &FirstIndent,    0,    132 },
  2013. X     {   "FoldYear",      1,        &FoldYear,    0,    1   },
  2014. X+    {   "FormWidth",      1,        &FormWidth,    20,    132 },
  2015. X     {   "HushMode",      0,        &Hush,        0,    0   },
  2016. X     {   "IgnoreOnce",      0,        &IgnoreOnce,    0,    0   },
  2017. X     {   "InfDelta",      0,        &InfiniteDelta,    0,    0   },
  2018. X***************
  2019. X*** 459,465 ****
  2020. X     {   "NumTrig",      0,        &NumTriggered,    0,    0   },
  2021. X     {   "PSCal",          0,        &PsCal,        0,    0   },
  2022. X     {   "RunOff",      0,        &RunDisabled,    0,    0   },
  2023. X!    {   "SimpleCal",      0,        &DoSimpleCalendar,    0,  0 }
  2024. X  };
  2025. X  
  2026. X  #define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
  2027. X--- 465,472 ----
  2028. X     {   "NumTrig",      0,        &NumTriggered,    0,    0   },
  2029. X     {   "PSCal",          0,        &PsCal,        0,    0   },
  2030. X     {   "RunOff",      0,        &RunDisabled,    0,    0   },
  2031. X!    {   "SimpleCal",      0,        &DoSimpleCalendar,    0,  0 },
  2032. X!    {   "SubsIndent",      1,        &SubsIndent,    0,    132}
  2033. X  };
  2034. X  
  2035. X  #define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
  2036. X***************
  2037. X*** 483,489 ****
  2038. X     SysVar *v = FindSysVar(name);
  2039. X     if (!v) return E_NOSUCH_VAR;
  2040. X     if (!v->modifiable) {
  2041. X!       Eprint("Cannot modify system variable '$%s'", name);
  2042. X        return E_CANT_MODIFY;
  2043. X     }
  2044. X     if (v->max != NO_CONSTRAINT && value > v->max) return E_2HIGH;
  2045. X--- 490,496 ----
  2046. X     SysVar *v = FindSysVar(name);
  2047. X     if (!v) return E_NOSUCH_VAR;
  2048. X     if (!v->modifiable) {
  2049. X!       Eprint("%s: '$%s'", ErrMsg[E_CANT_MODIFY], name);
  2050. X        return E_CANT_MODIFY;
  2051. X     }
  2052. X     if (v->max != NO_CONSTRAINT && value > v->max) return E_2HIGH;
  2053. X***************
  2054. X*** 598,610 ****
  2055. X     if (v) {
  2056. X        if (!v->modifiable) fprintf(ErrFp, "%d\n", *v->value);
  2057. X        else {
  2058. X!          fprintf(ErrFp, "%-10d  Allowed range: ", *v->value);
  2059. X       if (v->min == NO_CONSTRAINT) fprintf(ErrFp, "(-Inf, ");
  2060. X       else                         fprintf(ErrFp, "[%d, ", v->min);
  2061. X       if (v->max == NO_CONSTRAINT) fprintf(ErrFp, "Inf)\n");
  2062. X       else                         fprintf(ErrFp, "%d]\n", v->max);
  2063. X        }
  2064. X!    } else   fprintf(ErrFp, "*UNDEFINED*\n");
  2065. X  
  2066. X     return;
  2067. X  }
  2068. X--- 605,617 ----
  2069. X     if (v) {
  2070. X        if (!v->modifiable) fprintf(ErrFp, "%d\n", *v->value);
  2071. X        else {
  2072. X!          fprintf(ErrFp, "%-10d  ", *v->value);
  2073. X       if (v->min == NO_CONSTRAINT) fprintf(ErrFp, "(-Inf, ");
  2074. X       else                         fprintf(ErrFp, "[%d, ", v->min);
  2075. X       if (v->max == NO_CONSTRAINT) fprintf(ErrFp, "Inf)\n");
  2076. X       else                         fprintf(ErrFp, "%d]\n", v->max);
  2077. X        }
  2078. X!    } else   fprintf(ErrFp, "%s\n", UNDEF);
  2079. X  
  2080. X     return;
  2081. X  }
  2082. END_OF_FILE
  2083.   if test 60678 -ne `wc -c <'patch.08.C'`; then
  2084.     echo shar: \"'patch.08.C'\" unpacked with wrong size!
  2085.   elif test -f 'patch.08.A' && test -f 'patch.08.B'; then
  2086.     echo shar: Combining  \"'patch.08'\" \(120124 characters\)
  2087.     cat 'patch.08.A' 'patch.08.B' 'patch.08.C' > 'patch.08'
  2088.     if test 120124 -ne `wc -c <'patch.08'`; then
  2089.       echo shar: \"'patch.08'\" combined with wrong size!
  2090.     else
  2091.       rm patch.08.A patch.08.B patch.08.C
  2092.     fi
  2093.   fi
  2094.   # end of 'patch.08.C'
  2095. fi
  2096. echo shar: End of archive 2 \(of 3\).
  2097. cp /dev/null ark2isdone
  2098. MISSING=""
  2099. for I in 1 2 3 ; do
  2100.     if test ! -f ark${I}isdone ; then
  2101.     MISSING="${MISSING} ${I}"
  2102.     fi
  2103. done
  2104. if test "${MISSING}" = "" ; then
  2105.     echo You have unpacked all 3 archives.
  2106.     rm -f ark[1-9]isdone
  2107. else
  2108.     echo You still must unpack the following archives:
  2109.     echo "        " ${MISSING}
  2110. fi
  2111. exit 0
  2112. exit 0 # Just in case...
  2113.