Added TkRemind man page.

Reformatted a bunch of files.
Put RCS ID strings in man pages.
This commit is contained in:
dfs
1996-04-28 02:01:51 +00:00
parent 6d7c3bd696
commit 46dddf591c
26 changed files with 477 additions and 178 deletions

View File

@@ -1,5 +1,5 @@
# Makefile for REMIND
# $Id: Makefile,v 1.3 1996-03-31 04:08:09 dfs Exp $
# $Id: Makefile,v 1.4 1996-04-28 02:01:51 dfs Exp $
#-----------------------------------------------------------------------------
# THINGS FOR YOU TO EDIT START BELOW
@@ -127,8 +127,9 @@ utils.o: utils.c $(STDHDRS)
var.o: var.c $(STDHDRS) expr.h
tgz:
tar cvzf remind-3.0.14.tgz $(MANIFEST)
compress -v remind-3.0.14.tar
tar cvf remind-3.0.14.tar $(MANIFEST)
gzip -v -9 remind-3.0.14.tar
mv remind-3.0.14.tar.gz remind-3.0.14.tgz
shar:
shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
@@ -189,9 +190,3 @@ release:
mv *.man RELEASE
for i in *.1; do groff -man -Tps $$i > `basename $$i .1`.ps; done
mv *.ps RELEASE
# Meant for debugging - don't invoke this target unless you know what
# you're doing!
majortest:
for comp in "cc" "gcc -Wall -pedantic -ansi" ; do for lang in 1 2 3 4 5 0 ; do for def in ISOLATIN1 IBMEXTENDED FOOBARBAZ ; do echo $$def $$lang ; $(MAKE) clobber ; $(MAKE) "CDEFS=-DLANG=$$lang -D$$def=1" CFLAGS=-O "CC=$$comp" "LD=$$comp" ; done ; done ; done

View File

@@ -4,6 +4,11 @@ CHANGES TO REMIND
+ MINOR ENHANCEMENTS
- Added the WARN keyword for precise advance notice. You can now
have advance warning 5, 3, 1 and 0 days in advance (for example.)
The WARN keyword operates similarly to the SCHED keyword in that it
calls a user-defined function to obtain the advance warning sequence.
- Added support for QDOS/SMSQ on the Sinclair QL microcomputer,
courtesy of Robert H. Klein <kleir000@goofy.zdv.Uni-Mainz.de>
NOTE THAT I CANNOT TEST NOR SUPPORT THIS VERSION!

View File

@@ -11,7 +11,7 @@
/* */
/***************************************************************/
/* $Id: config.h,v 1.2 1996-03-31 04:01:54 dfs Exp $ */
/* $Id: config.h,v 1.3 1996-04-28 02:01:53 dfs Exp $ */
/*---------------------------------------------------------------------*/
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
@@ -267,7 +267,7 @@
#endif
#ifdef SYSV
#define __USE_SVID
#define _SVID_SOURCE
#endif
#define PSBEGIN "# rem2ps begin"

91
dorem.c
View File

