home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume22 / remind / patch03 next >
Encoding:
Text File  |  1991-09-13  |  11.7 KB  |  338 lines

  1. Newsgroups: comp.sources.misc
  2. From: David F. Skoll <dfs@doe.carleton.ca>
  3. Subject:  v22i102:  remind - A replacement for calendar, Patch03
  4. Message-ID: <1991Sep10.163641.7404@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 39c1ceba2c58965abe08f67a1a4d6277
  6. Date: Tue, 10 Sep 1991 16:36:41 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: David F. Skoll <dfs@doe.carleton.ca>
  10. Posting-number: Volume 22, Issue 102
  11. Archive-name: remind/patch03
  12. Environment: UNIX, MS-DOS
  13. Patch-To: remind: Volume 17, Issue 3-6
  14.  
  15. This is Official Patch #3 for Remind 2.3.  You should have Remind 2.3
  16. patch level 2 before applying this patch.
  17.  
  18. This patch adds the "-f" command-line option, which causes Remind to
  19. handle queued reminders in the foreground.  This is useful for people
  20. who run Remind under Sunview or X-Windows, because it allows your
  21. Remind processes to die automatically when you exit the windowing system.
  22. See the man page for more details.
  23.  
  24. To apply the patch, change to the Remind source directory, and unshar this
  25. article.  Type 'patch < patch-03' and re-Make and re-install Remind.
  26.  
  27. Unfortunately, I can't upload the latest version of Remind to
  28. alfred.ccs.carleton.ca anymore.  I'll send a request that it be uploaded,
  29. but I can't make any guarantees.  However, the source is archived in the
  30. comp.sources.misc archive.
  31.  
  32. David F. Skoll
  33.  
  34. -------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
  35. #!/bin/sh
  36. # This is Remind 2.3 Patch 03, a shell archive (shar 3.32)
  37. # made 09/10/1991 15:00 UTC by dfs@data
  38. # Source directory /enterprise/transporter/dfs/work/.rem/patch3-work
  39. #
  40. # existing files will NOT be overwritten
  41. #
  42. # This shar contains:
  43. # length  mode       name
  44. # ------ ---------- ------------------------------------------
  45. #   9105 -rw------- patch-03
  46. #
  47. if touch 2>&1 | fgrep 'amc' > /dev/null
  48.  then TOUCH=touch
  49.  else TOUCH=true
  50. fi
  51. # ============= patch-03 ==============
  52. if test X"$1" != X"-c" -a -f 'patch-03'; then
  53.     echo "File already exists: skipping 'patch-03'"
  54. else
  55. echo "x - extracting patch-03 (Text)"
  56. sed 's/^X//' << 'SHAR_EOF' > patch-03 &&
  57. XThis patch adds the -f command-line option to Remind.  This causes it to
  58. Xhandle the queued AT reminders in the foreground.  This is useful for
  59. XX-Windows and Sunview applications which desire that Remind be killed when
  60. Xthe windowing system is exited.
  61. X
  62. XChange the WHATSNEW file to reflect the new command line option.
  63. X*** ../patch2-work/WHATSNEW.23    Wed Jul 17 13:14:26 1991
  64. X--- ./WHATSNEW.23    Tue Sep 10 10:49:33 1991
  65. X***************
  66. X*** 64,66 ****
  67. X--- 64,70 ----
  68. X  Added the "%#" and "%@" modifiers for the current time.
  69. X  
  70. X  Made the Makefile more portable
  71. X+ 
  72. X+ * Version 2.3 Patch 3 - Added a command-line option for Remind to process
  73. X+ queued reminders in the foreground.  This makes automatic termination
  74. X+ of Remind processes from within X-Windows and Sunview easier.
  75. XPut the Foreground global variable in globals.h
  76. X*** ../patch2-work/globals.h    Wed Jul 17 12:52:37 1991
  77. X--- ./globals.h    Tue Sep 10 10:14:41 1991
  78. X***************
  79. X*** 47,49 ****
  80. X--- 47,50 ----
  81. X  extern int   CalWidth;
  82. X  extern int   SimpleCalendar;
  83. X  extern int   Hush;
  84. X+ extern int   Foreground;
  85. XChange the init.c file to recognize the -f option.
  86. X*** ../patch2-work/init.c    Wed Jul 17 12:52:26 1991
  87. X--- ./init.c    Tue Sep 10 10:25:35 1991
  88. X***************
  89. X*** 48,53 ****
  90. X--- 48,54 ----
  91. X     SimpleCalendar = 0;
  92. X     InfiniteDelta = 0;
  93. X     Hush = 0;
  94. X+    Foreground = 0;
  95. X  
  96. X     if(argc == 1) {
  97. X       fprintf(stderr,
  98. X***************
  99. X*** 54,60 ****
  100. X          "\nREMIND %d.%d Patch Level %d (C) 1990, 1991 by David Skoll.\n\n", 
  101. X             VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
  102. X  #ifdef UNIX
  103. X!      fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-voraqth] filename [date]\n\n");
  104. X  #else
  105. X       fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-vorth] filename [date]\n\n");
  106. X  #endif
  107. X--- 55,61 ----
  108. X          "\nREMIND %d.%d Patch Level %d (C) 1990, 1991 by David Skoll.\n\n", 
  109. X             VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
  110. X  #ifdef UNIX
  111. X!      fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-voraqthf] filename [date]\n\n");
  112. X  #else
  113. X       fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-vorth] filename [date]\n\n");
  114. X  #endif
  115. X***************
  116. X*** 66,73 ****
  117. X       fprintf(stderr, "-v   Verbose messages\n-o   Ignore ONCE directives\n");
  118. X       fprintf(stderr, "-r   Ignore RUN directives\n");
  119. X  #ifdef UNIX
  120. X!      fprintf(stderr, "-a   Do not trigger current AT reminders in foreground\n");
  121. X       fprintf(stderr, "-q   Do not queue current AT reminders\n");
  122. X  #endif
  123. X       fprintf(stderr, "-t   Trigger all non-expired reminders regardless of delta\n");
  124. X       fprintf(stderr, "-h   'Hush' mode - don't display anything if no reminders triggered\n\n");
  125. X--- 67,75 ----
  126. X       fprintf(stderr, "-v   Verbose messages\n-o   Ignore ONCE directives\n");
  127. X       fprintf(stderr, "-r   Ignore RUN directives\n");
  128. X  #ifdef UNIX
  129. X!      fprintf(stderr, "-a   Do not trigger current AT reminders until specified time\n");
  130. X       fprintf(stderr, "-q   Do not queue current AT reminders\n");
  131. X+      fprintf(stderr, "-f   Process queued reminders in the foreground.\n");
  132. X  #endif
  133. X       fprintf(stderr, "-t   Trigger all non-expired reminders regardless of delta\n");
  134. X       fprintf(stderr, "-h   'Hush' mode - don't display anything if no reminders triggered\n\n");
  135. X***************
  136. X*** 156,162 ****
  137. X  #ifdef UNIX
  138. X          case 'A': PrintAts = 0; break;
  139. X  
  140. X!             case 'Q': QueueAts = 0; break;          
  141. X  #endif        
  142. X          default: fprintf(stderr, "Unknown option '%c' ignored.\n", *s);
  143. X       }                  
  144. X--- 158,166 ----
  145. X  #ifdef UNIX
  146. X          case 'A': PrintAts = 0; break;
  147. X  
  148. X!             case 'Q': QueueAts = 0; break;
  149. X! 
  150. X!         case 'F': Foreground = 1; break;
  151. X  #endif        
  152. X          default: fprintf(stderr, "Unknown option '%c' ignored.\n", *s);
  153. X       }                  
  154. X*** ../patch2-work/main.c    Wed Jul 17 12:53:03 1991
  155. X--- ./main.c    Tue Sep 10 10:11:40 1991
  156. X***************
  157. X*** 119,124 ****
  158. X--- 119,125 ----
  159. X  char QueueAts, PrintAts;
  160. X  int  NumAtsQueued;
  161. X  int Calendar, CalTime, CalWidth, SimpleCalendar;
  162. X+ int Foreground;
  163. X  
  164. X  static int JulFirst; /* Julian date of 1 Jan Current_year */
  165. X  static int FirstYear;
  166. X***************
  167. X*** 684,692 ****
  168. X             /* stdout to a file. */
  169. X  
  170. X     if (NumAtsQueued) {
  171. X!       pid = fork();
  172. X!       if (pid == -1) Eprint("Can't fork to perform ATs!\n");
  173. X!       if (pid != 0) return 0;
  174. X        HandleQueuedAts();
  175. X     }
  176. X  #endif
  177. X--- 685,695 ----
  178. X             /* stdout to a file. */
  179. X  
  180. X     if (NumAtsQueued) {
  181. X!       if (!Foreground) {
  182. X!          pid = fork();
  183. X!          if (pid == -1) Eprint("Can't fork to perform ATs!\n");
  184. X!          if (pid != 0) return 0;
  185. X!       }
  186. X        HandleQueuedAts();
  187. X     }
  188. X  #endif
  189. X*** ../patch2-work/patchlevel.h    Wed Jul 17 12:41:43 1991
  190. X--- ./patchlevel.h    Tue Sep 10 10:07:33 1991
  191. X***************
  192. X*** 3,6 ****
  193. X  #define VERSION_MAJOR 2
  194. X  #define VERSION_MINOR 3
  195. X  
  196. X! #define PATCHLEVEL 2
  197. X--- 3,6 ----
  198. X  #define VERSION_MAJOR 2
  199. X  #define VERSION_MINOR 3
  200. X  
  201. X! #define PATCHLEVEL 3
  202. X*** ../patch2-work/remind.1    Wed Jul 17 12:56:26 1991
  203. X--- ./remind.1    Tue Sep 10 10:47:40 1991
  204. X***************
  205. X*** 5,11 ****
  206. X  .SH SYNOPSIS
  207. X  .B remind
  208. X  [\fB\-n | \fB\-d\fR | \fB\-p\fR | \fB\-c\fR\fIn\fR [\fB\-w\fR\fIn\fR | \fB\-s\fR]]
  209. X! [\fB\-voraqth\fR]
  210. X  .I filename
  211. X  [\fIdate\fR]
  212. X  .SH DESCRIPTION
  213. X--- 5,11 ----
  214. X  .SH SYNOPSIS
  215. X  .B remind
  216. X  [\fB\-n | \fB\-d\fR | \fB\-p\fR | \fB\-c\fR\fIn\fR [\fB\-w\fR\fIn\fR | \fB\-s\fR]]
  217. X! [\fB\-voraqthf\fR]
  218. X  .I filename
  219. X  [\fIdate\fR]
  220. X  .SH DESCRIPTION
  221. X***************
  222. X*** 141,147 ****
  223. X--- 141,166 ----
  224. X  flag causes \fBremind\fR to go into 'Hush' mode.  In this mode, if no
  225. X  reminders are triggered, nothing will be displayed.  (Normally, \fBremind\fR
  226. X  will display "No reminders." in this case.)
  227. X+ .TP
  228. X+ .B \-f
  229. X+ The
  230. X+ .B \-f
  231. X+ flag causes \fBremind\fR to remain in the foreground when handling queued
  232. X+ AT reminders, rather than forking into the background.  This is useful in
  233. X+ .xinitrc or .suntools scripts, because you can start \fBremind\fR and have
  234. X+ it automatically killed when you exit X-Windows or Sunview.  For example,
  235. X+ in your .xinitrc script, you could have:
  236. X  .PP
  237. X+ .nf
  238. X+     remind -fah $HOME/.reminders > /dev/null 2>&1 &
  239. X+ .fi
  240. X+ .PP
  241. X+ .RS
  242. X+ Presumably, your .reminders script will contain RUN-type reminders for
  243. X+ popping windows onto the X-Windows display.  When you exit X-Windows,
  244. X+ the \fBremind\fR process will be killed.
  245. X+ .RE
  246. X+ .PP
  247. X  If you supply a
  248. X  .I date
  249. X  on the command line, it must consist of
  250. X***************
  251. X*** 812,818 ****
  252. X  be triggered like a normal reminder.)  After
  253. X  .B remind
  254. X  has finished processing the reminder file, it starts up a background
  255. X! process to trigger all the queued timed reminders.  As each reminder's
  256. X  trigger time is reached, it is triggered.  Thus, you can have
  257. X  .B remind
  258. X  issue reminders just before important meetings or time-sensitive tasks.
  259. X--- 831,842 ----
  260. X  be triggered like a normal reminder.)  After
  261. X  .B remind
  262. X  has finished processing the reminder file, it starts up a background
  263. X! process to trigger all the queued timed reminders.  (However, if you
  264. X! supply the
  265. X! .B \-f
  266. X! command-line option, a background process will not be created.  Instead,
  267. X! the AT reminders will be processed in the foreground.)
  268. X! As each reminder's
  269. X  trigger time is reached, it is triggered.  Thus, you can have
  270. X  .B remind
  271. X  issue reminders just before important meetings or time-sensitive tasks.
  272. X*** ../patch2-work/timed.c    Wed Jul 17 13:07:45 1991
  273. X--- ./timed.c    Tue Sep 10 10:22:44 1991
  274. X***************
  275. X*** 65,70 ****
  276. X--- 65,71 ----
  277. X        prev->next = e;
  278. X        e->next = NULL;
  279. X     }
  280. X+    return 0;
  281. X  }
  282. X  
  283. X  /***************************************************************/
  284. X***************
  285. X*** 166,172 ****
  286. X     unsigned NotSlept;
  287. X  #endif
  288. X  
  289. X!    signal(SIGINT, SigIntHandler);
  290. X  
  291. X      /* If we are not connected to a tty, then we must close the
  292. X       * standard file descriptors. This is to prevent someone
  293. X--- 167,173 ----
  294. X     unsigned NotSlept;
  295. X  #endif
  296. X  
  297. X!    if (!Foreground) signal(SIGINT, SigIntHandler);
  298. X  
  299. X      /* If we are not connected to a tty, then we must close the
  300. X       * standard file descriptors. This is to prevent someone
  301. X***************
  302. X*** 227,233 ****
  303. X  /* SigIntHandler                                               */
  304. X  /*                                                             */
  305. X  /* For debugging purposes, when sent a SIGINT, we print the    */
  306. X! /* contents of the queue.                                      */
  307. X  /*                                                             */
  308. X  /***************************************************************/
  309. X  void SigIntHandler()
  310. X--- 228,235 ----
  311. X  /* SigIntHandler                                               */
  312. X  /*                                                             */
  313. X  /* For debugging purposes, when sent a SIGINT, we print the    */
  314. X! /* contents of the queue.  This does NOT work when the -f      */
  315. X! /* command-line flag is supplied.                              */
  316. X  /*                                                             */
  317. X  /***************************************************************/
  318. X  void SigIntHandler()
  319. SHAR_EOF
  320. $TOUCH -am 0910105891 patch-03 &&
  321. chmod 0600 patch-03 ||
  322. echo "restore of patch-03 failed"
  323. set `wc -c patch-03`;Wc_c=$1
  324. if test "$Wc_c" != "9105"; then
  325.     echo original size 9105, current size $Wc_c
  326. fi
  327. fi
  328. exit 0
  329.   
  330.  
  331.  
  332. exit 0 # Just in case...
  333. -- 
  334. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  335. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  336. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  337. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  338.