Compare commits

...

27 Commits

Author SHA1 Message Date
dfs
dd917df96f -- Removed use of difftime() -- SunOS doesn't have it. 1997-09-07 19:19:11 +00:00
dfs
a15e9bc2b4 -- Removed unnecessary chown's from www Makefile -- the www scripts
have RUN commands only in "inline" scripts supplied from stdin.
1997-08-31 17:17:51 +00:00
dfs
254f340f4c -- Made WWW Makefile do a "chown" to accomodate Remind security features. 1997-08-31 17:09:45 +00:00
dfs
800438a1d1 -- Clarified rem2html documentation. 1997-08-31 17:03:45 +00:00
dfs
8eb2028cf2 -- Made REMIND disable "RUN" on files not owned by its effective UID.
-- Updated copyright year.
1997-08-31 17:03:25 +00:00
dfs
ef2aa97967 -- Documented security features in man page. 1997-08-01 02:28:31 +00:00
dfs
165db3d5b6 -- Made HTML Hebrew calendar "self-linking" with links to next and
previous months.
1997-07-31 03:10:17 +00:00
dfs
76e0c78d15 -- Added HTML hebrew calendar; fixed wording here and there. 1997-07-31 02:19:04 +00:00
dfs
2d5d6d1f56 -- Added romanian.h to MANIFEST. 1997-07-31 01:57:10 +00:00
dfs
6248fd1808 -- Added "\n" to message. 1997-07-31 01:52:46 +00:00
dfs
2c9465b4bb -- Fixed bug in CheckSafety. 1997-07-31 01:51:18 +00:00
dfs
7897067eda -- Added UNIX security checks. 1997-07-31 01:49:37 +00:00
dfs
3c53ab13c9 -- Increased some static buffer sizes.
-- Added security features to "-u" option -- it now implies -r.
-- Remind refuses to run if installed set-uid or set-gid.
1997-07-30 01:30:56 +00:00
dfs
f32e0027ad -- Increased some static buffer sizes.
-- Made Remind ignore trailing commas at end of tokens.
1997-07-13 16:18:48 +00:00
dfs
4c46eb5fee -- Clarified Remind licensing issues. 1997-07-06 14:36:01 +00:00
dfs
a1fc29e66d -- Fixed CalcMinsFromUTC to work with unsigned time_t
-- Added rem2html.
1997-07-06 14:34:37 +00:00
dfs
8e17c968e2 CalcMinsFromUTC was failing if time_t was unsigned. I really _should_
use difftime(), but not all systems have it.  Also, defs.rem was
rearranged so PostScript stuff works better, and new target "emxomf"
was added to makefile.ost which uses OMF linking and a
dynamically-linked C library.  All three of these fixes are courtesy
of Christopher J. Madsen <madsen@iglobal.net>.  Thanks, Christopher.
1997-03-31 22:13:08 +00:00
dfs
ef9f13e83d -- Changed version to 3.0.17
-- Added romanian.h to manifest
-- Made code compile properly on compilers that don't grok 'const'
-- Changed PostScript output to be more compatible with Adobe recommendations
-- Fixed comment characters in HTML stuff
1997-03-30 19:07:35 +00:00
dfs
b5cb430fe4 -- Fixed grammer in WHATSNEW.30
-- Fixed bug in queue.c -- if you used -g option, background reminders
   were not issued.
-- Fixed WWW README.
1997-02-11 01:44:29 +00:00
dfs
a12cd4234c -- Added calendar.html-DIST.
-- Fixed bugs in missing newlines after Content-Type: header in hebdate
   and hebps.
1997-01-19 03:59:55 +00:00
dfs
100f038ae1 Made makefile slightly prettier.
Cleaned up www/Makefile.
Adjusted LSM to note www scripts.
1997-01-16 04:31:07 +00:00
dfs
e1730460fe Changed copyright date to 1997.
Added documentation about WWW server stuff.
1997-01-16 04:14:18 +00:00
dfs
00c2383738 -- Added more details to Makefile and README. 1997-01-16 04:05:31 +00:00
dfs
0f167686d9 Initial checkin of www stuff 1997-01-16 04:00:26 +00:00
dfs
d0be59edff -- Changed version number.
-- Made sunrise() and sunset() distinguish between cases when sun never
   rises and sun never sets.
1996-12-18 00:20:43 +00:00
dfs
dfbbafe87b Added support for Romanian. 1996-12-10 02:36:32 +00:00
dfs
3183d6340e Added portbr.h to Manifest. 1996-10-27 21:49:54 +00:00
81 changed files with 1626 additions and 241 deletions

View File

@@ -1,10 +1,10 @@
$Id: COPYRIGHT,v 1.4 1996-10-12 03:13:04 dfs Exp $
$Id: COPYRIGHT,v 1.5 1997-01-16 04:14:18 dfs Exp $
THE REMIND COPYRIGHT
1. REMIND refers to the entire set of files and documentation in the
REMIND package.
2. REMIND is Copyright 1992-1996 by David Skoll,
2. REMIND is Copyright 1992-1997 by David Skoll,
except where noted in individual files.
3. DISTRIBUTION AND USE

View File

@@ -1,5 +1,5 @@
# Makefile for REMIND
# $Id: Makefile,v 1.14 1996-10-27 21:28:03 dfs Exp $
# $Id: Makefile,v 1.20 1997-07-31 01:57:10 dfs Exp $
#-----------------------------------------------------------------------------
# THINGS FOR YOU TO EDIT START BELOW
@@ -54,17 +54,17 @@ GROUP=bin
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
# in config.h; then, you should be able to type 'make'.
#-----------------------------------------------------------------------------
VERSION= 03.00.15
VERSION= 03.00.17
MATHLIB= -lm
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \
danish.h polish.h
danish.h polish.h romanian.h
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h danish.h \
polish.h portbr.h italian.h
polish.h portbr.h italian.h romanian.h
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c hbcal.c \
init.c main.c moon.c omit.c sort.c queue.c token.c trigger.c userfns.c \
@@ -81,7 +81,7 @@ protos.h queue.c rem rem.1 rem2ps.1 rem2ps.c rem2ps.h remind-all.csh \
remind-all.sh remind.1 remind.def smakefile sort.c test-rem \
test-rem.ami test-rem.bat test-rem.cmd test-rem.rexx test.cmp test.rem \
test1.cmp test2.cmp tkremind tkremind.1 token.c trigger.c tstlang.rem \
types.h userfns.c utils.c var.c version.h remind.LSM
types.h userfns.c utils.c var.c version.h remind.LSM portbr.h romanian.h
OBJS= $(SRCS:.c=.o)
@@ -132,28 +132,23 @@ var.o: var.c $(STDHDRS) expr.h
tgz:
-rm -rf remind-$(VERSION)
-mkdir remind-$(VERSION)
cd remind-$(VERSION); for i in $(MANIFEST) ;do ln -s ../$$i .; done; cd ..
tar -c -h -v -f remind-3.0.15.tar remind-$(VERSION)
gzip -v -9 remind-3.0.15.tar
mv remind-3.0.15.tar.gz remind-3.0.15.tgz
cd remind-$(VERSION); for i in www $(MANIFEST) ;do ln -s ../$$i .; done; cd ..
tar --exclude CVS -c -h -v -f remind-3.0.17.tar remind-$(VERSION)
gzip -v -9 remind-3.0.17.tar
mv remind-3.0.17.tar.gz remind-3.0.17.tgz
rm -rf remind-$(VERSION)
shar:
shar -o./Shar -sdfs@doe.carleton.ca -a -c -n"Remind $(VERSION)" -m -l58 -o./Shar $(MANIFEST)
shar -o./Shar -sdfs@doe.carleton.ca -a -c -n"Remind $(VERSION)" -m -l58 -o./Shar www $(MANIFEST)
backup:
tar cvzf ../rbackup.tgz $(MANIFEST)
tar cvzf ../rbackup.tgz www $(MANIFEST)
zip:
zip ../rbackup.zip $(MANIFEST)
todos:
rm -rf DOS
mkdir DOS
for i in $(MANIFEST) ; do todos < $$i > DOS/$$i; done
zip ../rbackup.zip www $(MANIFEST)
transmit:
sz -a -e $(MANIFEST)
sz -a -e $(MANIFEST) www/*
install: install-bin install-scripts install-man
@@ -202,14 +197,3 @@ install-man:
-chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
-chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
-chgrp $(GROUP) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
release:
-mkdir RELEASE
-rm -f RELEASE/*
mkpatch ../prev . patch.15 Shar "Remind-3.0/Patch-15/part"
mv Shar* RELEASE
rm -f patch.15*
for i in *.1; do nroff -man $$i | sed -e 's/_//g' > `basename $$i .1`.man; done
mv *.man RELEASE
for i in *.1; do groff -man -Tps $$i > `basename $$i .1`.ps; done
mv *.ps RELEASE

View File

@@ -1,4 +1,4 @@
#$Id: Makefile_QDOS,v 1.3 1996-09-28 18:17:06 dfs Exp $
#$Id: Makefile_QDOS,v 1.5 1997-03-30 19:07:36 dfs Exp $
# Makefile for REMIND for QDOS / SMSQ
#-----------------------------------------------------------------------------
@@ -24,7 +24,7 @@ LDFLAGS= -bufp200K
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
# in config_h; then, you should be able to type 'make'.
#-----------------------------------------------------------------------------
VERSION= 03.00.15
VERSION= 03.00.17
MATHLIB= -lm
HDRS= config_h err_h expr_h globals_h protos_h types_h version_h \

View File

@@ -1,4 +1,4 @@
$Id: README.UNIX,v 1.2 1996-10-12 02:59:06 dfs Exp $
$Id: README.UNIX,v 1.3 1997-01-16 04:14:18 dfs Exp $
REMIND version 3.0 for UNIX
REMIND is a sophisticated alarm/calendar program. Details are given
@@ -30,6 +30,9 @@ in the man page, "remind.1".
8 - Type 'make install' to install Remind, kall, rem and the man
pages.
The subdirectory "www" contains scripts for making a nice calendar
web server. See the files README and Makefile in that directory.
Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
These allow automatic mailing of reminders to all users who create a
$HOME/.reminders file. These two scripts are equivalent; one is a

View File

@@ -1,5 +1,5 @@
$Id: README_QDOS,v 1.3 1996-09-28 18:17:07 dfs Exp $
REMIND version 3.0.15 for QDOS / SMSQ
$Id: README_QDOS,v 1.5 1997-03-30 19:07:36 dfs Exp $
REMIND version 3.0.17 for QDOS / SMSQ
REMIND is a sophisticated alarm/calendar program. Details are given
in the documentation file, "remind_doc" (QUILL format).

View File

@@ -1,5 +1,74 @@
CHANGES TO REMIND
* Version 3.0 Patch 17
+ MINOR ENHANCEMENTS
- Made REMIND accept date specs like "Jan 6, 1998" -- the comma is
ignored. This was suggested by John Conover <john@johncon.johncon.com>.
You can even do "REM 27, Aug, 1998, msg bar". (But I don't know why
you'd want to.)
- Added www/rem2html, a Perl script which converts the output of
`remind -p ...' to an HTML table. The script was contributed by
Don Schwarz <darkowl@mcs.net>
- New security features: Because of the risks of statically-allocated
buffers, REMIND now refuses to run if it is installed set-uid or set-gid.
If REMIND is run as root, it refuses to read files not owned by root.
It also won't open group- or world-writable files, no matter who is
running it. Finally, if you read a file you don't own, REMIND disables
RUN and shell(). REMIND doesn't do these security checks on stdin,
though, so be careful if you run it as root in a script.
NOTE: REMIND doesn't do the world- and group-writable checks
on devices, FIFOs, etc. Otherwise "remind /dev/null" fails...
+ BUG FIXES
- Increased sizes of some statically-allocated buffers. This doesn't
really fix the problem, but makes it more manageable.
- Using the "-u" option now implies the "-r" option. This is a
security feature.
- Added romanian.h to the manifest. Sorry.
- CalcMinsFromUTC was failing if time_t was unsigned. I now use
difftime(), but not all systems have it. Also, defs.rem was rearranged
so PostScript stuff works better, and new target "emxomf" was added to
makefile.os2 which uses OMF linking and a dynamically-linked C
library. All three of these fixes are courtesy of Christopher
J. Madsen <madsen@iglobal.net>. Thanks, Christopher.
* Version 3.0 Patch 16
+ MINOR ENHANCEMENTS
- Bundled scripts for making a nice WWW calendar server. See the
"www" subdirectory in the release.
- Added support for the Romanian language, courtesy of Liviu Daia.
- Changed sunrise() and sunset() as follows: If the sun never rises,
sunrise() returns 1440 and sunset() returns 0. In this case,
sunrise()-sunset() returns the length of the dark period of the
day, in minutes. If the sun never sets, sunrise() returns 0 and
sunset() returns 1440, and sunset()-sunrise() returns the length
of the light period of the day, in minutes. Thanks to Michael Salmon
for explaining the utility of this. See the file "defs.rem" for the
functions _light_len and _dark_len which return the length in minutes
of the light and dark period of the day, respectively.
+ BUG FIXES
- If you used the "-g" option, then no background reminders were
ever issued. DOH! Thanks to Greg Badros <gjb@cs.washington.edu>
for pointing this out.
- Fixed a problem under Solaris 2.5 whereby rem2ps was skipping some
latin1 characters which it interpreted as white space.
* Version 3.0 Patch 15
+ IMPORTANT NOTES

View File

@@ -7,10 +7,11 @@
/* This file is Copyright (C) 1995 by Martin Hohl */
/* */
/* This file is part of REMIND. */
/* Remind is Copyright (C) 1992-1996 by David F. Skoll */
/* Remind is Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: amiga.c,v 1.1 1996-03-31 04:01:53 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: amiga.c,v 1.3 1997-03-30 19:07:36 dfs Exp $";
#include <stdlib.h>
#include <string.h>

View File

@@ -5,13 +5,13 @@
/* The code for generating a calendar. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: calendar.c,v 1.2 1996-03-31 04:01:54 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: calendar.c,v 1.4 1997-03-30 19:07:37 dfs Exp $";
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STDLIB_H

View File

@@ -7,11 +7,11 @@
/* care of certain system dependencies. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: config.h,v 1.5 1996-10-12 02:49:32 dfs Exp $ */
/* $Id: config.h,v 1.8 1997-07-13 16:18:48 dfs Exp $ */
/*---------------------------------------------------------------------*/
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
@@ -160,7 +160,7 @@
/*---------------------------------------------------------------------*/
/* LINELEN: The maximum length of an input line */
/*---------------------------------------------------------------------*/
#define LINELEN 512
#define LINELEN 4096
/*---------------------------------------------------------------------*/
/* OP_STACK_SIZE: The size of the operator stack for expr. parsing */
@@ -198,6 +198,14 @@
#define HAVE_PROTOS 1
#endif
/*---------------------------------------------------------------------*/
/* Does our C compiler understand "const"? If not, define it as empty */
/* You may want to change the test -- it's very conservative. */
/*---------------------------------------------------------------------*/
#if !defined(__STDC__) && !defined(__TURBOC__) && !defined(__BORLANDC__)
#define const
#endif
/*---------------------------------------------------------------------*/
/* Do we use the <stdarg.h> scheme for functions with variable number */
/* of parameters? If not, the <varargs.h> scheme is assumed. */
@@ -239,7 +247,7 @@
/*---------------------------------------------------------------------*/
/* The size of statically-allocated buffers for tokens. */
/*---------------------------------------------------------------------*/
#define TOKSIZE 128
#define TOKSIZE 1024
/*---------------------------------------------------------------------*/
/* The size of the buffer for the shell() function. */

