mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Compare commits
176 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d1fcb19bf | ||
|
|
7176277ddb | ||
|
|
d9acf28ea5 | ||
|
|
00bbb8b159 | ||
|
|
dbe22e99ee | ||
|
|
361aa04c6d | ||
|
|
7e82b93a84 | ||
|
|
36731d2606 | ||
|
|
2e3ca89e0b | ||
|
|
394c4d0791 | ||
|
|
2bc3d991c1 | ||
|
|
a479ea971d | ||
|
|
075a491847 | ||
|
|
fefaea005b | ||
|
|
c564fa6165 | ||
|
|
0f4d6b5f8b | ||
|
|
55059d60e7 | ||
|
|
d45b590e59 | ||
|
|
76938d27f9 | ||
|
|
e89b5a2d91 | ||
|
|
a9ffc57ce6 | ||
|
|
97fdee4616 | ||
|
|
f9884f3e9d | ||
|
|
87b9dbf36b | ||
|
|
415c49fdb9 | ||
|
|
89cbe86ad9 | ||
|
|
db605a774c | ||
|
|
0e00cf4ee9 | ||
|
|
5bfac19a2e | ||
|
|
ea34bd0950 | ||
|
|
eea301cb53 | ||
|
|
bb62c3a9b4 | ||
|
|
879d31a555 | ||
|
|
104007b8cd | ||
|
|
116f8b805e | ||
|
|
b95b731817 | ||
|
|
365d5285b3 | ||
|
|
0bd4f230d2 | ||
|
|
392b9e7a12 | ||
|
|
f60fc18d1b | ||
|
|
524dcf86be | ||
|
|
a1d634dcb6 | ||
|
|
d88bcf4a33 | ||
|
|
a540d139af | ||
|
|
06a4085aa6 | ||
|
|
225749e6aa | ||
|
|
a169dc02fc | ||
|
|
8cc9b44975 | ||
|
|
5c478cd6c9 | ||
|
|
a2ffdfcc4f | ||
|
|
5ba43e981d | ||
|
|
87c948bb03 | ||
|
|
e4c85b7a49 | ||
|
|
04f6b3223b | ||
|
|
9b3d4281ad | ||
|
|
e0dd960ba6 | ||
|
|
f51e4f0fda | ||
|
|
4a04089285 | ||
|
|
47cb7a4e01 | ||
|
|
904f6f55f5 | ||
|
|
d2e2bf982e | ||
|
|
ab59a2e575 | ||
|
|
e12462630e | ||
|
|
65f62d6012 | ||
|
|
0e6f7f5e35 | ||
|
|
a8e977f8b7 | ||
|
|
8dac9848ee | ||
|
|
e0129313c4 | ||
|
|
85c5dc6d26 | ||
|
|
84a9aa22b4 | ||
|
|
102cbcc181 | ||
|
|
db37d11d52 | ||
|
|
dad6343f1e | ||
|
|
eaecc4d3f4 | ||
|
|
9c1b04b3fe | ||
|
|
f9e28c39f9 | ||
|
|
63983d4f49 | ||
|
|
a39088084e | ||
|
|
5973cb7631 | ||
|
|
9a9da33989 | ||
|
|
8a5df61642 | ||
|
|
6ca72652a3 | ||
|
|
ce1a0c3605 | ||
|
|
920699e17b | ||
|
|
83f24cd94f | ||
|
|
c9aa3000d1 | ||
|
|
08d2a36f2f | ||
|
|
eebe3733fc | ||
|
|
67aab59d19 | ||
|
|
c1e4e42763 | ||
|
|
f3b85cec38 | ||
|
|
dc346f126d | ||
|
|
b565353372 | ||
|
|
b1e70ef272 | ||
|
|
ae072a2fa3 | ||
|
|
39d8fe3523 | ||
|
|
048638cdda | ||
|
|
70ae23809f | ||
|
|
260d66b20f | ||
|
|
4b38ffdf12 | ||
|
|
7ff0315ae9 | ||
|
|
ce5a828896 | ||
|
|
a6686ab4a2 | ||
|
|
55e07e7326 | ||
|
|
3cd69d3cb4 | ||
|
|
8531f8b5b4 | ||
|
|
9a6eef11ea | ||
|
|
ede057e8d1 | ||
|
|
22d3a18116 | ||
|
|
d37d2c08d9 | ||
|
|
49a9dfb0d3 | ||
|
|
69d85c5228 | ||
|
|
6d5ed33b54 | ||
|
|
d380f4571b | ||
|
|
418e9ff265 | ||
|
|
c31b2e1d27 | ||
|
|
38280bed8a | ||
|
|
f4e09f9e96 | ||
|
|
ce88211f50 | ||
|
|
f8d91f559a | ||
|
|
b936e3994b | ||
|
|
bf5a11e1a3 | ||
|
|
0fac20e467 | ||
|
|
0a990f91ee | ||
|
|
c0d14e6d62 | ||
|
|
01455ed0c2 | ||
|
|
727eebfabc | ||
|
|
8841d03fe5 | ||
|
|
4828cfdbf6 | ||
|
|
41310f5a05 | ||
|
|
d3325809ab | ||
|
|
1a538a0112 | ||
|
|
b64ac87881 | ||
|
|
2fe7595d76 | ||
|
|
5a22d20ed4 | ||
|
|
df0bcfc1d2 | ||
|
|
22c169fea8 | ||
|
|
87cfe53b52 | ||
|
|
2db390d2e2 | ||
|
|
f2128d4cb6 | ||
|
|
02a7023040 | ||
|
|
931e7a7b26 | ||
|
|
05b3808e5c | ||
|
|
bc95350f1e | ||
|
|
0ff20006c7 | ||
|
|
1ba2968df8 | ||
|
|
c4fd7e3176 | ||
|
|
e1cf4d5e70 | ||
|
|
31bc3c8aa8 | ||
|
|
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 |
54
ACKNOWLEDGEMENTS
Normal file
54
ACKNOWLEDGEMENTS
Normal file
@@ -0,0 +1,54 @@
|
||||
$Id: ACKNOWLEDGEMENTS,v 1.2 2000-02-18 03:45:11 dfs Exp $
|
||||
|
||||
I would like to thank the following people:
|
||||
|
||||
Bill Aten <netagw!bill@uunet.UU.NET> for providing remind-all.sh
|
||||
|
||||
Bradley D. Keister <keister@poincare.phys.cmu.edu>, Rhys Weatherly
|
||||
rhys@batserver.cs.uq.OZ.AU> and Anthony Cheng for initially providing
|
||||
the Turbo C compiler support.
|
||||
|
||||
Dennis Cottel <dennis@peanuts.nosc.mil> for providing the patch to
|
||||
produce calendars by weeks as well as by months.
|
||||
|
||||
Bill Silvert <bill%biomel@cs.dal.ca> and Dennis Cottel
|
||||
<dennis@peanuts.nosc.mil> for suggesting many of the new features in
|
||||
REMIND.
|
||||
|
||||
Dave Wolfe <dwolfe@pffft.sps.mot.com> and Raphael Manfredi
|
||||
<ram@eiffel.com> for noticing bugs and sending me fixes.
|
||||
|
||||
Dave Rickel and George M. Sipe for sample reminders and holidays.
|
||||
|
||||
Michael Salmon for ISO encoding of PostScript output.
|
||||
|
||||
Darrel Hankerson for helping me provide some OS/2 support. Sorry
|
||||
it's not complete, Darrel!
|
||||
|
||||
Phillipp Slusallek for suggesting the -k option.
|
||||
|
||||
Amos Shapir, David W. Tamkin and Frank Yellin for help with the Hebrew
|
||||
calendar.
|
||||
|
||||
All of the language translators whose names are listed in lang.h
|
||||
|
||||
Mark Harrison and Michael McLennan for the excellent book
|
||||
"Effective Tcl/Tk Programming". This is where I stole the source
|
||||
for Tcl/Tk tabbed notebooks, and is an excellent reference book.
|
||||
Thanks also to Lucent Technologies and Addison Wesley Longman for
|
||||
making it legal to steal the code.
|
||||
|
||||
All others who have corresponded with me to report bugs, express
|
||||
appreciation or suggest features - too many people to list here.
|
||||
|
||||
Finally, all those who donated money to support the production of
|
||||
REMIND. Your donations were gratefully appreciated.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@roaringpenguin.com> <aa775@freenet.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
|
||||
65
COPYRIGHT
65
COPYRIGHT
@@ -1,25 +1,16 @@
|
||||
$Id: COPYRIGHT,v 1.4 1996-10-12 03:13:04 dfs Exp $
|
||||
$Id: COPYRIGHT,v 1.13 2000-03-15 15:51:33 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 1999-2000 Roaring Penguin Software Inc.,
|
||||
except where noted in individual files.
|
||||
|
||||
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, 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:
|
||||
REMIND may be used and distributed according to the terms of the
|
||||
GNU General Public License, Version 2, which follows:
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
@@ -302,56 +293,12 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
ACKNOWLEDGEMENTS:
|
||||
|
||||
I would like to thank the following people:
|
||||
|
||||
Bill Aten <netagw!bill@uunet.UU.NET> for providing remind-all.sh
|
||||
|
||||
Bradley D. Keister <keister@poincare.phys.cmu.edu>, Rhys Weatherly
|
||||
rhys@batserver.cs.uq.OZ.AU> and Anthony Cheng for initially providing
|
||||
the Turbo C compiler support.
|
||||
|
||||
Dennis Cottel <dennis@peanuts.nosc.mil> for providing the patch to
|
||||
produce calendars by weeks as well as by months.
|
||||
|
||||
Bill Silvert <bill%biomel@cs.dal.ca> and Dennis Cottel
|
||||
<dennis@peanuts.nosc.mil> for suggesting many of the new features in
|
||||
REMIND.
|
||||
|
||||
Dave Wolfe <dwolfe@pffft.sps.mot.com> and Raphael Manfredi
|
||||
<ram@eiffel.com> for noticing bugs and sending me fixes.
|
||||
|
||||
Dave Rickel and George M. Sipe for sample reminders and holidays.
|
||||
|
||||
Michael Salmon for ISO encoding of PostScript output.
|
||||
|
||||
Darrel Hankerson for helping me provide some OS/2 support. Sorry
|
||||
it's not complete, Darrel!
|
||||
|
||||
Phillipp Slusallek for suggesting the -k option.
|
||||
|
||||
Amos Shapir, David W. Tamkin and Frank Yellin for help with the Hebrew
|
||||
calendar.
|
||||
|
||||
All of the language translators whose names are listed in lang.h
|
||||
|
||||
Timo Salmi, Keith Petersen, Bill Davidsen and Kent Landfield for
|
||||
maintaining the uwasa and SIMTEL archives, and comp.binaries.ibm.pc
|
||||
and comp.sources.misc in the face of a flurry of updates to REMIND.
|
||||
|
||||
All others who have corresponded with me to report bugs, express
|
||||
appreciation or suggest features - too many people to list here.
|
||||
|
||||
Finally, all those who donated money to support the production of
|
||||
REMIND. Your donations were gratefully appreciated.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca> <aa775@freenet.carleton.ca>
|
||||
David F. Skoll <dfs@roaringpenguin.com>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
http://www.roaringpenguin.com
|
||||
|
||||
|
||||
234
Makefile
234
Makefile
@@ -1,215 +1,33 @@
|
||||
# Makefile for REMIND
|
||||
# $Id: Makefile,v 1.14 1996-10-27 21:28:03 dfs Exp $
|
||||
# Top-level Makefile for Remind.
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# THINGS FOR YOU TO EDIT START BELOW
|
||||
#-----------------------------------------------------------------------------
|
||||
# $Id: Makefile,v 1.28 1998-05-06 01:51:12 dfs Exp $
|
||||
|
||||
# Uncomment the next line if you are running on a SYSV system
|
||||
SYSV= -DSYSV
|
||||
all: src/Makefile
|
||||
@echo ""
|
||||
@echo "*******************"
|
||||
@echo "* *"
|
||||
@echo "* Building REMIND *"
|
||||
@echo "* *"
|
||||
@echo "*******************"
|
||||
@echo ""
|
||||
@cd src; $(MAKE) all LANGDEF=$(LANGDEF)
|
||||
|
||||
# Uncomment the next line if you are running under UNIX (including SYSV!)
|
||||
UNIX= -DUNIX
|
||||
|
||||
# Uncomment the next lines if you want to use gcc instead of default compiler
|
||||
# NOTE: Tempting as it may be, if you use 'cc' for the C compiler, do not
|
||||
# use 'ld' for the linker. It will probably work much better if you use
|
||||
# LD= cc rather than LD= ld.
|
||||
CC= gcc
|
||||
LD= gcc
|
||||
|
||||
# Put any additional flags for the C compiler or linker here - if you
|
||||
# are not using gcc, you probably want to remove '-ansi -pedantic -Wall'.
|
||||
CFLAGS= -O -ansi -pedantic -Wall
|
||||
CDEFS=
|
||||
LDFLAGS=
|
||||
|
||||
#### INSTALLATION LOCATIONS ####
|
||||
# Note that I use 'cp' rather than 'install' for improved portability.
|
||||
#
|
||||
# BINDIR: Where should the Remind executable be installed?
|
||||
BINDIR= /usr/local/bin
|
||||
|
||||
# SCRIPTDIR: Where should the kall and rem shell scripts be installed?
|
||||
SCRIPTDIR= /usr/local/bin
|
||||
|
||||
# MANDIR: Where should the man pages be installed?
|
||||
MANDIR= /usr/local/man
|
||||
|
||||
# MANSECT: Which man section should the man pages go into?
|
||||
MANSECT= 1
|
||||
|
||||
# EXEMODE: What file protection mode should be used for the executables?
|
||||
EXEMODE= 755
|
||||
|
||||
# MANMODE: What file protection mode should be used for the man pages?
|
||||
MANMODE= 644
|
||||
|
||||
# OWNER, GROUP: What owner and group to use for executables,
|
||||
# scripts and man pages?
|
||||
OWNER=bin
|
||||
GROUP=bin
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
|
||||
# in config.h; then, you should be able to type 'make'.
|
||||
#-----------------------------------------------------------------------------
|
||||
VERSION= 03.00.15
|
||||
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
|
||||
|
||||
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
|
||||
|
||||
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h danish.h \
|
||||
polish.h portbr.h italian.h
|
||||
|
||||
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 \
|
||||
utils.c var.c
|
||||
|
||||
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 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 remind.LSM
|
||||
|
||||
OBJS= $(SRCS:.c=.o)
|
||||
|
||||
all: remind rem2ps
|
||||
|
||||
.c.o:
|
||||
$(CC) $(UNIX) $(SYSV) -c $(CFLAGS) $(CDEFS) $*.c
|
||||
|
||||
rem2ps: rem2ps.o
|
||||
$(LD) $(LDFLAGS) -o rem2ps rem2ps.o
|
||||
|
||||
remind: $(OBJS)
|
||||
$(LD) $(LDFLAGS) -o remind $(OBJS) $(MATHLIB)
|
||||
install:
|
||||
@echo ""
|
||||
@echo "*********************"
|
||||
@echo "* *"
|
||||
@echo "* Installing REMIND *"
|
||||
@echo "* *"
|
||||
@echo "*********************"
|
||||
@echo ""
|
||||
cd src; $(MAKE) install
|
||||
|
||||
clean:
|
||||
rm -f *.o *~ core *.bak
|
||||
find . -name '*~' -exec rm {} \;
|
||||
cd src; $(MAKE) clean
|
||||
|
||||
clobber:
|
||||
rm -f *.o *~ remind rem2ps test.out core *.bak
|
||||
distclean: clean
|
||||
rm -f config.cache config.log config.status src/Makefile src/config.h
|
||||
|
||||
test: remind
|
||||
sh test-rem
|
||||
|
||||
rem2ps.o: rem2ps.c rem2ps.h lang.h config.h
|
||||
calendar.o: calendar.c $(STDHDRS) expr.h
|
||||
dorem.o: dorem.c $(STDHDRS) expr.h
|
||||
dosubst.o: dosubst.c $(STDHDRS) $(LANGHDRS)
|
||||
expr.o: expr.c $(STDHDRS) expr.h
|
||||
files.o: files.c $(STDHDRS)
|
||||
funcs.o: funcs.c $(STDHDRS) expr.h version.h
|
||||
globals.o: globals.c config.h types.h globals.h err.h lang.h $(LANGHDRS)
|
||||
hbcal.o: hbcal.c $(STDHDRS)
|
||||
init.o: init.c $(STDHDRS) expr.h version.h lang.h $(LANGHDRS)
|
||||
main.o: main.c $(STDHDRS) expr.h
|
||||
moon.o: moon.c $(STDHDRS)
|
||||
omit.o: omit.c $(STDHDRS)
|
||||
sort.o: sort.c $(STDHDRS)
|
||||
queue.o: queue.c $(STDHDRS)
|
||||
token.o: token.c $(STDHDRS)
|
||||
trigger.o: trigger.c $(STDHDRS) expr.h
|
||||
userfns.o: userfns.c $(STDHDRS) expr.h
|
||||
utils.o: utils.c $(STDHDRS)
|
||||
var.o: var.c $(STDHDRS) expr.h
|
||||
|
||||
# Some of these targets are just for my convenience and
|
||||
# probably won't be too useful to you! -- dfs
|
||||
|
||||
tgz:
|
||||
-rm -rf remind-$(VERSION)
|
||||
-mkdir remind-$(VERSION)
|
||||
cd remind-$(VERSION); for i in $(MANIFEST) ;do ln -s ../$$i .; done; cd ..
|
||||
tar -c -h -v -f remind-3.0.15.tar remind-$(VERSION)
|
||||
gzip -v -9 remind-3.0.15.tar
|
||||
mv remind-3.0.15.tar.gz remind-3.0.15.tgz
|
||||
rm -rf remind-$(VERSION)
|
||||
|
||||
shar:
|
||||
shar -o./Shar -sdfs@doe.carleton.ca -a -c -n"Remind $(VERSION)" -m -l58 -o./Shar $(MANIFEST)
|
||||
|
||||
backup:
|
||||
tar cvzf ../rbackup.tgz $(MANIFEST)
|
||||
|
||||
zip:
|
||||
zip ../rbackup.zip $(MANIFEST)
|
||||
|
||||
todos:
|
||||
rm -rf DOS
|
||||
mkdir DOS
|
||||
for i in $(MANIFEST) ; do todos < $$i > DOS/$$i; done
|
||||
|
||||
transmit:
|
||||
sz -a -e $(MANIFEST)
|
||||
|
||||
install: install-bin install-scripts install-man
|
||||
|
||||
install-bin: remind rem2ps
|
||||
cp remind $(BINDIR)/remind
|
||||
-chmod $(EXEMODE) $(BINDIR)/remind
|
||||
-chown $(OWNER) $(BINDIR)/remind
|
||||
-chgrp $(GROUP) $(BINDIR)/remind
|
||||
cp rem2ps $(BINDIR)/rem2ps
|
||||
-chmod $(EXEMODE) $(BINDIR)/rem2ps
|
||||
-chown $(OWNER) $(BINDIR)/rem2ps
|
||||
-chgrp $(GROUP) $(BINDIR)/rem2ps
|
||||
|
||||
install-scripts:
|
||||
cp kall $(SCRIPTDIR)/kall
|
||||
-chmod $(EXEMODE) $(SCRIPTDIR)/kall
|
||||
-chown $(OWNER) $(SCRIPTDIR)/kall
|
||||
-chgrp $(GROUP) $(SCRIPTDIR)/kall
|
||||
cp rem $(SCRIPTDIR)/rem
|
||||
-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)
|
||||
-chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
|
||||
-chown $(OWNER) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
|
||||
-chgrp $(GROUP) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
|
||||
cp tkremind.1 $(MANDIR)/man$(MANSECT)/tkremind.$(MANSECT)
|
||||
-chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/tkremind.$(MANSECT)
|
||||
-chown $(OWNER) $(MANDIR)/man$(MANSECT)/tkremind.$(MANSECT)
|
||||
-chgrp $(GROUP) $(MANDIR)/man$(MANSECT)/tkremind.$(MANSECT)
|
||||
cp rem.1 $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
|
||||
-chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
|
||||
-chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
|
||||
-chgrp $(GROUP) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
|
||||
cp kall.1 $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
|
||||
-chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
|
||||
-chown $(OWNER) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
|
||||
-chgrp $(GROUP) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
|
||||
cp rem2ps.1 $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
|
||||
-chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
|
||||
-chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
|
||||
-chgrp $(GROUP) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
|
||||
|
||||
release:
|
||||
-mkdir RELEASE
|
||||
-rm -f RELEASE/*
|
||||
mkpatch ../prev . patch.15 Shar "Remind-3.0/Patch-15/part"
|
||||
mv Shar* RELEASE
|
||||
rm -f patch.15*
|
||||
for i in *.1; do nroff -man $$i | sed -e 's/_//g' > `basename $$i .1`.man; done
|
||||
mv *.man RELEASE
|
||||
for i in *.1; do groff -man -Tps $$i > `basename $$i .1`.ps; done
|
||||
mv *.ps RELEASE
|
||||
src/Makefile: src/Makefile.in
|
||||
./configure
|
||||
|
||||
39
README
Normal file
39
README
Normal file
@@ -0,0 +1,39 @@
|
||||
REMIND
|
||||
|
||||
Remind is a full-featured calendar/alarm program. Copying policy is
|
||||
in the file "COPYRIGHT" in this directory.
|
||||
|
||||
Installation notes for various operating systems are in "docs". See
|
||||
the appropriate README file for installation on your system.
|
||||
|
||||
Manual pages are in "man".
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
Quick UNIX installation instructions for the very impatient:
|
||||
|
||||
If you have Tcl/Tk (wish 4.1 or higher) installed and are running X Windows:
|
||||
--------------------------------------------------------------
|
||||
|
||||
1) Type: wish ./build.tk from this directory. Fill in the various
|
||||
options and hit "Build Remind"
|
||||
|
||||
2) Type: "make install" -- you may need to be root to do this.
|
||||
|
||||
If you do NOT have Tcl/Tk or are NOT running X Windows:
|
||||
-------------------------------------------------------
|
||||
|
||||
1) Edit the file "src/custom.h" according to your preferences.
|
||||
|
||||
2) Edit the file "src/lang.h" to choose a language.
|
||||
|
||||
3) Type: "./configure"
|
||||
|
||||
4) Type: "make"
|
||||
|
||||
5) Type: "make install" -- you may need to be root to do this.
|
||||
|
||||
$Id: README,v 1.6 2000-03-13 17:40:38 dfs Exp $
|
||||
|
||||
Contact info: mailto:dfs@roaringpenguin.com
|
||||
Home page: http://www.roaringpenguin.com/remind.html
|
||||
57
README.AMIGA
57
README.AMIGA
@@ -1,57 +0,0 @@
|
||||
$Id: README.AMIGA,v 1.1 1996-03-31 04:01:52 dfs Exp $
|
||||
REMIND version 3.0 for AmigaDOS
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
|
||||
1 - Read the file COPYRIGHT.
|
||||
|
||||
2 - Examine the file config.h and adjust parameters as needed
|
||||
|
||||
3 - If you are using SAS/C to compile Remind, type:
|
||||
|
||||
copy amiga-SCOPTIONS SCOPTIONS
|
||||
smake -f smakefile
|
||||
|
||||
This will create remind, which is ready to be executed.
|
||||
|
||||
The file "defs.rem" has some sample Remind definitions and commands,
|
||||
as well as U.S. and Jewish holidays.
|
||||
|
||||
OTHER LANGUAGE SUPPORT
|
||||
|
||||
Remind has support for languages other than English. See the file
|
||||
"lang.h" for details. The language support may vary - you can change
|
||||
only the substitution filter, or you can translate all of the usage
|
||||
instructions and error messages as well. See "french.h" for an example.
|
||||
|
||||
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
|
||||
Remind scripts.
|
||||
|
||||
At a minimum, you should support month and day names in the foreign
|
||||
language, and should modify the substitution filter appropriately.
|
||||
If you are truly diligent, you can translate usage and error messages
|
||||
too.
|
||||
|
||||
Take a look at the files "english.h" and "german.h" if you want to add
|
||||
support for your favourite language. If you do add another language
|
||||
to Remind, please let me know! Here are the basic guidelines:
|
||||
|
||||
- Your language file should be called "lxxx.h", where lxxx is the first 8
|
||||
characters of the ENGLISH name of your language.
|
||||
|
||||
- You should define L_LANGNAME to be the full English name of your language,
|
||||
with the first letter capitalized and the rest lower-case.
|
||||
|
||||
[Please note: I CANNOT SUPPORT THE AMIGA VERSION!]
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
|
||||
65
README.BCC
65
README.BCC
@@ -1,65 +0,0 @@
|
||||
$Id: README.BCC,v 1.1 1996-03-27 03:25:48 dfs Exp $
|
||||
REMIND version 3.0 for Borland C++
|
||||
|
||||
1 - Read the file COPYRIGHT. (This may be called COPYRIGH on your
|
||||
MS-DOS system.)
|
||||
|
||||
2 - You must use the Borland C++ OS/2 or MSDOS/Windows compiler.
|
||||
|
||||
3 - Examine the file config.h and adjust parameters as needed
|
||||
|
||||
4 - Examine the file makefile.bcc and adjust parameters as needed.
|
||||
|
||||
5 - Type:
|
||||
|
||||
make -f makefile.bcc
|
||||
|
||||
This will make 'remind.exe' and 'rem2ps.exe' in the ..\os2-ex or ..\msdos-ex
|
||||
directories.
|
||||
|
||||
The file "defs.rem" has some sample Remind definitions and commands,
|
||||
as well as U.S. and Jewish holidays.
|
||||
|
||||
NOTE that I do not have access to an OS/2 system, so support for this
|
||||
system may not be as good as I'd like.
|
||||
|
||||
OS/2 support is courtesy of Russ Herman <rwh@gov.on.ca>, Norman Walsh
|
||||
<norm@ora.com>, and Darrel Hankerson <hankedr@mail.auburn.edu>.
|
||||
However, if you have problems, please contact me.
|
||||
|
||||
OTHER LANGUAGE SUPPORT
|
||||
|
||||
Remind has support for languages other than English. See the file
|
||||
"lang.h" for details. The language support may vary - you can change
|
||||
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.
|
||||
|
||||
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
|
||||
Remind scripts.
|
||||
|
||||
At a minimum, you should support month and day names in the foreign
|
||||
language, and should modify the substitution filter appropriately.
|
||||
If you are truly diligent, you can translate usage and error messages
|
||||
too.
|
||||
|
||||
Take a look at the files "english.h" and "german.h" if you want to add
|
||||
support for your favourite language. If you do add another language
|
||||
to Remind, please let me know! Here are the basic guidelines:
|
||||
|
||||
- Your language file should be called "lxxx.h", where lxxx is the first 8
|
||||
characters of the ENGLISH name of your language.
|
||||
|
||||
- You should define L_LANGNAME to be the full English name of your language,
|
||||
with the first letter capitalized and the rest lower-case.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
|
||||
62
README.DOS
62
README.DOS
@@ -1,62 +0,0 @@
|
||||
$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".
|
||||
|
||||
1 - Read the file COPYRIGHT. (This may be called COPYRIGH on your
|
||||
MS-DOS system.)
|
||||
|
||||
2 - Examine the file config.h and adjust parameters as needed
|
||||
|
||||
3 - If you are using Turbo C to compile Remind, type:
|
||||
|
||||
make -fmakefile.tc
|
||||
|
||||
If you are using Microsoft C to compile Remind, type:
|
||||
|
||||
make makefile.msc
|
||||
|
||||
This will create REMIND.EXE, which is ready to be executed.
|
||||
|
||||
The file "defs.rem" has some sample Remind definitions and commands,
|
||||
as well as U.S. and Jewish holidays.
|
||||
|
||||
OTHER LANGUAGE SUPPORT
|
||||
|
||||
Remind has support for languages other than English. See the file
|
||||
"lang.h" for details. The language support may vary - you can change
|
||||
only the substitution filter, or you can translate all of the usage
|
||||
instructions and error messages as well. See "french.h" for an example.
|
||||
|
||||
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
|
||||
Remind scripts.
|
||||
|
||||
At a minimum, you should support month and day names in the foreign
|
||||
language, and should modify the substitution filter appropriately.
|
||||
If you are truly diligent, you can translate usage and error messages
|
||||
too.
|
||||
|
||||
Take a look at the files "english.h" and "german.h" if you want to add
|
||||
support for your favourite language. If you do add another language
|
||||
to Remind, please let me know! Here are the basic guidelines:
|
||||
|
||||
- Your language file should be called "lxxx.h", where lxxx is the first 8
|
||||
characters of the ENGLISH name of your language.
|
||||
|
||||
- You should define L_LANGNAME to be the full English name of your language,
|
||||
with the first letter capitalized and the rest lower-case.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
|
||||
147
README.UNIX
147
README.UNIX
@@ -1,147 +0,0 @@
|
||||
$Id: README.UNIX,v 1.2 1996-10-12 02:59:06 dfs Exp $
|
||||
REMIND version 3.0 for UNIX
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
|
||||
1 - Read the file COPYRIGHT.
|
||||
|
||||
2- Before compiling the software, check to see if it includes patches.
|
||||
These are files called patch.xx. If there are patches, apply them all
|
||||
by typing:
|
||||
|
||||
cat patch.* | patch
|
||||
|
||||
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
|
||||
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'
|
||||
|
||||
7 - Type 'sh test-rem' or 'make test' to run the acceptance test. Note
|
||||
that the test script works only for the English version of Remind.
|
||||
|
||||
8 - Type 'make install' to install Remind, kall, rem and the man
|
||||
pages.
|
||||
|
||||
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
|
||||
"sh" script and the other is a "csh" script. Pick the one you want to
|
||||
use, and follow the instructions in the opening comments of the
|
||||
script.
|
||||
|
||||
*** NOTE *** Please be aware that "remind-all.csh" and "remind-all.sh"
|
||||
have been changed since version 03.00.05 of Remind. If you install
|
||||
the new remind executable, make sure you switch over to the new
|
||||
"remind-all" scripts.
|
||||
|
||||
A shell script called "rem" is provided for those who like to have
|
||||
'remind' assume a default reminders file. A man page for this script
|
||||
is provided. You should examine the script to ensure that the defaults
|
||||
are correct.
|
||||
|
||||
Many people have asked me why I supply the "rem" script instead of
|
||||
having Remind assume a default file. The answer is: That's how I like
|
||||
it! My personal preference is for a program which normally takes
|
||||
parameters to display usage information when invoked with no
|
||||
parameters. I like that behaviour so I can quickly get an idea of
|
||||
what a program does without poring through the man page. And I think
|
||||
I'll keep Remind that way. Sorry to all who dislike it. :-)
|
||||
|
||||
A shell script called "kall" is provided so you can kill your background
|
||||
remind processes when you log out. See the man page. Note that kall
|
||||
depends on the output of "ps", and may not be portable.
|
||||
|
||||
The file "defs.rem" has some sample Remind definitions and commands,
|
||||
as well as U.S. and Jewish holidays.
|
||||
|
||||
OTHER LANGUAGE SUPPORT
|
||||
|
||||
Remind has support for languages other than English. See the file
|
||||
"lang.h" for details. The language support may vary - you can change
|
||||
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
|
||||
Remind scripts.
|
||||
|
||||
At a minimum, you should support month and day names in the foreign
|
||||
language, and should modify the substitution filter appropriately.
|
||||
If you are truly diligent, you can translate usage and error messages
|
||||
too.
|
||||
|
||||
Take a look at the files "english.h" and "german.h" if you want to add
|
||||
support for your favourite language. If you do add another language
|
||||
to Remind, please let me know! Here are the basic guidelines:
|
||||
|
||||
- Your language file should be called "lxxx.h", where lxxx is the first 8
|
||||
characters of the ENGLISH name of your language.
|
||||
|
||||
- Your language file should define L_LANGNAME to be the full English
|
||||
name of your language, with the first letter capitalized and the rest
|
||||
lower-case.
|
||||
|
||||
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
||||
|
||||
1. POPUP REMINDERS
|
||||
|
||||
If you're running under X-Windows and you have the TCL tools,
|
||||
you can create simple pop-up reminders by creating the following
|
||||
TCL script called 'popup'. It pops a message on to the screen and
|
||||
waits for you to press the 'OK' button. If you don't press the OK button
|
||||
within 15 seconds, it exits anyway. To use it, you can use the '-k' option
|
||||
for Remind as follows:
|
||||
|
||||
remind "-kpopup '%s'&" .reminders
|
||||
|
||||
Or use the following in your Remind script:
|
||||
|
||||
REM AT 17:00 RUN popup 'Time to go home.' &
|
||||
|
||||
This TCL script is a slightly modified version of one submitted by
|
||||
Norman Walsh. TCL is available via FTP at ftp.uu.net in /languages/tcl.
|
||||
|
||||
-------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
|
||||
#!/usr/local/bin/wish -f
|
||||
|
||||
wm withdraw .
|
||||
|
||||
if { [ llength $argv ] == 1 } {
|
||||
eval set msg $argv
|
||||
} else {
|
||||
eval set msg [ list $argv ]
|
||||
}
|
||||
|
||||
after 15000 { destroy . ; exit }
|
||||
|
||||
tk_dialog .d { Message } $msg warning 0 { OK }
|
||||
|
||||
destroy .
|
||||
|
||||
exit
|
||||
-------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
|
||||
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
95
README_QDOS
95
README_QDOS
@@ -1,95 +0,0 @@
|
||||
$Id: README_QDOS,v 1.3 1996-09-28 18:17:07 dfs Exp $
|
||||
REMIND version 3.0.15 for QDOS / SMSQ
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the documentation file, "remind_doc" (QUILL format).
|
||||
[Note from David Skoll -- I was not sent the file `remind_doc', so
|
||||
you're on your own here. You'll have to use the UNIX man pages.]
|
||||
|
||||
1 - Read the file COPYRIGHT.
|
||||
|
||||
2 - Do NOT redistribute Remind WITHOUT the sources!
|
||||
|
||||
3 - Examine the Makefile and change any parameters which need to be
|
||||
changed for your system. (The makefile for QDOS / SMSQ is
|
||||
makefile_QDOS).
|
||||
|
||||
4 - Examine the file config_h and adjust parameters as needed
|
||||
|
||||
5 - Examine lang_h and choose the language you want Remind to use.
|
||||
There has no effort been put in making the language modules working
|
||||
on the QL. You'll have to adjust the files for yourself to get
|
||||
them working (umlauts etc).
|
||||
|
||||
6 - Execute "make;'-fMakefile_QDOS'". Be sure, that your DATA_DEFAULT
|
||||
directory is the directory where the remind source files are
|
||||
placed.
|
||||
|
||||
7 - There is an acceptance test for other systems. If you want to
|
||||
test remind on your QDOS / SMSQ system execute the following
|
||||
commands from your command line:
|
||||
SETENV "TEST_GETENV=foo bar baz"
|
||||
ex datad$&'remind';'-e -dxte test_rem 16 feb 1991 > test_out'
|
||||
ex diff;'test_out test_cmp >test_diff'
|
||||
Then check the output of diff. You will find lots of differences.
|
||||
If there are other than differences in the filename
|
||||
(supplied test-result: ./test.rem, QDOS result: test_rem) and
|
||||
in the ostype (supplied: UNIX, QDOS: QDOS / SMSQ) Remind does
|
||||
not work correctly.
|
||||
|
||||
|
||||
The file "defs_rem" has some sample Remind definitions and commands,
|
||||
as well as U.S. and Jewish holidays. You should delete the definitions
|
||||
for ANSI colours as the QL does not support the ANSI standard.
|
||||
|
||||
|
||||
OTHER LANGUAGE SUPPORT
|
||||
|
||||
Remind has support for languages other than English. See the file
|
||||
"lang_h" for details. The language support may vary - you can change
|
||||
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.
|
||||
|
||||
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
|
||||
Remind scripts.
|
||||
|
||||
At a minimum, you should support month and day names in the foreign
|
||||
language, and should modify the substitution filter appropriately.
|
||||
If you are truly diligent, you can translate usage and error messages
|
||||
too.
|
||||
|
||||
Take a look at the files "english_h" and "german_h" if you want to add
|
||||
support for your favourite language. If you do add another language
|
||||
to Remind, please let me know! Here are the basic guidelines:
|
||||
|
||||
- Your language file should be called "lxxx_h", where lxxx is the first 8
|
||||
characters of the ENGLISH name of your language.
|
||||
|
||||
- Your language file should define L_LANGNAME to be the full English
|
||||
name of your language, with the first letter capitalized and the rest
|
||||
lower-case.
|
||||
|
||||
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
||||
|
||||
The QDOS / SMSQ version does not support the enhanced features of
|
||||
the UNIX and/or OS/2 versions.
|
||||
|
||||
I had some problems with the sunrise() and sunset() functions,
|
||||
but didn't examine it.
|
||||
|
||||
I've ported Remind on a SMSQ/SGC system. It should work on other
|
||||
systems without problems. The compiler used was C68 v4.14c.
|
||||
|
||||
Remind should work with each QL or compatible with 512K or more RAM.
|
||||
It'll however NOT work on a standard QL due to it's code size.
|
||||
|
||||
Any problems with the QDOS / SMSQ versions should be sent to:
|
||||
|
||||
Robert H. Klein
|
||||
Bluecherstrasse 24
|
||||
D-56349 Kaub
|
||||
|
||||
Germany
|
||||
17
WINDOWS
Normal file
17
WINDOWS
Normal file
@@ -0,0 +1,17 @@
|
||||
$Id: WINDOWS,v 1.1 1999-04-05 17:34:28 dfs Exp $
|
||||
|
||||
MICROSOFT WINDOWS
|
||||
|
||||
I used to prohibit porting Remind to Microsoft Windows. However, this
|
||||
may cause problems with the GPL, so I have removed that restriction.
|
||||
|
||||
Although I cannot prevent you from porting Remind to Windows, I appeal
|
||||
to you not to do it. I am trying to encourage the growth of free
|
||||
software, not proprietary software.
|
||||
|
||||
If you port Remind to Windows, I will not provide support or answers to
|
||||
questions -- you're on your own. On the other hand, I will feel no guilt
|
||||
in taking enhancements and merging them into the UNIX stream.
|
||||
|
||||
--
|
||||
David F. Skoll.
|
||||
50
configure.in
Normal file
50
configure.in
Normal file
@@ -0,0 +1,50 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl $Id: configure.in,v 1.8 2000-03-15 16:05:19 dfs Exp $
|
||||
|
||||
AC_INIT(src/queue.c)
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
**********************
|
||||
* *
|
||||
* Configuring REMIND *
|
||||
* *
|
||||
**********************
|
||||
|
||||
EOF
|
||||
|
||||
AC_CONFIG_HEADER(src/config.h)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
dnl Checks for libraries.
|
||||
dnl Replace `main' with a function in -lm:
|
||||
|
||||
AC_CHECK_LIB(m, sqrt)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(sys/file.h sys/select.h sys/time.h sys/types.h unistd.h malloc.h stdarg.h stdlib.h pwd.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_STRUCT_TM
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_TYPE_SIGNAL
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_UID_T
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_HEADER_TIME
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(mktime putenv strstr timegm difftime)
|
||||
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
|
||||
fi
|
||||
|
||||
AC_OUTPUT(src/Makefile)
|
||||
34
docs/README.AMIGA
Normal file
34
docs/README.AMIGA
Normal file
@@ -0,0 +1,34 @@
|
||||
$Id: README.AMIGA,v 1.3 2000-02-18 03:45:29 dfs Exp $
|
||||
REMIND version 3.0 for AmigaDOS
|
||||
|
||||
I DO NOT SUPPORT REMIND ON AmigaDOS. THE AmigaDOS PORT HAS NOT BEEN MAINTAINED
|
||||
FOR QUITE A WHILE.
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
|
||||
1 - Read the file COPYRIGHT.
|
||||
|
||||
2 - cd src; examine the files config.h and custom.h and adjust parameters
|
||||
as needed
|
||||
|
||||
3 - If you are using SAS/C to compile Remind, type:
|
||||
|
||||
copy amiga-SCOPTIONS SCOPTIONS
|
||||
smake -f smakefile
|
||||
|
||||
This will create remind, which is ready to be executed.
|
||||
|
||||
[Please note: I CANNOT SUPPORT THE AMIGA VERSION!]
|
||||
|
||||
See README.UNIX for more info.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@roaringpenguin.com>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
http://www.roaringpenguin.com/remind.html
|
||||
|
||||
33
docs/README.BCC
Normal file
33
docs/README.BCC
Normal file
@@ -0,0 +1,33 @@
|
||||
$Id: README.BCC,v 1.3 2000-02-18 03:45:30 dfs Exp $
|
||||
REMIND version 3.0 for Borland C++
|
||||
|
||||
IMPORTANT NOTE: BCC SUPPORT MAY BE BROKEN. I DON'T CARE. I'M NOT
|
||||
MAINTAINING IT ANY LONGER.
|
||||
|
||||
1 - Read the file COPYRIGHT. (This may be called COPYRIGH on your
|
||||
MS-DOS system.)
|
||||
|
||||
2 - You must use the Borland C++ OS/2 or MSDOS/Windows compiler.
|
||||
|
||||
3 - cd src; examine the files custom.h and config.h and adjust
|
||||
parameters as needed
|
||||
|
||||
4 - Examine the file makefile.bcc and adjust parameters as needed.
|
||||
|
||||
5 - Type:
|
||||
|
||||
make -f makefile.bcc
|
||||
|
||||
This will make 'remind.exe' and 'rem2ps.exe' in the ..\os2-ex or ..\msdos-ex
|
||||
directories.
|
||||
|
||||
See README.UNIX for more info.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@roaringpenguin.com>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
http://www.roaringpenguin.com/remind.html
|
||||
38
docs/README.DOS
Normal file
38
docs/README.DOS
Normal file
@@ -0,0 +1,38 @@
|
||||
$Id: README.DOS,v 1.3 2000-02-18 03:45:31 dfs Exp $
|
||||
REMIND version 3.0 for MS-DOS
|
||||
|
||||
IMPORTANT NOTE: DOS SUPPORT MAY BE BROKEN. I DON'T CARE. I NO LONGER
|
||||
MAINTAIN THE DOS VERSION.
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
|
||||
1 - Read the file COPYRIGHT. (This may be called COPYRIGH on your
|
||||
MS-DOS system.)
|
||||
|
||||
2 - cd src; examine the files custom.h and config.h and adjust parameters
|
||||
as needed
|
||||
|
||||
3 - If you are using Turbo C to compile Remind, type:
|
||||
|
||||
make -fmakefile.tc
|
||||
|
||||
If you are using Microsoft C to compile Remind, type:
|
||||
|
||||
make makefile.msc
|
||||
|
||||
This will create REMIND.EXE, which is ready to be executed.
|
||||
|
||||
The file "defs.rem" has some sample Remind definitions and commands,
|
||||
as well as U.S. and Jewish holidays.
|
||||
|
||||
See README.UNIX for more info.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@roaringpenguin.com>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
http://www.roaringpenguin.com/remind.html
|
||||
@@ -1,6 +1,9 @@
|
||||
$Id: README.OS2,v 1.1 1996-03-27 03:25:49 dfs Exp $
|
||||
$Id: README.OS2,v 1.3 2000-02-18 03:45:32 dfs Exp $
|
||||
REMIND version 3.0 for OS/2
|
||||
|
||||
I DO NOT SUPPORT REMIND ON OS/2. THE OS/2 PORT HAS NOT BEEN MAINTAINED
|
||||
FOR QUITE A WHILE.
|
||||
|
||||
This file contains instructions for compiling Remind under OS/2 with
|
||||
Eberhard Mattes' emx/gcc compiler and with the Microsoft C compiler.
|
||||
There are a number of targets in Makefile.os2, including OS/2-only
|
||||
@@ -19,7 +22,8 @@ in the man page, "remind.1".
|
||||
or emx/gcc. You must also have a decent version of 'make', such
|
||||
as dmake or GNU make.
|
||||
|
||||
3 - Examine the file config.h and adjust parameters as needed
|
||||
3 - Change to "src" directory and examine the files config.h and custom.h
|
||||
and adjust parameters as needed.
|
||||
|
||||
4 - Examine the file Makefile.os2 and adjust parameters as needed.
|
||||
|
||||
@@ -33,9 +37,6 @@ to see a list of targets. For example,
|
||||
|
||||
will build a 32-bit emx version which runs under OS/2 2.x and DOS.
|
||||
|
||||
The file "defs.rem" has some sample Remind definitions and commands,
|
||||
as well as U.S. and Jewish holidays.
|
||||
|
||||
NOTE that I do not have access to an OS/2 system, so support for this
|
||||
system may not be as good as I'd like.
|
||||
|
||||
@@ -43,34 +44,6 @@ OS/2 support is courtesy of Russ Herman <rwh@gov.on.ca>, Norman Walsh
|
||||
<norm@ora.com>, and Darrel Hankerson <hankedr@mail.auburn.edu>.
|
||||
However, if you have problems, please contact me.
|
||||
|
||||
OTHER LANGUAGE SUPPORT
|
||||
|
||||
Remind has support for languages other than English. See the file
|
||||
"lang.h" for details. The language support may vary - you can change
|
||||
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.
|
||||
|
||||
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
|
||||
Remind scripts.
|
||||
|
||||
At a minimum, you should support month and day names in the foreign
|
||||
language, and should modify the substitution filter appropriately.
|
||||
If you are truly diligent, you can translate usage and error messages
|
||||
too.
|
||||
|
||||
Take a look at the files "english.h" and "german.h" if you want to add
|
||||
support for your favourite language. If you do add another language
|
||||
to Remind, please let me know! Here are the basic guidelines:
|
||||
|
||||
- Your language file should be called "lxxx.h", where lxxx is the first 8
|
||||
characters of the ENGLISH name of your language.
|
||||
|
||||
- You should define L_LANGNAME to be the full English name of your language,
|
||||
with the first letter capitalized and the rest lower-case.
|
||||
|
||||
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
||||
|
||||
1. POPUP REMINDERS
|
||||
@@ -127,11 +100,15 @@ CLEANUP:
|
||||
exit
|
||||
-------------- Cut Here ---------- Cut Here ---------- Cut Here --------
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
See README.UNIX for some more information about Remind.
|
||||
|
||||
David F. Skoll <dfs@roaringpenguin.com>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
http://www.roaringpenguin.com/remind.html
|
||||
|
||||
|
||||
|
||||
134
docs/README.UNIX
Normal file
134
docs/README.UNIX
Normal file
@@ -0,0 +1,134 @@
|
||||
$Id: README.UNIX,v 1.5 2000-02-18 03:45:33 dfs Exp $
|
||||
REMIND version 3.0 for UNIX
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
|
||||
INSTALLING REMIND:
|
||||
-----------------
|
||||
|
||||
If you have Tcl/Tk (wish 4.1 or higher) installed and are running X Windows:
|
||||
--------------------------------------------------------------
|
||||
|
||||
1) Type: wish ./build.tk from the top-level Remind directory.
|
||||
Fill in the various options and hit "Build Remind"
|
||||
|
||||
2) Type: "make install" -- you may need to be root to do this.
|
||||
|
||||
If you do NOT have Tcl/Tk or are NOT running X Windows:
|
||||
-------------------------------------------------------
|
||||
|
||||
1) Edit the file "src/custom.h" according to your preferences.
|
||||
|
||||
2) Edit the file "src/lang.h" to choose a language.
|
||||
|
||||
3) Type: "make"
|
||||
|
||||
4) Type: "make install" -- you may need to be root to do this.
|
||||
|
||||
The subdirectory "www" contains scripts for making a nice calendar
|
||||
web server. See the files README and Makefile in that directory.
|
||||
|
||||
Two shell scripts, "scripts/remind-all.csh" and
|
||||
"scripts/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 "sh" script and the other is a "csh"
|
||||
script. Pick the one you want to use, and follow the instructions in
|
||||
the opening comments of the script.
|
||||
|
||||
A shell script called "scripts/rem" is provided for those who like to have
|
||||
'remind' assume a default reminders file. A man page for this script
|
||||
is provided. You should examine the script to ensure that the defaults
|
||||
are correct.
|
||||
|
||||
Many people have asked me why I supply the "rem" script instead of
|
||||
having Remind assume a default file. The answer is: That's how I like
|
||||
it! My personal preference is for a program which normally takes
|
||||
parameters to display usage information when invoked with no
|
||||
parameters. I like that behaviour so I can quickly get an idea of
|
||||
what a program does without poring through the man page. And I think
|
||||
I'll keep Remind that way. Sorry to all who dislike it. :-)
|
||||
|
||||
A shell script called "scripts/kall" is provided so you can kill your
|
||||
background remind processes when you log out. See the man page. Note
|
||||
that kall depends on the output of "ps", and may not be portable.
|
||||
|
||||
The file "examples/defs.rem" has some sample Remind definitions and
|
||||
commands, as well as U.S. and Jewish holidays.
|
||||
|
||||
OTHER LANGUAGE SUPPORT
|
||||
|
||||
Remind has support for languages other than English. See the file
|
||||
"src/lang.h" for details. The language support may vary - you can change
|
||||
only the substitution filter, or you can translate all of the usage
|
||||
instructions and error messages as well. See "src/langs/french.h" for an
|
||||
example of the latter.
|
||||
|
||||
To compile Remind for a non-english language, look at the constants
|
||||
defined in "src/lang.h". Then, to compile Remind for Italian (as an
|
||||
example), type:
|
||||
|
||||
make "LANGDEF=-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
|
||||
Remind scripts.
|
||||
|
||||
At a minimum, you should support month and day names in the foreign
|
||||
language, and should modify the substitution filter appropriately.
|
||||
If you are truly diligent, you can translate usage and error messages
|
||||
too.
|
||||
|
||||
Take a look at the files "src/langs/english.h" and
|
||||
"src/langs/german.h" if you want to add support for your favourite
|
||||
language. If you do add another language to Remind, please let me
|
||||
know! Here are the basic guidelines:
|
||||
|
||||
- Your language file should be called "src/langs/lxxx.h", where lxxx
|
||||
is the first 8 characters of the ENGLISH name of your language.
|
||||
|
||||
- Your language file should define L_LANGNAME to be the full English
|
||||
name of your language, with the first letter capitalized and the rest
|
||||
lower-case.
|
||||
|
||||
- You can test your language file with the script "tests/tstlang.rem"
|
||||
|
||||
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
||||
|
||||
1. POPUP REMINDERS
|
||||
|
||||
If you're running under X-Windows and you have the TCL tools,
|
||||
you can create simple pop-up reminders by creating the following
|
||||
TCL script called 'popup'. It pops a message on to the screen and
|
||||
waits for you to press the 'OK' button. If you don't press the OK button
|
||||
within 15 seconds, it exits anyway. To use it, you can use the '-k' option
|
||||
for Remind as follows:
|
||||
|
||||
remind "-kpopup '%s'&" .reminders
|
||||
|
||||
Or use the following in your Remind script:
|
||||
|
||||
REM AT 17:00 RUN popup 'Time to go home.' &
|
||||
|
||||
This Tcl script is a slightly modified version of one submitted by
|
||||
Norman Walsh.
|
||||
|
||||
-------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
|
||||
#!/usr/local/bin/wish
|
||||
wm withdraw .
|
||||
after 15000 { destroy . ; exit }
|
||||
tk_dialog .d { Message } $argv warning 0 { OK }
|
||||
destroy .
|
||||
exit
|
||||
-------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
|
||||
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@roaringpenguin.com>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
http://www.roaringpenguin.com/remind.html
|
||||
53
docs/README_QDOS
Normal file
53
docs/README_QDOS
Normal file
@@ -0,0 +1,53 @@
|
||||
$Id: README_QDOS,v 1.4 2000-02-18 03:45:34 dfs Exp $
|
||||
REMIND version 3.0.19 for QDOS / SMSQ
|
||||
|
||||
I DO NOT SUPPORT REMIND ON QDOS. THE QDOS PORT HAS NOT BEEN MAINTAINED
|
||||
FOR QUITE A WHILE.
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the documentation file, "remind_doc" (QUILL format).
|
||||
[Note from David Skoll -- I was not sent the file `remind_doc', so
|
||||
you're on your own here. You'll have to use the UNIX man pages.]
|
||||
|
||||
1 - Read the file COPYRIGHT.
|
||||
|
||||
2 - Change to the directory "src"
|
||||
|
||||
3 - Examine the Makefile and change any parameters which need to be
|
||||
changed for your system. (The makefile for QDOS / SMSQ is
|
||||
makefile_QDOS).
|
||||
|
||||
4 - Examine the files config_h and custom_h and adjust parameters as needed
|
||||
|
||||
5 - Examine lang_h and choose the language you want Remind to use.
|
||||
There has no effort been put in making the language modules working
|
||||
on the QL. You'll have to adjust the files for yourself to get
|
||||
them working (umlauts etc).
|
||||
|
||||
6 - Execute "make;'-fMakefile_QDOS'". Be sure, that your DATA_DEFAULT
|
||||
directory is the directory where the remind source files are
|
||||
placed.
|
||||
|
||||
See README.UNIX for some more information about Remind.
|
||||
|
||||
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
||||
|
||||
The QDOS / SMSQ version does not support the enhanced features of
|
||||
the UNIX and/or OS/2 versions.
|
||||
|
||||
I had some problems with the sunrise() and sunset() functions,
|
||||
but didn't examine it.
|
||||
|
||||
I've ported Remind on a SMSQ/SGC system. It should work on other
|
||||
systems without problems. The compiler used was C68 v4.14c.
|
||||
|
||||
Remind should work with each QL or compatible with 512K or more RAM.
|
||||
It'll however NOT work on a standard QL due to it's code size.
|
||||
|
||||
Any problems with the QDOS / SMSQ versions should be sent to:
|
||||
|
||||
Robert H. Klein
|
||||
Bluecherstrasse 24
|
||||
D-56349 Kaub
|
||||
|
||||
Germany
|
||||
@@ -1,5 +1,240 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* Version 3.0 Patch 21
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Updated copyright years and contact info.
|
||||
|
||||
- Changed GIF images to PNG to avoid patent problems.
|
||||
|
||||
- Added "cm2trem.tcl" to convert from CDE's "cm" calendar manager to Remind
|
||||
format. It handles only an older version of "cm" data; there is a utility
|
||||
available (under Solaris anyway) to convert newer files to the older "cm"
|
||||
format.
|
||||
|
||||
- Fixed the scripts in the "www" directory to install and work properly.
|
||||
|
||||
- Added "remind.vim" file for Vim syntax highlighting of Remind files,
|
||||
thanks to Davide Alberani.
|
||||
|
||||
- Added "dusk" and "dawn" built-in functions, thanks to Ron Aaron.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Files for no-longer-supported platforms (OS/2, amiga, MS-DOS) have been
|
||||
moved to OBSOLETE subdirectory. They will disappear unless someone
|
||||
wants to maintain them.
|
||||
|
||||
- Fixed typo which caused compilation failure on compilers without function
|
||||
prototypes. Thanks to Ian Darwin for the patch.
|
||||
|
||||
- Fixed compilation problem on FreeBSD, IRIX, Tru64 and other UNIXes.
|
||||
|
||||
* Version 3.0 Patch 20
|
||||
|
||||
+ NEWS
|
||||
|
||||
- I have started a company, Roaring Penguin Software
|
||||
Inc. (http://www.roaringpenguin.com) and it now holds the Remind copyright.
|
||||
|
||||
+ LICENSE CHANGE
|
||||
|
||||
- Remind is now distributed under the pure GPL. See the file WINDOWS for my
|
||||
feelings about a Windows port, however.
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Made TkRemind adjust for really low-resolution displays if necessary.
|
||||
|
||||
- Added more print options to TkRemind, courtesy of Niels Kristian Bech Jensen.
|
||||
|
||||
- Added Spanish language support, courtesy of Rafa Couto.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Changed copyright notices to Roaring Penguin Software Inc.
|
||||
|
||||
- Rem2PS was passing specials like HTML, etc. in PostScript output.
|
||||
YECH! Fix courtesty of Derek J. Decker.
|
||||
|
||||
- Fixed a typo in danish.h, courtesy of Niels Kristian Bech Jensen.
|
||||
|
||||
* Version 3.0 Patch 19
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
- Added MOON and SHADE specials. These now work with PostScript,
|
||||
HTML and Tcl/Tk front-ends. You can have cute moons and shaded
|
||||
boxes on your printer, on your screen and in your web browser. :-)
|
||||
|
||||
- TkRemind overhauled -- you can now edit and delete reminders from
|
||||
the GUI. You can actually reasonably use Remind without learning
|
||||
the scripting language.
|
||||
|
||||
- TkRemind overhauled -- "server mode" added to Remind; TkRemind will
|
||||
now pop up timed reminders.
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Updated romanian.h, courtesy Liviu Daia.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Allowed object files to be built in different directory from
|
||||
source files (thanks to Jonathan Kamens <jik@American.COM>
|
||||
|
||||
- Removed restriction against reading group-writable files. This
|
||||
caused headaches on Red Hat Linux which uses an unusual user/group
|
||||
scheme.
|
||||
|
||||
- Remind would not compile if a non-English language was selected.
|
||||
|
||||
- Fixed free() of a NULL pointer.
|
||||
|
||||
- Made tkremind display a helpful error message if Remind's
|
||||
"security feature" of not reading a group-writable file kicks
|
||||
in.
|
||||
|
||||
- Fixed bug which sometimes prevented reminder times from appearing
|
||||
in a calendar display.
|
||||
|
||||
- Lots more silly little bugs squashed -- too many to go into in
|
||||
detail.
|
||||
|
||||
* Version 3.0 Patch 18
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
- Added the script "build.tk" which makes it trivial to compile
|
||||
and install Remind under UNIX -- no need to edit Makefiles or
|
||||
header files. A nice GUI installation dialog!
|
||||
|
||||
- Got rid of all fixed-size buffers. Hurray! Everything is dynamic --
|
||||
no built-in limits on line length, token size, etc. This should
|
||||
cure lots of SEGV's for weird files.
|
||||
|
||||
- Added TAG and DURATION clauses for communicating more information to
|
||||
back-ends and eventually converting REMIND into a full-fledged
|
||||
scheduler.
|
||||
|
||||
- Completely reworked the PS/PSFILE mechanism to use the more
|
||||
general SPECIAL mechanism for customizing output in REMIND back-ends.
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Made parser _very_ forgiving -- the type of reminder now defaults
|
||||
to MSG. This lets you have lines in the reminder file like this:
|
||||
|
||||
Feb 9, 1998 Meeting with Joe.
|
||||
|
||||
But I don't recommend abusing it. It's mostly to ease migration from
|
||||
UNIX calendar(1) files.
|
||||
|
||||
- Documented the "remind -p" format.
|
||||
|
||||
- Made Remind communicate day and month names to back-ends so they
|
||||
can automatically take on the language Remind was compiled with.
|
||||
|
||||
- Directory structure totally reorganized. Remind now uses an autoconf
|
||||
"configure" script which should make life very pleasant for UNIX
|
||||
people.
|
||||
|
||||
- Made Rem2HTML work properly if more than one month's worth of calendar
|
||||
data was produced. Rem2HTML also escapes any special HTML characters.
|
||||
However, it recognizes a "SPECIAL HTML" type of reminder which lets
|
||||
you put arbitrary HTML code in your calendar entries. See www/rem2html
|
||||
for details.
|
||||
|
||||
- Added the "-a" option to Rem2HTML to complement the "-p" option. Also
|
||||
made Rem2HTML print a usage message if input is coming from a terminal.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed sunset(), sunrise() and minsfromutc() functions which were broken
|
||||
by 3.0.17. (In 3.0.17, they did not account for daylight savings time.)
|
||||
|
||||
- Updated "finnish.h" to include proper URL and translation of all
|
||||
error messages.
|
||||
|
||||
+ BUG INTRODUCTIONS
|
||||
|
||||
- The reorganization and use of "configure" probably breaks Remind
|
||||
installation on non-UNIX platforms. Sorry. I can't fix it until
|
||||
I hear back from non-UNIX maintainers.
|
||||
|
||||
- Getting rid of fixed-sized buffers meant lots of changes to code.
|
||||
No doubt, I missed a few regression tests.
|
||||
|
||||
* 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
|
||||
880
dorem.c
880
dorem.c
@@ -1,880 +0,0 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DOREM.C */
|
||||
/* */
|
||||
/* Contains routines for parsing reminders and evaluating */
|
||||
/* triggers. Also contains routines for parsing OMIT */
|
||||
/* commands. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 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"
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
|
||||
/* Define the shell characters to escape */
|
||||
static char const EscapeMe[] =
|
||||
#ifdef QDOS
|
||||
"\"'!$%^&*()|<>[]{}\x9F~;?\\";
|
||||
#else
|
||||
"\"'!$%^&*()|<>[]{}`~;?\\";
|
||||
#endif
|
||||
|
||||
PRIVATE int ParseTimeTrig ARGS ((ParsePtr s, TimeTrig *tim));
|
||||
PRIVATE int ParseLocalOmit ARGS ((ParsePtr s, Trigger *t));
|
||||
PRIVATE int ParseScanFrom ARGS ((ParsePtr s, Trigger *t));
|
||||
PRIVATE int ParsePriority ARGS ((ParsePtr s, Trigger *t));
|
||||
PRIVATE int ParseUntil ARGS ((ParsePtr s, Trigger *t));
|
||||
PRIVATE int ShouldTriggerBasedOnWarn ARGS ((Trigger *t, int jul));
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DoRem */
|
||||
/* */
|
||||
/* Do the REM command. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoRem(ParsePtr p)
|
||||
#else
|
||||
int DoRem(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
{
|
||||
|
||||
Trigger trig;
|
||||
TimeTrig tim;
|
||||
int r;
|
||||
int jul;
|
||||
char buf[TOKSIZE];
|
||||
Token tok;
|
||||
|
||||
/* Parse the trigger date and time */
|
||||
if ( (r=ParseRem(p, &trig, &tim)) ) return r;
|
||||
|
||||
if (trig.typ == NO_TYPE) return E_EOLN;
|
||||
if (trig.typ == SAT_TYPE) {
|
||||
r=DoSatRemind(&trig, &tim, p);
|
||||
if (r) return r;
|
||||
r=ParseToken(p, buf);
|
||||
if (r) return r;
|
||||
FindToken(buf, &tok);
|
||||
if (tok.type == T_Empty || tok.type == T_Comment) return OK;
|
||||
if (tok.type != T_RemType || tok.val == SAT_TYPE) return E_PARSE_ERR;
|
||||
trig.typ = tok.val;
|
||||
jul = LastTriggerDate;
|
||||
if (!LastTrigValid) return OK;
|
||||
} else {
|
||||
/* Calculate the trigger date */
|
||||
jul = ComputeTrigger(trig.scanfrom, &trig, &r);
|
||||
if (r) return r;
|
||||
}
|
||||
|
||||
/* Queue the reminder, if necessary */
|
||||
#ifdef HAVE_QUEUED
|
||||
if (jul == JulianToday &&
|
||||
!(!IgnoreOnce &&
|
||||
trig.once != NO_ONCE &&
|
||||
FileAccessDate == JulianToday))
|
||||
QueueReminder(p, trig.typ, &tim, trig.sched);
|
||||
/* If we're in daemon mode, do nothing over here */
|
||||
if (Daemon) return OK;
|
||||
#endif
|
||||
|
||||
|
||||
if (ShouldTriggerReminder(&trig, &tim, jul)) {
|
||||
#ifdef OS2_POPUP
|
||||
if ( (r=TriggerReminder(p, &trig, &tim, jul, 0)) ) {
|
||||
#else
|
||||
if ( (r=TriggerReminder(p, &trig, &tim, jul)) ) {
|
||||
#endif
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseRem */
|
||||
/* */
|
||||
/* Given a parse pointer, parse line and fill in a */
|
||||
/* trigger structure. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim)
|
||||
#else
|
||||
int ParseRem(s, trig, tim)
|
||||
ParsePtr s;
|
||||
Trigger *trig;
|
||||
TimeTrig *tim;
|
||||
#endif
|
||||
{
|
||||
register int r;
|
||||
Token tok;
|
||||
|
||||
trig->y = NO_YR;
|
||||
trig->m = NO_MON;
|
||||
trig->d = NO_DAY;
|
||||
trig->wd = NO_WD;
|
||||
trig->back = NO_BACK;
|
||||
trig->delta = NO_DELTA;
|
||||
trig->until = NO_UNTIL;
|
||||
trig->rep = NO_REP;
|
||||
trig->localomit = NO_WD;
|
||||
trig->skip = NO_SKIP;
|
||||
trig->once = NO_ONCE;
|
||||
trig->typ = NO_TYPE;
|
||||
trig->scanfrom = NO_DATE;
|
||||
trig->priority = DefaultPrio;
|
||||
trig->sched[0] = 0;
|
||||
trig->warn[0] = 0;
|
||||
tim->ttime = NO_TIME;
|
||||
tim->delta = NO_DELTA;
|
||||
tim->rep = NO_REP;
|
||||
|
||||
while(1) {
|
||||
/* Read space-delimited string */
|
||||
r = ParseToken(s, TokBuffer);
|
||||
if (r) return r;
|
||||
|
||||
/* Figure out what we've got */
|
||||
FindToken(TokBuffer, &tok);
|
||||
switch(tok.type) {
|
||||
case T_WkDay:
|
||||
if (trig->wd & (1 << tok.val)) return E_WD_TWICE;
|
||||
trig->wd |= (1 << tok.val);
|
||||
break;
|
||||
|
||||
case T_Month:
|
||||
if (trig->m != NO_MON) return E_MON_TWICE;
|
||||
trig->m = tok.val;
|
||||
break;
|
||||
|
||||
case T_Skip:
|
||||
if (trig->skip != NO_SKIP) return E_SKIP_ERR;
|
||||
trig->skip = tok.val;
|
||||
break;
|
||||
|
||||
case T_Priority:
|
||||
r=ParsePriority(s, trig);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_At:
|
||||
r=ParseTimeTrig(s, tim);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_Scanfrom:
|
||||
r=ParseScanFrom(s, trig);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_RemType:
|
||||
trig->typ = tok.val;
|
||||
if (s->isnested) return E_CANT_NEST_RTYPE;
|
||||
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
|
||||
return OK;
|
||||
|
||||
case T_Until:
|
||||
r=ParseUntil(s, trig);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_Year:
|
||||
if (trig->y != NO_YR) return E_YR_TWICE;
|
||||
trig->y = tok.val;
|
||||
break;
|
||||
|
||||
case T_Day:
|
||||
if (trig->d != NO_DAY) return E_DAY_TWICE;
|
||||
trig->d = tok.val;
|
||||
break;
|
||||
|
||||
case T_Rep:
|
||||
if (trig->rep != NO_REP) return E_REP_TWICE;
|
||||
trig->rep = tok.val;
|
||||
break;
|
||||
|
||||
case T_Delta:
|
||||
if (trig->delta != NO_DELTA) return E_DELTA_TWICE;
|
||||
trig->delta = tok.val;
|
||||
break;
|
||||
|
||||
case T_Back:
|
||||
if (trig->back != NO_BACK) return E_BACK_TWICE;
|
||||
trig->back = tok.val;
|
||||
break;
|
||||
|
||||
case T_Once:
|
||||
if (trig->once != NO_ONCE) return E_ONCE_TWICE;
|
||||
trig->once = ONCE_ONCE;
|
||||
break;
|
||||
|
||||
case T_Omit:
|
||||
r = ParseLocalOmit(s, trig);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_Empty:
|
||||
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
|
||||
return OK;
|
||||
|
||||
case T_Warn:
|
||||
r=ParseToken(s, TokBuffer);
|
||||
if(r) return r;
|
||||
StrnCpy(trig->warn, TokBuffer, VAR_NAME_LEN);
|
||||
break;
|
||||
|
||||
case T_Sched:
|
||||
r=ParseToken(s, TokBuffer);
|
||||
if(r) return r;
|
||||
StrnCpy(trig->sched, TokBuffer, VAR_NAME_LEN);
|
||||
break;
|
||||
|
||||
default:
|
||||
Eprint("%s: %s", ErrMsg[E_UNKNOWN_TOKEN], TokBuffer);
|
||||
return E_UNKNOWN_TOKEN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseTimeTrig - parse the AT part of a timed reminder */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ParseTimeTrig(ParsePtr s, TimeTrig *tim)
|
||||
#else
|
||||
static int ParseTimeTrig(s, tim)
|
||||
ParsePtr s;
|
||||
TimeTrig *tim;
|
||||
#endif
|
||||
{
|
||||
Token tok;
|
||||
int r;
|
||||
|
||||
while(1) {
|
||||
r = ParseToken(s, TokBuffer);
|
||||
if (r) return r;
|
||||
FindToken(TokBuffer, &tok);
|
||||
switch(tok.type) {
|
||||
case T_Time:
|
||||
tim->ttime = tok.val;
|
||||
break;
|
||||
|
||||
case T_Delta:
|
||||
tim->delta = (tok.val > 0) ? tok.val : -tok.val;
|
||||
break;
|
||||
|
||||
case T_Rep:
|
||||
tim->rep = tok.val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (tim->ttime == NO_TIME) return E_EXPECT_TIME;
|
||||
/* Save in global variable */
|
||||
LastTriggerTime = tim->ttime;
|
||||
PushToken(TokBuffer);
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseLocalOmit - parse the local OMIT portion of a */
|
||||
/* reminder. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ParseLocalOmit(ParsePtr s, Trigger *t)
|
||||
#else
|
||||
static int ParseLocalOmit(s, t)
|
||||
ParsePtr s;
|
||||
Trigger *t;
|
||||
#endif
|
||||
{
|
||||
Token tok;
|
||||
int r;
|
||||
|
||||
while(1) {
|
||||
r = ParseToken(s, TokBuffer);
|
||||
if (r) return r;
|
||||
FindToken(TokBuffer, &tok);
|
||||
switch(tok.type) {
|
||||
case T_WkDay:
|
||||
t->localomit |= (1 << tok.val);
|
||||
break;
|
||||
|
||||
default:
|
||||
PushToken(TokBuffer);
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseUntil - parse the UNTIL portion of a reminder */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ParseUntil(ParsePtr s, Trigger *t)
|
||||
#else
|
||||
static int ParseUntil(s, t)
|
||||
ParsePtr s;
|
||||
Trigger *t;
|
||||
#endif
|
||||
{
|
||||
int y = NO_YR,
|
||||
m = NO_MON,
|
||||
d = NO_DAY;
|
||||
|
||||
Token tok;
|
||||
int r;
|
||||
|
||||
if (t->until != NO_UNTIL) return E_UNTIL_TWICE;
|
||||
|
||||
while(1) {
|
||||
r = ParseToken(s, TokBuffer);
|
||||
if (r) return r;
|
||||
FindToken(TokBuffer, &tok);
|
||||
switch(tok.type) {
|
||||
case T_Year:
|
||||
if (y != NO_YR) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_YR_TWICE]);
|
||||
return E_YR_TWICE;
|
||||
}
|
||||
y = tok.val;
|
||||
break;
|
||||
|
||||
case T_Month:
|
||||
if (m != NO_MON) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_MON_TWICE]);
|
||||
return E_MON_TWICE;
|
||||
}
|
||||
m = tok.val;
|
||||
break;
|
||||
|
||||
case T_Day:
|
||||
if (d != NO_DAY) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_DAY_TWICE]);
|
||||
return E_DAY_TWICE;
|
||||
}
|
||||
d = tok.val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (y == NO_YR || m == NO_MON || d == NO_DAY) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_INCOMPLETE]);
|
||||
return E_INCOMPLETE;
|
||||
}
|
||||
if (!DateOK(y, m, d)) return E_BAD_DATE;
|
||||
t->until = Julian(y, m, d);
|
||||
PushToken(TokBuffer);
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseScanFrom - parse the SCANFROM portion of a reminder */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ParseScanFrom(ParsePtr s, Trigger *t)
|
||||
#else
|
||||
static int ParseScanFrom(s, t)
|
||||
ParsePtr s;
|
||||
Trigger *t;
|
||||
#endif
|
||||
{
|
||||
int y = NO_YR,
|
||||
m = NO_MON,
|
||||
d = NO_DAY;
|
||||
|
||||
Token tok;
|
||||
int r;
|
||||
|
||||
if (t->scanfrom != NO_DATE) return E_SCAN_TWICE;
|
||||
|
||||
while(1) {
|
||||
r = ParseToken(s, TokBuffer);
|
||||
if (r) return r;
|
||||
FindToken(TokBuffer, &tok);
|
||||
switch(tok.type) {
|
||||
case T_Year:
|
||||
if (y != NO_YR) {
|
||||
Eprint("SCANFROM: %s", ErrMsg[E_YR_TWICE]);
|
||||
return E_YR_TWICE;
|
||||
}
|
||||
y = tok.val;
|
||||
break;
|
||||
|
||||
case T_Month:
|
||||
if (m != NO_MON) {
|
||||
Eprint("SCANFROM: %s", ErrMsg[E_MON_TWICE]);
|
||||
return E_MON_TWICE;
|
||||
}
|
||||
m = tok.val;
|
||||
break;
|
||||
|
||||
case T_Day:
|
||||
if (d != NO_DAY) {
|
||||
Eprint("SCANFROM: %s", ErrMsg[E_DAY_TWICE]);
|
||||
return E_DAY_TWICE;
|
||||
}
|
||||
d = tok.val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (y == NO_YR || m == NO_MON || d == NO_DAY) {
|
||||
Eprint("SCANFROM: %s", ErrMsg[E_INCOMPLETE]);
|
||||
return E_INCOMPLETE;
|
||||
}
|
||||
if (!DateOK(y, m, d)) return E_BAD_DATE;
|
||||
t->scanfrom = Julian(y, m, d);
|
||||
PushToken(TokBuffer);
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* TriggerReminder */
|
||||
/* */
|
||||
/* Trigger the reminder if it's a RUN or MSG type. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
#ifdef OS2_POPUP
|
||||
PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul,
|
||||
int AsPopUp)
|
||||
#else /* ! OS2_POPUP */
|
||||
PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
|
||||
#endif /* OS2_POPUP */
|
||||
#else /* ! HAVE_PROTOS */
|
||||
#ifdef OS2_POPUP
|
||||
int TriggerReminder(p, t, tim, jul, AsPopUp)
|
||||
ParsePtr p;
|
||||
Trigger *t;
|
||||
TimeTrig *tim;
|
||||
int jul;
|
||||
int AsPopUp;
|
||||
#else /* ! OS2_POPUP */
|
||||
int TriggerReminder(p, t, tim, jul)
|
||||
ParsePtr p;
|
||||
Trigger *t;
|
||||
TimeTrig *tim;
|
||||
int jul;
|
||||
#endif /* OS2_POPUP */
|
||||
#endif /* HAVE_PROTOS */
|
||||
{
|
||||
int r, y, m, d;
|
||||
char PrioExpr[25];
|
||||
static char buf[LINELEN+TOKSIZE];
|
||||
char *s, *s2;
|
||||
Value v;
|
||||
|
||||
if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
|
||||
if (t->typ == CAL_TYPE || t->typ == PS_TYPE || t->typ == PSF_TYPE)
|
||||
return OK;
|
||||
|
||||
/* If it's a MSG-type reminder, and no -k option was used, issue the banner. */
|
||||
if ((t->typ == MSG_TYPE || t->typ == MSF_TYPE)
|
||||
&& !NumTriggered && !NextMode && !MsgCommand) {
|
||||
if (!DoSubstFromString(Banner, SubstBuffer, JulianToday, NO_TIME) && *SubstBuffer)
|
||||
#ifdef OS2_POPUP
|
||||
if (AsPopUp)
|
||||
PutlPopUp(SubstBuffer);
|
||||
else
|
||||
printf("%s\n", SubstBuffer);
|
||||
#else
|
||||
printf("%s\n", SubstBuffer);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* If it's NextMode, process as a CAL-type entry, and issue simple-calendar
|
||||
format. */
|
||||
if (NextMode) {
|
||||
if ( (r=DoSubst(p, SubstBuffer, t, tim, jul, CAL_MODE)) ) return r;
|
||||
if (!*SubstBuffer) return OK;
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
#ifdef OS2_POPUP
|
||||
if (AsPopUp) {
|
||||
sprintf(buf, "%04d%c%02d%c%02d %s", y, DATESEP, m+1, DATESEP, d,
|
||||
SimpleTime(tim->ttime, NULL));
|
||||
StartPopUp();
|
||||
PutsPopUp(buf);
|
||||
PutlPopUp(SubstBuffer);
|
||||
}
|
||||
else
|
||||
printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
|
||||
SimpleTime(tim->ttime, NULL),
|
||||
SubstBuffer);
|
||||
#else
|
||||
printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d,
|
||||
SimpleTime(tim->ttime, NULL),
|
||||
SubstBuffer);
|
||||
#endif
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Put the substituted string into the SubstBuffer */
|
||||
s2 = buf;
|
||||
*s2 = 0;
|
||||
if (UserFuncExists("msgprefix") == 1) {
|
||||
sprintf(PrioExpr, "msgprefix(%d)", t->priority);
|
||||
s = PrioExpr;
|
||||
r = EvalExpr(&s, &v);
|
||||
if (!r) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
sprintf(s2, "%s", v.v.str);
|
||||
s2 += strlen(s2);
|
||||
}
|
||||
DestroyValue(v);
|
||||
}
|
||||
}
|
||||
if ( (r=DoSubst(p, s2, t, tim, jul, NORMAL_MODE)) ) return r;
|
||||
s2 += strlen(s2);
|
||||
if (UserFuncExists("msgsuffix") == 1) {
|
||||
sprintf(PrioExpr, "msgsuffix(%d)", t->priority);
|
||||
s = PrioExpr;
|
||||
r = EvalExpr(&s, &v);
|
||||
if (!r) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
sprintf(s2, "%s", v.v.str);
|
||||
s2 += strlen(s2);
|
||||
}
|
||||
DestroyValue(v);
|
||||
}
|
||||
}
|
||||
if ((!MsgCommand && t->typ == MSG_TYPE) || t->typ == MSF_TYPE) {
|
||||
*s2++ = '\n';
|
||||
}
|
||||
*s2 = 0;
|
||||
|
||||
/* If we are sorting, just queue it up in the sort buffer */
|
||||
if (SortByDate) {
|
||||
if (InsertIntoSortBuffer(jul, tim->ttime, buf, t->typ, t->priority) == OK) {
|
||||
NumTriggered++;
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we didn't insert the reminder into the sort buffer, issue the
|
||||
reminder now. */
|
||||
switch(t->typ) {
|
||||
case MSG_TYPE:
|
||||
if (MsgCommand) {
|
||||
DoMsgCommand(MsgCommand, buf);
|
||||
} else {
|
||||
#ifdef OS2_POPUP
|
||||
if (AsPopUp)
|
||||
PutlPopUp(buf);
|
||||
else
|
||||
printf("%s", buf);
|
||||
#else
|
||||
printf("%s", buf);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
case MSF_TYPE:
|
||||
#ifdef OS2_POPUP
|
||||
if (AsPopUp) {
|
||||
StartPopUp();
|
||||
FillParagraph(buf, 1);
|
||||
EndPopUp();
|
||||
} else {
|
||||
FillParagraph(buf, 0);
|
||||
}
|
||||
#else
|
||||
FillParagraph(buf);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case RUN_TYPE:
|
||||
system(buf);
|
||||
break;
|
||||
|
||||
default: /* Unknown/illegal type? */
|
||||
return E_SWERR;
|
||||
}
|
||||
|
||||
NumTriggered++;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ShouldTriggerReminder */
|
||||
/* */
|
||||
/* Return 1 if we should trigger a reminder, based on today's */
|
||||
/* date and the trigger. Return 0 if reminder should not be */
|
||||
/* triggered. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef __TURBOC__
|
||||
#pragma argsused
|
||||
#endif
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int jul)
|
||||
#else
|
||||
int ShouldTriggerReminder(t, tim, jul)
|
||||
Trigger *t;
|
||||
TimeTrig *tim;
|
||||
int jul;
|
||||
#endif
|
||||
{
|
||||
int r;
|
||||
|
||||
/* Handle the ONCE modifier in the reminder. */
|
||||
if (!IgnoreOnce && t->once !=NO_ONCE && FileAccessDate == JulianToday)
|
||||
return 0;
|
||||
|
||||
if (jul < JulianToday) return 0;
|
||||
|
||||
/* Don't trigger timed reminders if DontIssueAts is true, and if the
|
||||
reminder is for today */
|
||||
|
||||
#ifdef HAVE_QUEUED
|
||||
if (jul == JulianToday && DontIssueAts && tim->ttime != NO_TIME) return 0;
|
||||
#endif
|
||||
|
||||
/* Don't trigger "old" timed reminders */
|
||||
/*** REMOVED...
|
||||
if (jul == JulianToday &&
|
||||
tim->ttime != NO_TIME &&
|
||||
tim->ttime < SystemTime(0) / 60) return 0;
|
||||
*** ...UNTIL HERE */
|
||||
|
||||
/* If "infinite delta" option is chosen, always trigger future reminders */
|
||||
if (InfiniteDelta || NextMode) return 1;
|
||||
|
||||
/* If there's a "warn" function, it overrides any deltas */
|
||||
if (t->warn[0] != 0) {
|
||||
return ShouldTriggerBasedOnWarn(t, jul);
|
||||
}
|
||||
|
||||
/* Move back by delta days, if any */
|
||||
if (t->delta != NO_DELTA) {
|
||||
if (t->delta < 0)
|
||||
jul = jul + t->delta;
|
||||
else {
|
||||
r = t->delta;
|
||||
while(r && jul > JulianToday) {
|
||||
jul--;
|
||||
if (!IsOmitted(jul, t->localomit)) r--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Should we trigger the reminder? */
|
||||
return (jul <= JulianToday);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DoSatRemind */
|
||||
/* */
|
||||
/* Do the "satisfying..." remind calculation. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef __TURBOC__
|
||||
#pragma argsused
|
||||
#endif
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
|
||||
#else
|
||||
int DoSatRemind(trig, tim, p)
|
||||
Trigger *trig;
|
||||
TimeTrig *tim;
|
||||
ParsePtr p;
|
||||
#endif
|
||||
{
|
||||
int iter, jul, r;
|
||||
Value v;
|
||||
char *s, *t;
|
||||
|
||||
t = p->pos;
|
||||
iter = 0;
|
||||
jul = trig->scanfrom;
|
||||
while (iter++ < MaxSatIter) {
|
||||
jul = ComputeTrigger(jul, trig, &r);
|
||||
if (r) {
|
||||
if (r == E_CANT_TRIG) return OK; else return r;
|
||||
}
|
||||
s = p->pos;
|
||||
r = EvaluateExpr(p, &v);
|
||||
t = p->pos;
|
||||
if (r) return r;
|
||||
if (v.type != INT_TYPE && v.type != STR_TYPE) return E_BAD_TYPE;
|
||||
if (v.type == INT_TYPE && v.v.val) return OK;
|
||||
if (v.type == STR_TYPE && *v.v.str) return OK;
|
||||
p->pos = s;
|
||||
jul++;
|
||||
}
|
||||
p->pos = t;
|
||||
LastTrigValid = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParsePriority - parse the PRIORITY portion of a reminder */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ParsePriority(ParsePtr s, Trigger *t)
|
||||
#else
|
||||
static int ParsePriority(s, t)
|
||||
ParsePtr s;
|
||||
Trigger *t;
|
||||
#endif
|
||||
{
|
||||
int p, r;
|
||||
char *u;
|
||||
|
||||
r = ParseToken(s, TokBuffer);
|
||||
if(r) return r;
|
||||
u = TokBuffer;
|
||||
|
||||
if (!isdigit(*u)) return E_EXPECTING_NUMBER;
|
||||
p = 0;
|
||||
while (isdigit(*u)) {
|
||||
p = p*10 + *u - '0';
|
||||
u++;
|
||||
}
|
||||
if (*u) return E_EXPECTING_NUMBER;
|
||||
|
||||
/* Tricky! The only way p can be < 0 is if overflow occurred; thus,
|
||||
E2HIGH is indeed the appropriate error message. */
|
||||
if (p<0 || p>9999) return E_2HIGH;
|
||||
t->priority = p;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DoMsgCommand */
|
||||
/* */
|
||||
/* Execute the '-k' command, escaping shell chars in message. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void DoMsgCommand(char *cmd, char *msg)
|
||||
#else
|
||||
void DoMsgCommand(cmd, msg)
|
||||
char *cmd;
|
||||
char *msg;
|
||||
#endif
|
||||
{
|
||||
|
||||
#ifdef WANT_SHELL_ESCAPING
|
||||
char buf[2*LINELEN+TOKSIZE];
|
||||
char *s, *t;
|
||||
|
||||
/* Escape shell characters in msg INCLUDING WHITESPACE! */
|
||||
for (t=buf, s=msg; *s; s++) {
|
||||
if (isspace(*s) || strchr(EscapeMe, *s)) *t++ = '\\';
|
||||
*t++ = *s;
|
||||
}
|
||||
*t = 0;
|
||||
|
||||
/* Use SubstBuffer -- not too safe, since no check for overflow... */
|
||||
sprintf(SubstBuffer, cmd, buf);
|
||||
#else
|
||||
sprintf(SubstBuffer, cmd, msg);
|
||||
#endif /* WANT_SHELL_ESCAPING */
|
||||
system(SubstBuffer);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ShouldTriggerBasedOnWarn */
|
||||
/* */
|
||||
/* Determine whether to trigger a reminder based on its WARN */
|
||||
/* function. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ShouldTriggerBasedOnWarn(Trigger *t, int jul)
|
||||
#else
|
||||
static int ShouldTriggerBasedOnWarn(t, jul)
|
||||
Trigger *t;
|
||||
int jul;
|
||||
#endif
|
||||
{
|
||||
char buffer[VAR_NAME_LEN+15];
|
||||
int i;
|
||||
char *s;
|
||||
int r;
|
||||
Value v;
|
||||
int lastReturnVal = 0; /* Silence compiler warning */
|
||||
|
||||
/* If no proper function exists, barf... */
|
||||
if (UserFuncExists(t->warn) != 1) {
|
||||
Eprint("%s: `%s'", ErrMsg[M_BAD_WARN_FUNC], t->warn);
|
||||
return (jul == JulianToday);
|
||||
}
|
||||
for (i=1; ; i++) {
|
||||
sprintf(buffer, "%s(%d)", t->warn, i);
|
||||
s = buffer;
|
||||
r = EvalExpr(&s, &v);
|
||||
if (r) {
|
||||
Eprint("%s: `%s': %s", ErrMsg[M_BAD_WARN_FUNC],
|
||||
t->warn, ErrMsg[r]);
|
||||
return (jul == JulianToday);
|
||||
}
|
||||
if (v.type != INT_TYPE) {
|
||||
DestroyValue(v);
|
||||
Eprint("%s: `%s': %s", ErrMsg[M_BAD_WARN_FUNC],
|
||||
t->warn, ErrMsg[E_BAD_TYPE]);
|
||||
return (jul == JulianToday);
|
||||
}
|
||||
|
||||
/* If absolute value of return is not monotonically
|
||||
decreasing, exit */
|
||||
if (i > 1 && abs(v.v.val) >= lastReturnVal) {
|
||||
return (jul == JulianToday);
|
||||
}
|
||||
|
||||
lastReturnVal = abs(v.v.val);
|
||||
/* Positive values: Just subtract. Negative values:
|
||||
skip omitted days. */
|
||||
if (v.v.val >= 0) {
|
||||
if (JulianToday + v.v.val == jul) return 1;
|
||||
} else {
|
||||
int j = jul;
|
||||
while (v.v.val) {
|
||||
j--;
|
||||
if (!IsOmitted(j, t->localomit)) v.v.val++;
|
||||
}
|
||||
if (j == JulianToday) return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,12 +17,13 @@
|
||||
# "#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 David F. Skoll #
|
||||
# Copyright (C) 1999-2000 Roaring Penguin Software Inc. #
|
||||
# #
|
||||
#############################################################################
|
||||
|
||||
#
|
||||
# $Id: defs.rem,v 1.1 1996-03-27 03:25:51 dfs Exp $
|
||||
# $Id: defs.rem,v 1.4 2000-02-18 03:45:36 dfs Exp $
|
||||
#
|
||||
|
||||
RUN OFF
|
||||
@@ -30,8 +31,8 @@ RUN OFF
|
||||
################################################
|
||||
# Ensure required version of remind is used... #
|
||||
################################################
|
||||
IF version() < "03.00.10"
|
||||
ERRMSG This file requires at least version 03.00.10 of Remind.%
|
||||
IF version() < "03.00.19"
|
||||
ERRMSG This file requires at least version 03.00.19 of Remind.%
|
||||
ERRMSG This version is version [version()].
|
||||
EXIT
|
||||
ENDIF
|
||||
@@ -160,6 +161,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,50 +308,19 @@ 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
|
||||
REM Sat Sun SPECIAL SHADE 220
|
||||
|
||||
#USHOLS
|
||||
#############################################################################
|
||||
@@ -403,14 +381,13 @@ 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 :-) #
|
||||
# #
|
||||
##########################################################################
|
||||
if $NumTrig > SaveTrig
|
||||
REM PS [shade]
|
||||
REM SPECIAL SHADE 220
|
||||
endif
|
||||
|
||||
# Seasons (valid from 1992 to 2000)...
|
||||
@@ -420,6 +397,41 @@ 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 SHADE special blots out any previous PostScript #
|
||||
# reminders for a date, these examples need to follow the US Holidays #
|
||||
# section, which uses 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))] SPECIAL MOON 0
|
||||
[trigger(moondate(1))] SPECIAL MOON 1
|
||||
[trigger(moondate(2))] SPECIAL MOON 2
|
||||
[trigger(moondate(3))] SPECIAL MOON 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
|
||||
##########################################################################
|
||||
# #
|
||||
53
examples/remind.vim
Normal file
53
examples/remind.vim
Normal file
@@ -0,0 +1,53 @@
|
||||
" Vim syntax file
|
||||
" Language: Remind
|
||||
" Maintainer: Davide Alberani <alberanid@bigfoot.com>
|
||||
" Last change: 03 Dec 1999
|
||||
" Version: 0.1
|
||||
" URL: http://members.xoom.com/alberanid/vim/syntax/remind.vim
|
||||
"
|
||||
" remind is a sophisticated reminder service
|
||||
" you can download remind from ftp://ftp.doe.carleton.ca/pub/remind-3.0/
|
||||
|
||||
" clear any unwanted syntax defs
|
||||
syn clear
|
||||
|
||||
" shut case off
|
||||
syn case ignore
|
||||
|
||||
syn keyword remindCommands REM OMIT SET FSET UNSET
|
||||
syn keyword remindExpiry UNTIL SCANFROM SCAN WARN SCHED
|
||||
syn keyword remindTag PRIORITY TAG
|
||||
syn keyword remindTimed AT DURATION
|
||||
syn keyword remindMove ONCE SKIP BEFORE AFTER
|
||||
syn keyword remindSpecial INCLUDE INC BANNER PUSH-OMIT-CONTEXT PUSH CLEAR-OMIT-CONTEXT CLEAR POP-OMIT-CONTEXT POP
|
||||
syn keyword remindRun MSG MSF RUN CAL SATISFY SPECIAL PS PSFILE SHADE MOON
|
||||
syn keyword remindConditional IF ELSE ENDIF IFTRIG
|
||||
syn match remindComment "#.*$"
|
||||
syn region remindString start=+'+ end=+'+ skip=+\\\\\|\\'+ oneline
|
||||
syn region remindString start=+"+ end=+"+ skip=+\\\\\|\\"+ oneline
|
||||
syn keyword remindDebug DEBUG DUMPVARS DUMP ERRMSG FLUSH PRESERVE
|
||||
syn match remindVar "\$[_a-zA-Z][_a-zA-Z0-9]*"
|
||||
syn match remindSubst "%[^ ]"
|
||||
syn match remindAdvanceNumber "\(\*\|+\|-\|++\|--\)[0-9]\+"
|
||||
|
||||
if !exists("did_remind_syntax_inits")
|
||||
let did_remind_syntax_inits = 1
|
||||
hi link remindCommands Function
|
||||
hi link remindExpiry Repeat
|
||||
hi link remindTag Label
|
||||
hi link remindTimed Statement
|
||||
hi link remindMove Statement
|
||||
hi link remindSpecial Include
|
||||
hi link remindRun Function
|
||||
hi link remindConditional Conditional
|
||||
hi link remindComment Comment
|
||||
hi link remindString String
|
||||
hi link remindDebug Debug
|
||||
hi link remindVar Identifier
|
||||
hi link remindSubst Constant
|
||||
hi link remindAdvanceNumber Number
|
||||
endif
|
||||
|
||||
let b:current_syntax = "remind"
|
||||
|
||||
"EOF vim: ts=8 noet tw=100 sw=8 sts=0
|
||||
238
install-sh
Executable file
238
install-sh
Executable file
@@ -0,0 +1,238 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
#
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
||||
29
man/cm2rem.1
Normal file
29
man/cm2rem.1
Normal file
@@ -0,0 +1,29 @@
|
||||
.\" $Id: cm2rem.1,v 1.2 2000-03-15 15:51:36 dfs Exp $
|
||||
.TH CM2REM 1 "18 October 1999"
|
||||
.UC4
|
||||
.SH NAME
|
||||
cm2rem.tcl \- Convert Sun's "cm" input file to Remind format
|
||||
.SH SYNOPSIS
|
||||
.B cm2rem.tcl < cm_file > remind_file
|
||||
.SH DESCRIPTION
|
||||
\fBcm2rem.tcl\fR reads the Sun calendar manager data file and converts
|
||||
it into a \fBRemind\fR script. Note that \fBcm2rem.tcl\fR can convert
|
||||
\fIonly\fR version 3 calendar manager files. If you are using version 4
|
||||
files, there should be a system utility to convert them to version 3 files.
|
||||
.SH AUTHOR
|
||||
\fBcm2rem.tcl\fR is supported by Roaring Penguin Software
|
||||
Inc. (http://www.roaringpenguin.com)
|
||||
.PP
|
||||
\fBcm2rem.tcl\fR was written by David F. Skoll <dfs@roaringpenguin.com>.
|
||||
.SH BUGS
|
||||
Not all of the Sun calendar manager options are respected. In particular,
|
||||
nothing is done for e-mail actions. Also, the resulting Remind script
|
||||
is not editable with \fBTkRemind\fR; you can only edit it with a text
|
||||
editor.
|
||||
.PP
|
||||
\fBcm2rem.tcl\fR requires Tcl/Tk version 8.0 or higher. The
|
||||
\fBtclsh\fR interpreter must be on your \fBpath\fR.
|
||||
|
||||
.SH SEE ALSO
|
||||
\fBremind(1)\fR, \fBtkremind(1)\fR
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.\" $Id: kall.1,v 1.2 1996-04-28 02:01:58 dfs Exp $
|
||||
.TH KALL 1 "26 February 1991"
|
||||
.\" $Id: kall.1,v 1.2 1998-02-16 02:35:09 dfs Exp $
|
||||
.TH KALL 1 "15 February 1998"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
kall \- kill processes by command name
|
||||
@@ -1,5 +1,5 @@
|
||||
.\" $Id: rem.1,v 1.2 1996-04-28 02:02:01 dfs Exp $
|
||||
.TH REM 1 "26 February 1991"
|
||||
.\" $Id: rem.1,v 1.2 1998-02-16 02:35:09 dfs Exp $
|
||||
.TH REM 1 "15 February 1998"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
rem \- run 'remind' with a default reminder file
|
||||
@@ -1,5 +1,5 @@
|
||||
.\" $Id: rem2ps.1,v 1.2 1996-04-28 02:02:01 dfs Exp $
|
||||
.TH REM2PS 1 "27 April 1996"
|
||||
.\" $Id: rem2ps.1,v 1.4 2000-03-15 15:51:37 dfs Exp $
|
||||
.TH REM2PS 1 "1 February 1998"
|
||||
.UC4
|
||||
.SH NAME
|
||||
rem2ps \- draw a PostScript calendar from Remind output
|
||||
@@ -9,6 +9,11 @@ rem2ps \- draw a PostScript calendar from Remind output
|
||||
\fBRem2ps\fR reads the standard input, which should be the results of running
|
||||
\fBRemind\fR with the \fB\-p\fR option. It emits PostScript code (which
|
||||
draws a calendar) to the standard output.
|
||||
.PP
|
||||
See the section "Rem2PS Input Format" for details about the \fB\-p\fR
|
||||
data. This may be useful if you wish to create other \fBRemind\fR
|
||||
back-ends.
|
||||
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-v
|
||||
@@ -300,8 +305,76 @@ Use that file with the \fBRem2ps\fR \fB\-p\fR option to create calendars
|
||||
with the year and month in large grey letters in the background of the
|
||||
calendar.
|
||||
.PP
|
||||
.SH REM2PS INPUT FORMAT
|
||||
\fBRemind \-p\fR sends the following lines to standard output.
|
||||
The information is designed to be easily parsed by back-end programs:
|
||||
.TP
|
||||
.B # rem2ps begin
|
||||
This line signifies the start of calendar data. Back-ends can search
|
||||
for it to verify they are being fed correct information.
|
||||
.TP
|
||||
\fImonth_name year num_days first_day monday_first\fR
|
||||
On this line, \fImonth_name\fR is the name of the month whose calendar
|
||||
information is about to follow. \fInum_days\fR is the number of days
|
||||
in this month. \fIfirst_day\fR is the weekday of the first day of the
|
||||
month (0 = Sunday, 1 = Monday, 6 = Saturday.) And \fImonday_first\fR is
|
||||
1 if the \fB\-m\fR flag was supplied to \fBRemind\fR, or 0 if it was not.
|
||||
All this information is supplied so back-ends don't need any date calculation
|
||||
facilities.
|
||||
.TP
|
||||
\fIsun mon tue wed thu fri sat\fR
|
||||
This line consists of
|
||||
space-separated names of days in whatever language \fBRemind\fR was
|
||||
compiled for. This information can be used by back-ends to annotate
|
||||
calendars, and means they don't have to be created for a specific
|
||||
language.
|
||||
.TP
|
||||
\fInext_mon next_days\fR
|
||||
The name of the next month and the number of days in it.
|
||||
.TP
|
||||
\fIprev_mon prev_days\fR
|
||||
The name of the previous month and the number of days in it. The
|
||||
\fInext_mon\fR and \fIprev_mon\fR lines could be used to generate small
|
||||
inset calendars for the next and previous months.
|
||||
.PP
|
||||
The remaining data consists of calendar entries, in the following format:
|
||||
.PP
|
||||
\fIyyyy/mm/dd special tag dur time body\fR
|
||||
.PP
|
||||
Here, \fIyyyy\fR is the year, \fImm\fR is the month (01-12) and
|
||||
\fIdd\fR is the day of the month.
|
||||
.PP
|
||||
\fIspecial\fR is a string used
|
||||
for "out-of-band" communication with back-ends. If the reminder
|
||||
is a normal reminder, \fIspecial\fR is "*". The \fBRem2PS\fR
|
||||
back-end understands the specials \fBPostScript\fR and \fBPSFile\fR.
|
||||
Other back-ends may understand other specials. A back end should
|
||||
\fIsilently ignore\fR a reminder with a special it doesn't understand.
|
||||
.PP
|
||||
\fItag\fR is whatever tag the user provided with the \fBTAG\fR clause,
|
||||
or "*" if no tag was provided.
|
||||
.PP
|
||||
\fIdur\fR is the \fBDURATION\fR value in minutes, or "*" if no duration
|
||||
was provided.
|
||||
.PP
|
||||
\fItime\fR is the time of the reminder in minutes past midnight, or
|
||||
"*" if the reminder was not a timed reminder.
|
||||
.PP
|
||||
\fIbody\fR is the body of the reminder.
|
||||
.PP
|
||||
After a month's worth of reminders have been emitted, \fBRemind\fR
|
||||
emits the line:
|
||||
.PP
|
||||
\fB# rem2ps end
|
||||
.PP
|
||||
However, back-ends should keep reading until EOF in case more data for
|
||||
subsequent months is forthcoming.
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
David F. Skoll
|
||||
Rem2PS is now supported by Roaring Penguin Software
|
||||
Inc. (http://www.roaringpenguin.com)
|
||||
.PP
|
||||
Rem2PS was written by David F. Skoll <dfs@roaringpenguin.com>.
|
||||
.SH BUGS
|
||||
All \fBRem2ps\fR options are case-sensitive, unlike \fBRemind\fR.
|
||||
Any time you supply
|
||||
@@ -1,5 +1,5 @@
|
||||
.\" $Id: remind.1,v 1.5 1996-10-12 02:49:34 dfs Exp $
|
||||
.TH REMIND 1 "27 April 1996"
|
||||
.\" $Id: remind.1,v 1.12 2000-03-15 15:51:38 dfs Exp $
|
||||
.TH REMIND 1 "17 February 2000"
|
||||
.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
|
||||
@@ -57,8 +59,10 @@ of weeks.
|
||||
.B \-p\fR\fIn\fR
|
||||
The \fB\-p\fR option is very similar to the \fB\-s\fR option, except
|
||||
that the output contains additional information for use by the
|
||||
\fBrem2ps\fR program, which creates a PostScript calendar. For this
|
||||
\fBRem2PS\fR program, which creates a PostScript calendar. For this
|
||||
option, \fIn\fR cannot start with "+"; it must specify a number of months.
|
||||
The format of the \fB\-p\fR output is described in the \fBrem2ps(1)\fR
|
||||
man page.
|
||||
.TP
|
||||
.B \-m
|
||||
The \fB\-m\fR option causes the \fB\-c\fR or \fB\-p\fR options to produce
|
||||
@@ -67,6 +71,9 @@ a calendar whose first column is Monday rather than Sunday.
|
||||
.TP
|
||||
.B \-v
|
||||
The \fB\-v\fR option makes the output of \fBRemind\fR slightly more verbose.
|
||||
Currently, this causes \fBRemind\fR to echo a bad line in case of an
|
||||
error, and to print a security message if a script tests the
|
||||
$RunOff system variable.
|
||||
.TP
|
||||
.B \-o
|
||||
The \fB\-o\fR option causes \fBRemind\fR to ignore all \fBONCE\fR directives.
|
||||
@@ -172,6 +179,12 @@ specifies how often (in minutes) \fBRemind\fR should wake up to
|
||||
check if the reminder script has been changed. \fIN\fR defaults
|
||||
to 5, and can range from 5 to 60. Note that the use of the
|
||||
\fB\-z\fR option also enables the \fB\-f\fR option.
|
||||
.PP
|
||||
.RS
|
||||
If you supply the option \fB\-z0\fR, \fBRemind\fR runs in a
|
||||
special mode called \fBserver mode\fR. This is documented
|
||||
in the tkremind man page; see tkremind(1).
|
||||
.RE
|
||||
.TP
|
||||
\fB\-u\fR\fIname\fR (UNIX version only)
|
||||
Runs \fBRemind\fR with the uid and gid of the user specified by \fIname\fR.
|
||||
@@ -179,7 +192,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
|
||||
@@ -264,8 +279,10 @@ Its syntax is:
|
||||
[\fBWARN\fR \fIwarn_function\fR]
|
||||
[\fBUNTIL\fR \fIexpiry_date\fR]
|
||||
[\fBSCANFROM\fR \fIscan_date\fR]
|
||||
\fBMSG\fR | \fBMSF\fR | \fBRUN\fR | \fBCAL\fR | \fBSATISFY\fR |
|
||||
\fBPS\fR | \fBPSFILE\fR
|
||||
[\fBDURATION\fR \fIduration\fR]
|
||||
[\fBTAG\fR \fItag\fR]
|
||||
<\fBMSG\fR | \fBMSF\fR | \fBRUN\fR | \fBCAL\fR | \fBSATISFY\fR |
|
||||
\fBSPECIAL\fR \fIspecial\fR | \fBPS\fR | \fBPSFILE\fR>
|
||||
.I body
|
||||
.RE
|
||||
.PP
|
||||
@@ -279,7 +296,7 @@ such as \fBOMIT\fR or \fBRUN\fR. The portion of the \fBREM\fR command
|
||||
before the \fBMSG\fR, \fBMSF\fR \fBRUN\fR, \fBCAL\fR or \fBSATISFY\fR clause
|
||||
is called a \fItrigger\fR.
|
||||
.PP
|
||||
.B "MSG, MSF, RUN, CAL, PS and PSFILE"
|
||||
.B "MSG, MSF, RUN, CAL, SPECIAL, PS and PSFILE"
|
||||
.PP
|
||||
These keywords denote the \fItype\fR
|
||||
of the reminder. (\fBSATISFY\fR is more complicated and will be explained
|
||||
@@ -290,6 +307,15 @@ used the \fB\-k\fR command-line option, then \fBMSG\fR-type reminders are
|
||||
passed to the appropriate program. Note that the options \fB\-c\fR,
|
||||
\fB\-s\fR, \fB\-p\fR and \fB\-n\fR disable the \fB\-k\fR option.
|
||||
.PP
|
||||
Note that you can omit the reminder type, in which case it
|
||||
defaults to \fBMSG\fR. So you can write:
|
||||
.PP
|
||||
.nf
|
||||
6 January David's Birthday
|
||||
.fi
|
||||
.PP
|
||||
although this is not recommended.
|
||||
.PP
|
||||
The \fBMSF\fR keyword is almost the same as the \fBMSG\fR keyword,
|
||||
except that the reminder is formatted to fit into a paragraph-like
|
||||
format. Three system variables control the formatting of \fBMSF\fR-type
|
||||
@@ -320,6 +346,15 @@ programmer. The \fBPS\fR and \fBPSFILE\fR reminders are ignored unless
|
||||
\fBRemind\fR is run with the \fB\-p\fR option. See the section
|
||||
"More about PostScript" for more details.
|
||||
.PP
|
||||
A \fBSPECIAL\fR-type reminder is used to pass "out-of-band" information
|
||||
from \fBRemind\fR to a calendar-producing back-end. It should be followed
|
||||
by a word indicating the type of special data being passed. The type
|
||||
of a special reminder depends on the back-end. For the \fBRem2PS\fR
|
||||
back-end, \fBSPECIAL PostScript\fR is equivalent to a \fBPS\fR-type
|
||||
reminder, and \fBSPECIAL PSFile\fR is equivalent to a \fBPSFILE\fR-type
|
||||
reminder. The body of a \fBSPECIAL\fR reminder is obviously dependent
|
||||
upon the back-end.
|
||||
.PP
|
||||
.B DATE SPECIFICATIONS
|
||||
.PP
|
||||
A \fIdate_spec\fR consists of zero to four parts.
|
||||
@@ -790,6 +825,29 @@ However, discussion must be deferred until after
|
||||
expressions and user-defined functions are explained. See the subsection
|
||||
"Precise Scheduling" further on.
|
||||
.PP
|
||||
.B TAG AND DURATION
|
||||
.PP
|
||||
The \fBTAG\fR keyword lets you "tag" certain reminders. This facility
|
||||
is used by certain back-ends or systems built around \fBRemind\fR,
|
||||
such as \fBTkRemind\fR. These back-ends have specific rules about
|
||||
tags; you should \fInot\fR use the \fBTAG\fR keyword yourself, or
|
||||
your script will interact badly with back-ends.
|
||||
.PP
|
||||
The \fBTAG\fR keyword is followed by a tag consisting of up to
|
||||
32 characters.
|
||||
.PP
|
||||
The \fBDURATION\fR keyword makes sense only for timed reminders;
|
||||
it specifies the duration of an event. Currently, this is not
|
||||
used, but it may be used in future by back-ends or scheduling
|
||||
systems built around \fBRemind\fR. For example, if you have
|
||||
a 90-minute meeting starting at 1:00pm, you could use:
|
||||
.PP
|
||||
.nf
|
||||
REM 5 March 1999 AT 13:00 DURATION 1:30 MSG Meeting
|
||||
.fi
|
||||
.PP
|
||||
Note that \fIduration\fR is specified in hours and minutes.
|
||||
.PP
|
||||
.SH THE SUBSTITUTION FILTER
|
||||
.PP
|
||||
Before being processed, the body of a
|
||||
@@ -1010,7 +1068,7 @@ is similar to \fB%3\fR but displays the current time.
|
||||
.TP
|
||||
.B
|
||||
%"
|
||||
(percent-doublequote) is removed. This sequence is not
|
||||
(percent-doublequote - ") is removed. This sequence is not
|
||||
used by the substitution filter,
|
||||
but is used to tell \fBRemind\fR which text to include in a calendar
|
||||
entry when the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR option is chosen.
|
||||
@@ -1167,7 +1225,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 +1260,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:
|
||||
@@ -1821,6 +1885,10 @@ converted using the reverse of procedures described above. A
|
||||
The \fBdate()\fR function returns a \fBDATE\fR object with the year,
|
||||
month and day components specified by \fIy\fR, \fIm\fR and \fId\fR.
|
||||
.TP
|
||||
.B dawn([d_date])
|
||||
Returns the time of "civil dawn" on the specified \fIdate\fR. If \fIdate\fR
|
||||
is omitted, defaults to \fBtoday()\fR.
|
||||
.TP
|
||||
.B day(d_date)
|
||||
This function takes a \fBDATE\fR as an argument, and returns an \fBINT\fR
|
||||
which is the day-of-month component of \fIdate\fR.
|
||||
@@ -1865,6 +1933,10 @@ will produce undefined results.
|
||||
\fBRemind\fR.
|
||||
.RE
|
||||
.TP
|
||||
.B dusk([d_date])
|
||||
Returns the time of "civil twilight" on the specified \fIdate\fR. If
|
||||
\fIdate\fR is omitted, defaults to \fBtoday()\fR.
|
||||
.TP
|
||||
.B easterdate(di_arg)
|
||||
If \fIarg\fR is an \fBINT\fR, then returns the date of Easter Sunday
|
||||
for the specified year. If \fIarg\fR is a \fBDATE\fR, then returns the
|
||||
@@ -2120,6 +2192,10 @@ Here's an example of how to use this:
|
||||
.PP
|
||||
The above command emits PostScript code to lightly shade the boxes
|
||||
for Saturday and Sunday in a PostScript calendar.
|
||||
.PP
|
||||
Note that \fBpsmoon\fR and \fBpsshade\fR are deprecated; instead
|
||||
you should use the SPECIAL SHADE and SPECIAL MOON reminders
|
||||
as described in "Out-of-Band Reminders."
|
||||
.RE
|
||||
.TP
|
||||
.B realnow()
|
||||
@@ -2136,13 +2212,18 @@ in calendar mode, or if a date has been supplied on the command line.
|
||||
Returns -1 if \fInum\fR is negative, 1 if \fInum\fR is positive,
|
||||
and 0 if \fInum\fR is zero.
|
||||
.TP
|
||||
.B shell(s_cmd)
|
||||
.B shell(s_cmd [,i_maxlen])
|
||||
Executes \fIcmd\fR as a system command, and returns the first 511
|
||||
characters of output resulting from \fIcmd\fR. Any whitespace
|
||||
character in the output is converted to a space. Note that if \fBRUN
|
||||
OFF\fR has been executed, or the \fB\-r\fR command-line option has
|
||||
been used, \fBshell()\fR will result in an error, and \fIcmd\fR will
|
||||
not be executed.
|
||||
.PP
|
||||
If \fImaxlen\fR is specified, then \fBshell()\fR returns the first
|
||||
\fImaxlen\fR characters of output (rather than the first 511). If
|
||||
\fImaxlen\fR is specified as a negative number, then \fIall\fR the
|
||||
output from \fIcmd\fR is returned.
|
||||
.TP
|
||||
.B strlen(s_str)
|
||||
Returns the length of \fIstr\fR.
|
||||
@@ -2157,13 +2238,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
|
||||
@@ -2814,7 +2896,7 @@ and then inserted into the calendar in the appropriate places.
|
||||
If you also supply the \fB\-a\fR option, then \fBRemind\fR will not
|
||||
include timed reminders in the calendar.
|
||||
.PP
|
||||
The \fB\-p\fR option is used in conjunction with the \fBrem2ps\fR
|
||||
The \fB\-p\fR option is used in conjunction with the \fBRem2PS\fR
|
||||
program to produce a calendar in PostScript format. For example, the
|
||||
following command will send PostScript code to standard output:
|
||||
.PP
|
||||
@@ -2963,7 +3045,7 @@ The \fBPS\fR and \fBPSFILE\fR reminders pass PostScript code directly
|
||||
to the printer. They differ in that the \fBPS\fR-type reminder passes
|
||||
its body directly to the PostScript output (after processing by the
|
||||
substitution filter) while the \fBPSFILE\fR-type's body should
|
||||
simply consist of a filename. The \fBRem2ps\fR program will open the
|
||||
simply consist of a filename. The \fBRem2PS\fR program will open the
|
||||
file named in the \fBPSFILE\fR-type reminder, and include its contents in
|
||||
the PostScript output.
|
||||
.PP
|
||||
@@ -3410,6 +3492,59 @@ The jahrzeit information was supplied by Frank Yellin, who quoted
|
||||
"The Comprehensive Hebrew Calendar" by Arthur Spier, and "Calendrical
|
||||
Calculations" by E. M. Reingold and Nachum Dershowitz.
|
||||
.PP
|
||||
.SH OUT-OF-BAND REMINDERS
|
||||
.PP
|
||||
The \fBSPECIAL\fR keyword is used to transmit "out-of-band" information
|
||||
to \fBRemind\fR backends, such as \fBtkremind\fR or \fBRem2PS\fR.
|
||||
They are used only when piping data from a \fBremind -p\fR line.
|
||||
.PP
|
||||
The various \fBSPECIAL\fRs recognized are particular for each
|
||||
backend; however, there are two \fBSPECIAL\fRs which all backends
|
||||
should attempt to support. They are currently supported by
|
||||
\fBRem2PS\fR, \fBtkremind\fR and \fBrem2html\fR.
|
||||
.PP
|
||||
The \fBSHADE\fR special replaces the \fBpsshade()\fR function.
|
||||
Use it like this:
|
||||
.nf
|
||||
REM Sat Sun SPECIAL SHADE 128
|
||||
REM Mon SPECIAL SHADE 255 0 0
|
||||
.fi
|
||||
The \fBSHADE\fR keyword is followed by either one or three numbers,
|
||||
from 0 to 255. If one number is supplied, it is interpreted as
|
||||
a grey-scale value from black (0) to white (255). If three numbers
|
||||
are supplied, they are interpreted as RGB components from minimum (0)
|
||||
to maximum (255). The example above shades weekends a fairly dark
|
||||
grey and makes Mondays a fully-saturated red. (These shadings appear
|
||||
in calendars produced by \fBRem2PS\fR, \fBtkremind\fR and \fBrem2html\fR.)
|
||||
.PP
|
||||
The \fBMOON\fR special replaces the \fBpsmoon()\fR function. Use it
|
||||
like this:
|
||||
.nf
|
||||
REM [trigger(moondate(0))] SPECIAL MOON 0
|
||||
REM [trigger(moondate(1))] SPECIAL MOON 1
|
||||
REM [trigger(moondate(2))] SPECIAL MOON 2
|
||||
REM [trigger(moondate(3))] SPECIAL MOON 3
|
||||
.fi
|
||||
These draw little moons on the various calendars. The complete syntax
|
||||
of the \fBMOON\fR special is as follows:
|
||||
.nf
|
||||
... SPECIAL MOON phase moonsize fontsize msg
|
||||
.fi
|
||||
.PP
|
||||
\fIPhase\fR is a number from 0 to 3, with 0 representing a new moon,
|
||||
1 the first quarter, 2 a full moon and 3 the last quarter.
|
||||
.PP
|
||||
\fImoonsize\fR is the diameter in PostScript units of the moon to
|
||||
draw. If omitted or supplied as -1, the backend chooses an appropriate
|
||||
size.
|
||||
.PP
|
||||
\fIfontsize\fR is the font size in PostScript units of the \fImsg\fR
|
||||
.PP
|
||||
\fIMsg\fR is additional text which is placed near the moon glyph.
|
||||
.PP
|
||||
Note that only the \fBRem2PS\fR backend supports \fImoonsize\fR
|
||||
and \fIfontsize\fR; the other backends use fixed sizes.
|
||||
.PP
|
||||
.SH MISCELLANEOUS
|
||||
.PP
|
||||
.B COMMAND ABBREVIATIONS
|
||||
@@ -3583,15 +3718,19 @@ Note that this behaviour is not true for
|
||||
versions of \fBRemind\fR prior to 03.00.01.
|
||||
.SH AUTHOR
|
||||
.PP
|
||||
David F. Skoll wrote \fBRemind\fR. The moon code was copied largely
|
||||
unmodified from "moontool" by John Walker. The sunrise and sunset
|
||||
functions use ideas from programs by Michael Schwartz and Marc
|
||||
T. Kaufman. The Hebrew calendar support was taken from "hdate" by
|
||||
Amos Shapir. OS/2 support was done by Darrel Hankerson, Russ Herman,
|
||||
and Norman Walsh. The supported foreign languages and their
|
||||
translators are listed below. Languages marked "complete" support
|
||||
error messages and usage instructions in that language; all others
|
||||
only support the substitution filter mechanism and month/day names.
|
||||
Remind is now supported by Roaring Penguin Software
|
||||
Inc. (http://www.roaringpenguin.com)
|
||||
.PP
|
||||
David F. Skoll <dfs@roaringpenguin.com> wrote \fBRemind\fR. The moon code
|
||||
was copied largely unmodified from "moontool" by John Walker. The
|
||||
sunrise and sunset functions use ideas from programs by Michael
|
||||
Schwartz and Marc T. Kaufman. The Hebrew calendar support was taken
|
||||
from "hdate" by Amos Shapir. OS/2 support was done by Darrel
|
||||
Hankerson, Russ Herman, and Norman Walsh. The supported foreign
|
||||
languages and their translators are listed below. Languages marked
|
||||
"complete" support error messages and usage instructions in that
|
||||
language; all others only support the substitution filter mechanism
|
||||
and month/day names.
|
||||
.PP
|
||||
\fBGerman\fR --
|
||||
Wolfgang Thronicke
|
||||
@@ -3619,6 +3758,12 @@ Marco Paganini (complete)
|
||||
.PP
|
||||
\fBItalian\fR --
|
||||
Valerio Aimale
|
||||
.PP
|
||||
\fBRomanian\fR --
|
||||
Liviu Daia
|
||||
.PP
|
||||
\fBSpanish\fR --
|
||||
Rafa Couto
|
||||
.SH BUGS
|
||||
.PP
|
||||
There's no good reason why read-only system variables are not
|
||||
@@ -3635,8 +3780,8 @@ The UTC functions may not be reliable under MS-DOS.
|
||||
The MS-DOS version of \fBRemind\fR does not support queuing or timed
|
||||
activation of reminders.
|
||||
.PP
|
||||
\fBRemind\fR has some built-in limits on total line length,
|
||||
substitution buffer length, number of global \fBOMIT\fRs, etc.
|
||||
\fBRemind\fR has some built-in limits (for example,
|
||||
number of global \fBOMIT\fRs.)
|
||||
.PP
|
||||
.SH BIBLIOGRAPHY
|
||||
.PP
|
||||
@@ -1,5 +1,5 @@
|
||||
.\" $Id: tkremind.1,v 1.4 1996-09-28 18:46:57 dfs Exp $ "
|
||||
.TH TKREMIND 1 "7 July 1996"
|
||||
.\" $Id: tkremind.1,v 1.9 2000-03-15 15:51:39 dfs Exp $ "
|
||||
.TH TKREMIND 1 "15 February 1998"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
tkremind \- graphical front-end to Remind calendar program
|
||||
@@ -14,9 +14,8 @@ Although not all of \fBRemind\fR's features are available with \fBTkRemind\fR,
|
||||
it creates. This allows you to learn \fBRemind\fR's syntax and then add
|
||||
extra features as you become a more sophisticated \fBRemind\fR programmer.
|
||||
|
||||
\fBTkRemind\fR is written in TCL, and requires tcl version 7.4 and tk
|
||||
version 4.0. It also requires a \fBwish\fR binary. \fBTkRemind\fR runs
|
||||
only under UNIX, and requires X-Windows.
|
||||
\fBTkRemind\fR is written in Tcl, and requires version 8.0
|
||||
(or higher). It also requires a \fBwish\fR binary.
|
||||
|
||||
.SH OPTIONS
|
||||
\fBTkRemind\fR itself has no options. However, it passes certain options
|
||||
@@ -50,16 +49,14 @@ is no specific indication of an over-full box; you'll just have to
|
||||
notice that the box appears completely full.
|
||||
|
||||
.SH NAVIGATING
|
||||
To change to the previous or next month, click the \fBPrevious
|
||||
Month\fR or \fBNext Month\fR button, respectively. To change back to
|
||||
To change to the previous or next month, click the \fB<\-\fR
|
||||
or \fB\->\fR button, respectively. To change back to
|
||||
the current month, click \fBToday\fR. To go to a specific month,
|
||||
click \fBGo To Date...\fR. This pops up a dialog box which allows you
|
||||
to select a month and enter a year. Once you've done this, click
|
||||
\fBGo\fR to go to the date, or \fBCancel\fR to cancel.
|
||||
|
||||
To exit \fBTkRemind\fR, click \fBQuit\fR. By default, TkRemind
|
||||
does not ask for confirmation. If it has been configured
|
||||
to ask for confirmation, click \fBYes\fR in the dialog box which pops up.
|
||||
To exit \fBTkRemind\fR, click \fBQuit\fR.
|
||||
|
||||
.SH ADDING REMINDERS
|
||||
To add a reminder, click button 1 in any day number in the calendar.
|
||||
@@ -74,7 +71,7 @@ appear when you click the raised value buttons.
|
||||
|
||||
The next control specifies an expiry date for the reminder. Select
|
||||
the check button to enable an expiry date, and fill in the values
|
||||
using pull pull-down menus.
|
||||
using pull-down menus.
|
||||
|
||||
The third control specifes how much advance notice you want (if any),
|
||||
and whether or not weekends and holidays are counted when computing advance
|
||||
@@ -132,18 +129,92 @@ 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 EDITING REMINDERS
|
||||
|
||||
If you created a reminder with \fBTkRemind\fR, it will turn red as the
|
||||
mouse cursor passes over it in the calendar window. Click
|
||||
button-1 over the reminder and you will be presented with a dialog
|
||||
window whose state is identical to the one used to create the reminder.
|
||||
At this point, you can change the reminder by editing the dialog
|
||||
entries and selecting \fBReplace reminder\fR. You can delete the
|
||||
reminder entirely by selecting \fBDelete reminder\fR. The remaining
|
||||
buttons, \fBPreview reminder\fR and \fBCancel\fR operate identically
|
||||
to the dialog in "ADDING REMINDERS."
|
||||
|
||||
Note that if you edit a reminder (using \fBPreview reminder\fR),
|
||||
any edits you made are \fInot\fR retained in the dialog box. You
|
||||
should not attempt to edit such reminders; you have to retype them
|
||||
in the \fBPreview reminder\fR dialog.
|
||||
|
||||
If the reminder was not created with \fBTkRemind\fR, you can't edit
|
||||
it with \fBTkRemind\fR.
|
||||
|
||||
.SH BACKGROUND REMINDERS
|
||||
|
||||
If you create "timed" reminders, \fBTkRemind\fR will queue them in
|
||||
the background and pop up boxes as they are triggered. Additionally,
|
||||
if you created the reminder using \fBTkRemind\fR, you will be given the
|
||||
option of "turning off" the reminder for the rest of the day.
|
||||
\fBTkRemind\fR achieves queueing of background reminders by running
|
||||
\fBRemind\fR in \fIserver mode\fR, described later.
|
||||
|
||||
.SH OPTIONS
|
||||
|
||||
The final button on the calendar window, \fBOptions\fR, lets you configure
|
||||
certain aspects of \fBTkRemind\fR. The configuration options are:
|
||||
|
||||
.TP
|
||||
.B Start up Iconified
|
||||
If this is selected, \fBTkRemind\fR starts up iconified. Otherwise,
|
||||
it starts up in a normal window.
|
||||
|
||||
.TP
|
||||
.B Confirm Quit
|
||||
If this is selected, you will be asked to confirm when you press
|
||||
\fBQuit\fR. If not, \fBTkRemind\fR quits without prompting.
|
||||
|
||||
.TP
|
||||
.B Automatically close pop-up reminders after a minute
|
||||
If this is selected, pop-up reminder boxes will be closed after one minute
|
||||
has elapsed. Otherwise, they remain on your screen forever until you
|
||||
explicitly dismiss them.
|
||||
|
||||
.TP
|
||||
.B Beep terminal when popping up a reminder
|
||||
If selected, \fBTkRemind\fR beeps the terminal bell when a queued reminder
|
||||
pops up.
|
||||
|
||||
.TP
|
||||
.B Deiconify calendar window when popping up a reminder
|
||||
If selected, does what it says.
|
||||
|
||||
.TP
|
||||
.B Run command when popping up a reminder
|
||||
If this entry is not blank, the specified command is run whenever a
|
||||
background reminder pops up.
|
||||
|
||||
.TP
|
||||
.B Feed popped-up reminder to command's standard input
|
||||
If selected, feeds the text of the reminder to the command described
|
||||
above.
|
||||
.PP
|
||||
Once you've configured the options the way you like them,
|
||||
press \fBApply Options\fR to put them into effect, \fBSave Options\fR
|
||||
to put them into effect and save them in $HOME/.tkremindrc, or
|
||||
\fBCancel\fR to cancel any changes you made.
|
||||
|
||||
.SH ODDS AND ENDS
|
||||
\fBTkRemind\fR performs some basic consistency checks when you add or
|
||||
preview a reminder. However, if you edit a reminder in the previewer,
|
||||
\fBTkRemind\fR does \fInot\fR check the edited reminder. You can
|
||||
produce illegal reminders which may cause problems. (This is one good
|
||||
reason to isolate \fBTkRemind\fR's reminders in a separate file.)
|
||||
|
||||
.PP
|
||||
\fBTkRemind\fR does \fInot\fR check the body of the reminder in any
|
||||
way. You can use the normal \fBRemind\fR substitution sequences in
|
||||
the body. Furthermore, if you use expression-pasting in the body,
|
||||
\fBTkRemind\fR does \fInot\fR validate the expressions.
|
||||
|
||||
.PP
|
||||
When \fBTkRemind\fR invokes \fBRemind\fR, it supplies the option:
|
||||
.PP
|
||||
.nf
|
||||
@@ -160,11 +231,94 @@ on the command line. So, in your \fBRemind\fR file, you can include:
|
||||
.PP
|
||||
You can use this to activate certain reminders in different ways
|
||||
for \fBTkRemind\fR (for example).
|
||||
.PP
|
||||
\fBTkRemind\fR uses tags to keep track of reminders in the
|
||||
script file. It also places special comments in the reminder
|
||||
file to store additional state. You can certainly mix
|
||||
"hand-crafted" reminders with reminders created by \fBTkRemind\fR
|
||||
if you are awared of the following rules and limitations:
|
||||
.TP
|
||||
o
|
||||
Do not use the \fBTAG\fR keyword in hand-crafted reminders.
|
||||
.TP
|
||||
o
|
||||
Do not edit lines starting with "# TKTAGnnn", "# TKEND", or any
|
||||
lines in between. You can move such lines, but be careful to move
|
||||
them as a single block.
|
||||
.TP
|
||||
o
|
||||
Hand-crafted reminders cannot be edited with \fBTkRemind\fR, and
|
||||
for hand-crafted timed reminders, you will not be presented with
|
||||
the "Don't remind me again" option when they pop up.
|
||||
|
||||
.SH SERVER MODE
|
||||
|
||||
\fBRemind\fR has a special mode for interacting with programs like
|
||||
\fBTkRemind\fR. This mode is called \fIserver mode\fR and is
|
||||
selected by supplying the \fB\-z0\fR option to \fBRemind\fR.
|
||||
|
||||
In server mode, \fBRemind\fR operates similar to daemon mode, except
|
||||
it reads commands (one per line)
|
||||
from standard input and writes status lines to standard output.
|
||||
|
||||
The commands accepted in server mode are:
|
||||
|
||||
.TP
|
||||
EXIT
|
||||
Terminate the \fBRemind\fR process. EOF on standard input does the
|
||||
same thing.
|
||||
|
||||
.TP
|
||||
STATUS
|
||||
Return the number of queued reminders.
|
||||
|
||||
.TP
|
||||
REREAD
|
||||
Re-read the reminder file
|
||||
|
||||
.PP
|
||||
The status lines written are as follows:
|
||||
|
||||
.TP
|
||||
NOTE reminder \fItime\fR \fItag\fR
|
||||
Signifies the beginning of a timed reminder whose trigger time is
|
||||
\fItime\fR with tag \fItag\fR. If the reminder has no tag, an
|
||||
asterisk is supplied for \fItag\fR. All lines following this line
|
||||
are the body of the reminder, until the line \fBNOTE endreminder\fR
|
||||
is transmitted.
|
||||
|
||||
.TP
|
||||
NOTE newdate
|
||||
This line is emitted whenever \fBRemind\fR has detected a rollover of
|
||||
the system date. The front-end program should redraw its calendar
|
||||
or take whatever other action is needed.
|
||||
|
||||
.TP
|
||||
NOTE reread
|
||||
This line is emitted whenever the number of reminders in \fBRemind\fR's
|
||||
queue changes because of a date rollover or a \fBREREAD\fR command.
|
||||
The front-end should issue a \fBSTATUS\fR command in response to this
|
||||
message.
|
||||
|
||||
.TP
|
||||
NOTE queued \fIn\fR
|
||||
This line is emitted in response to a \fBSTATUS\fR command. The number
|
||||
\fIn\fR is the number of reminders in the queue.
|
||||
|
||||
.SH AUTHOR
|
||||
David F. Skoll
|
||||
TkRemind is now supported by Roaring Penguin Software
|
||||
Inc. (http://www.roaringpenguin.com)
|
||||
.PP
|
||||
TkRemind was written by David F. Skoll <dfs@roaringpenguin.com>.
|
||||
|
||||
\fBTkRemind\fR is Copyright 1996 by David F. Skoll
|
||||
\fBTkRemind\fR is Copyright 1996-1998 by David F. Skoll, Copyright
|
||||
1999 by Roaring Penguin Software Inc.
|
||||
|
||||
.SH FILES
|
||||
|
||||
$HOME/.reminders -- default reminder file.
|
||||
|
||||
$HOME/.tkremindrc -- \fBTkRemind\fR saved options.
|
||||
|
||||
.SH SEE ALSO
|
||||
remind, rem2ps
|
||||
@@ -1,24 +1,23 @@
|
||||
Begin3
|
||||
Title: Remind
|
||||
Version: 03.00.15
|
||||
Entered-date: 27 October 1996
|
||||
Version: 03.00.21
|
||||
Entered-date: 12 Apr 1999
|
||||
Description: Full-featured calendar/reminder program featuring
|
||||
sophisticated date calculation, moon phases, sunrise/sunset,
|
||||
Hebrew calendar, alarms, PostScript output, X-Windows
|
||||
front-end, multilingual messages, and proper handling of
|
||||
holidays. Available for UNIX, MS-DOS, OS/2, and other
|
||||
platforms.
|
||||
Keywords: calendar reminder alarm datebook PostScript
|
||||
Author: aa775@freenet.carleton.ca (David F. Skoll)
|
||||
Maintained-by: aa775@freenet.carleton.ca (David F. Skoll)
|
||||
platforms. Includes scripts for making a nice WWW
|
||||
calendar server.
|
||||
Keywords: calendar reminder alarm datebook PostScript www
|
||||
Author: dskoll@iname.com (David F. Skoll)
|
||||
Maintained-by: dskoll@iname.com (David F. Skoll)
|
||||
Primary-site: ftp.doe.carleton.ca /pub/Remind-3.0
|
||||
215kB remind-3.0.15.tgz
|
||||
304kB remind-3.0.21.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
|
||||
system. Wish 8.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.
|
||||
Copying-policy: GPL
|
||||
End
|
||||
10
scripts/README
Normal file
10
scripts/README
Normal file
@@ -0,0 +1,10 @@
|
||||
Files in this directory:
|
||||
|
||||
kall -- Kills a program by command name, as in "kall remind"
|
||||
rem -- Starts Remind with a default file of $HOME/.reminders
|
||||
remind-all.csh -- Mails reminders to all users (C-Shell version)
|
||||
remind-all.sh -- Mails reminders to all users (Bourne Shell version)
|
||||
tkremind* -- Tcl/Tk graphical calendar using Remind as engine
|
||||
|
||||
$Id: README,v 1.1 1998-01-15 02:50:20 dfs Exp $
|
||||
|
||||
361
scripts/cm2rem.tcl
Executable file
361
scripts/cm2rem.tcl
Executable file
@@ -0,0 +1,361 @@
|
||||
#!/bin/sh
|
||||
# -*-Mode: TCL;-*-
|
||||
|
||||
#--------------------------------------------------------------
|
||||
# cm2rem.tcl
|
||||
#
|
||||
# A cheesy Tcl script to convert Sun's "cm" calendar manager
|
||||
# files (version 3 only) to Remind format.
|
||||
#
|
||||
# This file is part of REMIND.
|
||||
# Copyright (C) 1992-1998 by David F. Skoll
|
||||
# Copyright (C) 1999-2000 by Roaring Penguin Software Inc.
|
||||
#
|
||||
#--------------------------------------------------------------
|
||||
|
||||
# $Id: cm2rem.tcl,v 1.3 2000-02-18 03:45:38 dfs Exp $
|
||||
|
||||
# the next line restarts using tclsh \
|
||||
exec tclsh "$0" "$@"
|
||||
|
||||
set i 0
|
||||
foreach month {January February March April May June
|
||||
July August September October November December} {
|
||||
incr i
|
||||
set MonthNum($month) $i
|
||||
set FullMonth([string range $month 0 2]) $month
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertParens
|
||||
# %ARGUMENTS:
|
||||
# line -- a line read from a cm file
|
||||
# %RETURNS:
|
||||
# A new line with all ( and ) outside quotes converted to { and }.
|
||||
# This cheap trick allows us to use Tcl's built-in list manipulation
|
||||
# functions to munge the line.
|
||||
#***********************************************************************
|
||||
proc convertParens { line } {
|
||||
# Convert all ( and ) to { and } unless they are inside a quoted
|
||||
# string
|
||||
set out ""
|
||||
set len [string length $line]
|
||||
set inQuotes 0
|
||||
for {set i 0} {$i < $len} {incr i} {
|
||||
set char [string range $line $i $i]
|
||||
if {$char == "\\" && $inQuotes} {
|
||||
append out $char
|
||||
incr i
|
||||
set char [string range $line $i $i]
|
||||
append out $char
|
||||
continue
|
||||
}
|
||||
|
||||
if {$char == "(" && !$inQuotes} {
|
||||
set char \{
|
||||
}
|
||||
|
||||
if {$char == ")" && !$inQuotes} {
|
||||
set char \}
|
||||
}
|
||||
|
||||
if {$char == "\""} {
|
||||
set inQuotes [expr !$inQuotes]
|
||||
}
|
||||
|
||||
append out $char
|
||||
}
|
||||
return $out
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: processLine
|
||||
# %ARGUMENTS:
|
||||
# line -- a line read from a cm file
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Processes a single line from the file, possibly writing a reminder
|
||||
# in Remind format to stdout
|
||||
#***********************************************************************
|
||||
proc processLine { line } {
|
||||
global Attributes
|
||||
global FullMonth
|
||||
|
||||
catch {unset Attributes}
|
||||
|
||||
# Only convert lines which start with "(add"
|
||||
if {[string range $line 0 3] != "(add"} {
|
||||
return
|
||||
}
|
||||
set line [convertParens $line]
|
||||
# Convert it to a list. CAREFUL: Potential security problem if
|
||||
# $line contains something nasty.
|
||||
|
||||
eval set line $line
|
||||
|
||||
set Attributes(body) ""
|
||||
foreach {key val} $line {
|
||||
switch -exact -- $key {
|
||||
"add" {
|
||||
set Attributes(date) $val
|
||||
}
|
||||
"what:" {
|
||||
append Attributes(body) $val
|
||||
}
|
||||
"details:" {
|
||||
append Attributes(body) $val
|
||||
}
|
||||
"duration:" {
|
||||
set Attributes(duration) $val
|
||||
}
|
||||
"period:" {
|
||||
set Attributes(period) $val
|
||||
}
|
||||
"ntimes:" {
|
||||
set Attributes(ntimes) $val
|
||||
}
|
||||
"attributes:" {
|
||||
set Attributes(action) $val
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if {[info exists Attributes(action)]} {
|
||||
# Nuke quotes and commas in action
|
||||
regsub -all {[,\"]} $Attributes(action) { } Attributes(action)
|
||||
|
||||
# Add spaces to pairs
|
||||
regsub -all \}\{ $Attributes(action) \}\ \{ Attributes(action)
|
||||
|
||||
# Add another pair of brackets to make a proper list
|
||||
set Attributes(action) "{$Attributes(action)}"
|
||||
|
||||
# Convert to a real Tcl list
|
||||
eval set Attributes(action) $Attributes(action)
|
||||
}
|
||||
# Split out date into month, day, year, time parts
|
||||
scan $Attributes(date) "%s%s%s%s%s" wkday month day time year
|
||||
set time [string range $time 0 4]
|
||||
set Attributes(wkday) $wkday
|
||||
set Attributes(month) $FullMonth($month)
|
||||
set Attributes(day) $day
|
||||
set Attributes(time) $time
|
||||
set Attributes(year) $year
|
||||
|
||||
# Convert newlines in body to spaces
|
||||
set body $Attributes(body)
|
||||
regsub -all "\n" $body " " body
|
||||
|
||||
# TODO: Escape BODY to get rid of [] chars.
|
||||
set Attributes(body) $body
|
||||
|
||||
# Convert to Reminder format
|
||||
convertReminder
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertReminder {} {
|
||||
global Attributes
|
||||
switch -exact $Attributes(period) {
|
||||
single { convertSingleReminder }
|
||||
daily { convertDailyReminder }
|
||||
weekly { convertWeeklyReminder }
|
||||
monthly { convertMonthlyReminder }
|
||||
yearly { convertYearlyReminder }
|
||||
default {
|
||||
puts "\# Unable to convert reminder with period $Attributes(period)"
|
||||
puts "\# Body is: $Attributes(body)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertSingleReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "single" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertSingleReminder {} {
|
||||
global Attributes
|
||||
puts "REM $Attributes(day) $Attributes(month) $Attributes(year) [at][duration]MSG $Attributes(body)"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertDailyReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "daily" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertDailyReminder {} {
|
||||
global Attributes
|
||||
set ntimes [expr $Attributes(ntimes) - 1]
|
||||
if {$ntimes <= 1} {
|
||||
convertSingleReminder
|
||||
return
|
||||
}
|
||||
set until [getUntilDate $Attributes(day) $Attributes(month) $Attributes(year) $ntimes]
|
||||
|
||||
puts "REM $Attributes(day) $Attributes(month) $Attributes(year) *1 [at][duration]UNTIL $until MSG $Attributes(body)"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertWeeklyReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "daily" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertWeeklyReminder {} {
|
||||
global Attributes
|
||||
set ntimes [expr $Attributes(ntimes) - 1]
|
||||
if {$ntimes <= 1} {
|
||||
convertSingleReminder
|
||||
return
|
||||
}
|
||||
set until [getUntilDate $Attributes(day) $Attributes(month) $Attributes(year) [expr $ntimes * 7]]
|
||||
|
||||
puts "REM $Attributes(day) $Attributes(month) $Attributes(year) *7 [at][duration]UNTIL $until MSG $Attributes(body)"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertMonthlyReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "monthly" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertMonthlyReminder {} {
|
||||
global Attributes
|
||||
set ntimes [expr $Attributes(ntimes) - 1]
|
||||
if {$ntimes <= 1} {
|
||||
convertSingleReminder
|
||||
return
|
||||
}
|
||||
|
||||
# If repetition > 1000, it's infinite
|
||||
if {$ntimes > 1000} {
|
||||
puts "REM $Attributes(day) [at][duration]MSG $Attributes(body)"
|
||||
return
|
||||
}
|
||||
|
||||
### UNTIL date is fudged!
|
||||
set until [getUntilDate $Attributes(day) $Attributes(month) $Attributes(year) [expr $ntimes * 30]]
|
||||
|
||||
puts "REM $Attributes(day) [at][duration]UNTIL $until MSG $Attributes(body)"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertYearlyReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "yearly" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertYearlyReminder {} {
|
||||
global Attributes
|
||||
|
||||
# No special handling of ntimes et al.
|
||||
puts "REM $Attributes(day) $Attributes(month) [at][duration]MSG $Attributes(body)"
|
||||
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: at
|
||||
# %ARGUMENTS:
|
||||
# None -- uses Attributes global variable
|
||||
# %RETURNS:
|
||||
# A string providing the correct AT clause for a timed reminder.
|
||||
#***********************************************************************
|
||||
proc at {} {
|
||||
global Attributes
|
||||
if {![info exists Attributes(time)]} {
|
||||
return ""
|
||||
}
|
||||
if {"$Attributes(time)" == ""} {
|
||||
return ""
|
||||
}
|
||||
|
||||
return "AT $Attributes(time) "
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: duration
|
||||
# %ARGUMENTS:
|
||||
# None -- uses Attributes global variable
|
||||
# %RETURNS:
|
||||
# A string providing the correct DURATION clause for a timed reminder.
|
||||
#***********************************************************************
|
||||
proc duration {} {
|
||||
global Attributes
|
||||
if {![info exists Attributes(duration)]} {
|
||||
return ""
|
||||
}
|
||||
if {"$Attributes(duration)" == ""} {
|
||||
return ""
|
||||
}
|
||||
set h [expr $Attributes(duration) / 3600]
|
||||
set remainder [expr $Attributes(duration) - $h*3600]
|
||||
set m [expr $remainder / 60]
|
||||
return "DURATION [format "%d:%02d " $h $m]"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: getUntilDate
|
||||
# %ARGUMENTS:
|
||||
# day, month, year -- a date
|
||||
# days -- number of days to add to date
|
||||
# %RETURNS:
|
||||
# The date which is "days" later than supplied date in a correct UNTIL
|
||||
# format.
|
||||
#***********************************************************************
|
||||
proc getUntilDate { day month year days } {
|
||||
global RemindPipe
|
||||
global MonthNum
|
||||
set date "'$year/$MonthNum($month)/$day'"
|
||||
puts $RemindPipe "MSG \[trigger($date + $days)\]%"
|
||||
puts $RemindPipe "flush"
|
||||
flush $RemindPipe
|
||||
gets $RemindPipe line
|
||||
return $line
|
||||
}
|
||||
|
||||
catch {wm withdraw .}
|
||||
# Start a Remind process to issue reminders
|
||||
if {[catch {set RemindPipe [open "|remind -" "r+"]} err]} {
|
||||
puts stderr "Error: Cannot run Remind: $err"
|
||||
exit 1
|
||||
}
|
||||
|
||||
puts $RemindPipe "banner %"
|
||||
flush $RemindPipe
|
||||
|
||||
# Write some blurb
|
||||
puts "\# Reminder file converted from \"cm\" data by cm2rem.tcl"
|
||||
puts ""
|
||||
|
||||
while {[gets stdin line] >= 0} {
|
||||
processLine $line
|
||||
}
|
||||
exit 0
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id: kall,v 1.1 1996-03-27 03:25:59 dfs Exp $
|
||||
# $Id: kall,v 1.1 1998-01-15 02:50:20 dfs Exp $
|
||||
#
|
||||
# kall - kill all processes belonging to this user that match
|
||||
# specified string.
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# rem - by David Skoll - 26 February 1991
|
||||
#
|
||||
# $Id: rem,v 1.1 1996-03-27 03:26:06 dfs Exp $
|
||||
# $Id: rem,v 1.1 1998-01-15 02:50:21 dfs Exp $
|
||||
#
|
||||
# This script runs 'remind' with a default reminder file assumed. You
|
||||
# can override the default by using "rem -F newfile ..." (But why would
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# Shell script to mail all users reminders.
|
||||
|
||||
# $Id: remind-all.csh,v 1.1 1996-03-27 03:26:08 dfs Exp $
|
||||
# $Id: remind-all.csh,v 1.1 1998-01-15 02:50:21 dfs Exp $
|
||||
|
||||
# Run it AFTER MIDNIGHT so that date is correct!
|
||||
# On our system, we have the following in our crontab:
|
||||
@@ -3,9 +3,10 @@
|
||||
|
||||
# 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.4 2000-02-18 03:45:39 dfs Exp $
|
||||
#
|
||||
# REMIND is Copyright (C) 1992-1996 by David F. Skoll
|
||||
# REMIND is Copyright (C) 1992-1998 by David F. Skoll
|
||||
# Copyright (C) 1999-2000 Roaring Penguin Software Inc.
|
||||
# This file is Copyright (C) 1990 by Bill Aten
|
||||
|
||||
# Thanks to Bill Aten for this script.
|
||||
3591
scripts/tkremind
Executable file
3591
scripts/tkremind
Executable file
File diff suppressed because it is too large
Load Diff
86
src/Makefile.in
Normal file
86
src/Makefile.in
Normal file
@@ -0,0 +1,86 @@
|
||||
# Makefile.in for REMIND
|
||||
#
|
||||
# $Id: Makefile.in,v 1.16 2000-03-15 16:03:39 dfs Exp $
|
||||
|
||||
VERSION=03.00.21
|
||||
SHELL= /bin/sh
|
||||
|
||||
srcdir=@srcdir@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
mandir=@mandir@
|
||||
bindir=@bindir@
|
||||
datadir=@datadir@
|
||||
VPATH=$(srcdir)
|
||||
|
||||
INSTALL=@INSTALL@
|
||||
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
||||
INSTALL_DATA=@INSTALL_DATA@
|
||||
|
||||
PROGS= remind rem2ps
|
||||
SCRIPTS= $(srcdir)/../scripts/kall $(srcdir)/../scripts/rem \
|
||||
$(srcdir)/../scripts/tkremind $(srcdir)/../scripts/cm2rem.tcl
|
||||
|
||||
MANS= $(srcdir)/../man/kall.1 $(srcdir)/../man/rem.1 \
|
||||
$(srcdir)/../man/rem2ps.1 $(srcdir)/../man/remind.1 \
|
||||
$(srcdir)/../man/tkremind.1 $(srcdir)/../man/cm2rem.1
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
REMINDSRCS= calendar.c dynbuf.c dorem.c dosubst.c expr.c files.c funcs.c \
|
||||
globals.c hbcal.c init.c main.c moon.c omit.c queue.c sort.c \
|
||||
token.c trigger.c userfns.c utils.c var.c
|
||||
|
||||
REMINDOBJS= $(REMINDSRCS:.c=.o)
|
||||
|
||||
all: remind rem2ps
|
||||
|
||||
test: remind
|
||||
sh ../tests/test-rem
|
||||
|
||||
.c.o:
|
||||
@CC@ -c @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -DUNIX -I. -I$(srcdir) $<
|
||||
|
||||
rem2ps: rem2ps.o dynbuf.o
|
||||
@CC@ @LDFLAGS@ -o rem2ps rem2ps.o dynbuf.o
|
||||
|
||||
remind: $(REMINDOBJS)
|
||||
@CC@ @LDFLAGS@ -o remind $(REMINDOBJS) @LIBS@
|
||||
|
||||
install: all
|
||||
for prog in $(PROGS) $(SCRIPTS) ; do \
|
||||
$(INSTALL_PROGRAM) $$prog $(bindir) ; \
|
||||
done
|
||||
-strip $(bindir)/remind
|
||||
-strip $(bindir)/rem2ps
|
||||
for man in $(MANS) ; do \
|
||||
$(INSTALL_DATA) $$man $(mandir)/man1 ; \
|
||||
done
|
||||
|
||||
clean:
|
||||
rm -f *.o *~ core *.bak $(PROGS)
|
||||
|
||||
clobber:
|
||||
rm -f *.o *~ remind rem2ps test.out core *.bak
|
||||
|
||||
depend:
|
||||
gccmakedep @DEFS@ -DUNIX $(REMINDSRCS) rem2ps.c
|
||||
|
||||
# The next targets are not very useful to you. I use them to build
|
||||
# distributions, etc.
|
||||
|
||||
# Build a tar file based on all files checked into CVS.
|
||||
distro:
|
||||
ln -s .. remind-$(VERSION)
|
||||
peekentry `find remind-$(VERSION) -depth -follow -name 'Entries' -print` | xargs tar cvf remind-$(VERSION).tar
|
||||
gzip -v -9 remind-$(VERSION).tar
|
||||
rm -f remind-$(VERSION)
|
||||
|
||||
beta-tgz:
|
||||
ln -s .. remind-$(VERSION)-BETA
|
||||
peekentry `find remind-$(VERSION)-BETA -depth -follow -name 'Entries' -print` | xargs tar cvf remind-$(VERSION)-BETA.tar
|
||||
gzip -v -9 remind-$(VERSION)-BETA.tar
|
||||
rm -f remind-$(VERSION)-BETA
|
||||
#---------------- Stuff after this added by "make depend" -----------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#$Id: Makefile_QDOS,v 1.3 1996-09-28 18:17:06 dfs Exp $
|
||||
#$Id: Makefile_QDOS,v 1.1 2000-03-15 16:03:57 dfs Exp $
|
||||
# Makefile for REMIND for QDOS / SMSQ
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -24,7 +24,6 @@ LDFLAGS= -bufp200K
|
||||
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
|
||||
# in config_h; then, you should be able to type 'make'.
|
||||
#-----------------------------------------------------------------------------
|
||||
VERSION= 03.00.15
|
||||
MATHLIB= -lm
|
||||
|
||||
HDRS= config_h err_h expr_h globals_h protos_h types_h version_h \
|
||||
@@ -7,10 +7,12 @@
|
||||
/* 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-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
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.1 2000-03-15 16:03:57 dfs Exp $";
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@@ -1,7 +1,5 @@
|
||||
# Makefile for REMIND for Borland C++
|
||||
# $Id: makefile.bcc,v 1.3 1996-09-28 18:17:07 dfs Exp $
|
||||
|
||||
VERSION= 03.00.15
|
||||
# $Id: makefile.bcc,v 1.1 2000-03-15 16:03:57 dfs Exp $
|
||||
|
||||
MODEL=l
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Makefile for REMIND for Microsoft C for MSDOS
|
||||
# $Id: makefile.msc,v 1.1 1996-03-27 03:26:01 dfs Exp $
|
||||
# $Id: makefile.msc,v 1.1 2000-03-15 16:03:57 dfs Exp $
|
||||
|
||||
OBJS= calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
|
||||
globals.obj init.obj main.obj omit.obj token.obj trigger.obj userfns.obj \
|
||||
@@ -1,6 +1,6 @@
|
||||
# Makefile for REMIND
|
||||
#
|
||||
# $Id: makefile.os2,v 1.2 1996-10-12 02:49:34 dfs Exp $
|
||||
# $Id: makefile.os2,v 1.1 2000-03-15 16:03:57 dfs Exp $
|
||||
#
|
||||
# THIS IS OUT OF DATE!
|
||||
#
|
||||
@@ -18,6 +18,7 @@ default:
|
||||
@echo " msc OS/2 exe [Microsoft C 6.00a] "
|
||||
@echo " mscbnd OS/2 and DOS exe [Microsoft C 6.00a] "
|
||||
@echo " emx OS/2 and DOS 32-bit exe [EMX/gcc] "
|
||||
@echo " emxomf OS/2 32-bit exe w/DLL C library [EMX/gcc] "
|
||||
|
||||
|
||||
msc:
|
||||
@@ -41,6 +42,13 @@ emx:
|
||||
CFLAGS="-D__OS2__ -D__MSDOS__" \
|
||||
LFLAGS=""
|
||||
|
||||
emxomf:
|
||||
$(MAKE) -f Makefile.os2 all \
|
||||
CC="gcc -Zomf -O -s" O=".obj" \
|
||||
CFLAGS="-D__OS2__" \
|
||||
LFLAGS="-Zcrtdll -Zstack 32" \
|
||||
LFLAGS2="remind.def"
|
||||
|
||||
|
||||
# OS2_POPUP enables Russ Herman's popup reminders
|
||||
#OS2_POPUP =
|
||||
@@ -71,6 +79,8 @@ OBJS= $(SRCS:.c=$O)
|
||||
|
||||
all: remind.exe rem2ps.exe
|
||||
|
||||
.SUFFIXES: $O
|
||||
|
||||
.c$O:
|
||||
$(CC) -c $(CFLAGS) $(OS2_POPUP) $*.c
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# Makefile for REMIND for Turbo C for MSDOS
|
||||
# $Id: makefile.tc,v 1.3 1996-09-28 18:17:08 dfs Exp $
|
||||
# $Id: makefile.tc,v 1.1 2000-03-15 16:03:57 dfs Exp $
|
||||
|
||||
CC= tcc
|
||||
VERSION= 03.00.15
|
||||
|
||||
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 \
|
||||
@@ -7,11 +7,13 @@
|
||||
/* 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-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.1 2000-03-15 16:03:57 dfs Exp $";
|
||||
|
||||
#ifdef OS2_POPUP
|
||||
#define INCL_VIO
|
||||
@@ -34,7 +36,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
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: smakefile,v 1.3 1996-10-12 02:49:35 dfs Exp $
|
||||
# $Id: smakefile,v 1.1 2000-03-15 16:03:57 dfs Exp $
|
||||
# Makefile for REMIND, suitable for SAS/C 6.50 under AmigaDOS
|
||||
# English version
|
||||
# THIS IS OUT OF DATE!
|
||||
@@ -5,22 +5,26 @@
|
||||
/* The code for generating a calendar. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.9 2000-02-18 03:45:43 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
@@ -34,6 +38,9 @@ typedef struct cal_entry {
|
||||
char *pos;
|
||||
int time;
|
||||
int priority;
|
||||
char tag[TAG_LEN+1];
|
||||
char passthru[PASSTHRU_LEN+1];
|
||||
int duration;
|
||||
} CalEntry;
|
||||
|
||||
/* Global variables */
|
||||
@@ -203,6 +210,9 @@ static void DoCalendarOneMonth()
|
||||
printf("%s %d %d %d %d\n",
|
||||
MonthName[m], y, DaysInMonth(m, y), (JulianToday+1) % 7,
|
||||
MondayFirst);
|
||||
printf("%s %s %s %s %s %s %s\n",
|
||||
DayName[6], DayName[0], DayName[1], DayName[2],
|
||||
DayName[3], DayName[4], DayName[5]);
|
||||
mm = m-1;
|
||||
if (mm<0) {
|
||||
mm = 11; yy = y-1;
|
||||
@@ -631,7 +641,7 @@ ParsePtr p;
|
||||
int col;
|
||||
#endif
|
||||
{
|
||||
|
||||
int oldLen;
|
||||
Trigger trig;
|
||||
TimeTrig tim;
|
||||
Value v;
|
||||
@@ -641,10 +651,11 @@ int col;
|
||||
CalEntry *CurPs = CalPs[col];
|
||||
CalEntry *e;
|
||||
char *s, *s2;
|
||||
static char buf[TOKSIZE];
|
||||
static char obuf[LINELEN];
|
||||
DynamicBuffer buf, obuf;
|
||||
Token tok;
|
||||
|
||||
DBufInit(&buf);
|
||||
|
||||
/* Parse the trigger date and time */
|
||||
if ( (r=ParseRem(p, &trig, &tim)) ) return r;
|
||||
|
||||
@@ -656,11 +667,22 @@ int col;
|
||||
if (trig.typ == SAT_TYPE) {
|
||||
r=DoSatRemind(&trig, &tim, p);
|
||||
if (r) return r;
|
||||
r=ParseToken(p, buf);
|
||||
r=ParseToken(p, &buf);
|
||||
if (r) return r;
|
||||
FindToken(buf, &tok);
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
DBufFree(&buf);
|
||||
if (tok.type == T_Empty || tok.type == T_Comment) return OK;
|
||||
if (tok.type != T_RemType || tok.val == SAT_TYPE) return E_PARSE_ERR;
|
||||
if (tok.val == PASSTHRU_TYPE) {
|
||||
r=ParseToken(p, &buf);
|
||||
if (r) return r;
|
||||
if (!DBufLen(&buf)) {
|
||||
DBufFree(&buf);
|
||||
return E_EOLN;
|
||||
}
|
||||
StrnCpy(trig.passthru, DBufValue(&buf), PASSTHRU_LEN);
|
||||
DBufFree(&buf);
|
||||
}
|
||||
trig.typ = tok.val;
|
||||
jul = LastTriggerDate;
|
||||
if (!LastTrigValid) return OK;
|
||||
@@ -670,58 +692,97 @@ int col;
|
||||
if (r) return r;
|
||||
}
|
||||
|
||||
if (!PsCal && (trig.typ == PS_TYPE || trig.typ == PSF_TYPE)) return OK;
|
||||
/* Convert PS and PSF to PASSTHRU */
|
||||
if (trig.typ == PS_TYPE) {
|
||||
strcpy(trig.passthru, "PostScript");
|
||||
trig.typ = PASSTHRU_TYPE;
|
||||
} else if (trig.typ == PSF_TYPE) {
|
||||
strcpy(trig.passthru, "PSFile");
|
||||
trig.typ = PASSTHRU_TYPE;
|
||||
}
|
||||
if (!PsCal && trig.typ == PASSTHRU_TYPE) return OK;
|
||||
|
||||
/* Remove any "at" times from PS or PSFILE reminders */
|
||||
if (trig.typ == PS_TYPE || trig.typ == PSF_TYPE) tim.ttime = NO_TIME;
|
||||
if (trig.typ == PASSTHRU_TYPE) {
|
||||
tim.ttime = NO_TIME;
|
||||
tim.duration = NO_TIME;
|
||||
}
|
||||
|
||||
/* If trigger date == today, add it to the current entry */
|
||||
DBufInit(&obuf);
|
||||
if (jul == JulianToday) {
|
||||
NumTriggered++;
|
||||
s = obuf;
|
||||
*s = 0;
|
||||
if (DoSimpleCalendar || tim.ttime != NO_TIME)
|
||||
s += strlen(SimpleTime(tim.ttime, s));
|
||||
if (trig.typ != PS_TYPE && trig.typ != PSF_TYPE &&
|
||||
if (DoSimpleCalendar || tim.ttime != NO_TIME) {
|
||||
if (DBufPuts(&obuf, SimpleTime(tim.ttime)) != OK) {
|
||||
DBufFree(&obuf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
if (trig.typ != PASSTHRU_TYPE &&
|
||||
UserFuncExists("calprefix")==1) {
|
||||
sprintf(buf, "calprefix(%d)", trig.priority);
|
||||
s2 = buf;
|
||||
char evalBuf[64];
|
||||
sprintf(evalBuf, "calprefix(%d)", trig.priority);
|
||||
s2 = evalBuf;
|
||||
r = EvalExpr(&s2, &v);
|
||||
if (!r) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
strcat(s, v.v.str);
|
||||
s += strlen(s);
|
||||
if (DBufPuts(&obuf, v.v.str) != OK) {
|
||||
DestroyValue(v);
|
||||
DBufFree(&obuf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
DestroyValue(v);
|
||||
}
|
||||
}
|
||||
if ( (r=DoSubst(p, s, &trig, &tim, jul, CAL_MODE)) ) return r;
|
||||
if (!*s) return OK;
|
||||
if (trig.typ != PS_TYPE && trig.typ != PSF_TYPE &&
|
||||
oldLen = DBufLen(&obuf);
|
||||
if ( (r=DoSubst(p, &obuf, &trig, &tim, jul, CAL_MODE)) ) {
|
||||
DBufFree(&obuf);
|
||||
return r;
|
||||
}
|
||||
if (DBufLen(&obuf) <= oldLen) {
|
||||
DBufFree(&obuf);
|
||||
return OK;
|
||||
}
|
||||
if (trig.typ != PASSTHRU_TYPE &&
|
||||
UserFuncExists("calsuffix")==1) {
|
||||
sprintf(buf, "calsuffix(%d)", trig.priority);
|
||||
s2 = buf;
|
||||
char evalBuf[64];
|
||||
sprintf(evalBuf, "calsuffix(%d)", trig.priority);
|
||||
s2 = evalBuf;
|
||||
r = EvalExpr(&s2, &v);
|
||||
if (!r) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
strcat(s, v.v.str);
|
||||
s += strlen(s);
|
||||
if (DBufPuts(&obuf, v.v.str) != OK) {
|
||||
DestroyValue(v);
|
||||
DBufFree(&obuf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
DestroyValue(v);
|
||||
}
|
||||
}
|
||||
s = obuf;
|
||||
s = DBufValue(&obuf);
|
||||
if (!DoSimpleCalendar) while (isspace(*s)) s++;
|
||||
e = NEW(CalEntry);
|
||||
if (!e) return E_NO_MEM;
|
||||
if (!e) {
|
||||
DBufFree(&obuf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
e->text = StrDup(s);
|
||||
DBufFree(&obuf);
|
||||
if (!e->text) {
|
||||
free(e);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
StrnCpy(e->tag, trig.tag, TAG_LEN);
|
||||
if (!e->tag[0]) {
|
||||
strcpy(e->tag, "*");
|
||||
}
|
||||
e->duration = tim.duration;
|
||||
e->priority = trig.priority;
|
||||
if (trig.typ == PS_TYPE || trig.typ == PSF_TYPE) {
|
||||
e->pos = (trig.typ == PS_TYPE) ? "P" : "F";
|
||||
if (trig.typ == PASSTHRU_TYPE) {
|
||||
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
|
||||
e->pos = e->passthru;
|
||||
e->time = NO_TIME;
|
||||
e->next = CurPs;
|
||||
CalPs[col] = e;
|
||||
@@ -755,12 +816,22 @@ int col, jul;
|
||||
CalEntry *n;
|
||||
int y, m, d;
|
||||
|
||||
/* Do all the PostScript entries first, if any */
|
||||
/* Do all the PASSTHRU entries first, if any */
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
while(e) {
|
||||
printf("%c%c%c%c%c%02d%c%02d ", *(e->pos), *(e->pos),
|
||||
*(e->pos), *(e->pos), DATESEP,
|
||||
m+1, DATESEP, d);
|
||||
printf("%04d/%02d/%02d ", y, m+1, d);
|
||||
printf("%s ", e->passthru);
|
||||
printf("%s ", e->tag);
|
||||
if (e->duration != NO_TIME) {
|
||||
printf("%d ", e->duration);
|
||||
} else {
|
||||
printf("* ");
|
||||
}
|
||||
if (e->time != NO_TIME) {
|
||||
printf("%d ", e->time);
|
||||
} else {
|
||||
printf("* ");
|
||||
}
|
||||
printf("%s\n", e->text);
|
||||
free(e->text);
|
||||
n = e->next;
|
||||
@@ -771,7 +842,18 @@ int col, jul;
|
||||
|
||||
e = CalColumn[col];
|
||||
while(e) {
|
||||
printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
|
||||
printf("%04d/%02d/%02d", y, m+1, d);
|
||||
printf(" * %s ", e->tag);
|
||||
if (e->duration != NO_TIME) {
|
||||
printf("%d ", e->duration);
|
||||
} else {
|
||||
printf("* ");
|
||||
}
|
||||
if (e->time != NO_TIME) {
|
||||
printf("%d ", e->time);
|
||||
} else {
|
||||
printf("* ");
|
||||
}
|
||||
printf("%s\n", e->text);
|
||||
free(e->text);
|
||||
n = e->next;
|
||||
@@ -837,49 +919,44 @@ static void WriteCalDays()
|
||||
/* SimpleTime */
|
||||
/* */
|
||||
/* Format the time according to simple time format. */
|
||||
/* If out is NULL, result placed in internal static buffer. */
|
||||
/* Answer is returned in a static buffer. */
|
||||
/* A trailing space is always added. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *SimpleTime(int tim, char *out)
|
||||
PUBLIC char *SimpleTime(int tim)
|
||||
#else
|
||||
char *SimpleTime(tim, out)
|
||||
char *SimpleTime(tim)
|
||||
int tim;
|
||||
char *out;
|
||||
#endif
|
||||
{
|
||||
static buf[9];
|
||||
static char buf[32];
|
||||
int h, min, hh;
|
||||
|
||||
if (!out) out = (char *) buf;
|
||||
|
||||
*out = 0;
|
||||
buf[0] = 0;
|
||||
|
||||
switch(ScFormat) {
|
||||
|
||||
case SC_AMPM:
|
||||
if (tim == NO_TIME) sprintf(out, " ");
|
||||
else {
|
||||
if (tim != NO_TIME) {
|
||||
h = tim / 60;
|
||||
min = tim % 60;
|
||||
if (h == 0) hh=12;
|
||||
else if (h > 12) hh=h-12;
|
||||
else hh=h;
|
||||
sprintf(out, "%2d%c%02d%s ", hh, TIMESEP, min, (h>=12) ? L_PM : L_AM);
|
||||
sprintf(buf, "%2d%c%02d%s ", hh, TIMESEP, min, (h>=12) ? L_PM : L_AM);
|
||||
}
|
||||
break;
|
||||
|
||||
case SC_MIL:
|
||||
if (tim == NO_TIME) sprintf(out, " ");
|
||||
else {
|
||||
if (tim != NO_TIME) {
|
||||
h = tim / 60;
|
||||
min = tim % 60;
|
||||
sprintf(out, "%02d%c%02d ", h, TIMESEP, min);
|
||||
sprintf(buf, "%02d%c%02d ", h, TIMESEP, min);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return out;
|
||||
return buf;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
83
src/config.h.in
Normal file
83
src/config.h.in
Normal file
@@ -0,0 +1,83 @@
|
||||
/* src/config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* $Id: config.h.in,v 1.4 2000-02-18 03:45:44 dfs Exp $ */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* Define if you have the mktime function. */
|
||||
#undef HAVE_MKTIME
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#undef HAVE_STRSTR
|
||||
|
||||
/* Define if you have the timegm function. */
|
||||
#undef HAVE_TIMEGM
|
||||
|
||||
/* Define if you have the difftime function. */
|
||||
#undef HAVE_DIFFTIME
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <stdarg.h> header file. */
|
||||
#undef HAVE_STDARG_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#undef HAVE_SYS_SELECT_H
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the m library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
#include "custom.h"
|
||||
@@ -1,27 +1,27 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* CONFIG.H */
|
||||
/* CUSTOM.H.IN */
|
||||
/* */
|
||||
/* Contains various configuration parameters for Remind. */
|
||||
/* You may have to edit this file to tweak parameters or take */
|
||||
/* care of certain system dependencies. */
|
||||
/* Contains various configuration parameters for Remind */
|
||||
/* which you can customize. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: config.h,v 1.5 1996-10-12 02:49:32 dfs Exp $ */
|
||||
/* $Id: custom.h,v 1.23 2000-03-12 12:52:02 dfs Exp $ */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
||||
/* LOCATION: A string identifying your location. */
|
||||
/* For latitude, north is positive, south is negative. */
|
||||
/* For longitude, west is positive, east is negative. */
|
||||
/* NOTE: For negative numbers, all three of DEG, MIN, SEC should be */
|
||||
/* negative. To indicate -20deg22'33'' use */
|
||||
/* DEG=-20, MIN=-22 and SEC=-33. */
|
||||
/* All latitude and longitude numbers should be positive for the */
|
||||
/* northern and western hemisphere. If you live in the southern */
|
||||
/* hemisphere, ALL latitude values should be negative. If you live */
|
||||
/* in the eastern hemisphere, ALL longitude values should be negative. */
|
||||
/* */
|
||||
/* The default values are initially set to Ottawa, Ontario, Canada. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define LAT_DEG 45
|
||||
@@ -32,21 +32,6 @@
|
||||
#define LON_SEC 0
|
||||
#define LOCATION "Ottawa"
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* HAVE_MKTIME: Define this if your C library includes the mktime() */
|
||||
/* function. Otherwise, will attempt to use the Unix */
|
||||
/* style time manipulations. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define HAVE_MKTIME 1
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* NEED_TIMEGM: If your C library does not have mktime() and it ALSO */
|
||||
/* does not have timelocal() or timegm(), uncomment the */
|
||||
/* next line. If HAVE_MKTIME is defined, NEED_TIMEGM is */
|
||||
/* ignored. Very few systems should require NEED_TIMEGM. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* #define NEED_TIMEGM 1 */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* DEFAULT_PAGE: The default page size to use for Rem2PS. */
|
||||
/* The Letter version is appropriate for North America; the A4 version */
|
||||
@@ -70,18 +55,37 @@
|
||||
/* #define TIMESEP '.' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* ISOLATIN1: uncomment the following line if your system uses the */
|
||||
/* ISOLATIN1: define it to 1 if you use the */
|
||||
/* ISO 8859-1 character set instead of ASCII. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define ISOLATIN1 1
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* IBMEXTENDED: uncomment the following line if you want to use the */
|
||||
/* IBM extended character set. NOT ALL LANGUAGE MODULES SUPPORT THIS. */
|
||||
/* Note that at most one of ISOLATIN1 or IBMEXTENDED should be */
|
||||
/* defined; if both are defined, the results are unspecified. */
|
||||
/* ISOLATIN2: define it to 1 if you use the */
|
||||
/* ISO 8859-2 character set instead of ASCII. */
|
||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
||||
/* then one are defined as 1, the results are unspecified. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* #define IBMEXTENDED 1 */
|
||||
#define ISOLATIN2 0
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* IBMEXTENDED: define as 1 if your system uses the IBM extended */
|
||||
/* character set. */
|
||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
||||
/* then one are defined as 1, the results are unspecified. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define IBMEXTENDED 0
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* IBM852: define as 1 if your system uses the IBM CPI-852 extended */
|
||||
/* character set. */
|
||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
||||
/* then one are defined as 1, the results are unspecified. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define IBM852 0
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
||||
@@ -90,6 +94,19 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define WANT_U_OPTION 1
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/* You most likely do NOT have to tweak anything after this! */
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
||||
/* characters to be escaped with a backslash for the -k option. */
|
||||
@@ -98,12 +115,6 @@
|
||||
#define WANT_SHELL_ESCAPING 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* STRSTR: If your system does not have the "strstr" function, */
|
||||
/* uncomment the following line. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* #define NO_STRSTR 1 */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Some implementations have a broken 'putc' and 'putchar'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -111,20 +122,6 @@
|
||||
#define BROKEN_PUTC
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* STDLIB: If you don't have the <stdlib.h> header file, comment the */
|
||||
/* following line. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* MALLOC: If you do not have the <malloc.h> header file, */
|
||||
/* comment out the next 3 lines. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#ifdef UNIX
|
||||
#define HAVE_MALLOC_H 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
||||
/* base year MUST be a Monday, else Remind will not work! */
|
||||
@@ -157,20 +154,15 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_PRT_LEN 40
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LINELEN: The maximum length of an input line */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define LINELEN 512
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* OP_STACK_SIZE: The size of the operator stack for expr. parsing */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define OP_STACK_SIZE 30
|
||||
#define OP_STACK_SIZE 100
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* VAL_STACK_SIZE: The size of the operand stack for expr. parsing */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define VAL_STACK_SIZE 30
|
||||
#define VAL_STACK_SIZE 500
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* INCLUDE_NEST: How many nested INCLUDES do we handle? */
|
||||
@@ -198,29 +190,6 @@
|
||||
#define HAVE_PROTOS 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Do we use the <stdarg.h> scheme for functions with variable number */
|
||||
/* of parameters? If not, the <varargs.h> scheme is assumed. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(__STDC__) || defined(__TURBOC__) || defined(__BORLANDC__)
|
||||
#define HAVE_STDARG 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Does the function argument to the signal() function take an INT */
|
||||
/* argument? If yes, uncomment the next line. If you get it wrong, */
|
||||
/* the only bad side effect is a compiler warning, so don't worry too */
|
||||
/* much about it. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define SIGHANDLER_INT_ARG 1
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Do we have the <unistd.h> header? If not, use sys/files.h */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#ifdef UNIX
|
||||
#define HAVE_UNISTD 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many attempts to resolve a weird date spec? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -236,16 +205,6 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_PARTIAL_OMITS 75
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* The size of statically-allocated buffers for tokens. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TOKSIZE 128
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* The size of the buffer for the shell() function. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define SHELLSIZE 512
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* A newline - some systems need "\n\r" */
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -259,17 +218,17 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Don't change the next definitions */
|
||||
/*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* TAG_LEN: The maximum length of tags. Don't change it */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TAG_LEN 32
|
||||
|
||||
#define PASSTHRU_LEN 24
|
||||
|
||||
#define PUBLIC
|
||||
#define PRIVATE static
|
||||
|
||||
#ifdef UNIX
|
||||
#define _POSIX_SOURCE
|
||||
#endif
|
||||
|
||||
#ifdef SYSV
|
||||
#define _SVID_SOURCE
|
||||
#endif
|
||||
|
||||
#define PSBEGIN "# rem2ps begin"
|
||||
#define PSEND "# rem2ps end"
|
||||
|
||||
241
src/custom.h.in
Normal file
241
src/custom.h.in
Normal file
@@ -0,0 +1,241 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* CUSTOM.H.IN */
|
||||
/* */
|
||||
/* Contains various configuration parameters for Remind */
|
||||
/* which you can customize. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: custom.h.in,v 1.7 2000-02-18 03:45:46 dfs Exp $ */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
||||
/* LOCATION: A string identifying your location. */
|
||||
/* All latitude and longitude numbers should be positive for the */
|
||||
/* northern and western hemisphere. If you live in the southern */
|
||||
/* hemisphere, ALL latitude values should be negative. If you live */
|
||||
/* in the eastern hemisphere, ALL longitude values should be negative. */
|
||||
/* */
|
||||
/* The default values are initially set to Ottawa, Ontario, Canada. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define LAT_DEG 45
|
||||
#define LAT_MIN 24
|
||||
#define LAT_SEC 0
|
||||
#define LON_DEG 75
|
||||
#define LON_MIN 39
|
||||
#define LON_SEC 0
|
||||
#define LOCATION "Ottawa"
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* DEFAULT_PAGE: The default page size to use for Rem2PS. */
|
||||
/* The Letter version is appropriate for North America; the A4 version */
|
||||
/* is appropriate for Europe. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DEFAULT_PAGE {"Letter", 612, 792}
|
||||
/* #define DEFAULT_PAGE {"A4", 595, 842} */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* DATESEP: The default date separator. North American usage is '/'; */
|
||||
/* others may prefer '-'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DATESEP '/'
|
||||
/* #define DATESEP '-' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* TIMESEP: The default time separator. North American usage is ':'; */
|
||||
/* others may prefer '.'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TIMESEP ':'
|
||||
/* #define TIMESEP '.' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* ISOLATIN1: define it to 1 if you use the */
|
||||
/* ISO 8859-1 character set instead of ASCII. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define ISOLATIN1 1
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* ISOLATIN2: define it to 1 if you use the */
|
||||
/* ISO 8859-2 character set instead of ASCII. */
|
||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
||||
/* then one are defined as 1, the results are unspecified. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define ISOLATIN2 0
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* IBMEXTENDED: define as 1 if your system uses the IBM extended */
|
||||
/* character set. */
|
||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
||||
/* then one are defined as 1, the results are unspecified. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define IBMEXTENDED 0
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* IBM852: define as 1 if your system uses the IBM CPI-852 extended */
|
||||
/* character set. */
|
||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
||||
/* then one are defined as 1, the results are unspecified. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define IBM852 0
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
||||
/* the -u option. If you do this, however, remind-all.[c]sh will not */
|
||||
/* work. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define WANT_U_OPTION 1
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/* You most likely do NOT have to tweak anything after this! */
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
||||
/* characters to be escaped with a backslash for the -k option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(UNIX)
|
||||
#define WANT_SHELL_ESCAPING 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Some implementations have a broken 'putc' and 'putchar'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#ifdef __SASC_60
|
||||
#define BROKEN_PUTC
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
||||
/* base year MUST be a Monday, else Remind will not work! */
|
||||
/* IMPORTANT NOTE: The Hebrew date routines depend on BASE */
|
||||
/* being set to 1990. If you change it, you'll have to add the */
|
||||
/* number of days between 1 Jan <NEWBASE> and 1 Jan 1990 to the */
|
||||
/* manifest constant CORRECTION in hbcal.c. Also, the year */
|
||||
/* folding mechanism in main.c depends on BASE<2001. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define BASE 1990
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* YR_RANGE: The range of years allowed. Computers with 16-bit */
|
||||
/* integers can handle about 89 years worth of reminders; if */
|
||||
/* you use 32-bit integers, you can handle over 5 867 000 */
|
||||
/* years. Note that YR_RANGE is set to 88 rather than 89 */
|
||||
/* because we can range up to the last day of the 88th year. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define YR_RANGE 88
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* VAR_NAME_LEN: The maximum length of variable names. Don't make it */
|
||||
/* any less than 12. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define VAR_NAME_LEN 12
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* MAX_PRT_LEN: The maximum number of characters to print when */
|
||||
/* displaying a string value for debugging purposes. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_PRT_LEN 40
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* OP_STACK_SIZE: The size of the operator stack for expr. parsing */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define OP_STACK_SIZE 100
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* VAL_STACK_SIZE: The size of the operand stack for expr. parsing */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define VAL_STACK_SIZE 500
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* INCLUDE_NEST: How many nested INCLUDES do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define INCLUDE_NEST 8
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* IF_NEST: How many nested IFs do we handle? Maximum is the number */
|
||||
/* of bits in an int, divided by two. Beware! */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define IF_NEST (4*sizeof(unsigned int))
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Do we handle queued reminders? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(UNIX) || defined(__OS2__)
|
||||
#define HAVE_QUEUED 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Does our C compiler have prototypes? Override this test if you */
|
||||
/* are using a non-ANSI compiler that nevertheless has prototypes. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(__STDC__) || defined(__TURBOC__) || defined(__BORLANDC__)
|
||||
#define HAVE_PROTOS 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many attempts to resolve a weird date spec? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TRIG_ATTEMPTS 25
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_FULL_OMITS 75
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_PARTIAL_OMITS 75
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* A newline - some systems need "\n\r" */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define NL "\n"
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Minimum number of linefeeds in each calendar "box" */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define CAL_LINES 5
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Don't change the next definitions */
|
||||
/*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* TAG_LEN: The maximum length of tags. Don't change it */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TAG_LEN 32
|
||||
|
||||
#define PASSTHRU_LEN 24
|
||||
|
||||
#define PUBLIC
|
||||
#define PRIVATE static
|
||||
|
||||
#define PSBEGIN "# rem2ps begin"
|
||||
#define PSEND "# rem2ps end"
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
#define Putc SafePutc
|
||||
#define PutChar SafePutChar
|
||||
#else
|
||||
#define Putc putc
|
||||
#define PutChar putchar
|
||||
#endif
|
||||
1065
src/dorem.c
Normal file
1065
src/dorem.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -6,29 +6,33 @@
|
||||
/* reminders are triggered. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
static char const RCSID[] = "$Id: dosubst.c,v 1.3 1996-10-12 02:49:32 dfs Exp $";
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: dosubst.c,v 1.10 2000-02-18 03:45:48 dfs Exp $";
|
||||
|
||||
#define L_IN_DOSUBST
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
|
||||
#define UPPER(c) (islower(c) ? toupper(c) : c)
|
||||
#define UPPER(c) (islower(c) ? toupper(c) : (c))
|
||||
#define ABS(x) ( (x) < 0 ? -(x) : (x) )
|
||||
#ifndef NL
|
||||
#define NL "\n"
|
||||
@@ -37,6 +41,8 @@ static char const RCSID[] = "$Id: dosubst.c,v 1.3 1996-10-12 02:49:32 dfs Exp $"
|
||||
static char TODAY[] = L_TODAY;
|
||||
static char TOMORROW[] = L_TOMORROW;
|
||||
|
||||
#define SHIP_OUT(s) if(DBufPuts(dbuf, s) != OK) return E_NO_MEM
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DoSubst */
|
||||
@@ -47,11 +53,11 @@ static char TOMORROW[] = L_TOMORROW;
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoSubst(ParsePtr p, char *out, Trigger *t, TimeTrig *tt, int jul, int mode)
|
||||
PUBLIC int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode)
|
||||
#else
|
||||
int DoSubst(p, out, t, tt, jul, mode)
|
||||
int DoSubst(p, dbuf, t, tt, jul, mode)
|
||||
ParsePtr p;
|
||||
char *out;
|
||||
DynamicBuffer *dbuf;
|
||||
Trigger *t;
|
||||
TimeTrig *tt;
|
||||
int jul, mode;
|
||||
@@ -68,8 +74,9 @@ int jul, mode;
|
||||
int tdiff, adiff, mdiff, hdiff;
|
||||
char *mplu, *hplu, *when, *plu;
|
||||
int has_quote = 0;
|
||||
char *s = out;
|
||||
char *os;
|
||||
char *ss, *os;
|
||||
char s[256];
|
||||
int origLen = DBufLen(dbuf);
|
||||
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
|
||||
@@ -133,25 +140,30 @@ int jul, mode;
|
||||
|
||||
while(1) {
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) return err;
|
||||
if (err) {
|
||||
DBufFree(dbuf);
|
||||
return err;
|
||||
}
|
||||
if (c == '\n') continue;
|
||||
if (!c) {
|
||||
if (mode != CAL_MODE && t->typ != RUN_TYPE && !MsgCommand)
|
||||
*s++ = '\n';
|
||||
*s++ = 0;
|
||||
if (mode != CAL_MODE && t->typ != RUN_TYPE && !MsgCommand) {
|
||||
if (DBufPutc(dbuf, '\n') != OK) return E_NO_MEM;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (c != '%') {
|
||||
*s++ = c;
|
||||
if (DBufPutc(dbuf, c) != OK) return E_NO_MEM;
|
||||
continue;
|
||||
}
|
||||
s[0] = 0;
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) return err;
|
||||
if (err) {
|
||||
DBufFree(dbuf);
|
||||
return err;
|
||||
}
|
||||
if (!c) {
|
||||
*s++ = 0;
|
||||
break;
|
||||
}
|
||||
os = s;
|
||||
done = 0;
|
||||
if (diff <= 1) {
|
||||
switch(UPPER(c)) {
|
||||
@@ -195,7 +207,7 @@ int jul, mode;
|
||||
case 'V':
|
||||
#endif
|
||||
sprintf(s, "%s", (diff ? TOMORROW : TODAY));
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
done = 1;
|
||||
break;
|
||||
|
||||
@@ -211,7 +223,7 @@ int jul, mode;
|
||||
sprintf(s, "%s %s, %d %s, %d", L_ON, DayName[jul%7], d,
|
||||
MonthName[m], y);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
@@ -220,7 +232,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, L_INXDAYS, diff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
@@ -229,7 +241,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%s %s", L_ON, DayName[jul%7]);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
@@ -238,7 +250,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", d);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
@@ -248,7 +260,7 @@ int jul, mode;
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, d, DATESEP,
|
||||
m+1, DATESEP, y);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'F':
|
||||
@@ -257,7 +269,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, m+1, DATESEP, d, DATESEP, y);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'G':
|
||||
@@ -266,7 +278,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%s %s, %d %s", L_ON, DayName[jul%7], d, MonthName[m]);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'H':
|
||||
@@ -275,7 +287,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, d, DATESEP, m+1);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
@@ -284,7 +296,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, m+1, DATESEP, d);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'J':
|
||||
@@ -294,7 +306,7 @@ int jul, mode;
|
||||
sprintf(s, "%s %s, %s %d%s, %d", L_ON, DayName[jul%7],
|
||||
MonthName[m], d, plu, y);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'K':
|
||||
@@ -304,7 +316,7 @@ int jul, mode;
|
||||
sprintf(s, "%s %s, %s %d%s", L_ON, DayName[jul%7],
|
||||
MonthName[m], d, plu);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
@@ -313,7 +325,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%s %04d%c%02d%c%02d", L_ON, y, DATESEP, m+1, DATESEP, d);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
@@ -322,7 +334,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%s", MonthName[m]);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
@@ -331,7 +343,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", m+1);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
@@ -341,25 +353,25 @@ int jul, mode;
|
||||
if (RealToday == JulianToday) sprintf(s, " (%s)", L_TODAY);
|
||||
else *s = 0;
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'P':
|
||||
#ifdef L_P_OVER
|
||||
L_P_OVER
|
||||
#else
|
||||
sprintf(s, (diff == 1 ? "" : L_PLURAL));
|
||||
sprintf(s, "%s", (diff == 1 ? "" : L_PLURAL));
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'Q':
|
||||
#ifdef L_Q_OVER
|
||||
L_Q_OVER
|
||||
#else
|
||||
sprintf(s, (diff == 1 ? "'s" : "s'"));
|
||||
sprintf(s, "%s", (diff == 1 ? "'s" : "s'"));
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
@@ -368,16 +380,16 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%02d", d);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
#ifdef L_S_OVER
|
||||
L_S_OVER
|
||||
#else
|
||||
sprintf(s, plu);
|
||||
sprintf(s, "%s", plu);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
@@ -386,7 +398,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%02d", m+1);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'U':
|
||||
@@ -396,7 +408,7 @@ int jul, mode;
|
||||
sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], d,
|
||||
plu, MonthName[m], y);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'V':
|
||||
@@ -406,16 +418,16 @@ int jul, mode;
|
||||
sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu,
|
||||
MonthName[m]);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'W':
|
||||
#ifdef L_W_OVER
|
||||
L_W_OVER
|
||||
#else
|
||||
sprintf(s, DayName[jul%7]);
|
||||
sprintf(s, "%s", DayName[jul%7]);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'X':
|
||||
@@ -424,7 +436,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", diff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'Y':
|
||||
@@ -433,7 +445,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", y);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'Z':
|
||||
@@ -442,7 +454,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", y % 100);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '1':
|
||||
@@ -450,7 +462,7 @@ int jul, mode;
|
||||
L_1_OVER
|
||||
#else
|
||||
if (tdiff == 0)
|
||||
sprintf(s, L_NOW);
|
||||
sprintf(s, "%s", L_NOW);
|
||||
else if (hdiff == 0)
|
||||
sprintf(s, "%d %s%s %s", mdiff, L_MINUTE, mplu, when);
|
||||
else if (mdiff == 0)
|
||||
@@ -459,7 +471,7 @@ int jul, mode;
|
||||
sprintf(s, "%d %s%s %s %d %s%s %s", hdiff, L_HOUR, hplu,
|
||||
L_AND, mdiff, L_MINUTE, mplu, when);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '2':
|
||||
@@ -468,7 +480,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%s %d%c%02d%s", L_AT, hh, TIMESEP, min, pm);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '3':
|
||||
@@ -478,7 +490,7 @@ int jul, mode;
|
||||
|
||||
sprintf(s, "%s %02d%c%02d", L_AT, h, TIMESEP, min);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '4':
|
||||
@@ -487,7 +499,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", tdiff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '5':
|
||||
@@ -496,16 +508,16 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", adiff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '6':
|
||||
#ifdef L_6_OVER
|
||||
L_6_OVER
|
||||
#else
|
||||
sprintf(s, when);
|
||||
sprintf(s, "%s", when);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '7':
|
||||
@@ -514,7 +526,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", hdiff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '8':
|
||||
@@ -523,34 +535,34 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", mdiff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '9':
|
||||
#ifdef L_9_OVER
|
||||
L_9_OVER
|
||||
#else
|
||||
sprintf(s, mplu);
|
||||
sprintf(s, "%s", mplu);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '0':
|
||||
#ifdef L_0_OVER
|
||||
L_0_OVER
|
||||
#else
|
||||
sprintf(s, hplu);
|
||||
sprintf(s, "%s", hplu);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '!':
|
||||
#ifdef L_BANG_OVER
|
||||
L_BANG_OVER
|
||||
#else
|
||||
sprintf(s, (tdiff >= 0 ? L_IS : L_WAS));
|
||||
sprintf(s, "%s", (tdiff >= 0 ? L_IS : L_WAS));
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '@':
|
||||
@@ -559,7 +571,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d%c%02d%s", chh, TIMESEP, cmin, cpm);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '#':
|
||||
@@ -568,7 +580,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%02d%c%02d", ch, TIMESEP, cmin);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '_':
|
||||
@@ -576,7 +588,7 @@ int jul, mode;
|
||||
sprintf(s, "%s", NL);
|
||||
else
|
||||
sprintf(s, " ");
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case QUOTE_MARKER:
|
||||
@@ -584,14 +596,17 @@ int jul, mode;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
*s++ = QUOTE_MARKER;
|
||||
if (DBufPutc(dbuf, QUOTE_MARKER) != OK) return E_NO_MEM;
|
||||
has_quote = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
*s++ = c;
|
||||
if (DBufPutc(dbuf, c) != OK) return E_NO_MEM;
|
||||
}
|
||||
if (isupper(c)) {
|
||||
os = DBufValue(dbuf) - strlen(s);
|
||||
*os = UPPER(*os);
|
||||
}
|
||||
if (isupper(c)) *os = UPPER(*os);
|
||||
}
|
||||
|
||||
/* We're outside the big while loop. The only way to get here is for c to
|
||||
@@ -602,35 +617,40 @@ int jul, mode;
|
||||
/* If there are NO quotes, then: If CAL_MODE && RUN_TYPE, we don't want the
|
||||
reminder in the calendar. Zero the output buffer and quit. */
|
||||
if (!has_quote) {
|
||||
if (mode == CAL_MODE && t->typ == RUN_TYPE) *out = 0;
|
||||
if (mode == CAL_MODE && t->typ == RUN_TYPE) {
|
||||
*DBufValue(dbuf) = 0;
|
||||
dbuf->len = 0;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* There ARE quotes. If in CAL_MODE, delete everything before first quote
|
||||
and after second quote. If in NORMAL_MODE, delete the %" sequences. */
|
||||
|
||||
s = out;
|
||||
os = out;
|
||||
ss = DBufValue(dbuf) + origLen;
|
||||
os = ss;
|
||||
if (mode == NORMAL_MODE) {
|
||||
while (*s) {
|
||||
if (*s != QUOTE_MARKER) *os++ = *s;
|
||||
s++;
|
||||
while (*ss) {
|
||||
if (*ss != QUOTE_MARKER) *os++ = *ss;
|
||||
ss++;
|
||||
}
|
||||
*os = 0;
|
||||
} else {
|
||||
|
||||
/* Skip past the quote marker */
|
||||
while (*s && (*s != QUOTE_MARKER)) s++;
|
||||
while (*ss && (*ss != QUOTE_MARKER)) ss++;
|
||||
|
||||
/* Security check... actually, *s must == QUOTE_MARKER at this point, but
|
||||
it doesn't hurt to make it a bit robust. */
|
||||
if (*s) s++;
|
||||
if (*ss) ss++;
|
||||
|
||||
/* Copy the output until the next QUOTE_MARKER */
|
||||
while (*s && (*s != QUOTE_MARKER)) *os++ = *s++;
|
||||
while (*ss && (*ss != QUOTE_MARKER)) *os++ = *ss++;
|
||||
*os = 0;
|
||||
}
|
||||
|
||||
/* Violating encapsulation here!!!! */
|
||||
dbuf->len = strlen(dbuf->buffer);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -645,11 +665,12 @@ int jul, mode;
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoSubstFromString(char *source, char *dest, int jul, int tim)
|
||||
PUBLIC int DoSubstFromString(char *source, DynamicBuffer *dbuf,
|
||||
int jul, int tim)
|
||||
#else
|
||||
int DoSubstFromString(source, dest, jul, tim)
|
||||
int DoSubstFromString(source, dbuf, jul, tim)
|
||||
char *source;
|
||||
char *dest;
|
||||
DynamicBuffer *dbuf;
|
||||
int jul;
|
||||
int tim;
|
||||
#endif
|
||||
@@ -666,7 +687,7 @@ int tim;
|
||||
tempTrig.typ = MSG_TYPE;
|
||||
tempTime.ttime = tim;
|
||||
|
||||
r = DoSubst(&tempP, dest, &tempTrig, &tempTime, jul, NORMAL_MODE);
|
||||
r = DoSubst(&tempP, dbuf, &tempTrig, &tempTime, jul, NORMAL_MODE);
|
||||
DestroyParser(&tempP);
|
||||
return r;
|
||||
}
|
||||
221
src/dynbuf.c
Normal file
221
src/dynbuf.c
Normal file
@@ -0,0 +1,221 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DYNBUF.C */
|
||||
/* */
|
||||
/* Implementation of functions for manipulating dynamic */
|
||||
/* buffers. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
static char const RCSID[] =
|
||||
"$Id: dynbuf.c,v 1.5 2000-02-18 03:45:49 dfs Exp $";
|
||||
|
||||
#include "config.h"
|
||||
#include "dynbuf.h"
|
||||
#include "err.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
/**********************************************************************
|
||||
%FUNCTION: DBufMakeRoom
|
||||
%ARGUMENTS:
|
||||
dbuf -- pointer to a dynamic buffer
|
||||
n -- size to expand to
|
||||
%RETURNS:
|
||||
OK if all went well; E_NO_MEM if out of memory
|
||||
%DESCRIPTION:
|
||||
Doubles the size of dynamic buffer until it has room for at least
|
||||
'n' characters, not including trailing '\0'
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int DBufMakeRoom(DynamicBuffer *dbuf, int n)
|
||||
#else
|
||||
static int DBufMakeRoom(dbuf, n)
|
||||
DynamicBuffer *dbuf;
|
||||
int n;
|
||||
#endif
|
||||
{
|
||||
/* Double size until it's greater than n (strictly > to leave room
|
||||
for trailing '\0' */
|
||||
int size = dbuf->allocatedLen;
|
||||
char *buf;
|
||||
|
||||
if (size > n) return OK;
|
||||
|
||||
while (size <= n) {
|
||||
size *= 2;
|
||||
}
|
||||
|
||||
/* Allocate memory */
|
||||
buf = (char *) malloc(size);
|
||||
if (!buf) return E_NO_MEM;
|
||||
|
||||
/* Copy contents */
|
||||
strcpy(buf, dbuf->buffer);
|
||||
|
||||
/* Free contents if necessary */
|
||||
if (dbuf->buffer != dbuf->staticBuf) free(dbuf->buffer);
|
||||
dbuf->buffer = buf;
|
||||
dbuf->allocatedLen = size;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
%FUNCTION: DBufInit
|
||||
%ARGUMENTS:
|
||||
dbuf -- pointer to a dynamic buffer
|
||||
%RETURNS:
|
||||
Nothing
|
||||
%DESCRIPTION:
|
||||
Initializes a dynamic buffer
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void DBufInit(DynamicBuffer *dbuf)
|
||||
#else
|
||||
void DBufInit(dbuf)
|
||||
DynamicBuffer *dbuf;
|
||||
#endif
|
||||
{
|
||||
dbuf->buffer = dbuf->staticBuf;
|
||||
dbuf->len = 0;
|
||||
dbuf->allocatedLen = DBUF_STATIC_SIZE;
|
||||
dbuf->buffer[0] = 0;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
%FUNCTION: DBufPutc
|
||||
%ARGUMENTS:
|
||||
dbuf -- pointer to a dynamic buffer
|
||||
c -- character to append to buffer
|
||||
%RETURNS:
|
||||
OK if all went well; E_NO_MEM if out of memory
|
||||
%DESCRIPTION:
|
||||
Appends a character to the buffer.
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DBufPutc(DynamicBuffer *dbuf, char c)
|
||||
#else
|
||||
int DBufPutc(dbuf, c)
|
||||
DynamicBuffer *dbuf;
|
||||
char c;
|
||||
#endif
|
||||
{
|
||||
if (dbuf->allocatedLen == dbuf->len+1) {
|
||||
if (DBufMakeRoom(dbuf, dbuf->len+1) != OK) return E_NO_MEM;
|
||||
}
|
||||
dbuf->buffer[dbuf->len++] = c;
|
||||
dbuf->buffer[dbuf->len] = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
%FUNCTION: DBufPuts
|
||||
%ARGUMENTS:
|
||||
dbuf -- pointer to a dynamic buffer
|
||||
str -- string to append to buffer
|
||||
%RETURNS:
|
||||
OK if all went well; E_NO_MEM if out of memory
|
||||
%DESCRIPTION:
|
||||
Appends a string to the buffer.
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DBufPuts(DynamicBuffer *dbuf, char *str)
|
||||
#else
|
||||
int DBufPuts(dbuf, str)
|
||||
DynamicBuffer *dbuf;
|
||||
char *str;
|
||||
#endif
|
||||
{
|
||||
int l = strlen(str);
|
||||
if (!l) return OK;
|
||||
|
||||
if (DBufMakeRoom(dbuf, dbuf->len+l) != OK) return E_NO_MEM;
|
||||
strcpy((dbuf->buffer+dbuf->len), str);
|
||||
dbuf->len += l;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
%FUNCTION: DBufFree
|
||||
%ARGUMENTS:
|
||||
dbuf -- pointer to a dynamic buffer
|
||||
%RETURNS:
|
||||
Nothing
|
||||
%DESCRIPTION:
|
||||
Frees and reinitializes a dynamic buffer
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void DBufFree(DynamicBuffer *dbuf)
|
||||
#else
|
||||
void DBufFree(dbuf)
|
||||
DynamicBuffer *dbuf;
|
||||
#endif
|
||||
{
|
||||
if (dbuf->buffer != dbuf->staticBuf) free(dbuf->buffer);
|
||||
DBufInit(dbuf);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
%FUNCTION: DBufGets
|
||||
%ARGUMENTS:
|
||||
dbuf -- pointer to a dynamic buffer
|
||||
fp -- file to read from
|
||||
%RETURNS:
|
||||
OK or E_NO_MEM
|
||||
%DESCRIPTION:
|
||||
Reads an entire line from a file and appends to dbuf. Does not include
|
||||
trailing newline.
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DBufGets(DynamicBuffer *dbuf, FILE *fp)
|
||||
#else
|
||||
int DBufGets(dbuf, fp)
|
||||
DynamicBuffer *dbuf;
|
||||
FILE *fp;
|
||||
#endif
|
||||
{
|
||||
char tmp[256]; /* Safe to hard-code */
|
||||
int busy = 1;
|
||||
int l;
|
||||
|
||||
DBufFree(dbuf);
|
||||
|
||||
/* Try reading the first few bytes right into the buffer --
|
||||
we can usually save some unnecessary copying */
|
||||
|
||||
*(dbuf->buffer) = 0;
|
||||
fgets(dbuf->buffer, dbuf->allocatedLen, fp);
|
||||
if (!*(dbuf->buffer)) return OK;
|
||||
dbuf->len = strlen(dbuf->buffer);
|
||||
l = dbuf->len - 1;
|
||||
if (dbuf->buffer[l] == '\n') {
|
||||
dbuf->buffer[l] = 0;
|
||||
dbuf->len = l;
|
||||
return OK;
|
||||
}
|
||||
|
||||
while(busy) {
|
||||
*tmp = 0;
|
||||
fgets(tmp, 256, fp);
|
||||
if (!*tmp) return OK;
|
||||
l = strlen(tmp) - 1;
|
||||
if (tmp[l] == '\n') {
|
||||
tmp[l] = 0;
|
||||
busy = 0;
|
||||
}
|
||||
if (DBufPuts(dbuf, tmp) != OK) return E_NO_MEM;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
45
src/dynbuf.h
Normal file
45
src/dynbuf.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DYNBUF.H */
|
||||
/* */
|
||||
/* Declaration of functions for manipulating dynamic buffers */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: dynbuf.h,v 1.3 2000-02-18 03:45:50 dfs Exp $ */
|
||||
|
||||
#ifndef DYNBUF_H
|
||||
#define DYNBUF_H
|
||||
|
||||
#include <stdio.h> /* For FILE */
|
||||
|
||||
#define DBUF_STATIC_SIZE 128
|
||||
typedef struct {
|
||||
char *buffer;
|
||||
int len;
|
||||
int allocatedLen;
|
||||
char staticBuf[DBUF_STATIC_SIZE];
|
||||
} DynamicBuffer;
|
||||
|
||||
#ifndef ARGS
|
||||
#ifdef HAVE_PROTOS
|
||||
#define ARGS(x) x
|
||||
#else
|
||||
#define ARGS(x) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void DBufInit(DynamicBuffer *dbuf);
|
||||
int DBufPutc(DynamicBuffer *dbuf, char c);
|
||||
int DBufPuts(DynamicBuffer *dbuf, char *str);
|
||||
void DBufFree(DynamicBuffer *dbuf);
|
||||
int DBufGets(DynamicBuffer *dbuf, FILE *fp);
|
||||
|
||||
#define DBufValue(bufPtr) ((bufPtr)->buffer)
|
||||
#define DBufLen(bufPtr) ((bufPtr)->len)
|
||||
|
||||
#endif /* DYNBUF_H */
|
||||
@@ -5,11 +5,12 @@
|
||||
/* Error definitions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: err.h,v 1.2 1996-04-28 02:01:55 dfs Exp $ */
|
||||
/* $Id: err.h,v 1.4 2000-02-18 03:45:51 dfs Exp $ */
|
||||
|
||||
/* Note that not all of the "errors" are really errors - some are just
|
||||
messages for information purposes. Constants beginning with M_ should
|
||||
@@ -5,22 +5,26 @@
|
||||
/* This file contains routines to parse and evaluate */
|
||||
/* expressions. */
|
||||
/* */
|
||||
/* Copyright 1992-1996 by David F. Skoll */
|
||||
/* Copyright 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.8 2000-02-18 03:45:52 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "err.h"
|
||||
#include "types.h"
|
||||
#include "expr.h"
|
||||
@@ -35,8 +39,7 @@ static char const RCSID[] = "$Id: expr.c,v 1.4 1996-05-25 18:14:51 dfs Exp $";
|
||||
#define LE 4
|
||||
#define NE 5
|
||||
|
||||
static char ExprBuf[TOKSIZE+1];
|
||||
static char CoerceBuf[TOKSIZE+1];
|
||||
static char CoerceBuf[512];
|
||||
extern int NumFuncs;
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
@@ -174,24 +177,27 @@ char **s;
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ParseExprToken(char *out, char **in)
|
||||
PRIVATE int ParseExprToken(DynamicBuffer *buf, char **in)
|
||||
#else
|
||||
static int ParseExprToken(out, in)
|
||||
char *out;
|
||||
static int ParseExprToken(buf, in)
|
||||
DynamicBuffer *buf;
|
||||
char **in;
|
||||
#endif
|
||||
{
|
||||
|
||||
char c;
|
||||
|
||||
*out = 0;
|
||||
DBufFree(buf);
|
||||
/* Skip white space */
|
||||
while (**in && isspace(**in)) (*in)++;
|
||||
|
||||
if (!**in) return OK;
|
||||
|
||||
*out++ = c = *(*in)++;
|
||||
*out = 0;
|
||||
c = *(*in)++;
|
||||
if (DBufPutc(buf, c) != OK) {
|
||||
DBufFree(buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
switch(c) {
|
||||
case COMMA:
|
||||
@@ -206,37 +212,59 @@ char **in;
|
||||
|
||||
case '&':
|
||||
case '|':
|
||||
case '=': if (**in == c) {
|
||||
*out++ = c;
|
||||
*out = 0;
|
||||
(*in)++;
|
||||
}
|
||||
return OK;
|
||||
case '=':
|
||||
if (**in == c) {
|
||||
if (DBufPutc(buf, c) != OK) {
|
||||
DBufFree(buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
(*in)++;
|
||||
}
|
||||
return OK;
|
||||
|
||||
case '!':
|
||||
case '>':
|
||||
case '<': if (**in == '=') {
|
||||
*out++ = '=';
|
||||
*out = 0;
|
||||
(*in)++;
|
||||
case '<':
|
||||
if (**in == '=') {
|
||||
if (DBufPutc(buf, '=') != OK) {
|
||||
DBufFree(buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
(*in)++;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
/* Handle the parsing of quoted strings */
|
||||
if (c == '\"') {
|
||||
if (!**in) return E_MISS_QUOTE;
|
||||
while (**in) if ((c = *out++ = *(*in)++) == '\"') break;
|
||||
*out = 0;
|
||||
if (c == '\"') return OK ; else return E_MISS_QUOTE;
|
||||
while (**in) {
|
||||
c = *(*in)++;
|
||||
if (DBufPutc(buf, c) != OK) {
|
||||
DBufFree(buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
if (c == '\"') break;
|
||||
}
|
||||
if (c == '\"') return OK;
|
||||
DBufFree(buf);
|
||||
return E_MISS_QUOTE;
|
||||
}
|
||||
|
||||
/* Dates can be specified with single-quotes */
|
||||
if (c == '\'') {
|
||||
if (!**in) return E_MISS_QUOTE;
|
||||
while (**in) if ((c = *out++ = *(*in)++) == '\'') break;
|
||||
*out = 0;
|
||||
if (c == '\'') return OK ; else return E_MISS_QUOTE;
|
||||
while (**in) {
|
||||
c = *(*in)++;
|
||||
if (DBufPutc(buf, c) != OK) {
|
||||
DBufFree(buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
if (c == '\'') break;
|
||||
}
|
||||
if (c == '\'') return OK;
|
||||
DBufFree(buf);
|
||||
}
|
||||
|
||||
if (!ISID(c) && c != '$') {
|
||||
@@ -245,16 +273,24 @@ char **in;
|
||||
}
|
||||
|
||||
/* Parse a constant, variable name or function */
|
||||
while (ISID(**in) || **in == ':' || **in == '.' || **in == TIMESEP)
|
||||
*out++ = *(*in)++;
|
||||
|
||||
while (ISID(**in) || **in == ':' || **in == '.' || **in == TIMESEP) {
|
||||
if (DBufPutc(buf, **in) != OK) {
|
||||
DBufFree(buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
(*in)++;
|
||||
}
|
||||
/* Chew up any remaining white space */
|
||||
while (**in && isspace(**in)) (*in)++;
|
||||
|
||||
/* Peek ahead - is it '('? Then we have a function call */
|
||||
if (**in == '(') *out++ = *(*in)++;
|
||||
|
||||
*out = 0;
|
||||
if (**in == '(') {
|
||||
if (DBufPutc(buf, '(') != OK) {
|
||||
DBufFree(buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
(*in)++;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -265,7 +301,7 @@ char **in;
|
||||
/* Put the result into value pointed to by v. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HaveProtos
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int EvalExpr(char **e, Value *v)
|
||||
#else
|
||||
int EvalExpr(e, v)
|
||||
@@ -277,10 +313,12 @@ Value *v;
|
||||
|
||||
OpStackPtr = 0;
|
||||
ValStackPtr = 0;
|
||||
|
||||
r = Evaluate(e, NULL);
|
||||
|
||||
/* Put last character parsed back onto input stream */
|
||||
if (*ExprBuf) (*e)--;
|
||||
if (DBufLen(&ExprBuf)) (*e)--;
|
||||
DBufFree(&ExprBuf);
|
||||
|
||||
if (r) {
|
||||
CleanStack();
|
||||
@@ -313,21 +351,35 @@ Var *locals;
|
||||
|
||||
while(1) {
|
||||
/* Looking for a value. Accept: value, unary op, func. call or left paren */
|
||||
r = ParseExprToken(ExprBuf, s);
|
||||
r = ParseExprToken(&ExprBuf, s);
|
||||
if (r) return r;
|
||||
if (!*ExprBuf) return E_EOLN;
|
||||
if (!DBufLen(&ExprBuf)) {
|
||||
DBufFree(&ExprBuf);
|
||||
return E_EOLN;
|
||||
}
|
||||
|
||||
if (*ExprBuf == '(') { /* Parenthesized expression */
|
||||
if (*DBufValue(&ExprBuf) == '(') { /* Parenthesized expression */
|
||||
DBufFree(&ExprBuf);
|
||||
r = Evaluate(s, locals); /* Leaves the last parsed token in ExprBuf */
|
||||
if (r) return r;
|
||||
if (*ExprBuf != ')') return E_MISS_RIGHT_PAREN;
|
||||
} else if (*ExprBuf == '+') continue; /* Ignore unary + */
|
||||
else if (*(ExprBuf + strlen(ExprBuf) -1) == '(') { /* Function Call */
|
||||
*(ExprBuf + strlen(ExprBuf) - 1) = 0;
|
||||
f = FindFunc(ExprBuf, Func, NumFuncs);
|
||||
r = OK;
|
||||
if (*DBufValue(&ExprBuf) != ')') {
|
||||
DBufFree(&ExprBuf);
|
||||
return E_MISS_RIGHT_PAREN;
|
||||
}
|
||||
if (r) return r;
|
||||
} else if (*DBufValue(&ExprBuf) == '+') {
|
||||
continue; /* Ignore unary + */
|
||||
}
|
||||
else if (*(DBufValue(&ExprBuf) + DBufLen(&ExprBuf) -1) == '(') { /* Function Call */
|
||||
*(DBufValue(&ExprBuf) + DBufLen(&ExprBuf) - 1) = 0;
|
||||
f = FindFunc(DBufValue(&ExprBuf), Func, NumFuncs);
|
||||
if (!f) {
|
||||
ufname = StrDup(ExprBuf);
|
||||
ufname = StrDup(DBufValue(&ExprBuf));
|
||||
DBufFree(&ExprBuf);
|
||||
if (!ufname) return E_NO_MEM;
|
||||
} else {
|
||||
DBufFree(&ExprBuf);
|
||||
}
|
||||
args = 0;
|
||||
if (PeekChar(s) == ')') { /* Function has no arguments */
|
||||
@@ -337,7 +389,8 @@ Var *locals;
|
||||
free(ufname);
|
||||
}
|
||||
if (r) return r;
|
||||
(void) ParseExprToken(ExprBuf, s); /* Guaranteed to be right paren. */
|
||||
r = ParseExprToken(&ExprBuf, s); /* Guaranteed to be right paren. */
|
||||
if (r) return r;
|
||||
} else { /* Function has some arguments */
|
||||
while(1) {
|
||||
args++;
|
||||
@@ -346,10 +399,12 @@ Var *locals;
|
||||
if (!f) free(ufname);
|
||||
return r;
|
||||
}
|
||||
if (*ExprBuf == ')') break;
|
||||
else if (*ExprBuf != ',') {
|
||||
if (*DBufValue(&ExprBuf) == ')') break;
|
||||
else if (*DBufValue(&ExprBuf) != ',') {
|
||||
if (!f) free(ufname);
|
||||
Eprint("%s: `%c'", ErrMsg[E_EXPECT_COMMA], *ExprBuf);
|
||||
Eprint("%s: `%c'", ErrMsg[E_EXPECT_COMMA],
|
||||
*DBufValue(&ExprBuf));
|
||||
DBufFree(&ExprBuf);
|
||||
return E_EXPECT_COMMA;
|
||||
}
|
||||
}
|
||||
@@ -359,27 +414,37 @@ Var *locals;
|
||||
free(ufname);
|
||||
}
|
||||
if (r) return r;
|
||||
DBufFree(&ExprBuf);
|
||||
}
|
||||
} else { /* Unary operator */
|
||||
f = FindFunc(ExprBuf, UnOp, NUM_UN_OPS);
|
||||
f = FindFunc(DBufValue(&ExprBuf), UnOp, NUM_UN_OPS);
|
||||
if (f) {
|
||||
DBufFree(&ExprBuf);
|
||||
PushOpStack(*f);
|
||||
continue; /* Still looking for an atomic vlue */
|
||||
} else if (!ISID(*ExprBuf) && *ExprBuf != '$'
|
||||
&& *ExprBuf != '"' && *ExprBuf != '\'') {
|
||||
Eprint("%s `%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
|
||||
} else if (!ISID(*DBufValue(&ExprBuf)) &&
|
||||
*DBufValue(&ExprBuf) != '$' &&
|
||||
*DBufValue(&ExprBuf) != '"' &&
|
||||
*DBufValue(&ExprBuf) != '\'') {
|
||||
Eprint("%s `%c'", ErrMsg[E_ILLEGAL_CHAR],
|
||||
*DBufValue(&ExprBuf));
|
||||
DBufFree(&ExprBuf);
|
||||
return E_ILLEGAL_CHAR;
|
||||
} else { /* Must be a literal value */
|
||||
r = MakeValue(ExprBuf, &va, locals);
|
||||
r = MakeValue(DBufValue(&ExprBuf), &va, locals);
|
||||
DBufFree(&ExprBuf);
|
||||
if (r) return r;
|
||||
PushValStack(va);
|
||||
}
|
||||
}
|
||||
/* OK, we've got a literal value; now, we're looking for the end of the
|
||||
expression, or a binary operator. */
|
||||
r = ParseExprToken(ExprBuf, s);
|
||||
r = ParseExprToken(&ExprBuf, s);
|
||||
if (r) return r;
|
||||
if (*ExprBuf == 0 || *ExprBuf == ',' || *ExprBuf == ']' || *ExprBuf == ')') {
|
||||
if (*DBufValue(&ExprBuf) == 0 ||
|
||||
*DBufValue(&ExprBuf) == ',' ||
|
||||
*DBufValue(&ExprBuf) == ']' ||
|
||||
*DBufValue(&ExprBuf) == ')') {
|
||||
/* We've hit the end of the expression. Pop off and evaluate until
|
||||
OpStackPtr = OpBase and ValStackPtr = ValBase+1 */
|
||||
while (OpStackPtr > OpBase) {
|
||||
@@ -389,14 +454,20 @@ Var *locals;
|
||||
else
|
||||
r=(op.func)();
|
||||
if (r) {
|
||||
DBufFree(&ExprBuf);
|
||||
Eprint("`%s': %s", op.name, ErrMsg[r]);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
if (ValStackPtr != ValBase+1) return E_STACK_ERR; else return OK;
|
||||
if (ValStackPtr != ValBase+1) {
|
||||
DBufFree(&ExprBuf);
|
||||
return E_STACK_ERR;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
/* Must be a binary operator */
|
||||
f = FindFunc(ExprBuf, BinOp, NUM_BIN_OPS);
|
||||
f = FindFunc(DBufValue(&ExprBuf), BinOp, NUM_BIN_OPS);
|
||||
DBufFree(&ExprBuf);
|
||||
if (!f) return E_EXPECTING_BINOP;
|
||||
|
||||
/* While operators of higher or equal precedence are on the stack,
|
||||
@@ -5,11 +5,12 @@
|
||||
/* 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-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: expr.h,v 1.1 1996-03-27 03:25:54 dfs Exp $ */
|
||||
/* $Id: expr.h,v 1.4 2000-02-18 03:45:53 dfs Exp $ */
|
||||
|
||||
/* Define the types of values */
|
||||
#define ERR_TYPE 0
|
||||
@@ -7,25 +7,41 @@
|
||||
/* files. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.10 2000-02-18 03:45:54 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef TM_IN_SYS_TIME
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__)
|
||||
#include <io.h>
|
||||
@@ -55,6 +71,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 +84,9 @@ typedef struct {
|
||||
int NumIfs;
|
||||
long offset;
|
||||
CachedLine *CLine;
|
||||
#ifdef UNIX
|
||||
int ownedByMe;
|
||||
#endif
|
||||
} IncludeStruct;
|
||||
|
||||
static CachedFile *CachedFiles = (CachedFile *) NULL;
|
||||
@@ -78,6 +100,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));
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -124,36 +147,51 @@ int ReadLine()
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ReadLineFromFile(void)
|
||||
#else
|
||||
static ReadLineFromFile()
|
||||
static int ReadLineFromFile()
|
||||
#endif
|
||||
{
|
||||
int l;
|
||||
char *ptr;
|
||||
char *tmp;
|
||||
|
||||
CurLine = LineBuffer;
|
||||
*LineBuffer = (char) 0;
|
||||
l = 0;
|
||||
ptr = LineBuffer;
|
||||
DynamicBuffer buf;
|
||||
|
||||
DBufInit(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
|
||||
while(fp) {
|
||||
tmp=fgets(ptr, LINELEN-l, fp);
|
||||
if (DBufGets(&buf, fp) != OK) {
|
||||
DBufFree(&LineBuffer);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
LineNo++;
|
||||
if (ferror(fp)) return E_IO_ERR;
|
||||
if (feof(fp) || !tmp) {
|
||||
if (ferror(fp)) {
|
||||
DBufFree(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
return E_IO_ERR;
|
||||
}
|
||||
if (feof(fp)) {
|
||||
FCLOSE(fp);
|
||||
}
|
||||
l = strlen(LineBuffer);
|
||||
if (l && (LineBuffer[l-1] == '\n')) LineBuffer[--l] = '\0';
|
||||
if (l && (LineBuffer[l-1] == '\\')) {
|
||||
l--;
|
||||
ptr = LineBuffer+l;
|
||||
if (l >= LINELEN-1) return E_LINE_2_LONG;
|
||||
l = DBufLen(&buf);
|
||||
if (l && (DBufValue(&buf)[l-1] == '\\')) {
|
||||
DBufValue(&buf)[l-1] = 0;
|
||||
if (DBufPuts(&LineBuffer, DBufValue(&buf)) != OK) {
|
||||
DBufFree(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (DBufPuts(&LineBuffer, DBufValue(&buf)) != OK) {
|
||||
DBufFree(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
FreshLine = 1;
|
||||
CurLine = DBufValue(&LineBuffer);
|
||||
if (DebugFlag & DB_ECHO_LINE) OutputLine(ErrFp);
|
||||
return OK;
|
||||
}
|
||||
CurLine = DBufValue(&LineBuffer);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -176,6 +214,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 +224,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 +240,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 +249,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 +295,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();
|
||||
@@ -258,13 +312,14 @@ char *fname;
|
||||
return r;
|
||||
}
|
||||
/* Skip blank chars */
|
||||
s = LineBuffer;
|
||||
s = DBufValue(&LineBuffer);
|
||||
while (isspace(*s)) s++;
|
||||
if (*s && *s!=';' && *s!='#') {
|
||||
/* Add the line to the cache */
|
||||
if (!cl) {
|
||||
cf->cache = NEW(CachedLine);
|
||||
if (!cf->cache) {
|
||||
DBufFree(&LineBuffer);
|
||||
DestroyCache(cf);
|
||||
ShouldCache = 0;
|
||||
FCLOSE(fp);
|
||||
@@ -274,6 +329,7 @@ char *fname;
|
||||
} else {
|
||||
cl->next = NEW(CachedLine);
|
||||
if (!cl->next) {
|
||||
DBufFree(&LineBuffer);
|
||||
DestroyCache(cf);
|
||||
ShouldCache = 0;
|
||||
FCLOSE(fp);
|
||||
@@ -284,6 +340,7 @@ char *fname;
|
||||
cl->next = NULL;
|
||||
cl->LineNo = LineNo;
|
||||
cl->text = StrDup(s);
|
||||
DBufFree(&LineBuffer);
|
||||
if (!cl->text) {
|
||||
DestroyCache(cf);
|
||||
ShouldCache = 0;
|
||||
@@ -314,6 +371,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 +385,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... */
|
||||
}
|
||||
@@ -353,13 +419,18 @@ int DoInclude(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
{
|
||||
char tok[TOKSIZE];
|
||||
DynamicBuffer buf;
|
||||
int r, e;
|
||||
|
||||
if ( (r=ParseToken(p, tok)) ) return r;
|
||||
DBufInit(&buf);
|
||||
if ( (r=ParseToken(p, &buf)) ) return r;
|
||||
e = VerifyEoln(p);
|
||||
if (e) Eprint("%s", ErrMsg[e]);
|
||||
if ( (r=IncludeFile(tok)) ) return r;
|
||||
if ( (r=IncludeFile(DBufValue(&buf))) ) {
|
||||
DBufFree(&buf);
|
||||
return r;
|
||||
}
|
||||
DBufFree(&buf);
|
||||
NumIfs = 0;
|
||||
IfFlags = 0;
|
||||
return OK;
|
||||
@@ -382,6 +453,7 @@ char *fname;
|
||||
{
|
||||
IncludeStruct *i;
|
||||
int r;
|
||||
int oldRunDisabled;
|
||||
|
||||
if (IStackPtr+1 >= INCLUDE_NEST) return E_NESTED_INCLUDE;
|
||||
i = &IStack[IStackPtr];
|
||||
@@ -393,6 +465,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 +479,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 +637,64 @@ 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 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_IWOTH)) {
|
||||
fprintf(ErrFp, "SECURITY: Won't read 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;
|
||||
}
|
||||
@@ -6,44 +6,61 @@
|
||||
/* expressions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
static char const RCSID[] = "$Id: funcs.c,v 1.4 1996-10-06 21:03:49 dfs Exp $";
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: funcs.c,v 1.9 2000-02-18 03:45:55 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#ifdef UNIX
|
||||
#ifdef HAVE_UNISTD
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_FILE_H
|
||||
#include <sys/file.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef TM_IN_SYS_TIME
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__) || defined(__OS2__)
|
||||
#include <io.h>
|
||||
#define R_OK 4
|
||||
#define W_OK 2
|
||||
#define X_OK 1
|
||||
#endif
|
||||
|
||||
#ifndef R_OK
|
||||
#define R_OK 4
|
||||
#define W_OK 2
|
||||
#define X_OK 1
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
@@ -98,8 +115,10 @@ PRIVATE int FPsshade ARGS ((void));
|
||||
PRIVATE int FShell ARGS ((void));
|
||||
PRIVATE int FStrlen ARGS ((void));
|
||||
PRIVATE int FSubstr ARGS ((void));
|
||||
PRIVATE int FSunrise ARGS ((void));
|
||||
PRIVATE int FDawn ARGS ((void));
|
||||
PRIVATE int FDusk ARGS ((void));
|
||||
PRIVATE int FSunset ARGS ((void));
|
||||
PRIVATE int FSunrise ARGS ((void));
|
||||
PRIVATE int FTime ARGS ((void));
|
||||
PRIVATE int FTrigdate ARGS ((void));
|
||||
PRIVATE int FTrigtime ARGS ((void));
|
||||
@@ -193,10 +212,12 @@ Operator Func[] = {
|
||||
{ "choose", 2, NO_MAX, FChoose },
|
||||
{ "coerce", 2, 2, FCoerce },
|
||||
{ "date", 3, 3, FDate },
|
||||
{ "dawn", 0, 1, FDawn},
|
||||
{ "day", 1, 1, FDay },
|
||||
{ "daysinmon", 2, 2, FDaysinmon },
|
||||
{ "defined", 1, 1, FDefined },
|
||||
{ "dosubst", 1, 3, FDosubst },
|
||||
{ "dusk", 0, 1, FDusk },
|
||||
{ "easterdate", 1, 1, FEasterdate },
|
||||
{ "filedate", 1, 1, FFiledate },
|
||||
{ "filedir", 0, 0, FFiledir },
|
||||
@@ -232,7 +253,7 @@ Operator Func[] = {
|
||||
{ "realnow", 0, 0, FRealnow},
|
||||
{ "realtoday", 0, 0, FRealtoday },
|
||||
{ "sgn", 1, 1, FSgn },
|
||||
{ "shell", 1, 1, FShell },
|
||||
{ "shell", 1, 2, FShell },
|
||||
{ "strlen", 1, 1, FStrlen },
|
||||
{ "substr", 2, 3, FSubstr },
|
||||
{ "sunrise", 0, 1, FSunrise},
|
||||
@@ -994,7 +1015,10 @@ static int FUpper()
|
||||
if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
|
||||
DCOPYVAL(RetVal, ARG(0));
|
||||
s = RetVal.v.str;
|
||||
while (*s) { *s = UPPER(*s); s++; }
|
||||
while (*s) {
|
||||
*s = UPPER(*s);
|
||||
s++;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1009,7 +1033,10 @@ static int FLower()
|
||||
if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
|
||||
DCOPYVAL(RetVal, ARG(0));
|
||||
s = RetVal.v.str;
|
||||
while (*s) { *s = LOWER(*s); s++; }
|
||||
while (*s) {
|
||||
*s = LOWER(*s);
|
||||
s++;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1285,35 +1312,52 @@ PRIVATE int FShell(void)
|
||||
static int FShell()
|
||||
#endif
|
||||
{
|
||||
char buf[SHELLSIZE+1];
|
||||
int ch, len;
|
||||
DynamicBuffer buf;
|
||||
int ch, r;
|
||||
FILE *fp;
|
||||
char *s;
|
||||
|
||||
/* For compatibility with previous versions of Remind, which
|
||||
used a static buffer for reading results from shell() command */
|
||||
int maxlen = 511;
|
||||
|
||||
DBufInit(&buf);
|
||||
if (RunDisabled) return E_RUN_DISABLED;
|
||||
if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
|
||||
s = buf;
|
||||
len = 0;
|
||||
if (Nargs >= 2) {
|
||||
if (ARG(1).type != INT_TYPE) return E_BAD_TYPE;
|
||||
maxlen = ARG(1).v.val;
|
||||
}
|
||||
fp = POPEN(ARG(0).v.str, "r");
|
||||
if (!fp) return E_IO_ERR;
|
||||
while (len < SHELLSIZE) {
|
||||
while (1) {
|
||||
ch = getc(fp);
|
||||
if (ch == EOF) {
|
||||
break;
|
||||
}
|
||||
if (isspace(ch)) *s++ = ' ';
|
||||
else *s++ = ch;
|
||||
len++;
|
||||
if (isspace(ch)) ch = ' ';
|
||||
if (DBufPutc(&buf, (char) ch) != OK) {
|
||||
PCLOSE(fp);
|
||||
DBufFree(&buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
if (maxlen > 0 && DBufLen(&buf) >= maxlen) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
*s = 0;
|
||||
|
||||
/* Delete trailing newline (converted to space) */
|
||||
if (s > buf && *(s-1) == ' ') *(s-1) = 0;
|
||||
if (DBufLen(&buf) && DBufValue(&buf)[DBufLen(&buf)-1] == ' ') {
|
||||
DBufValue(&buf)[DBufLen(&buf)-1] = 0;
|
||||
}
|
||||
#if defined(__MSDOS__) || defined(__OS2__)
|
||||
if (s-1 > buf && *(s-2) == ' ') *(s-2) = 0;
|
||||
if (DBufLen(&buf) > 1 && DBufValue(&buf)[DBufLen(&buf)-2] == ' ') {
|
||||
DBufValue(&buf)[DBufLen(&buf)-2] = 0;
|
||||
}
|
||||
#endif
|
||||
PCLOSE(fp);
|
||||
return RetStrVal(buf);
|
||||
r = RetStrVal(DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -1481,24 +1525,33 @@ PRIVATE int FFiledir(void)
|
||||
static int FFiledir()
|
||||
#endif
|
||||
{
|
||||
char TmpBuf[LINELEN]; /* Should be _POSIX_PATH_MAX ? */
|
||||
char *s;
|
||||
DynamicBuffer buf;
|
||||
int r;
|
||||
|
||||
strcpy(TmpBuf, FileName);
|
||||
s = TmpBuf + strlen(TmpBuf) - 1;
|
||||
if (s < TmpBuf) return RetStrVal(".");
|
||||
DBufInit(&buf);
|
||||
|
||||
if (DBufPuts(&buf, FileName) != OK) return E_NO_MEM;
|
||||
if (DBufLen(&buf) == 0) {
|
||||
DBufFree(&buf);
|
||||
return RetStrVal(".");
|
||||
}
|
||||
|
||||
s = DBufValue(&buf) + DBufLen(&buf) - 1;
|
||||
#if defined(__OS2__) || defined(__MSDOS__)
|
||||
/* Both '\\' and '/' can be part of path; handle drive letters. */
|
||||
while (s > TmpBuf && !strchr("\\/:", *s)) s--;
|
||||
while (s > DBufValue(&buf) && !strchr("\\/:", *s)) s--;
|
||||
if (*s == ':') { s[1] = '.'; s += 2; }
|
||||
if (s > TmpBuf) *s = '/';
|
||||
if (s > DBufValue(&buf)) *s = '/';
|
||||
#else
|
||||
while (s > TmpBuf && *s != '/') s--;
|
||||
while (s > DBufValue(&buf) && *s != '/') s--;
|
||||
#endif
|
||||
if (*s == '/') {
|
||||
*s = 0;
|
||||
return RetStrVal(TmpBuf);
|
||||
} else return RetStrVal(".");
|
||||
r = RetStrVal(DBufValue(&buf));
|
||||
} else r = RetStrVal(".");
|
||||
DBufFree(&buf);
|
||||
return r;
|
||||
}
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -1673,7 +1726,9 @@ static int FDosubst()
|
||||
#endif
|
||||
{
|
||||
int jul, tim, r;
|
||||
char TmpBuf[LINELEN];
|
||||
DynamicBuffer buf;
|
||||
|
||||
DBufInit(&buf);
|
||||
|
||||
jul = NO_DATE;
|
||||
tim = NO_TIME;
|
||||
@@ -1687,8 +1742,10 @@ static int FDosubst()
|
||||
}
|
||||
}
|
||||
|
||||
if ((r=DoSubstFromString(ARG(0).v.str, TmpBuf, jul, tim))) return r;
|
||||
return RetStrVal(TmpBuf);
|
||||
if ((r=DoSubstFromString(ARG(0).v.str, &buf, jul, tim))) return r;
|
||||
r = RetStrVal(DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -1967,6 +2024,7 @@ int jul;
|
||||
int year, mon, day;
|
||||
int jan0;
|
||||
int mins, hours;
|
||||
int dusk_or_dawn;
|
||||
|
||||
double M, L, tanA, sinDelta, cosDelta, a, a_hr, cosH, t, H, T;
|
||||
double latitude, longdeg, UT, local;
|
||||
@@ -1990,6 +2048,9 @@ int jul;
|
||||
FromJulian(jul, &year, &mon, &day);
|
||||
jan0 = jul - Julian(year, 0, 1);
|
||||
|
||||
dusk_or_dawn = rise;
|
||||
if (rise > 1)
|
||||
rise -= 2;
|
||||
/* Following formula on page B6 exactly... */
|
||||
t = (double) jan0;
|
||||
if (rise) t += (6.0 + longdeg/15.0) / 24.0;
|
||||
@@ -2000,6 +2061,11 @@ int jul;
|
||||
|
||||
/* Sun's true longitude */
|
||||
L = M + 1.916*sin(DEGRAD*M) + 0.02*sin(2*DEGRAD*M) + 282.565;
|
||||
if (dusk_or_dawn == 2) {/* dusk */
|
||||
L += 6;
|
||||
} else if (dusk_or_dawn == 3) {/* dawn */
|
||||
L -= 14;
|
||||
}
|
||||
if (L > 360.0) L -= 360.0;
|
||||
|
||||
/* Tan of sun's right ascension */
|
||||
@@ -2018,7 +2084,7 @@ int jul;
|
||||
}
|
||||
/* if (fabs(a - L) > 90.0)
|
||||
a += 180.0; */
|
||||
|
||||
|
||||
if (a > 360.0)
|
||||
a -= 360.0;
|
||||
a_hr = a / 15.0;
|
||||
@@ -2026,11 +2092,18 @@ int jul;
|
||||
/* Sine of sun's declination */
|
||||
sinDelta = 0.39782 * sin(DEGRAD*L);
|
||||
cosDelta = sqrt(1 - sinDelta*sinDelta);
|
||||
|
||||
|
||||
/* 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;
|
||||
@@ -2038,9 +2111,9 @@ int jul;
|
||||
T = H / 15.0 + a_hr - 0.065710*t - 6.620;
|
||||
if (T >= 24.0) T -= 24.0;
|
||||
else if (T < 0.0) T+= 24.0;
|
||||
|
||||
|
||||
UT = T + longdeg / 15.0;
|
||||
|
||||
|
||||
|
||||
local = UT + (double) mins / 60.0;
|
||||
if (local < 0.0) local += 24.0;
|
||||
@@ -2048,7 +2121,16 @@ 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 +2159,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;
|
||||
@@ -2101,6 +2186,23 @@ static int FSunset()
|
||||
return FSun(0);
|
||||
}
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int FDawn(void)
|
||||
#else
|
||||
static int FDawn()
|
||||
#endif
|
||||
{
|
||||
return FSun(3);
|
||||
}
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int FDusk(void)
|
||||
#else
|
||||
static int FDusk()
|
||||
#endif
|
||||
{
|
||||
return FSun(2);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* FFiledate */
|
||||
@@ -8,13 +8,14 @@
|
||||
/* globals.h and err.h */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.4 2000-02-18 03:45:56 dfs Exp $";
|
||||
|
||||
#include <stdio.h> /* For defintion of FILE - sigh! */
|
||||
#include "types.h"
|
||||
#define MK_GLOBALS
|
||||
@@ -7,11 +7,12 @@
|
||||
/* MK_GLOBALS. Also contains useful macro definitions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: globals.h,v 1.1 1996-03-27 03:25:57 dfs Exp $ */
|
||||
/* $Id: globals.h,v 1.7 2000-02-18 03:45:57 dfs Exp $ */
|
||||
|
||||
#ifdef MK_GLOBALS
|
||||
#undef EXTERN
|
||||
@@ -36,9 +37,6 @@ EXTERN int CurMon;
|
||||
EXTERN int CurYear;
|
||||
EXTERN int LineNo;
|
||||
EXTERN int FreshLine;
|
||||
EXTERN char LineBuffer[LINELEN];
|
||||
EXTERN char SubstBuffer[LINELEN];
|
||||
EXTERN char TokBuffer[TOKSIZE+1];
|
||||
EXTERN INIT( char *MsgCommand, NULL);
|
||||
EXTERN INIT( int ShowAllErrors, 0);
|
||||
EXTERN INIT( int DebugFlag, 0);
|
||||
@@ -113,9 +111,11 @@ EXTERN INIT( char *EndSentIg, "\"')]}>");
|
||||
/* We need the language stuff here... */
|
||||
|
||||
#include "lang.h"
|
||||
#include "dynbuf.h"
|
||||
|
||||
EXTERN INIT( char Banner[LINELEN], L_BANNER);
|
||||
|
||||
EXTERN DynamicBuffer Banner;
|
||||
EXTERN DynamicBuffer LineBuffer;
|
||||
EXTERN DynamicBuffer ExprBuf;
|
||||
/* List of months */
|
||||
EXTERN char *EnglishMonthName[]
|
||||
#ifdef MK_GLOBALS
|
||||
@@ -5,17 +5,18 @@
|
||||
/* Support for the Hebrew calendar */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/* 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.4 2000-02-18 03:45:58 dfs Exp $";
|
||||
|
||||
#include <stdio.h> /* For FILE used by protos.h - sigh. */
|
||||
#include "config.h"
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "globals.h"
|
||||
@@ -7,30 +7,39 @@
|
||||
/* in normal mode. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
static char const RCSID[] = "$Id: init.c,v 1.3 1996-10-27 21:28:03 dfs Exp $";
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: init.c,v 1.13 2000-02-18 03:53:45 dfs Exp $";
|
||||
|
||||
#define L_IN_INIT 1
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#ifdef UNIX
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#ifdef HAVE_UNISTD
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
@@ -112,6 +121,22 @@ char *argv[];
|
||||
int y, m, d, rep;
|
||||
Token tok;
|
||||
|
||||
/* Initialize global dynamic buffers */
|
||||
DBufInit(&Banner);
|
||||
DBufInit(&LineBuffer);
|
||||
DBufInit(&ExprBuf);
|
||||
|
||||
DBufPuts(&Banner, L_BANNER);
|
||||
|
||||
/* 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 +196,7 @@ char *argv[];
|
||||
|
||||
case 'r':
|
||||
case 'R':
|
||||
RunDisabled = 1;
|
||||
RunDisabled = RUN_CMDLINE;
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
@@ -225,6 +250,7 @@ char *argv[];
|
||||
case 'u':
|
||||
case 'U':
|
||||
ChgUser(arg);
|
||||
RunDisabled = RUN_CMDLINE;
|
||||
while (*arg) arg++;
|
||||
break;
|
||||
#endif
|
||||
@@ -233,9 +259,16 @@ char *argv[];
|
||||
case 'z':
|
||||
case 'Z':
|
||||
DontFork = 1;
|
||||
PARSENUM(Daemon, arg);
|
||||
if (Daemon<5) Daemon=5;
|
||||
else if (Daemon>60) Daemon=60;
|
||||
if (*arg == '0') {
|
||||
PARSENUM(Daemon, arg);
|
||||
if (Daemon == 0) Daemon = -1;
|
||||
else if (Daemon < 5) Daemon = 5;
|
||||
else if (Daemon > 60) Daemon = 60;
|
||||
} else {
|
||||
PARSENUM(Daemon, arg);
|
||||
if (Daemon<5) Daemon=5;
|
||||
else if (Daemon>60) Daemon=60;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
@@ -291,7 +324,7 @@ char *argv[];
|
||||
case 'W':
|
||||
if (*arg != ',') {
|
||||
PARSENUM(CalWidth, arg);
|
||||
if (CalWidth < 80) CalWidth = 80;
|
||||
if (CalWidth < 71) CalWidth = 71;
|
||||
}
|
||||
if (*arg == ',') {
|
||||
arg++;
|
||||
@@ -455,7 +488,8 @@ 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-1998 David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "Copyright 1999-2000 Roaring Penguin Software Inc.\n");
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
@@ -507,12 +541,7 @@ static void ChgUser(user)
|
||||
char *user;
|
||||
#endif /* HAVE_PROTOS */
|
||||
{
|
||||
#ifdef SYSV
|
||||
/* uid_t myuid; This seems to mess up on XENIX, so forget it... */
|
||||
int myuid;
|
||||
#else
|
||||
int myuid;
|
||||
#endif
|
||||
uid_t myuid;
|
||||
|
||||
struct passwd *pwent;
|
||||
static char *home, *shell, *username, *logname;
|
||||
@@ -5,11 +5,12 @@
|
||||
/* 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-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: lang.h,v 1.4 1996-10-12 02:49:33 dfs Exp $ */
|
||||
/* $Id: lang.h,v 1.5 2000-02-18 03:46:00 dfs Exp $ */
|
||||
|
||||
/* I'm chauvinistic and name each language with its English name... */
|
||||
|
||||
@@ -23,8 +24,10 @@
|
||||
#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 */
|
||||
#define SPANISH 11 /* translated by Rafa Couto */
|
||||
|
||||
/* Add more languages here - but please e-mail aa775@freenet.carleton.ca
|
||||
/* Add more languages here - but please e-mail dfs@roaringpenguin.com
|
||||
to have your favorite language assigned a number. If you add a
|
||||
language, please send me the header file, and permission to include
|
||||
it in future releases of Remind. Note that you'll get no remuneration
|
||||
@@ -43,28 +46,32 @@
|
||||
|
||||
/* Pick up the appropriate header file */
|
||||
#if LANG == ENGLISH
|
||||
#include "english.h"
|
||||
#include "langs/english.h"
|
||||
#elif LANG == GERMAN
|
||||
#include "german.h"
|
||||
#include "langs/german.h"
|
||||
#elif LANG == DUTCH
|
||||
#include "dutch.h"
|
||||
#include "langs/dutch.h"
|
||||
#elif LANG == FINNISH
|
||||
#include "finnish.h"
|
||||
#include "langs/finnish.h"
|
||||
#elif LANG == FRENCH
|
||||
#include "french.h"
|
||||
#include "langs/french.h"
|
||||
#elif LANG == NORWEGIAN
|
||||
#include "norwgian.h"
|
||||
#include "langs/norwgian.h"
|
||||
#elif LANG == DANISH
|
||||
#include "danish.h"
|
||||
#include "langs/danish.h"
|
||||
#elif LANG == POLISH
|
||||
#include "polish.h"
|
||||
#include "langs/polish.h"
|
||||
#elif LANG == BRAZPORT
|
||||
#include "portbr.h"
|
||||
#include "langs/portbr.h"
|
||||
#elif LANG == ITALIAN
|
||||
#include "italian.h"
|
||||
#include "langs/italian.h"
|
||||
#elif LANG == ROMANIAN
|
||||
#include "langs/romanian.h"
|
||||
#elif LANG == SPANISH
|
||||
#include "langs/spanish.h"
|
||||
|
||||
/* If no sensible language, choose English. I intended to use
|
||||
the #error directive here, but some C compilers barf. */
|
||||
#else
|
||||
#include "english.h"
|
||||
#include "langs/english.h"
|
||||
#endif
|
||||
@@ -6,18 +6,19 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* 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.7 2000-02-18 03:46:17 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Danish"
|
||||
|
||||
/* Day names */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_SUNDAY "S\370ndag"
|
||||
#else
|
||||
# define L_SUNDAY "Soendag"
|
||||
@@ -27,19 +28,16 @@
|
||||
#define L_WEDNESDAY "Onsdag"
|
||||
#define L_THURSDAY "Torsdag"
|
||||
#define L_FRIDAY "Fredag"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_SATURDAY "L\370rdag"
|
||||
#else
|
||||
# define L_SATURDAY "Loerdag"
|
||||
#endif
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#define L_DAYINIT "SMTOTFL"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "Januar"
|
||||
#define L_FEB "Februar"
|
||||
#define L_MAR "Mars"
|
||||
#define L_MAR "Marts"
|
||||
#define L_APR "April"
|
||||
#define L_MAY "Maj"
|
||||
#define L_JUN "Juni"
|
||||
@@ -55,7 +53,7 @@
|
||||
#define L_TOMORROW "i morgen"
|
||||
|
||||
/* The default banner */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_BANNER "P\345mindelse for %w, %d. %m, %y%o:"
|
||||
#else
|
||||
# define L_BANNER "Paamindelse for %w, %d. %m, %y%o:"
|
||||
@@ -76,7 +74,7 @@
|
||||
#define L_INXDAYS "om %d dage"
|
||||
|
||||
/* "on" as in "on date..." */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_ON "p\345"
|
||||
#else
|
||||
# define L_ON "paa"
|
||||
@@ -11,11 +11,12 @@
|
||||
/* Further corrections by Erik-Jan Vens */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: dutch.h,v 1.1 1996-03-27 03:25:53 dfs Exp $ */
|
||||
/* $Id: dutch.h,v 1.5 2000-02-18 03:46:18 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Dutch"
|
||||
@@ -29,9 +30,6 @@
|
||||
#define L_FRIDAY "vrijdag"
|
||||
#define L_SATURDAY "zaterdag"
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#define L_DAYINIT "zmdwdvz"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "januari"
|
||||
#define L_FEB "februari"
|
||||
@@ -5,11 +5,12 @@
|
||||
/* Support for the English language. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: english.h,v 1.1 1996-03-27 03:25:53 dfs Exp $ */
|
||||
/* $Id: english.h,v 1.5 2000-02-18 03:46:19 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "English"
|
||||
@@ -23,9 +24,6 @@
|
||||
#define L_FRIDAY "Friday"
|
||||
#define L_SATURDAY "Saturday"
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#define L_DAYINIT "SMTWTFS"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "January"
|
||||
#define L_FEB "February"
|
||||
@@ -4,18 +4,19 @@
|
||||
/* */
|
||||
/* Support for the Finnish language. */
|
||||
/* */
|
||||
/* Author: Mikko Silvonen <Mikko.Silvonen@Helsinki.FI> */
|
||||
/* Author: Mikko Silvonen <silvonen@iki.fi> */
|
||||
/* */
|
||||
/* Finnish holidays and name days for Remind are available */
|
||||
/* at ftp.funet.fi (pub/unix/misc/remind-fin*). */
|
||||
/* See http://www.iki.fi/silvonen/remind/ for a list of */
|
||||
/* Finnish holidays. */
|
||||
/* */
|
||||
/* 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 */
|
||||
/* This file is Copyright (C) 1993-1998 by Mikko Silvonen. */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: finnish.h,v 1.3 1996-04-29 19:34:37 dfs Exp $ */
|
||||
/* $Id: finnish.h,v 1.10 2000-02-18 03:53:49 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Finnish"
|
||||
@@ -29,19 +30,16 @@
|
||||
#define L_FRIDAY "perjantai"
|
||||
#define L_SATURDAY "lauantai"
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#define L_DAYINIT "SMTKTPL"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "tammikuu"
|
||||
#define L_FEB "helmikuu"
|
||||
#define L_MAR "maaliskuu"
|
||||
#define L_APR "huhtikuu"
|
||||
#define L_MAY "toukokuu"
|
||||
#if defined(ISOLATIN1)
|
||||
#if ISOLATIN1
|
||||
#define L_JUN "kes\xE4kuu"
|
||||
#define L_JUL "hein\xE4kuu"
|
||||
#elif defined(IBMEXTENDED)
|
||||
#elif IBMEXTENDED
|
||||
#define L_JUN "kes\x84kuu"
|
||||
#define L_JUL "hein\x84kuu"
|
||||
#else
|
||||
@@ -55,9 +53,9 @@
|
||||
#define L_DEC "joulukuu"
|
||||
|
||||
/* Today and tomorrow */
|
||||
#if defined(ISOLATIN1)
|
||||
#if ISOLATIN1
|
||||
#define L_TODAY "t\xE4n\xE4\xE4n"
|
||||
#elif defined(IBMEXTENDED)
|
||||
#elif IBMEXTENDED
|
||||
#define L_TODAY "t\x84n\x84\x84n"
|
||||
#else
|
||||
#define L_TODAY "t{n{{n"
|
||||
@@ -65,11 +63,11 @@
|
||||
#define L_TOMORROW "huomenna"
|
||||
|
||||
/* The default banner */
|
||||
#define L_BANNER "Viestit %wna, %d. %mta %y%o:"
|
||||
#define L_BANNER "Viestit %wna %d. %mta %y%o:"
|
||||
|
||||
/* "am" and "pm" */
|
||||
#define L_AM "ap"
|
||||
#define L_PM "ip"
|
||||
#define L_AM " ap."
|
||||
#define L_PM " ip."
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
@@ -79,9 +77,9 @@
|
||||
#define L_FROMNOW "kuluttua"
|
||||
|
||||
/* "in %d days' time" */
|
||||
#if defined(ISOLATIN1)
|
||||
#if ISOLATIN1
|
||||
#define L_INXDAYS "%d p\xE4iv\xE4n kuluttua"
|
||||
#elif defined(IBMEXTENDED)
|
||||
#elif IBMEXTENDED
|
||||
#define L_INXDAYS "%d p\x84iv\x84n kuluttua"
|
||||
#else
|
||||
#define L_INXDAYS "%d p{iv{n kuluttua"
|
||||
@@ -95,9 +93,9 @@
|
||||
/* Pluralizing - this is a problem for many languages and may require
|
||||
a more drastic fix */
|
||||
/* The partitive ending of "day" */
|
||||
#if defined(ISOLATIN1)
|
||||
#if ISOLATIN1
|
||||
#define L_PLURAL "\xE4"
|
||||
#elif defined(IBMEXTENDED)
|
||||
#elif IBMEXTENDED
|
||||
#define L_PLURAL "\x84"
|
||||
#else
|
||||
#define L_PLURAL "{"
|
||||
@@ -125,7 +123,7 @@
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
|
||||
#if defined(ISOLATIN1)
|
||||
#if ISOLATIN1
|
||||
#define L_ORDINAL_OVERRIDE switch(d) { \
|
||||
case 1: plu = ":sen\xE4"; break; \
|
||||
case 2: plu = ":sena"; break; \
|
||||
@@ -138,7 +136,7 @@
|
||||
default: plu = ":nten\xE4"; break; \
|
||||
} \
|
||||
}
|
||||
#elif defined(IBMEXTENDED)
|
||||
#elif IBMEXTENDED
|
||||
#define L_ORDINAL_OVERRIDE switch(d) { \
|
||||
case 1: plu = ":sen\x84"; break; \
|
||||
case 2: plu = ":sena"; break; \
|
||||
@@ -165,45 +163,44 @@
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
#define L_A_OVER sprintf(s, "%s%s, %d. %s%s %d", DayName[jul%7], L_ON, d, \
|
||||
#define L_A_OVER sprintf(s, "%s%s %d. %s%s %d", DayName[jul%7], L_ON, d, \
|
||||
MonthName[m], L_PARTIT, y);
|
||||
#define L_C_OVER sprintf(s, "%s%s", DayName[jul%7], L_ON);
|
||||
#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%s, %d. %s%s", DayName[jul%7], L_ON, d, \
|
||||
#define L_G_OVER sprintf(s, "%s%s %d. %s%s", DayName[jul%7], L_ON, d, \
|
||||
MonthName[m], L_PARTIT);
|
||||
#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%s, %sn %d%s %d", DayName[jul%7], L_ON, \
|
||||
#define L_J_OVER sprintf(s, "%s%s %sn %d%s %d", DayName[jul%7], L_ON, \
|
||||
MonthName[m], d, plu, y);
|
||||
#define L_K_OVER sprintf(s, "%s%s, %sn %d%s", DayName[jul%7], L_ON, \
|
||||
#define L_K_OVER sprintf(s, "%s%s %sn %d%s", DayName[jul%7], L_ON, \
|
||||
MonthName[m], d, plu);
|
||||
#define L_L_OVER sprintf(s, "%04d%c%02d%c%02d", y, DATESEP, m+1, DATESEP, d);
|
||||
#define L_Q_OVER sprintf(s, "n");
|
||||
#define L_U_OVER sprintf(s, "%s%s, %d%s %s%s %d", DayName[jul%7], L_ON, \
|
||||
#define L_U_OVER sprintf(s, "%s%s %d%s %s%s %d", DayName[jul%7], L_ON, \
|
||||
d, plu, MonthName[m], L_PARTIT, y);
|
||||
#define L_V_OVER sprintf(s, "%s%s, %d%s %s%s", DayName[jul%7], L_ON, d, \
|
||||
#define L_V_OVER sprintf(s, "%s%s %d%s %s%s", DayName[jul%7], L_ON, d, \
|
||||
plu, MonthName[m], L_PARTIT);
|
||||
#define L_1_OVER if (tdiff == 0) \
|
||||
sprintf(s, L_NOW); \
|
||||
#define L_1_OVER \
|
||||
if (tdiff == 0) \
|
||||
sprintf(s, "%s", L_NOW); \
|
||||
else { \
|
||||
s[0] = '\0'; \
|
||||
if (hdiff != 0) { \
|
||||
if (tdiff < 0) \
|
||||
sprintf(s, "%d %s%s ", hdiff, L_HOUR, hplu); \
|
||||
else \
|
||||
sprintf(s, "%d %s ", hdiff, L_HGEN); \
|
||||
s += strlen(s); \
|
||||
} \
|
||||
if (mdiff != 0) { \
|
||||
if (tdiff < 0) \
|
||||
sprintf(s, "%d %s%s ", mdiff, L_MINUTE, \
|
||||
mplu); \
|
||||
sprintf(s + strlen(s), "%d %s%s ", mdiff, L_MINUTE, mplu); \
|
||||
else \
|
||||
sprintf(s, "%d %s ", mdiff, L_MGEN); \
|
||||
s += strlen(s); \
|
||||
sprintf(s + strlen(s), "%d %s ", mdiff, L_MGEN); \
|
||||
} \
|
||||
sprintf(s, when); \
|
||||
sprintf(s + strlen(s), when); \
|
||||
}
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -212,7 +209,7 @@ else { \
|
||||
#define L_ERR_OVERRIDE 1
|
||||
EXTERN char *ErrMsg[] =
|
||||
{
|
||||
#if defined(ISOLATIN1)
|
||||
#if ISOLATIN1
|
||||
"Ok",
|
||||
"Puuttuva ']'",
|
||||
"Puuttuva lainausmerkki",
|
||||
@@ -311,9 +308,9 @@ EXTERN char *ErrMsg[] =
|
||||
"Ei viestej\xE4.",
|
||||
"%d viesti(\xE4) t\xE4m\xE4n p\xE4iv\xE4n jonossa.\n",
|
||||
"Numero puuttuu",
|
||||
"Illegal function in WARN clause (NEEDS TRANSLATION)"
|
||||
"Virheellinen funktio WARN-lausekkeessa"
|
||||
|
||||
#elif defined(IBMEXTENDED)
|
||||
#elif IBMEXTENDED
|
||||
"Ok",
|
||||
"Puuttuva ']'",
|
||||
"Puuttuva lainausmerkki",
|
||||
@@ -412,7 +409,7 @@ EXTERN char *ErrMsg[] =
|
||||
"Ei viestej\x84.",
|
||||
"%d viesti(\x84) t\x84m\x84n p\x84iv\x84n jonossa.\n",
|
||||
"Numero puuttuu"
|
||||
"Illegal function in WARN clause (NEEDS TRANSLATION)"
|
||||
"Virheellinen funktio WARN-lausekkeessa"
|
||||
#else
|
||||
"Ok",
|
||||
"Puuttuva ']'",
|
||||
@@ -512,7 +509,7 @@ EXTERN char *ErrMsg[] =
|
||||
"Ei viestej{.",
|
||||
"%d viesti({) t{m{n p{iv{n jonossa.\n",
|
||||
"Numero puuttuu",
|
||||
"Illegal function in WARN clause (NEEDS TRANSLATION)"
|
||||
"Virheellinen funktio WARN-lausekkeessa"
|
||||
#endif
|
||||
};
|
||||
#endif /* MK_GLOBALS */
|
||||
@@ -526,11 +523,12 @@ PUBLIC void Usage(void)
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1994 by David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1998 David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "Copyright 1999-2000 Roaring Penguin Software Inc.\n");
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETAVERSIO <<<<\n");
|
||||
#endif
|
||||
#if defined(ISOLATIN1)
|
||||
#if ISOLATIN1
|
||||
fprintf(ErrFp, "K\xE4ytt\xF6: remind [tarkenteet] tiedosto [p\xE4iv\xE4ys] [aika] [*toisto]\n");
|
||||
fprintf(ErrFp, "Tarkenteet:\n");
|
||||
fprintf(ErrFp, " -n Tulosta viestien seuraavat esiintymiskerrat yksink. muodossa\n");
|
||||
@@ -559,7 +557,7 @@ void Usage()
|
||||
fprintf(ErrFp, " -ivar=val Alusta muuttuja var arvolla val ja s\xE4ilyt\xE4 var\n");
|
||||
fprintf(ErrFp, " -m Aloita kalenteri maanantaista eik\xE4 sunnuntaista\n");
|
||||
exit(1);
|
||||
#elif defined(IBMEXTENDED)
|
||||
#elif IBMEXTENDED
|
||||
fprintf(ErrFp, "K\x84ytt\x94: remind [tarkenteet] tiedosto [p\x84iv\x84ys] [aika] [*toisto]\n");
|
||||
fprintf(ErrFp, "Tarkenteet:\n");
|
||||
fprintf(ErrFp, " -n Tulosta viestien seuraavat esiintymiskerrat yksink. muodossa\n");
|
||||
@@ -8,13 +8,14 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* 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.9 2000-02-18 03:53:50 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "French"
|
||||
@@ -28,12 +29,9 @@
|
||||
#define L_FRIDAY "vendredi"
|
||||
#define L_SATURDAY "samedi"
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#define L_DAYINIT "dlmmjvs"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "janvier"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_FEB "f\351vrier"
|
||||
#else
|
||||
#define L_FEB "fevrier"
|
||||
@@ -43,7 +41,7 @@
|
||||
#define L_MAY "mai"
|
||||
#define L_JUN "juin"
|
||||
#define L_JUL "juillet"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_AUG "ao\373t"
|
||||
#else
|
||||
#define L_AUG "aout"
|
||||
@@ -51,7 +49,7 @@
|
||||
#define L_SEP "septembre"
|
||||
#define L_OCT "octobre"
|
||||
#define L_NOV "novembre"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_DEC "d\351cembre"
|
||||
#else
|
||||
#define L_DEC "decembre"
|
||||
@@ -86,7 +84,7 @@
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#define L_NOW "maintenant"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_AT "\340"
|
||||
#else
|
||||
#define L_AT "a"
|
||||
@@ -94,7 +92,7 @@
|
||||
#define L_MINUTE "minute"
|
||||
#define L_HOUR "heure"
|
||||
#define L_IS "est"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_WAS "\351tait"
|
||||
#else
|
||||
#define L_WAS "etait"
|
||||
@@ -148,7 +146,7 @@ sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], \
|
||||
#define L_ERR_OVERRIDE 1
|
||||
EXTERN char *ErrMsg[] =
|
||||
{
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
"Ok",
|
||||
"']' manquant",
|
||||
"Apostrophe manquant",
|
||||
@@ -361,11 +359,12 @@ 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-1998 David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "Copyright 1999-2000 Roaring Penguin Software Inc.\n");
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [heure] [*r\351p\351tition]\n");
|
||||
fprintf(ErrFp, "Options:\n");
|
||||
fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
|
||||
@@ -9,11 +9,12 @@
|
||||
/* I don't speak German. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: german.h,v 1.1 1996-03-27 03:25:56 dfs Exp $ */
|
||||
/* $Id: german.h,v 1.6 2000-02-18 03:46:22 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "German"
|
||||
@@ -27,13 +28,10 @@
|
||||
#define L_FRIDAY "Freitag"
|
||||
#define L_SATURDAY "Samstag"
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#define L_DAYINIT "SMDMDFS"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "Januar"
|
||||
#define L_FEB "Februar"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_MAR "M\344rz"
|
||||
#else
|
||||
# define L_MAR "Maerz"
|
||||
@@ -53,7 +51,7 @@
|
||||
#define L_TOMORROW "morgen"
|
||||
|
||||
/* The default banner */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_BANNER "Termine f\374r %w, den %d. %m %y%o:"
|
||||
#else
|
||||
# define L_BANNER "Termine fuer %w, den %d. %m %y%o:"
|
||||
@@ -7,17 +7,18 @@
|
||||
/* This file is part of REMIND. */
|
||||
/* It is Copyright (C) 1996 by Valerio Aimale */
|
||||
/* */
|
||||
/* Remind is copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Remind is copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: italian.h,v 1.1 1996-10-12 02:49:33 dfs Exp $ */
|
||||
/* $Id: italian.h,v 1.6 2000-02-18 03:46:23 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Italian"
|
||||
|
||||
/* Day names */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_SUNDAY "Domenica"
|
||||
#define L_MONDAY "Luned\354"
|
||||
#define L_TUESDAY "Marted\354"
|
||||
@@ -35,10 +36,6 @@
|
||||
#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"
|
||||
@@ -86,7 +83,7 @@
|
||||
#define L_AT "alle"
|
||||
#define L_MINUTE "minut"
|
||||
#define L_HOUR "or"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_IS "\350"
|
||||
#else /* ISOLATIN1 */
|
||||
#define L_IS "e`"
|
||||
@@ -6,17 +6,18 @@
|
||||
/* */
|
||||
/* 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-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: norwgian.h,v 1.1 1996-03-27 03:26:03 dfs Exp $ */
|
||||
/* $Id: norwgian.h,v 1.6 2000-02-18 03:46:24 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Norwegian"
|
||||
|
||||
/* Day names */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_SUNDAY "S\370ndag"
|
||||
#else
|
||||
# define L_SUNDAY "Soendag"
|
||||
@@ -26,15 +27,12 @@
|
||||
#define L_WEDNESDAY "Onsdag"
|
||||
#define L_THURSDAY "Torsdag"
|
||||
#define L_FRIDAY "Fredag"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_SATURDAY "L\370rdag"
|
||||
#else
|
||||
# define L_SATURDAY "Loerdag"
|
||||
#endif
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#define L_DAYINIT "SMTOTFL"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "Januar"
|
||||
#define L_FEB "Februar"
|
||||
@@ -54,7 +52,7 @@
|
||||
#define L_TOMORROW "i morgen"
|
||||
|
||||
/* The default banner */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_BANNER "P\345minnelse for %w, %d. %m, %y%o:"
|
||||
#else
|
||||
# define L_BANNER "Paaminnelse for %w, %d. %m, %y%o:"
|
||||
@@ -69,7 +67,7 @@
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "siden"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_FROMNOW "fra n\345"
|
||||
#else
|
||||
# define L_FROMNOW "fra naa"
|
||||
@@ -86,7 +84,7 @@
|
||||
#define L_PLURAL "er"
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_NOW "n\345"
|
||||
#else
|
||||
# define L_NOW "naa"
|
||||
@@ -9,17 +9,18 @@
|
||||
/* Polish. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: polish.h,v 1.3 1996-04-29 19:34:38 dfs Exp $ */
|
||||
/* $Id: polish.h,v 1.9 2000-02-18 03:53:51 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Polish"
|
||||
|
||||
/* Day names */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_SUNDAY "Niedziela"
|
||||
# define L_MONDAY "Poniedzia\263ek"
|
||||
# define L_TUESDAY "Wtorek"
|
||||
@@ -37,15 +38,8 @@
|
||||
# define L_SATURDAY "Sobota"
|
||||
#endif
|
||||
|
||||
/* Day initials - first letter only */
|
||||
#ifdef ISOLATIN1
|
||||
#define L_DAYINIT "NPW\246CPS"
|
||||
#else
|
||||
#define L_DAYINIT "NPWSCPS"
|
||||
#endif
|
||||
|
||||
/* Month names */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_JAN "Stycze\361"
|
||||
# define L_FEB "Luty"
|
||||
# define L_MAR "Marzec"
|
||||
@@ -106,7 +100,7 @@
|
||||
#define L_AT "o"
|
||||
#define L_MINUTE "minut"
|
||||
#define L_HOUR "godzin"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
# define L_IS "b\352dzie"
|
||||
# define L_WAS "by\263o"
|
||||
#else
|
||||
@@ -115,7 +109,7 @@
|
||||
#endif
|
||||
#define L_AND "i"
|
||||
/* What to add to make "hour" or "minute" plural */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_NPLU( N ) ((N == 1) ? "\352" : ((N==12) || (N==13) || (N==14)) ? "" : \
|
||||
((N%10==2) || (N%10==3) || (N%10==4)) ? "y" : "" )
|
||||
#else
|
||||
@@ -129,7 +123,7 @@
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_AMPM_OVERRIDE(ampm, hour) \
|
||||
ampm = (hour<12) ? \
|
||||
(hour<5) ? " w nocy" \
|
||||
@@ -187,7 +181,7 @@ else \
|
||||
#define L_ERR_OVERRIDE 1
|
||||
EXTERN char *ErrMsg[] =
|
||||
{
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
"OK",
|
||||
"Brakuj\261cy ']'",
|
||||
"Brakuj\261cy nawias",
|
||||
@@ -400,11 +394,12 @@ 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-1998 David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "Copyright 1999-2000 Roaring Penguin Software Inc.\n");
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
fprintf(ErrFp, "\nSpos\363b u\277ycia: remind [opcje] plik [data] [czas] [*powt\363rzenie]\n");
|
||||
fprintf(ErrFp, "Opcje:\n");
|
||||
fprintf(ErrFp, " -n Wypisz nast\352pne przypomnienia w prostym formacie\n");
|
||||
@@ -8,13 +8,14 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* This file is Copyright (C) 1996 by Marco Paganini and */
|
||||
/* David F. Skoll. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: portbr.h,v 1.1 1996-06-22 02:21:29 dfs Exp $ */
|
||||
/* $Id: portbr.h,v 1.8 2000-02-18 03:53:52 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Brazilian Portuguese"
|
||||
@@ -28,9 +29,6 @@
|
||||
#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"
|
||||
@@ -261,7 +259,8 @@ PUBLIC void Usage(void)
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-1996 by David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-1998 David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "(C) 1999-2000 Roaring Penguin Software Inc.\n");
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> VERSAO BETA <<<<\n");
|
||||
#endif
|
||||
165
src/langs/romanian.h
Normal file
165
src/langs/romanian.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* 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-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* This file is Copyright (C) 1996-1998 by Liviu Daia */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: romanian.h,v 1.6 2000-02-18 03:46:27 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Romanian"
|
||||
|
||||
/* Day names */
|
||||
#if ISOLATIN1
|
||||
# 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 "S\342mbata"
|
||||
#elif ISOLATIN2
|
||||
# define L_SUNDAY "Duminic\343"
|
||||
# define L_MONDAY "Luni"
|
||||
# define L_TUESDAY "Mar\376i"
|
||||
# define L_WEDNESDAY "Miercuri"
|
||||
# define L_THURSDAY "Joi"
|
||||
# define L_FRIDAY "Vineri"
|
||||
# define L_SATURDAY "S\342mb\343t\343"
|
||||
#elif IBM852
|
||||
# define L_SUNDAY "Duminic\307"
|
||||
# define L_MONDAY "Luni"
|
||||
# define L_TUESDAY "Mar\316i"
|
||||
# define L_WEDNESDAY "Miercuri"
|
||||
# define L_THURSDAY "Joi"
|
||||
# define L_FRIDAY "Vineri"
|
||||
# define L_SATURDAY "S\203mb\307t\307"
|
||||
#else
|
||||
# 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"
|
||||
#endif
|
||||
|
||||
/* 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 "Noiembrie"
|
||||
#define L_DEC "Decembrie"
|
||||
|
||||
/* Today and tomorrow */
|
||||
#if ISOLATIN1
|
||||
# define L_TODAY "astazi"
|
||||
# define L_TOMORROW "m\342ine"
|
||||
#elif ISOLATIN2
|
||||
# define L_TODAY "ast\343zi"
|
||||
# define L_TOMORROW "m\342ine"
|
||||
#elif IBM852
|
||||
# define L_TODAY "ast\307zi"
|
||||
# define L_TOMORROW "m\203ine"
|
||||
#else
|
||||
# define L_TODAY "astazi"
|
||||
# define L_TOMORROW "maine"
|
||||
#endif
|
||||
|
||||
/* 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"
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU "e"
|
||||
|
||||
#if ISOLATIN2
|
||||
/* What to add to make "hour" plural */
|
||||
# define L_HPLU_OVER hplu = (hdiff == 1 ? "\343" : "e");
|
||||
# define L_AND "\272i"
|
||||
#elif IBM852
|
||||
/* What to add to make "hour" plural */
|
||||
# define L_HPLU_OVER hplu = (hdiff == 1 ? "\307" : "e");
|
||||
# define L_AND "\255i"
|
||||
#else
|
||||
/* What to add to make "hour" plural */
|
||||
# define L_HPLU_OVER hplu = (hdiff == 1 ? "a" : "e");
|
||||
# define L_AND "si"
|
||||
#endif
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
#if ISOLATIN2
|
||||
# define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " diminea\376a" : (hour > 17) ? " seara" : " dup\343-amiaza";
|
||||
#elif IBM852
|
||||
# define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " diminea\316a" : (hour > 17) ? " seara" : " dup\307-amiaza";
|
||||
#else
|
||||
# define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " dimineata" : (hour > 17) ? " seara" : " dupa-amiaza";
|
||||
#endif
|
||||
|
||||
#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 */
|
||||
99
src/langs/spanish.h
Normal file
99
src/langs/spanish.h
Normal file
@@ -0,0 +1,99 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* SPANISH.H */
|
||||
/* */
|
||||
/* Support for the Spanish language. */
|
||||
/* */
|
||||
/* Author: Rafa Couto <rafacouto@biogate.com> */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: spanish.h,v 1.3 2000-02-18 03:46:28 dfs Exp $ */
|
||||
|
||||
#define L_LANGNAME "Spanish"
|
||||
|
||||
/* Nombres de los di'as de la semana */
|
||||
#define L_SUNDAY "Domingo"
|
||||
#define L_MONDAY "Lunes"
|
||||
#define L_TUESDAY "Martes"
|
||||
#if ISOLATIN1
|
||||
#define L_WEDNESDAY "Mi\351rcoles"
|
||||
#else
|
||||
#define L_WEDNESDAY "Miercoles"
|
||||
#endif
|
||||
|
||||
#define L_THURSDAY "Jueves"
|
||||
#define L_FRIDAY "Viernes"
|
||||
#if ISOLATIN1
|
||||
#define L_SATURDAY "S\341bado"
|
||||
#else
|
||||
#define L_SATURDAY "Sabado"
|
||||
#endif
|
||||
|
||||
/* Nombres de los meses */
|
||||
#define L_JAN "Enero"
|
||||
#define L_FEB "Febrero"
|
||||
#define L_MAR "Marzo"
|
||||
#define L_APR "Abril"
|
||||
#define L_MAY "Mayo"
|
||||
#define L_JUN "Junio"
|
||||
#define L_JUL "Julio"
|
||||
#define L_AUG "Agosto"
|
||||
#define L_SEP "Septiembre"
|
||||
#define L_OCT "Octuber"
|
||||
#define L_NOV "Noviembre"
|
||||
#define L_DEC "Diciembre"
|
||||
|
||||
/* Hoy y man~ana */
|
||||
#define L_TODAY "hoy"
|
||||
#if ISOLATIN1
|
||||
#define L_TOMORROW "ma\361ana"
|
||||
#else
|
||||
#define L_TOMORROW "manana"
|
||||
#endif
|
||||
|
||||
/* El titular habitual */
|
||||
#define L_BANNER "Agenda para el %w, %d%s %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
|
||||
|
||||
/* Hace y desde hoy */
|
||||
#define L_AGO "hace"
|
||||
#define L_FROMNOW "desde hoy"
|
||||
|
||||
/* "dentro de %d di'as" */
|
||||
#if ISOLATIN1
|
||||
#define L_INXDAYS "dentro de %d d\355as"
|
||||
#define L_ON "el d\355a"
|
||||
#else
|
||||
#define L_INXDAYS "dentro de %d di'as"
|
||||
#define L_ON "el di'a"
|
||||
#endif
|
||||
|
||||
/* "el di'a..." */
|
||||
|
||||
/* plurales */
|
||||
#define L_PLURAL "s"
|
||||
|
||||
/* Minutos, horas, a las, etc */
|
||||
#define L_NOW "ahora"
|
||||
#define L_AT "a las"
|
||||
#define L_MINUTE "minuto"
|
||||
#define L_HOUR "hora"
|
||||
#define L_IS "es"
|
||||
#define L_WAS "fue"
|
||||
#define L_AND "y"
|
||||
#define L_HPLU "s"
|
||||
#define L_MPLU "s"
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -6,49 +6,60 @@
|
||||
/* routines, etc. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.11 2000-02-18 03:46:01 dfs Exp $";
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STDARG
|
||||
|
||||
#ifdef HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
#include <ctype.h>
|
||||
#ifdef TIME_WITH_SYS_TIME
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#if defined(HAVE_SYS_TIME_H) || defined (TIME_WITH_SYS_TIME)
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef AMIGA
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__) || defined(__OS2__)
|
||||
#include <dos.h>
|
||||
#else
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#ifndef SYSV
|
||||
#ifdef QDOS
|
||||
#include <sys/times.h>
|
||||
#else
|
||||
#include <sys/time.h>
|
||||
#endif /* QDOS */
|
||||
#endif /* ndef SYSV */
|
||||
#endif /* if defined(__MSDOS__)... */
|
||||
#endif /* AMIGA */
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
@@ -57,15 +68,12 @@ static char const RCSID[] = "$Id: main.c,v 1.3 1996-04-28 02:01:59 dfs Exp $";
|
||||
|
||||
PRIVATE void DoReminders ARGS ((void));
|
||||
|
||||
#if defined(NEED_TIMEGM) && !defined(HAVE_MKTIME)
|
||||
#if !defined(HAVE_TIMEGM) && !defined(HAVE_MKTIME)
|
||||
PRIVATE long time_cheat ARGS ((int year, int month));
|
||||
long timegm ARGS((struct tm *tm));
|
||||
long timelocal ARGS((struct tm *tm));
|
||||
#endif
|
||||
|
||||
static char TPushBuffer[TOKSIZE+1]; /* Buffer for pushing back a token. */
|
||||
static char *TokenPushed = NULL;
|
||||
|
||||
/* Whooo... the putchar/Putchar/PutChar macros are a mess...
|
||||
my apologies... */
|
||||
#ifdef OS2_POPUP
|
||||
@@ -383,9 +391,17 @@ int peek;
|
||||
int r;
|
||||
|
||||
*err = 0;
|
||||
if (TokenPushed && *TokenPushed)
|
||||
if (peek) return *TokenPushed;
|
||||
else return *TokenPushed++;
|
||||
if (p->tokenPushed && *p->tokenPushed) {
|
||||
if (peek) return *p->tokenPushed;
|
||||
else {
|
||||
r = *p->tokenPushed++;
|
||||
if (!r) {
|
||||
DBufFree(&p->pushedToken);
|
||||
p->tokenPushed = NULL;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
while(1) {
|
||||
if (p->isnested) {
|
||||
@@ -472,17 +488,16 @@ int peek;
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ParseToken(ParsePtr p, char *out)
|
||||
PUBLIC int ParseToken(ParsePtr p, DynamicBuffer *dbuf)
|
||||
#else
|
||||
int ParseToken(p, out)
|
||||
int ParseToken(p, dbuf)
|
||||
ParsePtr p;
|
||||
char *out;
|
||||
DynamicBuffer *dbuf;
|
||||
#endif
|
||||
{
|
||||
int c, err;
|
||||
int len = 0;
|
||||
|
||||
*out = 0;
|
||||
DBufFree(dbuf);
|
||||
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) return err;
|
||||
@@ -491,18 +506,17 @@ char *out;
|
||||
if (err) return err;
|
||||
}
|
||||
if (!c) return OK;
|
||||
*out++ = c;
|
||||
len++;
|
||||
|
||||
while (c && !isspace(c)) {
|
||||
if (DBufPutc(dbuf, c) != OK) {
|
||||
DBufFree(dbuf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) return err;
|
||||
if (len < TOKSIZE && c && !isspace(c)) {
|
||||
*out++ = c;
|
||||
len++;
|
||||
if (err) {
|
||||
DBufFree(dbuf);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
*out = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -516,17 +530,16 @@ char *out;
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ParseIdentifier(ParsePtr p, char *out)
|
||||
PUBLIC int ParseIdentifier(ParsePtr p, DynamicBuffer *dbuf)
|
||||
#else
|
||||
int ParseIdentifier(p, out)
|
||||
int ParseIdentifier(p, dbuf)
|
||||
ParsePtr p;
|
||||
char *out;
|
||||
DynamicBuffer *dbuf;
|
||||
#endif
|
||||
{
|
||||
int c, err;
|
||||
int len = 0;
|
||||
|
||||
*out = 0;
|
||||
DBufFree(dbuf);
|
||||
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) return err;
|
||||
@@ -536,23 +549,26 @@ char *out;
|
||||
}
|
||||
if (!c) return E_EOLN;
|
||||
if (c != '$' && c != '_' && !isalpha(c)) return E_BAD_ID;
|
||||
*out++ = c;
|
||||
*out = 0;
|
||||
len++;
|
||||
if (DBufPutc(dbuf, c) != OK) {
|
||||
DBufFree(dbuf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
c = ParseChar(p, &err, 1);
|
||||
if (err) return err;
|
||||
if (err) {
|
||||
DBufFree(dbuf);
|
||||
return err;
|
||||
}
|
||||
if (c != '_' && !isalnum(c)) return OK;
|
||||
|
||||
if (len < TOKSIZE) {
|
||||
c = ParseChar(p, &err, 0); /* Guaranteed to work */
|
||||
*out++ = c;
|
||||
*out = 0;
|
||||
len++;
|
||||
c = ParseChar(p, &err, 0); /* Guaranteed to work */
|
||||
if (DBufPutc(dbuf, c) != OK) {
|
||||
DBufFree(dbuf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* EvaluateExpr */
|
||||
@@ -594,7 +610,7 @@ Value *v;
|
||||
/* Eprint - print an error message. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_STDARG
|
||||
#ifdef HAVE_STDARG_H
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Eprint(const char *fmt, ...)
|
||||
#else
|
||||
@@ -608,7 +624,7 @@ va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list argptr;
|
||||
#ifndef HAVE_STDARG
|
||||
#ifndef HAVE_STDARG_H
|
||||
char *fmt;
|
||||
#endif
|
||||
|
||||
@@ -624,7 +640,7 @@ va_dcl
|
||||
if (DebugFlag & DB_PRTLINE) OutputLine(ErrFp);
|
||||
} else fprintf(ErrFp, " ");
|
||||
|
||||
#ifdef HAVE_STDARG
|
||||
#ifdef HAVE_STDARG_H
|
||||
va_start(argptr, fmt);
|
||||
#else
|
||||
va_start(argptr);
|
||||
@@ -632,7 +648,7 @@ va_dcl
|
||||
#endif
|
||||
(void) vfprintf(ErrFp, fmt, argptr);
|
||||
(void) fputc('\n', ErrFp);
|
||||
#ifndef HAVE_STDARG
|
||||
#ifndef HAVE_STDARG_H
|
||||
va_end(argptr);
|
||||
#endif
|
||||
return;
|
||||
@@ -685,7 +701,8 @@ ParsePtr p;
|
||||
p->epos = NULL;
|
||||
p->etext = NULL;
|
||||
p->allownested = 1;
|
||||
TokenPushed = NULL;
|
||||
p->tokenPushed = NULL;
|
||||
DBufInit(&p->pushedToken);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -707,26 +724,31 @@ ParsePtr p;
|
||||
p->etext = NULL;
|
||||
p->isnested = 0;
|
||||
}
|
||||
DBufFree(&p->pushedToken);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* PushToken - one level of token pushback. This is */
|
||||
/* GLOBAL, not on a per-parser basis. */
|
||||
/* on a per-parser basis. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void PushToken(const char *tok)
|
||||
PUBLIC int PushToken(const char *tok, ParsePtr p)
|
||||
#else
|
||||
void PushToken(tok)
|
||||
int PushToken(tok, p)
|
||||
char *tok;
|
||||
ParsePtr p;
|
||||
#endif
|
||||
{
|
||||
TokenPushed = TPushBuffer;
|
||||
strcpy(TPushBuffer, tok);
|
||||
strcat(TPushBuffer, " "); /* Separate the pushed token from the next
|
||||
token */
|
||||
|
||||
DBufFree(&p->pushedToken);
|
||||
if (DBufPuts(&p->pushedToken, (char *) tok) != OK ||
|
||||
DBufPutc(&p->pushedToken, ' ') != OK) {
|
||||
DBufFree(&p->pushedToken);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
p->tokenPushed = DBufValue(&p->pushedToken);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -972,11 +994,18 @@ ParsePtr p;
|
||||
{
|
||||
int r;
|
||||
|
||||
if ( (r = ParseToken(p, TokBuffer)) ) return r;
|
||||
if (*TokBuffer && (*TokBuffer != '#') && (*TokBuffer != ';')) {
|
||||
Eprint("%s: `%s'", ErrMsg[E_EXPECTING_EOL], TokBuffer);
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
if ( (r = ParseToken(p, &buf)) ) return r;
|
||||
if (*DBufValue(&buf) &&
|
||||
(*DBufValue(&buf) != '#') &&
|
||||
(*DBufValue(&buf) != ';')) {
|
||||
Eprint("%s: `%s'", ErrMsg[E_EXPECTING_EOL], DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
return E_EXTRANEOUS_TOKEN;
|
||||
}
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1070,9 +1099,9 @@ ParsePtr p;
|
||||
{
|
||||
int err;
|
||||
int c;
|
||||
char buf[LINELEN]; /* So we don't mess up the banner if an error occurs */
|
||||
char *s;
|
||||
DynamicBuffer buf;
|
||||
|
||||
DBufInit(&buf);
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) return err;
|
||||
while (isspace(c)) {
|
||||
@@ -1080,16 +1109,20 @@ ParsePtr p;
|
||||
if (err) return err;
|
||||
}
|
||||
if (!c) return E_EOLN;
|
||||
s = buf;
|
||||
|
||||
while(c) {
|
||||
*s++ = c;
|
||||
if (DBufPutc(&buf, c) != OK) return E_NO_MEM;
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) return err;
|
||||
if (err) {
|
||||
DBufFree(&buf);
|
||||
return err;
|
||||
}
|
||||
}
|
||||
*s++ = 0;
|
||||
strcpy(Banner, buf);
|
||||
return OK;
|
||||
DBufFree(&Banner);
|
||||
|
||||
err = DBufPuts(&Banner, DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
return err;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -1109,16 +1142,23 @@ ParsePtr p;
|
||||
{
|
||||
int r;
|
||||
|
||||
if ( (r=ParseToken(p, TokBuffer)) ) return r;
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
if ( (r=ParseToken(p, &buf)) ) return r;
|
||||
|
||||
/* Only allow RUN ON in top-level script */
|
||||
if (! StrCmpi(TokBuffer, "ON")) {
|
||||
if (! StrCmpi(DBufValue(&buf), "ON")) {
|
||||
if (TopLevel()) RunDisabled &= ~RUN_SCRIPT;
|
||||
}
|
||||
/* But allow RUN OFF anywhere */
|
||||
else if (! StrCmpi(TokBuffer, "OFF"))
|
||||
else if (! StrCmpi(DBufValue(&buf), "OFF"))
|
||||
RunDisabled |= RUN_SCRIPT;
|
||||
else return E_PARSE_ERR;
|
||||
else {
|
||||
DBufFree(&buf);
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
DBufFree(&buf);
|
||||
|
||||
return VerifyEoln(p);
|
||||
}
|
||||
@@ -1183,13 +1223,18 @@ ParsePtr p;
|
||||
int r;
|
||||
char *s;
|
||||
|
||||
DynamicBuffer buf;
|
||||
|
||||
DBufInit(&buf);
|
||||
t.typ = MSG_TYPE;
|
||||
tt.ttime = SystemTime(0) / 60;
|
||||
if ( (r=DoSubst(p, SubstBuffer, &t, &tt, JulianToday, NORMAL_MODE)) )
|
||||
if ( (r=DoSubst(p, &buf, &t, &tt, JulianToday, NORMAL_MODE)) ) {
|
||||
return r;
|
||||
s = SubstBuffer;
|
||||
}
|
||||
s = DBufValue(&buf);
|
||||
while (isspace(*s)) s++;
|
||||
fprintf(ErrFp, "%s\n", s);
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1223,8 +1268,10 @@ 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;
|
||||
int isdst_tmp;
|
||||
|
||||
FromJulian(jul, &yr, &mon, &day);
|
||||
|
||||
@@ -1243,11 +1290,17 @@ int jul, tim, *mins, *isdst;
|
||||
local.tm_year = yr-1900;
|
||||
local.tm_isdst = -1; /* We don't know whether or not dst is in effect */
|
||||
|
||||
|
||||
#if !defined(HAVE_MKTIME)
|
||||
loc_t = timelocal(&local);
|
||||
local.tm_isdst = 0;
|
||||
utc_t = timegm(&local);
|
||||
#else
|
||||
/* Horrible contortions to get minutes from UTC portably */
|
||||
loc_t = mktime(&local);
|
||||
if (loc_t == -1) return 1;
|
||||
isdst_tmp = local.tm_isdst;
|
||||
local.tm_isdst = 0;
|
||||
loc_t = mktime(&local);
|
||||
if (loc_t == -1) return 1;
|
||||
temp = gmtime(&loc_t);
|
||||
@@ -1256,14 +1309,23 @@ int jul, tim, *mins, *isdst;
|
||||
utc_t = mktime(&utc);
|
||||
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 */
|
||||
/* Compute difference between local time and UTC in seconds.
|
||||
Be careful, since time_t might be unsigned. */
|
||||
|
||||
#ifdef HAVE_DIFFTIME
|
||||
tdiff = (int) difftime(loc_t, utc_t);
|
||||
#else
|
||||
if (mins) *mins = (int) ((utc_t - loc_t) / 60);
|
||||
/* time_t may be unsigned, hence the contortions */
|
||||
if (loc_t < utc_t) {
|
||||
tdiff = - (int) (utc_t - loc_t);
|
||||
} else {
|
||||
tdiff = (int) (loc_t - utc_t);
|
||||
}
|
||||
#endif
|
||||
if (isdst) *isdst = temp->tm_isdst;
|
||||
|
||||
if (isdst_tmp) tdiff += 60*60;
|
||||
if (mins) *mins = (int)(tdiff / 60);
|
||||
if (isdst) *isdst = isdst_tmp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1371,7 +1433,7 @@ char *s;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(NEED_TIMEGM) && !defined(HAVE_MKTIME)
|
||||
#if !defined(HAVE_TIMEGM) && !defined(HAVE_MKTIME)
|
||||
#define TGM_SEC (1)
|
||||
#define TGM_MIN (60 * TGM_SEC)
|
||||
#define TGM_HR (60 * TGM_MIN)
|
||||
@@ -1528,26 +1590,19 @@ int utcdate, utctime, *locdate, *loctime;
|
||||
void __cdecl SigIntHandler(int d)
|
||||
#else
|
||||
#ifdef HAVE_PROTOS
|
||||
#ifdef SIGHANDLER_INT_ARG
|
||||
void SigIntHandler(int d)
|
||||
RETSIGTYPE SigIntHandler(int d)
|
||||
#else
|
||||
void SigIntHandler(void)
|
||||
#endif
|
||||
#else
|
||||
void SigIntHandler()
|
||||
RETSIGTYPE SigIntHandler()
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
#ifdef SYSV
|
||||
signal(SIGINT, SigIntHandler);
|
||||
#else
|
||||
#ifdef __BORLANDC__
|
||||
signal(SIGINT, SIG_DFL);
|
||||
#else
|
||||
#ifdef __OS2__
|
||||
signal(SIGINT, SIG_ACK);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
GotSigInt();
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
/* Calculations for figuring out moon phases. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.5 2000-02-18 03:46:02 dfs Exp $";
|
||||
|
||||
/* All of these routines were adapted from the program "moontool"
|
||||
by John Walker, February 1988. Here's the blurb from moontool:
|
||||
@@ -59,10 +61,10 @@ 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
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
@@ -6,20 +6,24 @@
|
||||
/* the data structures for OMITted dates. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.6 2000-02-18 03:46:03 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "globals.h"
|
||||
@@ -300,39 +304,51 @@ ParsePtr p;
|
||||
Token tok;
|
||||
int parsing=1;
|
||||
int syndrome;
|
||||
|
||||
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
/* Parse the OMIT. We need a month and day; year is optional. */
|
||||
while(parsing) {
|
||||
if ( (r=ParseToken(p, TokBuffer)) ) return r;
|
||||
FindToken(TokBuffer, &tok);
|
||||
if ( (r=ParseToken(p, &buf)) ) return r;
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
switch (tok.type) {
|
||||
case T_Year:
|
||||
DBufFree(&buf);
|
||||
if (y != NO_YR) return E_YR_TWICE;
|
||||
y = tok.val;
|
||||
break;
|
||||
|
||||
case T_Month:
|
||||
DBufFree(&buf);
|
||||
if (m != NO_MON) return E_MON_TWICE;
|
||||
m = tok.val;
|
||||
break;
|
||||
|
||||
case T_Day:
|
||||
DBufFree(&buf);
|
||||
if (d != NO_DAY) return E_DAY_TWICE;
|
||||
d = tok.val;
|
||||
break;
|
||||
|
||||
case T_Delta:
|
||||
DBufFree(&buf);
|
||||
break;
|
||||
|
||||
case T_Empty:
|
||||
case T_Comment:
|
||||
case T_RemType:
|
||||
case T_Priority:
|
||||
case T_Tag:
|
||||
case T_Duration:
|
||||
DBufFree(&buf);
|
||||
parsing = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
Eprint("%s: `%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN], TokBuffer);
|
||||
Eprint("%s: `%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN],
|
||||
DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
return E_UNKNOWN_TOKEN;
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,12 @@
|
||||
/* Function Prototypes. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: protos.h,v 1.2 1996-03-31 04:01:57 dfs Exp $ */
|
||||
/* $Id: protos.h,v 1.8 2000-02-18 03:46:05 dfs Exp $ */
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
#define ARGS(x) x
|
||||
@@ -23,14 +24,16 @@
|
||||
/* Define a general malloc routine for creating pointers to objects */
|
||||
#define NEW(type) ((type *) malloc(sizeof(type)))
|
||||
|
||||
#ifdef NO_STRSTR
|
||||
#include "dynbuf.h"
|
||||
|
||||
#ifndef HAVE_STRSTR
|
||||
char *strstr ARGS ((char *s1, char *s2));
|
||||
#endif
|
||||
|
||||
int CallUserFunc ARGS ((char *name, int nargs));
|
||||
int DoFset ARGS ((ParsePtr p));
|
||||
void ProduceCalendar ARGS ((void));
|
||||
char *SimpleTime ARGS ((int tim, char *out));
|
||||
char *SimpleTime ARGS ((int tim));
|
||||
int DoRem ARGS ((ParsePtr p));
|
||||
int DoFlush ARGS ((ParsePtr p));
|
||||
void DoExit ARGS ((ParsePtr p));
|
||||
@@ -42,8 +45,8 @@ int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul,
|
||||
int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul));
|
||||
#endif
|
||||
int ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul));
|
||||
int DoSubst ARGS ((ParsePtr p, char *out, Trigger *t, TimeTrig *tt, int jul, int mode));
|
||||
int DoSubstFromString ARGS ((char *source, char *dest, int jul, int tim));
|
||||
int DoSubst ARGS ((ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode));
|
||||
int DoSubstFromString ARGS ((char *source, DynamicBuffer *dbuf, int jul, int tim));
|
||||
int EvalExpr ARGS ((char **e, Value *v));
|
||||
int DoCoerce ARGS ((char type, Value *v));
|
||||
void PrintValue ARGS ((Value *v, FILE *fp));
|
||||
@@ -63,8 +66,8 @@ int main ARGS ((int argc, char *argv[]));
|
||||
int Julian ARGS ((int year, int month, int day));
|
||||
void FromJulian ARGS ((int jul, int *y, int *m, int *d));
|
||||
int ParseChar ARGS ((ParsePtr p, int *err, int peek));
|
||||
int ParseToken ARGS ((ParsePtr p, char *out));
|
||||
int ParseIdentifier ARGS ((ParsePtr p, char *out));
|
||||
int ParseToken ARGS ((ParsePtr p, DynamicBuffer *dbuf));
|
||||
int ParseIdentifier ARGS ((ParsePtr p, DynamicBuffer *dbuf));
|
||||
int EvaluateExpr ARGS ((ParsePtr p, Value *v));
|
||||
int Evaluate ARGS ((char **s, Var *locals));
|
||||
int FnPopValStack ARGS ((Value *val));
|
||||
@@ -72,7 +75,7 @@ void Eprint ARGS ((const char *fmt, ...));
|
||||
void OutputLine ARGS ((FILE *fp));
|
||||
void CreateParser ARGS ((char *s, ParsePtr p));
|
||||
void DestroyParser ARGS ((ParsePtr p));
|
||||
void PushToken ARGS ((const char *tok));
|
||||
int PushToken ARGS ((const char *tok, ParsePtr p));
|
||||
long SystemTime ARGS ((int realtime));
|
||||
int SystemDate ARGS ((int *y, int *m, int *d));
|
||||
int DoIf ARGS ((ParsePtr p));
|
||||
@@ -92,7 +95,7 @@ int PushOmitContext ARGS ((ParsePtr p));
|
||||
int PopOmitContext ARGS ((ParsePtr p));
|
||||
int IsOmitted ARGS ((int jul, int localomit));
|
||||
int DoOmit ARGS ((ParsePtr p));
|
||||
int QueueReminder ARGS ((ParsePtr p, int typ, TimeTrig *tim, const char *sched));
|
||||
int QueueReminder ARGS ((ParsePtr p, Trigger *trig, TimeTrig *tim, const char *sched));
|
||||
void HandleQueuedReminders ARGS ((void));
|
||||
char *FindInitialToken ARGS ((Token *tok, char *s));
|
||||
void FindToken ARGS ((const char *s, Token *tok));
|
||||
@@ -115,7 +118,7 @@ void DestroyVars ARGS ((int all));
|
||||
int PreserveVar ARGS ((char *name));
|
||||
int DoPreserve ARGS ((Parser *p));
|
||||
int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
|
||||
void DoMsgCommand ARGS ((char *cmd, char *msg));
|
||||
int DoMsgCommand ARGS ((char *cmd, char *msg));
|
||||
int ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
|
||||
unsigned int HashVal ARGS ((const char *str));
|
||||
int DateOK ARGS ((int y, int m, int d));
|
||||
@@ -151,11 +154,7 @@ int CompareRems ARGS ((int dat1, int tim1, int prio1, int dat2, int tim2, int pr
|
||||
#ifdef __BORLANDC__
|
||||
void __cdecl SigIntHandler ARGS ((int d));
|
||||
#else
|
||||
#ifdef SIGHANDLER_INT_ARG
|
||||
void SigIntHandler ARGS ((int d));
|
||||
#else
|
||||
void SigIntHandler ARGS ((void));
|
||||
#endif
|
||||
RETSIGTYPE SigIntHandler ARGS ((int d));
|
||||
#endif
|
||||
void GotSigInt ARGS ((void));
|
||||
|
||||
@@ -5,13 +5,18 @@
|
||||
/* Queue up reminders for subsequent execution. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.15 2000-02-18 03:46:06 dfs Exp $";
|
||||
|
||||
/* Solaris needs this to get select() prototype */
|
||||
#ifdef __sun__
|
||||
#define __EXTENSIONS__ 1
|
||||
#endif
|
||||
|
||||
/* We only want object code generated if we have queued reminders */
|
||||
#ifdef HAVE_QUEUED
|
||||
@@ -20,13 +25,24 @@ static char const RCSID[] = "$Id: queue.c,v 1.1 1996-03-27 03:26:05 dfs Exp $";
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
@@ -52,6 +68,7 @@ typedef struct queuedrem {
|
||||
int ntrig;
|
||||
char *text;
|
||||
char sched[VAR_NAME_LEN+1];
|
||||
char tag[TAG_LEN+1];
|
||||
TimeTrig tt;
|
||||
} QueuedRem;
|
||||
|
||||
@@ -65,6 +82,8 @@ PRIVATE void CheckInitialFile ARGS ((void));
|
||||
PRIVATE int CalculateNextTime ARGS ((QueuedRem *q));
|
||||
PRIVATE QueuedRem *FindNextReminder ARGS ((void));
|
||||
PRIVATE int CalculateNextTimeUsingSched ARGS ((QueuedRem *q));
|
||||
PRIVATE void DaemonWait ARGS ((unsigned int sleeptime));
|
||||
PRIVATE void reread ARGS((void));
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -75,11 +94,12 @@ PRIVATE int CalculateNextTimeUsingSched ARGS ((QueuedRem *q));
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int QueueReminder(ParsePtr p, int typ, TimeTrig *tim, const char *sched)
|
||||
PUBLIC int QueueReminder(ParsePtr p, Trigger *trig,
|
||||
TimeTrig *tim, const char *sched)
|
||||
#else
|
||||
int QueueReminder(p, typ, tim, sched)
|
||||
int QueueReminder(p, trig, tim, sched)
|
||||
ParsePtr p;
|
||||
int typ;
|
||||
Trigger *trig,
|
||||
TimeTrig *tim;
|
||||
char *sched;
|
||||
#endif
|
||||
@@ -88,9 +108,9 @@ char *sched;
|
||||
|
||||
if (DontQueue ||
|
||||
tim->ttime == NO_TIME ||
|
||||
typ == CAL_TYPE ||
|
||||
trig->typ == CAL_TYPE ||
|
||||
tim->ttime < SystemTime(0) / 60 ||
|
||||
((typ == RUN_TYPE) && RunDisabled)) return OK;
|
||||
((trig->typ == RUN_TYPE) && RunDisabled)) return OK;
|
||||
|
||||
qelem = NEW(QueuedRem);
|
||||
if (!qelem) {
|
||||
@@ -101,14 +121,14 @@ char *sched;
|
||||
free(qelem);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
qelem->typ = typ;
|
||||
qelem->typ = trig->typ;
|
||||
qelem->tt = *tim;
|
||||
qelem->next = QueueHead;
|
||||
qelem->RunDisabled = RunDisabled;
|
||||
qelem->ntrig = 0;
|
||||
strcpy(qelem->sched, sched);
|
||||
strcpy(qelem->tag, trig->tag);
|
||||
QueueHead = qelem;
|
||||
NumQueued++;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -133,7 +153,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:
|
||||
@@ -149,7 +172,7 @@ void HandleQueuedReminders()
|
||||
}
|
||||
|
||||
/* If we're a daemon, get the mod time of initial file */
|
||||
if (Daemon) {
|
||||
if (Daemon > 0) {
|
||||
if (stat(InitialFile, &StatBuf)) {
|
||||
fprintf(ErrFp, "Cannot stat %s - not running as daemon!\n",
|
||||
InitialFile);
|
||||
@@ -178,35 +201,72 @@ void HandleQueuedReminders()
|
||||
/* If no more reminders to issue, we're done unless we're a daemon. */
|
||||
if (!q && !Daemon) break;
|
||||
|
||||
if (Daemon && !q)
|
||||
TimeToSleep = (long) 60*Daemon;
|
||||
else
|
||||
if (Daemon && !q) {
|
||||
if (Daemon < 0) {
|
||||
/* Sleep until midnight */
|
||||
TimeToSleep = (long) 1440*60L - SystemTime(0);
|
||||
} else {
|
||||
TimeToSleep = (long) 60*Daemon;
|
||||
}
|
||||
} else {
|
||||
TimeToSleep = (long) q->tt.nexttime * 60L - SystemTime(0);
|
||||
}
|
||||
|
||||
while (TimeToSleep > 0L) {
|
||||
SleepTime = (unsigned) ((TimeToSleep > 30000L) ? 30000 : TimeToSleep);
|
||||
|
||||
if (Daemon && SleepTime > 60*Daemon) SleepTime = 60*Daemon;
|
||||
if (Daemon > 0 && SleepTime > 60*Daemon) SleepTime = 60*Daemon;
|
||||
|
||||
sleep(SleepTime);
|
||||
if (Daemon >= 0) {
|
||||
sleep(SleepTime);
|
||||
} else {
|
||||
DaemonWait(SleepTime);
|
||||
}
|
||||
|
||||
if (Daemon && SleepTime) CheckInitialFile();
|
||||
if (Daemon> 0 && SleepTime) CheckInitialFile();
|
||||
|
||||
if (Daemon && !q)
|
||||
TimeToSleep = (long) 60*Daemon;
|
||||
else
|
||||
if (Daemon && !q) {
|
||||
if (Daemon < 0) {
|
||||
/* Sleep until midnight */
|
||||
TimeToSleep = (long) 1440*60L - SystemTime(0);
|
||||
} else {
|
||||
TimeToSleep = (long) 60*Daemon;
|
||||
}
|
||||
} else {
|
||||
TimeToSleep = (long) q->tt.nexttime * 60L - SystemTime(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Trigger the reminder */
|
||||
CreateParser(q->text, &p);
|
||||
trig.typ = q->typ;
|
||||
RunDisabled = q->RunDisabled;
|
||||
if (Daemon < 0) {
|
||||
printf("NOTE reminder %s ",
|
||||
SimpleTime(q->tt.ttime));
|
||||
printf("%s ", SimpleTime(SystemTime(0)/60));
|
||||
if (!*q->tag) {
|
||||
printf("*");
|
||||
} else {
|
||||
printf("%s", q->tag);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* Set up global variables so some functions like trigdate()
|
||||
and trigtime() work correctly */
|
||||
LastTriggerDate = JulianToday;
|
||||
LastTriggerTime = q->tt.ttime;
|
||||
LastTrigValid = 1;
|
||||
#ifdef OS2_POPUP
|
||||
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday, 1);
|
||||
#else
|
||||
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
|
||||
#endif
|
||||
if (Daemon < 0) {
|
||||
printf("NOTE endreminder\n");
|
||||
}
|
||||
fflush(stdout);
|
||||
|
||||
/* Calculate the next trigger time */
|
||||
@@ -249,8 +309,13 @@ QueuedRem *q;
|
||||
r = CalculateNextTimeUsingSched(q);
|
||||
if (r != NO_TIME) return r;
|
||||
}
|
||||
if (delta == NO_DELTA)
|
||||
if (tim < curtime) return NO_TIME; else return tim;
|
||||
if (delta == NO_DELTA) {
|
||||
if (tim < curtime) {
|
||||
return NO_TIME;
|
||||
} else {
|
||||
return tim;
|
||||
}
|
||||
}
|
||||
|
||||
tim -= delta;
|
||||
if (rep == NO_REP) rep = delta;
|
||||
@@ -344,8 +409,9 @@ static void CheckInitialFile()
|
||||
|
||||
if (stat(InitialFile, &StatBuf) == 0) tim = StatBuf.st_mtime;
|
||||
if (tim != FileModTime ||
|
||||
RealToday != SystemDate(&y, &m, &d))
|
||||
execvp(ArgV[0], ArgV);
|
||||
RealToday != SystemDate(&y, &m, &d)) {
|
||||
reread();
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -377,8 +443,9 @@ QueuedRem *q;
|
||||
RunDisabled = q->RunDisabled; /* Don't want weird scheduling functions
|
||||
to be a security hole! */
|
||||
while(1) {
|
||||
sprintf(LineBuffer, "%s(%d)", q->sched, q->ntrig);
|
||||
s = LineBuffer;
|
||||
char exprBuf[VAR_NAME_LEN+32];
|
||||
sprintf(exprBuf, "%s(%d)", q->sched, q->ntrig);
|
||||
s = exprBuf;
|
||||
r = EvalExpr(&s, &v);
|
||||
if (r) {
|
||||
q->sched[0] = 0;
|
||||
@@ -409,4 +476,92 @@ QueuedRem *q;
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DaemonWait */
|
||||
/* */
|
||||
/* Sleep or read command from stdin in "daemon -1" mode */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void DaemonWait(unsigned int sleeptime)
|
||||
#else
|
||||
static DaemonWait(sleeptime)
|
||||
unsigned int sleeptime;
|
||||
#endif
|
||||
{
|
||||
fd_set readSet;
|
||||
struct timeval timeout;
|
||||
int retval;
|
||||
int y, m, d;
|
||||
char cmdLine[256];
|
||||
|
||||
FD_ZERO(&readSet);
|
||||
FD_SET(0, &readSet);
|
||||
timeout.tv_sec = sleeptime;
|
||||
timeout.tv_usec = 0;
|
||||
retval = select(1, &readSet, NULL, NULL, &timeout);
|
||||
|
||||
/* If date has rolled around, restart */
|
||||
if (RealToday != SystemDate(&y, &m, &d)) {
|
||||
printf("NOTE newdate\nNOTE reread\n");
|
||||
fflush(stdout);
|
||||
reread();
|
||||
}
|
||||
|
||||
/* If nothing readable or interrupted system call, return */
|
||||
if (retval <= 0) return;
|
||||
|
||||
/* If stdin not readable, return */
|
||||
if (!FD_ISSET(0, &readSet)) return;
|
||||
|
||||
/* If EOF on stdin, exit */
|
||||
if (feof(stdin)) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* Read a line from stdin and interpret it */
|
||||
if (!fgets(cmdLine, sizeof(cmdLine), stdin)) {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!strcmp(cmdLine, "EXIT\n")) {
|
||||
exit(0);
|
||||
} else if (!strcmp(cmdLine, "STATUS\n")) {
|
||||
int nqueued = 0;
|
||||
QueuedRem *q = QueueHead;
|
||||
while(q) {
|
||||
if (q->tt.nexttime != NO_TIME) {
|
||||
nqueued++;
|
||||
}
|
||||
q = q->next;
|
||||
}
|
||||
printf("NOTE queued %d\n", nqueued);
|
||||
fflush(stdout);
|
||||
} else if (!strcmp(cmdLine, "REREAD\n")) {
|
||||
printf("NOTE reread\n");
|
||||
fflush(stdout);
|
||||
reread();
|
||||
} else {
|
||||
printf("ERR Invalid daemon command: %s", cmdLine);
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* reread */
|
||||
/* */
|
||||
/* Restarts Remind if date rolls over or REREAD cmd received */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void reread(void)
|
||||
#else
|
||||
static reread()
|
||||
#endif
|
||||
{
|
||||
execvp(ArgV[0], ArgV);
|
||||
}
|
||||
|
||||
#endif /* HAVE_QUEUED from way at the top */
|
||||
@@ -5,25 +5,27 @@
|
||||
/* Print a PostScript calendar. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
static char const RCSID[] = "$Id: rem2ps.c,v 1.4 1996-07-07 16:35:42 dfs Exp $";
|
||||
|
||||
#include "config.h"
|
||||
#include "lang.h"
|
||||
#include "dynbuf.h"
|
||||
static char const RCSID[] = "$Id: rem2ps.c,v 1.10 2000-02-18 03:46:07 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_UNISTD
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include "rem2ps.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
@@ -32,6 +34,9 @@ static char const RCSID[] = "$Id: rem2ps.c,v 1.4 1996-07-07 16:35:42 dfs Exp $";
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#include "rem2ps.h"
|
||||
#include "version.h"
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
#define ARGS(x) x
|
||||
#else
|
||||
@@ -49,7 +54,7 @@ typedef struct {
|
||||
int xsize, ysize;
|
||||
} PageType;
|
||||
|
||||
char Days[]=L_DAYINIT;
|
||||
char DayName[7][33];
|
||||
|
||||
char *SmallCalLoc[] = {
|
||||
"",
|
||||
@@ -94,8 +99,6 @@ char PortraitMode;
|
||||
char NoSmallCal;
|
||||
char UseISO;
|
||||
|
||||
char LineBuffer[LINELEN];
|
||||
|
||||
char *HeadFont="Helvetica";
|
||||
char *TitleFont="Helvetica";
|
||||
char *DayFont="Helvetica-BoldOblique";
|
||||
@@ -132,6 +135,7 @@ void WriteProlog ARGS ((void));
|
||||
void WriteCalEntry ARGS ((void));
|
||||
void WriteOneEntry ARGS ((char *s));
|
||||
void GetSmallLocations ARGS ((void));
|
||||
char *EatToken(char *in, char *out, int maxlen);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -148,6 +152,8 @@ char argv[];
|
||||
{
|
||||
/* If stdin is a tty - probably wrong. */
|
||||
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
Init(argc, argv);
|
||||
|
||||
if (isatty(0)) {
|
||||
@@ -156,11 +162,11 @@ char argv[];
|
||||
|
||||
/* Search for a valid input file */
|
||||
while (!feof(stdin)) {
|
||||
gets(LineBuffer);
|
||||
if (!strcmp(LineBuffer, PSBEGIN)) {
|
||||
DBufGets(&buf, stdin);
|
||||
if (!strcmp(DBufValue(&buf), 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-1998 by David F. Skoll\n\n", VERSION);
|
||||
fprintf(stderr, "Generating PostScript calendar\n");
|
||||
}
|
||||
}
|
||||
@@ -197,25 +203,35 @@ void DoPsCal()
|
||||
int i;
|
||||
int is_ps;
|
||||
int firstcol;
|
||||
|
||||
char *startOfBody;
|
||||
char passthru[PASSTHRU_LEN+1];
|
||||
DynamicBuffer buf;
|
||||
CalEntry *c, *d;
|
||||
|
||||
/* Read the month and year name, followed by # days in month and 1st day of
|
||||
month */
|
||||
gets(LineBuffer);
|
||||
sscanf(LineBuffer, "%s %s %d %d %d", month, year, &days, &wkday,
|
||||
DBufInit(&buf);
|
||||
DBufGets(&buf, stdin);
|
||||
sscanf(DBufValue(&buf), "%s %s %d %d %d", month, year, &days, &wkday,
|
||||
&MondayFirst);
|
||||
|
||||
/* Get day names */
|
||||
DBufGets(&buf, stdin);
|
||||
sscanf(DBufValue(&buf), "%32s %32s %32s %32s %32s %32s %32s",
|
||||
DayName[0], DayName[1], DayName[2], DayName[3],
|
||||
DayName[4], DayName[5], DayName[6]);
|
||||
|
||||
/* We write the prolog here because it's only at this point that
|
||||
MondayFirst is set correctly. */
|
||||
if (validfile == 1) {
|
||||
WriteProlog();
|
||||
}
|
||||
|
||||
gets(LineBuffer);
|
||||
sscanf(LineBuffer, "%s %d", prevm, &prevdays);
|
||||
gets(LineBuffer);
|
||||
sscanf(LineBuffer, "%s %d", nextm, &nextdays);
|
||||
DBufGets(&buf, stdin);
|
||||
sscanf(DBufValue(&buf), "%s %d", prevm, &prevdays);
|
||||
DBufGets(&buf, stdin);
|
||||
sscanf(DBufValue(&buf), "%s %d", nextm, &nextdays);
|
||||
DBufFree(&buf);
|
||||
MaxDay = days;
|
||||
FirstWkDay = wkday;
|
||||
|
||||
@@ -226,7 +242,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);
|
||||
|
||||
@@ -265,11 +281,14 @@ void DoPsCal()
|
||||
exit(1);
|
||||
}
|
||||
|
||||
gets(LineBuffer);
|
||||
if (!strcmp(LineBuffer, PSEND)) break;
|
||||
DBufGets(&buf, stdin);
|
||||
if (!strcmp(DBufValue(&buf), PSEND)) {
|
||||
DBufFree(&buf);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Read the day number - a bit of a hack! */
|
||||
DayNum = (LineBuffer[8] - '0') * 10 + LineBuffer[9] - '0';
|
||||
DayNum = (DBufValue(&buf)[8] - '0') * 10 + DBufValue(&buf)[9] - '0';
|
||||
if (DayNum != CurDay) {
|
||||
for(; CurDay<DayNum; CurDay++) {
|
||||
WriteCalEntry();
|
||||
@@ -282,25 +301,55 @@ void DoPsCal()
|
||||
fprintf(stderr, "malloc failed - aborting.\n");
|
||||
exit(1);
|
||||
}
|
||||
is_ps = (*LineBuffer == 'F' || *LineBuffer == 'P');
|
||||
c->next = NULL;
|
||||
c->entry = malloc(strlen(LineBuffer+10) + 1 + is_ps);
|
||||
|
||||
/* Skip the tag, duration and time */
|
||||
startOfBody = DBufValue(&buf)+10;
|
||||
|
||||
/* Eat the passthru */
|
||||
startOfBody = EatToken(startOfBody, passthru, PASSTHRU_LEN);
|
||||
|
||||
/* Eat the tag */
|
||||
startOfBody = EatToken(startOfBody, NULL, 0);
|
||||
|
||||
/* Eat the duration */
|
||||
startOfBody = EatToken(startOfBody, NULL, 0);
|
||||
|
||||
/* Eat the time */
|
||||
startOfBody = EatToken(startOfBody, NULL, 0);
|
||||
|
||||
is_ps = 0;
|
||||
if (!strcmp(passthru, "PostScript") ||
|
||||
!strcmp(passthru, "PSFile") ||
|
||||
!strcmp(passthru, "MOON") ||
|
||||
!strcmp(passthru, "SHADE")) {
|
||||
is_ps = 1;
|
||||
}
|
||||
c->entry = malloc(strlen(startOfBody) + 1 + is_ps);
|
||||
if (!c->entry) {
|
||||
fprintf(stderr, "malloc failed - aborting.\n");
|
||||
exit(1);
|
||||
}
|
||||
strcpy(c->entry+is_ps, LineBuffer+10);
|
||||
strcpy(c->entry+is_ps, startOfBody);
|
||||
|
||||
if (is_ps) {
|
||||
/* Save the 'P' or 'F' flag */
|
||||
*(c->entry) = *LineBuffer;
|
||||
if (!strcmp(passthru, "PostScript")) {
|
||||
*(c->entry) = 'P';
|
||||
} else if (!strcmp(passthru, "SHADE")) {
|
||||
*(c->entry) = 'S';
|
||||
} else if (!strcmp(passthru, "MOON")) {
|
||||
*(c->entry) = 'M';
|
||||
} else {
|
||||
*(c->entry) = 'F';
|
||||
}
|
||||
if (!PsEntries[DayNum]) PsEntries[DayNum] = c;
|
||||
else {
|
||||
d = PsEntries[DayNum];
|
||||
while(d->next) d = d->next;
|
||||
d->next = c;
|
||||
}
|
||||
} else {
|
||||
} else if (!strcmp(passthru, "*")) {
|
||||
/* Put on linked list */
|
||||
if (!CurEntries) CurEntries = c;
|
||||
else {
|
||||
@@ -355,7 +404,7 @@ void WriteProlog()
|
||||
char *isostuff;
|
||||
FILE *fp;
|
||||
int nread;
|
||||
char buffer[LINELEN];
|
||||
char buffer[512];
|
||||
|
||||
if (!PortraitMode) {
|
||||
i = x; x = y; y = i;
|
||||
@@ -367,7 +416,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) &&
|
||||
@@ -388,12 +437,12 @@ void WriteProlog()
|
||||
for (i=0; PSProlog1[i]; i++) puts(PSProlog1[i]);
|
||||
if (!MondayFirst)
|
||||
printf("[(%s) (%s) (%s) (%s) (%s) (%s) (%s)]\n",
|
||||
L_SUNDAY, L_MONDAY, L_TUESDAY, L_WEDNESDAY,
|
||||
L_THURSDAY, L_FRIDAY, L_SATURDAY);
|
||||
DayName[0], DayName[1], DayName[2], DayName[3],
|
||||
DayName[4], DayName[5], DayName[6]);
|
||||
else
|
||||
printf("[(%s) (%s) (%s) (%s) (%s) (%s) (%s)]\n",
|
||||
L_MONDAY, L_TUESDAY, L_WEDNESDAY,
|
||||
L_THURSDAY, L_FRIDAY, L_SATURDAY, L_SUNDAY);
|
||||
DayName[1], DayName[2], DayName[3],
|
||||
DayName[4], DayName[5], DayName[6], DayName[0]);
|
||||
for (i=0; PSProlog2[i]; i++) puts(PSProlog2[i]);
|
||||
|
||||
printf("/HeadFont /%s %s\n", HeadFont, isostuff);
|
||||
@@ -430,7 +479,7 @@ void WriteProlog()
|
||||
fprintf(stderr, "Could not open prologue file `%s'\n", UserProlog);
|
||||
} else {
|
||||
while(1) {
|
||||
nread = fread(buffer, sizeof(char), LINELEN, fp);
|
||||
nread = fread(buffer, sizeof(char), 512, fp);
|
||||
if (!nread) break;
|
||||
fwrite(buffer, sizeof(char), nread, stdout);
|
||||
}
|
||||
@@ -550,16 +599,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;
|
||||
@@ -799,7 +850,7 @@ int days, first, col;
|
||||
for (i=0; i<7; i++) {
|
||||
if (MondayFirst) j=(i+1)%7;
|
||||
else j=i;
|
||||
printf("Border %d SmallWidth mul add Border neg SmallFontSize sub SmallFontSize sub 2 sub moveto (%c) show\n", i, Days[j]);
|
||||
printf("Border %d SmallWidth mul add Border neg SmallFontSize sub SmallFontSize sub 2 sub moveto (%c) show\n", i, DayName[j][0]);
|
||||
}
|
||||
|
||||
/* Now do the days of the month */
|
||||
@@ -832,7 +883,10 @@ int DoQueuedPs()
|
||||
CalEntry *e, *n;
|
||||
FILE *fp;
|
||||
int fnoff;
|
||||
char buffer[LINELEN];
|
||||
char buffer[512];
|
||||
char *size, *extra;
|
||||
int num, r, g, b, phase, fontsize, moonsize;
|
||||
unsigned char c;
|
||||
|
||||
if (!MondayFirst) begin = CurDay - WkDayNum;
|
||||
else begin = CurDay - (WkDayNum ? WkDayNum-1 : 6);
|
||||
@@ -859,20 +913,128 @@ int DoQueuedPs()
|
||||
/* Now do the user's PostScript code */
|
||||
fnoff = 1;
|
||||
while (isspace(*(e->entry+fnoff))) fnoff++;
|
||||
if (*(e->entry) == 'P') {
|
||||
switch(*e->entry) {
|
||||
case 'P': /* Send PostScript through */
|
||||
printf("%s\n", e->entry+fnoff);
|
||||
} else {
|
||||
break;
|
||||
case 'F': /* PostScript from a file */
|
||||
fp = fopen(e->entry+fnoff, "r");
|
||||
if (!fp) {
|
||||
fprintf(stderr, "Could not open PostScript file `%s'\n", e->entry+1);
|
||||
} else {
|
||||
while(1) {
|
||||
nread = fread(buffer, sizeof(char), LINELEN, fp);
|
||||
nread = fread(buffer, sizeof(char), 512, fp);
|
||||
if (!nread) break;
|
||||
fwrite(buffer, sizeof(char), nread, stdout);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
break;
|
||||
case 'S': /* Shading */
|
||||
num = sscanf(e->entry+fnoff, "%d %d %d", &r, &g, &b);
|
||||
if (num == 1) {
|
||||
g = r;
|
||||
b = r;
|
||||
} else if (num != 3) {
|
||||
fprintf(stderr, "Rem2PS: Malformed SHADE special\n");
|
||||
break;
|
||||
}
|
||||
if (r < 0 || r > 255 ||
|
||||
g < 0 || g > 255 ||
|
||||
b < 0 || b > 255) {
|
||||
fprintf(stderr, "Rem2PS: Illegal values for SHADE\n");
|
||||
break;
|
||||
}
|
||||
printf("/_A LineWidth 2 div def _A _A moveto\n");
|
||||
printf("BoxWidth _A sub _A lineto BoxWidth _A sub BoxHeight _A sub lineto\n");
|
||||
printf("_A BoxHeight _A sub lineto closepath\n");
|
||||
printf("%g %g %g setrgbcolor fill 0.0 setgray\n",
|
||||
r/255.0, g/255.0, b/255.0);
|
||||
break;
|
||||
|
||||
case 'M': /* Moon phase */
|
||||
num = sscanf(e->entry+fnoff, "%d %d %d", &phase, &moonsize,
|
||||
&fontsize);
|
||||
if (num == 1) {
|
||||
moonsize = -1;
|
||||
fontsize = -1;
|
||||
} else if (num == 2) {
|
||||
fontsize = -1;
|
||||
} else if (num != 3) {
|
||||
fprintf(stderr, "Rem2PS: Badly formed MOON special\n");
|
||||
break;
|
||||
}
|
||||
if (phase < 0 || phase > 3) {
|
||||
fprintf(stderr, "Rem2PS: Illegal MOON phase %d\n",
|
||||
phase);
|
||||
break;
|
||||
}
|
||||
if (moonsize < 0) {
|
||||
size = "DaySize 2 div";
|
||||
} else {
|
||||
sprintf(buffer, "%d", moonsize);
|
||||
size = buffer;
|
||||
}
|
||||
|
||||
printf("gsave 0 setgray newpath Border %s add BoxHeight Border sub %s sub\n", size, size);
|
||||
printf(" %s 0 360 arc closepath\n", size);
|
||||
switch(phase) {
|
||||
case 0:
|
||||
printf("fill\n");
|
||||
break;
|
||||
case 2:
|
||||
printf("stroke\n");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
printf("stroke\n");
|
||||
printf("newpath Border %s add BoxHeight Border sub %s sub\n",
|
||||
size, size);
|
||||
printf("%s 90 270 arc closepath fill\n", size);
|
||||
break;
|
||||
default:
|
||||
printf("stroke\n");
|
||||
printf("newpath Border %s add BoxHeight Border sub %s sub\n",
|
||||
size, size);
|
||||
printf("%s 270 90 arc closepath fill\n", size);
|
||||
break;
|
||||
}
|
||||
/* See if we have extra stuff */
|
||||
extra = e->entry+fnoff;
|
||||
|
||||
/* Skip phase */
|
||||
while(*extra && !isspace(*extra)) extra++;
|
||||
while(*extra && isspace(*extra)) extra++;
|
||||
|
||||
/* Skip moon size */
|
||||
while(*extra && !isspace(*extra)) extra++;
|
||||
while(*extra && isspace(*extra)) extra++;
|
||||
|
||||
/* Skip font size */
|
||||
while(*extra && !isspace(*extra)) extra++;
|
||||
while(*extra && isspace(*extra)) extra++;
|
||||
|
||||
/* Anything left? */
|
||||
if (*extra) {
|
||||
printf("Border %s add %s add Border add BoxHeight border sub %s sub %s sub moveto\n", size, size, size, size);
|
||||
if (fontsize < 0) {
|
||||
size = "EntrySize";
|
||||
} else {
|
||||
sprintf(buffer, "%d", fontsize);
|
||||
size = buffer;
|
||||
}
|
||||
printf("/EntryFont findfont %s scalefont setfont (",
|
||||
size);
|
||||
while(*extra) {
|
||||
c = (unsigned char) *extra++;
|
||||
if (c == '\\' || c == '(' || c == ')') PutChar('\\');
|
||||
PutChar(c);
|
||||
}
|
||||
printf(") show\n");
|
||||
|
||||
}
|
||||
printf("grestore\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* Free the entry */
|
||||
@@ -956,3 +1118,34 @@ void GetSmallLocations()
|
||||
return;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* EatToken */
|
||||
/* */
|
||||
/* Read a space-delimited token into an output buffer. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *EatToken(char *in, char *out, int maxlen)
|
||||
#else
|
||||
char *EatToken(in, out, maxlen)
|
||||
char *in, *out;
|
||||
int maxlen;
|
||||
#endif
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
/* Skip space before token */
|
||||
while(*in && isspace(*in)) in++;
|
||||
|
||||
/* Eat the token */
|
||||
while(*in && !isspace(*in)) {
|
||||
if (i < maxlen) {
|
||||
if (out) *out++ = *in;
|
||||
i++;
|
||||
}
|
||||
in++;
|
||||
}
|
||||
if (out) *out = 0;
|
||||
return in;
|
||||
}
|
||||
@@ -5,16 +5,18 @@
|
||||
/* Define the PostScript prologue */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: rem2ps.h,v 1.1 1996-03-27 03:26:08 dfs Exp $ */
|
||||
/* $Id: rem2ps.h,v 1.4 2000-02-18 03:46:08 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",
|
||||
@@ -5,13 +5,16 @@
|
||||
/* Routines for sorting reminders by trigger date */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.6 2000-02-18 03:46:09 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
@@ -21,8 +24,6 @@ static char const RCSID[] = "$Id: sort.c,v 1.1 1996-03-27 03:26:10 dfs Exp $";
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
@@ -205,10 +206,11 @@ static void IssueSortBanner(jul)
|
||||
int jul;
|
||||
#endif
|
||||
{
|
||||
char BanExpr[25];
|
||||
char BanExpr[64];
|
||||
int y, m, d;
|
||||
Value v;
|
||||
char *s = BanExpr;
|
||||
DynamicBuffer buf;
|
||||
|
||||
if (UserFuncExists("sortbanner") != 1) return;
|
||||
|
||||
@@ -217,8 +219,11 @@ int jul;
|
||||
y = EvalExpr(&s, &v);
|
||||
if (y) return;
|
||||
if (DoCoerce(STR_TYPE, &v)) return;
|
||||
if (!DoSubstFromString(v.v.str, SubstBuffer, jul, NO_TIME))
|
||||
if (*SubstBuffer) printf("%s\n", SubstBuffer);
|
||||
DBufInit(&buf);
|
||||
if (!DoSubstFromString(v.v.str, &buf, jul, NO_TIME)) {
|
||||
if (*DBufValue(&buf)) printf("%s\n", DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
}
|
||||
DestroyValue(v);
|
||||
}
|
||||
|
||||
@@ -6,22 +6,26 @@
|
||||
/* classifying the tokens parsed. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.9 2000-02-18 03:46:10 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
@@ -52,13 +56,14 @@ Token TokArray[] = {
|
||||
{ "banner", 3, T_Banner, 0 },
|
||||
{ "before", 3, T_Skip, BEFORE_SKIP },
|
||||
{ "cal", 3, T_RemType, CAL_TYPE },
|
||||
{ "clear-omit-context", 5, T_Clr, 0 },
|
||||
{ "debug", 5, T_Debug, 0 },
|
||||
{ "december", 3, T_Month, 11 },
|
||||
{ "dumpvars", 4, T_Dumpvars, 0 },
|
||||
{ "clear-omit-context", 5, T_Clr, 0 },
|
||||
{ "debug", 5, T_Debug, 0 },
|
||||
{ "december", 3, T_Month, 11 },
|
||||
{ "dumpvars", 4, T_Dumpvars, 0 },
|
||||
{ "duration", 3, T_Duration, 0 },
|
||||
{ "else", 4, T_Else, 0 },
|
||||
{ "endif", 5, T_EndIf, 0 },
|
||||
{ "errmsg", 6, T_ErrMsg, 0 },
|
||||
{ "errmsg", 6, T_ErrMsg, 0 },
|
||||
{ "exit", 4, T_Exit, 0 },
|
||||
{ "february", 3, T_Month, 1 },
|
||||
{ "flush", 5, T_Flush, 0 },
|
||||
@@ -67,7 +72,7 @@ Token TokArray[] = {
|
||||
{ "if", 2, T_If, 0 },
|
||||
{ "iftrig", 6, T_IfTrig, 0 },
|
||||
{ "include", 3, T_Include, 0 },
|
||||
{ "january", 3, T_Month, 0 },
|
||||
{ "january", 3, T_Month, 0 },
|
||||
{ "july", 3, T_Month, 6 },
|
||||
{ "june", 3, T_Month, 5 },
|
||||
{ "march", 3, T_Month, 2 },
|
||||
@@ -76,27 +81,29 @@ Token TokArray[] = {
|
||||
{ "msf", 3, T_RemType, MSF_TYPE },
|
||||
{ "msg", 3, T_RemType, MSG_TYPE },
|
||||
{ "november", 3, T_Month, 10 },
|
||||
{ "october", 3, T_Month, 9 },
|
||||
{ "october", 3, T_Month, 9 },
|
||||
{ "omit", 3, T_Omit, 0 },
|
||||
{ "once", 3, T_Once, 0 },
|
||||
{ "pop-omit-context", 3, T_Pop, 0 },
|
||||
{ "preserve", 8, T_Preserve, 0 },
|
||||
{ "preserve", 8, T_Preserve, 0 },
|
||||
{ "priority", 8, T_Priority, 0 },
|
||||
{ "ps", 2, T_RemType, PS_TYPE },
|
||||
{ "psfile", 6, T_RemType, PSF_TYPE },
|
||||
{ "psfile", 6, T_RemType, PSF_TYPE },
|
||||
{ "push-omit-context", 4, T_Push, 0 },
|
||||
{ "rem", 3, T_Rem, 0 },
|
||||
{ "run", 3, T_RemType, RUN_TYPE },
|
||||
{ "satisfy", 7, T_RemType, SAT_TYPE },
|
||||
{ "satisfy", 7, T_RemType, SAT_TYPE },
|
||||
{ "saturday", 3, T_WkDay, 5 },
|
||||
{ "scanfrom", 4, T_Scanfrom, 0 },
|
||||
{ "sched", 5, T_Sched, 0 },
|
||||
{ "september", 3, T_Month, 8 },
|
||||
{ "set", 3, T_Set, 0 },
|
||||
{ "skip", 3, T_Skip, SKIP_SKIP },
|
||||
{ "special", 7, T_RemType, PASSTHRU_TYPE },
|
||||
{ "sunday", 3, T_WkDay, 6 },
|
||||
{ "tag", 3, T_Tag, 0 },
|
||||
{ "thursday", 3, T_WkDay, 3 },
|
||||
{ "tuesday", 3, T_WkDay, 1 },
|
||||
{ "tuesday", 3, T_WkDay, 1 },
|
||||
{ "unset", 5, T_UnSet, 0 },
|
||||
{ "until", 3, T_Until, 0 },
|
||||
{ "warn", 4, T_Warn, 0 },
|
||||
@@ -109,24 +116,24 @@ Token NonEnglishToks[] = {
|
||||
/* NAME MINLEN TYPE VALUE */
|
||||
|
||||
{ L_MONDAY, 3, T_WkDay, 0 },
|
||||
{ L_TUESDAY, 3, T_WkDay, 1 },
|
||||
{ L_WEDNESDAY, 3, T_WkDay, 2 },
|
||||
{ L_THURSDAY, 3, T_WkDay, 3 },
|
||||
{ L_TUESDAY, 3, T_WkDay, 1 },
|
||||
{ L_WEDNESDAY, 3, T_WkDay, 2 },
|
||||
{ L_THURSDAY, 3, T_WkDay, 3 },
|
||||
{ L_FRIDAY, 3, T_WkDay, 4 },
|
||||
{ L_SATURDAY, 3, T_WkDay, 5 },
|
||||
{ L_SATURDAY, 3, T_WkDay, 5 },
|
||||
{ L_SUNDAY, 3, T_WkDay, 6 },
|
||||
{ L_JAN, 3, T_Month, 0 },
|
||||
{ L_FEB, 3, T_Month, 1 },
|
||||
{ L_MAR, 3, T_Month, 2 },
|
||||
{ L_APR, 3, T_Month, 3 },
|
||||
{ L_MAY, 3, T_Month, 4 },
|
||||
{ L_JUN, 3, T_Month, 5 },
|
||||
{ L_JUL, 3, T_Month, 6 },
|
||||
{ L_AUG, 3, T_Month, 7 },
|
||||
{ L_SEP, 3, T_Month, 8 },
|
||||
{ L_OCT, 3, T_Month, 9 },
|
||||
{ L_NOV, 3, T_Month, 10 },
|
||||
{ L_DEC, 3, T_Month, 11 }
|
||||
{ L_JAN, 3, T_Month, 0 },
|
||||
{ L_FEB, 3, T_Month, 1 },
|
||||
{ L_MAR, 3, T_Month, 2 },
|
||||
{ L_APR, 3, T_Month, 3 },
|
||||
{ L_MAY, 3, T_Month, 4 },
|
||||
{ L_JUN, 3, T_Month, 5 },
|
||||
{ L_JUL, 3, T_Month, 6 },
|
||||
{ L_AUG, 3, T_Month, 7 },
|
||||
{ L_SEP, 3, T_Month, 8 },
|
||||
{ L_OCT, 3, T_Month, 9 },
|
||||
{ L_NOV, 3, T_Month, 10 },
|
||||
{ L_DEC, 3, T_Month, 11 }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -148,23 +155,20 @@ Token *tok;
|
||||
char *s;
|
||||
#endif
|
||||
{
|
||||
char *t;
|
||||
int len=0;
|
||||
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
tok->type = T_Illegal;
|
||||
|
||||
while (isspace(*s)) s++;
|
||||
|
||||
t = TokBuffer;
|
||||
|
||||
while (*s && !isspace(*s)) {
|
||||
if (len < TOKSIZE) {
|
||||
*t++ = *s++;
|
||||
len++;
|
||||
}else s++;
|
||||
if (DBufPutc(&buf, *s++) != OK) return s;
|
||||
}
|
||||
|
||||
*t = 0;
|
||||
FindToken(DBufValue(&buf), tok);
|
||||
DBufFree(&buf);
|
||||
|
||||
FindToken(TokBuffer, tok);
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -205,6 +209,11 @@ Token *tok;
|
||||
}
|
||||
|
||||
l = strlen(s);
|
||||
|
||||
/* Ignore trailing commas */
|
||||
if (l > 0 && s[l-1] == ',') {
|
||||
l--;
|
||||
}
|
||||
bot = 0;
|
||||
top = sizeof(TokArray) / sizeof(TokArray[0]) - 1;
|
||||
|
||||
@@ -274,6 +283,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++;
|
||||
@@ -340,12 +363,14 @@ char *s;
|
||||
{
|
||||
register int r;
|
||||
char *tk = t->name;
|
||||
while(*tk && *s) {
|
||||
while(*tk && *s && !(*s == ',' && *(s+1) == 0)) {
|
||||
r = UPPER(*tk) - UPPER(*s);
|
||||
tk++;
|
||||
s++;
|
||||
if (r) return r;
|
||||
}
|
||||
if (!*s) return 0;
|
||||
/* Ignore trailing commas on s */
|
||||
|
||||
if (!*s || (*s == ',' && !*(s+1))) return 0;
|
||||
return (*tk - *s);
|
||||
}
|
||||
@@ -5,20 +5,24 @@
|
||||
/* 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-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.5 2000-02-18 03:46:11 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "expr.h"
|
||||
#include "protos.h"
|
||||
@@ -5,11 +5,14 @@
|
||||
/* Type definitions all dumped here. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: types.h,v 1.2 1996-04-28 02:02:11 dfs Exp $ */
|
||||
/* $Id: types.h,v 1.5 2000-02-18 03:46:12 dfs Exp $ */
|
||||
|
||||
#include "dynbuf.h"
|
||||
|
||||
/* Values */
|
||||
typedef struct {
|
||||
@@ -58,6 +61,8 @@ typedef struct {
|
||||
int priority;
|
||||
char sched[VAR_NAME_LEN+1]; /* Scheduling function */
|
||||
char warn[VAR_NAME_LEN+1]; /* Warning function */
|
||||
char tag[TAG_LEN+1];
|
||||
char passthru[PASSTHRU_LEN+1];
|
||||
} Trigger;
|
||||
|
||||
/* A time trigger */
|
||||
@@ -66,6 +71,7 @@ typedef struct {
|
||||
int nexttime;
|
||||
int delta;
|
||||
int rep;
|
||||
int duration;
|
||||
} TimeTrig;
|
||||
|
||||
/* The parse pointer */
|
||||
@@ -76,6 +82,8 @@ typedef struct {
|
||||
char *pos; /* Current position */
|
||||
char *etext; /* Substituted text */
|
||||
char *epos; /* Position in substituted text */
|
||||
DynamicBuffer pushedToken; /* Pushed-back token */
|
||||
char *tokenPushed; /* NULL if no pushed-back token */
|
||||
} Parser;
|
||||
|
||||
typedef Parser *ParsePtr; /* Pointer to parser structure */
|
||||
@@ -109,6 +117,8 @@ typedef Parser *ParsePtr; /* Pointer to parser structure */
|
||||
#define PS_TYPE 5
|
||||
#define PSF_TYPE 6
|
||||
#define MSF_TYPE 7
|
||||
#define PASSTHRU_TYPE 8
|
||||
|
||||
|
||||
/* DEFINES for debugging flags */
|
||||
#define DB_PRTLINE 1
|
||||
@@ -138,7 +148,9 @@ enum TokTypes
|
||||
T_Flush,
|
||||
T_Priority,
|
||||
T_Sched,
|
||||
T_Warn
|
||||
T_Warn,
|
||||
T_Tag,
|
||||
T_Duration
|
||||
};
|
||||
|
||||
/* The structure of a token */
|
||||
@@ -164,8 +176,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,21 +6,25 @@
|
||||
/* functions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.6 2000-02-18 03:46:13 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
@@ -35,7 +39,6 @@ typedef struct udf_struct {
|
||||
char name[VAR_NAME_LEN+1];
|
||||
char *text;
|
||||
Var *locals;
|
||||
char IsCached;
|
||||
char IsActive;
|
||||
int nargs;
|
||||
} UserFunc;
|
||||
@@ -76,27 +79,42 @@ ParsePtr p;
|
||||
UserFunc *func;
|
||||
Var *v;
|
||||
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
/* Get the function name */
|
||||
if ( (r=ParseIdentifier(p, TokBuffer)) ) return r;
|
||||
if (*TokBuffer == '$') return E_BAD_ID;
|
||||
if ( (r=ParseIdentifier(p, &buf)) ) return r;
|
||||
if (*DBufValue(&buf) == '$') {
|
||||
DBufFree(&buf);
|
||||
return E_BAD_ID;
|
||||
}
|
||||
|
||||
/* Should be followed by '(' */
|
||||
c = ParseNonSpaceChar(p, &r, 0);
|
||||
if (r) return r;
|
||||
if (c != '(') return E_PARSE_ERR;
|
||||
if (r) {
|
||||
DBufFree(&buf);
|
||||
return r;
|
||||
}
|
||||
if (c != '(') {
|
||||
DBufFree(&buf);
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
|
||||
func = NEW(UserFunc);
|
||||
if (!func) return E_NO_MEM;
|
||||
StrnCpy(func->name, TokBuffer, VAR_NAME_LEN);
|
||||
if (!func) {
|
||||
DBufFree(&buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
StrnCpy(func->name, DBufValue(&buf), VAR_NAME_LEN);
|
||||
DBufFree(&buf);
|
||||
if (!Hush) {
|
||||
if (FindFunc(TokBuffer, Func, NumFuncs)) {
|
||||
if (FindFunc(DBufValue(&buf), Func, NumFuncs)) {
|
||||
Eprint("%s: `%s'", ErrMsg[E_REDEF_FUNC],
|
||||
TokBuffer);
|
||||
DBufValue(&buf));
|
||||
}
|
||||
}
|
||||
func->locals = NULL;
|
||||
func->text = NULL;
|
||||
func->IsCached = 1;
|
||||
func->IsActive = 0;
|
||||
func->nargs = 0;
|
||||
|
||||
@@ -111,16 +129,21 @@ ParsePtr p;
|
||||
}
|
||||
else {
|
||||
while(1) {
|
||||
if ( (r=ParseIdentifier(p, TokBuffer)) ) return r;
|
||||
if (*TokBuffer == '$') return E_BAD_ID;
|
||||
if ( (r=ParseIdentifier(p, &buf)) ) return r;
|
||||
if (*DBufValue(&buf) == '$') {
|
||||
DBufFree(&buf);
|
||||
return E_BAD_ID;
|
||||
}
|
||||
v = NEW(Var);
|
||||
func->nargs++;
|
||||
v->v.type = ERR_TYPE;
|
||||
if (!v) {
|
||||
DBufFree(&buf);
|
||||
DestroyUserFunc(func);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
StrnCpy(v->name, TokBuffer, VAR_NAME_LEN);
|
||||
func->nargs++;
|
||||
v->v.type = ERR_TYPE;
|
||||
StrnCpy(v->name, DBufValue(&buf), VAR_NAME_LEN);
|
||||
DBufFree(&buf);
|
||||
v->next = func->locals;
|
||||
func->locals = v;
|
||||
c = ParseNonSpaceChar(p, &r, 0);
|
||||
@@ -139,18 +162,10 @@ ParsePtr p;
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
|
||||
/* A bit of trickery here - if the definition is already cached,
|
||||
no point in copying it. */
|
||||
if (CurLine != LineBuffer) {
|
||||
func->IsCached = 1;
|
||||
func->text = p->pos;
|
||||
} else {
|
||||
func->IsCached = 0;
|
||||
func->text = StrDup(p->pos);
|
||||
if (!func->text) {
|
||||
DestroyUserFunc(func);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
func->text = StrDup(p->pos);
|
||||
if (!func->text) {
|
||||
DestroyUserFunc(func);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
/* If an old definition of this function exists, destroy it */
|
||||
@@ -187,7 +202,7 @@ UserFunc *f;
|
||||
}
|
||||
|
||||
/* Free the function definition */
|
||||
if (f->text && !f->IsCached) free(f->text);
|
||||
if (f->text) free(f->text);
|
||||
|
||||
/* Free the data structure itself */
|
||||
free(f);
|
||||
@@ -5,22 +5,26 @@
|
||||
/* Useful utility functions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.5 2000-02-18 03:46:14 dfs Exp $";
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
@@ -139,7 +143,7 @@ char *s1, *s2;
|
||||
return UPPER(*s1) - UPPER(*s2);
|
||||
}
|
||||
|
||||
#ifdef NO_STRSTR
|
||||
#ifndef HAVE_STRSTR
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *strstr(char *s1, char *s2)
|
||||
#else
|
||||
@@ -6,22 +6,26 @@
|
||||
/* user- and system-defined variables. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
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.7 2000-02-18 03:46:15 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "expr.h"
|
||||
#include "globals.h"
|
||||
@@ -215,14 +219,22 @@ Parser *p;
|
||||
Value v;
|
||||
int r;
|
||||
|
||||
r = ParseIdentifier(p, TokBuffer);
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
r = ParseIdentifier(p, &buf);
|
||||
if (r) return r;
|
||||
|
||||
r = EvaluateExpr(p, &v);
|
||||
if (r) return r;
|
||||
if (r) {
|
||||
DBufFree(&buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
if (*TokBuffer == '$') return SetSysVar(TokBuffer+1, &v);
|
||||
else return SetVar(TokBuffer, &v);
|
||||
if (*DBufValue(&buf) == '$') r = SetSysVar(DBufValue(&buf)+1, &v);
|
||||
else r = SetVar(DBufValue(&buf), &v);
|
||||
DBufFree(&buf);
|
||||
return r;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -239,18 +251,27 @@ Parser *p;
|
||||
{
|
||||
int r;
|
||||
|
||||
r = ParseToken(p, TokBuffer);
|
||||
if (r) return r;
|
||||
if (!*TokBuffer) return E_EOLN;
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
(void) DeleteVar(TokBuffer); /* Ignore error - nosuchvar */
|
||||
r = ParseToken(p, &buf);
|
||||
if (r) return r;
|
||||
if (!DBufLen(&buf)) {
|
||||
DBufFree(&buf);
|
||||
return E_EOLN;
|
||||
}
|
||||
|
||||
(void) DeleteVar(DBufValue(&buf)); /* Ignore error - nosuchvar */
|
||||
|
||||
/* Keep going... */
|
||||
while(1) {
|
||||
r = ParseToken(p, TokBuffer);
|
||||
r = ParseToken(p, &buf);
|
||||
if (r) return r;
|
||||
if (!*TokBuffer) return OK;
|
||||
(void) DeleteVar(TokBuffer);
|
||||
if (!DBufLen(&buf)) {
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
(void) DeleteVar(DBufValue(&buf));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -270,30 +291,41 @@ ParsePtr p;
|
||||
{
|
||||
int r;
|
||||
Var *v;
|
||||
DynamicBuffer buf;
|
||||
|
||||
r = ParseToken(p, TokBuffer);
|
||||
DBufInit(&buf);
|
||||
r = ParseToken(p, &buf);
|
||||
if (r) return r;
|
||||
if (!*TokBuffer || *TokBuffer == '#' || *TokBuffer == ';') {
|
||||
if (!*DBufValue(&buf) ||
|
||||
*DBufValue(&buf) == '#' ||
|
||||
*DBufValue(&buf) == ';') {
|
||||
DBufFree(&buf);
|
||||
DumpVarTable();
|
||||
return OK;
|
||||
}
|
||||
fprintf(ErrFp, "%*s %s\n\n", VAR_NAME_LEN, VARIABLE, VALUE);
|
||||
while(1) {
|
||||
if (*TokBuffer == '$') {
|
||||
DumpSysVarByName(TokBuffer+1);
|
||||
if (*DBufValue(&buf) == '$') {
|
||||
DumpSysVarByName(DBufValue(&buf)+1);
|
||||
} else {
|
||||
v = FindVar(TokBuffer, 0);
|
||||
TokBuffer[VAR_NAME_LEN] = 0;
|
||||
if (!v) fprintf(ErrFp, "%*s %s\n", VAR_NAME_LEN, TokBuffer, UNDEF);
|
||||
v = FindVar(DBufValue(&buf), 0);
|
||||
DBufValue(&buf)[VAR_NAME_LEN] = 0;
|
||||
if (!v) fprintf(ErrFp, "%*s %s\n", VAR_NAME_LEN,
|
||||
DBufValue(&buf), UNDEF);
|
||||
else {
|
||||
fprintf(ErrFp, "%*s ", VAR_NAME_LEN, v->name);
|
||||
PrintValue(&(v->v), ErrFp);
|
||||
fprintf(ErrFp, "\n");
|
||||
}
|
||||
}
|
||||
r = ParseToken(p, TokBuffer);
|
||||
r = ParseToken(p, &buf);
|
||||
if (r) return r;
|
||||
if (!*TokBuffer || *TokBuffer == '#' || *TokBuffer == ';') return OK;
|
||||
if (!*DBufValue(&buf) ||
|
||||
*DBufValue(&buf) == '#' ||
|
||||
*DBufValue(&buf) == ';') {
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,19 +433,30 @@ Parser *p;
|
||||
{
|
||||
int r;
|
||||
|
||||
r = ParseToken(p, TokBuffer);
|
||||
if (r) return r;
|
||||
if (!*TokBuffer) return E_EOLN;
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
r = PreserveVar(TokBuffer);
|
||||
r = ParseToken(p, &buf);
|
||||
if (r) return r;
|
||||
if (!DBufLen(&buf)) {
|
||||
DBufFree(&buf);
|
||||
return E_EOLN;
|
||||
}
|
||||
|
||||
r = PreserveVar(DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
if (r) return r;
|
||||
|
||||
/* Keep going... */
|
||||
while(1) {
|
||||
r = ParseToken(p, TokBuffer);
|
||||
r = ParseToken(p, &buf);
|
||||
if (r) return r;
|
||||
if (!*TokBuffer) return OK;
|
||||
r = PreserveVar(TokBuffer);
|
||||
if (!DBufLen(&buf)) {
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
r = PreserveVar(DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
if (r) return r;
|
||||
}
|
||||
}
|
||||
@@ -547,6 +590,15 @@ Value *val;
|
||||
val->v.val = *((int *) v->value);
|
||||
}
|
||||
val->type = v->type;
|
||||
|
||||
/* In "verbose" mode, print attempts to test $RunOff */
|
||||
if (DebugFlag & DB_PRTLINE) {
|
||||
if (v->value == (void *) &RunDisabled) {
|
||||
Eprint("(Security note: $RunOff variable tested.)\n");
|
||||
/* Allow further messages from this line */
|
||||
FreshLine = 1;
|
||||
}
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
/* What version of remind do we have? */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: version.h,v 1.3 1996-09-28 18:17:10 dfs Exp $ */
|
||||
#define VERSION "03.00.15"
|
||||
/* $Id: version.h,v 1.9 2000-02-18 03:46:16 dfs Exp $ */
|
||||
#define VERSION "03.00.21"
|
||||
@@ -2,19 +2,20 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
# TEST-REM
|
||||
#
|
||||
# $Id: test-rem,v 1.1 1996-03-27 03:26:10 dfs Exp $
|
||||
# $Id: test-rem,v 1.4 2000-02-18 03:46:29 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 David F. Skoll
|
||||
# Copyright (C) 1999-2000 Roaring Penguin Software Inc.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
TEST_GETENV="foo bar baz" ; export TEST_GETENV
|
||||
./remind -e -dxte ./test.rem 16 feb 1991 > ./test.out
|
||||
cmp -s ./test.out ./test.cmp
|
||||
../src/remind -e -dxte ../tests/test.rem 16 feb 1991 > ../tests/test.out
|
||||
cmp -s ../tests/test.out ../tests/test.cmp
|
||||
if [ "$?" = "0" ]; then
|
||||
echo "Remind: Acceptance test PASSED"
|
||||
exit 0
|
||||
@@ -631,7 +631,7 @@ set a057 value("a05"+"6")
|
||||
"a05" + "6" => "a056"
|
||||
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
set a058 version()
|
||||
version() => "03.00.15"
|
||||
version() => "03.00.19"
|
||||
set a059 wkday(today())
|
||||
today() => 1991/02/16
|
||||
wkday(1991/02/16) => "Saturday"
|
||||
@@ -772,7 +772,7 @@ dump
|
||||
a048 "foo"
|
||||
a067 "INT"
|
||||
a039 "February"
|
||||
a058 "03.00.15"
|
||||
a058 "03.00.19"
|
||||
a077 "1992 92
|
||||
"
|
||||
a049 21
|
||||
@@ -2,14 +2,15 @@
|
||||
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.3 2000-02-18 03:46: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 David F. Skoll
|
||||
rem Copyright (C) 1999-2000 Roaring Penguin Software Inc.
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
del test.out > nul
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user