v17i033: remind - A replacement for calendar, Patch01

David F. Skoll dfs at doe.carleton.ca
Sat Mar 9 03:00:56 AEST 1991


Submitted-by: David F. Skoll <dfs at doe.carleton.ca>
Posting-number: Volume 17, Issue 33
Archive-name: remind/patch01
Patch-To: remind: Volume 17, Issue 3-6

This is the Official Patch 01 for Remind 2.3.  Here's the excerpt from
WHATSNEW.23:

* Version 2.3 Patch 1 - Added the "-t" command-line option to get Remind
to trigger all non-expired reminders.

Added Turbo C support courtesy of Rhys Weatherly

Added the "RUN ON" and "RUN OFF" commands for a secure interface with
the Elm mail system.

Added the "rem" shell script for running Remind with a default script.

Added manual pages for "kall" and "rem".

--
David F. Skoll

------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
#!/bin/sh
# This is Remind-2.3-Official-Patch-01, a shell archive (shar 3.32)
# made 03/07/1991 20:58 UTC by dfs at scotty
#
# existing files will NOT be overwritten
#
# This shar contains:
# length  mode       name
# ------ ---------- ------------------------------------------
#  27677 -rw------- patch.01
#    679 -rw------- kall.1
#    851 -rw------- makefile.tc
#    102 -rw------- patchlevel.h
#    850 -rwx------ rem
#    772 -rw------- rem.1
#    129 -rw------- remind.rsp
#   1640 -rw------- turboc.c
#    759 -rw------- turboc.h
#
if touch 2>&1 | fgrep 'amc' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
# ============= patch.01 ==============
if test X"$1" != X"-c" -a -f 'patch.01'; then
	echo "File already exists: skipping 'patch.01'"