View File

@@ -6,12 +6,12 @@
/* */
/* This file is part of REMIND. */
/* */
/* REMIND is Copyright (C) 1992-1996 by David F. Skoll */
/* REMIND is Copyright (C) 1992-1997 by David F. Skoll */
/* This file is Copyright (C) 1993 by Mogens Lynnerup. */
/* */
/***************************************************************/
/* $Id: danish.h,v 1.1 1996-03-27 03:25:51 dfs Exp $ */
/* $Id: danish.h,v 1.2 1997-01-16 04:14:20 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Danish"

View File

@@ -17,12 +17,12 @@
# "#COLORS" for examples of ANSI color escape sequences. #
# #
# This file is part of REMIND. #
# Copyright (C) 1992-1996 by David F. Skoll #
# Copyright (C) 1992-1997 by David F. Skoll #
# #
#############################################################################
#
# $Id: defs.rem,v 1.1 1996-03-27 03:25:51 dfs Exp $
# $Id: defs.rem,v 1.4 1997-03-31 22:13:08 dfs Exp $
#
RUN OFF
@@ -160,6 +160,14 @@ FSET _am_pm(tm) IIF(tm<01:00, tm+12*60+"am", \
FSET _no_lz(s) IIF(SUBSTR(s, 1, 1)=="0", SUBSTR(s, 2), s)
#################################################################
# Return the length of the daylight/night portion of a date, #
# in minutes. #
#################################################################
FSET _light_len(date) MAX(SUNSET(date)-SUNRISE(date), 0)
FSET _dark_len(date) 1440-_light_len(date)
############################################################
# Function to calculate number of years since a given year #
# or number of months since a given month and year... #
@@ -299,51 +307,26 @@ IF !$RunOff && !$CalMode && !$SimpleCal
ENDIF
ENDIF
#PSSTUFF
#PSSTUFF1
##########################################################################
# #
# This portion of the file contains some cute examples of the new #
# PS-type reminders. You need a PostScript printer or viewer to #
# appreciate these. To use them, pipe the output of remind -p into the #
# rem2ps program. #
# rem2ps program. More examples are in the PSSTUFF2 section, below. #
# #
##########################################################################
# Convenient to stick all the PostScript code in a string var - makes
# reminders easier to understand and faster. The variable "shade" will
# contain PostScript code to shade in a particular box on the calendar.
SET shade psshade(95)
# The following reminder will shade the Saturday and Sunday calendar
# entries.
REM Sat Sun PS [shade]
# The following will fill in the Hebrew dates on the calendar. For this
# example, I recommend that you use the -sd 10 option for Rem2PS.
REM PS Border Border moveto \
/DayFont findfont DaySize scalefont setfont \
([hebday(today())] [hebmon(today())]) show
# Fill in the phases of the moon on the PostScript calendar
[trigger(moondate(0))] PS [psmoon(0)]
[trigger(moondate(1))] PS [psmoon(1)]
[trigger(moondate(2))] PS [psmoon(2)]
[trigger(moondate(3))] PS [psmoon(3)]
# The following example puts sunrise and sunset times in PostScript in the
# calendar - the sizes are hard-coded, however, and work best in landscape.
REM PS Border Border 5 sub moveto \
/SmallFont findfont 4 scalefont setfont \
(Sunrise: [sunrise(trigdate())] Sunset: [sunset(trigdate())]) show
# The next one puts the day number (1-366) and days left in the year at the
# bottom of the post-script calendar. Again, the hard-coded sizes work best
# in landscape.
FSET _DayOfYear(x) x-(date(year(x),1,1) - 1)
REM PS BoxWidth 3 mul 4 div Border 5 sub moveto \
/SmallFont findfont 4 scalefont setfont \
([_DayOfYear(today())]([365+isleap(today())-_DayOfYear(today())])) show
#USHOLS
#############################################################################
# #
@@ -405,7 +388,7 @@ OMIT Dec 25 MSG %"Christmas%" Day
# #
# The next block uses the shade variable defined in PSSTUFF above. #
# If any US holidays were triggered above, shade in the calendar #
# entry in PostScript. This is not quite correct, as it blots out the #
# entry in PostScript. This is not quite correct, as it blots out any #
# other PostScript stuff above. I was too lazy to do it properly :-) #
# #
##########################################################################
@@ -420,6 +403,42 @@ REM Sep [CHOOSE(YEAR(TODAY())-1991, 22,22,23,23,22,22,22,23,22)] \
MSG %"Fall%" begins
REM Dec [IIF((YEAR(TODAY())+1)%4, 21, 22)] MSG %"Winter%" begins
#PSSTUFF2
##########################################################################
# #
# Since the "psshade" command blots out any previous PostScript #
# reminders for a date, these examples need to follow the US Holidays #
# section, which uses psshade. See PSSTUFF1, above, for examples using #
# psshade. #
# #
##########################################################################
# The following will fill in the Hebrew dates on the calendar. For this
# example, I recommend that you use the -sd 10 option for Rem2PS.
REM PS Border Border moveto \
/DayFont findfont DaySize scalefont setfont \
([hebday(today())] [hebmon(today())]) show
# Fill in the phases of the moon on the PostScript calendar
[trigger(moondate(0))] PS [psmoon(0)]
[trigger(moondate(1))] PS [psmoon(1)]
[trigger(moondate(2))] PS [psmoon(2)]
[trigger(moondate(3))] PS [psmoon(3)]
# The following example puts sunrise and sunset times in PostScript in the
# calendar - the sizes are hard-coded, however, and work best in landscape.
REM PS Border Border 5 sub moveto \
/SmallFont findfont 4 scalefont setfont \
(Sunrise: [sunrise(trigdate())] Sunset: [sunset(trigdate())]) show
# The next one puts the day number (1-366) and days left in the year at the
# bottom of the post-script calendar. Again, the hard-coded sizes work best
# in landscape.
FSET _DayOfYear(x) x-(date(year(x),1,1) - 1)
REM PS BoxWidth 3 mul 4 div Border 5 sub moveto \
/SmallFont findfont 4 scalefont setfont \
([_DayOfYear(today())]([365+isleap(today())-_DayOfYear(today())])) show
#JHOLS
##########################################################################
# #

View File

@@ -7,13 +7,13 @@
/* commands. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: dorem.c,v 1.3 1996-04-28 02:01:54 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: dorem.c,v 1.5 1997-03-30 19:07:37 dfs Exp $";
#include <stdio.h>
#include <ctype.h>
#include <string.h>

View File

@@ -6,14 +6,14 @@
/* reminders are triggered. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: dosubst.c,v 1.3 1996-10-12 02:49:32 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: dosubst.c,v 1.5 1997-03-30 19:07:38 dfs Exp $";
#define L_IN_DOSUBST
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <ctype.h>

View File

@@ -11,11 +11,11 @@
/* Further corrections by Erik-Jan Vens */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: dutch.h,v 1.1 1996-03-27 03:25:53 dfs Exp $ */
/* $Id: dutch.h,v 1.2 1997-01-16 04:14:21 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Dutch"

View File

@@ -5,11 +5,11 @@
/* Support for the English language. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: english.h,v 1.1 1996-03-27 03:25:53 dfs Exp $ */
/* $Id: english.h,v 1.2 1997-01-16 04:14:21 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "English"

4
err.h
View File

@@ -5,11 +5,11 @@
/* Error definitions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: err.h,v 1.2 1996-04-28 02:01:55 dfs Exp $ */
/* $Id: err.h,v 1.3 1997-01-16 04:14:22 dfs Exp $ */
/* Note that not all of the "errors" are really errors - some are just
messages for information purposes. Constants beginning with M_ should

6
expr.c
View File

@@ -5,13 +5,13 @@
/* This file contains routines to parse and evaluate */
/* expressions. */
/* */
/* Copyright 1992-1996 by David F. Skoll */
/* Copyright 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: expr.c,v 1.4 1996-05-25 18:14:51 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: expr.c,v 1.6 1997-03-30 19:07:38 dfs Exp $";
#include <stdio.h>
#include <ctype.h>
#include <string.h>

4
expr.h
View File

@@ -5,11 +5,11 @@
/* Contains a few definitions used by expression evaluator. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: expr.h,v 1.1 1996-03-27 03:25:54 dfs Exp $ */
/* $Id: expr.h,v 1.2 1997-01-16 04:14:22 dfs Exp $ */
/* Define the types of values */
#define ERR_TYPE 0

128
files.c
View File

