home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume39 / remind / patch09b < prev    next >
Encoding:
Text File  |  1993-10-04  |  54.8 KB  |  1,796 lines

  1. Newsgroups: comp.sources.misc
  2. From: dfs@doe.carleton.ca (David F. Skoll)
  3. Subject: v39i116:  remind - A replacement for calendar, Patch09b/4
  4. Message-ID: <1993Oct4.203923.8020@sparky.sterling.com>
  5. X-Md4-Signature: 2dfabe41b984468a550261045f6f42b7
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Dept. of Electronics, Carleton University
  8. Date: Mon, 4 Oct 1993 20:39:23 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: dfs@doe.carleton.ca (David F. Skoll)
  12. Posting-number: Volume 39, Issue 116
  13. Archive-name: remind/patch09b
  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.09.C
  22. # Wrapped by kent@sparky on Mon Oct  4 15:03:30 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 4)."'
  26. if test -f 'patch.09.C' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'patch.09.C'\"
  28. else
  29.   echo shar: Extracting \"'patch.09.C'\" \(52176 characters\)
  30.   sed "s/^X//" >'patch.09.C' <<'END_OF_FILE'
  31. X*** ../prev/french.h    Thu Aug 26 10:49:49 1993
  32. X--- ./french.h    Tue Sep 28 12:35:38 1993
  33. X***************
  34. X*** 361,367 ****
  35. X     fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
  36. X  #endif
  37. X  #ifdef ISOLATIN1
  38. X!    fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date]\n");
  39. X     fprintf(ErrFp, "Options:\n");
  40. X     fprintf(ErrFp, " -n     Afficher la prochaine occurence des rappels en format simple\n");
  41. X     fprintf(ErrFp, " -r     D\351sactiver les instructions RUN\n");
  42. X--- 361,367 ----
  43. X     fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
  44. X  #endif
  45. X  #ifdef ISOLATIN1
  46. X!    fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [*r\351p\351tition]\n");
  47. X     fprintf(ErrFp, "Options:\n");
  48. X     fprintf(ErrFp, " -n     Afficher la prochaine occurence des rappels en format simple\n");
  49. X     fprintf(ErrFp, " -r     D\351sactiver les instructions RUN\n");
  50. X***************
  51. X*** 387,394 ****
  52. X     fprintf(ErrFp, " -kcmd  Ex\351cuter 'cmd' pour les rappels de type MSG\n");
  53. X     fprintf(ErrFp, " -g[d[d]] Trier les rappels par date et heure avant lancement\n");
  54. X     fprintf(ErrFp, " -ivar=val Initialiser var \340 val et conserver var\n\n");
  55. X  #else /* ISOLATIN1 */
  56. X!    fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date]\n");
  57. X     fprintf(ErrFp, "Options:\n");
  58. X     fprintf(ErrFp, " -n     Afficher la prochaine occurence des rappels en format simple\n");
  59. X     fprintf(ErrFp, " -r     Desactiver les instructions RUN\n");
  60. X--- 387,395 ----
  61. X     fprintf(ErrFp, " -kcmd  Ex\351cuter 'cmd' pour les rappels de type MSG\n");
  62. X     fprintf(ErrFp, " -g[d[d]] Trier les rappels par date et heure avant lancement\n");
  63. X     fprintf(ErrFp, " -ivar=val Initialiser var \340 val et conserver var\n\n");
  64. X+    fprintf(ErrFp, " -m     Commencer le calendrier avec lundi plutot que dimanche");
  65. X  #else /* ISOLATIN1 */
  66. X!    fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [*repetition]\n");
  67. X     fprintf(ErrFp, "Options:\n");
  68. X     fprintf(ErrFp, " -n     Afficher la prochaine occurence des rappels en format simple\n");
  69. X     fprintf(ErrFp, " -r     Desactiver les instructions RUN\n");
  70. X***************
  71. X*** 414,419 ****
  72. X--- 415,421 ----
  73. X     fprintf(ErrFp, " -kcmd  Executer 'cmd' pour les rappels de type MSG\n");
  74. X     fprintf(ErrFp, " -g[d[d]] Trier les rappels par date et heure avant lancement\n");
  75. X     fprintf(ErrFp, " -ivar=val Initialiser var a val et conserver var\n\n");
  76. X+    fprintf(ErrFp, " -m     Commencer le calendrier avec lundi plutot que dimanche");
  77. X  #endif /* ISOLATIN1 */
  78. X     exit(1);
  79. X  }
  80. X*** ../prev/funcs.c    Thu Aug 19 16:58:12 1993
  81. X--- ./funcs.c    Tue Sep 28 16:45:33 1993
  82. X***************
  83. X*** 81,86 ****
  84. X--- 81,89 ----
  85. X  PRIVATE    int    FMin        ARGS ((void));
  86. X  PRIVATE    int    FMinute        ARGS ((void));
  87. X  PRIVATE    int    FMinsfromutc    ARGS ((void));
  88. X+ PRIVATE    int    FMoondate    ARGS ((void));
  89. X+ PRIVATE    int    FMoonphase    ARGS ((void));
  90. X+ PRIVATE    int    FMoontime    ARGS ((void));
  91. X  PRIVATE    int    FMon        ARGS ((void));
  92. X  PRIVATE    int    FMonnum        ARGS ((void));
  93. X  PRIVATE    int    FOrd        ARGS ((void));
  94. X***************
  95. X*** 87,92 ****
  96. X--- 90,97 ----
  97. X  PRIVATE    int    FOstype     ARGS ((void));
  98. X  PRIVATE    int    FPlural        ARGS ((void));
  99. X  PRIVATE    int    FSgn        ARGS ((void));
  100. X+ PRIVATE int    FPsmoon        ARGS ((void));
  101. X+ PRIVATE int    FPsshade    ARGS ((void));
  102. X  PRIVATE    int    FShell        ARGS ((void));
  103. X  PRIVATE    int    FStrlen        ARGS ((void));
  104. X  PRIVATE    int    FSubstr        ARGS ((void));
  105. X***************
  106. X*** 196,205 ****
  107. X--- 201,215 ----
  108. X      {   "minute",    1,    1,    FMinute },
  109. X      {   "mon",        1,    1,    FMon    },
  110. X      {   "monnum",    1,    1,    FMonnum },
  111. X+     {    "moondate",    1,    3,    FMoondate },
  112. X+     {    "moonphase",    0,    2,    FMoonphase },
  113. X+     {    "moontime",    1,    3,    FMoontime },
  114. X      {   "now",        0,    0,    FNow    },
  115. X      {   "ord",        1,    1,    FOrd    },
  116. X      {   "ostype",       0,      0,      FOstype },
  117. X      {   "plural",    1,    3,    FPlural },
  118. X+     {    "psmoon",    1,    2,    FPsmoon},
  119. X+     {    "psshade",    1,    1,    FPsshade},
  120. X      {   "realtoday",    0,      0,      FRealtoday },
  121. X      {   "sgn",        1,    1,    FSgn    },
  122. X      {   "shell",    1,    1,    FShell    },
  123. X***************
  124. X*** 2044,2046 ****
  125. X--- 2054,2250 ----
  126. X  
  127. X     return OK;
  128. X  }
  129. X+ 
  130. X+ /***************************************************************/
  131. X+ /*                                                             */
  132. X+ /*  FPsshade                                                   */
  133. X+ /*                                                             */
  134. X+ /*  Canned PostScript code for shading a calendar square       */
  135. X+ /*                                                             */
  136. X+ /***************************************************************/
  137. X+ #ifdef HAVE_PROTOS
  138. X+ PRIVATE int FPsshade(void)
  139. X+ #else
  140. X+ static int FPsshade()
  141. X+ #endif
  142. X+ {
  143. X+    char psbuff[256];
  144. X+    char *s = psbuff;
  145. X+    if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
  146. X+    if (ARG(0).v.val < 0) return E_2LOW;
  147. X+    if (ARG(0).v.val > 100) return E_2HIGH;
  148. X+ 
  149. X+    sprintf(s, "/_A LineWidth 2 div def ");
  150. X+    s += strlen(s);
  151. X+    sprintf(s, "_A _A moveto ");
  152. X+    s += strlen(s);
  153. X+    sprintf(s, "BoxWidth _A sub _A lineto BoxWidth _A sub BoxHeight _A sub lineto ");
  154. X+    s += strlen(s);
  155. X+    sprintf(s, "_A BoxHeight _A sub lineto closepath %d 100 div setgray fill 0.0 setgray", ARG(0).v.val);
  156. X+    return RetStrVal(psbuff);
  157. X+ }
  158. X+ 
  159. X+ /***************************************************************/
  160. X+ /*                                                             */
  161. X+ /*  FPsmoon                                                    */
  162. X+ /*                                                             */
  163. X+ /*  Canned PostScript code for generating moon phases          */
  164. X+ /*                                                             */
  165. X+ /***************************************************************/
  166. X+ #ifdef HAVE_PROTOS
  167. X+ PRIVATE int FPsmoon(void)
  168. X+ #else
  169. X+ static int FPsmoon()
  170. X+ #endif
  171. X+ {
  172. X+    char psbuff[256];
  173. X+    char sizebuf[30];
  174. X+    char *s = psbuff;
  175. X+    if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
  176. X+    if (ARG(0).v.val < 0) return E_2LOW;
  177. X+    if (ARG(0).v.val > 3) return E_2HIGH;
  178. X+    if (Nargs > 1) {
  179. X+       if (ARG(1).type != INT_TYPE) return E_BAD_TYPE;
  180. X+       if (ARG(1).v.val <= 0) return E_2LOW;
  181. X+       sprintf(sizebuf, "%d", ARG(1).v.val);
  182. X+    } else {
  183. X+       strcpy(sizebuf, "DaySize 2 div");
  184. X+    }
  185. X+ 
  186. X+    sprintf(s, "gsave 0 setgray newpath Border %s add BoxHeight Border sub %s sub",
  187. X+            sizebuf, sizebuf);
  188. X+    s += strlen(s);
  189. X+    sprintf(s, " %s 0 360 arc closepath", sizebuf);
  190. X+    s += strlen(s);
  191. X+    switch(ARG(0).v.val) {
  192. X+       case 0:
  193. X+      sprintf(s, " fill grestore");
  194. X+      break;
  195. X+ 
  196. X+       case 2:
  197. X+      sprintf(s, " stroke grestore");
  198. X+      break;
  199. X+ 
  200. X+       case 1:
  201. X+          sprintf(s, " stroke");
  202. X+      s += strlen(s);
  203. X+          sprintf(s, " newpath Border %s add BoxHeight Border sub %s sub",
  204. X+                  sizebuf, sizebuf);
  205. X+      s += strlen(s);
  206. X+      sprintf(s, " %s 90 270 arc closepath fill grestore", sizebuf);
  207. X+      break;
  208. X+ 
  209. X+       default:
  210. X+          sprintf(s, " stroke");
  211. X+      s += strlen(s);
  212. X+          sprintf(s, " newpath Border %s add BoxHeight Border sub %s sub",
  213. X+                  sizebuf, sizebuf);
  214. X+      s += strlen(s);
  215. X+      sprintf(s, " %s 270 90 arc closepath fill grestore", sizebuf);
  216. X+      break;
  217. X+    }
  218. X+    return RetStrVal(psbuff);
  219. X+ }
  220. X+ 
  221. X+ /***************************************************************/
  222. X+ /*                                                             */
  223. X+ /*  FMoonphase                                                 */
  224. X+ /*                                                             */
  225. X+ /*  Phase of moon for specified date/time.                     */
  226. X+ /*                                                             */
  227. X+ /***************************************************************/
  228. X+ #ifdef HAVE_PROTOS
  229. X+ PRIVATE int FMoonphase(void)
  230. X+ #else
  231. X+ static int FMoonphase()
  232. X+ #endif
  233. X+ {
  234. X+    int date, time;
  235. X+ 
  236. X+    switch(Nargs) {
  237. X+       case 0:
  238. X+          date = JulianToday;
  239. X+      time = 0;
  240. X+      break;
  241. X+       case 1:
  242. X+          if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
  243. X+      date = ARG(0).v.val;
  244. X+      time = 0;
  245. X+      break;
  246. X+       case 2:
  247. X+          if (ARG(0).type != DATE_TYPE && ARG(1).type != TIM_TYPE) return E_BAD_TYPE;
  248. X+      date = ARG(0).v.val;
  249. X+      time = ARG(1).v.val;
  250. X+      break;
  251. X+ 
  252. X+       default: return E_SWERR;
  253. X+    }
  254. X+ 
  255. X+    RetVal.type = INT_TYPE;
  256. X+    RetVal.v.val = MoonPhase(date, time);
  257. X+    return OK;
  258. X+ }
  259. X+ 
  260. X+ /***************************************************************/
  261. X+ /*                                                             */
  262. X+ /*  FMoondate                                                  */
  263. X+ /*                                                             */
  264. X+ /*  Hunt for next occurrence of specified moon phase           */
  265. X+ /*                                                             */
  266. X+ /***************************************************************/
  267. X+ PRIVATE int MoonStuff ARGS ((int want_time));
  268. X+ #ifdef HAVE_PROTOS
  269. X+ PRIVATE int FMoondate(void)
  270. X+ #else
  271. X+ static int FMoondate()
  272. X+ #endif
  273. X+ {
  274. X+    return MoonStuff(0);
  275. X+ }
  276. X+ 
  277. X+ #ifdef HAVE_PROTOS
  278. X+ PRIVATE int FMoontime(void)
  279. X+ #else
  280. X+ static int FMoontime()
  281. X+ #endif
  282. X+ {
  283. X+    return MoonStuff(1);
  284. X+ }
  285. X+ 
  286. X+ #ifdef HAVE_PROTOS
  287. X+ PRIVATE int MoonStuff(int want_time)
  288. X+ #else
  289. X+ static int MoonStuff(want_time)
  290. X+ int want_time;
  291. X+ #endif
  292. X+ {
  293. X+    int startdate, starttim;
  294. X+    int d, t;
  295. X+ 
  296. X+    startdate = JulianToday;
  297. X+    starttim = 0;
  298. X+ 
  299. X+    if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
  300. X+    if (ARG(0).v.val < 0) return E_2LOW;
  301. X+    if (ARG(0).v.val > 3) return E_2HIGH;
  302. X+    if (Nargs >= 2) {
  303. X+       if (ARG(1).type != DATE_TYPE) return E_BAD_TYPE;
  304. X+       startdate = ARG(1).v.val;
  305. X+       if (Nargs >= 3) {
  306. X+          if (ARG(2).type != TIM_TYPE) return E_BAD_TYPE;
  307. X+      starttim = ARG(2).v.val;
  308. X+       }
  309. X+    }
  310. X+ 
  311. X+    HuntPhase(startdate, starttim, ARG(0).v.val, &d, &t);
  312. X+    if (want_time) {
  313. X+       RetVal.type = TIM_TYPE;
  314. X+       RetVal.v.val = t;
  315. X+    } else {
  316. X+       RetVal.type = DATE_TYPE;
  317. X+       RetVal.v.val = d;
  318. X+    }
  319. X+    return OK;
  320. X+ }
  321. X+ 
  322. X+ 
  323. X*** ../prev/globals.h    Thu Aug 19 15:46:05 1993
  324. X--- ./globals.h    Tue Sep 28 10:56:14 1993
  325. X***************
  326. X*** 39,44 ****
  327. X--- 39,46 ----
  328. X  EXTERN  INIT(    int     DebugFlag, 0);
  329. X  EXTERN  INIT(   int    DoCalendar, 0);
  330. X  EXTERN  INIT(   int     DoSimpleCalendar, 0);
  331. X+ EXTERN    INIT(    int    MondayFirst, 0);
  332. X+ EXTERN    INIT(    int    Iterations, 1);
  333. X  EXTERN  INIT(   int     PsCal, 0);
  334. X  EXTERN  INIT(   int     CalWidth, 80);
  335. X  EXTERN  INIT(   int     CalWeeks, 0);
  336. X***************
  337. X*** 86,91 ****
  338. X--- 88,94 ----
  339. X  EXTERN  INIT(    int      LongDeg, LON_DEG);
  340. X  EXTERN  INIT(    int      LongMin, LON_MIN);
  341. X  EXTERN  INIT(    int      LongSec, LON_SEC);
  342. X+ EXTERN    INIT(    char      *Location, LOCATION);
  343. X  
  344. X  /* UTC calculation stuff */
  345. X  EXTERN  INIT(    int      MinsFromUTC, 0);
  346. X***************
  347. X*** 96,101 ****
  348. X--- 99,106 ----
  349. X  EXTERN  INIT(   int      FormWidth, 72);
  350. X  EXTERN    INIT(    int      FirstIndent, 0);
  351. X  EXTERN    INIT(    int      SubsIndent, 0);
  352. X+ EXTERN    INIT(    char      *EndSent, ".?!");
  353. X+ EXTERN    INIT(    char      *EndSentIg, "\"')]}>");
  354. X  
  355. X  /* We need the language stuff here... */
  356. X  
  357. X*** ../prev/init.c    Fri Aug 20 11:46:29 1993
  358. X--- ./init.c    Tue Sep 28 11:03:50 1993
  359. X***************
  360. X*** 66,71 ****
  361. X--- 66,72 ----
  362. X   *             by non-root, changes environment but not effective uid.
  363. X   *  -kcmd    = Run 'cmd' for MSG-type reminders instead of printing to stdout
  364. X   *  -iVAR=EXPR = Initialize and preserve VAR.
  365. X+  *  -m       = Start calendar with Monday instead of Sunday.
  366. X   *  A minus sign alone indicates to take input from stdin
  367. X   *
  368. X   **************************************************************/
  369. X***************
  370. X*** 104,115 ****
  371. X  {
  372. X     char *arg;
  373. X     int i;
  374. X!    int y, m, d;
  375. X     Token tok;
  376. X  
  377. X     y = NO_YR;
  378. X     m = NO_MON;
  379. X     d = NO_DAY;
  380. X  
  381. X     RealToday = SystemDate(&CurYear, &CurMon, &CurDay);
  382. X     if (RealToday < 0) {
  383. X--- 105,117 ----
  384. X  {
  385. X     char *arg;
  386. X     int i;
  387. X!    int y, m, d, rep;
  388. X     Token tok;
  389. X  
  390. X     y = NO_YR;
  391. X     m = NO_MON;
  392. X     d = NO_DAY;
  393. X+    rep = NO_REP;
  394. X  
  395. X     RealToday = SystemDate(&CurYear, &CurMon, &CurDay);
  396. X     if (RealToday < 0) {
  397. X***************
  398. X*** 162,167 ****
  399. X--- 164,174 ----
  400. X             RunDisabled = 1;
  401. X             break;
  402. X  
  403. X+         case 'm':
  404. X+         case 'M':
  405. X+            MondayFirst = 1;
  406. X+            break;
  407. X+ 
  408. X          case 'o':
  409. X          case 'O':
  410. X             IgnoreOnce = 1;
  411. X***************
  412. X*** 358,369 ****
  413. X             else y = tok.val;
  414. X             break;
  415. X  
  416. X          default: Usage();
  417. X           }
  418. X        }
  419. X  
  420. X  /* Must supply date in the form:  day, mon, yr OR mon, yr */
  421. X!       if (m == NO_MON || y == NO_YR) Usage();
  422. X        if (d == NO_DAY) d=1;
  423. X        if (d > DaysInMonth(m, y)) {
  424. X           fprintf(ErrFp, BadDate);
  425. X--- 365,394 ----
  426. X             else y = tok.val;
  427. X             break;
  428. X  
  429. X+         case T_Rep:
  430. X+            rep = tok.val;
  431. X+            break;
  432. X+ 
  433. X          default: Usage();
  434. X           }
  435. X        }
  436. X  
  437. X+       if (rep > 0) {
  438. X+          Iterations = rep;
  439. X+      DontQueue = 1;
  440. X+      Daemon = 0;
  441. X+       }
  442. X+ 
  443. X  /* Must supply date in the form:  day, mon, yr OR mon, yr */
  444. X!       if (m == NO_MON || y == NO_YR) {
  445. X!          if (rep == NO_REP) Usage();
  446. X!      else if (m != NO_MON || y != NO_YR) Usage();
  447. X!      else {
  448. X!         m = CurMon;
  449. X!         y = CurYear;
  450. X!         if (d == NO_DAY) d = CurDay;
  451. X!          }
  452. X!       }
  453. X        if (d == NO_DAY) d=1;
  454. X        if (d > DaysInMonth(m, y)) {
  455. X           fprintf(ErrFp, BadDate);
  456. X***************
  457. X*** 404,410 ****
  458. X  #ifdef BETA
  459. X     fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
  460. X  #endif
  461. X!    fprintf(ErrFp, "Usage: remind [options] filename [date]\n");
  462. X     fprintf(ErrFp, "Options:\n");
  463. X     fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  464. X     fprintf(ErrFp, " -r     Disable RUN directives\n");
  465. X--- 429,435 ----
  466. X  #ifdef BETA
  467. X     fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
  468. X  #endif
  469. X!    fprintf(ErrFp, "Usage: remind [options] filename [date] [*rep]\n");
  470. X     fprintf(ErrFp, "Options:\n");
  471. X     fprintf(ErrFp, " -n     Output next occurrence of reminders in simple format\n");
  472. X     fprintf(ErrFp, " -r     Disable RUN directives\n");
  473. X***************
  474. X*** 430,435 ****
  475. X--- 455,461 ----
  476. X     fprintf(ErrFp, " -kcmd  Run 'cmd' for MSG-type reminders\n");
  477. X     fprintf(ErrFp, " -g[d[d]] Sort reminders by date and time before issuing\n");
  478. X     fprintf(ErrFp, " -ivar=val Initialize var to val and preserve var\n");
  479. X+    fprintf(ErrFp, " -m     Start calendar with Monday rather than Sunday\n");
  480. X     exit(1);
  481. X  }
  482. X  #endif /* L_USAGE_OVERRIDE */
  483. X***************
  484. X*** 560,570 ****
  485. X     }
  486. X  
  487. X     if (*varname == '$') {
  488. X!       if (val.type != INT_TYPE) {
  489. X!          fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_BAD_TYPE]);
  490. X!      return;
  491. X!       }
  492. X!       r=SetSysVar(varname+1, val.v.val);
  493. X        if (r) fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
  494. X        return;
  495. X     }
  496. X--- 586,592 ----
  497. X     }
  498. X  
  499. X     if (*varname == '$') {
  500. X!       r=SetSysVar(varname+1, &val);
  501. X        if (r) fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
  502. X        return;
  503. X     }
  504. X*** ../prev/lnk.msc    Mon Jun 28 12:30:12 1993
  505. X--- ./lnk.msc    Mon Sep 20 14:59:42 1993
  506. X***************
  507. X*** 8,13 ****
  508. X--- 8,14 ----
  509. X  hbcal.obj +
  510. X  init.obj +
  511. X  main.obj +
  512. X+ moon.obj +
  513. X  omit.obj +
  514. X  sort.obj +
  515. X  token.obj +
  516. X*** ../prev/lnk.tc    Mon Jun 28 12:30:13 1993
  517. X--- ./lnk.tc    Mon Sep 20 14:59:34 1993
  518. X***************
  519. X*** 9,14 ****
  520. X--- 9,15 ----
  521. X  hbcal.obj
  522. X  init.obj
  523. X  main.obj
  524. X+ moon.obj
  525. X  omit.obj
  526. X  sort.obj
  527. X  token.obj
  528. X*** ../prev/main.c    Wed Aug 25 13:06:26 1993
  529. X--- ./main.c    Tue Sep 28 16:50:30 1993
  530. X***************
  531. X*** 80,86 ****
  532. X  
  533. X  /* The very first thing to do is to set up ErrFp to be stderr */
  534. X     ErrFp = stderr;
  535. X!    
  536. X  /* Set up global vars */
  537. X     ArgC = argc;
  538. X     ArgV = argv;
  539. X--- 80,86 ----
  540. X  
  541. X  /* The very first thing to do is to set up ErrFp to be stderr */
  542. X     ErrFp = stderr;
  543. X! 
  544. X  /* Set up global vars */
  545. X     ArgC = argc;
  546. X     ArgV = argv;
  547. X***************
  548. X*** 92,147 ****
  549. X     }
  550. X  
  551. X     /* Not doing a calendar.  Do the regular remind loop */
  552. X!    DoReminders();
  553. X  
  554. X!    if (DebugFlag & DB_DUMP_VARS) {
  555. X!       DumpVarTable();
  556. X!       DumpSysVarByName(NULL);
  557. X!    }
  558. X  
  559. X!    if (!Hush) {
  560. X!       if (DestroyOmitContexts())
  561. X!     Eprint("%s", E_PUSH_NOPOP);
  562. X  #ifdef HAVE_QUEUED
  563. X!       if (!Daemon && !NextMode && !NumTriggered && !NumQueued) printf("%s\n", ErrMsg[E_NOREMINDERS]);
  564. X!    else
  565. X!       if (!Daemon && !NextMode && !NumTriggered) printf(ErrMsg[M_QUEUED],
  566. X!          NumQueued);
  567. X  #else
  568. X!       if (!NextMode && !NumTriggered) printf("%s\n", ErrMsg[E_NOREMINDERS]);
  569. X  #endif
  570. X!    }
  571. X  
  572. X     /* If it's MS-DOS or OS2, reset the file access date */
  573. X  #if defined(__MSDOS__) || defined(OS2)
  574. X!    if (!UseStdin && (RealToday == JulianToday))
  575. X!       SetAccessDate(InitialFile, RealToday);
  576. X  #endif
  577. X  
  578. X     /* If there are sorted reminders, handle them */
  579. X!    if (SortByDate) IssueSortedReminders();
  580. X  
  581. X     /* If there are any background reminders queued up, handle them */
  582. X  #ifdef HAVE_QUEUED
  583. X!    if (NumQueued || Daemon) {
  584. X  
  585. X!       if (DontFork) {
  586. X!      HandleQueuedReminders();
  587. X!      return 0;
  588. X!       } else {
  589. X!      pid = fork();
  590. X!      if (pid == 0) {
  591. X!         HandleQueuedReminders();
  592. X!         return 0;
  593. X!      }
  594. X!      if (pid == -1) {
  595. X!         fprintf(ErrFp, "%s", ErrMsg[E_CANTFORK]);
  596. X!         return 1;
  597. X!      }
  598. X        }
  599. X-    }
  600. X  #endif
  601. X! 
  602. X     return 0;
  603. X  }
  604. X  
  605. X--- 92,157 ----
  606. X     }
  607. X  
  608. X     /* Not doing a calendar.  Do the regular remind loop */
  609. X!    ShouldCache = (Iterations > 1);
  610. X  
  611. X!    while (Iterations--) {
  612. X!       DoReminders();
  613. X  
  614. X!       if (DebugFlag & DB_DUMP_VARS) {
  615. X!          DumpVarTable();
  616. X!          DumpSysVarByName(NULL);
  617. X!       }
  618. X! 
  619. X!       if (!Hush) {
  620. X!          if (DestroyOmitContexts())
  621. X!          Eprint("%s", E_PUSH_NOPOP);
  622. X  #ifdef HAVE_QUEUED
  623. X!          if (!Daemon && !NextMode && !NumTriggered && !NumQueued) printf("%s\n", ErrMsg[E_NOREMINDERS]);
  624. X!       else
  625. X!          if (!Daemon && !NextMode && !NumTriggered) printf(ErrMsg[M_QUEUED],
  626. X!             NumQueued);
  627. X  #else
  628. X!          if (!NextMode && !NumTriggered) printf("%s\n", ErrMsg[E_NOREMINDERS]);
  629. X  #endif
  630. X!       }
  631. X  
  632. X     /* If it's MS-DOS or OS2, reset the file access date */
  633. X  #if defined(__MSDOS__) || defined(OS2)
  634. X!       if (!UseStdin && (RealToday == JulianToday))
  635. X!          SetAccessDate(InitialFile, RealToday);
  636. X  #endif
  637. X  
  638. X     /* If there are sorted reminders, handle them */
  639. X!       if (SortByDate) IssueSortedReminders();
  640. X  
  641. X     /* If there are any background reminders queued up, handle them */
  642. X  #ifdef HAVE_QUEUED
  643. X!       if (NumQueued || Daemon) {
  644. X  
  645. X!          if (DontFork) {
  646. X!            HandleQueuedReminders();
  647. X!           return 0;
  648. X!          } else {
  649. X!         pid = fork();
  650. X!         if (pid == 0) {
  651. X!            HandleQueuedReminders();
  652. X!            return 0;
  653. X!         }
  654. X!         if (pid == -1) {
  655. X!            fprintf(ErrFp, "%s", ErrMsg[E_CANTFORK]);
  656. X!            return 1;
  657. X!         }
  658. X!          }
  659. X        }
  660. X  #endif
  661. X!       if (Iterations) {
  662. X!          ClearGlobalOmits();
  663. X!          DestroyOmitContexts();
  664. X!          DestroyVars(0);
  665. X!          NumTriggered = 0;
  666. X!      JulianToday++;
  667. X!       }
  668. X!    }
  669. X     return 0;
  670. X  }
  671. X  
  672. X***************
  673. X*** 213,219 ****
  674. X          case T_Else:    r=DoElse(&p);    break;
  675. X          case T_EndIf:   r=DoEndif(&p);   break;
  676. X          case T_Include: r=DoInclude(&p); break;
  677. X!         case T_Exit:    exit(99);        break;
  678. X          case T_Set:     r=DoSet(&p);     break;
  679. X          case T_Fset:    r=DoFset(&p);    break;
  680. X          case T_UnSet:   r=DoUnset(&p);   break;
  681. X--- 223,230 ----
  682. X          case T_Else:    r=DoElse(&p);    break;
  683. X          case T_EndIf:   r=DoEndif(&p);   break;
  684. X          case T_Include: r=DoInclude(&p); break;
  685. X!         case T_Exit:    DoExit(&p);      break;
  686. X!         case T_Flush:   r=DoFlush(&p);   break;
  687. X          case T_Set:     r=DoSet(&p);     break;
  688. X          case T_Fset:    r=DoFset(&p);    break;
  689. X          case T_UnSet:   r=DoUnset(&p);   break;
  690. X***************
  691. X*** 239,246 ****
  692. X                  r=DoRem(&p);
  693. X                  break;
  694. X                   }
  695. X-                  
  696. X  
  697. X       /* If we don't recognize the command, do a REM by default */
  698. X       /* Note:  Since the parser hasn't been used yet, we don't */
  699. X       /* need to destroy it here. */
  700. X--- 250,257 ----
  701. X                  r=DoRem(&p);
  702. X                  break;
  703. X                   }
  704. X  
  705. X+ 
  706. X       /* If we don't recognize the command, do a REM by default */
  707. X       /* Note:  Since the parser hasn't been used yet, we don't */
  708. X       /* need to destroy it here. */
  709. X***************
  710. X*** 306,318 ****
  711. X     int y400 = (y2 / 400) - (y1 / 400); /* ... but do count multiples of 400 */
  712. X  
  713. X     int try_jul= 365 * (try_yr-BASE) + y4 - y100 + y400;
  714. X!    
  715. X     while (try_jul > jul) {
  716. X        try_yr--;
  717. X        try_jul -= DaysInYear(try_yr);
  718. X     }
  719. X     jul -= try_jul;
  720. X!    
  721. X     t = DaysInMonth(try_mon, try_yr);
  722. X     while (jul >= t) {
  723. X        jul -= t;
  724. X--- 317,329 ----
  725. X     int y400 = (y2 / 400) - (y1 / 400); /* ... but do count multiples of 400 */
  726. X  
  727. X     int try_jul= 365 * (try_yr-BASE) + y4 - y100 + y400;
  728. X! 
  729. X     while (try_jul > jul) {
  730. X        try_yr--;
  731. X        try_jul -= DaysInYear(try_yr);
  732. X     }
  733. X     jul -= try_jul;
  734. X! 
  735. X     t = DaysInMonth(try_mon, try_yr);
  736. X     while (jul >= t) {
  737. X        jul -= t;
  738. X***************
  739. X*** 436,442 ****
  740. X  {
  741. X     int c, err;
  742. X     int len = 0;
  743. X!    
  744. X     *out = 0;
  745. X  
  746. X     c = ParseChar(p, &err, 0);
  747. X--- 447,453 ----
  748. X  {
  749. X     int c, err;
  750. X     int len = 0;
  751. X! 
  752. X     *out = 0;
  753. X  
  754. X     c = ParseChar(p, &err, 0);
  755. X***************
  756. X*** 480,486 ****
  757. X  {
  758. X     int c, err;
  759. X     int len = 0;
  760. X!    
  761. X     *out = 0;
  762. X  
  763. X     c = ParseChar(p, &err, 0);
  764. X--- 491,497 ----
  765. X  {
  766. X     int c, err;
  767. X     int len = 0;
  768. X! 
  769. X     *out = 0;
  770. X  
  771. X     c = ParseChar(p, &err, 0);
  772. X***************
  773. X*** 566,572 ****
  774. X  #ifndef HAVE_STDARG
  775. X     char *fmt;
  776. X  #endif
  777. X!    
  778. X     /* Check if more than one error msg. from this line */
  779. X     if (!FreshLine && !ShowAllErrors) return;
  780. X  
  781. X--- 577,583 ----
  782. X  #ifndef HAVE_STDARG
  783. X     char *fmt;
  784. X  #endif
  785. X! 
  786. X     /* Check if more than one error msg. from this line */
  787. X     if (!FreshLine && !ShowAllErrors) return;
  788. X  
  789. X***************
  790. X*** 679,685 ****
  791. X     strcpy(TPushBuffer, tok);
  792. X     strcat(TPushBuffer, " ");  /* Separate the pushed token from the next
  793. X                           token */
  794. X!    
  795. X  }
  796. X  
  797. X  /***************************************************************/
  798. X--- 690,696 ----
  799. X     strcpy(TPushBuffer, tok);
  800. X     strcat(TPushBuffer, " ");  /* Separate the pushed token from the next
  801. X                           token */
  802. X! 
  803. X  }
  804. X  
  805. X  /***************************************************************/
  806. X***************
  807. X*** 779,785 ****
  808. X        if ( (r = EvaluateExpr(p, &v)) ) {
  809. X           syndrome = IF_TRUE | BEFORE_ELSE;
  810. X       Eprint("%s", ErrMsg[r]);
  811. X!       } else 
  812. X           if ( (v.type != STR_TYPE && v.v.val) ||
  813. X                (v.type == STR_TYPE && strcmp(v.v.str, "")) )
  814. X              syndrome = IF_TRUE | BEFORE_ELSE;
  815. X--- 790,796 ----
  816. X        if ( (r = EvaluateExpr(p, &v)) ) {
  817. X           syndrome = IF_TRUE | BEFORE_ELSE;
  818. X       Eprint("%s", ErrMsg[r]);
  819. X!       } else
  820. X           if ( (v.type != STR_TYPE && v.v.val) ||
  821. X                (v.type == STR_TYPE && strcmp(v.v.str, "")) )
  822. X              syndrome = IF_TRUE | BEFORE_ELSE;
  823. X***************
  824. X*** 877,883 ****
  825. X     return OK;
  826. X  }
  827. X  
  828. X!        
  829. X  /***************************************************************/
  830. X  /*                                                             */
  831. X  /*  ShouldIgnoreLine - given the current state of the IF       */
  832. X--- 888,894 ----
  833. X     return OK;
  834. X  }
  835. X  
  836. X! 
  837. X  /***************************************************************/
  838. X  /*                                                             */
  839. X  /*  ShouldIgnoreLine - given the current state of the IF       */
  840. X***************
  841. X*** 943,949 ****
  842. X  {
  843. X     int err;
  844. X     int ch;
  845. X!    int val=1;     
  846. X  
  847. X     while(1) {
  848. X        ch = ParseChar(p, &err, 0);
  849. X--- 954,960 ----
  850. X  {
  851. X     int err;
  852. X     int ch;
  853. X!    int val=1;
  854. X  
  855. X     while(1) {
  856. X        ch = ParseChar(p, &err, 0);
  857. X***************
  858. X*** 965,971 ****
  859. X       case '-':
  860. X          val = 0;
  861. X          break;
  862. X!  
  863. X        case 'e':
  864. X        case 'E':
  865. X          if (val) DebugFlag |=  DB_ECHO_LINE;
  866. X--- 976,982 ----
  867. X       case '-':
  868. X          val = 0;
  869. X          break;
  870. X! 
  871. X        case 'e':
  872. X        case 'E':
  873. X          if (val) DebugFlag |=  DB_ECHO_LINE;
  874. X***************
  875. X*** 1072,1077 ****
  876. X--- 1083,1129 ----
  877. X  
  878. X  /***************************************************************/
  879. X  /*                                                             */
  880. X+ /*  DoFlush                                                    */
  881. X+ /*                                                             */
  882. X+ /*  Flush stdout and stderr                                    */
  883. X+ /*                                                             */
  884. X+ /***************************************************************/
  885. X+ #ifdef HAVE_PROTOS
  886. X+ PUBLIC int DoFlush(ParsePtr p)
  887. X+ #else
  888. X+ int DoFlush(p)
  889. X+ ParsePtr p;
  890. X+ #endif
  891. X+ {
  892. X+    fflush(stdout);
  893. X+    fflush(stderr);
  894. X+    return VerifyEoln(p);
  895. X+ }
  896. X+ 
  897. X+ /***************************************************************/
  898. X+ /*                                                             */
  899. X+ /*  DoExit                                                     */
  900. X+ /*                                                             */
  901. X+ /*  Handle the EXIT command.                                   */
  902. X+ /*                                                             */
  903. X+ /***************************************************************/
  904. X+ #ifdef HAVE_PROTOS
  905. X+ PUBLIC void DoExit(ParsePtr p)
  906. X+ #else
  907. X+ void DoExit(p)
  908. X+ ParsePtr p;
  909. X+ #endif
  910. X+ {
  911. X+    int r;
  912. X+    Value v;
  913. X+ 
  914. X+    r = EvaluateExpr(p, &v);
  915. X+    if (r || v.type != INT_TYPE) exit(99);
  916. X+    exit(v.v.val);
  917. X+ }
  918. X+ 
  919. X+ /***************************************************************/
  920. X+ /*                                                             */
  921. X  /*  DoErrMsg                                                   */
  922. X  /*                                                             */
  923. X  /*  Issue an error message under program control.              */
  924. X***************
  925. X*** 1091,1097 ****
  926. X  
  927. X     t.typ = MSG_TYPE;
  928. X     tt.ttime = SystemTime() / 60;
  929. X!    if ( (r=DoSubst(p, SubstBuffer, &t, &tt, JulianToday, NORMAL_MODE)) ) 
  930. X        return r;
  931. X     s = SubstBuffer;
  932. X     while (isspace(*s)) s++;
  933. X--- 1143,1149 ----
  934. X  
  935. X     t.typ = MSG_TYPE;
  936. X     tt.ttime = SystemTime() / 60;
  937. X!    if ( (r=DoSubst(p, SubstBuffer, &t, &tt, JulianToday, NORMAL_MODE)) )
  938. X        return r;
  939. X     s = SubstBuffer;
  940. X     while (isspace(*s)) s++;
  941. X***************
  942. X*** 1112,1118 ****
  943. X     on the specified weekday.  For example, FoldArray[0][2] is a
  944. X     non-leapyear beginning on Wednesday, and FoldArray[1][5] is a
  945. X     leapyear beginning on Saturday.  Used to fold back dates which
  946. X!    are too high for the standard Unix representation. 
  947. X     NOTE:  This implies that you cannot set BASE > 2001!!!!! */
  948. X  static int FoldArray[2][7] = {
  949. X     {2001, 2002, 2003, 2009, 2010, 2005, 2006},
  950. X--- 1164,1170 ----
  951. X     on the specified weekday.  For example, FoldArray[0][2] is a
  952. X     non-leapyear beginning on Wednesday, and FoldArray[1][5] is a
  953. X     leapyear beginning on Saturday.  Used to fold back dates which
  954. X!    are too high for the standard Unix representation.
  955. X     NOTE:  This implies that you cannot set BASE > 2001!!!!! */
  956. X  static int FoldArray[2][7] = {
  957. X     {2001, 2002, 2003, 2009, 2010, 2005, 2006},
  958. X***************
  959. X*** 1168,1174 ****
  960. X                               (loc_t - utc_t) / 60 );  /* Should use difftime */
  961. X  #else
  962. X     if (mins) *mins = (int) ((utc_t - loc_t) / 60);
  963. X! #endif   
  964. X     if (isdst) *isdst = temp->tm_isdst;
  965. X     return 0;
  966. X  }
  967. X--- 1220,1226 ----
  968. X                               (loc_t - utc_t) / 60 );  /* Should use difftime */
  969. X  #else
  970. X     if (mins) *mins = (int) ((utc_t - loc_t) / 60);
  971. X! #endif
  972. X     if (isdst) *isdst = temp->tm_isdst;
  973. X     return 0;
  974. X  }
  975. X***************
  976. X*** 1180,1189 ****
  977. X  /*  Write a string to standard output, formatting it as a      */
  978. X  /*  paragraph according to the FirstIndent, FormWidth and      */
  979. X  /*  SubsIndent variables.  Spaces are gobbled.  Double-spaces  */
  980. X! /*  are inserted after periods.  As a special case, if the     */
  981. X! /*  last char in s is '\n', an extra newline is emitted.       */
  982. X  /*                                                             */
  983. X  /***************************************************************/
  984. X  #ifdef HAVE_PROTOS
  985. X  PUBLIC void FillParagraph(char *s)
  986. X  #else
  987. X--- 1232,1245 ----
  988. X  /*  Write a string to standard output, formatting it as a      */
  989. X  /*  paragraph according to the FirstIndent, FormWidth and      */
  990. X  /*  SubsIndent variables.  Spaces are gobbled.  Double-spaces  */
  991. X! /*  are inserted after '.', '?' and '!'.  Newlines in the      */
  992. X! /*  source are treated as paragraph breaks.                    */
  993. X  /*                                                             */
  994. X  /***************************************************************/
  995. X+ 
  996. X+ /* A macro safe ONLY if used with arg with no side effects! */
  997. X+ #define ISBLANK(c) (isspace(c) && (c) != '\n')
  998. X+ 
  999. X  #ifdef HAVE_PROTOS
  1000. X  PUBLIC void FillParagraph(char *s)
  1001. X  #else
  1002. X***************
  1003. X*** 1194,1199 ****
  1004. X--- 1250,1256 ----
  1005. X  
  1006. X     int line = 0;
  1007. X     int i, j;
  1008. X+    int doublespace = 1;
  1009. X     int pendspace;
  1010. X     int len;
  1011. X     char *t;
  1012. X***************
  1013. X*** 1203,1214 ****
  1014. X     if (!s || !*s) return;
  1015. X  
  1016. X     /* Skip leading spaces */
  1017. X!    while(isspace(*s)) s++;
  1018. X  
  1019. X     /* Start formatting */
  1020. X     while(1) {
  1021. X        if (!*s) {
  1022. X!          if (*(s-1) == '\n') putchar('\n');
  1023. X           return;
  1024. X        }
  1025. X        /* Over here, we're at the beginning of a line.  Emit the correct
  1026. X--- 1260,1280 ----
  1027. X     if (!s || !*s) return;
  1028. X  
  1029. X     /* Skip leading spaces */
  1030. X!    while(ISBLANK(*s)) s++;
  1031. X  
  1032. X     /* Start formatting */
  1033. X     while(1) {
  1034. X+ 
  1035. X+       /* If it's a carriage return, output it and start new paragraph */
  1036. X+       if (*s == '\n') {
  1037. X+          putchar('\n');
  1038. X+      s++;
  1039. X+      line = 0;
  1040. X+      while(ISBLANK(*s)) s++;
  1041. X+      continue;
  1042. X+       }
  1043. X        if (!*s) {
  1044. X!          putchar('\n');
  1045. X           return;
  1046. X        }
  1047. X        /* Over here, we're at the beginning of a line.  Emit the correct
  1048. X***************
  1049. X*** 1222,1234 ****
  1050. X  
  1051. X        /* Emit words until the next one won't fit */
  1052. X        while(1) {
  1053. X!          while(isspace(*s)) s++;
  1054. X           t = s;
  1055. X           while(*s && !isspace(*s)) s++;
  1056. X       len = s - t;
  1057. X       if (!len) {
  1058. X          putchar('\n');
  1059. X-             if (*(s-1) == '\n') putchar('\n');
  1060. X          return;
  1061. X           }
  1062. X       if (!pendspace || len+pendspace <= roomleft) {
  1063. X--- 1288,1300 ----
  1064. X  
  1065. X        /* Emit words until the next one won't fit */
  1066. X        while(1) {
  1067. X!          while(ISBLANK(*s)) s++;
  1068. X!      if (*s == '\n') break;
  1069. X           t = s;
  1070. X           while(*s && !isspace(*s)) s++;
  1071. X       len = s - t;
  1072. X       if (!len) {
  1073. X          putchar('\n');
  1074. X          return;
  1075. X           }
  1076. X       if (!pendspace || len+pendspace <= roomleft) {
  1077. X***************
  1078. X*** 1235,1240 ****
  1079. X--- 1301,1308 ----
  1080. X              for (i=0; i<pendspace; i++) putchar(' ');
  1081. X             while(t < s) {
  1082. X             putchar(*t);
  1083. X+            if (strchr(EndSent, *t)) doublespace = 2;
  1084. X+            else if (!strchr(EndSentIg, *t)) doublespace = 1;
  1085. X             t++;
  1086. X              }
  1087. X           } else {
  1088. X***************
  1089. X*** 1243,1250 ****
  1090. X          line++;
  1091. X          break;
  1092. X           }
  1093. X!      pendspace = (*(t-1) == '.') ? 2 : 1;
  1094. X!      roomleft -= len+pendspace;
  1095. X        }
  1096. X     }
  1097. X  }
  1098. X--- 1311,1318 ----
  1099. X          line++;
  1100. X          break;
  1101. X           }
  1102. X!      roomleft -= len+doublespace;
  1103. X!      pendspace = doublespace;
  1104. X        }
  1105. X     }
  1106. X  }
  1107. X***************
  1108. X*** 1266,1272 ****
  1109. X      long guess = time((long *) NULL);
  1110. X      struct tm g;
  1111. X      int diff;
  1112. X!     
  1113. X      g = *gmtime (&guess);
  1114. X      while ((diff = year - g.tm_year) > 0)
  1115. X      {
  1116. X--- 1334,1340 ----
  1117. X      long guess = time((long *) NULL);
  1118. X      struct tm g;
  1119. X      int diff;
  1120. X! 
  1121. X      g = *gmtime (&guess);
  1122. X      while ((diff = year - g.tm_year) > 0)
  1123. X      {
  1124. X***************
  1125. X*** 1323,1325 ****
  1126. X--- 1391,1458 ----
  1127. X      return (clock);
  1128. X  }
  1129. X  #endif /* NEED_TIMEGM */
  1130. X+ 
  1131. X+ /***************************************************************/
  1132. X+ /*                                                             */
  1133. X+ /*  LocalToUTC                                                 */
  1134. X+ /*                                                             */
  1135. X+ /*  Convert a local date/time to a UTC date/time.              */
  1136. X+ /*                                                             */
  1137. X+ /***************************************************************/
  1138. X+ #ifdef HAVE_PROTOS
  1139. X+ PUBLIC void LocalToUTC(int locdate, int loctime, int *utcdate, int *utctime)
  1140. X+ #else
  1141. X+ void LocalToUTC(locdate, loctime, utcdate, utctime)
  1142. X+ int locdate, loctime, *utcdate, *utctime;
  1143. X+ #endif
  1144. X+ {
  1145. X+    int diff;
  1146. X+    int dummy;
  1147. X+ 
  1148. X+    if (!CalculateUTC || !CalcMinsFromUTC(locdate, loctime, &diff, &dummy)) 
  1149. X+    diff=MinsFromUTC;
  1150. X+ 
  1151. X+    loctime -= MinsFromUTC;
  1152. X+    if (loctime < 0) {
  1153. X+       loctime += 1440;
  1154. X+       locdate--;
  1155. X+    } else if (loctime >= 1440) {
  1156. X+       loctime -= 1440;
  1157. X+       locdate++;
  1158. X+    }
  1159. X+    *utcdate = locdate;
  1160. X+    *utctime = loctime;
  1161. X+ }
  1162. X+ 
  1163. X+ /***************************************************************/
  1164. X+ /*                                                             */
  1165. X+ /*  UTCToLocal                                                 */
  1166. X+ /*                                                             */
  1167. X+ /*  Convert a UTC date/time to a local date/time.              */
  1168. X+ /*                                                             */
  1169. X+ /***************************************************************/
  1170. X+ #ifdef HAVE_PROTOS
  1171. X+ PUBLIC void UTCToLocal(int utcdate, int utctime, int *locdate, int *loctime)
  1172. X+ #else
  1173. X+ void UTCToLocal(utcdate, utctime, locdate, loctime)
  1174. X+ int utcdate, utctime, *locdate, *loctime;
  1175. X+ #endif
  1176. X+ {
  1177. X+    int diff;
  1178. X+    int dummy;
  1179. X+ 
  1180. X+    /* Hack -- not quite right when DST changes.  */
  1181. X+    if (!CalculateUTC || !CalcMinsFromUTC(utcdate, utctime, &diff, &dummy)) 
  1182. X+    diff=MinsFromUTC;
  1183. X+ 
  1184. X+    utctime += MinsFromUTC;
  1185. X+    if (utctime < 0) {
  1186. X+       utctime += 1440;
  1187. X+       utcdate--;
  1188. X+    } else if (utctime >= 1440) {
  1189. X+       utctime -= 1440;
  1190. X+       utcdate++;
  1191. X+    }
  1192. X+    *locdate = utcdate;
  1193. X+    *loctime = utctime;
  1194. X+ }
  1195. X*** ../prev/makefile.msc    Mon Jun 28 12:30:11 1993
  1196. X--- ./makefile.msc    Thu Sep 30 15:50:35 1993
  1197. X***************
  1198. X*** 2,12 ****
  1199. X  
  1200. X  OBJS= calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
  1201. X  globals.obj init.obj main.obj omit.obj token.obj trigger.obj userfns.obj \
  1202. X! utils.obj var.obj sort.obj hbcal.obj
  1203. X  
  1204. X  DEFINES= /D__MSDOS__ /D__MSC__
  1205. X  
  1206. X! MODEL= /AS
  1207. X  
  1208. X  calendar.obj: calendar.c
  1209. X      cl /c $(DEFINES) $(MODEL) /Focalendar.obj calendar.c
  1210. X--- 2,12 ----
  1211. X  
  1212. X  OBJS= calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
  1213. X  globals.obj init.obj main.obj omit.obj token.obj trigger.obj userfns.obj \
  1214. X! utils.obj var.obj sort.obj hbcal.obj moon.obj
  1215. X  
  1216. X  DEFINES= /D__MSDOS__ /D__MSC__
  1217. X  
  1218. X! MODEL= /AM
  1219. X  
  1220. X  calendar.obj: calendar.c
  1221. X      cl /c $(DEFINES) $(MODEL) /Focalendar.obj calendar.c
  1222. X***************
  1223. X*** 40,45 ****
  1224. X--- 40,48 ----
  1225. X  
  1226. X  main.obj: main.c
  1227. X      cl /c $(DEFINES) $(MODEL) /Fomain.obj main.c
  1228. X+ 
  1229. X+ moon.obj: moon.c
  1230. X+     cl /c $(DEFINES) $(MODEL) /Fomoon.obj moon.c
  1231. X  
  1232. X  omit.obj: omit.c
  1233. X      cl /c $(DEFINES) $(MODEL) /Foomit.obj omit.c
  1234. X*** ../prev/makefile.os2    Wed Aug 18 11:13:19 1993
  1235. X--- ./makefile.os2    Mon Sep 20 15:00:08 1993
  1236. X***************
  1237. X*** 25,31 ****
  1238. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  1239. X  # in config.h; then, you should be able to type 'make'.
  1240. X  #-----------------------------------------------------------------------------
  1241. X! VERSION= 03.00.08
  1242. X  
  1243. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  1244. X  lang.h english.h german.h dutch.h finish.h french.h norwgian.h
  1245. X--- 25,31 ----
  1246. X  # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  1247. X  # in config.h; then, you should be able to type 'make'.
  1248. X  #-----------------------------------------------------------------------------
  1249. X! VERSION= 03.00.09
  1250. X  
  1251. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  1252. X  lang.h english.h german.h dutch.h finish.h french.h norwgian.h
  1253. X***************
  1254. X*** 35,41 ****
  1255. X  LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  1256. X  
  1257. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  1258. X! main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  1259. X  
  1260. X  MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  1261. X  remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  1262. X--- 35,41 ----
  1263. X  LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  1264. X  
  1265. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  1266. X! main.c moon.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  1267. X  
  1268. X  MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  1269. X  remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  1270. X***************
  1271. X*** 77,82 ****
  1272. X--- 77,83 ----
  1273. X  globals$O: globals.c config.h types.h globals.h err.h lang.h
  1274. X  init$O: init.c $(STDHDRS) expr.h version.h
  1275. X  main$O: main.c $(STDHDRS) expr.h
  1276. X+ moon$O: moon.c $(STDHDRS)
  1277. X  omit$O: omit.c $(STDHDRS)
  1278. X  sort$O: sort.c $(STDHDRS)
  1279. X  token$O: token.c $(STDHDRS)
  1280. X*** ../prev/makefile.tc    Wed Aug 18 11:13:06 1993
  1281. X--- ./makefile.tc    Thu Sep 30 15:50:25 1993
  1282. X***************
  1283. X*** 1,6 ****
  1284. X  # Makefile for REMIND for Turbo C for MSDOS
  1285. X  
  1286. X! VERSION= 03.00.08
  1287. X  
  1288. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  1289. X  lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
  1290. X--- 1,6 ----
  1291. X  # Makefile for REMIND for Turbo C for MSDOS
  1292. X  
  1293. X! VERSION= 03.00.09
  1294. X  
  1295. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  1296. X  lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
  1297. X***************
  1298. X*** 10,16 ****
  1299. X  LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  1300. X  
  1301. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  1302. X! main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  1303. X  
  1304. X  OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
  1305. X  globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
  1306. X--- 10,16 ----
  1307. X  LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  1308. X  
  1309. X  SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  1310. X! moon.c main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  1311. X  
  1312. X  OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
  1313. X  globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
  1314. X***************
  1315. X*** 31,37 ****
  1316. X      tcc -erem2ps.exe rem2ps.obj
  1317. X  
  1318. X  .c.obj:
  1319. X!     tcc -A -w-pia -c -O -ms {$< }
  1320. X  
  1321. X  rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
  1322. X  
  1323. X--- 31,37 ----
  1324. X      tcc -erem2ps.exe rem2ps.obj
  1325. X  
  1326. X  .c.obj:
  1327. X!     tcc -A -w-pia -c -O -mm {$< }
  1328. X  
  1329. X  rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
  1330. X  
  1331. X***************
  1332. X*** 52,57 ****
  1333. X--- 52,59 ----
  1334. X  init.obj: init.c $(STDHDRS) expr.h version.h
  1335. X  
  1336. X  main.obj: main.c $(STDHDRS) expr.h
  1337. X+ 
  1338. X+ moon.obj: moon.c $(STDHDRS) expr.h
  1339. X  
  1340. X  omit.obj: omit.c $(STDHDRS)
  1341. X  
  1342. X*** ../prev/protos.h    Wed Aug 18 12:52:08 1993
  1343. X--- ./protos.h    Mon Sep 20 16:53:13 1993
  1344. X***************
  1345. X*** 29,34 ****
  1346. X--- 29,36 ----
  1347. X  void ProduceCalendar ARGS ((void));
  1348. X  char *SimpleTime ARGS ((int tim, char *out));
  1349. X  int DoRem ARGS ((ParsePtr p));
  1350. X+ int DoFlush ARGS ((ParsePtr p));
  1351. X+ void DoExit ARGS ((ParsePtr p));
  1352. X  int ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim));
  1353. X  int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul));
  1354. X  int ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul));
  1355. X***************
  1356. X*** 103,109 ****
  1357. X  int DoUnset  ARGS ((Parser *p));
  1358. X  int DoDump ARGS ((ParsePtr p));
  1359. X  void DumpVarTable ARGS ((void));
  1360. X! void DestroyVars ARGS ((void));
  1361. X  int PreserveVar ARGS ((char *name));
  1362. X  int DoPreserve  ARGS ((Parser *p));
  1363. X  int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
  1364. X--- 105,111 ----
  1365. X  int DoUnset  ARGS ((Parser *p));
  1366. X  int DoDump ARGS ((ParsePtr p));
  1367. X  void DumpVarTable ARGS ((void));
  1368. X! void DestroyVars ARGS ((int all));
  1369. X  int PreserveVar ARGS ((char *name));
  1370. X  int DoPreserve  ARGS ((Parser *p));
  1371. X  int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
  1372. X***************
  1373. X*** 126,132 ****
  1374. X  int GetNextHebrewDate ARGS((int julstart, int hm, int hd, int yahr, int adarbehave, int *ans));
  1375. X  int ComputeJahr ARGS ((int y, int m, int d, int *ans));
  1376. X  int GetSysVar ARGS ((const char *name, Value *val));
  1377. X! int SetSysVar ARGS ((const char *name, int value));
  1378. X  void DumpSysVarByName ARGS ((const char *name));
  1379. X  int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
  1380. X  void FillParagraph ARGS ((char *s));
  1381. X--- 128,138 ----
  1382. X  int GetNextHebrewDate ARGS((int julstart, int hm, int hd, int yahr, int adarbehave, int *ans));
  1383. X  int ComputeJahr ARGS ((int y, int m, int d, int *ans));
  1384. X  int GetSysVar ARGS ((const char *name, Value *val));
  1385. X! int SetSysVar ARGS ((const char *name, Value *val));
  1386. X  void DumpSysVarByName ARGS ((const char *name));
  1387. X  int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
  1388. X  void FillParagraph ARGS ((char *s));
  1389. X+ void LocalToUTC ARGS ((int locdate, int loctime, int *utcdate, int *utctime));
  1390. X+ void UTCToLocal ARGS ((int utcdate, int utctime, int *locdate, int *loctime));
  1391. X+ int MoonPhase ARGS ((int date, int time));
  1392. X+ void HuntPhase ARGS ((int startdate, int starttim, int phas, int *date, int *time));
  1393. X*** ../prev/rem2ps.1    Wed Jul 28 10:22:25 1993
  1394. X--- ./rem2ps.1    Thu Sep 30 15:23:25 1993
  1395. X***************
  1396. X*** 1,4 ****
  1397. X! .TH REM2PS 1 "8 January 1993"
  1398. X  .UC4
  1399. X  .SH NAME
  1400. X  rem2ps \- draw a PostScript calendar from Remind output
  1401. X--- 1,4 ----
  1402. X! .TH REM2PS 1 "30 September 1993"
  1403. X  .UC4
  1404. X  .SH NAME
  1405. X  rem2ps \- draw a PostScript calendar from Remind output
  1406. X***************
  1407. X*** 10,15 ****
  1408. X--- 10,18 ----
  1409. X  draws a calendar) to the standard output.
  1410. X  .SH OPTIONS
  1411. X  .TP
  1412. X+ .B \-n
  1413. X+ Produce a calendar whose first column is Monday (rather than Sunday.)
  1414. X+ .TP
  1415. X  .B \-p file
  1416. X  Include the contents of \fIfile\fR in the PostScript prologue.  This
  1417. X  allows you to define procedures, variables etc. which can be used
  1418. X***************
  1419. X*** 20,30 ****
  1420. X  Produce the calendar in landscape mode rather than the default
  1421. X  portrait mode.
  1422. X  .TP
  1423. X! .B \-c
  1424. X! Do not generate small calendars for the next and previous months.  By
  1425. X! default, these small calendars are generated and placed on the main
  1426. X! calendar.
  1427. X  .TP
  1428. X  .B \-i
  1429. X  Use ISO 8859-1 standard encoding for the PostScript fonts.  If you do
  1430. X  not use this option, the default encoding is used.
  1431. X--- 23,53 ----
  1432. X  Produce the calendar in landscape mode rather than the default
  1433. X  portrait mode.
  1434. X  .TP
  1435. X! \fB\-c\fR[\fIn\fR]
  1436. X! If \fIn\fR is omitted, disables the small calendars for next and previous
  1437. X! months which are normally generated.  If \fIn\fR is supplied, it can range
  1438. X! from 0 to 3, with the following meanings:
  1439. X! .RS
  1440. X  .TP
  1441. X+ .B 0
  1442. X+ Disable small calendars
  1443. X+ .TP
  1444. X+ .B 1
  1445. X+ Place the small calendars at the bottom-right if there is room; otherwise,
  1446. X+ place them at the top-left.
  1447. X+ .TP
  1448. X+ .B 2
  1449. X+ Place the small calendars at the top-left if there is room; otherwise,
  1450. X+ place them at the bottom-right.
  1451. X+ .TP
  1452. X+ .B 3
  1453. X+ Place the previous month's small calendar at the top-left and the next
  1454. X+ month's at the bottom-right if there is room; otherwise, follow \fIn\fR=1.
  1455. X+ A moment's thought reveals that an option which splits the calendars if
  1456. X+ there is room and otherwise follows \fIn\fR=2 yields the same results as
  1457. X+ \fIn\fR=3.
  1458. X+ .RE
  1459. X+ .TP
  1460. X  .B \-i
  1461. X  Use ISO 8859-1 standard encoding for the PostScript fonts.  If you do
  1462. X  not use this option, the default encoding is used.
  1463. X***************
  1464. X*** 90,97 ****
  1465. X  option will display the compiled-in default.
  1466. X  .RE
  1467. X  .TP
  1468. X! \fB\-f\fR[\fBshed\fR] \fIfont\fR
  1469. X! Set the font for the small calendar, the calendar headings, the calendar
  1470. X  entries, and the day numbers, respectively.  \fIFont\fR must be the
  1471. X  name of a valid PostScript font.  The default fonts are equivalent to
  1472. X  specifying:
  1473. X--- 113,121 ----
  1474. X  option will display the compiled-in default.
  1475. X  .RE
  1476. X  .TP
  1477. X! \fB\-f\fR[\fBtshed\fR] \fIfont\fR
  1478. X! Set the font for the calendar title,
  1479. X! the small calendars, the day-of-week headings, the calendar
  1480. X  entries, and the day numbers, respectively.  \fIFont\fR must be the
  1481. X  name of a valid PostScript font.  The default fonts are equivalent to
  1482. X  specifying:
  1483. X***************
  1484. X*** 98,104 ****
  1485. X  .RS
  1486. X  .PP
  1487. X  .nf
  1488. X!     -fhes Helvetica -fd Helvetica-BoldOblique
  1489. X  .fi
  1490. X  .PP
  1491. X  In other words, the heading, entry and small-calendar fonts are set
  1492. X--- 122,128 ----
  1493. X  .RS
  1494. X  .PP
  1495. X  .nf
  1496. X!     -ftshe Helvetica -fd Helvetica-BoldOblique
  1497. X  .fi
  1498. X  .PP
  1499. X  In other words, the heading, entry and small-calendar fonts are set
  1500. X***************
  1501. X*** 106,120 ****
  1502. X  Helvetica-BoldOblique.
  1503. X  .RE
  1504. X  .TP
  1505. X! \fB\-s\fR[\fBhed\fR] \fIsize\fR
  1506. X! Set the size (in points) of the text for the the calendar headings,
  1507. X! the calendar entries, and the day numbers, respectively.  \fISize\fR
  1508. X! must be a decimal number.  The default sizes are equivalent to
  1509. X! specifying:
  1510. X  .RS
  1511. X  .PP
  1512. X  .nf
  1513. X!     -sdh 14 -se 8
  1514. X  .fi
  1515. X  .PP
  1516. X  In other words, the heading and day numbers are 14-point fonts, and the
  1517. X--- 130,144 ----
  1518. X  Helvetica-BoldOblique.
  1519. X  .RE
  1520. X  .TP
  1521. X! \fB\-s\fR[\fBthed\fR] \fIsize\fR
  1522. X! Set the size (in points) of the text for the the calendar title,
  1523. X! day-of-week headings, the calendar entries, and the day numbers,
  1524. X! respectively.  \fISize\fR must be a decimal number.  The default sizes
  1525. X! are equivalent to specifying:
  1526. X  .RS
  1527. X  .PP
  1528. X  .nf
  1529. X!     -sthd 14 -se 8
  1530. X  .fi
  1531. X  .PP
  1532. X  In other words, the heading and day numbers are 14-point fonts, and the
  1533. X***************
  1534. X*** 185,195 ****
  1535. X  of the regular calendar entry area.  The space from here to the top
  1536. X  of the box is used only to draw the day number.
  1537. X  .TP
  1538. X! /DayFont, /EntryFont, /SmallFont and /HeadFont
  1539. X! The fonts used to draw the day numbers, the calendar entries, the small
  1540. X! calendars, and the month and day headings, respectively.
  1541. X  .TP
  1542. X! DaySize, EntrySize and HeadSize
  1543. X  The sizes of the above fonts.  (The size of the small calendar font
  1544. X  is \fInot\fR defined here.)  For example, if you wanted to print
  1545. X  the Hebrew date next to the regular day number in the calendar, use:
  1546. X--- 209,220 ----
  1547. X  of the regular calendar entry area.  The space from here to the top
  1548. X  of the box is used only to draw the day number.
  1549. X  .TP
  1550. X! /DayFont, /TitleFont, /EntryFont, /SmallFont and /HeadFont
  1551. X! The fonts used to draw the day numbers, the month and year title,
  1552. X! the calendar entries, the small
  1553. X! calendars, and the day-of-week headings, respectively.
  1554. X  .TP
  1555. X! DaySize, TitleSize, EntrySize and HeadSize
  1556. X  The sizes of the above fonts.  (The size of the small calendar font
  1557. X  is \fInot\fR defined here.)  For example, if you wanted to print
  1558. X  the Hebrew date next to the regular day number in the calendar, use:
  1559. X*** ../prev/rem2ps.c    Wed Jul 28 10:15:11 1993
  1560. X--- ./rem2ps.c    Tue Sep 28 12:33:59 1993
  1561. X***************
  1562. X*** 43,48 ****
  1563. X--- 43,59 ----
  1564. X  
  1565. X  char Days[]=L_DAYINIT;
  1566. X  
  1567. X+ char *SmallCalLoc[] = {
  1568. X+    "",
  1569. X+    "bt",
  1570. X+    "tb",
  1571. X+    "sbt",
  1572. X+ };
  1573. X+ 
  1574. X+ #define NUMSMALL (sizeof(SmallCalLoc)/sizeof(SmallCalLoc[0]))
  1575. X+ char *SmallLocation;
  1576. X+ int SmallCol1, SmallCol2;
  1577. X+ 
  1578. X  PageType Pages[] =
  1579. X  {
  1580. X     {"Letter", 612, 792},     /* 8.5 x 11 in. */
  1581. X***************
  1582. X*** 78,83 ****
  1583. X--- 89,95 ----
  1584. X  char LineBuffer[LINELEN];
  1585. X  
  1586. X  char *HeadFont="Helvetica";
  1587. X+ char *TitleFont="Helvetica";
  1588. X  char *DayFont="Helvetica-BoldOblique";
  1589. X  char *EntryFont="Helvetica";
  1590. X  char *SmallFont="Helvetica";
  1591. X***************
  1592. X*** 84,89 ****
  1593. X--- 96,102 ----
  1594. X  char *LineWidth = "1";
  1595. X  
  1596. X  char *HeadSize="14";
  1597. X+ char *TitleSize="14";
  1598. X  char *DaySize="14";
  1599. X  char *EntrySize="8";
  1600. X  char *BorderSize = "6";
  1601. X***************
  1602. X*** 96,102 ****
  1603. X  int MaxDay;
  1604. X  int DayNum;
  1605. X  int WkDayNum;
  1606. X! 
  1607. X  int LeftMarg, RightMarg, TopMarg, BotMarg;
  1608. X  int FillPage;
  1609. X  
  1610. X--- 109,116 ----
  1611. X  int MaxDay;
  1612. X  int DayNum;
  1613. X  int WkDayNum;
  1614. X! int FirstWkDay;
  1615. X! int MondayFirst;
  1616. X  int LeftMarg, RightMarg, TopMarg, BotMarg;
  1617. X  int FillPage;
  1618. X  
  1619. X***************
  1620. X*** 104,113 ****
  1621. X  void Usage ARGS ((char *s));
  1622. X  void DoPsCal ARGS ((void));
  1623. X  int DoQueuedPs ARGS ((void));
  1624. X! void DoSmallCal ARGS((char *m, int days, int first, int col));
  1625. X  void WriteProlog ARGS ((void));
  1626. X  void WriteCalEntry ARGS ((void));
  1627. X  void WriteOneEntry ARGS ((char *s));
  1628. X  
  1629. X  /***************************************************************/
  1630. X  /*                                                             */
  1631. X--- 118,128 ----
  1632. X  void Usage ARGS ((char *s));
  1633. X  void DoPsCal ARGS ((void));
  1634. X  int DoQueuedPs ARGS ((void));
  1635. X! void DoSmallCal ARGS((char *m, int days, int first, int col, int which));
  1636. X  void WriteProlog ARGS ((void));
  1637. X  void WriteCalEntry ARGS ((void));
  1638. X  void WriteOneEntry ARGS ((char *s));
  1639. X+ void GetSmallLocations ARGS ((void));
  1640. X  
  1641. X  /***************************************************************/
  1642. X  /*                                                             */
  1643. X***************
  1644. X*** 165,177 ****
  1645. X     int days, wkday, prevdays, nextdays;
  1646. X     int sfirst;
  1647. X     int i;
  1648. X-    int smallcol = 0; /* Stop GCC from complaining about uninit var */
  1649. X     int is_ps;
  1650. X     CalEntry *c, *d;
  1651. X  
  1652. X     printf("%%%%Page: %d %d\n", validfile, validfile);
  1653. X  /* Read the month and year name, followed by # days in month and 1st day of
  1654. X!    month */
  1655. X     gets(LineBuffer);
  1656. X     sscanf(LineBuffer, "%s %s %d %d", month, year, &days, &wkday);
  1657. X     gets(LineBuffer);
  1658. X--- 180,191 ----
  1659. X     int days, wkday, prevdays, nextdays;
  1660. X     int sfirst;
  1661. X     int i;
  1662. X     int is_ps;
  1663. X     CalEntry *c, *d;
  1664. X  
  1665. X     printf("%%%%Page: %d %d\n", validfile, validfile);
  1666. X  /* Read the month and year name, followed by # days in month and 1st day of
  1667. X!    month, followed by the MondayFirst flag */
  1668. X     gets(LineBuffer);
  1669. X     sscanf(LineBuffer, "%s %s %d %d", month, year, &days, &wkday);
  1670. X     gets(LineBuffer);
  1671. X***************
  1672. X*** 179,184 ****
  1673. X--- 193,199 ----
  1674. X     gets(LineBuffer);
  1675. X     sscanf(LineBuffer, "%s %d", nextm, &nextdays);
  1676. X     MaxDay = days;
  1677. X+    FirstWkDay = wkday;
  1678. X  
  1679. X  /* Emit PostScript to do the heading */
  1680. X     if (!PortraitMode) printf("XSIZE 0 translate 90 rotate\n");
  1681. X***************
  1682. X*** 197,207 ****
  1683. X           printf("/MinBoxSize ytop MinY sub 5 div def\n");
  1684. X     }
  1685. X  
  1686. X! /* If wkday >= 2, then do the small calendars at the top. */
  1687. X!    if (wkday >=2 && !NoSmallCal) {
  1688. X!       smallcol = 0;
  1689. X!       printf("/ysmall ytop def\n");
  1690. X!    }
  1691. X  
  1692. X  /* Do each entry */
  1693. X  
  1694. X--- 212,218 ----
  1695. X           printf("/MinBoxSize ytop MinY sub 5 div def\n");
  1696. X     }
  1697. X  
  1698. X!    printf("/ysmalltop ytop def\n");
  1699. X  
  1700. X  /* Do each entry */
  1701. X  
  1702. X***************
  1703. X*** 262,278 ****
  1704. X     }
  1705. X  
  1706. X  /* If wkday < 2, set ysmall.  If necessary (only for feb) increase cal size. */
  1707. X!    if (wkday < 2 && !NoSmallCal) {
  1708. X!       smallcol = 5;
  1709. X!       printf("/ysmall ylast def\n");
  1710. X!       if (days == 28 && wkday == 0) {
  1711. X!          printf("/ysmall ymin def /ymin ysmall MinBoxSize sub def\n");
  1712. X!      printf("MinX ymin MaxX ymin L\n");
  1713. X!       }
  1714. X!    }
  1715. X!        
  1716. X  
  1717. X  /* Now draw the vertical lines */
  1718. X     for (i=0; i<=7; i++) {
  1719. X        printf("%d xincr mul MinX add ymin %d xincr mul MinX add topy L\n",
  1720. X                i, i);
  1721. X--- 273,282 ----
  1722. X     }
  1723. X  
  1724. X  /* If wkday < 2, set ysmall.  If necessary (only for feb) increase cal size. */
  1725. X!    printf("/ysmallbot ylast def\n");
  1726. X  
  1727. X  /* Now draw the vertical lines */
  1728. X+    GetSmallLocations();
  1729. X     for (i=0; i<=7; i++) {
  1730. X        printf("%d xincr mul MinX add ymin %d xincr mul MinX add topy L\n",
  1731. X                i, i);
  1732. X***************
  1733. X*** 282,291 ****
  1734. X     if (!NoSmallCal) {
  1735. X        sfirst = wkday - (prevdays % 7);
  1736. X        if (sfirst < 0) sfirst += 7;
  1737. X!       DoSmallCal(prevm, prevdays, sfirst, smallcol);
  1738. X        sfirst = wkday + (days % 7);
  1739. X        if (sfirst >6) sfirst -= 7;
  1740. X!       DoSmallCal(nextm, nextdays, sfirst, smallcol+1);
  1741. X     }
  1742. X  /* Do it! */
  1743. X     printf("showpage\n");
  1744. X--- 286,295 ----
  1745. X     if (!NoSmallCal) {
  1746. X        sfirst = wkday - (prevdays % 7);
  1747. X        if (sfirst < 0) sfirst += 7;
  1748. X!       DoSmallCal(prevm, prevdays, sfirst, SmallCol1, 1);
  1749. X        sfirst = wkday + (days % 7);
  1750. X        if (sfirst >6) sfirst -= 7;
  1751. X!       DoSmallCal(nextm, nextdays, sfirst, SmallCol2, 2);
  1752. X     }
  1753. X  /* Do it! */
  1754. X     printf("showpage\n");
  1755. X***************
  1756. X*** 322,332 ****
  1757. X  /* Write the document structuring stuff */
  1758. X     printf("%%!PS-Adobe-\n");
  1759. X     printf("%%%%DocumentFonts: %s", HeadFont);
  1760. X!    if (strcmp(HeadFont, DayFont)) printf(" %s", DayFont);
  1761. X     if (strcmp(EntryFont, HeadFont) &&
  1762. X         strcmp(EntryFont, DayFont)) printf(" %s", EntryFont);
  1763. X     if (!NoSmallCal && strcmp(SmallFont, HeadFont) &&
  1764. END_OF_FILE
  1765.   if test 52176 -ne `wc -c <'patch.09.C'`; then
  1766.     echo shar: \"'patch.09.C'\" unpacked with wrong size!
  1767.   elif test -f 'patch.09.A' && test -f 'patch.09.B' && test -f 'patch.09.D'
  1768.   then    
  1769.     echo shar: Combining  \"'patch.09'\" \(145785 characters\) 
  1770.     cat 'patch.09.A' 'patch.09.B' 'patch.09.C' 'patch.09.D' > 'patch.09' 
  1771.     if test 145785 -ne `wc -c <'patch.09'`; then 
  1772.       echo shar: \"'patch.09'\" combined with wrong size! 
  1773.     else 
  1774.       rm patch.09.A patch.09.B patch.09.C patch.09.D 
  1775.     fi 
  1776.   fi
  1777.   # end of 'patch.09.C'
  1778. fi
  1779. echo shar: End of archive 2 \(of 4\).
  1780. cp /dev/null ark2isdone
  1781. MISSING=""
  1782. for I in 1 2 3 4 ; do
  1783.     if test ! -f ark${I}isdone ; then
  1784.     MISSING="${MISSING} ${I}"
  1785.     fi
  1786. done
  1787. if test "${MISSING}" = "" ; then
  1788.     echo You have unpacked all 4 archives.
  1789.     rm -f ark[1-9]isdone
  1790. else
  1791.     echo You still must unpack the following archives:
  1792.     echo "        " ${MISSING}
  1793. fi
  1794. exit 0
  1795. exit 0 # Just in case...
  1796.