home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / os2 / remind / src / patches.os2 < prev    next >
Encoding:
Text File  |  1993-11-05  |  41.4 KB  |  1,480 lines

  1. diff -c remind-3.0.10/config.h new/config.h
  2. *** remind-3.0.10/config.h    Wed Oct 13 07:47:46 1993
  3. --- new/config.h    Sun Oct 31 20:46:00 1993
  4. ***************
  5. *** 169,179 ****
  6.   /*---------------------------------------------------------------------*/
  7.   /* Do we handle queued reminders?                                      */
  8.   /*---------------------------------------------------------------------*/
  9. ! #ifdef UNIX
  10. ! #define HAVE_QUEUED 1
  11. ! #endif
  12. ! #if defined(__BORLANDC__) && defined(__OS2__)
  13.   #define HAVE_QUEUED 1
  14.   #endif
  15.   
  16. --- 169,175 ----
  17.   /*---------------------------------------------------------------------*/
  18.   /* Do we handle queued reminders?                                      */
  19.   /*---------------------------------------------------------------------*/
  20. ! #if defined(UNIX) || defined(__OS2__)
  21.   #define HAVE_QUEUED 1
  22.   #endif
  23.   
  24. diff -c remind-3.0.10/dorem.c new/dorem.c
  25. *** remind-3.0.10/dorem.c    Wed Oct 20 09:14:48 1993
  26. --- new/dorem.c    Sun Oct 31 20:45:50 1993
  27. ***************
  28. *** 88,95 ****
  29.   
  30.   
  31.      if (ShouldTriggerReminder(&trig, &tim, jul)) {
  32. !       if ( (r=TriggerReminder(p, &trig, &tim, jul)) ) return r;
  33.      }
  34.   
  35.      return OK;
  36.   }   
  37. --- 88,97 ----
  38.   
  39.   
  40.      if (ShouldTriggerReminder(&trig, &tim, jul)) {
  41. !       if ( (r=TriggerReminder(p, &trig, &tim, jul, 0)) ) {
  42. !      return r;
  43.      }
  44. +    }
  45.   
  46.      return OK;
  47.   }   
  48. ***************
  49. *** 445,457 ****
  50.   /*                                                             */
  51.   /***************************************************************/
  52.   #ifdef HAVE_PROTOS
  53. ! PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
  54.   #else
  55. ! int TriggerReminder(p, t, tim, jul)
  56.   ParsePtr p;
  57.   Trigger *t;
  58.   TimeTrig *tim;
  59.   int jul;
  60.   #endif
  61.   {
  62.      int r, y, m, d;
  63. --- 447,461 ----
  64.   /*                                                             */
  65.   /***************************************************************/
  66.   #ifdef HAVE_PROTOS
  67. ! PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul,
  68. !                int AsPopUp)
  69.   #else
  70. ! int TriggerReminder(p, t, tim, jul, AsPopUp)
  71.   ParsePtr p;
  72.   Trigger *t;
  73.   TimeTrig *tim;
  74.   int jul;
  75. + int AsPopUp
  76.   #endif
  77.   {
  78.      int r, y, m, d;
  79. ***************
  80. *** 468,475 ****
  81.      if ((t->typ == MSG_TYPE || t->typ == MSF_TYPE) 
  82.          && !NumTriggered && !NextMode && !MsgCommand) {
  83.         if (!DoSubstFromString(Banner, SubstBuffer, JulianToday, NO_TIME) && *SubstBuffer)
  84. ! #ifdef __OS2__
  85.               PutlPopUp(SubstBuffer);
  86.   #else
  87.           printf("%s\n", SubstBuffer);
  88.   #endif
  89. --- 472,482 ----
  90.      if ((t->typ == MSG_TYPE || t->typ == MSF_TYPE) 
  91.          && !NumTriggered && !NextMode && !MsgCommand) {
  92.         if (!DoSubstFromString(Banner, SubstBuffer, JulianToday, NO_TIME) && *SubstBuffer)
  93. ! #ifdef OS2_POPUP
  94. !         if (AsPopUp)
  95.               PutlPopUp(SubstBuffer);
  96. +         else
  97. +            printf("%s\n", SubstBuffer);
  98.   #else
  99.           printf("%s\n", SubstBuffer);
  100.   #endif
  101. ***************
  102. *** 481,492 ****
  103.         if ( (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) ) return r;
  104.         if (!*SubstBuffer) return OK;
  105.         FromJulian(jul, &y, &m, &d);
  106. ! #ifdef __OS2__
  107.         sprintf(buf, "%04d%c%02d%c%02d %s", y, DATESEP, m+1, DATESEP, d,
  108.                       SimpleTime(tim->ttime, NULL));
  109.         StartPopUp();
  110.         PutsPopUp(buf);
  111.         PutlPopUp(SubstBuffer);
  112.   #else
  113.         printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
  114.                                         SimpleTime(tim->ttime, NULL),
  115. --- 488,505 ----
  116.         if ( (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) ) return r;
  117.         if (!*SubstBuffer) return OK;
  118.         FromJulian(jul, &y, &m, &d);
  119. ! #ifdef OS2_POPUP
  120. !       if (AsPopUp) {
  121.         sprintf(buf, "%04d%c%02d%c%02d %s", y, DATESEP, m+1, DATESEP, d,
  122.                       SimpleTime(tim->ttime, NULL));
  123.         StartPopUp();
  124.         PutsPopUp(buf);
  125.         PutlPopUp(SubstBuffer);
  126. +       }
  127. +       else
  128. +       printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
  129. +                       SimpleTime(tim->ttime, NULL),
  130. +                       SubstBuffer);
  131.   #else
  132.         printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
  133.                                         SimpleTime(tim->ttime, NULL),
  134. ***************
  135. *** 524,533 ****
  136.        DestroyValue(&v);
  137.         }
  138.      }
  139. ! #ifndef __OS2__
  140.      if (t->typ == MSG_TYPE || t->typ == MSF_TYPE) {
  141.   #else
  142. !    if (t->typ == MSF_TYPE) {
  143.   #endif
  144.         *s2++ = '\n';
  145.      }
  146. --- 537,550 ----
  147.        DestroyValue(&v);
  148.         }
  149.      }
  150. ! #if 0
  151. ! #ifdef OS2_POPUP
  152. !    if (t->typ == MSF_TYPE) {
  153. ! #else
  154.      if (t->typ == MSG_TYPE || t->typ == MSF_TYPE) {
  155. + #endif
  156.   #else
  157. !    if (t->typ == MSG_TYPE || t->typ == MSF_TYPE) {
  158.   #endif
  159.         *s2++ = '\n';
  160.      }
  161. ***************
  162. *** 549,556 ****
  163.               sprintf(SubstBuffer, MsgCommand, buf);
  164.           system(SubstBuffer);
  165.            } else {
  166. ! #ifdef __OS2__
  167.               PutlPopUp(buf);
  168.   #else
  169.               printf("%s", buf);
  170.   #endif
  171. --- 566,576 ----
  172.               sprintf(SubstBuffer, MsgCommand, buf);
  173.           system(SubstBuffer);
  174.            } else {
  175. ! #ifdef OS2_POPUP
  176. !         if (AsPopUp)
  177.               PutlPopUp(buf);
  178. +         else
  179. +            printf("%s", buf);
  180.   #else
  181.               printf("%s", buf);
  182.   #endif
  183. ***************
  184. *** 558,569 ****
  185.        break;
  186.   
  187.         case MSF_TYPE:
  188. ! #ifdef __OS2__
  189.            StartPopUp();
  190. ! #endif
  191. !          FillParagraph(buf);
  192. ! #ifdef __OS2__
  193.            EndPopUp();
  194.   #endif
  195.        break;
  196.   
  197. --- 578,593 ----
  198.        break;
  199.   
  200.         case MSF_TYPE:
  201. ! #ifdef OS2_POPUP
  202. !      if (AsPopUp) {
  203.            StartPopUp();
  204. !          FillParagraph(buf, 1);
  205.            EndPopUp();
  206. +      }else{
  207. +          FillParagraph(buf, 0);
  208. +      }
  209. + #else
  210. +      FillParagraph(buf, 0);
  211.   #endif
  212.        break;
  213.   
  214. diff -c remind-3.0.10/files.c new/files.c
  215. *** remind-3.0.10/files.c    Wed Oct 13 07:38:24 1993
  216. --- new/files.c    Sun Oct 31 20:45:52 1993
  217. ***************
  218. *** 25,31 ****
  219.   #include <sys/stat.h>
  220.   #include <time.h>
  221.   
  222. ! #if defined(__MSDOS__) || defined(OS2)
  223.   #include <io.h>
  224.   #endif
  225.   
  226. --- 25,31 ----
  227.   #include <sys/stat.h>
  228.   #include <time.h>
  229.   
  230. ! #if defined(__MSDOS__)
  231.   #include <io.h>
  232.   #endif
  233.   
  234. ***************
  235. *** 444,450 ****
  236.   /*  file.  Not needed for UNIX.                                */
  237.   /*                                                             */
  238.   /***************************************************************/
  239. ! #if defined(__MSDOS__) || defined(OS2)
  240.   /*
  241.    * WARNING WARNING WARNING WARNING
  242.    * In the version of Turbo C which I have, there is a bug in the
  243. --- 444,450 ----
  244.   /*  file.  Not needed for UNIX.                                */
  245.   /*                                                             */
  246.   /***************************************************************/
  247. ! #if defined(__MSDOS__)
  248.   /*
  249.    * WARNING WARNING WARNING WARNING
  250.    * In the version of Turbo C which I have, there is a bug in the
  251. diff -c remind-3.0.10/funcs.c new/funcs.c
  252. *** remind-3.0.10/funcs.c    Fri Oct 15 09:34:34 1993
  253. --- new/funcs.c    Fri Nov 05 18:43:04 1993
  254. ***************
  255. *** 30,36 ****
  256.   #include <sys/types.h>
  257.   #include <sys/stat.h>
  258.   #include <time.h>
  259. ! #if defined(__MSDOS__) || defined(OS2)
  260.   #include <io.h>
  261.   #define R_OK 4
  262.   #define W_OK 2
  263. --- 30,36 ----
  264.   #include <sys/types.h>
  265.   #include <sys/stat.h>
  266.   #include <time.h>
  267. ! #if defined(__MSDOS__) || defined(__OS2__)
  268.   #include <io.h>
  269.   #define R_OK 4
  270.   #define W_OK 2
  271. ***************
  272. *** 118,126 ****
  273.   PRIVATE int    CleanUpAfterFunc ARGS ((void));
  274.   PRIVATE int    SunStuff    ARGS ((int rise, double cosz, int jul));
  275.   
  276. ! #if defined(__MSDOS__) || defined(OS2)
  277. ! PRIVATE FILE *popen  ARGS((char *cmd, char *mode));
  278. ! PRIVATE int   pclose ARGS((FILE *fp));
  279.   #endif
  280.   
  281.   /* "Overload" the struct Operator definition */
  282. --- 118,138 ----
  283.   PRIVATE int    CleanUpAfterFunc ARGS ((void));
  284.   PRIVATE int    SunStuff    ARGS ((int rise, double cosz, int jul));
  285.   
  286. ! #if defined(__MSDOS__) || defined(__BORLANDC__)
  287. ! PRIVATE FILE *os_popen  ARGS((char *cmd, char *mode));
  288. ! PRIVATE int   os_pclose ARGS((FILE *fp));
  289. ! #define POPEN os_popen
  290. ! #define PCLOSE os_pclose
  291. ! #if defined(_MSC_VER)
  292. ! #define popen _popen
  293. ! #define pclose _pclose
  294. ! #endif
  295. ! #elif defined(_MSC_VER)
  296. ! #define POPEN _popen
  297. ! #define PCLOSE _pclose
  298. ! #else
  299. ! #define POPEN popen
  300. ! #define PCLOSE pclose
  301.   #endif
  302.   
  303.   /* "Overload" the struct Operator definition */
  304. ***************
  305. *** 930,941 ****
  306.   #ifdef UNIX
  307.      return RetStrVal("UNIX");
  308.   #else
  309. - #ifdef __MSC__
  310. -     if (_osmode == OS2_MODE)
  311. -         return RetStrVal("OS/2");
  312. - #endif
  313.   #ifdef __OS2__
  314. !    return RetStrVal("OS/2");
  315.   #else
  316.      return RetStrVal("MSDOS");
  317.   #endif
  318. --- 942,949 ----
  319.   #ifdef UNIX
  320.      return RetStrVal("UNIX");
  321.   #else
  322.   #ifdef __OS2__
  323. !    return RetStrVal(OS2MODE ? "OS/2" : "MSDOS");
  324.   #else
  325.      return RetStrVal("MSDOS");
  326.   #endif
  327. ***************
  328. *** 1248,1254 ****
  329.      if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
  330.      s = buf;
  331.      len = 0;
  332. !    fp = popen(ARG(0).v.str, "r");
  333.      if (!fp) return E_IO_ERR;
  334.      while (len < SHELLSIZE) {
  335.         ch = getc(fp);
  336. --- 1256,1262 ----
  337.      if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
  338.      s = buf;
  339.      len = 0;
  340. !    fp = POPEN(ARG(0).v.str, "r");
  341.      if (!fp) return E_IO_ERR;
  342.      while (len < SHELLSIZE) {
  343.         ch = getc(fp);
  344. ***************
  345. *** 1263,1272 ****
  346.   
  347.      /* Delete trailing newline (converted to space) */
  348.      if (s > buf && *(s-1) == ' ') *(s-1) = 0;
  349. ! #if defined(__MSDOS__) || defined(OS2)
  350.      if (s-1 > buf && *(s-2) == ' ') *(s-2) = 0;
  351.   #endif
  352. !    pclose(fp);
  353.      return RetStrVal(buf);
  354.   }
  355.   
  356. --- 1271,1280 ----
  357.   
  358.      /* Delete trailing newline (converted to space) */
  359.      if (s > buf && *(s-1) == ' ') *(s-1) = 0;
  360. ! #if defined(__MSDOS__) || defined(__OS2__)
  361.      if (s-1 > buf && *(s-2) == ' ') *(s-2) = 0;
  362.   #endif
  363. !    PCLOSE(fp);
  364.      return RetStrVal(buf);
  365.   }
  366.   
  367. ***************
  368. *** 1438,1454 ****
  369.      char TmpBuf[LINELEN];  /* Should be _POSIX_PATH_MAX ? */
  370.      char *s;
  371.   
  372. - #if defined(__MSDOS__) || defined(OS2)
  373. - #define PATHSEP '\\'
  374. - #else
  375. - #define PATHSEP '/'
  376. - #endif
  377.      strcpy(TmpBuf, FileName);
  378.      s = TmpBuf + strlen(TmpBuf) - 1;
  379.      if (s < TmpBuf) return RetStrVal(".");
  380. !    while (s > TmpBuf && *s != PATHSEP) s--;
  381. !    if (*s == PATHSEP) {
  382.            *s = 0;
  383.        return RetStrVal(TmpBuf);
  384.      } else return RetStrVal(".");
  385. --- 1446,1463 ----
  386.      char TmpBuf[LINELEN];  /* Should be _POSIX_PATH_MAX ? */
  387.      char *s;
  388.   
  389.      strcpy(TmpBuf, FileName);
  390.      s = TmpBuf + strlen(TmpBuf) - 1;
  391.      if (s < TmpBuf) return RetStrVal(".");
  392. ! #if defined(__OS2__) || defined(__MSDOS__)
  393. !    /* Both '\\' and '/' can be part of path; handle drive letters. */
  394. !    while (s > TmpBuf && !strchr("\\/:", *s)) s--;
  395. !    if (*s == ':') { s[1] = '.'; s += 2; }
  396. !    if (s > TmpBuf) *s = '/';
  397. ! #else
  398. !    while (s > TmpBuf && *s != '/') s--;
  399. ! #endif
  400. !    if (*s == '/') {
  401.            *s = 0;
  402.        return RetStrVal(TmpBuf);
  403.      } else return RetStrVal(".");
  404. ***************
  405. *** 1492,1498 ****
  406.      return OK;
  407.   }
  408.   
  409. ! #if defined(__MSDOS__) || defined(OS2)
  410.   /***************************************************************/
  411.   /*                                                             */
  412.   /*  popen and pclose                                           */
  413. --- 1501,1507 ----
  414.      return OK;
  415.   }
  416.   
  417. ! #if defined(__MSDOS__) || defined(__BORLANDC__)
  418.   /***************************************************************/
  419.   /*                                                             */
  420.   /*  popen and pclose                                           */
  421. ***************
  422. *** 1509,1522 ****
  423.   
  424.   static char *TmpFile;
  425.   #ifdef HAVE_PROTOS
  426. ! PRIVATE FILE *popen(char *cmd, char *mode)
  427.   #else
  428. ! static FILE *popen(cmd, mode)
  429.   char *cmd, *mode;
  430.   #endif
  431.   {
  432.      char *s;
  433.   
  434.      TmpFile = tmpnam(NULL);
  435.      if (!TmpFile) return NULL;
  436.      s = (char *) malloc(strlen(cmd) + 3 + strlen(TmpFile) + 1);
  437. --- 1518,1536 ----
  438.   
  439.   static char *TmpFile;
  440.   #ifdef HAVE_PROTOS
  441. ! PRIVATE FILE *os_popen(char *cmd, char *mode)
  442.   #else
  443. ! static FILE *os_popen(cmd, mode)
  444.   char *cmd, *mode;
  445.   #endif
  446.   {
  447.      char *s;
  448.   
  449. + #if defined(__OS2__) && !defined(__BORLANDC__)
  450. +    if (OS2MODE)
  451. +      return(popen(cmd, mode));
  452. + #endif
  453.      TmpFile = tmpnam(NULL);
  454.      if (!TmpFile) return NULL;
  455.      s = (char *) malloc(strlen(cmd) + 3 + strlen(TmpFile) + 1);
  456. ***************
  457. *** 1530,1541 ****
  458.   }
  459.   
  460.   #ifdef HAVE_PROTOS
  461. ! PRIVATE int pclose(FILE *fp)
  462.   #else
  463. ! static int pclose(fp)
  464.   FILE *fp;
  465.   #endif
  466.   {
  467.      unlink(TmpFile);
  468.      return fclose(fp);
  469.   }
  470. --- 1544,1560 ----
  471.   }
  472.   
  473.   #ifdef HAVE_PROTOS
  474. ! PRIVATE int os_pclose(FILE *fp)
  475.   #else
  476. ! static int os_pclose(fp)
  477.   FILE *fp;
  478.   #endif
  479.   {
  480. + #if defined(__OS2__) && !defined(__BORLANDC__)
  481. +   if (OS2MODE)
  482. +     return(pclose(fp));
  483. + #endif
  484.      unlink(TmpFile);
  485.      return fclose(fp);
  486.   }
  487. diff -c remind-3.0.10/globals.h new/globals.h
  488. *** remind-3.0.10/globals.h    Tue Oct 12 13:22:42 1993
  489. --- new/globals.h    Sun Oct 31 20:46:00 1993
  490. ***************
  491. *** 141,143 ****
  492. --- 141,154 ----
  493.     }
  494.   #endif
  495.   ;
  496. + #if defined(__OS2__)
  497. + #if defined(_MSC_VER) || defined(__EMX__)
  498. + #define OS2MODE (_osmode == OS2_MODE)
  499. + #define DOSMODE (_osmode == DOS_MODE)
  500. + #else
  501. + #define OS2MODE 1
  502. + #define DOSMODE 0
  503. + #endif
  504. + #endif
  505. diff -c remind-3.0.10/init.c new/init.c
  506. *** remind-3.0.10/init.c    Tue Oct 12 13:22:44 1993
  507. --- new/init.c    Sun Oct 31 20:45:54 1993
  508. ***************
  509. *** 128,133 ****
  510. --- 128,138 ----
  511.      NumQueued = 0;
  512.      DontIssueAts = 0;
  513.      Daemon = 0;
  514. + #elif defined(_MSC_VER) || defined(__BORLANDC__)
  515. +    DontFork = 1;
  516. + #elif defined(__OS2__) && defined (__MSDOS__)
  517. +    if (DOSMODE)
  518. +      DontFork = 1;
  519.   #endif
  520.   
  521.      /* Parse the command-line options */
  522. diff -c remind-3.0.10/main.c new/main.c
  523. *** remind-3.0.10/main.c    Thu Oct 14 08:27:42 1993
  524. --- new/main.c    Sun Oct 31 20:45:56 1993
  525. ***************
  526. *** 20,25 ****
  527. --- 20,26 ----
  528.   #include <unistd.h>
  529.   #endif
  530.   #include <stdio.h>
  531. + #include <signal.h>
  532.   #include <string.h>
  533.   #ifdef HAVE_STDARG
  534.   #include <stdarg.h>
  535. ***************
  536. *** 55,67 ****
  537.   static char TPushBuffer[TOKSIZE+1]; /* Buffer for pushing back a token. */
  538.   static char *TokenPushed = NULL;
  539.   
  540. ! #ifdef __OS2__
  541. ! #ifdef putchar
  542. ! #undef putchar
  543. ! #endif
  544. ! #define putchar(c) PutcPopUp(c)
  545.   #endif
  546.   
  547.   /***************************************************************/
  548.   /***************************************************************/
  549.   /**                                                           **/
  550. --- 56,68 ----
  551.   static char TPushBuffer[TOKSIZE+1]; /* Buffer for pushing back a token. */
  552.   static char *TokenPushed = NULL;
  553.   
  554. ! #ifdef OS2_POPUP
  555. ! #define Putchar(c) {if (AsPopUp) PutcPopUp(c); else putchar(c);}
  556. ! #else
  557. ! #define Putchar(c) putchar(c)
  558.   #endif
  559.   
  560.   /***************************************************************/
  561.   /***************************************************************/
  562.   /**                                                           **/
  563. ***************
  564. *** 118,125 ****
  565.   #endif
  566.         }
  567.   
  568. !    /* If it's MS-DOS or OS2, reset the file access date */
  569. ! #if defined(__MSDOS__) || defined(OS2)
  570.         if (!UseStdin && (RealToday == JulianToday))
  571.            SetAccessDate(InitialFile, RealToday);
  572.   #endif
  573. --- 119,128 ----
  574.   #endif
  575.         }
  576.   
  577. !    /* If it's MS-DOS, reset the file access date.           */
  578. !    /* Note that OS/2 and DOS bound programs have __MSDOS__  */
  579. !    /* defined, so this test should probably be modified.    */
  580. ! #if defined(__MSDOS__)
  581.         if (!UseStdin && (RealToday == JulianToday))
  582.            SetAccessDate(InitialFile, RealToday);
  583.   #endif
  584. ***************
  585. *** 1246,1255 ****
  586.   #define ISBLANK(c) (isspace(c) && (c) != '\n')
  587.   
  588.   #ifdef HAVE_PROTOS
  589. ! PUBLIC void FillParagraph(char *s)
  590.   #else
  591. ! void FillParagraph(s)
  592.   char *s;
  593.   #endif
  594.   {
  595.   
  596. --- 1249,1259 ----
  597.   #define ISBLANK(c) (isspace(c) && (c) != '\n')
  598.   
  599.   #ifdef HAVE_PROTOS
  600. ! PUBLIC void FillParagraph(char *s, int AsPopUp)
  601.   #else
  602. ! void FillParagraph(s, AsPopUp)
  603.   char *s;
  604. + int AsPopUp;
  605.   #endif
  606.   {
  607.   
  608. ***************
  609. *** 1272,1278 ****
  610.   
  611.         /* If it's a carriage return, output it and start new paragraph */
  612.         if (*s == '\n') {
  613. !          putchar('\n');
  614.        s++;
  615.        line = 0;
  616.        while(ISBLANK(*s)) s++;
  617. --- 1276,1282 ----
  618.   
  619.         /* If it's a carriage return, output it and start new paragraph */
  620.         if (*s == '\n') {
  621. !      Putchar('\n');
  622.        s++;
  623.        line = 0;
  624.        while(ISBLANK(*s)) s++;
  625. ***************
  626. *** 1284,1290 ****
  627.         /* Over here, we're at the beginning of a line.  Emit the correct
  628.            number of spaces */
  629.         j = line ? SubsIndent : FirstIndent;
  630. !       for (i=0; i<j; i++) putchar(' ');
  631.   
  632.         /* Calculate the amount of room left on this line */
  633.         roomleft = FormWidth - j;
  634. --- 1288,1296 ----
  635.         /* Over here, we're at the beginning of a line.  Emit the correct
  636.            number of spaces */
  637.         j = line ? SubsIndent : FirstIndent;
  638. !       for (i=0; i<j; i++) {
  639. !       Putchar(' ');
  640. !         }
  641.   
  642.         /* Calculate the amount of room left on this line */
  643.         roomleft = FormWidth - j;
  644. ***************
  645. *** 1301,1309 ****
  646.           return;
  647.            }
  648.        if (!pendspace || len+pendspace <= roomleft) {
  649. !             for (i=0; i<pendspace; i++) putchar(' ');
  650.              while(t < s) {
  651. !            putchar(*t);
  652.              if (strchr(EndSent, *t)) doublespace = 2;
  653.              else if (!strchr(EndSentIg, *t)) doublespace = 1;
  654.              t++;
  655. --- 1307,1317 ----
  656.           return;
  657.            }
  658.        if (!pendspace || len+pendspace <= roomleft) {
  659. !         for (i=0; i<pendspace; i++) {
  660. !            Putchar(' ');
  661. !         }
  662.              while(t < s) {
  663. !            Putchar(*t);
  664.              if (strchr(EndSent, *t)) doublespace = 2;
  665.              else if (!strchr(EndSentIg, *t)) doublespace = 1;
  666.              t++;
  667. ***************
  668. *** 1310,1316 ****
  669.               }
  670.            } else {
  671.           s = t;
  672. !         putchar('\n');
  673.           line++;
  674.           break;
  675.            }
  676. --- 1318,1324 ----
  677.               }
  678.            } else {
  679.           s = t;
  680. !         Putchar('\n');
  681.           line++;
  682.           break;
  683.            }
  684. ***************
  685. *** 1459,1461 ****
  686. --- 1467,1506 ----
  687.      *locdate = utcdate;
  688.      *loctime = utctime;
  689.   }
  690. + /***************************************************************/
  691. + /*                                   */
  692. + /* SigIntHandler                           */
  693. + /*                                   */
  694. + /* For debugging purposes, when sent a SIGINT, we print the    */
  695. + /* contents of the queue.  This does NOT work when the -f      */
  696. + /* command-line flag is supplied.                   */
  697. + /*                                   */
  698. + /* For OS/2, this has to be in the main thread.            */
  699. + /*                                   */
  700. + /***************************************************************/
  701. + #ifdef __BORLANDC__
  702. + void __cdecl SigIntHandler(int d)
  703. + #else
  704. + #ifdef HAVE_PROTOS
  705. + void SigIntHandler(void)
  706. + #else
  707. + void SigIntHandler()
  708. + #endif
  709. + #endif
  710. + {
  711. + #ifdef SYSV
  712. +    signal(SIGINT, SigIntHandler);
  713. + #else
  714. + #ifdef __BORLANDC__
  715. +    signal(SIGINT, SIG_DFL);
  716. + #else
  717. + #ifdef __OS2__
  718. +    signal(SIGINT, SIG_ACK);
  719. + #endif
  720. + #endif
  721. + #endif
  722. +    GotSigInt();
  723. +    exit(0);
  724. + }
  725. diff -c remind-3.0.10/makefile.bcc new/makefile.bcc
  726. *** remind-3.0.10/makefile.bcc    Wed Oct 13 08:21:02 1993
  727. --- new/makefile.bcc    Sun Oct 31 20:45:48 1993
  728. ***************
  729. *** 5,11 ****
  730.   MODEL=l
  731.   
  732.   !if $d(__OS2__)
  733. ! CFLAGS= -DOS2 -w-pia -O2
  734.   BINDIR= ..\OS2-EX
  735.   DELFLAG= /f
  736.   !else
  737. --- 5,11 ----
  738.   MODEL=l
  739.   
  740.   !if $d(__OS2__)
  741. ! CFLAGS= -DOS2_POPUP -w-pia -O2
  742.   BINDIR= ..\OS2-EX
  743.   DELFLAG= /f
  744.   !else
  745. diff -c remind-3.0.10/makefile.os2 new/makefile.os2
  746. *** remind-3.0.10/makefile.os2    Tue Oct 12 13:28:52 1993
  747. --- new/makefile.os2    Sun Oct 31 20:45:50 1993
  748. ***************
  749. *** 1,41 ****
  750. ! # Makefile for REMIND for Microsoft C 6.00A for OS/2 and MSDOS
  751. ! # This copy was modified from the original to permit creation of 
  752. ! #   remind.exe   OS/2 1.x--2.0 executable
  753. ! #   remindb.exe  OS/2 and MSDOS bound executable
  754.   #
  755. ! # Darrel Hankerson hank@ducvax.auburn.edu
  756. ! # 11 November 1992
  757.   
  758. ! O = .obj
  759. ! CC= cl
  760. ! # Put any additional flags for the C compiler here
  761. ! MODEL = S
  762. ! DEFINES= -D__MSDOS__ -D__MSC__ -D__STDC__ -DOS2
  763. ! CFLAGS= -A$(MODEL) $(DEFINES)
  764. ! LINK = cl
  765. ! LFLAGS = -A$(MODEL) -Lp
  766. ! BIND = bind
  767. ! all: remind.exe remindb.exe rem2ps.exe
  768.   
  769. ! #-----------------------------------------------------------------------------
  770. ! # YOU SHOULDN'T EDIT ANYTHING BELOW HERE.  You may want to change some things
  771. ! # in config.h; then, you should be able to type 'make'.
  772. ! #-----------------------------------------------------------------------------
  773. ! VERSION= 03.00.10
  774.   
  775.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  776. ! lang.h english.h german.h dutch.h finish.h french.h norwgian.h
  777.   
  778.   STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  779.   
  780.   LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  781.   
  782. ! SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
  783. ! main.c moon.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
  784.   
  785.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  786.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  787. --- 1,57 ----
  788. ! # Makefile for REMIND
  789.   #
  790. ! # - for GNU gcc (emx 0.8g kit) [executables for OS/2 2.x or DOS (32-bit)]
  791. ! # - for Microsoft C 6.00A      [executables for OS/2 or MSDOS (16-bit)]
  792.   
  793. ! # To use, enter "make -f Makefile.os2" (this makefile depends on its
  794. ! # name being "Makefile.os2").
  795. ! #
  796. ! # Tested with dmake 3.8 and GNU make 3.68 under OS/2
  797.   
  798. ! default:
  799. !     @echo "Enter $(MAKE) -f Makefile.os2 target                     "
  800. !     @echo " where 'target' is chosen from                          " 
  801. !     @echo "   msc      OS/2 exe [Microsoft C 6.00a]                "
  802. !     @echo "   mscbnd   OS/2 and DOS exe [Microsoft C 6.00a]        "
  803. !     @echo "   emx      OS/2 and DOS 32-bit exe [EMX/gcc]           "
  804. ! msc: 
  805. !     $(MAKE) -f Makefile.os2 all \
  806. !     CC="cl -nologo -AM" O=".obj" \
  807. !     CFLAGS="-D__STDC__ -D__OS2__" \
  808. !     LFLAGS="-Lp" \
  809. !     LFLAGS2="setargv.obj remind.def -link /NOE"
  810. ! mscbnd: 
  811. !     $(MAKE) -f Makefile.os2 all \
  812. !     CC="cl -nologo -AM" O=".obj" \
  813. !     CFLAGS="-D__STDC__ -D__OS2__ -D__MSDOS__" \
  814. !     LFLAGS="-Lp" LBIND="-Fb" \
  815. !     LFLAGS2="setargv.obj remind.def -link /NOE" \
  816. !     BIND="bind remind /n DOSMAKEPIPE DOSCWAIT VIOENDPOPUP VIOPOPUP"
  817. ! emx:  
  818. !     $(MAKE) -f Makefile.os2 all \
  819. !     CC="gcc -O -s" O=".o" \
  820. !     CFLAGS="-D__OS2__ -D__MSDOS__" \
  821. !     LFLAGS=""
  822. ! # OS2_POPUP enables Russ Herman's popup reminders
  823. ! #OS2_POPUP =
  824. ! OS2_POPUP = -DOS2_POPUP
  825.   
  826.   HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
  827. ! lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
  828.   
  829.   STDHDRS= config.h types.h protos.h globals.h err.h lang.h
  830.   
  831.   LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
  832.   
  833. ! SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c hbcal.c \
  834. ! init.c main.c moon.c omit.c sort.c queue.c token.c trigger.c userfns.c \
  835. ! utils.c var.c os2func.c
  836.   
  837.   MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
  838.   remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
  839. ***************
  840. *** 47,75 ****
  841.   
  842.   OBJS= $(SRCS:.c=$O)
  843.   
  844. ! rem2ps.exe: rem2ps.obj remind.def
  845. !     copy remind.def rem2ps.def
  846. !     $(LINK) -o $@ $(LFLAGS) $<
  847.   
  848. ! rem2ps.obj: rem2ps.c rem2ps.h lang.h config.h
  849. !     $(CC) -c $(CFLAGS) rem2ps.c
  850.   
  851. ! remind.exe: $(OBJS) remind.def
  852. !     $(LINK) -o $@ $(LFLAGS) $< 
  853.   
  854. ! remindb.exe: remind.exe
  855. !     $(BIND) -o $@ $<
  856.   
  857. ! rem2psb.exe: rem2ps.exe
  858. !     $(BIND) -o $@ $<
  859.   
  860. ! .c.$O:
  861. !     $(CC) -c $(CFLAGS) $<
  862.   
  863. ! clean:
  864. !     rm -f *$O
  865.   
  866. ! rem2ps$O: rem2ps.c rem2ps.h config.h
  867.   calendar$O: calendar.c $(STDHDRS) expr.h
  868.   dorem$O: dorem.c $(STDHDRS) expr.h
  869.   dosubst$O: dosubst.c $(STDHDRS) $(LANGHDRS)
  870. --- 63,90 ----
  871.   
  872.   OBJS= $(SRCS:.c=$O)
  873.   
  874. ! all: remind.exe rem2ps.exe
  875.   
  876. ! .c$O:
  877. !     $(CC) -c $(CFLAGS) $(OS2_POPUP) $*.c
  878.   
  879. ! rem2ps.exe: rem2ps$O
  880. !     $(CC) $(LFLAGS) $(LBIND) -o $@ rem2ps$O $(LFLAGS2)
  881.   
  882. ! remind.exe: $(OBJS)
  883. !     $(CC) $(LFLAGS) -o $@ $(OBJS) $(LFLAGS2)
  884. !     $(BIND)
  885.   
  886. ! clean:
  887. !     rm -f *.o *.obj *~ core *.bak
  888.   
  889. ! clobber:
  890. !     rm -f *.o *.obj *~ remind.exe rem2ps.exe test.out core *.bak
  891.   
  892. ! test:
  893. !     test-rem.cmd
  894.   
  895. ! rem2ps$O: rem2ps.c rem2ps.h lang.h config.h
  896.   calendar$O: calendar.c $(STDHDRS) expr.h
  897.   dorem$O: dorem.c $(STDHDRS) expr.h
  898.   dosubst$O: dosubst.c $(STDHDRS) $(LANGHDRS)
  899. ***************
  900. *** 76,87 ****
  901.   expr$O: expr.c $(STDHDRS) expr.h
  902.   files$O: files.c $(STDHDRS)
  903.   funcs$O: funcs.c $(STDHDRS) expr.h version.h
  904. ! globals$O: globals.c config.h types.h globals.h err.h lang.h
  905. ! init$O: init.c $(STDHDRS) expr.h version.h
  906.   main$O: main.c $(STDHDRS) expr.h
  907.   moon$O: moon.c $(STDHDRS)
  908.   omit$O: omit.c $(STDHDRS)
  909.   sort$O: sort.c $(STDHDRS)
  910.   token$O: token.c $(STDHDRS)
  911.   trigger$O: trigger.c $(STDHDRS) expr.h
  912.   userfns$O: userfns.c $(STDHDRS) expr.h
  913. --- 91,104 ----
  914.   expr$O: expr.c $(STDHDRS) expr.h
  915.   files$O: files.c $(STDHDRS)
  916.   funcs$O: funcs.c $(STDHDRS) expr.h version.h
  917. ! globals$O: globals.c config.h types.h globals.h err.h lang.h $(LANGHDRS)
  918. ! hbcal$O: hbcal.c $(STDHDRS)
  919. ! init$O: init.c $(STDHDRS) expr.h version.h $(LANGHDRS)
  920.   main$O: main.c $(STDHDRS) expr.h
  921.   moon$O: moon.c $(STDHDRS)
  922.   omit$O: omit.c $(STDHDRS)
  923.   sort$O: sort.c $(STDHDRS)
  924. + queue$O: queue.c $(STDHDRS)
  925.   token$O: token.c $(STDHDRS)
  926.   trigger$O: trigger.c $(STDHDRS) expr.h
  927.   userfns$O: userfns.c $(STDHDRS) expr.h
  928. diff -c remind-3.0.10/os2func.c new/os2func.c
  929. *** remind-3.0.10/os2func.c    Tue Oct 12 13:44:56 1993
  930. --- new/os2func.c    Fri Nov 05 18:32:12 1993
  931. ***************
  932. *** 10,21 ****
  933.   /*  REMIND is Copyright (C) 1993 by David F. Skoll.            */
  934.   /*                                                             */
  935.   /***************************************************************/
  936. ! #ifdef __OS2__
  937.   #define INCL_VIO
  938.   #define INCL_KBD
  939.   #include <os2.h>
  940.   
  941.   #include <stdio.h>
  942.   #include <string.h>
  943.   #ifdef OS2DBG
  944.   #include <dos.h>
  945. --- 10,31 ----
  946.   /*  REMIND is Copyright (C) 1993 by David F. Skoll.            */
  947.   /*                                                             */
  948.   /***************************************************************/
  949. ! #ifdef OS2_POPUP
  950.   #define INCL_VIO
  951.   #define INCL_KBD
  952. + #endif
  953. + #ifdef _MSC_VER
  954. + #define INCL_DOSPROCESS
  955. + #endif
  956. + #if defined(OS2_POPUP) || defined(_MSC_VER)
  957.   #include <os2.h>
  958. + #endif
  959.   
  960. + #ifdef OS2_POPUP
  961.   #include <stdio.h>
  962. + #include <stdlib.h>
  963.   #include <string.h>
  964.   #ifdef OS2DBG
  965.   #include <dos.h>
  966. ***************
  967. *** 26,40 ****
  968.   #include "types.h"
  969.   #include "protos.h"
  970.   
  971.   static APIRET apiret = 0;
  972.   static KBDKEYINFO kbci;
  973.   static char *pszPressAny = "\r\nPress any key to continue";
  974. ! static USHORT pflags = VP_WAIT;
  975.   static HKBD hkbd = 0;
  976. ! static char VioSubstBuffer[2*LINELEN];
  977.   
  978.   void StartPopUp()
  979.   {
  980.       if (!(DebugFlag & DB_ECHO_LINE))
  981.          VioPopUp(&pflags, 0);
  982.   }
  983. --- 36,55 ----
  984.   #include "types.h"
  985.   #include "protos.h"
  986.   
  987. + #ifdef _MSC_VER
  988. + typedef USHORT APIRET;
  989. + #endif
  990.   static APIRET apiret = 0;
  991.   static KBDKEYINFO kbci;
  992.   static char *pszPressAny = "\r\nPress any key to continue";
  993. ! static USHORT pflags = VP_WAIT;  /* | VP_TRANSPARENT; */
  994.   static HKBD hkbd = 0;
  995. ! static char VioSubstBuffer[SHELLSIZE + 1];
  996.   
  997.   void StartPopUp()
  998.   {
  999. +   if (OS2MODE)
  1000.       if (!(DebugFlag & DB_ECHO_LINE))
  1001.          VioPopUp(&pflags, 0);
  1002.   }
  1003. ***************
  1004. *** 43,51 ****
  1005.   {
  1006.       if (DebugFlag & DB_ECHO_LINE)
  1007.       return;
  1008. !     VioWrtTTY(pszPressAny, strlen(pszPressAny), 0);
  1009. !     KbdCharIn(&kbci, IO_WAIT, hkbd);
  1010. !     VioEndPopUp(0);
  1011.   }
  1012.   
  1013.   int PutsPopUp(char *s)
  1014. --- 58,68 ----
  1015.   {
  1016.       if (DebugFlag & DB_ECHO_LINE)
  1017.       return;
  1018. !     if (OS2MODE) {
  1019. !       VioWrtTTY(pszPressAny, strlen(pszPressAny), 0);
  1020. !       KbdCharIn(&kbci, IO_WAIT, hkbd);
  1021. !       VioEndPopUp(0);
  1022. !     }
  1023.   }
  1024.   
  1025.   int PutsPopUp(char *s)
  1026. ***************
  1027. *** 115,121 ****
  1028. --- 132,148 ----
  1029.   #endif
  1030.   #endif
  1031.   
  1032. + #ifdef _MSC_VER
  1033. + unsigned sleep(unsigned sec)
  1034. + {
  1035. +   return DosSleep(sec * 1000L);
  1036. + }
  1037. + #endif
  1038. + #ifndef __EMX__ 
  1039.   int fork()
  1040.   {
  1041.       return(-1);
  1042.   }
  1043. + #endif
  1044. diff -c remind-3.0.10/protos.h new/protos.h
  1045. *** remind-3.0.10/protos.h    Wed Oct 20 08:54:30 1993
  1046. --- new/protos.h    Sun Oct 31 20:46:00 1993
  1047. ***************
  1048. *** 32,38 ****
  1049.   int DoFlush ARGS ((ParsePtr p));
  1050.   void DoExit ARGS ((ParsePtr p));
  1051.   int ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim));
  1052. ! int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul));
  1053.   int ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul));
  1054.   int DoSubst ARGS ((ParsePtr p, char *out, Trigger *t, TimeTrig *tt, int jul, int mode));
  1055.   int DoSubstFromString ARGS ((char *source, char *dest, int jul, int tim));
  1056. --- 32,39 ----
  1057.   int DoFlush ARGS ((ParsePtr p));
  1058.   void DoExit ARGS ((ParsePtr p));
  1059.   int ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim));
  1060. ! int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul,
  1061. !                int AsPopUp));
  1062.   int ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul));
  1063.   int DoSubst ARGS ((ParsePtr p, char *out, Trigger *t, TimeTrig *tt, int jul, int mode));
  1064.   int DoSubstFromString ARGS ((char *source, char *dest, int jul, int tim));
  1065. ***************
  1066. *** 131,148 ****
  1067.   int SetSysVar ARGS ((const char *name, Value *val));
  1068.   void DumpSysVarByName ARGS ((const char *name));
  1069.   int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
  1070. ! void FillParagraph ARGS ((char *s));
  1071.   void LocalToUTC ARGS ((int locdate, int loctime, int *utcdate, int *utctime));
  1072.   void UTCToLocal ARGS ((int utcdate, int utctime, int *locdate, int *loctime));
  1073.   int MoonPhase ARGS ((int date, int time));
  1074.   void HuntPhase ARGS ((int startdate, int starttim, int phas, int *date, int *time));
  1075.   int CompareRems ARGS ((int dat1, int tim1, int prio1, int dat2, int tim2, int prio2, int bydate, int bytime, int byprio));
  1076.   
  1077.   #if defined(__OS2__)
  1078.   int fork ARGS ((void));
  1079.   void StartPopUp ARGS ((void));
  1080.   void EndPopUp ARGS ((void));
  1081.   int PutcPopUp ARGS ((int c));
  1082.   int PutlPopUp ARGS ((char *s));
  1083.   int PutsPopUp ARGS ((char *s));
  1084.   #endif
  1085. --- 132,157 ----
  1086.   int SetSysVar ARGS ((const char *name, Value *val));
  1087.   void DumpSysVarByName ARGS ((const char *name));
  1088.   int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
  1089. ! void FillParagraph ARGS ((char *s, int AsPopUp));
  1090.   void LocalToUTC ARGS ((int locdate, int loctime, int *utcdate, int *utctime));
  1091.   void UTCToLocal ARGS ((int utcdate, int utctime, int *locdate, int *loctime));
  1092.   int MoonPhase ARGS ((int date, int time));
  1093.   void HuntPhase ARGS ((int startdate, int starttim, int phas, int *date, int *time));
  1094.   int CompareRems ARGS ((int dat1, int tim1, int prio1, int dat2, int tim2, int prio2, int bydate, int bytime, int byprio));
  1095. + #ifdef __BORLANDC__
  1096. + void __cdecl SigIntHandler ARGS ((int d));
  1097. + #else
  1098. + void SigIntHandler ARGS ((void));
  1099. + #endif
  1100. + void GotSigInt ARGS ((void));
  1101.   
  1102.   #if defined(__OS2__)
  1103.   int fork ARGS ((void));
  1104. + #if defined(OS2_POPUP)
  1105.   void StartPopUp ARGS ((void));
  1106.   void EndPopUp ARGS ((void));
  1107.   int PutcPopUp ARGS ((int c));
  1108.   int PutlPopUp ARGS ((char *s));
  1109.   int PutsPopUp ARGS ((char *s));
  1110. + #endif
  1111.   #endif
  1112. diff -c remind-3.0.10/queue.c new/queue.c
  1113. *** remind-3.0.10/queue.c    Wed Oct 20 10:16:42 1993
  1114. --- new/queue.c    Mon Nov 01 18:36:36 1993
  1115. ***************
  1116. *** 23,31 ****
  1117.   #include <unistd.h>
  1118.   #endif
  1119.   
  1120. ! #ifdef __BORLANDC__
  1121.   #include <io.h>
  1122.   #include <dos.h>
  1123.   #include <process.h>
  1124.   #endif
  1125.   
  1126. --- 23,34 ----
  1127.   #include <unistd.h>
  1128.   #endif
  1129.   
  1130. ! #if defined(__OS2__) || defined(__MSDOS__)
  1131. ! #include <string.h>
  1132.   #include <io.h>
  1133. + #if defined(__BORLANDC__)
  1134.   #include <dos.h>
  1135. + #endif
  1136.   #include <process.h>
  1137.   #endif
  1138.   
  1139. ***************
  1140. *** 57,66 ****
  1141.   PRIVATE QueuedRem *FindNextReminder ARGS ((void));
  1142.   PRIVATE int CalculateNextTimeUsingSched ARGS ((QueuedRem *q));
  1143.   
  1144. ! #ifdef __OS2__
  1145.   void (__cdecl SigIntHandler(int));
  1146.   #else
  1147. ! PRIVATE void SigIntHandler ARGS ((void));
  1148.   #endif
  1149.   
  1150.   /***************************************************************/
  1151. --- 60,69 ----
  1152.   PRIVATE QueuedRem *FindNextReminder ARGS ((void));
  1153.   PRIVATE int CalculateNextTimeUsingSched ARGS ((QueuedRem *q));
  1154.   
  1155. ! #ifdef __BORLANDC__
  1156.   void (__cdecl SigIntHandler(int));
  1157.   #else
  1158. ! void SigIntHandler ARGS ((void));
  1159.   #endif
  1160.   
  1161.   /***************************************************************/
  1162. ***************
  1163. *** 162,168 ****
  1164. --- 165,175 ----
  1165.         q = q->next;
  1166.      }
  1167.   
  1168. + #ifdef __BORLANDC__
  1169. +    signal(SIGINT, SigIntHandler);
  1170. + #else
  1171.      if (!DontFork || Daemon) signal(SIGINT, SigIntHandler);
  1172. + #endif
  1173.   
  1174.      /* Sit in a loop, issuing reminders when necessary */
  1175.      while(1) {
  1176. ***************
  1177. *** 169,175 ****
  1178.         q = FindNextReminder();
  1179.   
  1180.         /* If no more reminders to issue, we're unless we're a daemon. */
  1181. !       if (!q && !Daemon) exit(0);
  1182.   
  1183.         if (Daemon && !q)
  1184.            TimeToSleep = (long) 60*Daemon;
  1185. --- 176,182 ----
  1186.         q = FindNextReminder();
  1187.   
  1188.         /* If no more reminders to issue, we're unless we're a daemon. */
  1189. !       if (!q && !Daemon) break;
  1190.   
  1191.         if (Daemon && !q)
  1192.            TimeToSleep = (long) 60*Daemon;
  1193. ***************
  1194. *** 195,206 ****
  1195.         CreateParser(q->text, &p);
  1196.         trig.typ = q->typ;
  1197.         RunDisabled = q->RunDisabled;
  1198. !       (void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
  1199.         fflush(stdout);
  1200.         
  1201.         /* Calculate the next trigger time */
  1202.         q->tt.nexttime = CalculateNextTime(q);
  1203.      }
  1204.   }
  1205.      
  1206.   
  1207. --- 202,217 ----
  1208.         CreateParser(q->text, &p);
  1209.         trig.typ = q->typ;
  1210.         RunDisabled = q->RunDisabled;
  1211. !       (void) TriggerReminder(&p, &trig, &q->tt, JulianToday, 1);
  1212.         fflush(stdout);
  1213.         
  1214.         /* Calculate the next trigger time */
  1215.         q->tt.nexttime = CalculateNextTime(q);
  1216.      }
  1217. + #ifdef __BORLANDC__
  1218. +    signal(SIGINT, SIG_DFL);
  1219. + #endif
  1220. +    exit(0);
  1221.   }
  1222.      
  1223.   
  1224. ***************
  1225. *** 275,303 ****
  1226.   
  1227.   /***************************************************************/
  1228.   /*                                                             */
  1229. ! /* SigIntHandler                                               */
  1230.   /*                                                             */
  1231. ! /* For debugging purposes, when sent a SIGINT, we print the    */
  1232. ! /* contents of the queue.  This does NOT work when the -f      */
  1233. ! /* command-line flag is supplied.                              */
  1234.   /*                                                             */
  1235.   /***************************************************************/
  1236. - #ifdef __OS2__
  1237. - void __cdecl SigIntHandler(int d)
  1238. - #else
  1239.   #ifdef HAVE_PROTOS
  1240. ! PRIVATE void SigIntHandler(void)
  1241.   #else
  1242. ! static void SigIntHandler()
  1243.   #endif
  1244. - #endif
  1245.   {
  1246.      QueuedRem *q = QueueHead;
  1247.   
  1248. - #ifdef SYSV
  1249. -    signal(SIGINT, SigIntHandler);
  1250. - #endif
  1251.      printf("Contents of AT queue:%s", NL);
  1252.   
  1253.      while (q) {
  1254. --- 286,305 ----
  1255.   
  1256.   /***************************************************************/
  1257.   /*                                                             */
  1258. ! /* GotSigInt                               */
  1259.   /*                                                             */
  1260. ! /* Split out what's done on a SIGINT from the SIGINT Handler.  */
  1261. ! /* This will be necessary for OS/2 multithreaded.           */
  1262.   /*                                                             */
  1263.   /***************************************************************/
  1264.   #ifdef HAVE_PROTOS
  1265. ! void GotSigInt(void)
  1266.   #else
  1267. ! void GotSigInt()
  1268.   #endif
  1269.   {
  1270.      QueuedRem *q = QueueHead;
  1271.   
  1272.      printf("Contents of AT queue:%s", NL);
  1273.   
  1274.      while (q) {
  1275. ***************
  1276. *** 315,320 ****
  1277. --- 317,323 ----
  1278.      }
  1279.      printf(NL);
  1280.   }
  1281.   /***************************************************************/
  1282.   /*                                                             */
  1283.   /*  CheckInitialFile                                           */
  1284. diff -c remind-3.0.10/README.OS2 new/README.OS2
  1285. *** remind-3.0.10/README.OS2    Wed Oct 13 07:51:42 1993
  1286. --- new/README.OS2    Sun Oct 31 20:45:48 1993
  1287. ***************
  1288. *** 1,10 ****
  1289.   REMIND version 3.0 for OS/2
  1290.   
  1291. ! This file contains instructions for compiling Remind with the
  1292. ! Microsoft C compiler under OS/2.  However, there is better support
  1293. ! for OS/2 using the Borland C compiler -- see the file README.BCC
  1294. ! for details.
  1295.   
  1296.   REMIND is a sophisticated alarm/calendar program.  Details are given
  1297.   in the man page, "remind.1".
  1298.   
  1299. --- 1,13 ----
  1300.   REMIND version 3.0 for OS/2
  1301.   
  1302. ! This file contains instructions for compiling Remind under OS/2 with
  1303. ! Eberhard Mattes' emx/gcc compiler and with the Microsoft C compiler.
  1304. ! There are a number of targets in Makefile.os2, including OS/2-only 
  1305. ! versions and bound versions (programs which run under OS/2 and DOS).
  1306.   
  1307. + Note that there is also support for OS/2 using the Borland C 
  1308. + compiler--see the file README.BCC for details.
  1309.   REMIND is a sophisticated alarm/calendar program.  Details are given
  1310.   in the man page, "remind.1".
  1311.   
  1312. ***************
  1313. *** 11,29 ****
  1314.   1 - Read the file COPYRIGHT.  (This may be called COPYRIGH on your
  1315.       MS-DOS system.)
  1316.   
  1317. ! 2 - To compile Remind for OS/2, you must use the Microsoft C compiler.
  1318. !     You must also have a decent version of 'make', such as dmake.
  1319.   
  1320.   3 - Examine the file config.h and adjust parameters as needed
  1321.   
  1322. ! 4 - Examine the file makefile.os2 and adjust parameters as needed.
  1323.   
  1324.   5 - Type:
  1325.   
  1326. !     make -f makefile.os2
  1327.   
  1328. ! This will make 'remind.exe' which is an OS/2 1.x--2.0 executable, and
  1329. ! 'remindb.exe' which is an OS/2 and MSDOS bound executable.
  1330.   
  1331.   The file "defs.rem" has some sample Remind definitions and commands,
  1332.   as well as U.S. and Jewish holidays.
  1333. --- 14,36 ----
  1334.   1 - Read the file COPYRIGHT.  (This may be called COPYRIGH on your
  1335.       MS-DOS system.)
  1336.   
  1337. ! 2 - To compile Remind for OS/2, you must use the Microsoft C compiler
  1338. !     or emx/gcc. You must also have a decent version of 'make', such 
  1339. !     as dmake or GNU make.
  1340.   
  1341.   3 - Examine the file config.h and adjust parameters as needed
  1342.   
  1343. ! 4 - Examine the file Makefile.os2 and adjust parameters as needed.
  1344.   
  1345.   5 - Type:
  1346.   
  1347. !     make -f Makefile.os2
  1348. ! to see a list of targets. For example, 
  1349. !     make -f Makefile.os2 emx
  1350.   
  1351. ! will build a 32-bit emx version which runs under OS/2 2.x and DOS.
  1352.   
  1353.   The file "defs.rem" has some sample Remind definitions and commands,
  1354.   as well as U.S. and Jewish holidays.
  1355. ***************
  1356. *** 31,38 ****
  1357.   NOTE that I do not have access to an OS/2 system, so support for this
  1358.   system may not be as good as I'd like.
  1359.   
  1360. ! OS/2 support is courtesy of DARREL HANKERSON <HANK@DUCVAX.AUBURN.EDU>.
  1361. ! However, if you have problems, please contact me and not Darrel.
  1362.   
  1363.   OTHER LANGUAGE SUPPORT
  1364.   
  1365. --- 38,46 ----
  1366.   NOTE that I do not have access to an OS/2 system, so support for this
  1367.   system may not be as good as I'd like.
  1368.   
  1369. ! OS/2 support is courtesy of Russ Herman <rwh@gov.on.ca>, Norman Walsh 
  1370. ! <norm@ora.com>, and Darrel Hankerson <hankedr@mail.auburn.edu>. 
  1371. ! However, if you have problems, please contact me.
  1372.   
  1373.   OTHER LANGUAGE SUPPORT
  1374.   
  1375. diff -c remind-3.0.10/sort.c new/sort.c
  1376. *** remind-3.0.10/sort.c    Tue Oct 19 08:19:14 1993
  1377. --- new/sort.c    Sun Oct 31 20:45:58 1993
  1378. ***************
  1379. *** 166,187 ****
  1380.                 IssueSortBanner(cur->trigdate);
  1381.             olddate = cur->trigdate;
  1382.                  }
  1383. - #ifdef __OS2__
  1384. -                PutlPopUp(cur->text);
  1385. - #else
  1386.                  printf("%s", cur->text);
  1387. - #endif
  1388.               }
  1389.           break;
  1390.   
  1391.        case MSF_TYPE:
  1392. ! #ifdef __OS2__
  1393. !             StartPopUp();
  1394. ! #endif
  1395. !         FillParagraph(cur->text);
  1396. ! #ifdef __OS2__
  1397. !             EndPopUp();
  1398. ! #endif
  1399.           break;
  1400.   
  1401.        case RUN_TYPE:
  1402. --- 166,177 ----
  1403.                 IssueSortBanner(cur->trigdate);
  1404.             olddate = cur->trigdate;
  1405.                  }
  1406.                  printf("%s", cur->text);
  1407.               }
  1408.           break;
  1409.   
  1410.        case MSF_TYPE:
  1411. !         FillParagraph(cur->text, 0);
  1412.           break;
  1413.   
  1414.        case RUN_TYPE:
  1415. diff -c remind-3.0.10/test-rem.bat new/test-rem.bat
  1416. *** remind-3.0.10/test-rem.bat    Wed Oct 20 12:10:42 1993
  1417. --- new/test-rem.bat    Mon Oct 25 18:20:14 1993
  1418. ***************
  1419. *** 12,18 ****
  1420. --- 12,23 ----
  1421.   
  1422.   del test.out > nul
  1423.   set TEST_GETENV=foo bar baz
  1424. + if exist ..\msdos-ex\remind.exe goto bcc
  1425. + remind -e -dxte ./test.rem 16 feb 1991 > test.out
  1426. + goto cmp
  1427. + :bcc
  1428.   ..\msdos-ex\remind -e -dxte .\test.rem 16 feb 1991 > test.out
  1429. + :cmp
  1430.   echo n | comp test.out test1.cmp
  1431.   if errorlevel 1 goto oops
  1432.   echo "Remind:  Acceptance test PASSED"
  1433. diff -c remind-3.0.10/test-rem.cmd new/test-rem.cmd
  1434. *** remind-3.0.10/test-rem.cmd    Wed Oct 20 12:10:32 1993
  1435. --- new/test-rem.cmd    Mon Oct 25 18:11:24 1993
  1436. ***************
  1437. *** 13,19 ****
  1438. --- 13,24 ----
  1439.   del /f test.out > nul
  1440.   setlocal
  1441.   set TEST_GETENV=foo bar baz
  1442. + if exist ..\os2-ex\remind.exe goto bcc
  1443. + remind -e -dxte ./test.rem 16 feb 1991 > .\test.out
  1444. + goto cmp
  1445. + :bcc
  1446.   ..\os2-ex\remind -e -dxte .\test.rem 16 feb 1991 > .\test.out
  1447. + :cmp
  1448.   echo n | comp test.out test2.cmp
  1449.   if errorlevel 1 goto oops
  1450.   echo "Remind:  Acceptance test PASSED"
  1451.