@@ -11,7 +11,7 @@
/* */
/***************************************************************/
static char const RCSID[] = "$Id: dorem.c,v 1.2 1996-03-31 04:01:55 dfs Exp $";
static char const RCSID[] = "$Id: dorem.c,v 1.3 1996-04-28 02:01:54 dfs Exp $";
#include "config.h"
#include <stdio.h>
@@ -42,6 +42,7 @@ PRIVATE int ParseLocalOmit ARGS ((ParsePtr s, Trigger *t));
PRIVATE int ParseScanFrom ARGS ((ParsePtr s, Trigger *t));
PRIVATE int ParsePriority ARGS ((ParsePtr s, Trigger *t));
PRIVATE int ParseUntil ARGS ((ParsePtr s, Trigger *t));
PRIVATE int ShouldTriggerBasedOnWarn ARGS ((Trigger *t, int jul));
/***************************************************************/
/* */
@@ -146,6 +147,7 @@ ParsePtr p;
trig->scanfrom = NO_DATE;
trig->priority = DefaultPrio;
trig->sched[0] = 0;
trig->warn[0] = 0;
tim->ttime = NO_TIME;
tim->delta = NO_DELTA;
tim->rep = NO_REP;
@@ -238,6 +240,12 @@ ParsePtr p;
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
return OK;
case T_Warn:
r=ParseToken(s, TokBuffer);
if(r) return r;
StrnCpy(trig->warn, TokBuffer, VAR_NAME_LEN);
break;
case T_Sched:
r=ParseToken(s, TokBuffer);
if(r) return r;
@@ -634,12 +642,12 @@ ParsePtr p;
#pragma argsused
#endif
#ifdef HAVE_PROTOS
PUBLIC int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int jul)
PUBLIC int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int jul)
#else
int ShouldTriggerReminder(t, tim, jul)
Trigger *t;
TimeTrig *tim;
int jul;
int ShouldTriggerReminder(t, tim, jul)
Trigger *t;
TimeTrig *tim;
int jul;
#endif
{
int r;
@@ -667,6 +675,11 @@ ParsePtr p;
/* If "infinite delta" option is chosen, always trigger future reminders */
if (InfiniteDelta || NextMode) return 1;
/* If there's a "warn" function, it overrides any deltas */
if (t->warn[0] != 0) {
return ShouldTriggerBasedOnWarn(t, jul);
}
/* Move back by delta days, if any */
if (t->delta != NO_DELTA) {
if (t->delta < 0)
@@ -800,6 +813,68 @@ ParsePtr p;
system(SubstBuffer);
}
/***************************************************************/
/* */
/* ShouldTriggerBasedOnWarn */
/* */
/* Determine whether to trigger a reminder based on its WARN */
/* function. */
/* */
/***************************************************************/
#ifdef HAVE_PROTOS
PRIVATE int ShouldTriggerBasedOnWarn(Trigger *t, int jul)
#else
static int ShouldTriggerBasedOnWarn(t, jul)
Trigger *t;
int jul;
#endif
{
char buffer[VAR_NAME_LEN+15];
int i;
char *s;
int r;
Value v;
int lastReturnVal = 0; /* Silence compiler warning */
/* If no proper function exists, barf... */
if (UserFuncExists(t->warn) != 1) {
Eprint("%s: `%s'", ErrMsg[M_BAD_WARN_FUNC], t->warn);
return (jul == JulianToday);
}
for (i=1; ; i++) {
sprintf(buffer, "%s(%d)", t->warn, i);
s = buffer;
r = EvalExpr(&s, &v);
if (r) {
Eprint("%s: `%s': %s", ErrMsg[M_BAD_WARN_FUNC],
t->warn, ErrMsg[r]);
return (jul == JulianToday);
}
if (v.type != INT_TYPE) {
DestroyValue(v);
Eprint("%s: `%s': %s", ErrMsg[M_BAD_WARN_FUNC],
t->warn, ErrMsg[E_BAD_TYPE]);
return (jul == JulianToday);
}
/* If absolute value of return is not monotonically
decreasing, exit */
if (i > 1 && abs(v.v.val) >= lastReturnVal) {
return (jul == JulianToday);
}
lastReturnVal = abs(v.v.val);
/* Positive values: Just subtract. Negative values:
skip omitted days. */
if (v.v.val >= 0) {
if (JulianToday + v.v.val == jul) return 1;
} else {
int j = jul;
while (v.v.val) {
j--;
if (!IsOmitted(j, t->localomit)) v.v.val++;
}
if (j == JulianToday) return 1;
}
}
}

204
err.h
View File

@@ -9,7 +9,7 @@
/* */
/***************************************************************/
/* $Id: err.h,v 1.1 1996-03-27 03:25:53 dfs Exp $ */
/* $Id: err.h,v 1.2 1996-04-28 02:01:55 dfs Exp $ */
/* Note that not all of the "errors" are really errors - some are just
messages for information purposes. Constants beginning with M_ should
@@ -116,6 +116,7 @@
#define E_NOREMINDERS 95
#define M_QUEUED 96
#define E_EXPECTING_NUMBER 97
#define M_BAD_WARN_FUNC 98
#ifdef MK_GLOBALS
#undef EXTERN
@@ -129,106 +130,107 @@
EXTERN char *ErrMsg[]
#ifdef MK_GLOBALS
= {
"Ok",
"Missing ']'",
"Missing quote",
"Expression too complex - too many operators",
"Expression too complex - too many operands",
"Missing ')'",
"Undefined function",
"Illegal character",
"Expecting binary operator",
"Out of memory",
"Ill-formed number",
"Op stack underflow - internal error",
"Va stack underflow - internal error",
"Can't coerce",
"Type mismatch",
"Date overflow",
"Stack error - internal error",
"Division by zero",
"Undefined variable",
"Unexpected end of line",
"Unexpected end of file",
"I/O error",
"Line too long",
"Internal error",
"Bad date specification",
"Not enough arguments",
"Too many arguments",
"Ill-formed time",
"Number too high",
"Number too low",
"Can't open file",
"INCLUDE nested too deeply",
"Parse error",
"Can't compute trigger",
"Too many nested IFs",
"ELSE with no matching IF",
"ENDIF with no matching IF",
"Can't OMIT every weekday",
"Extraneous token(s) on line",
"POP-OMIT-CONTEXT without matching PUSH-OMIT-CONTEXT",
"RUN disabled",
"Domain error",
"Invalid identifier",
"Recursive function call detected",
"",
"Cannot modify system variable",
"C library function can't represent date/time",
"Attempt to redefine built-in function",
"Can't nest function definition in expression",
"Must fully specify date to use repeat factor",
"Year specified twice",
"Month specified twice",
"Day specified twice",
"Unknown token",
"Must specify month and day in OMIT command",
"Too many partial OMITs",
"Too many full OMITs",
"Warning: PUSH-OMIT-CONTEXT without matching POP-OMIT-CONTEXT",
"Error reading file",
"Expecting end-of-line",
"Invalid Hebrew date",
"IIF needs odd number of arguments",
"Warning: Missing ENDIF",
"Expecting comma",
"Weekday specified twice",
"Only use one of BEFORE, AFTER or SKIP",
"Can't nest MSG, MSF, RUN, etc. in expression",
"Repeat value specified twice",
"Delta value specified twice",
"Back value specified twice",
"ONCE keyword used twice. (Hah.)",
"Expecting time after AT",
"UNTIL keyword used twice",
"Incomplete date specification",
"SCANFROM keyword used twice",
"Variable",
"Value",
"*UNDEFINED*",
"Entering UserFN",
"Leaving UserFN",
"Expired",
"fork() failed - can't do queued reminders",
"Can't access file",
"Illegal system date: Year is less than %d\n",
"Unknown debug flag '%c'\n",
"Unknown option '%c'\n",
"Unknown user '%s'\n",
"Could not change gid to %d\n",
"Could not change uid to %d\n",
"Out of memory for environment\n",
"Missing '=' sign",
"Missing variable name",
"Missing expression",
"Can't reset access date of %s\n",
"Remind: '-i' option: %s\n",
"No reminders.",
"%d reminder(s) queued for later today.\n",
"Expecting number"
}
= {
"Ok",
"Missing ']'",
"Missing quote",
"Expression too complex - too many operators",
"Expression too complex - too many operands",
"Missing ')'",
"Undefined function",
"Illegal character",
"Expecting binary operator",
"Out of memory",
"Ill-formed number",
"Op stack underflow - internal error",
"Va stack underflow - internal error",
"Can't coerce",
"Type mismatch",
"Date overflow",
"Stack error - internal error",
"Division by zero",
"Undefined variable",
"Unexpected end of line",
"Unexpected end of file",
"I/O error",
"Line too long",
"Internal error",
"Bad date specification",
"Not enough arguments",
"Too many arguments",
"Ill-formed time",
"Number too high",
"Number too low",
"Can't open file",
"INCLUDE nested too deeply",
"Parse error",
"Can't compute trigger",
"Too many nested IFs",
"ELSE with no matching IF",
"ENDIF with no matching IF",
"Can't OMIT every weekday",
"Extraneous token(s) on line",
"POP-OMIT-CONTEXT without matching PUSH-OMIT-CONTEXT",
"RUN disabled",
"Domain error",
"Invalid identifier",
"Recursive function call detected",
"",
"Cannot modify system variable",
"C library function can't represent date/time",
"Attempt to redefine built-in function",
"Can't nest function definition in expression",
"Must fully specify date to use repeat factor",
"Year specified twice",
"Month specified twice",
"Day specified twice",
"Unknown token",
"Must specify month and day in OMIT command",
"Too many partial OMITs",
"Too many full OMITs",
"Warning: PUSH-OMIT-CONTEXT without matching POP-OMIT-CONTEXT",
"Error reading file",
"Expecting end-of-line",
"Invalid Hebrew date",
"IIF needs odd number of arguments",
"Warning: Missing ENDIF",
"Expecting comma",
"Weekday specified twice",
"Only use one of BEFORE, AFTER or SKIP",
"Can't nest MSG, MSF, RUN, etc. in expression",
"Repeat value specified twice",
"Delta value specified twice",
"Back value specified twice",
"ONCE keyword used twice. (Hah.)",
"Expecting time after AT",
"UNTIL keyword used twice",
"Incomplete date specification",
"SCANFROM keyword used twice",
"Variable",
"Value",
"*UNDEFINED*",
"Entering UserFN",
"Leaving UserFN",
"Expired",
"fork() failed - can't do queued reminders",
"Can't access file",
"Illegal system date: Year is less than %d\n",
"Unknown debug flag '%c'\n",
"Unknown option '%c'\n",
"Unknown user '%s'\n",
"Could not change gid to %d\n",
"Could not change uid to %d\n",
"Out of memory for environment\n",
"Missing '=' sign",
"Missing variable name",
"Missing expression",
"Can't reset access date of %s\n",
"Remind: '-i' option: %s\n",
"No reminders.",
"%d reminder(s) queued for later today.\n",
"Expecting number",
"Bad function in WARN clause"
}
#endif /* MK_GLOBALS */
;
#endif /* L_ERR_OVERRIDE */

12
expr.c
View File

@@ -9,7 +9,7 @@
/* */
/***************************************************************/
static char const RCSID[] = "$Id: expr.c,v 1.2 1996-03-31 04:01:55 dfs Exp $";
static char const RCSID[] = "$Id: expr.c,v 1.3 1996-04-28 02:01:55 dfs Exp $";
#include "config.h"
#include <stdio.h>
@@ -240,7 +240,7 @@ char **in;
}
if (!ISID(c) && c != '$') {
Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], c);
Eprint("%s `%c'", ErrMsg[E_ILLEGAL_CHAR], c);
return E_ILLEGAL_CHAR;
}
@@ -349,7 +349,7 @@ Var *locals;
if (*ExprBuf == ')') break;
else if (*ExprBuf != ',') {
if (!f) free(ufname);
Eprint("%s: '%c'", ErrMsg[E_EXPECT_COMMA], *ExprBuf);
Eprint("%s: `%c'", ErrMsg[E_EXPECT_COMMA], *ExprBuf);
return E_EXPECT_COMMA;
}
}
@@ -367,7 +367,7 @@ Var *locals;
continue; /* Still looking for an atomic vlue */
} else if (!ISID(*ExprBuf) && *ExprBuf != '$'
&& *ExprBuf != '"' && *ExprBuf != '\'') {
Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
Eprint("%s `%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
return E_ILLEGAL_CHAR;
} else { /* Must be a literal value */
r = MakeValue(ExprBuf, &va, locals);
@@ -389,7 +389,7 @@ Var *locals;
else
r=(op.func)();
if (r) {
Eprint("'%s': %s", op.name, ErrMsg[r]);
Eprint("`%s': %s", op.name, ErrMsg[r]);
return r;
}
}
@@ -409,7 +409,7 @@ Var *locals;
else
r=(op2.func)();
if (r) {
Eprint("'%s': %s", op2.name, ErrMsg[r]);
Eprint("`%s': %s", op2.name, ErrMsg[r]);
return r;
}
}

