mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd917df96f | ||
|
|
a15e9bc2b4 | ||
|
|
254f340f4c | ||
|
|
800438a1d1 | ||
|
|
8eb2028cf2 | ||
|
|
ef2aa97967 | ||
|
|
165db3d5b6 | ||
|
|
76e0c78d15 | ||
|
|
2d5d6d1f56 | ||
|
|
6248fd1808 | ||
|
|
2c9465b4bb | ||
|
|
7897067eda | ||
|
|
3c53ab13c9 | ||
|
|
f32e0027ad | ||
|
|
4c46eb5fee | ||
|
|
a1fc29e66d | ||
|
|
8e17c968e2 | ||
|
|
ef9f13e83d | ||
|
|
b5cb430fe4 | ||
|
|
a12cd4234c | ||
|
|
100f038ae1 | ||
|
|
e1730460fe | ||
|
|
00c2383738 | ||
|
|
0f167686d9 | ||
|
|
d0be59edff | ||
|
|
dfbbafe87b | ||
|
|
3183d6340e | ||
|
|
4d37a817cd | ||
|
|
072e5ffe3e | ||
|
|
28dfd69147 | ||
|
|
82f15a7d4a | ||
|
|
b681b72515 | ||
|
|
a255620f76 | ||
|
|
0990ec1967 | ||
|
|
28e147ec87 | ||
|
|
2b609c899c | ||
|
|
e10dd441b0 | ||
|
|
754aefebc2 | ||
|
|
79094a2ca5 | ||
|
|
6f03e960e8 | ||
|
|
2dd2a8ad6d | ||
|
|
0050c317f5 | ||
|
|
ab76407b51 | ||
|
|
d65532d43b | ||
|
|
b1928fe92d |
17
COPYRIGHT
17
COPYRIGHT
@@ -1,22 +1,25 @@
|
||||
$Id: COPYRIGHT,v 1.2 1996-05-25 18:14:49 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. REMIND is distributed under the GNU General Public License,
|
||||
Version 2, WITH THE FOLLOWING IMPORTANT MODIFICATIONS:
|
||||
|
||||
Notwithstanding any statements in the GNU General Public License:
|
||||
3. DISTRIBUTION AND USE
|
||||
|
||||
a) REMIND may not be used under Microsoft Windows (3.0, 3.1, 95
|
||||
or NT) or any future version of Windows. Such use constitutes
|
||||
a violation of copyright.
|
||||
|
||||
b) REMIND may not be used by Cadabra Design Libraries Inc. or its
|
||||
directors. Such use constitutes a violation of copyright.
|
||||
directors, nor by any of Cadabra's subsidiaries or their directors.
|
||||
Such use constitutes a violation of copyright.
|
||||
|
||||
c) Except for situations (a) and (b), REMIND may be used and
|
||||
distributed according to the terms of the GNU General Public
|
||||
License, Version 2, which follows:
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
50
Makefile
50
Makefile
@@ -1,5 +1,5 @@
|
||||
# Makefile for REMIND
|
||||
# $Id: Makefile,v 1.9 1996-05-26 03:17:35 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.14
|
||||
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
|
||||
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 \
|
||||
@@ -74,14 +74,14 @@ MANIFEST=COPYRIGHT Makefile Makefile_QDOS README.AMIGA README.BCC \
|
||||
README.DOS README.OS2 README.UNIX README_QDOS WHATSNEW.30 \
|
||||
amiga-SCOPTIONS amiga.c calendar.c config.h danish.h defs.rem dorem.c \
|
||||
dosubst.c dutch.h english.h err.h expr.c expr.h files.c finnish.h \
|
||||
french.h funcs.c german.h globals.c globals.h hbcal.c init.c kall \
|
||||
french.h funcs.c german.h globals.c globals.h hbcal.c init.c italian.h kall \
|
||||
kall.1 lang.h lnk.bcc lnk.msc lnk.tc main.c makefile.bcc makefile.msc \
|
||||
makefile.os2 makefile.tc moon.c norwgian.h omit.c os2func.c polish.h \
|
||||
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
|
||||
types.h userfns.c utils.c var.c version.h remind.LSM portbr.h romanian.h
|
||||
|
||||
OBJS= $(SRCS:.c=.o)
|
||||
|
||||
@@ -130,26 +130,25 @@ var.o: var.c $(STDHDRS) expr.h
|
||||
# probably won't be too useful to you! -- dfs
|
||||
|
||||
tgz:
|
||||
tar cvf remind-3.0.14.tar $(MANIFEST)
|
||||
gzip -v -9 remind-3.0.14.tar
|
||||
mv remind-3.0.14.tar.gz remind-3.0.14.tgz
|
||||
-rm -rf remind-$(VERSION)
|
||||
-mkdir remind-$(VERSION)
|
||||
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
|
||||
|
||||
@@ -172,6 +171,10 @@ install-scripts:
|
||||
-chmod $(EXEMODE) $(SCRIPTDIR)/rem
|
||||
-chown $(OWNER) $(SCRIPTDIR)/rem
|
||||
-chgrp $(GROUP) $(SCRIPTDIR)/rem
|
||||
cp tkremind $(SCRIPTDIR)/tkremind
|
||||
-chmod $(EXEMODE) $(SCRIPTDIR)/tkremind
|
||||
-chown $(OWNER) $(SCRIPTDIR)/tkremind
|
||||
-chgrp $(GROUP) $(SCRIPTDIR)/tkremind
|
||||
|
||||
install-man:
|
||||
cp remind.1 $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
|
||||
@@ -194,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.14 Shar "Remind-3.0/Patch-14/part"
|
||||
mv Shar* RELEASE
|
||||
rm -f patch.14*
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#$Id: Makefile_QDOS,v 1.2 1996-03-31 04:08:10 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.14
|
||||
VERSION= 03.00.17
|
||||
MATHLIB= -lm
|
||||
|
||||
HDRS= config_h err_h expr_h globals_h protos_h types_h version_h \
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
$Id: README.DOS,v 1.1 1996-03-27 03:25:49 dfs Exp $
|
||||
$Id: README.DOS,v 1.2 1996-10-12 02:59:06 dfs Exp $
|
||||
REMIND version 3.0 for MS-DOS
|
||||
|
||||
IMPORTANT NOTE: I'm no longer officially supporting Remind under
|
||||
DOS. It may very well work, but if it doesn't... you're on your own.
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
|
||||
|
||||
15
README.UNIX
15
README.UNIX
@@ -1,4 +1,4 @@
|
||||
$Id: README.UNIX,v 1.1 1996-03-27 03:25:49 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
|
||||
@@ -14,11 +14,13 @@ in the man page, "remind.1".
|
||||
|
||||
3 - Examine the Makefile and change any parameters which need to be
|
||||
changed for your system. As it stands, the Makefile is set up for a
|
||||
BSD system.
|
||||
Linux system.
|
||||
|
||||
4 - Examine the file config.h and adjust parameters as needed
|
||||
|
||||
5 - Examine lang.h and choose the language you want Remind to use.
|
||||
(You can do this on the "make" command-line -- see "OTHER
|
||||
LANGUAE SUPPORT.)
|
||||
|
||||
6 - Type 'make'
|
||||
|
||||
@@ -28,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
|
||||
@@ -68,6 +73,12 @@ only the substitution filter, or you can translate all of the usage
|
||||
instructions and error messages as well. See "french.h" for an
|
||||
example of the latter.
|
||||
|
||||
To compile Remind for a non-english language, look at the constants
|
||||
defined in "lang.h". Then, to compile Remind for Italian (as an
|
||||
example), type:
|
||||
|
||||
make "CDEFS=-DLANG=ITALIAN"
|
||||
|
||||
If you add support for a non-English language, Remind will accept both the
|
||||
English and non-English names of months and weekdays in an input script.
|
||||
However, you should not rely on this feature if you want to write portable
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
$Id: README_QDOS,v 1.2 1996-03-31 04:08:11 dfs Exp $
|
||||
REMIND version 3.0.14 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).
|
||||
|
||||
99
WHATSNEW.30
99
WHATSNEW.30
@@ -1,5 +1,104 @@
|
||||
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
|
||||
|
||||
- The tar file now unpacks into a Remind subdirectory rather than into
|
||||
the current working directory.
|
||||
|
||||
- I no longer support Remind under DOS. I don't think I've done anything
|
||||
to stop it from working under DOS, but will no longer compile and test
|
||||
it under DOS, and can't help you if you get stuck. Sorry -- I no longer
|
||||
have a DOS machine.
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Changed psshade() to accept 1 or 3 arguments for colored shading in
|
||||
PostScript calendar mode.
|
||||
|
||||
- Added a Print dialog to tkremind.
|
||||
|
||||
- Added support for Brazilian Portuguese courtesy of Marco Paganini
|
||||
|
||||
- Added support for Italian courtesy of Valerio Aimale
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed confusing error in rem2ps help messages.
|
||||
|
||||
- Fixed bug in TkRemind which caused a crash if the "-m" option was used
|
||||
for a month beginning on Sunday. Doh!!!
|
||||
|
||||
* Version 3.0 Patch 14
|
||||
|
||||
+ CHANGE IN COPYING POLICY
|
||||
|
||||
5
amiga.c
5
amiga.c
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
18
config.h
18
config.h
@@ -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.4 1996-05-25 18:14:51 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 */
|
||||
@@ -73,7 +73,7 @@
|
||||
/* ISOLATIN1: uncomment the following line if your system uses the */
|
||||
/* ISO 8859-1 character set instead of ASCII. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* #define ISOLATIN1 1 */
|
||||
#define ISOLATIN1 1
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* IBMEXTENDED: uncomment the following line if you want to use the */
|
||||
@@ -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. */
|
||||
|
||||
4
danish.h
4
danish.h
@@ -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"
|
||||
|
||||
81
defs.rem
81
defs.rem
@@ -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
|
||||
##########################################################################
|
||||
# #
|
||||
|
||||
6
dorem.c
6
dorem.c
@@ -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>
|
||||
|
||||
17
dosubst.c
17
dosubst.c
@@ -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.2 1996-04-29 19:34:36 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>
|
||||
@@ -78,8 +78,19 @@ int jul, mode;
|
||||
adiff = ABS(tdiff);
|
||||
mdiff = adiff % 60;
|
||||
hdiff = adiff / 60;
|
||||
|
||||
#ifdef L_MPLU_OVER
|
||||
L_MPLU_OVER
|
||||
#else /* L_MPLU_OVER */
|
||||
mplu = (mdiff == 1 ? "" : L_MPLU);
|
||||
#endif /* L_MPLU_OVER */
|
||||
|
||||
#ifdef L_HPLU_OVER
|
||||
L_HPLU_OVER
|
||||
#else /* L_HPLU_OVER */
|
||||
hplu = (hdiff == 1 ? "" : L_HPLU);
|
||||
#endif /* L_HPLU_OVER */
|
||||
|
||||
when = (tdiff < 0 ? L_AGO : L_FROMNOW);
|
||||
|
||||
h = tim / 60;
|
||||
|
||||
4
dutch.h
4
dutch.h
@@ -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"
|
||||
|
||||
@@ -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
4
err.h
@@ -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
6
expr.c
@@ -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
4
expr.h
@@ -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
128
files.c
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
6
french.h
6
french.h
@@ -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
|
||||
|
||||
48
funcs.c
48
funcs.c
@@ -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.3 1996-03-31 04:01:56 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>
|
||||
@@ -228,7 +228,7 @@ Operator Func[] = {
|
||||
{ "ostype", 0, 0, FOstype },
|
||||
{ "plural", 1, 3, FPlural },
|
||||
{ "psmoon", 1, 4, FPsmoon},
|
||||
{ "psshade", 1, 1, FPsshade},
|
||||
{ "psshade", 1, 3, FPsshade},
|
||||
{ "realnow", 0, 0, FRealnow},
|
||||
{ "realtoday", 0, 0, FRealtoday },
|
||||
{ "sgn", 1, 1, FSgn },
|
||||
@@ -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;
|
||||
@@ -2155,9 +2174,16 @@ static int FPsshade()
|
||||
{
|
||||
char psbuff[256];
|
||||
char *s = psbuff;
|
||||
if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
|
||||
if (ARG(0).v.val < 0) return E_2LOW;
|
||||
if (ARG(0).v.val > 100) return E_2HIGH;
|
||||
int i;
|
||||
|
||||
/* 1 or 3 args */
|
||||
if (Nargs != 1 && Nargs != 3) return E_2MANY_ARGS;
|
||||
|
||||
for (i=0; i<Nargs; i++) {
|
||||
if (ARG(i).type != INT_TYPE) return E_BAD_TYPE;
|
||||
if (ARG(i).v.val < 0) return E_2LOW;
|
||||
if (ARG(i).v.val > 100) return E_2HIGH;
|
||||
}
|
||||
|
||||
sprintf(s, "/_A LineWidth 2 div def ");
|
||||
s += strlen(s);
|
||||
@@ -2165,7 +2191,11 @@ static int FPsshade()
|
||||
s += strlen(s);
|
||||
sprintf(s, "BoxWidth _A sub _A lineto BoxWidth _A sub BoxHeight _A sub lineto ");
|
||||
s += strlen(s);
|
||||
sprintf(s, "_A BoxHeight _A sub lineto closepath %d 100 div setgray fill 0.0 setgray", ARG(0).v.val);
|
||||
if (Nargs == 1) {
|
||||
sprintf(s, "_A BoxHeight _A sub lineto closepath %d 100 div setgray fill 0.0 setgray", ARG(0).v.val);
|
||||
} else {
|
||||
sprintf(s, "_A BoxHeight _A sub lineto closepath %d 100 div %d 100 div %d 100 div setrgbcolor fill 0.0 setgray", ARG(0).v.val, ARG(1).v.val, ARG(2).v.val);
|
||||
}
|
||||
return RetStrVal(psbuff);
|
||||
}
|
||||
|
||||
|
||||
4
german.h
4
german.h
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
6
hbcal.c
6
hbcal.c
@@ -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"
|
||||
|
||||
32
init.c
32
init.c
@@ -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.2 1996-04-28 02:01:58 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
|
||||
@@ -77,12 +77,12 @@ static char const RCSID[] = "$Id: init.c,v 1.2 1996-04-28 02:01:58 dfs Exp $";
|
||||
|
||||
/* For parsing an integer */
|
||||
#define PARSENUM(var, s) \
|
||||
var = 0; \
|
||||
while (isdigit(*(s))) { \
|
||||
var *= 10; \
|
||||
var += *(s) - '0'; \
|
||||
s++; \
|
||||
}
|
||||
var = 0; \
|
||||
while (isdigit(*(s))) { \
|
||||
var *= 10; \
|
||||
var += *(s) - '0'; \
|
||||
s++; \
|
||||
}
|
||||
|
||||
#ifdef UNIX
|
||||
PRIVATE void ChgUser ARGS((char *uname));
|
||||
@@ -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
|
||||
|
||||
139
italian.h
Normal file
139
italian.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ITALIAN.H */
|
||||
/* */
|
||||
/* Support for the Italian language. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* It is Copyright (C) 1996 by Valerio Aimale */
|
||||
/* */
|
||||
/* Remind is copyright (C) 1992-1997 by David F. Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $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"
|
||||
|
||||
/* Day names */
|
||||
#ifdef ISOLATIN1
|
||||
#define L_SUNDAY "Domenica"
|
||||
#define L_MONDAY "Luned\354"
|
||||
#define L_TUESDAY "Marted\354"
|
||||
#define L_WEDNESDAY "Mercoled\354"
|
||||
#define L_THURSDAY "Gioved\354"
|
||||
#define L_FRIDAY "Venerd\354"
|
||||
#define L_SATURDAY "Sabato"
|
||||
#else /* ISOLATIN1 */
|
||||
#define L_SUNDAY "Domenica"
|
||||
#define L_MONDAY "Lunedi`"
|
||||
#define L_TUESDAY "Martedi`"
|
||||
#define L_WEDNESDAY "Mercoledi`"
|
||||
#define L_THURSDAY "Giovedi`"
|
||||
#define L_FRIDAY "Venerdi`"
|
||||
#define L_SATURDAY "Sabato"
|
||||
#endif /* ISOLATIN */
|
||||
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#define L_DAYINIT "DLMMGVS"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "Gennaio"
|
||||
#define L_FEB "Febbraio"
|
||||
#define L_MAR "Marzo"
|
||||
#define L_APR "Aprile"
|
||||
#define L_MAY "Maggio"
|
||||
#define L_JUN "Giugno"
|
||||
#define L_JUL "Luglio"
|
||||
#define L_AUG "Agosto"
|
||||
#define L_SEP "Settembre"
|
||||
#define L_OCT "Ottobre"
|
||||
#define L_NOV "Novembre"
|
||||
#define L_DEC "Dicembre"
|
||||
|
||||
/* Today and tomorrow */
|
||||
#define L_TODAY "oggi"
|
||||
|
||||
#define L_TOMORROW "domani"
|
||||
|
||||
/* The default banner */
|
||||
#define L_BANNER "Promemoria per %w, %d %m %y%o:"
|
||||
|
||||
/* "am" and "pm" */
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "fa"
|
||||
#define L_FROMNOW "da oggi"
|
||||
|
||||
/* "in %d days' time" */
|
||||
#define L_INXDAYS "fra %d giorni"
|
||||
|
||||
/* "on" as in "on date..." */
|
||||
#define L_ON ""
|
||||
|
||||
/* Pluralizing - this is a problem for many languages and may require
|
||||
a more drastic fix */
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#define L_NOW "ora"
|
||||
#define L_AT "alle"
|
||||
#define L_MINUTE "minut"
|
||||
#define L_HOUR "or"
|
||||
#ifdef ISOLATIN1
|
||||
#define L_IS "\350"
|
||||
#else /* ISOLATIN1 */
|
||||
#define L_IS "e`"
|
||||
#endif/* ISOLATIN1 */
|
||||
#define L_WAS "era"
|
||||
#define L_AND "e"
|
||||
/* What to add to make "hour" plural */
|
||||
#define L_HPLU "s"
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU "s"
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
|
||||
#define L_P_OVER sprintf(s, (diff == 1 ? "o" : "i"));
|
||||
#define L_Q_OVER sprintf(s, (diff == 1 ? "a" : "e"));
|
||||
|
||||
#define L_HPLU_OVER hplu = (hdiff == 1 ? "a" : "e");
|
||||
#define L_MPLU_OVER mplu = (mdiff == 1 ? "o" : "i");
|
||||
|
||||
#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_E_OVER sprintf(s, "%02d%c%02d%c%04d", d, DATESEP,\
|
||||
m+1, DATESEP, y);
|
||||
|
||||
#define L_F_OVER sprintf(s, "%02d%c%02d%c%04d", m+1, DATESEP, d, DATESEP, y);
|
||||
|
||||
#define L_G_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
|
||||
|
||||
#define L_H_OVER sprintf(s, "%02d%c%02d", d, DATESEP, m+1);
|
||||
|
||||
#define L_I_OVER sprintf(s, "%02d%c%02d", m+1, DATESEP, d);
|
||||
|
||||
#define L_J_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, \
|
||||
MonthName[m], y);
|
||||
|
||||
#define L_K_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
|
||||
MonthName[m]);
|
||||
#define L_L_OVER sprintf(s, "%04d%c%02d%c%02d", y, DATESEP, m+1, DATESEP, d);
|
||||
|
||||
#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]);
|
||||
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
13
lang.h
13
lang.h
@@ -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.2 1996-04-29 19:34:38 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... */
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
#define NORWEGIAN 5 /* translated by Trygve Randen */
|
||||
#define DANISH 6 /* translated by Mogens Lynnerup */
|
||||
#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
|
||||
@@ -56,6 +59,12 @@
|
||||
#include "danish.h"
|
||||
#elif LANG == POLISH
|
||||
#include "polish.h"
|
||||
#elif LANG == BRAZPORT
|
||||
#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
27
main.c
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Makefile for REMIND for Borland C++
|
||||
# $Id: makefile.bcc,v 1.2 1996-03-31 04:08:11 dfs Exp $
|
||||
# $Id: makefile.bcc,v 1.5 1997-03-30 19:07:41 dfs Exp $
|
||||
|
||||
VERSION= 03.00.14
|
||||
VERSION= 03.00.17
|
||||
|
||||
MODEL=l
|
||||
|
||||
|
||||
14
makefile.os2
14
makefile.os2
@@ -1,6 +1,8 @@
|
||||
# Makefile for REMIND
|
||||
#
|
||||
# $Id: makefile.os2,v 1.1 1996-03-27 03:26:02 dfs Exp $
|
||||
# $Id: makefile.os2,v 1.3 1997-03-31 22:13:09 dfs Exp $
|
||||
#
|
||||
# THIS IS OUT OF DATE!
|
||||
#
|
||||
# - for GNU gcc (emx 0.8g kit) [executables for OS/2 2.x or DOS (32-bit)]
|
||||
# - for Microsoft C 6.00A [executables for OS/2 or MSDOS (16-bit)]
|
||||
@@ -16,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:
|
||||
@@ -39,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 =
|
||||
@@ -69,6 +79,8 @@ OBJS= $(SRCS:.c=$O)
|
||||
|
||||
all: remind.exe rem2ps.exe
|
||||
|
||||
.SUFFIXES: $O
|
||||
|
||||
.c$O:
|
||||
$(CC) -c $(CFLAGS) $(OS2_POPUP) $*.c
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Makefile for REMIND for Turbo C for MSDOS
|
||||
# $Id: makefile.tc,v 1.2 1996-03-31 04:08:11 dfs Exp $
|
||||
# $Id: makefile.tc,v 1.5 1997-03-30 19:07:41 dfs Exp $
|
||||
|
||||
CC= tcc
|
||||
VERSION= 03.00.14
|
||||
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
6
moon.c
@@ -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
|
||||
|
||||
@@ -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
6
omit.c
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
6
polish.h
6
polish.h
@@ -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
|
||||
|
||||
297
portbr.h
Normal file
297
portbr.h
Normal file
@@ -0,0 +1,297 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* PORTBR.H */
|
||||
/* */
|
||||
/* Support for the Brazilian Portuguese Language. */
|
||||
/* */
|
||||
/* Contributed by Marco Paganini (paganini@ism.com.br). */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* 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.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"
|
||||
|
||||
/* Day names */
|
||||
#define L_SUNDAY "domingo"
|
||||
#define L_MONDAY "segunda"
|
||||
#define L_TUESDAY "terca"
|
||||
#define L_WEDNESDAY "quarta"
|
||||
#define L_THURSDAY "quinta"
|
||||
#define L_FRIDAY "sexta"
|
||||
#define L_SATURDAY "sabado"
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#define L_DAYINIT "dstqqss"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "janeiro"
|
||||
#define L_FEB "fevereiro"
|
||||
#define L_MAR "marco"
|
||||
#define L_APR "abril"
|
||||
#define L_MAY "maio"
|
||||
#define L_JUN "junho"
|
||||
#define L_JUL "julho"
|
||||
#define L_AUG "agosto"
|
||||
#define L_SEP "setembro"
|
||||
#define L_OCT "outubro"
|
||||
#define L_NOV "novembro"
|
||||
#define L_DEC "dezembro"
|
||||
|
||||
/* Today and tomorrow */
|
||||
#define L_TODAY "hoje"
|
||||
#define L_TOMORROW "amanha"
|
||||
|
||||
/* The default banner */
|
||||
#define L_BANNER "Avisos para %w, %d de %m de %y%o:"
|
||||
|
||||
/* "am" and "pm" */
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "atras"
|
||||
#define L_FROMNOW "adiante"
|
||||
|
||||
/* "in %d days' time" */
|
||||
#define L_INXDAYS "em %d dias"
|
||||
|
||||
/* "on" as in "on date..." */
|
||||
#define L_ON "em"
|
||||
|
||||
/* Pluralizing - this is a problem for many languages and may require
|
||||
a more drastic fix */
|
||||
#define L_PLURAL "s"
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#define L_NOW "agora"
|
||||
#define L_AT "as"
|
||||
#define L_MINUTE "minuto"
|
||||
#define L_HOUR "hora"
|
||||
#define L_IS "sao"
|
||||
#define L_WAS "eram"
|
||||
#define L_AND "e"
|
||||
|
||||
/* What to add to make "hour" plural */
|
||||
#define L_HPLU "s"
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU "s"
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
|
||||
#define L_ORDINAL_OVERRIDE plu = "";
|
||||
|
||||
/* Portuguese weekdays must be treated separately */
|
||||
#define _ON_WEEKDAY(x) ((x % 7) < 2) ? "no" : "na"
|
||||
|
||||
#define L_A_OVER \
|
||||
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m], y);
|
||||
|
||||
#define L_C_OVER \
|
||||
sprintf(s, "%s %s", _ON_WEEKDAY(jul), DayName[jul%7]);
|
||||
|
||||
#define L_G_OVER \
|
||||
sprintf(s, "%s %s, %d %s", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m]);
|
||||
|
||||
#define L_J_OVER \
|
||||
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m], y);
|
||||
|
||||
#define L_K_OVER \
|
||||
sprintf(s, "%s %s, %d de %s", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m]);
|
||||
|
||||
/* Portuguese does not use some suffixes, some some %u and %j are the same */
|
||||
#define L_U_OVER \
|
||||
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m], y);
|
||||
|
||||
#define L_V_OVER \
|
||||
sprintf(s, "%s %s, %d de %s", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m]);
|
||||
|
||||
#define L_1_OVER \
|
||||
{ \
|
||||
if (tdiff == 0) \
|
||||
sprintf(s, L_NOW); \
|
||||
else \
|
||||
if (hdiff == 0) \
|
||||
{ \
|
||||
if (mdiff > 0) \
|
||||
sprintf(s, "em %d %s%s", mdiff, L_MINUTE, mplu); \
|
||||
else \
|
||||
sprintf(s, "%d %s%s atras", mdiff, L_MINUTE, mplu); \
|
||||
} \
|
||||
else if (mdiff == 0) \
|
||||
{ \
|
||||
if (hdiff > 0) \
|
||||
sprintf(s, "em %d %s%s", hdiff, L_HOUR, hplu); \
|
||||
else \
|
||||
sprintf(s, "%d %s%s atras", hdiff, L_HOUR, hplu); \
|
||||
} else { \
|
||||
if (tdiff > 0) \
|
||||
sprintf(s, "em %d %s%s %s %d %s%s", hdiff, L_HOUR, hplu, L_AND, mdiff, L_MINUTE, mplu); \
|
||||
else \
|
||||
sprintf(s, "%d %s%s %s %d %s%s atras", hdiff, L_HOUR, hplu, L_AND, mdiff, L_MINUTE, mplu); \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
/* The next ones are used only when MK_GLOBALS is set */
|
||||
#ifdef MK_GLOBALS
|
||||
#define L_ERR_OVERRIDE 1
|
||||
EXTERN char *ErrMsg[] =
|
||||
{
|
||||
"Ok",
|
||||
"Falta um ']'",
|
||||
"Falta uma aspa",
|
||||
"Expressao muito complexa - muitos operadores",
|
||||
"Expressao muito complexa - muitos operandos",
|
||||
"Falta um ')'",
|
||||
"Funcao nao definida",
|
||||
"Caracter ilegal",
|
||||
"Esperando operador binario",
|
||||
"Sem memoria",
|
||||
"Numero mal-formado",
|
||||
"Op stack underflow - erro interno",
|
||||
"Va stack underflow - erro interno",
|
||||
"Nao consigo fazer 'coerce'",
|
||||
"Type mismatch",
|
||||
"Overflow na data",
|
||||
"Erro de stack - erro interno",
|
||||
"Divisao por zero",
|
||||
"Variavel nao definida",
|
||||
"Fim da linha nao esperado",
|
||||
"Fim de arquivo nao esperado",
|
||||
"Erro de I/O",
|
||||
"Linha muito longa",
|
||||
"Erro interno",
|
||||
"Especificacao de data invalida",
|
||||
"Argumentos insuficientes",
|
||||
"Argumentos em excesso",
|
||||
"Hora mal-formada",
|
||||
"Numero muito grande",
|
||||
"Numero muito pequeno",
|
||||
"Nao consigo abrir o arquivo",
|
||||
"Ninho de INCLUDEs muito profundo",
|
||||
"Erro de parsing",
|
||||
"Nao consigo computar o 'trigger'",
|
||||
"Muitos IFs aninhados",
|
||||
"ELSE sem o IF correspondente",
|
||||
"ENDIF sem o IF correspondente",
|
||||
"Nao se pode usar OMIT para todos os dias da semana",
|
||||
"Token nao reconhecido na linha",
|
||||
"POP-OMIT-CONTEXT sem PUSH-OMIT-CONTEXT correspondente",
|
||||
"RUN desabilitado",
|
||||
"Erro de dominio",
|
||||
"Identificados invalido",
|
||||
"Chamada de funcao recursiva detectada",
|
||||
"",
|
||||
"Nao posso modificar variavel de sistema",
|
||||
"Funcao da biblioteca C nao pode representar data/hora",
|
||||
"Tentativa de redefinir funcao interna",
|
||||
"Nao e' possivel aninhar definicao de funcao em expressao",
|
||||
"Data deve ser completamente especificada para usar o fator de REPEAT",
|
||||
"Ano especificado duas vezes",
|
||||
"Mes especificado duas vezes",
|
||||
"Dia especificado duas vezes",
|
||||
"Token desconhecido",
|
||||
"Mes e dia devem ser especificados no comando OMIT",
|
||||
"Muitos OMITs parciais",
|
||||
"Muitos OMITs full",
|
||||
"Aviso: PUSH-OMIT-CONTEXT sem POP-OMIT-CONTEXT correspondente",
|
||||
"Erro na leitura do arquivo",
|
||||
"Aguardando fim do arquivo",
|
||||
"Data hebraica invalida",
|
||||
"IIF necessita de numero impar de argumentos",
|
||||
"Warning: ENDIF faltando",
|
||||
"Esperando virgula",
|
||||
"Dia da semana especificado duas vezes",
|
||||
"Use apenas um de BEFORE, AFTER ou SKIP",
|
||||
"Nao e possivel aninhar MSG, MSF, RUN, etc. em expressoes",
|
||||
"Valor de Repeat especificado duas vezes",
|
||||
"Valor de Delta especificado duas vezes",
|
||||
"Valor de Back especificado duas vezes",
|
||||
"ONCE usado duas vezes (Eheheh)",
|
||||
"Esperando hora apos AT",
|
||||
"Keyword UNTIL usada duas vezes",
|
||||
"Especificacao de data incompleta",
|
||||
"Keyword SCANFROM usada duas vezes",
|
||||
"Variavel",
|
||||
"Valor",
|
||||
"*INDEFINIDO*",
|
||||
"Entrando UserFN",
|
||||
"Saindo UserFN",
|
||||
"Expirou",
|
||||
"fork() falhou - Nao posso processar compromissos na fila",
|
||||
"Nao consigo acessar o arquivo",
|
||||
"Data do sistema ilegal: Ano e menor que %d\n",
|
||||
"Flag de debug desconhecido '%c'\n",
|
||||
"Opcao desconhecida '%c'\n",
|
||||
"Usuario desconhecido '%s'\n",
|
||||
"Nao consigo mudar gid para %d\n",
|
||||
"Nao consigo mudar uid para %d\n",
|
||||
"Sem memoria para o environment\n",
|
||||
"Falta o sinal de '='",
|
||||
"Falta o nome da variavel",
|
||||
"Falta a expressao",
|
||||
"Nao consigo resetar a data de acesso de %s\n",
|
||||
"Remind: '-i' opcao: %s\n",
|
||||
"Sem compromissos.",
|
||||
"%d compromisso(s) colocados na fila para mais tarde.\n",
|
||||
"Esperando numero",
|
||||
"Funcao ilegal na clausula WARN"
|
||||
};
|
||||
#endif /* MK_GLOBALS */
|
||||
|
||||
/* The following is only used in init.c */
|
||||
#ifdef L_IN_INIT
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
{
|
||||
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
|
||||
fprintf(ErrFp, "Uso: remind [opcoes] arquivo [data] [hora] [*rep]\n");
|
||||
fprintf(ErrFp, "Opcoes:\n");
|
||||
fprintf(ErrFp, " -n Imprime a proxima ocorrencia em formato simples\n");
|
||||
fprintf(ErrFp, " -r Desabilita a diretiva RUN\n");
|
||||
fprintf(ErrFp, " -c[n] Produz calendario para n (default 1) meses\n");
|
||||
fprintf(ErrFp, " -c+[n] Produz calendario para n (default 1) semanas\n");
|
||||
fprintf(ErrFp, " -w[n[,p[,s]]] Especifica largura, preenchimento e espacejamento do calendario\n");
|
||||
fprintf(ErrFp, " -s[+][n] Produz um `calendario simples' para n (1) meses (semanas)\n");
|
||||
fprintf(ErrFp, " -p[n] Identico a -s, porem com saida compativel com rem2ps\n");
|
||||
fprintf(ErrFp, " -v Modo verbose\n");
|
||||
fprintf(ErrFp, " -o Ignora diretivas ONCE\n");
|
||||
fprintf(ErrFp, " -t Aciona todos os compromissos futuros, sem considerar o delta\n");
|
||||
fprintf(ErrFp, " -h Modo `Hush' - quieto\n");
|
||||
#ifdef HAVE_QUEUED
|
||||
fprintf(ErrFp, " -a Nao aciona compromissos com hora imediatamente - apenas coloca na fila\n");
|
||||
fprintf(ErrFp, " -q Nao coloca compromissos com hora na fila\n");
|
||||
fprintf(ErrFp, " -f Aciona compromissos com hora em modo foreground\n");
|
||||
fprintf(ErrFp, " -z[n] Modo `daemon', acordando a cada n (5) minutos.\n");
|
||||
#endif
|
||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trigger v=dumpvars l=showline\n");
|
||||
fprintf(ErrFp, " -e Desvia mensagens normalmente enviadas a stderr para stdout\n");
|
||||
fprintf(ErrFp, " -b[n] Formato da hora para o cal: 0=am/pm, 1=24hr, 2=nenhum\n");
|
||||
fprintf(ErrFp, " -x[n] Limite de iteracoes para a clausula SATISFY (default=150)\n");
|
||||
fprintf(ErrFp, " -kcmd Executa `cmd' para os compromissos com MSG\n");
|
||||
fprintf(ErrFp, " -g[ddd] Classifica compromissos por data, hora e prioridade antes de exibir\n");
|
||||
fprintf(ErrFp, " -ivar=val Inicializa (e preserva) variavel var com val\n");
|
||||
fprintf(ErrFp, " -m Inicia o calendario na segunda, ao inves de domingo\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif /* L_IN_INIT */
|
||||
4
protos.h
4
protos.h
@@ -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
10
queue.c
@@ -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:
|
||||
|
||||
21
rem2ps.c
21
rem2ps.c
@@ -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.3 1996-04-28 02:02:02 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;
|
||||
@@ -740,7 +742,6 @@ char *s;
|
||||
fprintf(stderr, "-p file Include user-supplied PostScript code in prologue\n");
|
||||
fprintf(stderr, "-l Do calendar in landscape mode\n");
|
||||
fprintf(stderr, "-c[n] Control small calendars: 0=none; 1=bt; 2=tb; 3=sbt\n");
|
||||
fprintf(stderr, " and next month\n");
|
||||
fprintf(stderr, "-i Use ISO 8859-1 encoding in PostScript output\n");
|
||||
fprintf(stderr, "-m media Set page size (eg, Letter, Legal, A4.) Case sensitive!\n");
|
||||
fprintf(stderr, " (Default page size is %s)\n", DefaultPage[0].name);
|
||||
|
||||
5
rem2ps.h
5
rem2ps.h
@@ -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",
|
||||
|
||||
@@ -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.
|
||||
|
||||
41
remind.1
41
remind.1
@@ -1,5 +1,5 @@
|
||||
.\" $Id: remind.1,v 1.2 1996-04-28 02:02:04 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:
|
||||
@@ -2106,10 +2116,12 @@ moon displayed, you could use this in your reminder script:
|
||||
Note how the time is coerced to a string by concatenating the null string.
|
||||
.RE
|
||||
.TP
|
||||
.B psshade(i_num)
|
||||
\fBpsshade(i_gray)\fR or \fBpsshade(i_red, i_green, i_blue)\fR
|
||||
Returns a \fBSTRING\fR which consists of PostScript commands to
|
||||
shade a calendar box. \fINum\fR can range from 0 (completely black)
|
||||
to 100 (completely white.) Here's an example of how to use this:
|
||||
to 100 (completely white.) If three arguments are given, they specify
|
||||
red, green and blue intensity from 0 to 100.
|
||||
Here's an example of how to use this:
|
||||
.RS
|
||||
.PP
|
||||
.nf
|
||||
@@ -2155,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
|
||||
@@ -3611,6 +3624,15 @@ Mogens Lynnerup
|
||||
.PP
|
||||
\fBPolish\fR --
|
||||
Jerzy Sobczyk (complete)
|
||||
.PP
|
||||
\fBBrazilian Portuguese\fR --
|
||||
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
|
||||
@@ -3619,6 +3641,9 @@ are not implemented as read-only system variables.
|
||||
.PP
|
||||
Hebrew dates in \fBRemind\fR change at midnight instead of sunset.
|
||||
.PP
|
||||
Language should be selectable at run-time, not compile-time. Don't
|
||||
expect this to happen soon!
|
||||
.PP
|
||||
The UTC functions may not be reliable under MS-DOS.
|
||||
.PP
|
||||
The MS-DOS version of \fBRemind\fR does not support queuing or timed
|
||||
|
||||
25
remind.LSM
Normal file
25
remind.LSM
Normal file
@@ -0,0 +1,25 @@
|
||||
Begin3
|
||||
Title: Remind
|
||||
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. 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
|
||||
230kB remind-3.0.17.tgz
|
||||
Alternate-site:
|
||||
Original-site:
|
||||
Platform: Linux, Solaris, SunOS, HP-UX -- virtually any UN*X-like
|
||||
system. Wish 4.x required for TCL/Tk front-end, but
|
||||
this is not essential to use the software.
|
||||
Copying-policy: An AMENDED version of GPL. The amendments prohibit
|
||||
porting to MS Windows and use by a certain Canadian
|
||||
corporation.
|
||||
End
|
||||
112
romanian.h
Normal file
112
romanian.h
Normal 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 */
|
||||
@@ -1,6 +1,7 @@
|
||||
# $Id: smakefile,v 1.2 1996-04-29 19:34:39 dfs Exp $
|
||||
# $Id: smakefile,v 1.3 1996-10-12 02:49:35 dfs Exp $
|
||||
# Makefile for REMIND, suitable for SAS/C 6.50 under AmigaDOS
|
||||
# English version
|
||||
# THIS IS OUT OF DATE!
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# THINGS FOR YOU TO EDIT START BELOW
|
||||
|
||||
5
sort.c
5
sort.c
@@ -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>
|
||||
|
||||
4
test-rem
4
test-rem
@@ -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
|
||||
|
||||
@@ -631,7 +631,7 @@ set a057 value("a05"+"6")
|
||||
"a05" + "6" => "a056"
|
||||
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
set a058 version()
|
||||
version() => "03.00.14"
|
||||
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.14"
|
||||
a058 "03.00.17"
|
||||
a077 "1992 92
|
||||
"
|
||||
a049 21
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
4
test.cmp
4
test.cmp
@@ -631,7 +631,7 @@ set a057 value("a05"+"6")
|
||||
"a05" + "6" => "a056"
|
||||
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
set a058 version()
|
||||
version() => "03.00.14"
|
||||
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.14"
|
||||
a058 "03.00.17"
|
||||
a077 "1992 92
|
||||
"
|
||||
a049 21
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Test file for REMIND
|
||||
#
|
||||
# $Id: test1.cmp,v 1.3 1996-04-28 02:02:07 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.14"
|
||||
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.14"
|
||||
a058 "03.00.17"
|
||||
a077 "1992 92
|
||||
"
|
||||
a049 21
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Test file for REMIND
|
||||
#
|
||||
# $Id: test2.cmp,v 1.3 1996-04-28 02:02:07 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.14"
|
||||
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.14"
|
||||
a058 "03.00.17"
|
||||
a077 "1992 92
|
||||
"
|
||||
a049 21
|
||||
|
||||
378
tkremind
378
tkremind
@@ -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.6 1996-05-25 19:36:50 dfs Exp $
|
||||
# $Id: tkremind,v 1.12 1997-01-16 04:14:32 dfs Exp $
|
||||
|
||||
# the next line restarts using wish \
|
||||
exec wish "$0" "$@"
|
||||
@@ -26,6 +26,9 @@ set ConfirmQuit 0
|
||||
# Remind program to execute -- supply full path if you want
|
||||
set Remind "remind"
|
||||
|
||||
# Rem2PS program to execute -- supply full path if you want
|
||||
set Rem2PS "rem2ps"
|
||||
|
||||
# Reminder file to source -- default
|
||||
set ReminderFile {NOSUCHFILE}
|
||||
catch {set ReminderFile "$env(HOME)/.reminders"}
|
||||
@@ -60,20 +63,28 @@ set SkipType 1
|
||||
|
||||
# Remind command line
|
||||
set CommandLine {}
|
||||
set PSCmd {}
|
||||
|
||||
# Print options -- destination file; letter-size; landscape; fill page
|
||||
set PrintDest file
|
||||
set PrintSize letter
|
||||
set PrintOrient landscape
|
||||
set PrintFill 1
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Initialize -- initialize things
|
||||
#---------------------------------------------------------------------------
|
||||
proc Initialize {} {
|
||||
|
||||
global DayNames argc argv CommandLine ReminderFile AppendFile Remind
|
||||
global DayNames argc argv CommandLine ReminderFile AppendFile Remind PSCmd
|
||||
|
||||
set CommandLine "|$Remind -itkremind=1 -p"
|
||||
|
||||
set PSCmd "$Remind -p"
|
||||
set i 0
|
||||
while {$i < $argc} {
|
||||
if {[regexp -- {-[bgxim].*} [lindex $argv $i]]} {
|
||||
append CommandLine " [lindex $argv $i]"
|
||||
append PSCmd " [lindex $argv $i]"
|
||||
} else {
|
||||
break
|
||||
}
|
||||
@@ -91,16 +102,17 @@ proc Initialize {} {
|
||||
|
||||
# Check system sanity
|
||||
if {! [file readable $ReminderFile]} {
|
||||
tk_dialog .error Error "Can't read reminder file `$ReminderFile'" error -1 Ok
|
||||
tk_dialog .error Error "Can't read reminder file `$ReminderFile'" error 0 Ok
|
||||
exit 1
|
||||
}
|
||||
|
||||
if {! [file writable $AppendFile]} {
|
||||
tk_dialog .error Error "Can't write reminder file `$AppendFile'" error -1 Ok
|
||||
tk_dialog .error Error "Can't write reminder file `$AppendFile'" error 0 Ok
|
||||
exit 1
|
||||
}
|
||||
|
||||
append CommandLine " $ReminderFile"
|
||||
append PSCmd " $ReminderFile"
|
||||
set DayNames [GetWeekdayNames]
|
||||
# puts "CommandLine: $CommandLine"
|
||||
}
|
||||
@@ -148,9 +160,12 @@ proc GetWeekdayNames {} {
|
||||
# day -- day whose row number is needed
|
||||
#---------------------------------------------------------------------------
|
||||
proc RowNumber {firstDay mondayFirst day} {
|
||||
# If month starts on Sunday, but Monday is in first column, handle it...
|
||||
set adjust 0
|
||||
if {$mondayFirst && !$firstDay} {incr adjust}
|
||||
set modDay [expr $day - $mondayFirst]
|
||||
if { $modDay < 0 } { set modDay 6 }
|
||||
return [expr ($modDay + $firstDay - 1) / 7 + 1]
|
||||
return [expr ($modDay + $firstDay - 1) / 7 + 1 + $adjust]
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -222,9 +237,10 @@ proc CreateCalWindow { firstDay mondayFirst daysInMonth month year dayNames } {
|
||||
button .b.this -text {Today} -command {ThisMonth}
|
||||
button .b.next -text {Next Month} -command {MoveMonth 1}
|
||||
button .b.goto -text {Go To Date...} -command {GotoDialog}
|
||||
button .b.print -text {Print...} -command {DoPrint}
|
||||
button .b.quit -text {Quit} -command {Quit}
|
||||
label .b.status -text "" -width 10 -relief sunken
|
||||
pack .b.prev .b.this .b.next .b.goto .b.quit -side left -fill x
|
||||
pack .b.prev .b.this .b.next .b.goto .b.print .b.quit -side left -fill x
|
||||
pack .b.status -side left -fill x -expand 1
|
||||
pack .h -side top -expand 1 -fill both
|
||||
pack .b -side top -fill x -expand 0
|
||||
@@ -326,6 +342,129 @@ proc Status { stuff } {
|
||||
update idletasks
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# DoPrint -- print a calendar
|
||||
# Arguments:
|
||||
# None
|
||||
#---------------------------------------------------------------------------
|
||||
proc DoPrint {} {
|
||||
global PrintDest PrintSize PrintOrient PrintFill PrintStatus Rem2PS PSCmd
|
||||
global CurMonth CurYear MonthNames
|
||||
catch {destroy .p}
|
||||
toplevel .p
|
||||
wm title .p "Print..."
|
||||
wm iconname .p "Print..."
|
||||
frame .p.f1 -relief sunken -border 2
|
||||
frame .p.f11
|
||||
frame .p.f12
|
||||
frame .p.f2 -relief sunken -border 2
|
||||
frame .p.f3 -relief sunken -border 2
|
||||
frame .p.f4
|
||||
|
||||
radiobutton .p.tofile -text "To file: " -variable PrintDest -value file
|
||||
entry .p.filename
|
||||
button .p.browse -text "Browse..." -command PrintFileBrowse
|
||||
radiobutton .p.tocmd -text "To command: " -variable PrintDest -value command
|
||||
entry .p.command
|
||||
.p.command insert end "lpr"
|
||||
|
||||
label .p.size -text "Paper Size:"
|
||||
radiobutton .p.letter -text "Letter" -variable PrintSize -value letter
|
||||
radiobutton .p.a4 -text "A4" -variable PrintSize -value a4
|
||||
|
||||
label .p.orient -text "Orientation:"
|
||||
radiobutton .p.landscape -text "Landscape" -variable PrintOrient -value landscape
|
||||
radiobutton .p.portrait -text "Portrait" -variable PrintOrient -value portrait
|
||||
|
||||
checkbutton .p.fill -text "Fill page" -variable PrintFill
|
||||
|
||||
button .p.print -text "Print" -command {set PrintStatus print}
|
||||
button .p.cancel -text "Cancel" -command {set PrintStatus cancel}
|
||||
|
||||
pack .p.f1 .p.f2 .p.f3 -side top -fill both -expand 1 -anchor w
|
||||
pack .p.fill -side top -anchor w -fill none -expand 0
|
||||
pack .p.f4 -side top -fill both -expand 1 -anchor w
|
||||
pack .p.f11 .p.f12 -in .p.f1 -side top -fill none -expand 0 -anchor w
|
||||
pack .p.tofile .p.filename .p.browse -in .p.f11 -side left -fill none -expand 0 -anchor w
|
||||
pack .p.tocmd .p.command -in .p.f12 -side left -fill none -expand 0 -anchor w
|
||||
pack .p.size .p.letter .p.a4 -in .p.f2 -side top -fill none -expand 0 -anchor w
|
||||
pack .p.orient .p.landscape .p.portrait -in .p.f3 -side top -fill none -expand 0 -anchor w
|
||||
pack .p.print .p.cancel -in .p.f4 -side left -fill none -expand 0
|
||||
|
||||
bind .p <KeyPress-Escape> ".p.cancel flash; .p.cancel invoke"
|
||||
bind .p <KeyPress-Return> ".p.print flash; .p.print invoke"
|
||||
set PrintStatus 2
|
||||
CenterWindow .p
|
||||
tkwait visibility .p
|
||||
set oldFocus [focus]
|
||||
focus .p.filename
|
||||
grab .p
|
||||
tkwait variable PrintStatus
|
||||
catch {focus $oldFocus}
|
||||
set fname [.p.filename get]
|
||||
set cmd [.p.command get]
|
||||
destroy .p
|
||||
if {$PrintStatus == "cancel"} {
|
||||
return
|
||||
}
|
||||
if {$PrintDest == "file"} {
|
||||
if {$fname == ""} {
|
||||
tk_dialog .error Error "No filename specified" error 0 Ok
|
||||
return
|
||||
}
|
||||
if {[file isdirectory $fname]} {
|
||||
tk_dialog .error Error "$fname is a directory" error 0 Ok
|
||||
return
|
||||
}
|
||||
if {[file readable $fname]} {
|
||||
set ans [tk_dialog .error Overwrite? "Overwrite $fname?" question 0 No Yes]
|
||||
if {$ans == 0} {
|
||||
return
|
||||
}
|
||||
}
|
||||
set fname "> $fname"
|
||||
} else {
|
||||
set fname "| $cmd"
|
||||
}
|
||||
|
||||
# Build the command line
|
||||
set cmd "$PSCmd 1 [lindex $MonthNames $CurMonth] $CurYear | $Rem2PS -c3"
|
||||
if {$PrintSize == "letter"} {
|
||||
append cmd " -m Letter"
|
||||
} else {
|
||||
append cmd " -m A4"
|
||||
}
|
||||
|
||||
if {$PrintOrient == "landscape"} {
|
||||
append cmd " -l"
|
||||
}
|
||||
|
||||
if {$PrintFill} {
|
||||
append cmd " -e"
|
||||
}
|
||||
|
||||
append cmd " $fname"
|
||||
Status "Printing..."
|
||||
if {[catch {eval "exec $cmd"} err]} {
|
||||
tk_dialog .error Error "Error during printing: $err" error 0 Ok
|
||||
}
|
||||
Status "Ready."
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# PrintFileBrowse -- browse for a filename for Print dialog
|
||||
# Arguments: none
|
||||
#---------------------------------------------------------------------------
|
||||
proc PrintFileBrowse {} {
|
||||
set ans [BrowseForFile .filebrowse "Print to file..." "Ok" 0 "*.ps"]
|
||||
if {$ans != ""} {
|
||||
.p.filename delete 0 end
|
||||
.p.filename insert end $ans
|
||||
.p.filename icursor end
|
||||
.p.filename xview end
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# GotoDialog -- Do the "Goto..." dialog
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -358,6 +497,7 @@ proc GotoDialog {} {
|
||||
pack .g.y.e -side left -fill x -expand 1
|
||||
pack .g.y -expand 1 -fill x
|
||||
pack .g.b -expand 1 -fill x
|
||||
bind .g <KeyPress-Escape> ".g.b.cancel flash; .g.b.cancel invoke"
|
||||
CenterWindow .g
|
||||
set oldFocus [focus]
|
||||
grab .g
|
||||
@@ -373,11 +513,11 @@ proc DoGoto {} {
|
||||
global CurYear CurMonth MonthNames
|
||||
set year [.g.y.e get]
|
||||
if { ! [regexp {^[0-9]+$} $year] } {
|
||||
tk_dialog .error Error {Illegal year specified (1990-2078)} error -1 Ok
|
||||
tk_dialog .error Error {Illegal year specified (1990-2078)} error 0 Ok
|
||||
return
|
||||
}
|
||||
if { $year < 1990 || $year > 2078 } {
|
||||
tk_dialog .error Error {Illegal year specified (1990-2078)} error -1 Ok
|
||||
tk_dialog .error Error {Illegal year specified (1990-2078)} error 0 Ok
|
||||
return
|
||||
}
|
||||
set month [lsearch -exact $MonthNames [.g.mon cget -text]]
|
||||
@@ -394,10 +534,11 @@ proc Quit {} {
|
||||
global ConfirmQuit
|
||||
if { !$ConfirmQuit } {
|
||||
destroy .
|
||||
return
|
||||
exit
|
||||
}
|
||||
if { [tk_dialog .question "Confirm..." {Really quit?} question 0 No Yes] } {
|
||||
destroy .
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,6 +727,7 @@ proc CreateModifyDialog {w day firstDay} {
|
||||
button $w.cancel -text "Cancel" -background "#e0c9c9" -command "set ModifyDialogResult 3"
|
||||
pack $w.add $w.preview $w.cancel -side left -anchor w -in $w.buttons -expand 1 -fill x
|
||||
|
||||
bind $w <KeyPress-Escape> "$w.cancel flash; $w.cancel invoke"
|
||||
set ModifyDialogResult 0
|
||||
|
||||
# Center the window on the root
|
||||
@@ -694,7 +836,7 @@ proc ModifyDay {d firstDay} {
|
||||
}
|
||||
set problem [catch {set rem [CreateReminder .mod]} err]
|
||||
if {$problem} {
|
||||
tk_dialog .error Error "$err" error -1 Ok
|
||||
tk_dialog .error Error "$err" error 0 Ok
|
||||
} else {
|
||||
if {$ModifyDialogResult == 2} {
|
||||
set err [EditReminder $err]
|
||||
@@ -999,6 +1141,7 @@ proc EditReminder {rem} {
|
||||
pack .edit.t -side top -fill both -expand 1
|
||||
pack .edit.f -side top -fill x -expand 1
|
||||
pack .edit.ok .edit.cancel -in .edit.f -side left -fill x -expand 1
|
||||
bind .edit <KeyPress-Escape> ".edit.cancel flash; .edit.cancel invoke"
|
||||
set ModifyDialogResult 0
|
||||
CenterWindow .edit
|
||||
tkwait visibility .edit
|
||||
@@ -1012,6 +1155,217 @@ proc EditReminder {rem} {
|
||||
return $rem
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# SetWinAttr -- sets an attribute for a window
|
||||
# Arguments:
|
||||
# w -- window name
|
||||
# attr -- attribute name
|
||||
# val -- value to set it to
|
||||
# Returns:
|
||||
# $val
|
||||
#---------------------------------------------------------------------------
|
||||
proc SetWinAttr {w attr val} {
|
||||
global attrPriv
|
||||
set attrPriv($w-$attr) $val
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# GetWinAttr -- gets an attribute for a window
|
||||
# Arguments:
|
||||
# w -- window name
|
||||
# attr -- attribute name
|
||||
# Returns:
|
||||
# Value of attribute
|
||||
#---------------------------------------------------------------------------
|
||||
proc GetWinAttr {w attr} {
|
||||
global attrPriv
|
||||
return $attrPriv($w-$attr)
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# WaitWinAttr -- wait for a window attribute to change
|
||||
# Arguments:
|
||||
# w -- window name
|
||||
# attr -- attribute name
|
||||
# Returns:
|
||||
# Value of attribute
|
||||
#---------------------------------------------------------------------------
|
||||
proc WaitWinAttr {w attr} {
|
||||
global attrPriv
|
||||
tkwait variable attrPriv($w-$attr)
|
||||
return $attrPriv($w-$attr)
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# BrowseForFile -- creates and operates a file browser dialog.
|
||||
# Arguments:
|
||||
# w -- dialog window.
|
||||
# title -- dialog title
|
||||
# oktext -- text for "OK" button
|
||||
# showdots -- if non-zero, shows "dot" files as well.
|
||||
# Returns:
|
||||
# complete path of filename chosen, or "" if Cancel pressed.
|
||||
#---------------------------------------------------------------------------
|
||||
proc BrowseForFile {w title {oktext "OK"} {showdots 0} {filter "*"}} {
|
||||
catch {destroy $w}
|
||||
toplevel $w
|
||||
wm title $w $title
|
||||
|
||||
# Global array to hold window attributes
|
||||
global a${w}
|
||||
|
||||
SetWinAttr $w status busy
|
||||
SetWinAttr $w showdots $showdots
|
||||
|
||||
frame $w.fileframe
|
||||
frame $w.butframe
|
||||
label $w.cwd -text [pwd]
|
||||
entry $w.entry
|
||||
label $w.masklab -text "Match: "
|
||||
listbox $w.list -yscrollcommand "$w.scroll set"
|
||||
scrollbar $w.scroll -command "$w.list yview"
|
||||
button $w.ok -text $oktext -command "BrowseForFileOK $w"
|
||||
button $w.cancel -text "Cancel" -command "BrowseForFileCancel $w"
|
||||
entry $w.filter -width 7
|
||||
$w.filter insert end $filter
|
||||
|
||||
pack $w.cwd $w.entry -side top -expand 0 -fill x
|
||||
pack $w.fileframe -side top -expand 1 -fill both
|
||||
pack $w.butframe -side top -expand 0 -fill x
|
||||
pack $w.list -in $w.fileframe -side left -expand 1 -fill both
|
||||
pack $w.scroll -in $w.fileframe -side left -expand 0 -fill y
|
||||
pack $w.ok -in $w.butframe -side left -expand 1 -fill x
|
||||
pack $w.cancel -in $w.butframe -side left -expand 1 -fill x
|
||||
pack $w.masklab -in $w.butframe -side left -expand 0
|
||||
pack $w.filter -in $w.butframe -side left -expand 1 -fill x
|
||||
|
||||
# Fill in the box and wait for status to change
|
||||
BrowseForFileRead $w [pwd]
|
||||
|
||||
bind $w <KeyPress-Escape> "$w.cancel flash; $w.cancel invoke"
|
||||
bind $w.list <Button-1> "$w.entry delete 0 end; $w.entry insert 0 \[selection get\]"
|
||||
bind $w.list <Double-Button-1> "$w.ok flash; $w.ok invoke"
|
||||
bind $w.list <Return> "$w.entry delete 0 end; $w.entry insert 0 \[selection get\]; $w.ok flash; $w.ok invoke"
|
||||
bind $w.entry <Return> "$w.ok flash; $w.ok invoke"
|
||||
bind $w.filter <Return> "BrowseForFileRead $w"
|
||||
bind $w.entry <KeyPress> "CompleteFile $w"
|
||||
bind $w.entry <KeyPress-space> "ExpandFile $w"
|
||||
bindtags $w.entry "Entry $w.entry $w all"
|
||||
|
||||
bindtags $w.list "Listbox $w.list $w all"
|
||||
CenterWindow $w
|
||||
set oldFocus [focus]
|
||||
tkwait visibility $w
|
||||
focus $w.entry
|
||||
set oldGrab [grab current $w]
|
||||
grab set $w
|
||||
WaitWinAttr $w status
|
||||
catch {focus $oldFocus}
|
||||
catch {grab set $oldGrab}
|
||||
set ans [GetWinAttr $w status]
|
||||
destroy $w
|
||||
return $ans
|
||||
}
|
||||
|
||||
proc CompleteFile {w} {
|
||||
set index [lsearch [$w.list get 0 end] [$w.entry get]* ]
|
||||
if {$index > -1} {
|
||||
$w.list see $index
|
||||
$w.list selection clear 0 end
|
||||
$w.list selection set $index
|
||||
}
|
||||
}
|
||||
|
||||
proc ExpandFile {w} {
|
||||
set stuff [$w.list curselection]
|
||||
if {[string compare $stuff ""]} {
|
||||
$w.entry delete 0 end
|
||||
$w.entry insert end [$w.list get $stuff]
|
||||
}
|
||||
}
|
||||
|
||||
proc BrowseForFileCancel {w} {
|
||||
SetWinAttr $w status {}
|
||||
}
|
||||
|
||||
proc BrowseForFileOK {w} {
|
||||
set fname [$w.entry get]
|
||||
if {[string compare $fname ""]} {
|
||||
# If it starts with a slash, handle it specially.
|
||||
if {[string match "/*" $fname]} {
|
||||
if {[file isdirectory $fname]} {
|
||||
BrowseForFileRead $w $fname
|
||||
return
|
||||
} else {
|
||||
SetWinAttr $w status $fname
|
||||
return
|
||||
}
|
||||
}
|
||||
if {[string match */ $fname]} {
|
||||
set fname [string trimright $fname /]
|
||||
}
|
||||
if {[$w.cwd cget -text] == "/"} {
|
||||
set fname "/$fname"
|
||||
} else {
|
||||
set fname "[$w.cwd cget -text]/$fname"
|
||||
}
|
||||
# If it's a directory, change directories
|
||||
if {[file isdirectory $fname]} {
|
||||
BrowseForFileRead $w $fname
|
||||
} else {
|
||||
SetWinAttr $w status $fname
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# BrowseForFileRead -- read the current directory into the file browser
|
||||
# Arguments:
|
||||
# w -- window name
|
||||
# dir -- directory
|
||||
# Returns:
|
||||
# nothing
|
||||
#---------------------------------------------------------------------------
|
||||
proc BrowseForFileRead {w {dir ""}} {
|
||||
# Save working dir
|
||||
set cwd [pwd]
|
||||
if {$dir == ""} {
|
||||
set dir [$w.cwd cget -text]
|
||||
}
|
||||
if {[catch "cd $dir" err]} {
|
||||
tk_dialog .error Error "$err" error 0 Ok
|
||||
return
|
||||
}
|
||||
$w.cwd configure -text [pwd]
|
||||
if {[GetWinAttr $w showdots]} {
|
||||
set flist [glob -nocomplain .* *]
|
||||
} else {
|
||||
set flist [glob -nocomplain *]
|
||||
}
|
||||
set flist [lsort $flist]
|
||||
set filter [$w.filter get]
|
||||
if {$filter == ""} {
|
||||
set filter "*"
|
||||
}
|
||||
$w.list delete 0 end
|
||||
foreach item $flist {
|
||||
if {$item != "." && $item != ".."} {
|
||||
if {[file isdirectory $item]} {
|
||||
$w.list insert end "$item/"
|
||||
} else {
|
||||
if {[string match $filter $item]} {
|
||||
$w.list insert end $item
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if {[pwd] != "/"} {
|
||||
$w.list insert 0 "../"
|
||||
}
|
||||
cd $cwd
|
||||
$w.entry delete 0 end
|
||||
}
|
||||
|
||||
proc main {} {
|
||||
wm withdraw .
|
||||
puts "\nTkRemind Copyright (c) 1996 by David F. Skoll\n"
|
||||
|
||||
31
tkremind.1
31
tkremind.1
@@ -1,5 +1,5 @@
|
||||
.\" $Id: tkremind.1,v 1.2 1996-05-25 19:29:27 dfs Exp $ "
|
||||
.TH TKREMIND 1 "23 April 1996"
|
||||
.\" $Id: tkremind.1,v 1.4 1996-09-28 18:46:57 dfs Exp $ "
|
||||
.TH TKREMIND 1 "7 July 1996"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
tkremind \- graphical front-end to Remind calendar program
|
||||
@@ -105,6 +105,33 @@ edit the reminder, thereby gaining access to advanced features of
|
||||
\fBRemind\fR. You can also use it simply to play around and discover
|
||||
\fBRemind\fR's idioms for expressing different types of reminders.
|
||||
|
||||
.SH PRINTING
|
||||
To print the current month's calender, click \fBPrint...\fR on the
|
||||
main calendar window. This brings up the print dialog. Printing
|
||||
either produces a PostScript file or sends PostScript to a UNIX command.
|
||||
|
||||
Select the print destination by choosing either \fBTo file:\fR or
|
||||
\fBTo command:\fR in the print dialog. Press \fBBrowse...\fR to bring
|
||||
up a file browser. In the file browser, you can enter a filename in
|
||||
the text entry, double-click on a filename in the listbox, or
|
||||
double-click on a directory to navigate the file system. You can also
|
||||
type the first few characters of a file name in the text entry box and
|
||||
press space to complete the name to the first matching entry.
|
||||
|
||||
The \fBMatch:\fR box contains a filename wildcard which filters files
|
||||
in the listbox. You can change the filter and press enter to rescan
|
||||
the directory.
|
||||
|
||||
Select the appropriate paper size and orientation. Activate
|
||||
\fBFill page\fR if you want the calendar to fill the page. This should
|
||||
be the normal case unless you have many reminders in a particular
|
||||
day. (See the \fBRem2PS\fR documentation.)
|
||||
|
||||
Finally, click \fBPrint\fR to print or \fBCancel\fR to cancel.
|
||||
Note that during printing, \fBRemind\fR is \fInot\fR called with
|
||||
the \fB-itkremind=1\fR option, because it is operated in normal
|
||||
PostScript-producing mode.
|
||||
|
||||
.SH ODDS AND ENDS
|
||||
\fBTkRemind\fR performs some basic consistency checks when you add or
|
||||
preview a reminder. However, if you edit a reminder in the previewer,
|
||||
|
||||
29
token.c
29
token.c
@@ -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++;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
#
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
9
types.h
9
types.h
@@ -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. */
|
||||
|
||||
@@ -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>
|
||||
|
||||
6
utils.c
6
utils.c
@@ -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
6
var.c
@@ -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
|
||||
|
||||
@@ -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.2 1996-03-31 04:08:14 dfs Exp $ */
|
||||
#define VERSION "03.00.14"
|
||||
/* $Id: version.h,v 1.6 1997-03-30 19:07:52 dfs Exp $ */
|
||||
#define VERSION "03.00.17"
|
||||
|
||||
64
www/Makefile
Normal file
64
www/Makefile
Normal 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
50
www/README
Normal 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
18
www/README.rem2html
Normal 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
83
www/cal_dispatch-DIST
Executable 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
30
www/calendar.html-DIST
Normal 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
13
www/calps
Executable 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
27
www/hebdate
Executable 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
179
www/hebdate.rem-DIST
Normal 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
43
www/hebhtml
Executable 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
19
www/hebps
Executable 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
15
www/moon
Executable 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
34
www/moon.rem-DIST
Normal 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
301
www/rem2html
Executable 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
15
www/sunrise
Executable 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
42
www/sunrise.rem-DIST
Executable 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
15
www/sunset
Executable 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
43
www/sunset.rem-DIST
Normal 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>
|
||||
Reference in New Issue
Block a user