else
echo "x - extracting patch.01 (Text)"
sed 's/^X//' << 'SHAR_EOF' > patch.01 &&
XThis is Remind-2.3-Official-Patch-01
X
XThis patch adds support for the -t option and the RUN command.
XIt modifies README files and man pages to reflect the new commands,
Xas well as the added Turbo C support.  It also adds acknowledgements to
Xthe COPYRIGHT file.
X
X*** ../old/COPYRIGHT	Mon Feb 18 13:05:16 1991
X--- ./COPYRIGHT	Mon Feb 25 17:05:00 1991
X***************
X*** 4,10 ****
X  REMIND package.
X  
X  REMIND is Copyright (C) 1990, 1991 by David Skoll, except for the file
X! remind-all.sh, which is Copyright (C) 1990 by Bill Aten.
X  
X  You may use REMIND for free, and may freely distribute it, providing
X  you do not charge the recipients to whom you distribute REMIND.
X--- 4,11 ----
X  REMIND package.
X  
X  REMIND is Copyright (C) 1990, 1991 by David Skoll, except for the file
X! remind-all.sh, which is Copyright (C) 1990 by Bill Aten, and the Turbo C
X! support, which is Copyright (C) 1991 by Rhys Weatherly.
X  
X  You may use REMIND for free, and may freely distribute it, providing
X  you do not charge the recipients to whom you distribute REMIND.
X***************
X*** 21,25 ****
X  I will attempt to support REMIND as much as possible.  However, you use
X  it at your own risk.  I am not responsible for any damages caused by
X  the use or misuse of REMIND.
X  --
X! David F. Skoll
X--- 22,65 ----
X  I will attempt to support REMIND as much as possible.  However, you use
X  it at your own risk.  I am not responsible for any damages caused by
X  the use or misuse of REMIND.
X+ 
X+ If you wish to contribute ideas or money to help the production of
X+ software like REMIND, you can reply to the address shown at the end of
X+ this file.  Note that you are under no obligation to send me money.
X+ If you don't donate, you have full rights to use REMIND just as if you
X+ had donated.  If you do donate, you get a big thank-you, but no
X+ special rights.  However, you will have helped support the production
X+ of software like REMIND.  Should you wish to donate, the suggested
X+ amount is $18.00 (Canadian)
X+ 
X+ ACKNOWLEDGEMENTS:
X+ 
X+ I would like to thank the following people:
X+ 
X+ Bill Aten <netagw!bill at uunet.UU.NET> for providing remind-all.sh
X+ 
X+ Bradley D. Keister <keister at poincare.phys.cmu.edu>, Rhys Weatherly
X+ <rhys at batserver.cs.uq.OZ.AU> and Anthony Cheng for providing the Turbo
X+ C compiler support
X+ 
X+ Bill Silvert <bill%biomel at cs.dal.ca> and Dennis Cottel
X+ <dennis at peanuts.nosc.mil> for suggesting many of the new features in
X+ REMIND.
X+ 
X+ Timo Salmi, Keith Petersen, Bill Davidsen and Kent Landfield for maintaining
X+ the uwasa and SIMTEL archives, and comp.binaries.ibm.pc and comp.sources.misc
X+ in the face of a flurry of updates to REMIND.
X+ 
X+ All others who have corresponded with me to report bugs, express appreciation
X+ or suggest features - too many people to list here.
X+ 
X+ Finally, all those who donated money to support the production of
X+ REMIND.  Your donations were gratefully appreciated.
X  --
X! David F. Skoll <dfs at doe.carleton.ca>
X! 4-317 LeBreton Street South
X! Ottawa, Ontario K1S 4L4
X! CANADA
X! 
X! Tel. (613) 567-3662
X! 
X*** ../old/Makefile	Mon Feb 18 13:05:16 1991
X--- ./Makefile	Tue Feb 26 14:37:07 1991
X***************
X*** 1,4 ****
X! # Makefile for REMIND - simple file
X  
X  #--------------- BEGINNING OF THINGS YOU CAN CHANGE --------------
X  
X--- 1,4 ----
X! # Makefile for REMIND
X  
X  #--------------- BEGINNING OF THINGS YOU CAN CHANGE --------------
X  
X***************
X*** 20,30 ****
X  
X  #Where do you want it installed?
X  BINDIR= /usr/local/bin
X! KALLDIR= /usr/share/bin
X  MANDIR= /usr/share/man
X  MANSECTION= 1
X  
X! #What program does the installation?
X  INSTALL= install
X  #INSTALL= cp
X  
X--- 20,36 ----
X  
X  #Where do you want it installed?
X  BINDIR= /usr/local/bin
X! 
X! # If you have a special directory for shell scripts, install them
X! # there.  Otherwise, make SCRIPTDIR the same as BINDIR
X! SCRIPTDIR= /usr/share/bin
X! 
X! # This should be the top-level MAN directory
X  MANDIR= /usr/share/man
X  MANSECTION= 1
X  
X! # What program does the installation?  If you don't have 'install', use
X! # 'cp' instead.
X  INSTALL= install
X  #INSTALL= cp
X  
X***************
X*** 58,67 ****
X  
X  install:
X  	$(INSTALL) remind $(BINDIR)
X  
X  install.man:
X  	$(INSTALL) remind.1 $(MANDIR)/man$(MANSECTION)/remind.$(MANSECTION)
X! 
X! install.kall:
X! 	$(INSTALL) kall $(KALLDIR)
X  
X--- 64,74 ----
X  
X  install:
X  	$(INSTALL) remind $(BINDIR)
X+ 	$(INSTALL) kall $(SCRIPTDIR)
X+ 	$(INSTALL) rem $(SCRIPTDIR)
X  
X  install.man:
X  	$(INSTALL) remind.1 $(MANDIR)/man$(MANSECTION)/remind.$(MANSECTION)
X! 	$(INSTALL) rem.1 $(MANDIR)/man$(MANSECTION)/rem.$(MANSECTION)
X! 	$(INSTALL) kall.1 $(MANDIR)/man$(MANSECTION)/kall.$(MANSECTION)
X  
X*** ../old/README.DOS	Mon Feb 18 13:05:16 1991
X--- ./README.DOS	Mon Feb 25 17:09:21 1991
X***************
X*** 4,10 ****
X  
X  REMIND was originally written for MS-DOS.  To compile it, you need the
X  Microsoft C compiler (at least version 5.1) and the Microsoft MAKE
X! utility.
X  
X  Before compiling the software, check if it includes patches.  These are
X  files called patch.xx.  If there are patches, apply them all by typing
X--- 4,12 ----
X  
X  REMIND was originally written for MS-DOS.  To compile it, you need the
X  Microsoft C compiler (at least version 5.1) and the Microsoft MAKE
X! utility.  Alternatively, you can use the Turbo C compiler.  The Turbo
X! C support was supplied by Rhys Weatherly; as I do not have access to a
X! Turbo C compiler, I cannot test it.
X  
X  Before compiling the software, check if it includes patches.  These are
X  files called patch.xx.  If there are patches, apply them all by typing
X***************
X*** 14,21 ****
X  on a Unix machine.  Then copy the software to your MS-DOS machine.
X  
X  To compile the software, simply go to the source directory and type:
X  
X! MAKE REMIND.MAK
X  
X  The file test.rem contains test reminders for verifying that REMIND's
X  date calculation routines are working correctly.  The file test.out
X--- 16,25 ----
X  on a Unix machine.  Then copy the software to your MS-DOS machine.
X  
X  To compile the software, simply go to the source directory and type:
X+ MAKE REMIND.MAK if you are using the Microsoft C compiler.
X  
X! If you are using the Turbo C compiler, rename the "MAKEFILE.TC" file
X! to MAKEFILE (throw out the Unix Makefile) and type MAKE.
X  
X  The file test.rem contains test reminders for verifying that REMIND's
X  date calculation routines are working correctly.  The file test.out
X*** ../old/README.UNIX	Mon Feb 18 13:05:16 1991
X--- ./README.UNIX	Tue Feb 26 14:38:52 1991
X***************
X*** 27,41 ****
X  
X  Once remind has been compiled, install it in your favourite system
X  directory.  Type "make install" to install the executable, and "make
X! install.man" to install the manpage.  If you want to install the "kall"
X! script, type "make install.kall"
X  
X  Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
X  These allow automatic mailing of reminders to all users who create a
X  $HOME/.reminders file.  These two scripts are equivalent; one is a
X  "sh" script and the other is a "csh" script.  Pick the one you want to
X  use, and follow the instructions in the opening comments of the
X! script.
X  
X  A shell script called "kall" is provided which kills processes
X  specified by command name rather than process ID.  You may have to
X--- 27,44 ----
X  
X  Once remind has been compiled, install it in your favourite system
X  directory.  Type "make install" to install the executable, and "make
X! install.man" to install the manpage.  You may wish to edit the
X! 'install:' and 'install.man:' targets of the Makefile in case you do
X! not wish to install the shell scripts.
X  
X+ 
X  Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
X  These allow automatic mailing of reminders to all users who create a
X  $HOME/.reminders file.  These two scripts are equivalent; one is a
X  "sh" script and the other is a "csh" script.  Pick the one you want to
X  use, and follow the instructions in the opening comments of the
X! script.  Neither of these scripts will be installed automatically; you
X! must copy them by hand to the desired destination.
X  
X  A shell script called "kall" is provided which kills processes
X  specified by command name rather than process ID.  You may have to
X***************
X*** 46,51 ****
X--- 49,59 ----
X  with 2.2 - the new version requires an exact match of command name,
X  not just a command name which contains the specified
X  string.
X+ 
X+ A shell script called "rem" is provided for those who like to have
X+ 'remind' assume a default reminders file.  A man page for this script
X+ is provided.  You should examine the script to ensure that the defaults
X+ are correct.
X  
X  --
X  David F. Skoll <dfs at doe.carleton.ca>
X*** ../old/WHATSNEW.23	Mon Feb 18 13:05:16 1991
X--- ./WHATSNEW.23	Thu Mar  7 15:24:35 1991
X***************
X*** 1,24 ****
X  A BRIEF HISTORY OF REMIND:
X  
X! Version 1.0 - never publicly released.
X  
X! Version 2.0 - first public release.  Included advanced date specifications,
X  character substitution, and the RUN keyword.
X  
X! Version 2.1 - Added the "repeat" token for repeating reminders with a period
X  other than 7 days.  Also fixed some bugs from version 2.0
X  
X! Version 2.2 - Added the AT keyword, the timed reminders daemon, and the
X  calendar facility.
X  
X! Version 2.2 - Patch 3  - Added the MSG or RUN tokens in an OMIT command; also
X  allowed RUN-type reminders to be explicitly included in the calendar by
X  using the %" escape sequence.
X  
X! Version 2.2 - Patch 5 - Added the BEFORE, AFTER and SKIP tokens to make the
X  handling of holidays more sensible.  Also corrected a few more bugs.
X  
X! Version 2.3 - Added the UNTIL keyword for forcing reminders to expire.
X  
X  Added the "++" form of 'back' and the "--" form of 'delta' for
X  ignoring OMIT information.
X--- 1,24 ----
X  A BRIEF HISTORY OF REMIND:
X  
X! * Version 1.0 - never publicly released.
X  
X! * Version 2.0 - first public release.  Included advanced date specifications,
X  character substitution, and the RUN keyword.
X  
X! * Version 2.1 - Added the "repeat" token for repeating reminders with a period
X  other than 7 days.  Also fixed some bugs from version 2.0
X  
X! * Version 2.2 - Added the AT keyword, the timed reminders daemon, and the
X  calendar facility.
X  
X! * Version 2.2 - Patch 3  - Added the MSG or RUN tokens in an OMIT command; also
X  allowed RUN-type reminders to be explicitly included in the calendar by
X  using the %" escape sequence.
X  
X! * Version 2.2 - Patch 5 - Added the BEFORE, AFTER and SKIP tokens to make the
X  handling of holidays more sensible.  Also corrected a few more bugs.
X  
X! * Version 2.3 - Added the UNTIL keyword for forcing reminders to expire.
X  
X  Added the "++" form of 'back' and the "--" form of 'delta' for
X  ignoring OMIT information.
X***************
X*** 38,40 ****
X--- 38,51 ----
X  Modified the calendar and SimpleCalendar formats so that the % escape
X  substitutions ARE performed.
X  
X+ * Version 2.3 Patch 1 - Added the "-t" command-line option to get Remind
X+ to trigger all non-expired reminders.
X+ 
X+ Added Turbo C support courtesy of Rhys Weatherly
X+ 
X+ Added the "RUN ON" and "RUN OFF" commands for a secure interface with
X+ the Elm mail system.
X+ 
X+ Added the "rem" shell script for running Remind with a default script.
X+ 
X+ Added manual pages for "kall" and "rem".
X*** ../old/defines.h	Mon Feb 18 13:05:17 1991
X--- ./defines.h	Thu Mar  7 14:33:22 1991
X***************
X*** 16,21 ****
X--- 16,23 ----
X  #define FOMITSIZE 150
X  #define POMITSIZE 75
X  
X+ /* Size of buffer for reminder file lines */
X+ #define BUFFER_SIZE 512
X  /* Useful macros */
X  
X  #define upper(c) ( ((c) >= 'a' && (c) <= 'z') ? ((c)-32) : (c) )
X***************
X*** 38,44 ****
X  enum Token_t { Unknown_t, Year_t, Month_t, Day_t, WkDay_t, Msg_t, Run_t,
X  	       Omit_t, Banner_t, Rem_t, Delta_t, Back_t, Once_t, Include_t,
X                 Repeat_t, At_t, Time_t, Skip_t, Until_t, Push_t, Pop_t,
X! 	       Clear_t, Eol_t };
X  
X  /* Define the Token structure */
X  
X--- 40,46 ----
X  enum Token_t { Unknown_t, Year_t, Month_t, Day_t, WkDay_t, Msg_t, Run_t,
X  	       Omit_t, Banner_t, Rem_t, Delta_t, Back_t, Once_t, Include_t,
X                 Repeat_t, At_t, Time_t, Skip_t, Until_t, Push_t, Pop_t,
X! 	       Clear_t, OnOff_t, Eol_t };
X  
X  /* Define the Token structure */
X  
X***************
X*** 62,64 ****
X--- 64,69 ----
X  } AtEntry;
X  #endif
X  
X+ #ifdef __TURBOC__
X+ #include "turbo.h"
X+ #endif
X*** ../old/dorem.c	Mon Feb 18 13:05:17 1991
X--- ./dorem.c	Thu Mar  7 15:16:29 1991
X***************
X*** 319,328 ****
X     }
X         
X     /* Figure out if the reminder should be triggered */
X  
X-    trigger = MoveBack(jul, delta, omit);
X- 
X     if(Debug) {
X        Eprint("%sTrigger date: %s, %d %s, %d.\n", 
X                (trigger <= JulianToday ? "*" : ""), DayName[jul % 7], 
X  	      d2, MonthName[m2], y2);
X--- 319,333 ----
X     }
X         
X     /* Figure out if the reminder should be triggered */
X+    /* If the -t command-line option was supplied, trigger the reminder. */
X+    if (InfiniteDelta) trigger = 0;
X+    else trigger = MoveBack(jul, delta, omit);
X  
X     if(Debug) {
X+ /* Check for potentially dangerous RUN-type reminders if Debug is on */
X+       if (tok.type == Run_t && (IgRun & 2))
X+          Eprint("Warning: RUN-type reminder after RUN OFF command.\n");
X+        
X        Eprint("%sTrigger date: %s, %d %s, %d.\n", 
X                (trigger <= JulianToday ? "*" : ""), DayName[jul % 7], 
X  	      d2, MonthName[m2], y2);
X***************
X*** 332,338 ****
X  
X     while (isspace(**s)) (*s)++;
X  
X!    if (trigger <= JulianToday && !(tok.type == Run_t && IgRun)) { 
X        /* Trigger a reminder */
X  #ifdef UNIX
X        if (QueueAts && (jul == JulianToday) && (tim != -1)) {
X--- 337,344 ----
X  
X     while (isspace(**s)) (*s)++;
X  
X!    if (trigger <= JulianToday
X!         && !(tok.type == Run_t && IgRun)) { 
X        /* Trigger a reminder */
X  #ifdef UNIX
X        if (QueueAts && (jul == JulianToday) && (tim != -1)) {
X*** ../old/files.c	Mon Feb 18 13:05:18 1991
X--- ./files.c	Mon Feb 25 17:01:30 1991
X***************
X*** 262,268 ****
X     Fresh = 1;
X     while (!done) {
X        CurLine++;
X!       if (fgets(Line, 512, fp) == NULL) {
X           if (ferror(fp)) Eprint("Error reading %s\n", FileName);
X  	 if (PopFile()) return 1;
X        } else {
X--- 262,268 ----
X     Fresh = 1;
X     while (!done) {
X        CurLine++;
X!       if (fgets(Line, BUFFER_SIZE, fp) == NULL) {
X           if (ferror(fp)) Eprint("Error reading %s\n", FileName);
X  	 if (PopFile()) return 1;
X        } else {
X***************
X*** 273,281 ****
X              len--;
X           }
X           done = 1;
X!          while(*Line && (*(Line + len-1) == '\\') && len<512) {
X   	    *(Line + len-1) = '\n';
X!             if (fgets(Line+len, 512-len,fp) == NULL) {
X                 *(Line + len) = 0;
X    	       break;
X  	    }
X--- 273,281 ----
X              len--;
X           }
X           done = 1;
X!          while(*Line && (*(Line + len-1) == '\\') && len<BUFFER_SIZE) {
X   	    *(Line + len-1) = '\n';
X!             if (fgets(Line+len, BUFFER_SIZE-len,fp) == NULL) {
X                 *(Line + len) = 0;
X    	       break;
X  	    }
X*** ../old/globals.h	Mon Feb 18 13:05:18 1991
X--- ./globals.h	Thu Mar  7 15:13:58 1991
X***************
X*** 23,28 ****
X--- 23,29 ----
X  extern char  Debug;
X  extern char  Verbose;
X  extern char  Next;
X+ extern char  InfiniteDelta;
X  extern char  FileName[];
X  extern int   CurLine;
X  extern int   NumEmitted;
X*** ../old/init.c	Mon Feb 18 13:05:18 1991
X--- ./init.c	Thu Mar  7 15:42:28 1991
X***************
X*** 7,13 ****
X  #include "globals.h"
X  #include "protos.h"
X  
X! #define PATCHLEVEL 0
X  
X  static char DPMsg[] = "Debug and Purge options conflict - Purge chosen.\n";
X  static char DPCMsg[] = "Calendar overrides Debug and Purge options.\n";
X--- 7,13 ----
X  #include "globals.h"
X  #include "protos.h"
X  
X! #include "patchlevel.h"
X  
X  static char DPMsg[] = "Debug and Purge options conflict - Purge chosen.\n";
X  static char DPCMsg[] = "Calendar overrides Debug and Purge options.\n";
X***************
X*** 46,58 ****
X     QueueAts = 1;
X     CalWidth = 10;
X     SimpleCalendar = 0;
X  
X     if(argc == 1) {
X!      fprintf(stderr, "\nREMIND 2.3 Patch Level %d (C) 1990, 1991 by David Skoll.\n\n", PATCHLEVEL);
X  #ifdef UNIX
X!      fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-voraq] filename [date]\n\n");
X  #else
X!      fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-vor] filename [date]\n\n");
X  #endif
X       fprintf(stderr, "-n   Output next occurrence of reminders in simple format\n");
X       fprintf(stderr, "-d   Debug reminder file\n-p   Purge reminder file\n");
X--- 46,61 ----
X     QueueAts = 1;
X     CalWidth = 10;
X     SimpleCalendar = 0;
X+    InfiniteDelta = 0;
X  
X     if(argc == 1) {
X!      fprintf(stderr,
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]] [-voraqt] filename [date]\n\n");
X  #else
X!      fprintf(stderr, "Usage: remind [-n | -d | -p | -c# [-w# | -s]] [-vort] filename [date]\n\n");
X  #endif
X       fprintf(stderr, "-n   Output next occurrence of reminders in simple format\n");
X       fprintf(stderr, "-d   Debug reminder file\n-p   Purge reminder file\n");
X***************
X*** 63,70 ****
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\n");
X  #endif
X       exit(1);
X     }
X  
X--- 66,74 ----
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\n");
X       exit(1);
X     }
X  
X***************
X*** 143,148 ****
X--- 147,154 ----
X  	    case 'O': IgOnce = 1; break;
X  
X  	    case 'R': IgRun = 1; break;
X+ 
X+ 	    case 'T': InfiniteDelta = 1; break;
X  #ifdef UNIX
X  	    case 'A': PrintAts = 0; break;
X  
X*** ../old/kall	Mon Feb 18 13:05:18 1991
X--- ./kall	Mon Feb 25 11:50:30 1991
X***************
X*** 25,31 ****
X  
X  # NOTE:  You may have to modify the next line, since PS is non-portable.
X  # The 'awk' command picks out the process IDs to pass them on to kill.
X! 	rprocs=`ps -cx | awk '{if(prog == $5) print $1}' prog=$1 -`
X  	if [ "$rprocs" != "" ]; then
X  		msg="1"
X  		echo -n "${me}: Sending $signal signal to $1 process(es)"
X--- 25,31 ----
X  
X  # NOTE:  You may have to modify the next line, since PS is non-portable.
X  # The 'awk' command picks out the process IDs to pass them on to kill.
X! 	rprocs=`ps cx | awk '{if(prog == $5) print $1}' prog=$1 -`
X  	if [ "$rprocs" != "" ]; then
X  		msg="1"
X  		echo -n "${me}: Sending $signal signal to $1 process(es)"
X*** ../old/main.c	Mon Feb 18 13:05:18 1991
X--- ./main.c	Thu Mar  7 15:37:14 1991
X***************
X*** 64,70 ****
X--- 64,72 ----
X     { "MSG",       Msg_t,    0, 3 },
X     { "November",  Month_t,  10, 3 },
X     { "October",   Month_t,  9, 3 },
X+    { "OFF",       OnOff_t,  0, 3},
X     { "OMIT",      Omit_t,   0, 3 },
X+    { "ON",        OnOff_t,  1, 2 },
X     { "ONCE",      Once_t,   0, 3 },
X     { "POP-OMIT-CONTEXT", Pop_t, 0, 3},
X     { "PUSH-OMIT-CONTEXT", Push_t, 0, 3 },
X***************
X*** 99,110 ****
X  int PartOmitArray[POMITSIZE];
X  
X  /* Define the working buffers */
X! char Line[512], WorkBuf[512];
X! char TmpBuf[512];
X  char Fresh;  /* True if the contents of Line are fresh */
X  
X  /* Global variables */
X! char Purge, Debug, Verbose, IgRun, IgOnce, Next;
X  int LastRun;
X  char FileName[200];
X  int CurLine;
X--- 101,112 ----
X  int PartOmitArray[POMITSIZE];
X  
X  /* Define the working buffers */
X! char Line[BUFFER_SIZE], WorkBuf[BUFFER_SIZE];
X! char TmpBuf[BUFFER_SIZE];
X  char Fresh;  /* True if the contents of Line are fresh */
X  
X  /* Global variables */
X! char Purge, Debug, Verbose, IgRun, IgOnce, Next, InfiniteDelta;
X  int LastRun;
X  char FileName[200];
X  int CurLine;
X***************
X*** 234,239 ****
X--- 236,245 ----
X  		      DoInclude(&s);
X  		      break;
X  
X+       case Run_t:    DoRun(&s);
X+                      if (Purge && TopLevel()) Output(Line);
X+                      break;
X+ 
X        default:       if (Purge && TopLevel()) Output(Line);
X  		     Eprint("Unknown command '%s'\n", tok.str);
X     }
X***************
X*** 341,346 ****
X--- 347,353 ----
X        else if (d > 0 && d <= DaysInMonth(m, y)) return 0; else return 1;
X  }
X  
X+ #ifndef __TURBOC__
X  /***************************************************************/
X  /*                                                             */
X  /*  int strncmpi(char *s1, char*s1, int n)                     */
X***************
X*** 371,376 ****
X--- 378,386 ----
X     return 0;
X  }
X  
X+ #endif
X+ /* __TURBOC__*/
X+ 
X  /***************************************************************/
X  /*                                                             */
X  /*  ParseToken(char **s);                                      */
X***************
X*** 707,710 ****
X--- 717,752 ----
X     _dos_gettime(&tloc);
X     return (long) tloc.hour * 3600L + (long) tloc.minute * 60L + (long) tloc.second;
X  #endif
X+ }
X+ 
X+ /***************************************************************/
X+ /*                                                             */
X+ /* DoRun - handle the RUN ON or RUN OFF command.               */
X+ /*                                                             */
X+ /***************************************************************/
X+ #ifdef __STDC__
X+ void DoRun(char **s)
X+ #else
X+ void DoRun(s)
X+ char **s;
X+ #endif
X+ {
X+    Token tok;
X+ 
X+    tok = ParseToken(s);
X+ 
X+    if (tok.type != OnOff_t) {
X+       Eprint("RUN must be followed by ON or OFF.\n");
X+       return;
X+    }
X+ 
X+    if (!TopLevel()) {
X+       Eprint("RUN command not valid within INCLUDE file.\n");
X+       return;
X+    }
X+ 
X+    if (tok.val) IgRun &= (~2);
X+    else         IgRun |= 2;
X+ 
X+    return;
X  }
X*** ../old/protos.h	Mon Feb 18 13:05:19 1991
X--- ./protos.h	Thu Mar  7 14:50:59 1991
X***************
X*** 10,15 ****
X--- 10,16 ----
X  int   DoGlobalOmit(char **s);
X  void  DoInclude   (char **s);
X  int   DoRem       (char **s);
X+ void  DoRun       (char **s);
X  int   DoSubst     (char *src, char *dst, int d, int m, int y, int jul, enum Token_t t, int tim, int mode);
X  int   FindTodaysDate(int *d, int *m, int *y);
X  void  FreeStackedOmits (void);
X***************
X*** 45,50 ****
X--- 46,52 ----
X  int   DoGlobalOmit();
X  void  DoInclude   ();
X  int   DoRem       ();
X+ void  DoRun       ();
X  int   DoSubst     ();
X  int   FindTodaysDate();
X  void  FreeStackedOmits();
X*** ../old/remind.1	Mon Feb 18 13:05:20 1991
X--- ./remind.1	Thu Mar  7 15:52:55 1991
X***************
X*** 1,4 ****
X! .TH REMIND 1 "18 February 1991"
X  .UC 4
X  .SH NAME
X  remind \- a sophisticated reminder service
X--- 1,4 ----
X! .TH REMIND 1 "7 March 1991"
X  .UC 4
X  .SH NAME
X  remind \- a sophisticated reminder service
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\-voraq\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\-voraqt\fR]
X  .I filename
X  [\fIdate\fR]
X  .SH DESCRIPTION
X***************
X*** 126,131 ****
X--- 126,139 ----
X  reminders for triggering later in the day.  This prevents
X  .B remind
X  from running as a daemon and popping up reminders as they are triggered.
X+ .TP
X+ .B \-t
X+ The
X+ .B \-t
X+ flag causes \fBremind\fR to trigger all reminders which have not expired.
X+ In effect, this causes reminders to be treated as if they have an
X+ infinite value of "delta"; ie, they are triggered no matter how far in the
X+ future they are.
X  .PP
X  If you supply a
X  .I date
X***************
X*** 1306,1311 ****
X--- 1314,1360 ----
X  or
X  .I RUN
X  token.
X+ .SH THE RUN COMMAND
X+ The \fIRUN\fR command comes in two flavours:
X+ .PP
X+ .nf
X+ 	RUN OFF
X+ 	RUN ON
X+ .fi
X+ .PP
X+ The \fIRUN OFF\fR command disables the \fIRUN\fR-type reminders from
X+ being triggered.  This is similar to the \fB\-r\fR flag on the command
X+ line.  The \fIRUN ON\fR command re-enables the \fIRUN\fR-type reminders.
X+ Note that if you supply the \fB\-r\fR flag on the command line,
X+ \fIRUN\fR-type reminders are disabled regardless of any \fIRUN\fR commands
X+ in your reminder file.
X+ .PP
X+ The purpose of the \fIRUN\fR command is to provide a secure interface
X+ between \fBRemind\fR and the \fBElm\fR mail system.  The \fBElm\fR
X+ system can automatically scan incoming mail for reminder or calendar
X+ entries, and place them in your calendar file.  To use this feature,
X+ you should set the calendar filename option under \fBElm\fR to be something
X+ like "~/.reminders.in", \fInot\fB your main reminder file!  (The reason will
X+ become clear.)
X+ .PP
X+ Then, you can use the \fBElm\fR \fIscan message for calendar entries\fR
X+ command to place reminders prefaced by "->" into .reminders.in.  In
X+ your main .reminders file, include the following lines:
X+ .PP
X+ .nf
X+ 	RUN OFF   # Disable RUN
X+ 	INCLUDE .reminders.in
X+ 	RUN ON    # Re-enable RUN
X+ .fi
X+ .PP
X+ The \fIRUN OFF\fR command disables \fIRUN\fR-type reminders.  This ensures
X+ that if any malicious person mails you a potentially destructive reminder,
X+ it will not be processed.  Furthermore, if the person places a \fIRUN ON\fR
X+ command in the mail, it will not execute, since the \fIRUN\fR command can
X+ only be executed from the topmost file, and not from an INCLUDEd file.
X+ This is the reason for placing incoming reminders into an INCLUDEd file rather
X+ than the main file.  If you run REMIND with debugging on, it will warn you
X+ of \fIRUN\fR-type reminders placed after a \fIRUN OFF\fR command.
X  .SH PRODUCING A CALENDAR
X  If you provide the \fB\-c\fR option, the \fBremind\fR will scan your
X  reminder file and produce a calendar with your reminders entered on the
X***************
X*** 1335,1341 ****
X  calendar.
X  If you indicate empty text for the calendar entry
X  with the sequence \fB%"%"\fR, then the reminder is ignored when producing
X! the calendar, whether is is a \fIMSG\fR or \fIRUN\fR type.
X  .PP
X  If your reminder file has errors in it, when you produce a calendar, you
X  will get many error messages apparently coming from the file "*cache*"
X--- 1384,1390 ----
X  calendar.
X  If you indicate empty text for the calendar entry
X  with the sequence \fB%"%"\fR, then the reminder is ignored when producing
X! the calendar, whether it is a \fIMSG\fR or \fIRUN\fR type.
X  .PP
X  If your reminder file has errors in it, when you produce a calendar, you
X  will get many error messages apparently coming from the file "*cache*"
X***************
X*** 1496,1498 ****
X--- 1545,1549 ----
X  has some built-in limits on total line length (511 characters),
X  the length of an expanded \fIREM\fR body (511 characters), the number
X  of global \fIOMIT\fRs, etc.
X+ .SH SEE ALSO
X+ kall, rem, elm
X*** ../old/remind.mak	Mon Feb 18 13:05:20 1991
X--- ./remind.mak	Thu Mar  7 14:45:41 1991
X***************
X*** 14,20 ****
X  dorem.obj: dorem.c $(HEADERS)
X     cl $(WARN) /AS /Fodorem.obj /c dorem.c
X  
X! init.obj: init.c $(HEADERS)
X     cl $(WARN) /AS /Foinit.obj /c init.c
X  
X  dosubst.obj: dosubst.c
X--- 14,20 ----
X  dorem.obj: dorem.c $(HEADERS)
X     cl $(WARN) /AS /Fodorem.obj /c dorem.c
X  
X! init.obj: init.c $(HEADERS) patchlevel.h
X     cl $(WARN) /AS /Foinit.obj /c init.c
X  
X  dosubst.obj: dosubst.c
SHAR_EOF
$TOUCH -am 0307155991 patch.01 &&
chmod 0600 patch.01 ||
echo "restore of patch.01 failed"
set `wc -c patch.01`;Wc_c=$1
if test "$Wc_c" != "27677"; then
	echo original size 27677, current size $Wc_c
fi
fi
# ============= kall.1 ==============
if test X"$1" != X"-c" -a -f 'kall.1'; then
	echo "File already exists: skipping 'kall.1'"
else
echo "x - extracting kall.1 (Text)"
sed 's/^X//' << 'SHAR_EOF' > kall.1 &&
X.TH KALL 1 "26 February 1991"
X.UC 4
X.SH NAME
Xkall \- kill processes by command name
X.SH SYNOPSIS
X.B kall
X[\-\fIsignal\fR] prog1 [prog2...]
X.SH DESCRIPTION
X.B Kall
Xsends the specified \fIsignal\fR (defaults to \fB-TERM\fR) to all processes
Xwhose command name is specified on the command line.  For example:
X.PP
X.nf
X	kall -HUP remind foobar
X.fi
X.PP
Xsends a \fBHUP\fR signal to all \fIremind\fR and \fIfoobar\fR programs.
XNote that \fBkall\fR sends signals only to those processes owned by the
Xuser invoking \fBkall\fR.
X.SH AUTHOR
XDavid F. Skoll
X.SH BUGS
X.B Kall
Xis a sh(1) script and depends on the behaviour of ps(1); thus, it is
Xnot especially portable.
X.SH SEE ALSO
Xremind, rem
SHAR_EOF
$TOUCH -am 0226144491 kall.1 &&
chmod 0600 kall.1 ||
echo "restore of kall.1 failed"
set `wc -c kall.1`;Wc_c=$1
if test "$Wc_c" != "679"; then
	echo original size 679, current size $Wc_c
fi
fi
# ============= makefile.tc ==============
if test X"$1" != X"-c" -a -f 'makefile.tc'; then
	echo "File already exists: skipping 'makefile.tc'"
else
echo "x - extracting makefile.tc (Text)"
sed 's/^X//' << 'SHAR_EOF' > makefile.tc &&
X# Makefile.tc - Makefile for REMIND for Turbo C
X
X#--------------- BEGINNING OF THINGS YOU CAN CHANGE --------------
X
XCFLAGS=-mc -DNO_MALLOC_H -w-pia -w-rvl
XCC=tcc
X
X#Where do you want it installed?
XBINDIR= c:\bin
X
X#--------------- SHOULDN'T CHANGE STUFF BELOW HERE ---------------
X
XHEADERS=globals.h protos.h defines.h turboc.h
XOBJECTS=main.obj nextdate.obj dorem.obj dosubst.obj \
X	files.obj calendar.obj cache.obj omits.obj turboc.obj
X
Xall:		remind.exe
X
Xremind.exe:	remind.lib
X		$(CC) $(CFLAGS) -eremind.exe remind.lib
X
Xremind.lib:	$(OBJECTS) init.obj
X		tlib remind.lib /C @remind.rsp
X
X.c.obj:		
X		$(CC) $(CFLAGS) -c $<
X
X$(OBJECTS):	$(HEADERS)
X
Xinit.obj:	init.c $(HEADERS) patchlevel.h
X		$(CC) $(CFLAGS) -c init.c
X
Xinstall:	remind.exe
X		copy remind.exe $(BINDIR)
X
Xclean:
X		del *.obj
X		del remind.lib
X		del remind.bak
X
Xclobber:	clean
X		del remind.exe
SHAR_EOF
$TOUCH -am 0307144891 makefile.tc &&
chmod 0600 makefile.tc ||
echo "restore of makefile.tc failed"
set `wc -c makefile.tc`;Wc_c=$1
if test "$Wc_c" != "851"; then
	echo original size 851, current size $Wc_c
fi
fi
# ============= patchlevel.h ==============
if test X"$1" != X"-c" -a -f 'patchlevel.h'; then
	echo "File already exists: skipping 'patchlevel.h'"
else
echo "x - extracting patchlevel.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > patchlevel.h &&
X/* patchlevel.h for Remind. */
X
X#define VERSION_MAJOR 2
X#define VERSION_MINOR 3
X
X#define PATCHLEVEL 1
SHAR_EOF
$TOUCH -am 0307144591 patchlevel.h &&
chmod 0600 patchlevel.h ||
echo "restore of patchlevel.h failed"
set `wc -c patchlevel.h`;Wc_c=$1
if test "$Wc_c" != "102"; then
	echo original size 102, current size $Wc_c
fi
fi
# ============= rem ==============
if test X"$1" != X"-c" -a -f 'rem'; then
	echo "File already exists: skipping 'rem'"
else
echo "x - extracting rem (Text)"
sed 's/^X//' << 'SHAR_EOF' > rem &&
X#!/bin/sh
X#
X# rem - by David Skoll - 26 February 1991
X#
X# This script runs 'remind' with a default reminder file assumed.  You
X# can override the default by using "rem -f newfile ..."  (But why would
X# you use rem unless you wanted to accept the default??)
X
X# ------ You may wish to change the defaults below this line ------
X
X# The default reminder file
XDEFAULT=$HOME/.reminders
X
X# The executable file (you may wish to change this to /usr/local/bin/remind
X# or whatever.
XEXECUTABLE=remind
X
X# No options yet
XOPTIONS=""
X
X# No parameters yet
XPARAMETERS=""
X
X# ------ You shouldn't change anything below this line -----
X
X# Scan for options
Xwhile test "$1" != ""
Xdo
X	case $1 in
X
X		-f) DEFAULT=$2
X		    shift
X		    shift ;;
X
X		-*) OPTIONS="$OPTIONS $1"
X		    shift ;;
X
X		*) PARAMETERS=$*
X		   break ;;
X	esac
Xdone
X
X$EXECUTABLE $OPTIONS $DEFAULT $PARAMETERS
SHAR_EOF
$TOUCH -am 0226143091 rem &&
chmod 0700 rem ||
echo "restore of rem failed"
set `wc -c rem`;Wc_c=$1
if test "$Wc_c" != "850"; then
	echo original size 850, current size $Wc_c