View File

@@ -15,7 +15,7 @@
/* */
/***************************************************************/
/* $Id: finnish.h,v 1.1 1996-03-27 03:25:55 dfs Exp $ */
/* $Id: finnish.h,v 1.2 1996-04-28 02:01:56 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Finnish"
@@ -310,6 +310,9 @@ EXTERN char *ErrMsg[] =
"Remind: tarkenne '-i': %s\n",
"Ei viestej\xE4.",
"%d viesti(\xE4) t\xE4m\xE4n p\xE4iv\xE4n jonossa.\n",
"Numero puuttuu",
"Illegal function in WARN clause (NEEDS TRANSLATION)"
#elif defined(IBMEXTENDED)
"Ok",
"Puuttuva ']'",
@@ -409,6 +412,7 @@ EXTERN char *ErrMsg[] =
"Ei viestej\x84.",
"%d viesti(\x84) t\x84m\x84n p\x84iv\x84n jonossa.\n",
"Numero puuttuu"
"Illegal function in WARN clause (NEEDS TRANSLATION)"
#else
"Ok",
"Puuttuva ']'",
@@ -507,7 +511,8 @@ EXTERN char *ErrMsg[] =
"Remind: tarkenne '-i': %s\n",
"Ei viestej{.",
"%d viesti({) t{m{n p{iv{n jonossa.\n",
"Numero puuttuu"
"Numero puuttuu",
"Illegal function in WARN clause (NEEDS TRANSLATION)"
#endif
};
#endif /* MK_GLOBALS */