@@ -7,13 +7,13 @@
/* files. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: files.c,v 1.3 1996-05-25 19:10:12 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: files.c,v 1.9 1997-08-31 17:03:25 dfs Exp $";
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -27,6 +27,10 @@ static char const RCSID[] = "$Id: files.c,v 1.3 1996-05-25 19:10:12 dfs Exp $";
#include <sys/stat.h>
#include <time.h>
#ifdef HAVE_UNISTD
#include <unistd.h>
#endif
#if defined(__MSDOS__)
#include <io.h>
#endif
@@ -55,6 +59,9 @@ typedef struct cheader {
struct cheader *next;
char *filename;
CachedLine *cache;
#ifdef UNIX
int ownedByMe;
#endif
} CachedFile;
/* Define the structures needed by the INCLUDE file system */
@@ -65,6 +72,9 @@ typedef struct {
int NumIfs;
long offset;
CachedLine *CLine;
#ifdef UNIX
int ownedByMe;
#endif
} IncludeStruct;
static CachedFile *CachedFiles = (CachedFile *) NULL;
@@ -78,6 +88,7 @@ static int IStackPtr = 0;
PRIVATE int ReadLineFromFile ARGS ((void));
PRIVATE int CacheFile ARGS ((const char *fname));
PRIVATE void DestroyCache ARGS ((CachedFile *cf));
PRIVATE int CheckSafety ARGS ((void));
/***************************************************************/
/* */
@@ -176,6 +187,9 @@ char *fname;
CachedFile *h = CachedFiles;
int r;
/* Assume we own the file for now */
RunDisabled &= ~RUN_NOTOWNER;
/* If it's in the cache, get it from there. */
while (h) {
@@ -183,6 +197,11 @@ char *fname;
CLine = h->cache;
STRSET(FileName, fname);
LineNo = 0;
#ifdef UNIX
if (!h->ownedByMe) {
RunDisabled |= RUN_NOTOWNER;
}
#endif
if (FileName) return OK; else return E_NO_MEM;
}
h = h->next;
@@ -194,7 +213,7 @@ char *fname;
} else {
fp = fopen(fname, "r");
}
if (!fp) return E_CANT_OPEN;
if (!fp || !CheckSafety()) return E_CANT_OPEN;
CLine = NULL;
if (ShouldCache) {
LineNo = 0;
@@ -203,11 +222,12 @@ char *fname;
fp = NULL;
CLine = CachedFiles->cache;
} else {
if (strcmp(fname, "-"))
if (strcmp(fname, "-")) {
fp = fopen(fname, "r");
else
if (!fp || !CheckSafety()) return E_CANT_OPEN;
} else {
fp = stdin;
if (!fp) return E_CANT_OPEN;
}
}
}
STRSET(FileName, fname);
@@ -248,6 +268,13 @@ char *fname;
return E_NO_MEM;
}
#ifdef UNIX
if (RunDisabled & RUN_NOTOWNER) {
cf->ownedByMe = 0;
} else {
cf->ownedByMe = 1;
}
#endif
/* Read the file */
while(fp) {
r = ReadLineFromFile();
@@ -314,6 +341,9 @@ int PopFile()
{
IncludeStruct *i;
/* Assume we own the file for now */
RunDisabled &= ~RUN_NOTOWNER;
if (!Hush && NumIfs) Eprint("%s", ErrMsg[E_MISS_ENDIF]);
if (!IStackPtr) return E_EOF;
IStackPtr--;
@@ -325,13 +355,19 @@ int PopFile()
CLine = i->CLine;
fp = NULL;
STRSET(FileName, i->filename);
#ifdef UNIX
if (!i->ownedByMe) {
RunDisabled |= RUN_NOTOWNER;
}
#endif
if (!CLine && (i->offset != -1L)) {
/* We must open the file, then seek to specified position */
if (strcmp(i->filename, "-"))
if (strcmp(i->filename, "-")) {
fp = fopen(i->filename, "r");
else
if (!fp || !CheckSafety()) return E_CANT_OPEN;
} else {
fp = stdin;
if (!fp) return E_CANT_OPEN;
}
if (fp != stdin)
(void) fseek(fp, i->offset, 0); /* Trust that it works... */
}
@@ -382,6 +418,7 @@ char *fname;
{
IncludeStruct *i;
int r;
int oldRunDisabled;
if (IStackPtr+1 >= INCLUDE_NEST) return E_NESTED_INCLUDE;
i = &IStack[IStackPtr];
@@ -393,6 +430,13 @@ char *fname;
i->IfFlags = IfFlags;
i->CLine = CLine;
i->offset = -1L;
#ifdef UNIX
if (RunDisabled & RUN_NOTOWNER) {
i->ownedByMe = 0;
} else {
i->ownedByMe = 1;
}
#endif
if (fp) {
i->offset = ftell(fp);
FCLOSE(fp);
@@ -400,10 +444,12 @@ char *fname;
IStackPtr++;
oldRunDisabled = RunDisabled;
/* Try to open the new file */
if (!OpenFile(fname)) {
return OK;
}
RunDisabled = oldRunDisabled;
/* Ugh! We failed! */
if ( (r=PopFile()) ) return r;
Eprint("%s: %s", ErrMsg[E_CANT_OPEN], fname);
@@ -556,3 +602,65 @@ int TopLevel()
{
return !IStackPtr;
}
/***************************************************************/
/* */
/* CheckSafety */
/* */
/* Returns 1 if current file is safe to read; 0 otherwise. */
/* Currently only meaningful for UNIX. If we are running as */
/* root, we refuse to open files not owned by root. */
/* We also reject group- or world-writable files, no matter */
/* who we're running as. */
/* As a side effect, if we don't own the file, we disable RUN */
/***************************************************************/
#ifdef HAVE_PROTOS
PRIVATE int CheckSafety(void)
#else
static int CheckSafety()
#endif
{
#ifdef UNIX
struct stat statbuf;
if (fp == stdin) {
return 1;
}
if (fstat(fileno(fp), &statbuf)) {
fclose(fp);
fp = NULL;
return 0;
}
/* Under UNIX, take extra precautions if running as root */
if (!geteuid()) {
/* Reject files not owned by root or group/world writable */
if (statbuf.st_uid != 0) {
fprintf(ErrFp, "SECURITY: Won't read non-root-owned file when running as root!\n");
fclose(fp);
fp = NULL;
return 0;
}
}
/* Sigh... /dev/null is usually world-writable, so ignore devices,
FIFOs, sockets, etc. */
if (!S_ISREG(statbuf.st_mode)) {
return 1;
}
if ((statbuf.st_mode & S_IWGRP) ||
(statbuf.st_mode & S_IWOTH)) {
fprintf(ErrFp, "SECURITY: Won't read group- or world-writable file!\n");
fclose(fp);
fp = NULL;
return 0;
}
/* If file is not owned by me, disable RUN command */
if (statbuf.st_uid != geteuid()) {
RunDisabled |= RUN_NOTOWNER;
}
#endif
return 1;
}

View File

@@ -11,11 +11,11 @@
/* */
/* This file is part of REMIND. */
/* This file is Copyright (C) 1993, 1994 by Mikko Silvonen. */
/* REMIND is Copyright (C) 1992-1996 by David F. Skoll */
/* REMIND is Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: finnish.h,v 1.3 1996-04-29 19:34:37 dfs Exp $ */
/* $Id: finnish.h,v 1.4 1997-01-16 04:14:23 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Finnish"

View File

@@ -8,13 +8,13 @@
/* */
/* This file is part of REMIND. */
/* */
/* REMIND is Copyright (C) 1992-1996 by David F. Skoll */
/* REMIND is Copyright (C) 1992-1997 by David F. Skoll */
/* This file is Copyright (C) 1993 by Laurent Duperval and */
/* David F. Skoll. */
/* */
/***************************************************************/
/* $Id: french.h,v 1.3 1996-04-29 19:34:37 dfs Exp $ */
/* $Id: french.h,v 1.5 1997-08-31 17:03:25 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "French"
@@ -361,7 +361,7 @@ PUBLIC void Usage(void)
void Usage()
#endif /* HAVE_PROTOS */
{
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1996 by David F. Skoll\n", VERSION, L_LANGNAME);
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1997 by David F. Skoll\n", VERSION, L_LANGNAME);
#ifdef BETA
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
#endif

27
funcs.c
View File

@@ -6,13 +6,13 @@
/* expressions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: funcs.c,v 1.4 1996-10-06 21:03:49 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: funcs.c,v 1.7 1997-03-30 19:07:39 dfs Exp $";
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -2030,7 +2030,14 @@ int jul;
/* Cosine of sun's local hour angle */
cosH = (cosz - sinDelta * sin(latitude)) / (cosDelta * cos(latitude));
if (cosH > 1.0 || cosH < -1.0) return NO_TIME;
if (cosH < -1.0) { /* Summer -- permanent daylight */
if (rise) return NO_TIME;
else return -NO_TIME;
}
if (cosH > 1.0) { /* Winter -- permanent darkness */
if (rise) return -NO_TIME;
else return NO_TIME;
}
H = RADDEG * acos(cosH);
if (rise) H = 360.0 - H;
@@ -2049,6 +2056,15 @@ int jul;
hours = (int) local;
mins = (int) ((local - hours) * 60.0);
/* Sometimes, we get roundoff error. Check for "reasonableness" of
answer. */
if (rise) {
/* Sunrise so close to midnight it wrapped around -- permament light */
if (hours >= 23) return NO_TIME;
} else {
/* Sunset so close to midnight it wrapped around -- permament light */
if (hours <= 1) return -NO_TIME;
}
return hours*60 + mins;
}
@@ -2077,6 +2093,9 @@ int rise;
if (r == NO_TIME) {
RetVal.v.val = 0;
RetVal.type = INT_TYPE;
} else if (r == -NO_TIME) {
RetVal.v.val = 1440;
RetVal.type = INT_TYPE;
} else {
RetVal.v.val = r;
RetVal.type = TIM_TYPE;

View File

@@ -9,11 +9,11 @@
/* I don't speak German. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: german.h,v 1.1 1996-03-27 03:25:56 dfs Exp $ */
/* $Id: german.h,v 1.2 1997-01-16 04:14:24 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "German"

View File

@@ -8,13 +8,13 @@
/* globals.h and err.h */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: globals.c,v 1.1 1996-03-27 03:25:57 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: globals.c,v 1.3 1997-03-30 19:07:39 dfs Exp $";
#include <stdio.h> /* For defintion of FILE - sigh! */
#include "types.h"
#define MK_GLOBALS

View File

@@ -7,11 +7,11 @@
/* MK_GLOBALS. Also contains useful macro definitions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: globals.h,v 1.1 1996-03-27 03:25:57 dfs Exp $ */
/* $Id: globals.h,v 1.2 1997-01-16 04:14:24 dfs Exp $ */
#ifdef MK_GLOBALS
#undef EXTERN

View File

@@ -5,17 +5,17 @@
/* Support for the Hebrew calendar */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/* Derived from code written by Amos Shapir in 1978; revised */
/* 1985. */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: hbcal.c,v 1.1 1996-03-27 03:25:58 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: hbcal.c,v 1.3 1997-03-30 19:07:40 dfs Exp $";
#include <stdio.h> /* For FILE used by protos.h - sigh. */
#include "config.h"
#include "types.h"
#include "protos.h"
#include "globals.h"

20
init.c
View File

@@ -7,14 +7,14 @@
/* in normal mode. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: init.c,v 1.3 1996-10-27 21:28:03 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: init.c,v 1.7 1997-08-31 17:03:26 dfs Exp $";
#define L_IN_INIT 1
#include "config.h"
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STDLIB_H
@@ -112,6 +112,15 @@ char *argv[];
int y, m, d, rep;
Token tok;
/* Make sure remind is not installed set-uid or set-gid */
#ifdef UNIX
if (getgid() != getegid() ||
getuid() != geteuid()) {
fprintf(ErrFp, "\nRemind should not be installed set-uid or set-gid.\nCHECK YOUR SYSTEM SECURITY.\n");
exit(1);
}
#endif
y = NO_YR;
m = NO_MON;
d = NO_DAY;
@@ -171,7 +180,7 @@ char *argv[];
case 'r':
case 'R':
RunDisabled = 1;
RunDisabled = RUN_CMDLINE;
break;
case 'm':
@@ -225,6 +234,7 @@ char *argv[];
case 'u':
case 'U':
ChgUser(arg);
RunDisabled = RUN_CMDLINE;
while (*arg) arg++;
break;
#endif
@@ -455,7 +465,7 @@ PUBLIC void Usage(void)
void Usage()
#endif /* HAVE_PROTOS */
{
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1996 by David F. Skoll\n", VERSION, L_LANGNAME);
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1997 by David F. Skoll\n", VERSION, L_LANGNAME);
#ifdef BETA
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
#endif

View File

@@ -7,11 +7,11 @@
/* This file is part of REMIND. */
/* It is Copyright (C) 1996 by Valerio Aimale */
/* */
/* Remind is copyright (C) 1992-1996 by David F. Skoll */
/* Remind is copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: italian.h,v 1.1 1996-10-12 02:49:33 dfs Exp $ */
/* $Id: italian.h,v 1.2 1997-01-16 04:14:26 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Italian"

7
lang.h
View File

@@ -5,11 +5,11 @@
/* Header file for language support for various languages. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: lang.h,v 1.4 1996-10-12 02:49:33 dfs Exp $ */
/* $Id: lang.h,v 1.6 1997-01-16 04:14:26 dfs Exp $ */
/* I'm chauvinistic and name each language with its English name... */
@@ -23,6 +23,7 @@
#define POLISH 7 /* translated by Jerzy Sobczyk */
#define BRAZPORT 8 /* Brazilian Portuguese by Marco Paganini */
#define ITALIAN 9 /* translated by Valerio Aimale */
#define ROMANIAN 10 /* translated by Liviu Daia */
/* Add more languages here - but please e-mail aa775@freenet.carleton.ca
to have your favorite language assigned a number. If you add a
@@ -62,6 +63,8 @@
#include "portbr.h"
#elif LANG == ITALIAN
#include "italian.h"
#elif LANG == ROMANIAN
#include "romanian.h"
/* If no sensible language, choose English. I intended to use
the #error directive here, but some C compilers barf. */

27
main.c
View File

@@ -6,13 +6,13 @@
/* routines, etc. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: main.c,v 1.3 1996-04-28 02:01:59 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: main.c,v 1.9 1997-09-07 19:19:11 dfs Exp $";
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -502,6 +502,10 @@ char *out;
len++;
}
}
/* Ignore trailing commas */
if (len > 0 && *(out-1) == ',') {
out--;
}
*out = 0;
return OK;
}
@@ -1223,6 +1227,7 @@ int jul, tim, *mins, *isdst;
/* Convert jul and tim to an Unix tm struct */
int yr, mon, day;
int tdiff;
struct tm local, utc, *temp;
time_t loc_t, utc_t;
@@ -1257,12 +1262,16 @@ int jul, tim, *mins, *isdst;
if (utc_t == -1) return 1;
#endif
temp = localtime(&loc_t);
#ifdef HAVE_MKTIME
if (mins) *mins = (int) ( ((temp->tm_isdst) ? 60 : 0) +
(loc_t - utc_t) / 60 ); /* Should use difftime */
#else
if (mins) *mins = (int) ((utc_t - loc_t) / 60);
#endif
/* Compute difference between local time and UTC in seconds.
Be careful, since time_t might be unsigned. */
/* I would love to use difftime(), but SunOS doesn't have it. */
if (loc_t < utc_t) {
tdiff = - (int) (utc_t - loc_t);
} else {
tdiff = (int) (loc_t - utc_t);
}
if (mins) *mins = (int)(tdiff / 60);
if (isdst) *isdst = temp->tm_isdst;
return 0;
}

View File

@@ -1,7 +1,7 @@
# Makefile for REMIND for Borland C++
# $Id: makefile.bcc,v 1.3 1996-09-28 18:17:07 dfs Exp $
# $Id: makefile.bcc,v 1.5 1997-03-30 19:07:41 dfs Exp $
VERSION= 03.00.15
VERSION= 03.00.17
MODEL=l

View File

@@ -1,6 +1,6 @@
# Makefile for REMIND
#
# $Id: makefile.os2,v 1.2 1996-10-12 02:49:34 dfs Exp $
# $Id: makefile.os2,v 1.3 1997-03-31 22:13:09 dfs Exp $
#
# THIS IS OUT OF DATE!
#
@@ -18,6 +18,7 @@ default:
@echo " msc OS/2 exe [Microsoft C 6.00a] "
@echo " mscbnd OS/2 and DOS exe [Microsoft C 6.00a] "
@echo " emx OS/2 and DOS 32-bit exe [EMX/gcc] "
@echo " emxomf OS/2 32-bit exe w/DLL C library [EMX/gcc] "
msc:
@@ -41,6 +42,13 @@ emx:
CFLAGS="-D__OS2__ -D__MSDOS__" \
LFLAGS=""
emxomf:
$(MAKE) -f Makefile.os2 all \
CC="gcc -Zomf -O -s" O=".obj" \
CFLAGS="-D__OS2__" \
LFLAGS="-Zcrtdll -Zstack 32" \
LFLAGS2="remind.def"
# OS2_POPUP enables Russ Herman's popup reminders
#OS2_POPUP =
@@ -71,6 +79,8 @@ OBJS= $(SRCS:.c=$O)
all: remind.exe rem2ps.exe
.SUFFIXES: $O
.c$O:
$(CC) -c $(CFLAGS) $(OS2_POPUP) $*.c

View File

@@ -1,8 +1,8 @@
# Makefile for REMIND for Turbo C for MSDOS
# $Id: makefile.tc,v 1.3 1996-09-28 18:17:08 dfs Exp $
# $Id: makefile.tc,v 1.5 1997-03-30 19:07:41 dfs Exp $
CC= tcc
VERSION= 03.00.15
VERSION= 03.00.17
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \

6
moon.c
View File

@@ -5,11 +5,12 @@
/* Calculations for figuring out moon phases. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: moon.c,v 1.1 1996-03-27 03:26:03 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: moon.c,v 1.3 1997-03-30 19:07:42 dfs Exp $";
/* All of these routines were adapted from the program "moontool"
by John Walker, February 1988. Here's the blurb from moontool:
@@ -59,7 +60,6 @@ static char const RCSID[] = "$Id: moon.c,v 1.1 1996-03-27 03:26:03 dfs Exp $";
that credit and blame may be properly apportioned.
*/
#include "config.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

View File

@@ -6,11 +6,11 @@
/* */
/* This file is part of REMIND. */
/* This file is Copyright (C) 1993 by Trygve Randen. */
/* Remind is Copyright (C) 1992-1996 by David F. Skoll */
/* Remind is Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: norwgian.h,v 1.1 1996-03-27 03:26:03 dfs Exp $ */
/* $Id: norwgian.h,v 1.2 1997-01-16 04:14:27 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Norwegian"

6
omit.c
View File

@@ -6,13 +6,13 @@
/* the data structures for OMITted dates. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: omit.c,v 1.2 1996-04-28 02:02:00 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: omit.c,v 1.4 1997-03-30 19:07:42 dfs Exp $";
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>

View File

@@ -7,11 +7,12 @@
/* This file is part of REMIND. */
/* */
/* This file is Copyright (C) 1993 by Russ Herman. */
/* REMIND is Copyright (C) 1992-1996 by David F. Skoll */
/* REMIND is Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: os2func.c,v 1.1 1996-03-27 03:26:04 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: os2func.c,v 1.3 1997-03-30 19:07:42 dfs Exp $";
#ifdef OS2_POPUP
#define INCL_VIO
@@ -34,7 +35,6 @@ static char const RCSID[] = "$Id: os2func.c,v 1.1 1996-03-27 03:26:04 dfs Exp $"
#include <dos.h>
#include <stdlib.h>
#endif
#include "config.h"
#include "globals.h"
/* EMX defines PS_TYPE, so we undefine it here to avoid

View File

@@ -9,11 +9,11 @@
/* Polish. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: polish.h,v 1.3 1996-04-29 19:34:38 dfs Exp $ */
/* $Id: polish.h,v 1.4 1997-01-16 04:14:28 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Polish"
@@ -400,7 +400,7 @@ PUBLIC void Usage(void)
void Usage()
#endif /* HAVE_PROTOS */
{
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1996 by David F. Skoll\n", VERSION, L_LANGNAME);
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1997 by David F. Skoll\n", VERSION, L_LANGNAME);
#ifdef BETA
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
#endif

View File

@@ -8,13 +8,13 @@
/* */
/* This file is part of REMIND. */
/* */
/* REMIND is Copyright (C) 1992-1996 by David F. Skoll */
/* REMIND is Copyright (C) 1992-1997 by David F. Skoll */
/* This file is Copyright (C) 1996 by Marco Paganini and */
/* David F. Skoll. */
/* */
/***************************************************************/
/* $Id: portbr.h,v 1.1 1996-06-22 02:21:29 dfs Exp $ */
/* $Id: portbr.h,v 1.2 1997-01-16 04:14:29 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Brazilian Portuguese"
@@ -261,7 +261,7 @@ PUBLIC void Usage(void)
void Usage()
#endif /* HAVE_PROTOS */
{
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-1996 by David F. Skoll\n", VERSION, L_LANGNAME);
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-1997 by David F. Skoll\n", VERSION, L_LANGNAME);
#ifdef BETA
fprintf(ErrFp, ">>>> VERSAO BETA <<<<\n");
#endif

View File

@@ -5,11 +5,11 @@
/* Function Prototypes. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: protos.h,v 1.2 1996-03-31 04:01:57 dfs Exp $ */
/* $Id: protos.h,v 1.3 1997-01-16 04:14:29 dfs Exp $ */
#ifdef HAVE_PROTOS
#define ARGS(x) x

10
queue.c
View File

@@ -5,13 +5,12 @@
/* Queue up reminders for subsequent execution. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: queue.c,v 1.1 1996-03-27 03:26:05 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: queue.c,v 1.4 1997-03-30 19:07:44 dfs Exp $";
/* We only want object code generated if we have queued reminders */
#ifdef HAVE_QUEUED
@@ -133,7 +132,10 @@ void HandleQueuedReminders()
/* Suppress the BANNER from being issued */
NumTriggered = 1;
/* Turn off sorting -- otherwise, TriggerReminder has no effect! */
SortByDate = 0;
/* If we are not connected to a tty, then we must close the
* standard file descriptors. This is to prevent someone
* doing:

View File

@@ -5,13 +5,13 @@
/* Print a PostScript calendar. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: rem2ps.c,v 1.4 1996-07-07 16:35:42 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: rem2ps.c,v 1.7 1997-03-30 19:07:45 dfs Exp $";
#include "lang.h"
#include <stdio.h>
#include <string.h>
@@ -160,7 +160,7 @@ char argv[];
if (!strcmp(LineBuffer, PSBEGIN)) {
if (!validfile) {
if (Verbose) {
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-1996 by David F. Skoll\n\n", VERSION);
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-1997 by David F. Skoll\n\n", VERSION);
fprintf(stderr, "Generating PostScript calendar\n");
}
}
@@ -226,7 +226,7 @@ void DoPsCal()
year[2], year[3], validfile);
/* Emit PostScript to do the heading */
if (!PortraitMode) printf("XSIZE 0 translate 90 rotate\n");
if (!PortraitMode) printf("90 rotate 0 XSIZE neg translate\n");
printf("/SAVESTATE save def (%s) (%s) PreCal SAVESTATE restore\n", month, year);
printf("(%s %s) doheading\n", month, year);
@@ -367,7 +367,7 @@ void WriteProlog()
isostuff = "copyFont";
/* Write the document structuring stuff */
printf("%%!PS-Adobe-\n");
printf("%%!PS-Adobe-2.0\n");
printf("%%%%DocumentFonts: %s", HeadFont);
if (strcmp(TitleFont, HeadFont)) printf(" %s", TitleFont);
if (strcmp(TitleFont, DayFont) &&
@@ -550,16 +550,18 @@ char *s;
printf(" [");
/* Chew up leading spaces */
while(isspace(*s)) s++;
while(isspace((unsigned char) *s)) s++;
PutChar('(');
while(*s) {
c = *s++;
/* Use the "unsigned char" cast to fix problem on Solaris 2.5 */
/* which treated some latin1 characters as white space. */
c = (unsigned char) *s++;
if (c == '\\' || c == '(' || c == ')') PutChar('\\');
if (!isspace(c)) PutChar(c);
else {
PutChar(')');
while(isspace(*s)) s++;
while(isspace((unsigned char)*s)) s++;
if (!*s) {
printf("]\n");
return;

View File

@@ -5,16 +5,17 @@
/* Define the PostScript prologue */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: rem2ps.h,v 1.1 1996-03-27 03:26:08 dfs Exp $ */
/* $Id: rem2ps.h,v 1.2 1997-01-16 04:14:30 dfs Exp $ */
char *PSProlog1[] =
{
"% This file was produced by Remind and Rem2PS, written by",
"% David F. Skoll.",
"% Remind and Rem2PS are Copyright 1992-1997 David F. Skoll.",
"/ISOLatin1Encoding where { pop save true }{ false } ifelse",
" /ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus",
" StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute",

View File

@@ -3,9 +3,9 @@
# This file is part of REMIND
#
# $Id: remind-all.sh,v 1.1 1996-03-27 03:26:08 dfs Exp $
# $Id: remind-all.sh,v 1.2 1997-01-16 04:14:30 dfs Exp $
#
# REMIND is Copyright (C) 1992-1996 by David F. Skoll
# REMIND is Copyright (C) 1992-1997 by David F. Skoll
# This file is Copyright (C) 1990 by Bill Aten
# Thanks to Bill Aten for this script.

View File

@@ -1,5 +1,5 @@
.\" $Id: remind.1,v 1.5 1996-10-12 02:49:34 dfs Exp $
.TH REMIND 1 "27 April 1996"
.\" $Id: remind.1,v 1.10 1997-08-31 17:03:26 dfs Exp $
.TH REMIND 1 "31 July 1997"
.UC 4
.SH NAME
remind \- a sophisticated reminder service
@@ -15,6 +15,8 @@ If \fIfilename\fR is specified as a single dash '-', then \fBRemind\fR
takes its input from standard input. This also implicitly enables
the \fB\-o\fR option, described below.
.SH OPTIONS
\fBRemind\fR has a slew of options. If you're new to the program,
ignore them for now and skip to the section "Reminder Files".
.TP
.B \-n
The \fB\-n\fR option causes \fBRemind\fR to print the \fBnext\fR occurrence
@@ -179,7 +181,9 @@ The option changes the uid and gid as described, and sets the
environment variables HOME, SHELL and USER to the home directory, shell,
and user name, respectively, of the specified user. LOGNAME is also
set to the specified user name. This option is meant for
use in shell scripts which mail reminders to all users.
use in shell scripts which mail reminders to all users. Note that
as of Remind 3.0.17, using \fB\-u\fR implies \fB\-r\fR -- the RUN
directive and shell() functions are disabled.
.PP
.RS
Non-root users can also use the \fB\-u\fR option. However, in this
@@ -1167,7 +1171,7 @@ will begin reading from standard input.
.SH THE RUN COMMAND
.PP
If you include other files in your reminder script, you may not always
entirely "trust" the contents of the other files. For example, they
entirely trust the contents of the other files. For example, they
may contain \fBRUN\fR-type reminders which could be used to access your
files or perform undesired actions. The \fBRUN\fR command can restrict
this: If you include the command \fBRUN OFF\fR in your top-level reminder
@@ -1202,6 +1206,12 @@ your main .reminders file, include the following lines:
RUN ON # Re-enable RUN
.fi
.PP
In addition, \fBRemind\fR on UNIX contains a few other security
features. It will not read a file which is group- or world-writable.
It will not run set-uid. If it reads a file you don't own, it will
disable RUN and the shell() function. And if it is run as \fIroot\fR,
it will only read files owned by \fIroot\fR.
.PP
.SH THE BANNER COMMAND
.PP
When \fBRemind\fR first issues a reminder, it prints a message like this:
@@ -2157,13 +2167,14 @@ of \fIstr\fR.
Returns a \fBTIME\fR indicating the time of sunrise on the specified
\fIdate\fR (default \fBtoday()\fR.) In high lattitudes, there
may be no sunrise on a particular day, in which case \fBsunrise()\fR
returns the \fBINT\fR 0.
returns the \fBINT\fR 0 if the sun never sets, or 1440 if it never rises.
.TP
.B sunset([d_date])
Returns a \fBTIME\fR indicating the time of sunset on the specified
\fIdate\fR (default \fBtoday()\fR.) In high lattitudes, there
may be no sunset on a particular day, in which case \fBsunset()\fR
returns the \fBINT\fR 0.
returns the \fBINT\fR 0 if the sun never rises, or 1440 if it never
sets.
.RS
.PP
The functions \fBsunrise()\fR and \fBsunset()\fR are based on
@@ -3619,6 +3630,9 @@ Marco Paganini (complete)
.PP
\fBItalian\fR --
Valerio Aimale
.PP
\fBRomanian\fR --
Liviu Daia
.SH BUGS
.PP
There's no good reason why read-only system variables are not

View File

@@ -1,18 +1,19 @@
Begin3
Title: Remind
Version: 03.00.15
Entered-date: 27 October 1996
Version: 03.00.17
Entered-date: 10 February 1997
Description: Full-featured calendar/reminder program featuring
sophisticated date calculation, moon phases, sunrise/sunset,
Hebrew calendar, alarms, PostScript output, X-Windows
front-end, multilingual messages, and proper handling of
holidays. Available for UNIX, MS-DOS, OS/2, and other
platforms.
Keywords: calendar reminder alarm datebook PostScript
platforms. Includes scripts for making a nice WWW
calendar server.
Keywords: calendar reminder alarm datebook PostScript www
Author: aa775@freenet.carleton.ca (David F. Skoll)
Maintained-by: aa775@freenet.carleton.ca (David F. Skoll)
Primary-site: ftp.doe.carleton.ca /pub/Remind-3.0
215kB remind-3.0.15.tgz
230kB remind-3.0.17.tgz
Alternate-site:
Original-site:
Platform: Linux, Solaris, SunOS, HP-UX -- virtually any UN*X-like

112
romanian.h Normal file
View File

@@ -0,0 +1,112 @@
/***************************************************************/
/* */
/* ROMANIAN.H */
/* */
/* Support for the Romanian language. */
/* */
/* Contributed by Liviu Daia <daia@stoilow.imar.ro> */
/* */
/* This file is part of REMIND. */
/* */
/* REMIND is Copyright (C) 1992-1997 by David F. Skoll */
/* This file is Copyright (C) 1996 by Liviu Daia */
/* */
/***************************************************************/
/* $Id: romanian.h,v 1.2 1997-01-16 04:14:31 dfs Exp $ */
/* The very first define in a language support file must be L_LANGNAME: */
#define L_LANGNAME "Romanian"
/* Day names */
#define L_SUNDAY "Duminica"
#define L_MONDAY "Luni"
#define L_TUESDAY "Marti"
#define L_WEDNESDAY "Miercuri"
#define L_THURSDAY "Joi"
#define L_FRIDAY "Vineri"
#define L_SATURDAY "Sambata"
/* Day initials - first letter only */
#define L_DAYINIT "DLMMJVS"
/* Month names */
#define L_JAN "Ianuarie"
#define L_FEB "Februarie"
#define L_MAR "Martie"
#define L_APR "Aprilie"
#define L_MAY "Mai"
#define L_JUN "Iunie"
#define L_JUL "Iulie"
#define L_AUG "August"
#define L_SEP "Septembrie"
#define L_OCT "Octombrie"
#define L_NOV "Noiemberie"
#define L_DEC "Decembrie"
/* Today and tomorrow */
#define L_TODAY "astazi"
#define L_TOMORROW "maine"
/* The default banner */
#define L_BANNER "Reamintiri pentru %w, %d %m %y%o:"
/* "am" and "pm" */
#define L_AM "am"
#define L_PM "pm"
#ifdef L_IN_DOSUBST
/*** The following are only used in dosubst.c ***/
/* Ago and from now */
#define L_AGO "acum"
#define L_FROMNOW "peste"
/* "in %d days' time" */
#define L_INXDAYS "peste %d zile"
/* "on" as in "on date..." */
#define L_ON "pe"
/* Pluralizing - this is a problem for many languages and may require
a more drastic fix */
#define L_PLURAL "le"
/* Minutes, hours, at, etc */
#define L_NOW "acum"
#define L_AT "la ora"
#define L_MINUTE "minut"
#define L_HOUR "or"
#define L_IS "este"
#define L_WAS "a fost"
#define L_AND "si"
/* What to add to make "hour" plural */
#define L_HPLU_OVER hplu = (hdiff == 1 ? "a" : "e");
/* What to add to make "minute" plural */
#define L_MPLU "e"
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
See the file dosubst.c for more info. */
#define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " dimineata" : (hour > 17) ? " seara" : " dupa-amiaza";
#define L_ORDINAL_OVERRIDE plu = "";
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, MonthName[m], y);
#define L_C_OVER sprintf(s, "%s", DayName[jul%7]);
#define L_G_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
#define L_J_OVER sprintf(s, "%s, %s %d, %d", DayName[jul%7], MonthName[m], d, y);
#define L_K_OVER sprintf(s, "%s, %s %d", DayName[jul%7], MonthName[m], d);
#define L_S_OVER
#define L_U_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, MonthName[m], y);
#define L_V_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
#define L_1_OVER \
if (tdiff == 0) \
sprintf(s, L_NOW); \
else if (hdiff == 0) \
sprintf(s, "%s %d %s%s", when, mdiff, L_MINUTE, mplu); \
else if (mdiff == 0) \
sprintf(s, "%s %d %s%s", when, hdiff, L_HOUR, hplu); \
else \
sprintf(s, "%s %d %s%s %s %d %s%s", when, hdiff, \
L_HOUR, hplu, L_AND, mdiff, L_MINUTE, mplu);
#endif /* L_IN_DOSUBST */

5
sort.c
View File

@@ -5,13 +5,12 @@
/* Routines for sorting reminders by trigger date */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: sort.c,v 1.1 1996-03-27 03:26:10 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: sort.c,v 1.3 1997-03-30 19:07:47 dfs Exp $";
#ifdef HAVE_STDLIB_H
#include <stdlib.h>

View File

@@ -2,14 +2,14 @@
# ---------------------------------------------------------------------------
# TEST-REM
#
# $Id: test-rem,v 1.1 1996-03-27 03:26:10 dfs Exp $
# $Id: test-rem,v 1.2 1997-01-16 04:14:31 dfs Exp $
#
# This file runs an acceptance test for Remind. To use it, type:
# sh test-rem OR make test
# in the build directory.
#
# This file is part of REMIND.
# Copyright (C) 1992-1996 by David F. Skoll
# Copyright (C) 1992-1997 by David F. Skoll
# ---------------------------------------------------------------------------
TEST_GETENV="foo bar baz" ; export TEST_GETENV

View File

@@ -631,7 +631,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
version() => "03.00.15"
version() => "03.00.17"
set a059 wkday(today())
today() => 1991/02/16
wkday(1991/02/16) => "Saturday"
@@ -772,7 +772,7 @@ dump
a048 "foo"
a067 "INT"
a039 "February"
a058 "03.00.15"
a058 "03.00.17"
a077 "1992 92
"
a049 21

View File

@@ -2,14 +2,14 @@
rem ---------------------------------------------------------------------------
rem TEST-REM
rem
rem $Id: test-rem.bat,v 1.1 1996-03-27 03:26:10 dfs Exp $
rem $Id: test-rem.bat,v 1.2 1997-01-16 04:14:31 dfs Exp $
rem
rem This file runs an MSDOS acceptance test for Remind. To use it, type:
rem test-rem
rem in the build directory.
rem
rem This file is part of REMIND.
rem Copyright (C) 1992-1996 by David F. Skoll
rem Copyright (C) 1992-1997 by David F. Skoll
rem ---------------------------------------------------------------------------
del test.out > nul

View File

@@ -2,14 +2,14 @@
rem ---------------------------------------------------------------------------
rem TEST-REM
rem
rem $Id: test-rem.cmd,v 1.1 1996-03-27 03:26:11 dfs Exp $
rem $Id: test-rem.cmd,v 1.2 1997-01-16 04:14:32 dfs Exp $
rem
rem This file runs an OS/2 acceptance test for Remind. To use it, type:
rem test-rem
rem in the build directory.
rem
rem This file is part of REMIND.
rem Copyright (C) 1992-1996 by David F. Skoll
rem Copyright (C) 1992-1997 by David F. Skoll
rem ---------------------------------------------------------------------------
del /f test.out > nul

View File

@@ -631,7 +631,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
version() => "03.00.15"
version() => "03.00.17"
set a059 wkday(today())
today() => 1991/02/16
wkday(1991/02/16) => "Saturday"
@@ -772,7 +772,7 @@ dump
a048 "foo"
a067 "INT"
a039 "February"
a058 "03.00.15"
a058 "03.00.17"
a077 "1992 92
"
a049 21

View File

@@ -1,6 +1,6 @@
# Test file for REMIND
#
# $Id: test1.cmp,v 1.4 1996-09-28 18:17:09 dfs Exp $
# $Id: test1.cmp,v 1.6 1997-03-30 19:07:49 dfs Exp $
#
# Use this file to test the date calculation routines
# of the REMIND program by typing:
@@ -633,7 +633,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
version() => "03.00.15"
version() => "03.00.17"
set a059 wkday(today())
today() => 1991/02/16
wkday(1991/02/16) => "Saturday"
@@ -774,7 +774,7 @@ dump
a048 "foo"
a067 "INT"
a039 "February"
a058 "03.00.15"
a058 "03.00.17"
a077 "1992 92
"
a049 21

View File

@@ -1,6 +1,6 @@
# Test file for REMIND
#
# $Id: test2.cmp,v 1.4 1996-09-28 18:17:10 dfs Exp $
# $Id: test2.cmp,v 1.6 1997-03-30 19:07:49 dfs Exp $
#
# Use this file to test the date calculation routines
# of the REMIND program by typing:
@@ -633,7 +633,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
version() => "03.00.15"
version() => "03.00.17"
set a059 wkday(today())
today() => 1991/02/16
wkday(1991/02/16) => "Saturday"
@@ -774,7 +774,7 @@ dump
a048 "foo"
a067 "INT"
a039 "February"
a058 "03.00.15"
a058 "03.00.17"
a077 "1992 92
"
a049 21

View File

@@ -7,11 +7,11 @@
# A cheesy graphical front/back end for Remind using Tcl/Tk
#
# This file is part of REMIND.
# Copyright (C) 1992-1996 by David F. Skoll
# Copyright (C) 1992-1997 by David F. Skoll
#
#--------------------------------------------------------------
# $Id: tkremind,v 1.11 1996-10-12 02:49:36 dfs Exp $
# $Id: tkremind,v 1.12 1997-01-16 04:14:32 dfs Exp $
# the next line restarts using wish \
exec wish "$0" "$@"

29
token.c
View File

@@ -6,13 +6,13 @@
/* classifying the tokens parsed. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: token.c,v 1.2 1996-04-28 02:02:10 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: token.c,v 1.5 1997-07-13 16:18:49 dfs Exp $";
#include <stdio.h>
#include <string.h>
#include <ctype.h>
@@ -159,10 +159,15 @@ char *s;
if (len < TOKSIZE) {
*t++ = *s++;
len++;
}else s++;
} else s++;
}
*t = 0;
/* Ignore trailing commas */
if (t > TokBuffer && *(t-1) == ',') {
*(t-1) = 0;
} else {
*t = 0;
}
FindToken(TokBuffer, tok);
return s;
@@ -274,6 +279,20 @@ Token *t;
if (isdigit(*s)) {
PARSENUM(t->val, s);
/* If we hit a comma, swallow it. This allows stuff
like Jan 6, 1998 */
if (*s == ',') {
s++;
/* Special hack - convert years between 90 and
99 to 1990 and 1999 */
if (t->val >= 90 && t->val <= 99) t->val += 1900;
/* Classify the number we've got */
if (t->val >= BASE && t->val <= BASE+YR_RANGE) t->type = T_Year;
else if (t->val >= 1 && t->val <= 31) t->type = T_Day;
else t->type = T_Number;
return;
}
/* If we hit a colon or a period, we've probably got a time hr:min */
if (*s == ':' || *s == '.' || *s == TIMESEP) {
s++;

View File

@@ -5,13 +5,13 @@
/* Routines for figuring out the trigger date of a reminder */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: trigger.c,v 1.2 1996-05-25 19:10:13 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: trigger.c,v 1.4 1997-03-30 19:07:50 dfs Exp $";
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>

View File

@@ -3,7 +3,7 @@
#
# TSTLANG.REM
#
# $Id: tstlang.rem,v 1.1 1996-03-27 03:26:14 dfs Exp $
# $Id: tstlang.rem,v 1.2 1997-01-16 04:14:33 dfs Exp $
#
# Use this file to test new language headers you may want to create.
# Usage: remind -rq tstlang.rem
@@ -13,7 +13,7 @@
# Use the output to verify your translations.
#
# This file is part of REMIND.
# Copyright (C) 1992-1996 by David F. Skoll
# Copyright (C) 1992-1997 by David F. Skoll
#
# ---------------------------------------------------------------------------

View File

@@ -5,11 +5,11 @@
/* Type definitions all dumped here. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: types.h,v 1.2 1996-04-28 02:02:11 dfs Exp $ */
/* $Id: types.h,v 1.4 1997-08-31 17:03:27 dfs Exp $ */
/* Values */
typedef struct {
@@ -164,8 +164,9 @@ typedef struct {
#define QUOTE_MARKER 1 /* Unlikely character to appear in reminder */
/* Flags for disabling run */
#define RUN_CMDLINE 1
#define RUN_SCRIPT 2
#define RUN_CMDLINE 1
#define RUN_SCRIPT 2
#define RUN_NOTOWNER 4
/* Flags for the SimpleCalendar format */
#define SC_AMPM 0 /* Time shown as 3:00am, etc. */

View File

@@ -6,13 +6,13 @@
/* functions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: userfns.c,v 1.2 1996-04-28 02:02:11 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: userfns.c,v 1.4 1997-03-30 19:07:51 dfs Exp $";
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>

View File

@@ -5,13 +5,13 @@
/* Useful utility functions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: utils.c,v 1.2 1996-03-31 04:02:00 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: utils.c,v 1.4 1997-03-30 19:07:51 dfs Exp $";
#include <string.h>
#include <stdio.h>
#ifdef HAVE_STDLIB_H

6
var.c
View File

@@ -6,13 +6,13 @@
/* user- and system-defined variables. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
static char const RCSID[] = "$Id: var.c,v 1.3 1996-04-28 02:02:12 dfs Exp $";
#include "config.h"
static char const RCSID[] = "$Id: var.c,v 1.5 1997-03-30 19:07:51 dfs Exp $";
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STDLIB_H

View File

@@ -5,9 +5,9 @@
/* What version of remind do we have? */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1996 by David F. Skoll */
/* Copyright (C) 1992-1997 by David F. Skoll */
/* */
/***************************************************************/
/* $Id: version.h,v 1.3 1996-09-28 18:17:10 dfs Exp $ */
#define VERSION "03.00.15"
/* $Id: version.h,v 1.6 1997-03-30 19:07:52 dfs Exp $ */
#define VERSION "03.00.17"

64
www/Makefile Normal file
View File

@@ -0,0 +1,64 @@
# Makefile for installing WWW server calendar scripts
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: Makefile,v 1.7 1997-08-31 17:17:51 dfs Exp $
# The complete name of your www host. Example: www.mycompany.com
WWWHOST = shevy.skoll.ca
# WWWHOST = www.mycompany.com
# The complete path to where the scripts actually live, as seen by
# the UNIX operating system.
SCRIPTDIR = /var/web/cgi-bin
# SCRIPTDIR = /home/dfs/Remind/www/TEST
# Where the scripts live as seen from the outside world. If
# they live in WWWHOST/cgi-bin, supply /cgi-bin
CGIDIR = /cgi-bin
# The complete path to the HTML file "calendar.html". This is a sample
# file containing links to all the scripts. This path should be the
# path as seen by the UNIX operating system
HTMLDIR = /home/dfs/public_html
# Location. Typically, the name of your city or town. Example: Ottawa
LOCATION = Ottawa
# LOCATION = New York
# Where do Remind and Rem2PS executables live?
REMIND = /usr/local/bin/remind
REM2PS = /usr/local/bin/rem2ps
# Don't change stuff below here.
# --------------------------------------------------------------------
# Construct a rotten mean nasty sed script to do the dirty work
SEDSCRIPT = -e 's/Ottawa/$(LOCATION)/g' \
-e 's@http://your.machine/your.dir@http://$(WWWHOST)$(CGIDIR)@g' \
-e 's@%SCRIPTDIR%@$(SCRIPTDIR)@g' \
-e 's@%REMIND%@$(REMIND)@g' \
-e 's@%REM2PS%@$(REM2PS)@g'
all:
@echo "Edit the Makefile; then type 'make install' to install"
@echo "the www server scripts."
# OK, it's abominable. But it works...
install:
cp rem2html calps hebdate hebps hebhtml moon sunrise sunset $(SCRIPTDIR)
sed $(SEDSCRIPT) < cal_dispatch-DIST > $(SCRIPTDIR)/cal_dispatch
sed $(SEDSCRIPT) < hebdate.rem-DIST > $(SCRIPTDIR)/hebdate.rem
sed $(SEDSCRIPT) < moon.rem-DIST > $(SCRIPTDIR)/moon.rem
sed $(SEDSCRIPT) < sunrise.rem-DIST > $(SCRIPTDIR)/sunrise.rem
sed $(SEDSCRIPT) < sunset.rem-DIST > $(SCRIPTDIR)/sunset.rem
sed $(SEDSCRIPT) < calendar.html-DIST > $(HTMLDIR)/calendar.html
chmod 644 $(SCRIPTDIR)/sunrise.rem
chmod 644 $(SCRIPTDIR)/moon.rem
chmod 644 $(SCRIPTDIR)/hebdate.rem
chmod 644 $(SCRIPTDIR)/sunset.rem
chmod 644 $(HTMLDIR)/calendar.html
chmod 755 $(SCRIPTDIR)/cal_dispatch
chmod 755 $(SCRIPTDIR)/calps $(SCRIPTDIR)/hebdate \
$(SCRIPTDIR)/hebps $(SCRIPTDIR)/moon $(SCRIPTDIR)/sunrise \
$(SCRIPTDIR)/sunset $(SCRIPTDIR)/hebhtml $(SCRIPTDIR)/rem2html

50
www/README Normal file
View File

@@ -0,0 +1,50 @@
README
$Id: README,v 1.7 1997-08-31 17:17:51 dfs Exp $
HTML Hebrew Calendar Server
This is a rudimentary Hebrew calendar server for the WWW. It
supplies local sunrise and sunset times, moon phases, upcoming Jewish
holidays, and PostScript calendars. It only works under UNIX. I've
only tested it with Linux running NCSA's httpd and Apache's httpd, but
it should work on any UNIX web server.
To install it, you need the Remind package, available via ftp from
ftp://ftp.doe.carleton.ca/pub/remind-3.0. You should install Remind,
setting the lattitude, longitude, location and time zone as appropriate
for your machine.
Once you have Remind installed, follow these steps to set up your WWW
server:
1) Edit the Makefile in this directory. See the comments in the Makefile
for details.
2) Edit the first line of "rem2html" to reflect the location of
Perl on your system. (Oh yeah, you need Perl for the
HTML Hebrew calendar...)
3) Type "make install"
4) Test it out. It will generate links of the form:
http://www.your_server.com/your_cgi-bin/cal_dispatch?what
where "what" is one of:
sunrise -- show info about sunrise times.
sunset -- show info about sunset times.
hebdate -- show today's Hebrew date.
calps -- get a blank PostScript calendar.
moon -- show info about moon phases.
hebps -- get a PostScript calendar with Jewish holidays.
hebhtml -- get an HTML version of the above (requires Perl.)
(Visit http://www.doe.carleton.ca/~dfs/ for previews.)
All of these links will be set up in a sample HTML document
called "calendar.html" and installed in the HTMLDIR you specified
in the Makefile.
4) Enjoy!

18
www/README.rem2html Normal file
View File

@@ -0,0 +1,18 @@
REM2HTML
$Id: README.rem2html,v 1.2 1997-08-31 17:03:45 dfs Exp $
Rem2HTML is a Perl script which transforms the output of
`remind -p ...' to an HTML table. Type `perl rem2html --help' for
usage information.
Typical usage: remind -p ~/.reminders | rem2html > file.html
You may have to edit the "#!/bin/perl" line to reflect the location
of your Perl interpreter.
Rem2HTML was contributed by Don Schwarz <darkowl@mcs.net>. It
produces HTML compatible with most modern browsers, but *not* with
browsers which don't support tables (like Lynx, as of this writing.)
--
David F. Skoll

83
www/cal_dispatch-DIST Executable file
View File

@@ -0,0 +1,83 @@
#!/bin/sh
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# CAL_DISPATCH -- Shell script for CGI directory to dispatch calendar
# commands.
#
# $Id: cal_dispatch-DIST,v 1.3 1997-07-31 03:10:17 dfs Exp $
#
# WARNING WARNING WARNING -- If your /bin/sh is really GNU's "bash",
# make sure you don't have a buggy version which treats char 0xFF as
# a command separator -- it is a security risk!
#########################
#
# Parameters for you to change
#
#########################
# Set DIR to the directory in which all the scripts live. They must all
# be in the same directory. The scripts are:
# cal_dispatch, cal_ps, hebdate, hebps, moon, sunrise and sunset.
# In addition, the reminder files hebbg.ps, hebdate.rem, moon.rem,
# sunrise.rem and sunset.rem must live in $DIR.
DIR=%SCRIPTDIR%
export DIR
# Set REMIND to the full pathname of the Remind executable.
REMIND=%REMIND%
export REMIND
# Set REM2PS to the full pathname of the rem2ps executable
REM2PS=%REM2PS%
export REM2PS
#########################
#
# Don't change anything after this.
#
#########################
if [ "$1" = "" ] ; then
exit 0
fi
case "$1" in
sunrise)
exec $DIR/sunrise
;;
sunset)
exec $DIR/sunset
;;
hebdate)
exec $DIR/hebdate
;;
calps)
exec $DIR/calps
;;
moon)
exec $DIR/moon
;;
hebps)
exec $DIR/hebps
;;
hebhtml)
if [ "$2" = "" -o "$3" = "" ] ; then
exec $DIR/hebhtml
else
exec $DIR/hebhtml "$2" "$3"
fi
;;
esac
exit 0

30
www/calendar.html-DIST Normal file
View File

@@ -0,0 +1,30 @@
<HTML>
<!-- Sample HTML file with links to the calendar stuff -->
<!-- $Id: calendar.html-DIST,v 1.4 1997-07-31 02:19:05 dfs Exp $ -->
<HEAD>
<TITLE>David Skoll's Calendar Server</TITLE>
</HEAD>
<BODY>
<H1>David Skoll's Calendar Server</H1>
<a HREF="http://your.machine/your.dir/cal_dispatch?sunrise">
Sunrise Information</a><P>
<a HREF="http://your.machine/your.dir/cal_dispatch?sunset">
Sunset Information</a><P>
<a HREF="http://your.machine/your.dir/cal_dispatch?moon">
Moon Phase Information</a><P>
<a HREF="http://your.machine/your.dir/cal_dispatch?calps">
Blank PostScript Calendar</a> (Approximately 20kB)<P>
<a HREF="http://your.machine/your.dir/cal_dispatch?hebdate">
Today's Hebrew Date</a><P>
<a HREF="http://your.machine/your.dir/cal_dispatch?hebps">
PostScript Calendar with Jewish Holidays</a> (Approximately 35 kB)<P>
<a HREF="http://your.machine/your.dir/cal_dispatch?hebhtml">
HTML Calendar with Jewish Holidays</a> (Your browser must support tables.)<P>
<HR>
<a HREF="ftp://ftp.doe.carleton.ca/pub/remind-3.0">
Get the Remind software</a> that provides this service.<P>
</BODY>
</HTML>

13
www/calps Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
# PostScript calendar shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: calps,v 1.1 1997-01-16 04:00:27 dfs Exp $
echo "Content-type: application/postscript"
echo
$REMIND -p /dev/null | $REM2PS -e -c3
exit 0

27
www/hebdate Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/sh
# Hebrew date shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: hebdate,v 1.2 1997-01-19 03:59:56 dfs Exp $
echo Content-type: text/html
echo ""
cat <<EOM
<HTML>
<HEAD>
<TITLE>Hebrew date</TITLE>
</HEAD>
<BODY>
<H1>Hebrew date</H1>
EOM
$REMIND -arqh $DIR/hebdate.rem
echo "</BODY>"
echo "</HTML>"
exit 0

179
www/hebdate.rem-DIST Normal file
View File

@@ -0,0 +1,179 @@
# Hebrew date reminder file
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: hebdate.rem-DIST,v 1.3 1997-07-31 03:10:18 dfs Exp $
BANNER %
IF !$PSCAL
FSET _hstr(x) HEBDAY(x) + " " + HEBMON(x) + ", " + HEBYEAR(x)
FSET msgsuffix(x) "<P>"
MSG The Hebrew date for today, %d %m, %y, is [_hstr(today())]. %
MSG And the Hebrew date for tomorrow is [_hstr(today()+1)]. %
fset msgprefix(x) iif($NumTrig==OldTrig, "<H2>Upcoming Holidays</H2>"+char(13,10),"")
set oldtrig $numtrig
ENDIF
#JHOLS
##########################################################################
# #
# This portion of the file contains reminders for Jewish holidays. The #
# dates were obtained from "The First Jewish Catalog" by Richard Siegel #
# and Michael and Sharon Strassfeld, published by the Jewish Publication #
# Society of America. The Reform version of the calendar was guessed #
# at by David Skoll based on experience. Additional corrections were #
# made from the paper "Calendrical Calculations" by Nachum Dershowitz #
# and Edward M. Reingold. Any further corrections are welcome. #
# #
##########################################################################
# --- HERE ARE THE JEWISH HOLIDAYS ---
# Set the variable InIsrael to 1 if you live in Israel. Otherwise,
# you get the Diaspora versions of Jewish holidays
SET InIsrael 0
# Set the variable Reform to 1 if you want the Reform version of the
# Jewish calendar. Otherwise, you get the traditional version
SET Reform 0
# Convenient function definition to save typing
FSET _h(x, y) TRIGGER(HEBDATE(x,y))
FSET _h2(x, y) HEBDATE(x, y, TODAY()-7)
FSET _PastSat(x, y) IIF(WKDAYNUM(_h2(x,y))!=6, \
TRIGGER(_h2(x,y)), \
TRIGGER(_h2(x,y)+1))
# Default values in case InIsrael and Reform are not set
SET InIsrael VALUE("InIsrael", 0)
SET Reform VALUE("Reform", 0)
[_h(1, "Tishrey")] ++12 MSG %"Rosh Hashana 1%" is %b.
# No RH-2 or Tzom Gedalia in Reform
IF !Reform
[_h(2, "Tishrey")] ++12 MSG %"Rosh Hashana 2%" is %b.
[_PastSat(3, "Tishrey")] ++12 MSG %"Tzom Gedalia%" is %b.
ENDIF
[_h(10, "Tishrey")] ++12 MSG %"Yom Kippur%" is %b.
[_h(15, "Tishrey")] ++12 MSG %"Sukkot 1%" is %b.
IF !InIsrael
[_h(16, "Tishrey")] MSG %"Sukkot 2%"
ENDIF
[_h(21, "Tishrey")] ++12 MSG %"Hashana Rabba%" is %b.
[_h(22, "Tishrey")] ++12 MSG %"Shemini Atzeret%" is %b.
IF InIsrael
[_h(22, "Tishrey")] ++12 MSG %"Simchat Torah%" is %b.
ELSE
[_h(23, "Tishrey")] ++12 MSG %"Simchat Torah%" is %b.
ENDIF
# Because Kislev can change length, we must be more careful about Chanukah
FSET _chan(x) TRIGGER(HEBDATE(24, "Kislev", today()-9)+x)
[_chan(1)] ++12 MSG %"Chanukah 1%" is %b.
[_chan(2)] MSG %"Chanukah 2%"
[_chan(3)] MSG %"Chanukah 3%"
[_chan(4)] MSG %"Chanukah 4%"
[_chan(5)] MSG %"Chanukah 5%"
[_chan(6)] MSG %"Chanukah 6%"
[_chan(7)] MSG %"Chanukah 7%"
[_chan(8)] MSG %"Chanukah 8%"
# Not sure about Reform's position on the next one.
IF !Reform
# The fast is moved to the 11th if the 10th is a Saturday
REM [_PastSat(10, "Tevet")] MSG %"Tzom Tevet%" is %b.
ENDIF
[_h(15, "Shvat")] ++12 MSG %"Tu B'Shvat%" is %b.
[_h(15, "Adar A")] ++12 MSG %"Purim Katan%" is %b.
# If Purim is on Sunday, then Fast of Esther is 11 Adar.
IF WKDAYNUM(_h2(13, "Adar")) != 6
REM [TRIGGER(_h2(13, "Adar"))] ++12 MSG %"Fast of Esther%" is %b.
ELSE
REM [TRIGGER(_h2(11, "Adar"))] ++12 MSG %"Fast of Esther%" is %b.
ENDIF
[_h(14, "Adar")] ++12 MSG %"Purim%" is %b.
[_h(15, "Nisan")] ++12 MSG %"Pesach%" is %b.
IF !InIsrael
[_h(16, "Nisan")] MSG %"Pesach 2%" is %b.
ENDIF
[_h(21, "Nisan")] MSG %"Pesach 7%" is %b.
IF !InIsrael && !Reform
[_h(22, "Nisan")] MSG %"Pesach 8%" is %b.
ENDIF
[_h(27, "Nisan")] ++12 MSG %"Yom HaShoah%" is %b.
[_h(4, "Iyar")] ++12 MSG %"Yom HaZikaron%" is %b.
[_h(5, "Iyar")] ++12 MSG %"Yom Ha'atzmaut%" is %b.
# Not sure about Reform's position on Lag B'Omer
IF !Reform
[_h(18, "Iyar")] ++12 MSG %"Lag B'Omer%" is %b.
ENDIF
[_h(28, "Iyar")] ++12 MSG %"Yom Yerushalayim%" is %b.
[_h(6, "Sivan")] ++12 MSG %"Shavuot%" is %b.
IF !InIsrael && !Reform
[_h(7, "Sivan")] MSG %"Shavuot 2%" is %b.
ENDIF
# Fairly sure Reform Jews don't observe the next two
IF !Reform
# Tzom Tamuz and Tish'a B'Av are moved to Sunday if they normally
# fall on a Saturday
[_PastSat(17, "Tamuz")] ++12 MSG %"Tzom Tammuz%" is %b.
[_PastSat(9, "Av")] ++12 MSG %"Tish'a B'Av%" is %b.
ENDIF
fset msgprefix(x) ""
# Counting the omer - do the whole spiel, i.e:
# "This is the xth day of the omer, being y weeks and z days of the omer."
# Nice Remind programming example here!
SET ostart HEBDATE(16, "Nisan", TODAY()-50)
IF ostart <= TODAY() && (TODAY() - ostart < 49)
SET odays TODAY()-ostart+1
IF odays < 7
MSG %"%"Today is the [ORD(odays)] day of the Omer.
ELSE
IF !(odays % 7)
MSG %"%"Today is the [ORD(odays)] day of the Omer, being [odays / 7] [PLURAL(odays/7, "week")] of the Omer.
ELSE
MSG %"%"Today is the [ORD(odays)] day of the Omer, being [odays/7] [PLURAL(odays/7, "week")] and [odays%7] [PLURAL(odays%7, "day")] of the Omer.
ENDIF
ENDIF
CAL [ORD(odays)] of Omer
ENDIF
IF !$PSCAL
REM 20 ++40 msg Also available: <a HREF="http://your.machine/your.dir/cal_dispatch?hebps">a PostScript calendar</a> (about 35KB) for %m %y, complete with Hebrew dates, Jewish holidays, and moon phases for Ottawa. (This takes a few seconds to generate.)
REM 20 ++40 msg And: <a HREF="http://your.machine/your.dir/cal_dispatch?hebhtml">an HTML version</a> of the above. (No moons, and your browser must handle tables.)
ELSE
IF !HTML
REM Sat PS [psshade(95)]
[trigger(moondate(0))] PS [psmoon(0)]
[trigger(moondate(1))] PS [psmoon(1)]
[trigger(moondate(2))] PS [psmoon(2)]
[trigger(moondate(3))] PS [psmoon(3)]
REM PS Border Border moveto /DayFont findfont 10 scalefont setfont ([hebday(today())] [hebmon(today())]) show
ELSE
[trigger(moondate(0))] MSG <FONT SIZE=-2>New Moon</FONT>
[trigger(moondate(2))] MSG <FONT SIZE=-2>Full Moon</FONT>
REM MSG <FONT SIZE=-1>[hebday(today())] [hebmon(today())]</FONT>
ENDIF
ENDIF

43
www/hebhtml Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/sh
# HTML calendar shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: hebhtml,v 1.2 1997-07-31 03:10:18 dfs Exp $
echo "Content-Type: text/html"
echo ""
if [ "$1 $2" = " " ] ; then
$REMIND - <<'EOR'
set thismon monnum(today())
set thisyear year(today())
set nextmon iif(thismon+1 > 12, 1, thismon+1)
set nextyear iif(nextmon==1, thisyear+1, thisyear)
set lastmon iif(thismon-1 < 1, 12, thismon-1)
set lastyear iif(lastmon==12, thisyear-1, thisyear)
set nextmon mon(nextmon)
set lastmon mon(lastmon)
BANNER %
REM RUN $REMIND -iHTML=1 -p $DIR/hebdate.rem %m %y | $DIR/rem2html --forwurl "cal_dispatch?hebhtml+[nextmon]+[nextyear]" --backurl "cal_dispatch?hebhtml+[lastmon]+[lastyear]"
EOR
else
$REMIND - "$1" "$2" <<'EOR'
set thismon monnum(today())
set thisyear year(today())
set nextmon iif(thismon+1 > 12, 1, thismon+1)
set nextyear iif(nextmon==1, thisyear+1, thisyear)
set lastmon iif(thismon-1 < 1, 12, thismon-1)
set lastyear iif(lastmon==12, thisyear-1, thisyear)
set nextmon mon(nextmon)
set lastmon mon(lastmon)
BANNER %
REM RUN $REMIND -iHTML=1 -p $DIR/hebdate.rem %m %y | $DIR/rem2html --forwurl "cal_dispatch?hebhtml+[nextmon]+[nextyear]" --backurl "cal_dispatch?hebhtml+[lastmon]+[lastyear]"
EOR
fi
exit 0

19
www/hebps Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
# Hebrew PostScript calendar shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: hebps,v 1.3 1997-07-31 02:19:06 dfs Exp $
# Figure out the month: If day <= 20, use this month; otherwise, use
# next month.
echo "Content-type: application/postscript"
echo ""
$REMIND - <<EOR
BANNER %
REM 20 ++40 RUN $REMIND -iHTML=0 -p $DIR/hebdate.rem %m %y | $REM2PS -e -c3
EOR
exit 0

15
www/moon Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
# Moon shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: moon,v 1.1 1997-01-16 04:00:27 dfs Exp $
echo Content-type: text/html
echo
echo "<HTML>"
$REMIND $DIR/moon.rem
echo "</HTML>"
exit 0

34
www/moon.rem-DIST Normal file
View File

@@ -0,0 +1,34 @@
# File for giving moon phase info.
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: moon.rem-DIST,v 1.1 1997-01-16 04:00:28 dfs Exp $
set now now()
banner %
MSG <HEAD>%
MSG <TITLE>Moon over Ottawa</TITLE>%
MSG </HEAD>%
MSG <BODY>
MSG <H1>Moon over Ottawa</H1>
set ndate moondate(0)
set ntime moontime(0)
set fdate moondate(2)
set ftime moontime(2)
fset t(x) wkday(x)+", "+day(x)+" "+mon(x)+", "+year(x)
msg Today is %w, %d %m, %y.<P>
msg The local time in Ottawa is [now].<P>
if ndate < fdate
msg The next new moon is on [t(ndate)] at [ntime], Ottawa time.<P>
msg The next full moon is on [t(fdate)] at [ftime], Ottawa time.<P>
else
msg The next full moon is on [t(fdate)] at [ftime], Ottawa time.<P>
msg The next new moon is on [t(ndate)] at [ntime], Ottawa time.<P>
endif

301
www/rem2html Executable file
View File

@@ -0,0 +1,301 @@
#!/bin/perl
# rem2html
#
# $Id: rem2html,v 1.2 1997-07-06 14:36:01 dfs Exp $
#
# A script to convert from the output of "remind -p" to Hyper-Text Markup
# Language (HTML), the text format used in WWW documents. By default, it
# outputs a stand-alone file which can be fed directly into a web browser.
# The output uses nested <TABLE> blocks, so it will only work in a browser
# which supports tables (Netscape, MSIE, etc, NOT Lynx).
#
# This script works well on my computer (Linux 2.0.27) under Perl 5.003 and
# 5.004. It should work fine on other unices but I have no idea whether
# it will run under VMS, OS/2, Windows, etc.
#
# [Note from David: The REMIND license prohibits you from using REMIND
# under Windows.]
#
# This file is Copyright (C) 1997 by Don Schwarz <darkowl@mcs.net>.
use Getopt::Long;
@months = (January,February,March,April,May,June,July,August,September,October,November,December);
$rem2html_version = "1.0";
&parse_options();
if ($Options{'help'}) {
&show_usage();
} elsif ($Options{'version'}) {
print "Rem2HTML Version $rem2html_version.\n";
} else {
&parse_input();
&output_header();
&output_data();
&output_footer();
}
exit(0);
sub show_usage {
print STDERR <<EndOfUsage;
Rem2HTML: Produce a HTML calendar from the output of Remind.
Usage: rem2html [options]
Options:
--help, -h Print this information
--version Version information
-p file Prepend the specified HTML file to the beginning of the
output
-f[shted] font Set font for small cal, hdr, title, cal entries,day numbers
-s[hted] size Set size for header, title, calendar entries and/or day
numbers
--backurl url Make the title on the previous month's small calendar entry
a hyperlink to <url>
--forwurl url Same as --backurl, but with the next month's small calendar
--tableonly Output the results as a <TABLE> block only, no <HTML>, etc.
--border,-b size Set the border thickness of the table
--cellspace,-t size Set the line thickness of the table
--bgcolor,-g color Set the background color for the day entries
EndOfUsage
}
sub parse_options {
%Options = ();
GetOptions (\%Options, "help|h",
"version",
"border|b=i",
"cellspace|t=i",
"backurl|bu:s", "forwurl|fu:s",
"tableonly|to",
"prologue|p=s",
"bgcolor|g=s",
"fs=s", "fh=s", "ft=s", "fe=s", "fd=s",
"sh=i", "st=i", "se=i", "sd=i",
);
$Options{'border'} = "BORDER=" . ($Options{'border'} || 1);
$Options{'cellspace'} &&= "CELLSPACING=$Options{'cellspace'}";
$Options{'bgcolor'} &&= "BGCOLOR=$Options{'bgcolor'}";
}
sub parse_input {
local $where = 0;
local $msg;
@days = ();
while (<>) {
chomp($_);
if (/rem2(html|ps) begin/) {
} elsif (!$where) {
next;
} elsif ($where == 1) {
local ($month, $year);
($month, $year, $month_length, $firstday, $mfirst) = split(" ");
$caption = "$month, $year";
for $i ( 1 .. $month_length) { push(@days, ""); }
} elsif ($where == 2) {
@prevsc = split(" ");
} elsif ($where == 3) {
@nextsc = split(" ");
} else {
last if /rem2(html|ps) end/;
next unless m%^(\d*)/*(\d*)/*(\d*) ([^ ]*)?\s*(.*)$%;
$msg = $5;
$msg = "$4 $msg" if $4;
$days[$3] .= "<P>$msg</P>";
}
$where++;
}
die "Rem2HTML: Could not find any calendar data.\n", unless $where;
}
sub output_header {
local ($title, $dayheader);
if (!$Options{'tableonly'}) {
print <<EndOfHTML;
<HTML>
<HEAD><TITLE>Reminders for $caption</TITLE></HEAD>
<BODY>
EndOfHTML
}
print <<EndOfHTML;
<!-- This output was produced by Rem2HTML $rem2html_version (written by
Don Schwarz <darkowl\@mcs.net>) and Remind (written by David F. Skoll). -->
EndOfHTML
if ($Options{'prologue'}) {
open(PROLOGUE, "< $Options{'prologue'}");
print while ( <PROLOGUE> );
close(PROLOGUE);
}
$caption = &format_font($caption, $Options{'ft'}, $Options{'st'} || "+1");
print <<EndOfHTML;
<TABLE $Options{'border'} $Options{'cellspace'} $Options{'bgcolor'} WIDTH=100%>
<CAPTION><STRONG>$caption</STRONG></CAPTION>
<TR>
EndOfHTML
$mfirst || &print_day_header("Sunday");
foreach $dayheader (Monday,Tuesday,Wednesday,Thursday,Friday,Saturday) {
&print_day_header($dayheader);
}
$mfirst && &print_day_header("Sunday");
print " </TR>\n";
}
sub output_footer {
print "</TABLE>\n";
unless ($Options{'tableonly'}) {
print <<EndOfHTML;
</BODY>
</HTML>
EndOfHTML
}
}
sub output_data {
local ($endday, $prevday, $nextday, $week, $weekday);
local ($element, $day, $msg, $fday);
$firstday -= $mfirst;
if ($firstday < 0) { $firstday += 7; }
$endday = $firstday + $month_length;
$endweek = $endday + (6 - ($endday % 7));
$endday %= 7;
if ( $firstday > 1 ) {
$prevday = 0;
$nextday = 1;
} elsif ($endday ? ($endday < 5) : !$firstday) {
$prevday = $endweek - 1;
$nextday = $endweek;
} else {
$prevday = 0;
$nextday = $endweek;
}
for $week ( 0..5 ) {
print " <TR>\n";
for $weekday ( 0..6 ) {
$element = ($week * 7) + ($weekday * 1);
$day = $element - $firstday + 1;
$msg = $days[$day];
$msg = $msg ? &format_font($msg, $Options{'fe'}, $Options{'se'})
: " <BR> <BR> <BR> <BR>";
$fday = &format_font($day, $Options{'fd'}, $Options{'sd'} || -1);
if ($day > 0 && $day <= $month_length) {
print <<EndOfHTML;
<TD VALIGN=TOP WIDTH=14%>
<P ALIGN=RIGHT>$fday</P>
$msg
</TD>
EndOfHTML
} elsif ($element == $prevday) {
&small_calendar(@prevsc, 1, $Options{'backurl'});
} elsif ($element == $nextday) {
&small_calendar(@nextsc, 2, $Options{'forwurl'});
} else {
print " <TD WIDTH=14%><BR></TD>";
}
}
print " </TR>\n";
last if $day >= $month_length && $element >= $nextday;
}
}
sub small_calendar {
local ($scname, $scn, $which, $url) = @_;
local ($scstart, $l, $week, $weekday, $tday);
$scname = "<A HREF=\"$url\">$scname</A>", if $url;
$scname = &format_font($scname, $Options{'fs'}, -2);
if ($which == 1) {
$scstart = $firstday - ($scn % 7);
if ($scstart < 0) { $scstart += 7; }
} else {
$scstart = $firstday + ($month_length % 7);
if ($scstart > 6) { $scstart -= 7; }
}
print <<EndOfHTML;
<TD WIDTH=14% VALIGN=TOP>
<TABLE WIDTH=100%>
<CAPTION><STRONG>$scname</STRONG></CAPTION>
<TR>
EndOfHTML
$mfirst || &print_day_header("S", 1);
foreach $l (M,T,W,T,F,S) {
&print_day_header($l, 1);
}
$mfirst && &print_day_header("S", 1);
print "</TR>\n";
for $week ( 0..5 ) {
print " <TR>\n";
for $weekday ( 0..6 ) {
$tday = ($week * 7) + ($weekday * 1) - $scstart + 1;
$tday = "", if $tday <= 0 || $tday > $scn;
print " <TD WIDTH=14%><FONT SIZE=-2>$tday</FONT></TD>\n";
}
print " </TR>\n";
last if $tday >= $scn;
}
print <<EndOfHTML;
</TABLE>
</TD>
EndOfHTML
}
sub format_font {
local ($text, $font, $size) = @_;
if (!$text) {
return "";
} elsif ($font && $size) {
return "<FONT FACE=$font SIZE=$size>$text</FONT>";
} elsif ($font) {
return "<FONT FACE=$font>$text</FONT>";
} elsif ($size) {
return "<FONT SIZE=$size>$text</FONT>";
} else {
return $text;
}
}
sub print_day_header {
local ($dheader, $small) = @_;
if ($small) {
$dheader = &format_font($dheader, $Options{'fs'}, -2);
} else {
$dheader = &format_font($dheader, $Options{'fh'}, $Options{'sh'});
}
print " <TH WIDTH=14%>$dheader</TH>\n";
}

15
www/sunrise Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
# Sunrise shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: sunrise,v 1.1 1997-01-16 04:00:28 dfs Exp $
echo Content-type: text/html
echo
echo "<HTML>"
$REMIND -arqh $DIR/sunrise.rem
echo "</HTML>"
exit 0

42
www/sunrise.rem-DIST Executable file
View File

@@ -0,0 +1,42 @@
# File for giving sunrise info
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: sunrise.rem-DIST,v 1.1 1997-01-16 04:00:28 dfs Exp $
set now now()
banner %
MSG <HEAD>%
MSG <TITLE>Sunrise in Ottawa</TITLE>%
MSG </HEAD>%
MSG <BODY>
MSG <H1>Sunrise in Ottawa</H1>
set tod sunrise(today())
set tom sunrise(today()+1)
set len1 sunset(today())-sunrise(today())
set len2 sunset(today()+1)-sunrise(today()+1)
set dlen len2-len1
set slen iif(dlen==0, "the same length as", dlen<0, abs(dlen)+plural(abs(dlen)," minute", " minutes")+" shorter than", dlen+plural(dlen, " minute", " minutes")+" longer than")
set diff tod-now
set adiff abs(diff)
set hdiff adiff/60
set mdiff adiff%60
set mstr iif(mdiff==0, "", mdiff == 1, "1 minute", mdiff + " minutes")
set hstr iif(hdiff==0, "", hdiff == 1, "1 hour", hdiff + " hours")
set astr iif(mdiff!=0 && hdiff!=0, " and ", "")
set fn iif(diff==0, "now", diff <0, "ago", "from now")
set iw iif(diff<0, "was", "is")
set aw iif(tod==tom, " as well.", ".")
msg Today is %w, %d %m, %y.<P>
msg The local time in Ottawa is [now].<P>
msg Sunrise today [iw] at [tod]; in other words, [hstr][astr][mstr] [fn].<P>
msg Sunrise tomorrow is at [tom][aw]<P>
msg The daylight portion of tomorrow will be [slen] today.<P>
msg </BODY>

15
www/sunset Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
# Sunset shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: sunset,v 1.1 1997-01-16 04:00:28 dfs Exp $
echo Content-type: text/html
echo
echo "<HTML>"
$REMIND -arqh $DIR/sunset.rem
echo "</HTML>"
exit 0

43
www/sunset.rem-DIST Normal file
View File

@@ -0,0 +1,43 @@
# File for giving sunset info
#
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# $Id: sunset.rem-DIST,v 1.2 1997-01-16 04:31:11 dfs Exp $
set now now()
banner %
MSG <HEAD>%
MSG <TITLE>Sunset in Ottawa</TITLE>%
MSG </HEAD>%
MSG <BODY>
MSG <H1>Sunset in Ottawa</H1>
set tod sunset(today())
set tom sunset(today()+1)
set len1 sunset(today())-sunrise(today())
set len2 sunset(today()+1)-sunrise(today()+1)
set dlen len2-len1
set slen iif(dlen==0, "the same length as", dlen<0, abs(dlen)+plural(abs(dlen)," minute", " minutes")+" shorter than", dlen+plural(dlen, " minute", " minutes")+" longer than")
set diff tod-now
set adiff abs(diff)
set hdiff adiff/60
set mdiff adiff%60
set mstr iif(mdiff==0, "", mdiff == 1, "1 minute", mdiff + " minutes")
set hstr iif(hdiff==0, "", hdiff == 1, "1 hour", hdiff + " hours")
set astr iif(mdiff!=0 && hdiff!=0, " and ", "")
set fn iif(diff==0, "now", diff <0, "ago", "from now")
set iw iif(diff<0, "was", "is")
set aw iif(tod==tom, " as well.", ".")
msg Today is %w, %d %m, %y.<P>
msg The local time in Ottawa is [now].<P>
msg Sunset today [iw] at [tod]; in other words, [hstr][astr][mstr] [fn].<P>
msg Sunset tomorrow is at [tom][aw]<P>
msg The daylight portion of tomorrow will be [slen] today.<P>
msg </BODY>