fi
fi
# ============= rem.1 ==============
if test X"$1" != X"-c" -a -f 'rem.1'; then
	echo "File already exists: skipping 'rem.1'"
else
echo "x - extracting rem.1 (Text)"
sed 's/^X//' << 'SHAR_EOF' > rem.1 &&
X.TH REM 1 "26 February 1991"
X.UC 4
X.SH NAME
Xrem \- run 'remind' with a default reminder file
X.SH SYNOPSIS
X.B rem
X[\-f \fIfilename\fR] [\fIremind_options\fR] [\fIremind_params\fR]
X.SH DESCRIPTION
X.B Rem
Xruns the \fBremind\fR program with a default reminder file of
X"$HOME\.reminders".  You can supply remind options on the command line,
Xas well as a date specification, just as with \fBremind\fR.
X
XIf you don't want to use the default filename, you can override it with
Xthe "-f" option, followed by a space and a filename.  (This, however,
Xdefeats the purpose of \fBrem\fR)
X.PP
XFor example, typing:
X.PP
X.nf
X	rem -c 1 jan 1992
X.fi
X.PP
Xhas the same effect as typing:
X.PP
X.nf
X	remind -c $HOME/.reminders 1 jan 1992
X.fi
X.PP
X.SH AUTHOR
XDavid F. Skoll
X.SH SEE ALSO
Xremind, kall
X
SHAR_EOF
$TOUCH -am 0226144991 rem.1 &&
chmod 0600 rem.1 ||
echo "restore of rem.1 failed"
set `wc -c rem.1`;Wc_c=$1
if test "$Wc_c" != "772"; then
	echo original size 772, current size $Wc_c