View File

@@ -14,7 +14,7 @@
/* */
/***************************************************************/
/* $Id: french.h,v 1.1 1996-03-27 03:25:55 dfs Exp $ */
/* $Id: french.h,v 1.2 1996-04-28 02:01:57 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "French"
@@ -346,7 +346,8 @@ EXTERN char *ErrMsg[] =
"Remind: '-i' option: %s\n",
"Pas de rappels.",
"%d rappel(s) en file pour aujourd'hui.\n",
"Nombre attendu"
"Nombre attendu",
"Fonction illegale apres WARN"
#endif /* ISOLATIN1 */
};
#endif /* MK_GLOBALS */

8
init.c
View File

@@ -11,7 +11,7 @@
/* */
/***************************************************************/
static char const RCSID[] = "$Id: init.c,v 1.1 1996-03-27 03:25:58 dfs Exp $";
static char const RCSID[] = "$Id: init.c,v 1.2 1996-04-28 02:01:58 dfs Exp $";
#define L_IN_INIT 1
#include "config.h"
@@ -466,12 +466,12 @@ void Usage()
fprintf(ErrFp, " -c[n] Produce a calendar for n (default 1) months\n");
fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Specify width, padding and spacing of calendar\n");
fprintf(ErrFp, " -s[+][n] Produce 'simple calendar' for n (1) months (weeks)\n");
fprintf(ErrFp, " -s[+][n] Produce `simple calendar' for n (1) months (weeks)\n");
fprintf(ErrFp, " -p[n] Same as -s, but input compatible with rem2ps\n");
fprintf(ErrFp, " -v Verbose mode\n");
fprintf(ErrFp, " -o Ignore ONCE directives\n");
fprintf(ErrFp, " -t Trigger all future reminders regardless of delta\n");
fprintf(ErrFp, " -h 'Hush' mode - be very quiet\n");
fprintf(ErrFp, " -h `Hush' mode - be very quiet\n");
#ifdef HAVE_QUEUED
fprintf(ErrFp, " -a Don't trigger timed reminders immediately - just queue them\n");
fprintf(ErrFp, " -q Don't queue timed reminders\n");
@@ -482,7 +482,7 @@ void Usage()
fprintf(ErrFp, " -e Divert messages normally sent to stderr to stdout\n");
fprintf(ErrFp, " -b[n] Time format for cal: 0=am/pm, 1=24hr, 2=none\n");
fprintf(ErrFp, " -x[n] Iteration limit for SATISFY clause (def=150)\n");
fprintf(ErrFp, " -kcmd Run 'cmd' for MSG-type reminders\n");
fprintf(ErrFp, " -kcmd Run `cmd' for MSG-type reminders\n");
fprintf(ErrFp, " -g[ddd] Sort reminders by date, time and priority before issuing\n");
fprintf(ErrFp, " -ivar=val Initialize var to val and preserve var\n");
fprintf(ErrFp, " -m Start calendar with Monday rather than Sunday\n");

1
kall.1
View File

@@ -1,3 +1,4 @@
.\" $Id: kall.1,v 1.2 1996-04-28 02:01:58 dfs Exp $
.TH KALL 1 "26 February 1991"
.UC 4
.SH NAME

6
main.c
View File

@@ -10,7 +10,7 @@
/* */
/***************************************************************/
static char const RCSID[] = "$Id: main.c,v 1.2 1996-03-31 04:01:57 dfs Exp $";
static char const RCSID[] = "$Id: main.c,v 1.3 1996-04-28 02:01:59 dfs Exp $";
#include "config.h"
#ifdef HAVE_STDLIB_H
@@ -200,7 +200,7 @@ static void DoReminders()
}
if (FileAccessDate < 0) {
fprintf(ErrFp, "%s: '%s'.\n", ErrMsg[E_CANTACCESS], InitialFile);
fprintf(ErrFp, "%s: `%s'.\n", ErrMsg[E_CANTACCESS], InitialFile);
exit(1);
}
@@ -974,7 +974,7 @@ ParsePtr p;
if ( (r = ParseToken(p, TokBuffer)) ) return r;
if (*TokBuffer && (*TokBuffer != '#') && (*TokBuffer != ';')) {
Eprint("%s: '%s'", ErrMsg[E_EXPECTING_EOL], TokBuffer);
Eprint("%s: `%s'", ErrMsg[E_EXPECTING_EOL], TokBuffer);
return E_EXTRANEOUS_TOKEN;
}
return OK;

4
omit.c
View File

@@ -10,7 +10,7 @@
/* */
/***************************************************************/
static char const RCSID[] = "$Id: omit.c,v 1.1 1996-03-27 03:26:04 dfs Exp $";
static char const RCSID[] = "$Id: omit.c,v 1.2 1996-04-28 02:02:00 dfs Exp $";
#include "config.h"
#include <stdio.h>
@@ -332,7 +332,7 @@ ParsePtr p;
break;
default:
Eprint("%s: '%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN], TokBuffer);
Eprint("%s: `%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN], TokBuffer);
return E_UNKNOWN_TOKEN;
}
}

