home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: David F. Skoll <dfs@doe.carleton.ca>
- Subject: v22i102: remind - A replacement for calendar, Patch03
- Message-ID: <1991Sep10.163641.7404@sparky.IMD.Sterling.COM>
- X-Md4-Signature: 39c1ceba2c58965abe08f67a1a4d6277
- Date: Tue, 10 Sep 1991 16:36:41 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: David F. Skoll <dfs@doe.carleton.ca>
- Posting-number: Volume 22, Issue 102
- Archive-name: remind/patch03
- Environment: UNIX, MS-DOS
- Patch-To: remind: Volume 17, Issue 3-6
-
- This is Official Patch #3 for Remind 2.3. You should have Remind 2.3
- patch level 2 before applying this patch.
-
- This patch adds the "-f" command-line option, which causes Remind to
- handle queued reminders in the foreground. This is useful for people
- who run Remind under Sunview or X-Windows, because it allows your
- Remind processes to die automatically when you exit the windowing system.
- See the man page for more details.
-
- To apply the patch, change to the Remind source directory, and unshar this
- article. Type 'patch < patch-03' and re-Make and re-install Remind.
-
- Unfortunately, I can't upload the latest version of Remind to
- alfred.ccs.carleton.ca anymore. I'll send a request that it be uploaded,
- but I can't make any guarantees. However, the source is archived in the
- comp.sources.misc archive.
-
- David F. Skoll
-
- -------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
- #!/bin/sh
- # This is Remind 2.3 Patch 03, a shell archive (shar 3.32)
- # made 09/10/1991 15:00 UTC by dfs@data
- # Source directory /enterprise/transporter/dfs/work/.rem/patch3-work
- #
- # existing files will NOT be overwritten
- #
- # This shar contains:
- # length mode name
- # ------ ---------- ------------------------------------------
- # 9105 -rw------- patch-03
- #
- if touch 2>&1 | fgrep 'amc' > /dev/null
- then TOUCH=touch
- else TOUCH=true
- fi
- # ============= patch-03 ==============
- if test X"$1" != X"-c" -a -f 'patch-03'; then
- echo "File already exists: skipping 'patch-03'"
- else
- echo "x - extracting patch-03 (Text)"
- sed 's/^X//' << 'SHAR_EOF' > patch-03 &&
- XThis patch adds the -f command-line option to Remind. This causes it to
- Xhandle the queued AT reminders in the foreground. This is useful for
- XX-Windows and Sunview applications which desire that Remind be killed when
- Xthe windowing system is exited.
- X
- XChange the WHATSNEW file to reflect the new command line option.
- X*** ../patch2-work/WHATSNEW.23 Wed Jul 17 13:14:26 1991
- X--- ./WHATSNEW.23 Tue Sep 10 10:49:33 1991
- X***************
- X*** 64,66 ****
- X--- 64,70 ----
- X Added the "%#" and "%@" modifiers for the current time.
- X
- X Made the Makefile more portable
- X+
- X+ * Version 2.3 Patch 3 - Added a command-line option for Remind to process
- X+ queued reminders in the foreground. This makes automatic termination
- X+ of Remind processes from within X-Windows and Sunview easier.
- XPut the Foreground global variable in globals.h
- X*** ../patch2-work/globals.h Wed Jul 17 12:52:37 1991
- X--- ./globals.h Tue Sep 10 10:14:41 1991
- X***************
- X*** 47,49 ****
- X--- 47,50 ----
- X extern int CalWidth;
- X extern int SimpleCalendar;
- X extern int Hush;
- X+ extern int Foreground;
- XChange the init.c file to recognize the -f option.
- X*** ../patch2-work/init.c Wed Jul 17 12:52:26 1991
- X--- ./init.c Tue Sep 10 10:25:35 1991
- X***************
- X*** 48,53 ****
- X--- 48,54 ----
- X SimpleCalendar = 0;
- X InfiniteDelta = 0;
- X Hush = 0;
- X+ Foreground = 0;
- X
- X if(argc == 1) {
- X fprintf(stderr,
- X***************
- X*** 54,60 ****
- X "\nREMIND %d.%d Patch Level %d (C) 1990, 1991 by David Skoll.\n\n",
- X VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
- X #ifdef UNIX
- X! fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-voraqth] filename [date]\n\n");
- X #else
- X fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-vorth] filename [date]\n\n");
- X #endif
- X--- 55,61 ----
- X "\nREMIND %d.%d Patch Level %d (C) 1990, 1991 by David Skoll.\n\n",
- X VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
- X #ifdef UNIX
- X! fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-voraqthf] filename [date]\n\n");
- X #else
- X fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-vorth] filename [date]\n\n");
- X #endif
- X***************
- X*** 66,73 ****
- X fprintf(stderr, "-v Verbose messages\n-o Ignore ONCE directives\n");
- X fprintf(stderr, "-r Ignore RUN directives\n");
- X #ifdef UNIX
- X! fprintf(stderr, "-a Do not trigger current AT reminders in foreground\n");
- X fprintf(stderr, "-q Do not queue current AT reminders\n");
- X #endif
- X fprintf(stderr, "-t Trigger all non-expired reminders regardless of delta\n");
- X fprintf(stderr, "-h 'Hush' mode - don't display anything if no reminders triggered\n\n");
- X--- 67,75 ----
- X fprintf(stderr, "-v Verbose messages\n-o Ignore ONCE directives\n");
- X fprintf(stderr, "-r Ignore RUN directives\n");
- X #ifdef UNIX
- X! fprintf(stderr, "-a Do not trigger current AT reminders until specified time\n");
- X fprintf(stderr, "-q Do not queue current AT reminders\n");
- X+ fprintf(stderr, "-f Process queued reminders in the foreground.\n");
- X #endif
- X fprintf(stderr, "-t Trigger all non-expired reminders regardless of delta\n");
- X fprintf(stderr, "-h 'Hush' mode - don't display anything if no reminders triggered\n\n");
- X***************
- X*** 156,162 ****
- X #ifdef UNIX
- X case 'A': PrintAts = 0; break;
- X
- X! case 'Q': QueueAts = 0; break;
- X #endif
- X default: fprintf(stderr, "Unknown option '%c' ignored.\n", *s);
- X }
- X--- 158,166 ----
- X #ifdef UNIX
- X case 'A': PrintAts = 0; break;
- X
- X! case 'Q': QueueAts = 0; break;
- X!
- X! case 'F': Foreground = 1; break;
- X #endif
- X default: fprintf(stderr, "Unknown option '%c' ignored.\n", *s);
- X }
- X*** ../patch2-work/main.c Wed Jul 17 12:53:03 1991
- X--- ./main.c Tue Sep 10 10:11:40 1991
- X***************
- X*** 119,124 ****
- X--- 119,125 ----
- X char QueueAts, PrintAts;
- X int NumAtsQueued;
- X int Calendar, CalTime, CalWidth, SimpleCalendar;
- X+ int Foreground;
- X
- X static int JulFirst; /* Julian date of 1 Jan Current_year */
- X static int FirstYear;
- X***************
- X*** 684,692 ****
- X /* stdout to a file. */
- X
- X if (NumAtsQueued) {
- X! pid = fork();
- X! if (pid == -1) Eprint("Can't fork to perform ATs!\n");
- X! if (pid != 0) return 0;
- X HandleQueuedAts();
- X }
- X #endif
- X--- 685,695 ----
- X /* stdout to a file. */
- X
- X if (NumAtsQueued) {
- X! if (!Foreground) {
- X! pid = fork();
- X! if (pid == -1) Eprint("Can't fork to perform ATs!\n");
- X! if (pid != 0) return 0;
- X! }
- X HandleQueuedAts();
- X }
- X #endif
- X*** ../patch2-work/patchlevel.h Wed Jul 17 12:41:43 1991
- X--- ./patchlevel.h Tue Sep 10 10:07:33 1991
- X***************
- X*** 3,6 ****
- X #define VERSION_MAJOR 2
- X #define VERSION_MINOR 3
- X
- X! #define PATCHLEVEL 2
- X--- 3,6 ----
- X #define VERSION_MAJOR 2
- X #define VERSION_MINOR 3
- X
- X! #define PATCHLEVEL 3
- X*** ../patch2-work/remind.1 Wed Jul 17 12:56:26 1991
- X--- ./remind.1 Tue Sep 10 10:47:40 1991
- X***************
- X*** 5,11 ****
- X .SH SYNOPSIS
- X .B remind
- X [\fB\-n | \fB\-d\fR | \fB\-p\fR | \fB\-c\fR\fIn\fR [\fB\-w\fR\fIn\fR | \fB\-s\fR]]
- X! [\fB\-voraqth\fR]
- X .I filename
- X [\fIdate\fR]
- X .SH DESCRIPTION
- X--- 5,11 ----
- X .SH SYNOPSIS
- X .B remind
- X [\fB\-n | \fB\-d\fR | \fB\-p\fR | \fB\-c\fR\fIn\fR [\fB\-w\fR\fIn\fR | \fB\-s\fR]]
- X! [\fB\-voraqthf\fR]
- X .I filename
- X [\fIdate\fR]
- X .SH DESCRIPTION
- X***************
- X*** 141,147 ****
- X--- 141,166 ----
- X flag causes \fBremind\fR to go into 'Hush' mode. In this mode, if no
- X reminders are triggered, nothing will be displayed. (Normally, \fBremind\fR
- X will display "No reminders." in this case.)
- X+ .TP
- X+ .B \-f
- X+ The
- X+ .B \-f
- X+ flag causes \fBremind\fR to remain in the foreground when handling queued
- X+ AT reminders, rather than forking into the background. This is useful in
- X+ .xinitrc or .suntools scripts, because you can start \fBremind\fR and have
- X+ it automatically killed when you exit X-Windows or Sunview. For example,
- X+ in your .xinitrc script, you could have:
- X .PP
- X+ .nf
- X+ remind -fah $HOME/.reminders > /dev/null 2>&1 &
- X+ .fi
- X+ .PP
- X+ .RS
- X+ Presumably, your .reminders script will contain RUN-type reminders for
- X+ popping windows onto the X-Windows display. When you exit X-Windows,
- X+ the \fBremind\fR process will be killed.
- X+ .RE
- X+ .PP
- X If you supply a
- X .I date
- X on the command line, it must consist of
- X***************
- X*** 812,818 ****
- X be triggered like a normal reminder.) After
- X .B remind
- X has finished processing the reminder file, it starts up a background
- X! process to trigger all the queued timed reminders. As each reminder's
- X trigger time is reached, it is triggered. Thus, you can have
- X .B remind
- X issue reminders just before important meetings or time-sensitive tasks.
- X--- 831,842 ----
- X be triggered like a normal reminder.) After
- X .B remind
- X has finished processing the reminder file, it starts up a background
- X! process to trigger all the queued timed reminders. (However, if you
- X! supply the
- X! .B \-f
- X! command-line option, a background process will not be created. Instead,
- X! the AT reminders will be processed in the foreground.)
- X! As each reminder's
- X trigger time is reached, it is triggered. Thus, you can have
- X .B remind
- X issue reminders just before important meetings or time-sensitive tasks.
- X*** ../patch2-work/timed.c Wed Jul 17 13:07:45 1991
- X--- ./timed.c Tue Sep 10 10:22:44 1991
- X***************
- X*** 65,70 ****
- X--- 65,71 ----
- X prev->next = e;
- X e->next = NULL;
- X }
- X+ return 0;
- X }
- X
- X /***************************************************************/
- X***************
- X*** 166,172 ****
- X unsigned NotSlept;
- X #endif
- X
- X! signal(SIGINT, SigIntHandler);
- X
- X /* If we are not connected to a tty, then we must close the
- X * standard file descriptors. This is to prevent someone
- X--- 167,173 ----
- X unsigned NotSlept;
- X #endif
- X
- X! if (!Foreground) signal(SIGINT, SigIntHandler);
- X
- X /* If we are not connected to a tty, then we must close the
- X * standard file descriptors. This is to prevent someone
- X***************
- X*** 227,233 ****
- X /* SigIntHandler */
- X /* */
- X /* For debugging purposes, when sent a SIGINT, we print the */
- X! /* contents of the queue. */
- X /* */
- X /***************************************************************/
- X void SigIntHandler()
- X--- 228,235 ----
- X /* SigIntHandler */
- X /* */
- X /* For debugging purposes, when sent a SIGINT, we print the */
- X! /* contents of the queue. This does NOT work when the -f */
- X! /* command-line flag is supplied. */
- X /* */
- X /***************************************************************/
- X void SigIntHandler()
- SHAR_EOF
- $TOUCH -am 0910105891 patch-03 &&
- chmod 0600 patch-03 ||
- echo "restore of patch-03 failed"
- set `wc -c patch-03`;Wc_c=$1
- if test "$Wc_c" != "9105"; then
- echo original size 9105, current size $Wc_c
- fi
- fi
- exit 0
-
-
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-