fi
fi
# ============= remind.rsp ==============
if test X"$1" != X"-c" -a -f 'remind.rsp'; then
	echo "File already exists: skipping 'remind.rsp'"
else
echo "x - extracting remind.rsp (Text)"
sed 's/^X//' << 'SHAR_EOF' > remind.rsp &&
X-+main.obj -+nextdate.obj -+dorem.obj -+init.obj -+dosubst.obj &
X-+files.obj -+calendar.obj -+cache.obj -+omits.obj -+turboc.obj
SHAR_EOF
$TOUCH -am 0225165991 remind.rsp &&
chmod 0600 remind.rsp ||
echo "restore of remind.rsp failed"
set `wc -c remind.rsp`;Wc_c=$1
if test "$Wc_c" != "129"; then
	echo original size 129, current size $Wc_c
fi
fi
# ============= turboc.c ==============
if test X"$1" != X"-c" -a -f 'turboc.c'; then
	echo "File already exists: skipping 'turboc.c'"
else
echo "x - extracting turboc.c (Text)"
sed 's/^X//' << 'SHAR_EOF' > turboc.c &&
X/***************************************************************/
X/*                                                             */
X/*  TURBOC.C                                                   */
X/*                                                             */
X/*  Contains definitons of MSC's _dos_XXXX functions.          */
X/*                                                             */
X/*  Copyright 1991 Rhys Weatherley.                            */
X/*                                                             */
X/***************************************************************/
X
X#include "turboc.h"
X#include <errno.h>
X#include <dos.h>
X
Xint	_dos_open (char *name,int mode,int *handle)
X{
X  if ((*handle = _open (name,mode)) < 0)
X    return (_doserrno);
X   else
X    return (0);
X}
X
Xvoid	_dos_close (int handle)
X{
X  _close (handle);
X}
X
Xvoid	_dos_getftime (int handle,unsigned *date,unsigned *time)
X{
X  union REGS regs;
X  regs.x.ax = 0x5700;
X  regs.x.bx = handle;
X  int86 (0x21,&regs,&regs);
X  *date = regs.x.dx;
X  *time = regs.x.cx;
X}
X
Xvoid	_dos_setftime (int handle,unsigned date,unsigned time)
X{
X  union REGS regs;
X  regs.x.ax = 0x5701;
X  regs.x.bx = handle;
X  regs.x.dx = date;
X  regs.x.cx = time;
X  int86 (0x21,&regs,&regs);
X}
X
Xvoid	_dos_getdate (struct dosdate_t *buf)
X{
X  union REGS regs;
X  regs.h.ah = 0x2A;
X  int86 (0x21,&regs,&regs);
X  buf -> day = regs.h.dl;
X  buf -> month = regs.h.dh;
X  buf -> year = regs.x.cx;
X}
X
Xvoid	_dos_gettime (struct dostime_t *tloc)
X{
X  union REGS regs;
X  regs.h.ah = 0x2C;
X  int86 (0x21,&regs,&regs);
X  tloc -> hour = regs.h.ch;
X  tloc -> minute = regs.h.cl;
X  tloc -> second = regs.h.dh;
X}
SHAR_EOF
$TOUCH -am 0225170491 turboc.c &&
chmod 0600 turboc.c ||
echo "restore of turboc.c failed"
set `wc -c turboc.c`;Wc_c=$1
if test "$Wc_c" != "1640"; then
	echo original size 1640, current size $Wc_c