View File

@@ -13,7 +13,7 @@
/* */
/***************************************************************/
/* $Id: polish.h,v 1.1 1996-03-27 03:26:05 dfs Exp $ */
/* $Id: polish.h,v 1.2 1996-04-28 02:02:00 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Polish"
@@ -285,7 +285,8 @@ EXTERN char *ErrMsg[] =
"Remind: '-i' option: %s\n",
"Brak przypomnie\361.",
"%d Przypomnienia zakolejkowane na p\363\274niej.\n",
"Spodziewana liczba"
"Spodziewana liczba",
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)"
#else /* ISOLATIN1 */
"OK",
"Brakujacy ']'",
@@ -384,7 +385,8 @@ EXTERN char *ErrMsg[] =
"Remind: '-i' option: %s\n",
"Brak przypomnien.",
"%d Przypomnienia zakolejkowane na pozniej.\n",
"Spodziewana liczba"
"Spodziewana liczba",
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)"
#endif /* ISOLATIN1 */
};
#endif /* MK_GLOBALS */

1
rem.1
View File

@@ -1,3 +1,4 @@
.\" $Id: rem.1,v 1.2 1996-04-28 02:02:01 dfs Exp $
.TH REM 1 "26 February 1991"
.UC 4
.SH NAME

View File

@@ -1,4 +1,5 @@
.TH REM2PS 1 "2 February 1994"
.\" $Id: rem2ps.1,v 1.2 1996-04-28 02:02:01 dfs Exp $
.TH REM2PS 1 "27 April 1996"
.UC4
.SH NAME
rem2ps \- draw a PostScript calendar from Remind output
@@ -14,9 +15,6 @@ draws a calendar) to the standard output.
Be more verbose. This causes \fBRem2ps\fR to print progress messages
to the standard error stream. Normally, it is silent.
.TP
.B \-n
Produce a calendar whose first column is Monday (rather than Sunday.)
.TP
.B \-p file
Include the contents of \fIfile\fR in the PostScript prologue. This
allows you to define procedures, variables etc. which can be used

View File

