home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume40 / remind / patch11b < prev    next >
Encoding:
Text File  |  1993-11-26  |  43.8 KB  |  1,558 lines

  1. Newsgroups: comp.sources.misc
  2. From: dfs@doe.carleton.ca (David F. Skoll)
  3. Subject: v40i168:  remind - A replacement for calendar, Patch11b/5
  4. Message-ID: <1993Nov26.165729.5496@sparky.sterling.com>
  5. X-Md4-Signature: bc35e20e208f7dcf2c8d53d438006b26
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Reply-To: dfs@doe.carleton.ca (David F. Skoll)
  8. Organization: Carleton University
  9. Date: Fri, 26 Nov 1993 16:57:29 GMT
  10. Approved: kent@sparky.sterling.com
  11.  
  12. Submitted-by: dfs@doe.carleton.ca (David F. Skoll)
  13. Posting-number: Volume 40, Issue 168
  14. Archive-name: remind/patch11b
  15. Environment: UNIX, MS-DOS, OS/2
  16. Patch-To: remind: Volume 33, Issue 58-69
  17.  
  18. #!/bin/sh
  19. # this is Shar.02 (part 2 of Remind-3.0/Patch-11/part)
  20. # do not concatenate these parts, unpack them in order with /bin/sh
  21. # file patch.11 continued
  22. #
  23. if touch 2>&1 | fgrep 'amc' > /dev/null
  24.  then TOUCH=touch
  25.  else TOUCH=true
  26. fi
  27. if test ! -r shar3_seq_.tmp; then
  28.     echo "Please unpack part 1 first!"
  29.     exit 1
  30. fi
  31. (read Scheck
  32.  if test "$Scheck" != 2; then
  33.     echo "Please unpack part $Scheck next!"
  34.     exit 1
  35.  else
  36.     exit 0
  37.  fi
  38. ) < shar3_seq_.tmp || exit 1
  39. echo "x - Continuing file patch.11"
  40. sed 's/^X//' << 'SHAR_EOF' >> patch.11 &&
  41. X+ Value *val;
  42. X+ #endif
  43. X+ {
  44. X+    if (ValStackPtr <= 0)
  45. X+       return E_VA_STK_UNDER;
  46. X+    else {
  47. X+       *val = ValStack[--ValStackPtr];
  48. X+       return OK;
  49. X+    }
  50. X+ }
  51. X+ 
  52. X*** ../prev/expr.h    Tue Oct 12 16:22:39 1993
  53. X--- ./expr.h    Tue Nov 16 16:12:44 1993
  54. X***************
  55. X*** 24,26 ****
  56. X--- 24,53 ----
  57. X  #define UN_OP 0  /* Unary operator */
  58. X  #define BIN_OP 1 /* Binary Operator */
  59. X  #define FUNC 2   /* Function */
  60. X+ 
  61. X+ /* Make the pushing and popping of values and operators in-line code
  62. X+    for speed.  BEWARE:  These macros invoke return if an error happens ! */
  63. X+ 
  64. X+ #define PushOpStack(op) \
  65. X+    if (OpStackPtr >= OP_STACK_SIZE) \
  66. X+       return E_OP_STK_OVER; \
  67. X+    else \
  68. X+       OpStack[OpStackPtr++] = (op)
  69. X+ 
  70. X+ #define PopOpStack(op) \
  71. X+    if (OpStackPtr <= 0) \
  72. X+       return E_OP_STK_UNDER; \
  73. X+    else \
  74. X+       (op) = OpStack[--OpStackPtr]
  75. X+ 
  76. X+ #define PushValStack(val) \
  77. X+    if (ValStackPtr >= VAL_STACK_SIZE) \
  78. X+       return E_VA_STK_OVER; \
  79. X+    else \
  80. X+       ValStack[ValStackPtr++] = (val)
  81. X+ 
  82. X+ #define PopValStack(val) \
  83. X+    if (ValStackPtr <= 0) \
  84. X+       return E_VA_STK_UNDER; \
  85. X+    else \
  86. X+       (val) = ValStack[--ValStackPtr]
  87. X*** ../prev/files.c    Wed Oct 13 10:38:25 1993
  88. X--- ./files.c    Mon Nov 15 14:25:27 1993
  89. X***************
  90. X*** 25,31 ****
  91. X  #include <sys/stat.h>
  92. X  #include <time.h>
  93. X  
  94. X! #if defined(__MSDOS__) || defined(OS2)
  95. X  #include <io.h>
  96. X  #endif
  97. X  
  98. X--- 25,31 ----
  99. X  #include <sys/stat.h>
  100. X  #include <time.h>
  101. X  
  102. X! #if defined(__MSDOS__)
  103. X  #include <io.h>
  104. X  #endif
  105. X  
  106. X***************
  107. X*** 444,450 ****
  108. X  /*  file.  Not needed for UNIX.                                */
  109. X  /*                                                             */
  110. X  /***************************************************************/
  111. X! #if defined(__MSDOS__) || defined(OS2)
  112. X  /*
  113. X   * WARNING WARNING WARNING WARNING
  114. X   * In the version of Turbo C which I have, there is a bug in the
  115. X--- 444,450 ----
  116. X  /*  file.  Not needed for UNIX.                                */
  117. X  /*                                                             */
  118. X  /***************************************************************/
  119. X! #if defined(__MSDOS__)
  120. X  /*
  121. X   * WARNING WARNING WARNING WARNING
  122. X   * In the version of Turbo C which I have, there is a bug in the
  123. X*** ../prev/french.h    Wed Oct 13 11:05:29 1993
  124. X--- ./french.h    Tue Nov  2 14:55:03 1993
  125. X***************
  126. X*** 388,395 ****
  127. X     fprintf(ErrFp, " -x[n]  Limite d'it\351rations pour la clause SATISFY (def=150)\n");
  128. X     fprintf(ErrFp, " -kcmd  Ex\351cuter 'cmd' pour les rappels de type MSG\n");
  129. X     fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorit\351 avant d'\351mettre\n");
  130. X!    fprintf(ErrFp, " -ivar=val Initialiser var \340 val et conserver var\n\n");
  131. X!    fprintf(ErrFp, " -m     Commencer le calendrier avec lundi plutot que dimanche");
  132. X  #else /* ISOLATIN1 */
  133. X     fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [*repetition]\n");
  134. X     fprintf(ErrFp, "Options:\n");
  135. X--- 388,395 ----
  136. X     fprintf(ErrFp, " -x[n]  Limite d'it\351rations pour la clause SATISFY (def=150)\n");
  137. X     fprintf(ErrFp, " -kcmd  Ex\351cuter 'cmd' pour les rappels de type MSG\n");
  138. X     fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorit\351 avant d'\351mettre\n");
  139. X!    fprintf(ErrFp, " -ivar=val Initialiser var \340 val et conserver var\n");
  140. X!    fprintf(ErrFp, " -m     Commencer le calendrier avec lundi plut\364t que dimanche\n");
  141. X  #else /* ISOLATIN1 */
  142. X     fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [*repetition]\n");
  143. X     fprintf(ErrFp, "Options:\n");
  144. X***************
  145. X*** 416,423 ****
  146. X     fprintf(ErrFp, " -x[n]  Limite d'iterations pour la clause SATISFY (def=150)\n");
  147. X     fprintf(ErrFp, " -kcmd  Executer 'cmd' pour les rappels de type MSG\n");
  148. X     fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorite avant d'emettre\n");
  149. X!    fprintf(ErrFp, " -ivar=val Initialiser var a val et conserver var\n\n");
  150. X!    fprintf(ErrFp, " -m     Commencer le calendrier avec lundi plutot que dimanche");
  151. X  #endif /* ISOLATIN1 */
  152. X     exit(1);
  153. X  }
  154. X--- 416,423 ----
  155. X     fprintf(ErrFp, " -x[n]  Limite d'iterations pour la clause SATISFY (def=150)\n");
  156. X     fprintf(ErrFp, " -kcmd  Executer 'cmd' pour les rappels de type MSG\n");
  157. X     fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorite avant d'emettre\n");
  158. X!    fprintf(ErrFp, " -ivar=val Initialiser var a val et conserver var\n");
  159. X!    fprintf(ErrFp, " -m     Commencer le calendrier avec lundi plutot que dimanche\n");
  160. X  #endif /* ISOLATIN1 */
  161. X     exit(1);
  162. X  }
  163. X*** ../prev/funcs.c    Fri Oct 15 12:34:35 1993
  164. X--- ./funcs.c    Tue Nov 16 17:40:44 1993
  165. X***************
  166. X*** 30,36 ****
  167. X  #include <sys/types.h>
  168. X  #include <sys/stat.h>
  169. X  #include <time.h>
  170. X! #if defined(__MSDOS__) || defined(OS2)
  171. X  #include <io.h>
  172. X  #define R_OK 4
  173. X  #define W_OK 2
  174. X--- 30,36 ----
  175. X  #include <sys/types.h>
  176. X  #include <sys/stat.h>
  177. X  #include <time.h>
  178. X! #if defined(__MSDOS__) || defined(__OS2__)
  179. X  #include <io.h>
  180. X  #define R_OK 4
  181. X  #define W_OK 2
  182. X***************
  183. X*** 118,128 ****
  184. X  PRIVATE int    CleanUpAfterFunc ARGS ((void));
  185. X  PRIVATE int    SunStuff    ARGS ((int rise, double cosz, int jul));
  186. X  
  187. X! #if defined(__MSDOS__) || defined(OS2)
  188. X! PRIVATE FILE *popen  ARGS((char *cmd, char *mode));
  189. X! PRIVATE int   pclose ARGS((FILE *fp));
  190. X  #endif
  191. X  
  192. X  /* "Overload" the struct Operator definition */
  193. X  #define NO_MAX 127
  194. X  #define MINARGS prec
  195. X--- 118,143 ----
  196. X  PRIVATE int    CleanUpAfterFunc ARGS ((void));
  197. X  PRIVATE int    SunStuff    ARGS ((int rise, double cosz, int jul));
  198. X  
  199. X! #if defined(__MSDOS__) || defined(__BORLANDC__)
  200. X! PRIVATE FILE *os_popen  ARGS((char *cmd, char *mode));
  201. X! PRIVATE int   os_pclose ARGS((FILE *fp));
  202. X! #define POPEN os_popen
  203. X! #define PCLOSE os_pclose
  204. X! 
  205. X! #if defined(_MSC_VER)
  206. X! #define popen _popen
  207. X! #define pclose _pclose
  208. X  #endif
  209. X  
  210. X+ #elif defined(_MSC_VER)
  211. X+ #define POPEN _popen
  212. X+ #define PCLOSE _pclose
  213. X+ 
  214. X+ #else
  215. X+ #define POPEN popen
  216. X+ #define PCLOSE pclose
  217. X+ #endif
  218. X+ 
  219. X  /* "Overload" the struct Operator definition */
  220. X  #define NO_MAX 127
  221. X  #define MINARGS prec
  222. X***************
  223. X*** 276,282 ****
  224. X  
  225. X     r = (*(f->func))();
  226. X     if (r) {
  227. X!       DestroyValue(&RetVal);
  228. X        if (DebugFlag & DB_PRTEXPR)
  229. X       fprintf(ErrFp, "%s\n", ErrMsg[r]);
  230. X        else
  231. X--- 291,297 ----
  232. X  
  233. X     r = (*(f->func))();
  234. X     if (r) {
  235. X!       DestroyValue(RetVal);
  236. X        if (DebugFlag & DB_PRTEXPR)
  237. X       fprintf(ErrFp, "%s\n", ErrMsg[r]);
  238. X        else
  239. X***************
  240. X*** 326,339 ****
  241. X  #endif
  242. X  {
  243. X     Value v;
  244. X!    int i, r;
  245. X  
  246. X     for (i=0; i<Nargs; i++) {
  247. X!       r = PopValStack(&v);
  248. X!       if (r) return r;
  249. X!       DestroyValue(&v);
  250. X     }
  251. X!    PushValStack(&RetVal);
  252. X     return OK;
  253. X  }
  254. X  
  255. X--- 341,353 ----
  256. X  #endif
  257. X  {
  258. X     Value v;
  259. X!    int i;
  260. X  
  261. X     for (i=0; i<Nargs; i++) {
  262. X!       PopValStack(v);
  263. X!       DestroyValue(v);
  264. X     }
  265. X!    PushValStack(RetVal);
  266. X     return OK;
  267. X  }
  268. X  
  269. X***************
  270. X*** 562,570 ****
  271. X     if (!RetVal.v.str) return E_NO_MEM;
  272. X     RetVal.type = STR_TYPE;
  273. X     for (i=0; i<Nargs; i++) {
  274. X!      if (ARG(i).type != INT_TYPE) return E_BAD_TYPE;
  275. X!      if (ARG(i).v.val < -128 || ARG(i).v.val == 0) return E_2LOW;
  276. X!      if (ARG(i).v.val > 255) return E_2HIGH;
  277. X       *(RetVal.v.str + i) = ARG(i).v.val;
  278. X     }
  279. X     *(RetVal.v.str + Nargs) = 0;
  280. X--- 576,596 ----
  281. X     if (!RetVal.v.str) return E_NO_MEM;
  282. X     RetVal.type = STR_TYPE;
  283. X     for (i=0; i<Nargs; i++) {
  284. X!      if (ARG(i).type != INT_TYPE) {
  285. X!         free(RetVal.v.str);
  286. X!     RetVal.type = ERR_TYPE;
  287. X!         return E_BAD_TYPE;
  288. X!      }
  289. X!      if (ARG(i).v.val < -128 || ARG(i).v.val == 0) {
  290. X!         free(RetVal.v.str);
  291. X!     RetVal.type = ERR_TYPE;
  292. X!         return E_2LOW;
  293. X!      }
  294. X!      if (ARG(i).v.val > 255) {
  295. X!         free(RetVal.v.str);
  296. X!     RetVal.type = ERR_TYPE;
  297. X!         return E_2HIGH;
  298. X!      }
  299. X       *(RetVal.v.str + i) = ARG(i).v.val;
  300. X     }
  301. X     *(RetVal.v.str + Nargs) = 0;
  302. X***************
  303. X*** 930,941 ****
  304. X  #ifdef UNIX
  305. X     return RetStrVal("UNIX");
  306. X  #else
  307. X- #ifdef __MSC__
  308. X-     if (_osmode == OS2_MODE)
  309. X-         return RetStrVal("OS/2");
  310. X- #endif
  311. X  #ifdef __OS2__
  312. X!    return RetStrVal("OS/2");
  313. X  #else
  314. X     return RetStrVal("MSDOS");
  315. X  #endif
  316. X--- 956,963 ----
  317. X  #ifdef UNIX
  318. X     return RetStrVal("UNIX");
  319. X  #else
  320. X  #ifdef __OS2__
  321. X!    return RetStrVal(OS2MODE ? "OS/2" : "MSDOS");
  322. X  #else
  323. X     return RetStrVal("MSDOS");
  324. X  #endif
  325. X***************
  326. X*** 1216,1225 ****
  327. X     if (Nargs > 1) {
  328. X        if (ARG(1).type != TIM_TYPE) return E_BAD_TYPE;
  329. X        if (Nargs == 2) time = ARG(1).v.val;
  330. X!       sprintf(buf, "%d %s %d AT %02d:%02d", d, MonthName[m], y,
  331. X                time/60, time%60);
  332. X     } else {
  333. X!       sprintf(buf, "%d %s %d", d, MonthName[m], y);
  334. X     }
  335. X     return RetStrVal(buf);
  336. X  }
  337. X--- 1238,1247 ----
  338. X     if (Nargs > 1) {
  339. X        if (ARG(1).type != TIM_TYPE) return E_BAD_TYPE;
  340. X        if (Nargs == 2) time = ARG(1).v.val;
  341. X!       sprintf(buf, "%d %s %d AT %02d:%02d", d, EnglishMonthName[m], y,
  342. X                time/60, time%60);
  343. X     } else {
  344. X!       sprintf(buf, "%d %s %d", d, EnglishMonthName[m], y);
  345. X     }
  346. X     return RetStrVal(buf);
  347. X  }
  348. X***************
  349. X*** 1248,1254 ****
  350. X     if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
  351. X     s = buf;
  352. X     len = 0;
  353. X!    fp = popen(ARG(0).v.str, "r");
  354. X     if (!fp) return E_IO_ERR;
  355. X     while (len < SHELLSIZE) {
  356. X        ch = getc(fp);
  357. X--- 1270,1276 ----
  358. X     if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
  359. X     s = buf;
  360. X     len = 0;
  361. X!    fp = POPEN(ARG(0).v.str, "r");
  362. X     if (!fp) return E_IO_ERR;
  363. X     while (len < SHELLSIZE) {
  364. X        ch = getc(fp);
  365. X***************
  366. X*** 1263,1272 ****
  367. X  
  368. X     /* Delete trailing newline (converted to space) */
  369. X     if (s > buf && *(s-1) == ' ') *(s-1) = 0;
  370. X! #if defined(__MSDOS__) || defined(OS2)
  371. X     if (s-1 > buf && *(s-2) == ' ') *(s-2) = 0;
  372. X  #endif
  373. X!    pclose(fp);
  374. X     return RetStrVal(buf);
  375. X  }
  376. X  
  377. X--- 1285,1294 ----
  378. X  
  379. X     /* Delete trailing newline (converted to space) */
  380. X     if (s > buf && *(s-1) == ' ') *(s-1) = 0;
  381. X! #if defined(__MSDOS__) || defined(__OS2__)
  382. X     if (s-1 > buf && *(s-2) == ' ') *(s-2) = 0;
  383. X  #endif
  384. X!    PCLOSE(fp);
  385. X     return RetStrVal(buf);
  386. X  }
  387. X  
  388. X***************
  389. X*** 1438,1454 ****
  390. X     char TmpBuf[LINELEN];  /* Should be _POSIX_PATH_MAX ? */
  391. X     char *s;
  392. X  
  393. X- #if defined(__MSDOS__) || defined(OS2)
  394. X- #define PATHSEP '\\'
  395. X- #else
  396. X- #define PATHSEP '/'
  397. X- #endif
  398. X- 
  399. X     strcpy(TmpBuf, FileName);
  400. X     s = TmpBuf + strlen(TmpBuf) - 1;
  401. X     if (s < TmpBuf) return RetStrVal(".");
  402. X!    while (s > TmpBuf && *s != PATHSEP) s--;
  403. X!    if (*s == PATHSEP) {
  404. X           *s = 0;
  405. X       return RetStrVal(TmpBuf);
  406. X     } else return RetStrVal(".");
  407. X--- 1460,1477 ----
  408. X     char TmpBuf[LINELEN];  /* Should be _POSIX_PATH_MAX ? */
  409. X     char *s;
  410. X  
  411. X     strcpy(TmpBuf, FileName);
  412. X     s = TmpBuf + strlen(TmpBuf) - 1;
  413. X     if (s < TmpBuf) return RetStrVal(".");
  414. X! #if defined(__OS2__) || defined(__MSDOS__)
  415. X!    /* Both '\\' and '/' can be part of path; handle drive letters. */
  416. X!    while (s > TmpBuf && !strchr("\\/:", *s)) s--;
  417. X!    if (*s == ':') { s[1] = '.'; s += 2; }
  418. X!    if (s > TmpBuf) *s = '/';
  419. X! #else
  420. X!    while (s > TmpBuf && *s != '/') s--;
  421. X! #endif
  422. X!    if (*s == '/') {
  423. X           *s = 0;
  424. X       return RetStrVal(TmpBuf);
  425. X     } else return RetStrVal(".");
  426. X***************
  427. X*** 1492,1498 ****
  428. X     return OK;
  429. X  }
  430. X  
  431. X! #if defined(__MSDOS__) || defined(OS2)
  432. X  /***************************************************************/
  433. X  /*                                                             */
  434. X  /*  popen and pclose                                           */
  435. X--- 1515,1521 ----
  436. X     return OK;
  437. X  }
  438. X  
  439. X! #if defined(__MSDOS__) || defined(__BORLANDC__)
  440. X  /***************************************************************/
  441. X  /*                                                             */
  442. X  /*  popen and pclose                                           */
  443. X***************
  444. X*** 1509,1522 ****
  445. X  
  446. X  static char *TmpFile;
  447. X  #ifdef HAVE_PROTOS
  448. X! PRIVATE FILE *popen(char *cmd, char *mode)
  449. X  #else
  450. X! static FILE *popen(cmd, mode)
  451. X  char *cmd, *mode;
  452. X  #endif
  453. X  {
  454. X     char *s;
  455. X  
  456. X     TmpFile = tmpnam(NULL);
  457. X     if (!TmpFile) return NULL;
  458. X     s = (char *) malloc(strlen(cmd) + 3 + strlen(TmpFile) + 1);
  459. X--- 1532,1550 ----
  460. X  
  461. X  static char *TmpFile;
  462. X  #ifdef HAVE_PROTOS
  463. X! PRIVATE FILE *os_popen(char *cmd, char *mode)
  464. X  #else
  465. X! static FILE *os_popen(cmd, mode)
  466. X  char *cmd, *mode;
  467. X  #endif
  468. X  {
  469. X     char *s;
  470. X  
  471. X+ #if defined(__OS2__) && !defined(__BORLANDC__)
  472. X+    if (OS2MODE)
  473. X+      return(popen(cmd, mode));
  474. X+ #endif
  475. X+ 
  476. X     TmpFile = tmpnam(NULL);
  477. X     if (!TmpFile) return NULL;
  478. X     s = (char *) malloc(strlen(cmd) + 3 + strlen(TmpFile) + 1);
  479. X***************
  480. X*** 1530,1541 ****
  481. X  }
  482. X  
  483. X  #ifdef HAVE_PROTOS
  484. X! PRIVATE int pclose(FILE *fp)
  485. X  #else
  486. X! static int pclose(fp)
  487. X  FILE *fp;
  488. X  #endif
  489. X  {
  490. X     unlink(TmpFile);
  491. X     return fclose(fp);
  492. X  }
  493. X--- 1558,1574 ----
  494. X  }
  495. X  
  496. X  #ifdef HAVE_PROTOS
  497. X! PRIVATE int os_pclose(FILE *fp)
  498. X  #else
  499. X! static int os_pclose(fp)
  500. X  FILE *fp;
  501. X  #endif
  502. X  {
  503. X+ #if defined(__OS2__) && !defined(__BORLANDC__)
  504. X+   if (OS2MODE)
  505. X+     return(pclose(fp));
  506. X+ #endif
  507. X+ 
  508. X     unlink(TmpFile);
  509. X     return fclose(fp);
  510. X  }
  511. X*** ../prev/globals.h    Tue Oct 12 16:22:43 1993
  512. X--- ./globals.h    Tue Nov 16 17:45:06 1993
  513. X***************
  514. X*** 24,29 ****
  515. X--- 24,31 ----
  516. X  #define IsLeapYear(y) (((y) % 4) ? 0 : ((!((y) % 100) && ((y) % 400)) ? 0 : 1 ))
  517. X  #define DaysInMonth(m, y) ((m) != 1 ? MonthDays[m] : 28 + IsLeapYear(y))
  518. X  
  519. X+ #define DestroyValue(x) (void) (((x).type == STR_TYPE && (x).v.str) ? (free((x).v.str),(x).type = ERR_TYPE) : 0)
  520. X+ 
  521. X  EXTERN    int    JulianToday;
  522. X  EXTERN    int    RealToday;
  523. X  EXTERN    int    CurDay;
  524. X***************
  525. X*** 53,58 ****
  526. X--- 55,61 ----
  527. X  EXTERN  INIT(   int     SortByTime, 0);
  528. X  EXTERN  INIT(   int     SortByDate, 0);
  529. X  EXTERN    INIT(    int    SortByPrio, 0);
  530. X+ EXTERN    INIT(    int    DefaultPrio, NO_PRIORITY);
  531. X  
  532. X  EXTERN    char    *InitialFile;
  533. X  EXTERN    int    FileAccessDate;
  534. X***************
  535. X*** 110,115 ****
  536. X--- 113,128 ----
  537. X  EXTERN  INIT(   char    Banner[LINELEN], L_BANNER);
  538. X  
  539. X  /* List of months */
  540. X+ EXTERN  char    *EnglishMonthName[]
  541. X+ #ifdef MK_GLOBALS
  542. X+ = {"January", "February", "March", "April", "May", "June",
  543. X+    "July", "August", "September", "October", "November", "December"}
  544. X+ #endif
  545. X+ ;
  546. X+ 
  547. X+ #if LANG == ENGLISH
  548. X+ #define MonthName EnglishMonthName
  549. X+ #else
  550. X  EXTERN    char    *MonthName[]
  551. X  #ifdef MK_GLOBALS
  552. X  = {L_JAN, L_FEB, L_MAR, L_APR, L_MAY, L_JUN,
  553. X***************
  554. X*** 116,122 ****
  555. X--- 129,146 ----
  556. X     L_JUL, L_AUG, L_SEP, L_OCT, L_NOV, L_DEC}
  557. X  #endif
  558. X  ;
  559. X+ #endif
  560. X  
  561. X+ EXTERN  char    *EnglishDayName[]
  562. X+ #ifdef MK_GLOBALS
  563. X+ = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
  564. X+    "Saturday", "Sunday"}
  565. X+ #endif
  566. X+ ;
  567. X+ 
  568. X+ #if LANG == ENGLISH
  569. X+ #define DayName EnglishDayName
  570. X+ #else
  571. X  EXTERN    char    *DayName[]
  572. X  #ifdef MK_GLOBALS
  573. X  = {L_MONDAY, L_TUESDAY, L_WEDNESDAY, L_THURSDAY, L_FRIDAY,
  574. X***************
  575. X*** 123,128 ****
  576. X--- 147,153 ----
  577. X     L_SATURDAY, L_SUNDAY}
  578. X  #endif
  579. X  ;
  580. X+ #endif
  581. X  
  582. X  EXTERN    int    MonthDays[]
  583. X  #ifdef MK_GLOBALS
  584. X***************
  585. X*** 141,143 ****
  586. X--- 166,178 ----
  587. X    }
  588. X  #endif
  589. X  ;
  590. X+ 
  591. X+ #if defined(__OS2__)
  592. X+ #if defined(_MSC_VER) || defined(__EMX__)
  593. X+ #define OS2MODE (_osmode == OS2_MODE)
  594. X+ #define DOSMODE (_osmode == DOS_MODE)
  595. X+ #else
  596. X+ #define OS2MODE 1
  597. X+ #define DOSMODE 0
  598. X+ #endif
  599. X+ #endif
  600. X*** ../prev/init.c    Tue Oct 12 16:22:44 1993
  601. X--- ./init.c    Mon Nov 15 14:25:30 1993
  602. X***************
  603. X*** 128,133 ****
  604. X--- 128,138 ----
  605. X     NumQueued = 0;
  606. X     DontIssueAts = 0;
  607. X     Daemon = 0;
  608. X+ #elif defined(_MSC_VER) || defined(__BORLANDC__)
  609. X+    DontFork = 1;
  610. X+ #elif defined(__OS2__) && defined (__MSDOS__)
  611. X+    if (DOSMODE)
  612. X+      DontFork = 1;
  613. X  #endif
  614. X  
  615. X     /* Parse the command-line options */
  616. X*** ../prev/main.c    Thu Oct 14 11:27:43 1993
  617. X--- ./main.c    Wed Nov 17 12:38:09 1993
  618. X***************
  619. X*** 20,25 ****
  620. X--- 20,26 ----
  621. X  #include <unistd.h>
  622. X  #endif
  623. X  #include <stdio.h>
  624. X+ #include <signal.h>
  625. X  #include <string.h>
  626. X  #ifdef HAVE_STDARG
  627. X  #include <stdarg.h>
  628. X***************
  629. X*** 55,66 ****
  630. X  static char TPushBuffer[TOKSIZE+1]; /* Buffer for pushing back a token. */
  631. X  static char *TokenPushed = NULL;
  632. X  
  633. X! #ifdef __OS2__
  634. X! #ifdef putchar
  635. X! #undef putchar
  636. X  #endif
  637. X- #define putchar(c) PutcPopUp(c)
  638. X- #endif
  639. X  
  640. X  /***************************************************************/
  641. X  /***************************************************************/
  642. X--- 56,66 ----
  643. X  static char TPushBuffer[TOKSIZE+1]; /* Buffer for pushing back a token. */
  644. X  static char *TokenPushed = NULL;
  645. X  
  646. X! #ifdef OS2_POPUP
  647. X! #define Putchar(c) {if (AsPopUp) PutcPopUp(c); else putchar(c);}
  648. X! #else
  649. X! #define Putchar(c) putchar(c)
  650. X  #endif
  651. X  
  652. X  /***************************************************************/
  653. X  /***************************************************************/
  654. X***************
  655. X*** 118,125 ****
  656. X  #endif
  657. X        }
  658. X  
  659. X!    /* If it's MS-DOS or OS2, reset the file access date */
  660. X! #if defined(__MSDOS__) || defined(OS2)
  661. X        if (!UseStdin && (RealToday == JulianToday))
  662. X           SetAccessDate(InitialFile, RealToday);
  663. X  #endif
  664. X--- 118,127 ----
  665. X  #endif
  666. X        }
  667. X  
  668. X!    /* If it's MS-DOS, reset the file access date.           */
  669. X!    /* Note that OS/2 and DOS bound programs have __MSDOS__  */
  670. X!    /* defined, so this test should probably be modified.    */
  671. X! #if defined(__MSDOS__)
  672. X        if (!UseStdin && (RealToday == JulianToday))
  673. X           SetAccessDate(InitialFile, RealToday);
  674. X  #endif
  675. X***************
  676. X*** 390,396 ****
  677. X        if (*p->pos != END_OF_EXPR) {
  678. X       *err = E_MISS_END;
  679. X       DestroyParser(p);
  680. X!      DestroyValue(&val);
  681. X       return 0;
  682. X        }
  683. X        p->pos++;
  684. X--- 392,398 ----
  685. X        if (*p->pos != END_OF_EXPR) {
  686. X       *err = E_MISS_END;
  687. X       DestroyParser(p);
  688. X!      DestroyValue(val);
  689. X       return 0;
  690. X        }
  691. X        p->pos++;
  692. X***************
  693. X*** 1246,1256 ****
  694. X--- 1248,1268 ----
  695. X  #define ISBLANK(c) (isspace(c) && (c) != '\n')
  696. X  
  697. X  #ifdef HAVE_PROTOS
  698. X+ #ifdef OS2_POPUP
  699. X+ PUBLIC void FillParagraph(char *s, int AsPopUp)
  700. X+ #else
  701. X  PUBLIC void FillParagraph(char *s)
  702. X+ #endif
  703. X  #else
  704. X+ #ifdef OS2_POPUP
  705. X+ void FillParagraph(s, AsPopUp)
  706. X+ char *s;
  707. X+ int AsPopUp;
  708. X+ #else
  709. X  void FillParagraph(s)
  710. X  char *s;
  711. X  #endif
  712. X+ #endif
  713. X  {
  714. X  
  715. X     int line = 0;
  716. X***************
  717. X*** 1272,1278 ****
  718. X  
  719. X        /* If it's a carriage return, output it and start new paragraph */
  720. X        if (*s == '\n') {
  721. X!          putchar('\n');
  722. X       s++;
  723. X       line = 0;
  724. X       while(ISBLANK(*s)) s++;
  725. X--- 1284,1290 ----
  726. X  
  727. X        /* If it's a carriage return, output it and start new paragraph */
  728. X        if (*s == '\n') {
  729. X!      Putchar('\n');
  730. X       s++;
  731. X       line = 0;
  732. X       while(ISBLANK(*s)) s++;
  733. X***************
  734. X*** 1284,1290 ****
  735. X        /* Over here, we're at the beginning of a line.  Emit the correct
  736. X           number of spaces */
  737. X        j = line ? SubsIndent : FirstIndent;
  738. X!       for (i=0; i<j; i++) putchar(' ');
  739. X  
  740. X        /* Calculate the amount of room left on this line */
  741. X        roomleft = FormWidth - j;
  742. X--- 1296,1304 ----
  743. X        /* Over here, we're at the beginning of a line.  Emit the correct
  744. X           number of spaces */
  745. X        j = line ? SubsIndent : FirstIndent;
  746. X!       for (i=0; i<j; i++) {
  747. X!       Putchar(' ');
  748. X!       }
  749. X  
  750. X        /* Calculate the amount of room left on this line */
  751. X        roomleft = FormWidth - j;
  752. X***************
  753. X*** 1301,1309 ****
  754. X          return;
  755. X           }
  756. X       if (!pendspace || len+pendspace <= roomleft) {
  757. X!             for (i=0; i<pendspace; i++) putchar(' ');
  758. X             while(t < s) {
  759. X!            putchar(*t);
  760. X             if (strchr(EndSent, *t)) doublespace = 2;
  761. X             else if (!strchr(EndSentIg, *t)) doublespace = 1;
  762. X             t++;
  763. X--- 1315,1325 ----
  764. X          return;
  765. X           }
  766. X       if (!pendspace || len+pendspace <= roomleft) {
  767. X!         for (i=0; i<pendspace; i++) {
  768. X!            Putchar(' ');
  769. X!         }
  770. X             while(t < s) {
  771. X!            Putchar(*t);
  772. X             if (strchr(EndSent, *t)) doublespace = 2;
  773. X             else if (!strchr(EndSentIg, *t)) doublespace = 1;
  774. X             t++;
  775. X***************
  776. X*** 1310,1316 ****
  777. X              }
  778. X           } else {
  779. X          s = t;
  780. X!         putchar('\n');
  781. X          line++;
  782. X          break;
  783. X           }
  784. X--- 1326,1332 ----
  785. X              }
  786. X           } else {
  787. X          s = t;
  788. X!         Putchar('\n');
  789. X          line++;
  790. X          break;
  791. X           }
  792. X***************
  793. X*** 1459,1461 ****
  794. X--- 1475,1520 ----
  795. X     *locdate = utcdate;
  796. X     *loctime = utctime;
  797. X  }
  798. X+ 
  799. X+ /***************************************************************/
  800. X+ /*                                   */
  801. X+ /* SigIntHandler                           */
  802. X+ /*                                   */
  803. X+ /* For debugging purposes, when sent a SIGINT, we print the    */
  804. X+ /* contents of the queue.  This does NOT work when the -f      */
  805. X+ /* command-line flag is supplied.                   */
  806. X+ /*                                   */
  807. X+ /* For OS/2, this has to be in the main thread.            */
  808. X+ /*                                   */
  809. X+ /***************************************************************/
  810. X+ #ifdef HAVE_QUEUED
  811. X+ 
  812. X+ #ifdef __BORLANDC__
  813. X+ void __cdecl SigIntHandler(int d)
  814. X+ #else
  815. X+ #ifdef HAVE_PROTOS
  816. X+ void SigIntHandler(void)
  817. X+ #else
  818. X+ void SigIntHandler()
  819. X+ #endif
  820. X+ #endif
  821. X+ {
  822. X+ #ifdef SYSV
  823. X+    signal(SIGINT, SigIntHandler);
  824. X+ #else
  825. X+ #ifdef __BORLANDC__
  826. X+    signal(SIGINT, SIG_DFL);
  827. X+ #else
  828. X+ #ifdef __OS2__
  829. X+    signal(SIGINT, SIG_ACK);
  830. X+ #endif
  831. X+ #endif
  832. X+ #endif
  833. X+    GotSigInt();
  834. X+ 
  835. X+ #ifndef UNIX
  836. X+    exit(0);
  837. X+ #endif
  838. X+ }
  839. X+ 
  840. X+ #endif /* HAVE_QUEUED */
  841. X*** ../prev/makefile.bcc    Wed Oct 13 11:21:03 1993
  842. X--- ./makefile.bcc    Mon Nov 15 14:25:32 1993
  843. X***************
  844. X*** 1,11 ****
  845. X  # Makefile for REMIND for Borland C++
  846. X  
  847. X! VERSION= 03.00.10
  848. X  
  849. X  MODEL=l
  850. X  
  851. X  !if $d(__OS2__)
  852. X! CFLAGS= -DOS2 -w-pia -O2
  853. X  BINDIR= ..\OS2-EX
  854. X  DELFLAG= /f
  855. X  !else
  856. X--- 1,11 ----
  857. X  # Makefile for REMIND for Borland C++
  858. X  
  859. X! VERSION= 03.00.11
  860. X  
  861. X  MODEL=l
  862. X  
  863. X  !if $d(__OS2__)
  864. X! CFLAGS= -DOS2_POPUP -w-pia -O2
  865. X  BINDIR= ..\OS2-EX
  866. X  DELFLAG= /f
  867. X  !else
  868. X*** ../prev/makefile.os2    Tue Oct 12 16:28:52 1993
  869. X--- ./makefile.os2    Tue Nov 16 12:13:24 1993
  870. X***************
  871. X*** 1,41 ****
  872. X! # Makefile for REMIND for Microsoft C 6.00A for OS/2 and MSDOS
  873. X! # This copy was modified from the original to permit creation of 
  874. X! #   remind.exe   OS/2 1.x--2.0 executable
  875. X! #   remindb.exe  OS/2 and MSDOS bound executable
  876. X  #
  877. X! # Darrel Hankerson hank@ducvax.auburn.edu
  878. X! # 11 November 1992
  879. X  
  880. X! O = .obj
  881. X  
  882. X! CC= cl
  883. X  
  884. X- # Put any additional flags for the C compiler here
  885. X- MODEL = S
  886. X- DEFINES= -D__MSDOS__ -D__MSC__ -D__STDC__ -DOS2
  887. X- CFLAGS= -A$(MODEL) $(DEFINES)
  888. X  
  889. X! LINK = cl
  890. X! LFLAGS = -A$(MODEL) -Lp
  891. X! BIND = bind
  892. X  
  893. X! all: remind.exe remindb.exe rem2ps.exe
  894. X  
  895. X! #-----------------------------------------------------------------------------
  896. X! # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  897. X! # in config.h; then, you should be able to type 'make'.
  898. X! #-----------------------------------------------------------------------------
  899. X! VERSION= 03.00.10
  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 finish.h french.h norwgian.h
  903. X  
  904. X  STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  905. X  
  906. X  LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  907. X  
  908. X! SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  909. X! main.c moon.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  910. X  
  911. X  MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  912. X  remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  913. X--- 1,57 ----
  914. X! # Makefile for REMIND
  915. X  #
  916. X! # - for GNU gcc (emx 0.8g kit) [executables for OS/2 2.x or DOS (32-bit)]
  917. X! # - for Microsoft C 6.00A      [executables for OS/2 or MSDOS (16-bit)]
  918. X  
  919. X! # To use, enter "make -f Makefile.os2" (this makefile depends on its
  920. X! # name being "Makefile.os2").
  921. X! #
  922. X! # Tested with dmake 3.8 and GNU make 3.68 under OS/2
  923. X  
  924. X! default:
  925. X!     @echo "Enter $(MAKE) -f Makefile.os2 target                     "
  926. X!     @echo " where 'target' is chosen from                          " 
  927. X!     @echo "   msc      OS/2 exe [Microsoft C 6.00a]                "
  928. X!     @echo "   mscbnd   OS/2 and DOS exe [Microsoft C 6.00a]        "
  929. X!     @echo "   emx      OS/2 and DOS 32-bit exe [EMX/gcc]           "
  930. X  
  931. X  
  932. X! msc: 
  933. X!     $(MAKE) -f Makefile.os2 all \
  934. X!     CC="cl -nologo -AM" O=".obj" \
  935. X!     CFLAGS="-D__STDC__ -D__OS2__" \
  936. X!     LFLAGS="-Lp" \
  937. X!     LFLAGS2="setargv.obj remind.def -link /NOE"
  938. X  
  939. X! mscbnd: 
  940. X!     $(MAKE) -f Makefile.os2 all \
  941. X!     CC="cl -nologo -AM" O=".obj" \
  942. X!     CFLAGS="-D__STDC__ -D__OS2__ -D__MSDOS__" \
  943. X!     LFLAGS="-Lp" LBIND="-Fb" \
  944. X!     LFLAGS2="setargv.obj remind.def -link /NOE" \
  945. X!     BIND="bind remind /n DOSMAKEPIPE DOSCWAIT VIOENDPOPUP VIOPOPUP"
  946. X  
  947. X! emx:  
  948. X!     $(MAKE) -f Makefile.os2 all \
  949. X!     CC="gcc -O -s" O=".o" \
  950. X!     CFLAGS="-D__OS2__ -D__MSDOS__" \
  951. X!     LFLAGS=""
  952. X  
  953. X+ 
  954. X+ # OS2_POPUP enables Russ Herman's popup reminders
  955. X+ #OS2_POPUP =
  956. X+ OS2_POPUP = -DOS2_POPUP
  957. X+ 
  958. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  959. X! lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
  960. X  
  961. X  STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  962. X  
  963. X  LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  964. X  
  965. X! SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c hbcal.c \
  966. X! init.c main.c moon.c omit.c sort.c queue.c token.c trigger.c userfns.c \
  967. X! utils.c var.c os2func.c
  968. X  
  969. X  MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  970. X  remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  971. X***************
  972. X*** 47,75 ****
  973. X  
  974. X  OBJS= $(SRCS:.c=$O)
  975. X  
  976. X! rem2ps.exe: rem2ps.obj remind.def
  977. X!     copy remind.def rem2ps.def
  978. X!     $(LINK) -o $@ $(LFLAGS) $<
  979. X  
  980. X! rem2ps.obj: rem2ps.c rem2ps.h lang.h config.h
  981. X!     $(CC) -c $(CFLAGS) rem2ps.c
  982. X  
  983. X! remind.exe: $(OBJS) remind.def
  984. X!     $(LINK) -o $@ $(LFLAGS) $< 
  985. X  
  986. X! remindb.exe: remind.exe
  987. X!     $(BIND) -o $@ $<
  988. X  
  989. X! rem2psb.exe: rem2ps.exe
  990. X!     $(BIND) -o $@ $<
  991. X  
  992. X! .c.$O:
  993. X!     $(CC) -c $(CFLAGS) $<
  994. X  
  995. X! clean:
  996. X!     rm -f *$O
  997. X  
  998. X! rem2ps$O: rem2ps.c rem2ps.h config.h
  999. X  calendar$O: calendar.c $(STDHDRS) expr.h
  1000. X  dorem$O: dorem.c $(STDHDRS) expr.h
  1001. X  dosubst$O: dosubst.c $(STDHDRS) $(LANGHDRS)
  1002. X--- 63,90 ----
  1003. X  
  1004. X  OBJS= $(SRCS:.c=$O)
  1005. X  
  1006. X! all: remind.exe rem2ps.exe
  1007. X  
  1008. X! .c$O:
  1009. X!     $(CC) -c $(CFLAGS) $(OS2_POPUP) $*.c
  1010. X  
  1011. X! rem2ps.exe: rem2ps$O
  1012. X!     $(CC) $(LFLAGS) $(LBIND) -o $@ rem2ps$O $(LFLAGS2)
  1013. X  
  1014. X! remind.exe: $(OBJS)
  1015. X!     $(CC) $(LFLAGS) -o $@ $(OBJS) $(LFLAGS2)
  1016. X!     $(BIND)
  1017. X  
  1018. X! clean:
  1019. X!     rm -f *.o *.obj *~ core *.bak
  1020. X  
  1021. X! clobber:
  1022. X!     rm -f *.o *.obj *~ remind.exe rem2ps.exe test.out core *.bak
  1023. X  
  1024. X! test:
  1025. X!     test-rem.cmd
  1026. X  
  1027. X! rem2ps$O: rem2ps.c rem2ps.h lang.h config.h
  1028. X  calendar$O: calendar.c $(STDHDRS) expr.h
  1029. X  dorem$O: dorem.c $(STDHDRS) expr.h
  1030. X  dosubst$O: dosubst.c $(STDHDRS) $(LANGHDRS)
  1031. X***************
  1032. X*** 76,87 ****
  1033. X  expr$O: expr.c $(STDHDRS) expr.h
  1034. X  files$O: files.c $(STDHDRS)
  1035. X  funcs$O: funcs.c $(STDHDRS) expr.h version.h
  1036. X! globals$O: globals.c config.h types.h globals.h err.h lang.h
  1037. X! init$O: init.c $(STDHDRS) expr.h version.h
  1038. X  main$O: main.c $(STDHDRS) expr.h
  1039. X  moon$O: moon.c $(STDHDRS)
  1040. X  omit$O: omit.c $(STDHDRS)
  1041. X  sort$O: sort.c $(STDHDRS)
  1042. X  token$O: token.c $(STDHDRS)
  1043. X  trigger$O: trigger.c $(STDHDRS) expr.h
  1044. X  userfns$O: userfns.c $(STDHDRS) expr.h
  1045. X--- 91,104 ----
  1046. X  expr$O: expr.c $(STDHDRS) expr.h
  1047. X  files$O: files.c $(STDHDRS)
  1048. X  funcs$O: funcs.c $(STDHDRS) expr.h version.h
  1049. X! globals$O: globals.c config.h types.h globals.h err.h lang.h $(LANGHDRS)
  1050. X! hbcal$O: hbcal.c $(STDHDRS)
  1051. X! init$O: init.c $(STDHDRS) expr.h version.h $(LANGHDRS)
  1052. X  main$O: main.c $(STDHDRS) expr.h
  1053. X  moon$O: moon.c $(STDHDRS)
  1054. X  omit$O: omit.c $(STDHDRS)
  1055. X  sort$O: sort.c $(STDHDRS)
  1056. X+ queue$O: queue.c $(STDHDRS)
  1057. X  token$O: token.c $(STDHDRS)
  1058. X  trigger$O: trigger.c $(STDHDRS) expr.h
  1059. X  userfns$O: userfns.c $(STDHDRS) expr.h
  1060. X*** ../prev/makefile.tc    Tue Oct 12 16:28:35 1993
  1061. X--- ./makefile.tc    Thu Oct 21 12:39:34 1993
  1062. X***************
  1063. X*** 1,7 ****
  1064. X  # Makefile for REMIND for Turbo C for MSDOS
  1065. X  
  1066. X  CC= tcc
  1067. X! VERSION= 03.00.10
  1068. X  
  1069. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  1070. X  lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
  1071. X--- 1,7 ----
  1072. X  # Makefile for REMIND for Turbo C for MSDOS
  1073. X  
  1074. X  CC= tcc
  1075. X! VERSION= 03.00.11
  1076. X  
  1077. X  HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  1078. X  lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
  1079. X*** ../prev/os2func.c    Tue Oct 12 16:44:56 1993
  1080. X--- ./os2func.c    Wed Nov 17 10:12:21 1993
  1081. X***************
  1082. X*** 10,21 ****
  1083. X  /*  REMIND is Copyright (C) 1993 by David F. Skoll.            */
  1084. X  /*                                                             */
  1085. X  /***************************************************************/
  1086. X! #ifdef __OS2__
  1087. X  #define INCL_VIO
  1088. X  #define INCL_KBD
  1089. X  #include <os2.h>
  1090. X  
  1091. X  #include <stdio.h>
  1092. X  #include <string.h>
  1093. X  #ifdef OS2DBG
  1094. X  #include <dos.h>
  1095. X--- 10,31 ----
  1096. X  /*  REMIND is Copyright (C) 1993 by David F. Skoll.            */
  1097. X  /*                                                             */
  1098. X  /***************************************************************/
  1099. X! #ifdef OS2_POPUP
  1100. X  #define INCL_VIO
  1101. X  #define INCL_KBD
  1102. X+ #endif
  1103. X+ 
  1104. X+ #ifdef _MSC_VER
  1105. X+ #define INCL_DOSPROCESS
  1106. X+ #endif
  1107. X+ 
  1108. X+ #if defined(OS2_POPUP) || defined(_MSC_VER)
  1109. X  #include <os2.h>
  1110. X+ #endif
  1111. X  
  1112. X+ #ifdef OS2_POPUP
  1113. X  #include <stdio.h>
  1114. X+ #include <stdlib.h>
  1115. X  #include <string.h>
  1116. X  #ifdef OS2DBG
  1117. X  #include <dos.h>
  1118. X***************
  1119. X*** 23,40 ****
  1120. X  #endif
  1121. X  #include "config.h"
  1122. X  #include "globals.h"
  1123. X  #include "types.h"
  1124. X  #include "protos.h"
  1125. X  
  1126. X  static APIRET apiret = 0;
  1127. X  static KBDKEYINFO kbci;
  1128. X  static char *pszPressAny = "\r\nPress any key to continue";
  1129. X! static USHORT pflags = VP_WAIT;
  1130. X  static HKBD hkbd = 0;
  1131. X! static char VioSubstBuffer[2*LINELEN];
  1132. X  
  1133. X  void StartPopUp()
  1134. X  {
  1135. X      if (!(DebugFlag & DB_ECHO_LINE))
  1136. X         VioPopUp(&pflags, 0);
  1137. X  }
  1138. X--- 33,62 ----
  1139. X  #endif
  1140. X  #include "config.h"
  1141. X  #include "globals.h"
  1142. X+ 
  1143. X+ /* EMX defines PS_TYPE, so we undefine it here to avoid
  1144. X+    a redefinition warning when we include "types.h" */
  1145. X+ #ifdef PS_TYPE
  1146. X+ #undef PS_TYPE
  1147. X+ #endif
  1148. X+ 
  1149. X  #include "types.h"
  1150. X  #include "protos.h"
  1151. X  
  1152. X+ #ifdef _MSC_VER
  1153. X+ typedef USHORT APIRET;
  1154. X+ #endif
  1155. X+ 
  1156. X  static APIRET apiret = 0;
  1157. X  static KBDKEYINFO kbci;
  1158. X  static char *pszPressAny = "\r\nPress any key to continue";
  1159. X! static USHORT pflags = VP_WAIT;  /* | VP_TRANSPARENT; */
  1160. X  static HKBD hkbd = 0;
  1161. X! static char VioSubstBuffer[SHELLSIZE + 1];
  1162. X  
  1163. X  void StartPopUp()
  1164. X  {
  1165. X+   if (OS2MODE)
  1166. X      if (!(DebugFlag & DB_ECHO_LINE))
  1167. X         VioPopUp(&pflags, 0);
  1168. X  }
  1169. X***************
  1170. X*** 43,51 ****
  1171. X  {
  1172. X      if (DebugFlag & DB_ECHO_LINE)
  1173. X      return;
  1174. X!     VioWrtTTY(pszPressAny, strlen(pszPressAny), 0);
  1175. X!     KbdCharIn(&kbci, IO_WAIT, hkbd);
  1176. X!     VioEndPopUp(0);
  1177. X  }
  1178. X  
  1179. X  int PutsPopUp(char *s)
  1180. X--- 65,75 ----
  1181. X  {
  1182. X      if (DebugFlag & DB_ECHO_LINE)
  1183. X      return;
  1184. X!     if (OS2MODE) {
  1185. X!       VioWrtTTY(pszPressAny, strlen(pszPressAny), 0);
  1186. X!       KbdCharIn(&kbci, IO_WAIT, hkbd);
  1187. X!       VioEndPopUp(0);
  1188. X!     }
  1189. X  }
  1190. X  
  1191. X  int PutsPopUp(char *s)
  1192. X***************
  1193. X*** 115,121 ****
  1194. X--- 139,155 ----
  1195. X  #endif
  1196. X  #endif
  1197. X  
  1198. X+ #ifdef _MSC_VER
  1199. X+ unsigned sleep(unsigned sec)
  1200. X+ {
  1201. X+   return DosSleep(sec * 1000L);
  1202. X+ }
  1203. X+ #endif
  1204. X+ 
  1205. X+ #ifndef __EMX__ 
  1206. X  int fork()
  1207. X  {
  1208. X      return(-1);
  1209. X  }
  1210. X+ #endif
  1211. X+ 
  1212. X*** ../prev/protos.h    Wed Oct 20 11:54:30 1993
  1213. X--- ./protos.h    Tue Nov 16 15:58:54 1993
  1214. X***************
  1215. X*** 32,44 ****
  1216. X  int DoFlush ARGS ((ParsePtr p));
  1217. X  void DoExit ARGS ((ParsePtr p));
  1218. X  int ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim));
  1219. X  int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul));
  1220. X  int ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul));
  1221. X  int DoSubst ARGS ((ParsePtr p, char *out, Trigger *t, TimeTrig *tt, int jul, int mode));
  1222. X  int DoSubstFromString ARGS ((char *source, char *dest, int jul, int tim));
  1223. X  int EvalExpr ARGS ((char **e, Value *v));
  1224. X- int PushValStack ARGS ((Value *val));
  1225. X- int PopValStack ARGS ((Value *val));
  1226. X  int DoCoerce ARGS ((char type, Value *v));
  1227. X  void DestroyValue ARGS ((Value *v));
  1228. X  void PrintValue  ARGS ((Value *v, FILE *fp));
  1229. X--- 32,47 ----
  1230. X  int DoFlush ARGS ((ParsePtr p));
  1231. X  void DoExit ARGS ((ParsePtr p));
  1232. X  int ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim));
  1233. X+ #ifdef OS2_POPUP
  1234. X+ int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul,
  1235. X+                int AsPopUp));
  1236. X+ #else
  1237. X  int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul));
  1238. X+ #endif
  1239. X  int ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul));
  1240. X  int DoSubst ARGS ((ParsePtr p, char *out, Trigger *t, TimeTrig *tt, int jul, int mode));
  1241. X  int DoSubstFromString ARGS ((char *source, char *dest, int jul, int tim));
  1242. X  int EvalExpr ARGS ((char **e, Value *v));
  1243. X  int DoCoerce ARGS ((char type, Value *v));
  1244. X  void DestroyValue ARGS ((Value *v));
  1245. X  void PrintValue  ARGS ((Value *v, FILE *fp));
  1246. X***************
  1247. X*** 62,67 ****
  1248. X--- 65,71 ----
  1249. X  int ParseIdentifier ARGS ((ParsePtr p, char *out));
  1250. X  int EvaluateExpr ARGS ((ParsePtr p, Value *v));
  1251. X  int Evaluate ARGS ((char **s, Var *locals));
  1252. X+ int FnPopValStack ARGS ((Value *val));
  1253. X  void Eprint ARGS ((const char *fmt, ...));
  1254. X  void OutputLine ARGS ((FILE *fp));
  1255. X  void CreateParser ARGS ((char *s, ParsePtr p));
  1256. X***************
  1257. X*** 131,148 ****
  1258. X--- 135,164 ----
  1259. X  int SetSysVar ARGS ((const char *name, Value *val));
  1260. X  void DumpSysVarByName ARGS ((const char *name));
  1261. X  int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
  1262. X+ #ifdef OS2_POPUP
  1263. X+ void FillParagraph ARGS ((char *s, int AsPopUp));
  1264. X+ #else
  1265. X  void FillParagraph ARGS ((char *s));
  1266. X+ #endif
  1267. X  void LocalToUTC ARGS ((int locdate, int loctime, int *utcdate, int *utctime));
  1268. X  void UTCToLocal ARGS ((int utcdate, int utctime, int *locdate, int *loctime));
  1269. X  int MoonPhase ARGS ((int date, int time));
  1270. X  void HuntPhase ARGS ((int startdate, int starttim, int phas, int *date, int *time));
  1271. X  int CompareRems ARGS ((int dat1, int tim1, int prio1, int dat2, int tim2, int prio2, int bydate, int bytime, int byprio));
  1272. X+ #ifdef __BORLANDC__
  1273. X+ void __cdecl SigIntHandler ARGS ((int d));
  1274. X+ #else
  1275. X+ void SigIntHandler ARGS ((void));
  1276. X+ #endif
  1277. X+ void GotSigInt ARGS ((void));
  1278. X  
  1279. X  #if defined(__OS2__)
  1280. X  int fork ARGS ((void));
  1281. X+ #if defined(OS2_POPUP)
  1282. X  void StartPopUp ARGS ((void));
  1283. X  void EndPopUp ARGS ((void));
  1284. X  int PutcPopUp ARGS ((int c));
  1285. X  int PutlPopUp ARGS ((char *s));
  1286. X  int PutsPopUp ARGS ((char *s));
  1287. X+ #endif
  1288. X  #endif
  1289. X*** ../prev/queue.c    Wed Oct 20 13:16:43 1993
  1290. X--- ./queue.c    Wed Nov 17 12:56:07 1993
  1291. X***************
  1292. X*** 9,15 ****
  1293. X--- 9,19 ----
  1294. X  /*                                                             */
  1295. X  /***************************************************************/
  1296. X  #include "config.h"
  1297. X+ 
  1298. X+ /* We only want object code generated if we have queued reminders */
  1299. X+ #ifdef HAVE_QUEUED
  1300. X  #include <stdio.h>
  1301. X+ #include <string.h>
  1302. X  #include <signal.h>
  1303. X  #include <sys/types.h>
  1304. X  #include <sys/stat.h>
  1305. X***************
  1306. X*** 23,31 ****
  1307. X  #include <unistd.h>
  1308. X  #endif
  1309. X  
  1310. X! #ifdef __BORLANDC__
  1311. X  #include <io.h>
  1312. X  #include <dos.h>
  1313. X  #include <process.h>
  1314. X  #endif
  1315. X  
  1316. X--- 27,37 ----
  1317. X  #include <unistd.h>
  1318. X  #endif
  1319. X  
  1320. X! #if defined(__OS2__) || defined(__MSDOS__)
  1321. X  #include <io.h>
  1322. X+ #if defined(__BORLANDC__)
  1323. X  #include <dos.h>
  1324. X+ #endif
  1325. X  #include <process.h>
  1326. X  #endif
  1327. X  
  1328. X***************
  1329. X*** 57,68 ****
  1330. X  PRIVATE QueuedRem *FindNextReminder ARGS ((void));
  1331. X  PRIVATE int CalculateNextTimeUsingSched ARGS ((QueuedRem *q));
  1332. X  
  1333. X- #ifdef __OS2__
  1334. X- void (__cdecl SigIntHandler(int));
  1335. X- #else
  1336. X- PRIVATE void SigIntHandler ARGS ((void));
  1337. X- #endif
  1338. X- 
  1339. X  /***************************************************************/
  1340. X  /*                                                             */
  1341. X  /*  QueueReminder                                              */
  1342. X--- 63,68 ----
  1343. X***************
  1344. X*** 162,175 ****
  1345. X        q = q->next;
  1346. X     }
  1347. X  
  1348. X     if (!DontFork || Daemon) signal(SIGINT, SigIntHandler);
  1349. X  
  1350. X     /* Sit in a loop, issuing reminders when necessary */
  1351. X     while(1) {
  1352. X        q = FindNextReminder();
  1353. X  
  1354. X!       /* If no more reminders to issue, we're unless we're a daemon. */
  1355. X!       if (!q && !Daemon) exit(0);
  1356. X  
  1357. X        if (Daemon && !q)
  1358. X           TimeToSleep = (long) 60*Daemon;
  1359. X--- 162,179 ----
  1360. X        q = q->next;
  1361. X     }
  1362. X  
  1363. X+ #ifdef __BORLANDC__
  1364. X+    signal(SIGINT, SigIntHandler);
  1365. X+ #else
  1366. X     if (!DontFork || Daemon) signal(SIGINT, SigIntHandler);
  1367. X+ #endif
  1368. X  
  1369. X     /* Sit in a loop, issuing reminders when necessary */
  1370. X     while(1) {
  1371. X        q = FindNextReminder();
  1372. X  
  1373. X!       /* If no more reminders to issue, we're done unless we're a daemon. */
  1374. X!       if (!q && !Daemon) break;
  1375. X  
  1376. X        if (Daemon && !q)
  1377. X           TimeToSleep = (long) 60*Daemon;
  1378. X***************
  1379. X*** 195,206 ****
  1380. X--- 199,218 ----
  1381. X        CreateParser(q->text, &p);
  1382. X        trig.typ = q->typ;
  1383. X        RunDisabled = q->RunDisabled;
  1384. X+ #ifdef OS2_POPUP
  1385. X+       (void) TriggerReminder(&p, &trig, &q->tt, JulianToday, 1);
  1386. X+ #else
  1387. X        (void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
  1388. X+ #endif
  1389. X        fflush(stdout);
  1390. X        
  1391. X        /* Calculate the next trigger time */
  1392. X        q->tt.nexttime = CalculateNextTime(q);
  1393. X     }
  1394. X+ #ifdef __BORLANDC__
  1395. X+    signal(SIGINT, SIG_DFL);
  1396. X+ #endif
  1397. X+    exit(0);
  1398. X  }
  1399. X     
  1400. X  
  1401. X***************
  1402. X*** 275,313 ****
  1403. X  
  1404. X  /***************************************************************/
  1405. X  /*                                                             */
  1406. X! /* SigIntHandler                                               */
  1407. X  /*                                                             */
  1408. X! /* For debugging purposes, when sent a SIGINT, we print the    */
  1409. X! /* contents of the queue.  This does NOT work when the -f      */
  1410. X! /* command-line flag is supplied.                              */
  1411. X  /*                                                             */
  1412. X  /***************************************************************/
  1413. X- #ifdef __OS2__
  1414. X- void __cdecl SigIntHandler(int d)
  1415. X- #else
  1416. X  #ifdef HAVE_PROTOS
  1417. X! PRIVATE void SigIntHandler(void)
  1418. X  #else
  1419. X! static void SigIntHandler()
  1420. X  #endif
  1421. X- #endif
  1422. X  {
  1423. X     QueuedRem *q = QueueHead;
  1424. X  
  1425. X- #ifdef SYSV
  1426. X-    signal(SIGINT, SigIntHandler);
  1427. X- #endif
  1428. X- 
  1429. X     printf("Contents of AT queue:%s", NL);
  1430. X  
  1431. X     while (q) {
  1432. X        if (q->tt.nexttime != NO_TIME) {
  1433. X!          printf("Trigger: %02d%c%02d  Activate: %02d%c%02d  Rep: %d  Delta: %d  Sched: %s%s",
  1434. X                   q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
  1435. X                   q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
  1436. X!                  q->tt.rep, q->tt.delta, q->sched, NL);
  1437. X!                  printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
  1438. X!                                    ((q->typ == MSF_TYPE) ? "MSF" :"RUN")),
  1439. X                   q->text,
  1440. X                   NL, NL);
  1441. X        }
  1442. X--- 287,318 ----
  1443. X  
  1444. X  /***************************************************************/
  1445. X  /*                                                             */
  1446. X! /* GotSigInt                               */
  1447. X  /*                                                             */
  1448. X! /* Split out what's done on a SIGINT from the SIGINT Handler.  */
  1449. X! /* This will be necessary for OS/2 multithreaded.           */
  1450. X  /*                                                             */
  1451. X  /***************************************************************/
  1452. X  #ifdef HAVE_PROTOS
  1453. X! void GotSigInt(void)
  1454. X  #else
  1455. X! void GotSigInt()
  1456. X  #endif
  1457. X  {
  1458. X     QueuedRem *q = QueueHead;
  1459. X  
  1460. X     printf("Contents of AT queue:%s", NL);
  1461. X  
  1462. X     while (q) {
  1463. X        if (q->tt.nexttime != NO_TIME) {
  1464. X!          printf("Trigger: %02d%c%02d  Activate: %02d%c%02d  Rep: %d  Delta: %d  Sched: %s",
  1465. X                   q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
  1466. X                   q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
  1467. X!                  q->tt.rep, q->tt.delta, q->sched);
  1468. X!          if (*q->sched) printf("(%d)", q->ntrig+1);
  1469. X!      printf("%s", NL);
  1470. X!          printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
  1471. X!                             ((q->typ == MSF_TYPE) ? "MSF" :"RUN")),
  1472. X                   q->text,
  1473. X                   NL, NL);
  1474. X        }
  1475. X***************
  1476. X*** 315,320 ****
  1477. X--- 320,326 ----
  1478. X     }
  1479. X     printf(NL);
  1480. X  }
  1481. X+ 
  1482. X  /***************************************************************/
  1483. X  /*                                                             */
  1484. X  /*  CheckInitialFile                                           */
  1485. X***************
  1486. X*** 384,390 ****
  1487. X          ThisTime = q->tt.ttime + v.v.val;
  1488. X  
  1489. X        } else {
  1490. X!          DestroyValue(&v);
  1491. X       q->sched[0] = 0;
  1492. X       return NO_TIME;
  1493. X        }
  1494. X--- 390,396 ----
  1495. X          ThisTime = q->tt.ttime + v.v.val;
  1496. X  
  1497. X        } else {
  1498. X!          DestroyValue(v);
  1499. X       q->sched[0] = 0;
  1500. X       return NO_TIME;
  1501. X        }
  1502. X***************
  1503. X*** 399,401 ****
  1504. X--- 405,409 ----
  1505. X        q->ntrig++;
  1506. X     }
  1507. X  }
  1508. X+ 
  1509. X+ #endif /* HAVE_QUEUED from way at the top */
  1510. X*** ../prev/remind.1    Wed Oct 20 13:27:12 1993
  1511. X--- ./remind.1    Mon Nov 15 15:19:08 1993
  1512. X***************
  1513. X*** 610,616 ****
  1514. X  It is used in calendar mode and when sorting reminders.  If two reminders
  1515. X  have the same trigger date and time, then they are sorted by priority.
  1516. X  If the \fBPRIORITY\fR keyword is not supplied, a default priority of 5000
  1517. X! is used.
  1518. X  .PP
  1519. X  .B EXPIRY DATES
  1520. X  .PP
  1521. X--- 610,618 ----
  1522. X  It is used in calendar mode and when sorting reminders.  If two reminders
  1523. X  have the same trigger date and time, then they are sorted by priority.
  1524. X  If the \fBPRIORITY\fR keyword is not supplied, a default priority of 5000
  1525. X! is used.  (This default can be changed by adjusting the system variable
  1526. X! \fB$DefaultPrio\fR.  See the section "System Variables" for more
  1527. X! information.)
  1528. X  .PP
  1529. X  .B EXPIRY DATES
  1530. X  .PP
  1531. X***************
  1532. X*** 1534,1539 ****
  1533. X--- 1536,1548 ----
  1534. X  minutes between wakeups.  If not running in daemon mode, contains
  1535. X  0.  For the MS-DOS version, always contains 0.
  1536. X  .TP
  1537. X+ .B $DefaultPrio
  1538. X+ The default priority assigned to reminders without a \fBPRIORITY\fR
  1539. X+ clause.  You can set this as required to adjust the priorities of
  1540. X+ blocks of reminders without having to type priorities for individual
  1541. X+ reminders.  At startup, \fB$DefaultPrio\fR is set to 5000; it can range
  1542. X+ from 0 to 9999.
  1543. X+ .TP
  1544. X  .B $DontFork (read-only)
  1545. X  If non-zero, then the \fB\-c\fR option was supplied on the command line.
  1546. X  For the MS-DOS version, always contains 1.
  1547. X***************
  1548. X*** 2155,2166 ****
  1549. SHAR_EOF
  1550. echo "End of Remind-3.0/Patch-11/part part 2"
  1551. echo "File patch.11 is continued in part 3"
  1552. echo "3" > shar3_seq_.tmp
  1553. exit 0
  1554.  
  1555.  
  1556.  
  1557. exit 0 # Just in case...
  1558.