fi
fi
# ============= turboc.h ==============
if test X"$1" != X"-c" -a -f 'turboc.h'; then
	echo "File already exists: skipping 'turboc.h'"
else
echo "x - extracting turboc.h (Text)"
sed 's/^X//' << 'SHAR_EOF' > turboc.h &&
X/***************************************************************/
X/*                                                             */
X/*  TURBOC.H                                                   */
X/*                                                             */
X/*  Contains definitons for MSC's _dos_XXXX functions.         */
X/*                                                             */
X/*  Copyright 1991 Rhys Weatherley.                            */
X/*                                                             */
X/***************************************************************/
X
X#include <alloc.h>
X#include <fcntl.h>
X#include <io.h>
X
Xstruct	dostime_t {
X		    int hour,minute,second;
X		  };
X
Xstruct	dosdate_t {
X		    int	day,month,year;
X		  };
SHAR_EOF
$TOUCH -am 0225170491 turboc.h &&
chmod 0600 turboc.h ||
echo "restore of turboc.h failed"
set `wc -c turboc.h`;Wc_c=$1
if test "$Wc_c" != "759"; then
	echo original size 759, current size $Wc_c
fi
fi
exit 0


exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent at 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 at uunet.uu.net.



More information about the Comp.sources.misc mailing list