@@ -9,7 +9,7 @@
/* */
/***************************************************************/
static char const RCSID[] = "$Id: rem2ps.c,v 1.2 1996-03-31 04:01:58 dfs Exp $";
static char const RCSID[] = "$Id: rem2ps.c,v 1.3 1996-04-28 02:02:02 dfs Exp $";
#include "config.h"
#include "lang.h"
@@ -163,7 +163,6 @@ char argv[];
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-1996 by David F. Skoll\n\n", VERSION);
fprintf(stderr, "Generating PostScript calendar\n");
}
WriteProlog();
}
validfile++;
DoPsCal();
@@ -206,6 +205,13 @@ void DoPsCal()
gets(LineBuffer);
sscanf(LineBuffer, "%s %s %d %d %d", month, year, &days, &wkday,
&MondayFirst);
/* We write the prolog here because it's only at this point that
MondayFirst is set correctly. */
if (validfile == 1) {
WriteProlog();
}
gets(LineBuffer);
sscanf(LineBuffer, "%s %d", prevm, &prevdays);
gets(LineBuffer);
@@ -421,7 +427,7 @@ void WriteProlog()
if (UserProlog) {
fp = fopen(UserProlog, "r");
if (!fp) {
fprintf(stderr, "Could not open prologue file '%s'\n", UserProlog);
fprintf(stderr, "Could not open prologue file `%s'\n", UserProlog);
} else {
while(1) {
nread = fread(buffer, sizeof(char), LINELEN, fp);
@@ -601,7 +607,7 @@ char *argv[];
s = argv[i];
i++;
if (*s++ != '-') Usage("Options must begin with '-'");
if (*s++ != '-') Usage("Options must begin with `-'");
switch(*s++) {
@@ -859,7 +865,7 @@ int DoQueuedPs()
} else {
fp = fopen(e->entry+fnoff, "r");
if (!fp) {
fprintf(stderr, "Could not open PostScript file '%s'\n", e->entry+1);
fprintf(stderr, "Could not open PostScript file `%s'\n", e->entry+1);
} else {
while(1) {
nread = fread(buffer, sizeof(char), LINELEN, fp);

View File

@@ -1,4 +1,5 @@
.TH REMIND 1 "6 April 1994"
.\" $Id: remind.1,v 1.2 1996-04-28 02:02:04 dfs Exp $
.TH REMIND 1 "27 April 1996"
.UC 4
.SH NAME
remind \- a sophisticated reminder service
@@ -60,10 +61,9 @@ that the output contains additional information for use by the
option, \fIn\fR cannot start with "+"; it must specify a number of months.
.TP
.B \-m
The \fB\-m\fR option causes the \fB\-c\fR option to produce a calendar whose
first column is Monday rather than Sunday. (This conforms to the international
standard.) It does \fInot\fR, however, affect the \fB\-p\fR or \fB\-s\fR
options.
The \fB\-m\fR option causes the \fB\-c\fR or \fB\-p\fR options to produce
a calendar whose first column is Monday rather than Sunday.
(This conforms to the international standard.)
.TP
.B \-v
The \fB\-v\fR option makes the output of \fBRemind\fR slightly more verbose.
@@ -261,6 +261,7 @@ Its syntax is:
[\fBOMIT\fR \fIomit_list\fR]
[\fBAT\fR \fItime\fR [\fItdelta\fR] [\fItrepeat\fR]]
[\fBSCHED\fR \fIsched_function\fR]
[\fBWARN\fR \fIwarn_function\fR]
[\fBUNTIL\fR \fIexpiry_date\fR]
[\fBSCANFROM\fR \fIscan_date\fR]
\fBMSG\fR | \fBMSF\fR | \fBRUN\fR | \fBCAL\fR | \fBSATISFY\fR |
@@ -780,10 +781,12 @@ in effect at the end of the reminder script. These definitions may
\fInot\fR necessarily be those which were in effect at the time the reminder
was queued.
.PP
.B THE SCHED KEYWORD
.B THE SCHED AND WARN KEYWORDS
.PP
The \fBSCHED\fR keyword allows more precise control over the triggering
of timed reminders. However, discussion must be deferred until after
of timed reminders, and the \fBWARN\fR keyword allows precise control
over the advance triggering of all types of reminders.
However, discussion must be deferred until after
expressions and user-defined functions are explained. See the subsection
"Precise Scheduling" further on.
.PP
@@ -2496,7 +2499,52 @@ with an underscore.
.PP
.SH PRECISE SCHEDULING
.PP
The \fBSCHED\fR keyword allows precise control over the scheduling of timed
The \fBWARN\fR keyword allows precise control over advance warning in
a more flexible manner than the \fIdelta\fR mechanism. It should be
followed by the name of a user-defined function, \fIwarn_function\fR.
.PP
If a \fIwarn_function\fR is supplied, then it must take one argument of
type \fBINT\fR. \fBRemind\fR ignores any delta, and instead calls
\fIwarn_function\fR successively with the arguments 1, 2, 3, ...
.PP
\fIWarn_function\fR's return value \fIn\fR is interpreted as follows:
.TP
o
If \fIn\fR is positive, then the reminder is triggered exactly \fIn\fR
days before its trigger date.
.TP
o
If \fIn\fR is negative, then it is triggered \fIn\fR days before its
trigger date, \fInot counting\fR \fBOMIT\fRted days.
.PP
As an example, suppose you wish to be warned of American Independence Day
5, 3, and 1 days in advance. You could use this:
.PP
.nf
FSET _wfun(x) choose(x, 5, 3, 1, 0)
REM 4 July WARN _wfun MSG American Independence Day is %b.
.fi
.PP
.B NOTES
.TP
1
If an error occurs during the evaluation of \fIwarn_function\fR, then
\fBRemind\fR stops calling it and simply issues the reminder on its
trigger date.
.TP
2
If the absolute-values of the return values of \fIwarn_function\fR are
not monotonically decreasing, \fBRemind\fR stops calling it and issues
the reminder on its trigger date.
.TP
3
\fIWarn_function\fR should (as a matter of good style) return 0 as the
final value in its sequence of return values. However, a reminder will
\fIalways\fR be triggered on its trigger date, regardless of what
\fIwarn_function\fR does.
.PP
Similarly to \fBWARN\fR, the \fBSCHED\fR keyword allows precise
control over the scheduling of timed
reminders. It should be followed by the name of a user-defined function,
\fIsched_function\fR.
.PP
@@ -3593,4 +3641,4 @@ Catalog\fR, Jewish Publication Society of America.
.PP
.SH SEE ALSO
.PP
rem, elm, kall, rem2ps
rem, elm, kall, rem2ps, tkremind

View File

@@ -710,7 +710,7 @@ y => 11:33
x => "foo"
y => 11:33
"foo" * 11:33 => Type mismatch
./test.rem(240): '*': Type mismatch
./test.rem(240): `*': Type mismatch
Leaving UserFN h() => Type mismatch
set a074 dosubst("%a %b %c %d %e %f %g %h", '1992/5/5')
dosubst("%a %b %c %d %e %f %g %h", 1992/05/05) => "on Tuesday, 5 May, 1992 in 444 days' tim"...

View File

@@ -1,6 +1,6 @@
# Test file for REMIND
#
# $Id: test1.cmp,v 1.2 1996-03-31 04:08:13 dfs Exp $
# $Id: test1.cmp,v 1.3 1996-04-28 02:02:07 dfs Exp $
#
# Use this file to test the date calculation routines
# of the REMIND program by typing:
@@ -712,7 +712,7 @@ y => 11:33
x => "foo"
y => 11:33
"foo" * 11:33 => Type mismatch
.\test.rem(240): '*': Type mismatch
.\test.rem(240): `*': Type mismatch
Leaving UserFN h() => Type mismatch
set a074 dosubst("%a %b %c %d %e %f %g %h", '1992/5/5')
dosubst("%a %b %c %d %e %f %g %h", 1992/05/05) => "on Tuesday, 5 May, 1992 in 444 days' tim"...

View File

@@ -1,6 +1,6 @@
# Test file for REMIND
#
# $Id: test2.cmp,v 1.2 1996-03-31 04:08:13 dfs Exp $
# $Id: test2.cmp,v 1.3 1996-04-28 02:02:07 dfs Exp $
#
# Use this file to test the date calculation routines
# of the REMIND program by typing:
@@ -712,7 +712,7 @@ y => 11:33
x => "foo"
y => 11:33
"foo" * 11:33 => Type mismatch
.\test.rem(240): '*': Type mismatch
.\test.rem(240): `*': Type mismatch
Leaving UserFN h() => Type mismatch
set a074 dosubst("%a %b %c %d %e %f %g %h", '1992/5/5')
dosubst("%a %b %c %d %e %f %g %h", 1992/05/05) => "on Tuesday, 5 May, 1992 in 444 days' tim"...

View File

@@ -11,7 +11,7 @@
#
#--------------------------------------------------------------
# $Id: tkremind,v 1.3 1996-04-22 03:37:35 dfs Exp $
# $Id: tkremind,v 1.4 1996-04-28 02:02:08 dfs Exp $
# the next line restarts using wish \
exec wish "$0" "$@"
@@ -49,15 +49,18 @@ set SkipType 1
set CommandLine {}
# Reminder file to source -- default
set ReminderFile {NOSUCHFILE}
catch {set ReminderFile "$env(HOME)/.reminders"}
# Reminder file to append to -- default
set AppendFile {NOSUCHFILE}
catch {set AppendFile $ReminderFile}
#---------------------------------------------------------------------------
# Initialize -- initialize things
#---------------------------------------------------------------------------
proc Initialize {} {
global DayNames argc argv CommandLine ReminderFile AppendFile Remind
set CommandLine "|$Remind -itkremind=1 -p"
@@ -80,6 +83,18 @@ proc Initialize {} {
incr i
}
}
# Check system sanity
if {! [file readable $ReminderFile]} {
tk_dialog .error Error "Can't read reminder file `$ReminderFile'" error -1 Ok
exit 1
}
if {! [file writable $AppendFile]} {
tk_dialog .error Error "Can't write reminder file `$AppendFile'" error -1 Ok
exit 1
}
append CommandLine " $ReminderFile"
set DayNames [GetWeekdayNames]
# puts "CommandLine: $CommandLine"

142
tkremind.1 Normal file
View File

@@ -0,0 +1,142 @@
.\" $Id: tkremind.1,v 1.1 1996-04-28 02:02:10 dfs Exp $
.TH TKREMIND 1 "23 April 1996"
.UC 4
.SH NAME
tkremind \- graphical front-end to Remind calendar program
.SH SYNOPSIS
.B tkremind \fR[\fIoptions\fR] [\fIread_file\fR] [\fIwrite_file\fR]
.SH DESCRIPTION
\fBTkRemind\fR is a graphical front-end to the \fBRemind\fR program.
It provides a friendly graphical interface which allows you to view
your calendar and add reminders without learning the syntax of \fBRemind\fR.
Although not all of \fBRemind\fR's features are available with \fBTkRemind\fR,
\fBTkRemind\fR gives you an opportunity to edit the reminder commands which
it creates. This allows you to learn \fBRemind\fR's syntax and then add
extra features as you become a more sophisticated \fBRemind\fR programmer.
\fBTkRemind\fR is written in TCL, and requires tcl version 7.4 and tk
version 4.0. It also requires a \fBwish\fR binary. \fBTkRemind\fR runs
only under UNIX, and requires X-Windows.
.SH OPTIONS
\fBTkRemind\fR itself has no options. However, it passes certain options
on to \fBRemind\fR. The options it passes are
\fB\-b\fR, \fB\-g\fR, \fB\-x\fR, \fB\-i\fR and \fB\-m\fR.
See the \fBRemind\fR man page for details about the options.
\fIRead_file\fR is the file from which \fBTkRemind\fR reads reminders.
It is in standard \fBRemind\fR format. \fIWrite_file\fR is the file
to which \fBTkRemind\fR writes reminders which you add using the GUI.
If \fIRead_file\fR is omitted, it defaults to \fB$HOME/.reminders\fR.
If \fIWrite_file\fR is omitted, it defaults to \fIRead_file\fR.
You may wish to have a different \fIWrite_file\fR from \fIRead_file\fR if
you want to collect all of \fBTkRemind\fR's reminders in one place. Suppose
your main file is \fI$HOME/.reminders\fR and you want \fBTkRemind\fR to put
its reminders in \fI$HOME/.tkreminders\fR. In \fI$HOME/.reminders\fR,
include the line:
.PP
.nf
INCLUDE [getenv("HOME")]/.tkreminders
.fi
.PP
.SH THE CALENDAR WINDOW
When you start \fBTkRemind\fR, it displays a calendar for the current
month, with today's date highlighted. Reminders are filled into each
box on the calendar. If a box contains many reminders, you can scroll
it up and down by dragging mouse button 2 in the box. Note that there
is no specific indication of an over-full box; you'll just have to
notice that the box appears completely full.
.SH NAVIGATING
To change to the previous or next month, click the \fBPrevious
Month\fR or \fBNext Month\fR button, respectively. To change back to
the current month, click \fBToday\fR. To go to a specific month,
click \fBGo To Date...\fR. This pops up a dialog box which allows you
to select a month and enter a year. Once you've done this, click
\fBGo\fR to go to the date, or \fBCancel\fR to cancel.
To exit \fBTkRemind\fR, click \fBQuit\fR. Confirm your intention to
quit in the dialog box which pops up.
.SH ADDING REMINDERS
To add a reminder, click button 1 in any day number in the calendar.
The \fBAdd Reminder...\fR dialog will pop up, with values preselected for
the day you clicked.
The dialog has six basic groups of controls. The first three lines
select one of three types of reminders. Choose the type of reminder
with the radio buttons, and choose the values of the days, months, and
years by selecting values from pull-down menus. The pull-down menus
appear when you click the raised value buttons.
The next control specifies an expiry date for the reminder. Select
the check button to enable an expiry date, and fill in the values
using pull pull-down menus.
The third control specifes how much advance notice you want (if any),
and whether or not weekends and holidays are counted when computing advance
notice.
The fourth control specifies which days \fBRemind\fR considers
as part of the weekend. This can affect the interpretation of "weekday"
in the second and third types of reminders.
The fifth control associates a time with the reminder.
You can also specify advance notice, possibly repeating.
The sixth control specifies what \fBRemind\fR should do if a reminder
falls on a holiday or weekend.
Enter the body of the reminder into the \fBBody:\fR text entry.
To add the reminder to the reminder file, click \fBAdd to reminder file\fR.
To close the dialog without adding the reminder to the file, click
\fBCancel\fR. To preview the reminder, click \fBPreview reminder\fR.
This pops up the \fBPreview reminder\fR dialog box.
.SH PREVIEWING REMINDERS
The \fBPreview reminder\fR dialog box is an excellent way to learn
\fBRemind\fR. It displays the \fBRemind\fR command which realizes the
reminder you entered using the \fBAdd Reminder...\fR dialog. You can
edit the reminder, thereby gaining access to advanced features of
\fBRemind\fR. You can also use it simply to play around and discover
\fBRemind\fR's idioms for expressing different types of reminders.
.SH ODDS AND ENDS
\fBTkRemind\fR performs some basic consistency checks when you add or
preview a reminder. However, if you edit a reminder in the previewer,
\fBTkRemind\fR does \fInot\fR check the edited reminder. You can
produce illegal reminders which may cause problems. (This is one good
reason to isolate \fBTkRemind\fR's reminders in a separate file.)
\fBTkRemind\fR does \fInot\fR check the body of the reminder in any
way. You can use the normal \fBRemind\fR substitution sequences in
the body. Furthermore, if you use expression-pasting in the body,
\fBTkRemind\fR does \fInot\fR validate the expressions.
When \fBTkRemind\fR invokes \fBRemind\fR, it supplies the option:
.PP
.nf
-itkremind=1
.fi
.PP
on the command line. So, in your \fBRemind\fR file, you can include:
.PP
.nf
IF defined("tkremind")
# Then I'm probably being invoked by TkRemind
ENDIF
.fi
.PP
You can use this to activate certain reminders in different ways
for \fBTkRemind\fR (for example).
.SH AUTHOR
David F. Skoll
\fBTkRemind\fR is Copyright 1996 by David F. Skoll
.SH SEE ALSO
remind, rem2ps

11
token.c
View File

@@ -10,7 +10,7 @@
/* */
/***************************************************************/
static char const RCSID[] = "$Id: token.c,v 1.1 1996-03-27 03:26:13 dfs Exp $";
static char const RCSID[] = "$Id: token.c,v 1.2 1996-04-28 02:02:10 dfs Exp $";
#include "config.h"
#include <stdio.h>
@@ -33,10 +33,10 @@ static char const RCSID[] = "$Id: token.c,v 1.1 1996-03-27 03:26:13 dfs Exp $";
if (!isdigit(*(string))) return; \
var = 0; \
while (isdigit(*(string))) { \
var *= 10; \
var += *(string) - '0'; \
string++; \
}
var *= 10; \
var += *(string) - '0'; \
string++; \
}
#define UPPER(c) (islower(c) ? toupper(c) : c)
@@ -99,6 +99,7 @@ Token TokArray[] = {
{ "tuesday", 3, T_WkDay, 1 },
{ "unset", 5, T_UnSet, 0 },
{ "until", 3, T_Until, 0 },
{ "warn", 4, T_Warn, 0 },
{ "wednesday", 3, T_WkDay, 2 }
};

View File

@@ -9,7 +9,7 @@
/* */
/***************************************************************/
/* $Id: types.h,v 1.1 1996-03-27 03:26:14 dfs Exp $ */
/* $Id: types.h,v 1.2 1996-04-28 02:02:11 dfs Exp $ */
/* Values */
typedef struct {
@@ -57,6 +57,7 @@ typedef struct {
int scanfrom;
int priority;
char sched[VAR_NAME_LEN+1]; /* Scheduling function */
char warn[VAR_NAME_LEN+1]; /* Warning function */
} Trigger;
/* A time trigger */
@@ -136,7 +137,8 @@ enum TokTypes
T_Scanfrom,
T_Flush,
T_Priority,
T_Sched
T_Sched,
T_Warn
};
/* The structure of a token */

View File

@@ -10,7 +10,7 @@
/* */
/***************************************************************/
static char const RCSID[] = "$Id: userfns.c,v 1.1 1996-03-27 03:26:15 dfs Exp $";
static char const RCSID[] = "$Id: userfns.c,v 1.2 1996-04-28 02:02:11 dfs Exp $";
#include "config.h"
#include <stdio.h>
@@ -90,7 +90,7 @@ ParsePtr p;
StrnCpy(func->name, TokBuffer, VAR_NAME_LEN);
if (!Hush) {
if (FindFunc(TokBuffer, Func, NumFuncs)) {
Eprint("%s: '%s'", ErrMsg[E_REDEF_FUNC],
Eprint("%s: `%s'", ErrMsg[E_REDEF_FUNC],
TokBuffer);
}
}
@@ -268,7 +268,7 @@ int nargs;
f = FuncHash[h];
while (f && StrinCmp(name, f->name, VAR_NAME_LEN)) f = f->next;
if (!f) {
Eprint("%s: '%s'", ErrMsg[E_UNDEF_FUNC], name);
Eprint("%s: `%s'", ErrMsg[E_UNDEF_FUNC], name);
return E_UNDEF_FUNC;
}
/* Debugging stuff */

4
var.c
View File

@@ -10,7 +10,7 @@
/* */
/***************************************************************/
static char const RCSID[] = "$Id: var.c,v 1.2 1996-03-31 04:02:00 dfs Exp $";
static char const RCSID[] = "$Id: var.c,v 1.3 1996-04-28 02:02:12 dfs Exp $";
#include "config.h"
#include <stdio.h>
@@ -503,7 +503,7 @@ Value *value;
if (!v) return E_NOSUCH_VAR;
if (v->type != value->type) return E_BAD_TYPE;
if (!v->modifiable) {
Eprint("%s: '$%s'", ErrMsg[E_CANT_MODIFY], name);
Eprint("%s: `$%s'", ErrMsg[E_CANT_MODIFY], name);
return E_CANT_MODIFY;
}