mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Compare commits
347 Commits
v3_00_14
...
v3_01_01-F
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
19f03e419a | ||
|
|
5a281d5999 | ||
|
|
d80d14f585 | ||
|
|
520b8511bd | ||
|
|
91627d4f22 | ||
|
|
a21147c7a5 | ||
|
|
d22c1dee49 | ||
|
|
95b0fc7480 | ||
|
|
b40d5d7984 | ||
|
|
2df93c9df3 | ||
|
|
51cdea4b17 | ||
|
|
f229e64744 | ||
|
|
0f15955a41 | ||
|
|
390e6c2eed | ||
|
|
877eaccd6d | ||
|
|
6424e655a1 | ||
|
|
176037082b | ||
|
|
a361c7e426 | ||
|
|
caba0c1695 | ||
|
|
71b3f9fefc | ||
|
|
91f8507e51 | ||
|
|
b68e81a126 | ||
|
|
72658025f1 | ||
|
|
93aea240d6 | ||
|
|
7717b37c36 | ||
|
|
e1b2990fb0 | ||
|
|
e49194c6ee | ||
|
|
79ab150546 | ||
|
|
fc658d15d4 | ||
|
|
76d130ef82 | ||
|
|
3e9a55fbdb | ||
|
|
b071397d46 | ||
|
|
df0dd55635 | ||
|
|
960d08fd24 | ||
|
|
38603916a2 | ||
|
|
0ed1bb4017 | ||
|
|
b4ac0c9f6c | ||
|
|
b136af88ad | ||
|
|
508b5f9aae | ||
|
|
43dff67a60 | ||
|
|
41b850321f | ||
|
|
523237007b | ||
|
|
a3f6c5fd9c | ||
|
|
785cdc8726 | ||
|
|
cbf12b5601 | ||
|
|
1a6d59d9c0 | ||
|
|
23ae054abb | ||
|
|
b57852d3d8 | ||
|
|
c0e1be2f3a | ||
|
|
a442a15a8d | ||
|
|
f91bf634ad | ||
|
|
ce4311c3df | ||
|
|
08e69cb541 | ||
|
|
f8e2eaed73 | ||
|
|
e68a16e73d | ||
|
|
ca191fbd92 | ||
|
|
10276826c0 | ||
|
|
02c9129903 | ||
|
|
04e4c902bd | ||
|
|
0663ae77de | ||
|
|
0c0f5ea093 | ||
|
|
f450fd633e | ||
|
|
59cdd35f61 | ||
|
|
eab67cbda4 | ||
|
|
b3c4a48641 | ||
|
|
07ac8ed341 | ||
|
|
e32aa218fc | ||
|
|
09d11d36c3 | ||
|
|
629e287526 | ||
|
|
e2cd29c824 | ||
|
|
69e597dbe7 | ||
|
|
152e7ebac9 | ||
|
|
8d4451ed85 | ||
|
|
5b8836d4b8 | ||
|
|
be7086579e | ||
|
|
ab16c8f1fe | ||
|
|
6bb71ee5e3 | ||
|
|
ebb4ebea97 | ||
|
|
bf97e62d56 | ||
|
|
47645cddb6 | ||
|
|
cf2af56a05 | ||
|
|
50d1ae42c9 | ||
|
|
9501498a7e | ||
|
|
614ab08099 | ||
|
|
64ee338433 | ||
|
|
43556238d0 | ||
|
|
58d7ac0520 | ||
|
|
0754678ce7 | ||
|
|
2bea176816 | ||
|
|
fa90333219 | ||
|
|
e007b3bc0f | ||
|
|
978e83567b | ||
|
|
d01c1190cd | ||
|
|
0b1855df9b | ||
|
|
951f2785cc | ||
|
|
30090d3f8d | ||
|
|
b6ad67891c | ||
|
|
b61c9db6e6 | ||
|
|
29368ec2ee | ||
|
|
88ff86c910 | ||
|
|
0cc5ae521c | ||
|
|
da1b5ed9a0 | ||
|
|
f786d05c04 | ||
|
|
0bcbe9047e | ||
|
|
585346f753 | ||
|
|
324aa01f80 | ||
|
|
8d0adfa6b7 | ||
|
|
bffae3724c | ||
|
|
a60dc3d1c8 | ||
|
|
df9977d4da | ||
|
|
c31678d28e | ||
|
|
40c1a5a3ee | ||
|
|
846dbd9338 | ||
|
|
2bfed13ebc | ||
|
|
2a5c625a7f | ||
|
|
7660e4a5f1 | ||
|
|
779672a5b5 | ||
|
|
46e9ac86bc | ||
|
|
8d6ca79934 | ||
|
|
2212d1eebe | ||
|
|
c78c284f19 | ||
|
|
b6b30637c6 | ||
|
|
b17198697c | ||
|
|
3ec57a608d | ||
|
|
49cd14846c | ||
|
|
1fd794a5bc | ||
|
|
5848991c27 | ||
|
|
d71f92d034 | ||
|
|
f9719ae7f5 | ||
|
|
4e0be6645a | ||
|
|
da25a18610 | ||
|
|
7bc3aa52d4 | ||
|
|
ca5bb13096 | ||
|
|
da124475fa | ||
|
|
ff04b2e481 | ||
|
|
09d66135b2 | ||
|
|
65cb72f7e8 | ||
|
|
8ae1f93899 | ||
|
|
0017f81da5 | ||
|
|
8c782c5b4e | ||
|
|
ffd283d779 | ||
|
|
b9227e11df | ||
|
|
5a289add73 | ||
|
|
614254a40d | ||
|
|
e31981c4c8 | ||
|
|
eb67e7757b | ||
|
|
ececf4a76e | ||
|
|
0a437420d8 | ||
|
|
b6ddc22c80 | ||
|
|
83d88affb7 | ||
|
|
5ae835db6c | ||
|
|
47e16f5525 | ||
|
|
a6a3dffbd6 | ||
|
|
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 | ||
|
|
4d37a817cd | ||
|
|
072e5ffe3e | ||
|
|
28dfd69147 | ||
|
|
82f15a7d4a | ||
|
|
b681b72515 | ||
|
|
a255620f76 | ||
|
|
0990ec1967 | ||
|
|
28e147ec87 | ||
|
|
2b609c899c | ||
|
|
e10dd441b0 | ||
|
|
754aefebc2 | ||
|
|
79094a2ca5 | ||
|
|
6f03e960e8 | ||
|
|
2dd2a8ad6d | ||
|
|
0050c317f5 | ||
|
|
ab76407b51 | ||
|
|
d65532d43b | ||
|
|
b1928fe92d |
68
COPYRIGHT
68
COPYRIGHT
@@ -1,22 +1,15 @@
|
||||
$Id: COPYRIGHT,v 1.2 1996-05-25 18:14:49 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-2005 Roaring Penguin Software Inc.,
|
||||
except where noted in individual files.
|
||||
|
||||
3. REMIND is distributed under the GNU General Public License,
|
||||
Version 2, WITH THE FOLLOWING IMPORTANT MODIFICATIONS:
|
||||
3. DISTRIBUTION AND USE
|
||||
|
||||
Notwithstanding any statements in the GNU General Public License:
|
||||
|
||||
a) REMIND may not be used under Microsoft Windows (3.0, 3.1, 95
|
||||
or NT) or any future version of Windows. Such use constitutes
|
||||
a violation of copyright.
|
||||
b) REMIND may not be used by Cadabra Design Libraries Inc. or its
|
||||
directors. Such use constitutes a violation of copyright.
|
||||
REMIND may be used and distributed according to the terms of the
|
||||
GNU General Public License, Version 2, which follows:
|
||||
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
@@ -299,56 +292,9 @@ 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>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
David F. Skoll <dfs@roaringpenguin.com>
|
||||
|
||||
Tel. (613) 225-8687
|
||||
Tel. (613) 231-6599
|
||||
http://www.roaringpenguin.com
|
||||
|
||||
|
||||
227
Makefile
227
Makefile
@@ -1,207 +1,32 @@
|
||||
# Makefile for REMIND
|
||||
# $Id: Makefile,v 1.9 1996-05-26 03:17:35 dfs Exp $
|
||||
# Top-level Makefile for Remind.
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# THINGS FOR YOU TO EDIT START BELOW
|
||||
#-----------------------------------------------------------------------------
|
||||
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 on a SYSV system
|
||||
SYSV= -DSYSV
|
||||
|
||||
# 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.14
|
||||
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
|
||||
|
||||
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 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
|
||||
|
||||
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 tests/test.out
|
||||
|
||||
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:
|
||||
tar cvf remind-3.0.14.tar $(MANIFEST)
|
||||
gzip -v -9 remind-3.0.14.tar
|
||||
mv remind-3.0.14.tar.gz remind-3.0.14.tgz
|
||||
|
||||
shar:
|
||||
shar -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
|
||||
|
||||
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.14 Shar "Remind-3.0/Patch-14/part"
|
||||
mv Shar* RELEASE
|
||||
rm -f patch.14*
|
||||
for i in *.1; do nroff -man $$i | sed -e 's/_//g' > `basename $$i .1`.man; done
|
||||
mv *.man RELEASE
|
||||
for i in *.1; do groff -man -Tps $$i > `basename $$i .1`.ps; done
|
||||
mv *.ps RELEASE
|
||||
src/Makefile: src/Makefile.in
|
||||
./configure
|
||||
# DO NOT DELETE
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
#$Id: Makefile_QDOS,v 1.2 1996-03-31 04:08:10 dfs Exp $
|
||||
# Makefile for REMIND for QDOS / SMSQ
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# THINGS FOR YOU TO EDIT START BELOW
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# 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.
|
||||
# QDOS remark: I made it work the following way, and I found it to be working.
|
||||
CC= cc
|
||||
LD= ld
|
||||
|
||||
# Put any additional flags for the C compiler or linker here - if you
|
||||
# are not using gcc, you probably want to remove '-ansi'.
|
||||
# QDOS remark: no -ansi option and no gcc on QDOS / SMSQ
|
||||
CFLAGS= -V -O -DQDOS
|
||||
CDEFS=
|
||||
LDFLAGS= -bufp200K
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
|
||||
# in config_h; then, you should be able to type 'make'.
|
||||
#-----------------------------------------------------------------------------
|
||||
VERSION= 03.00.14
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
OBJS= calendar_o dorem_o dosubst_o expr_o files_o funcs_o globals_o hbcal_o \
|
||||
init_o main_o moon_o omit_o sort_o queue_o token_o trigger_o userfns_o \
|
||||
utils_o var_o
|
||||
|
||||
all: remind rem2ps
|
||||
|
||||
# _c_o:
|
||||
# $(CC) $(UNIX) $(SYSV) -c $(CFLAGS) $(CDEFS) $*_c
|
||||
|
||||
rem2ps: rem2ps_o
|
||||
# $(CC) $(CFLAGS) rem2ps_c
|
||||
$(LD) $(LDFLAGS) -orem2ps rem2ps_o
|
||||
|
||||
remind: $(OBJS)
|
||||
# $(CC) $(CFLAGS) $(SRCS)
|
||||
$(LD) $(LDFLAGS) -oremind $(OBJS) $(MATHLIB)
|
||||
|
||||
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
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *_o *_bak
|
||||
|
||||
clobber:
|
||||
rm -f *_o remind rem2ps test_out *_bak
|
||||
38
README
Normal file
38
README
Normal file
@@ -0,0 +1,38 @@
|
||||
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" (You can supply options; type "./configure --help"
|
||||
for details.)
|
||||
|
||||
4) Type: "make"
|
||||
|
||||
5) Type: "make install" -- you may need to be root to do this.
|
||||
|
||||
Contact info: mailto:dfs@roaringpenguin.com
|
||||
Home page: http://www.roaringpenguin.com/remind
|
||||
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
|
||||
|
||||
59
README.DOS
59
README.DOS
@@ -1,59 +0,0 @@
|
||||
$Id: README.DOS,v 1.1 1996-03-27 03:25:49 dfs Exp $
|
||||
REMIND version 3.0 for MS-DOS
|
||||
|
||||
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
|
||||
|
||||
137
README.OS2
137
README.OS2
@@ -1,137 +0,0 @@
|
||||
$Id: README.OS2,v 1.1 1996-03-27 03:25:49 dfs Exp $
|
||||
REMIND version 3.0 for OS/2
|
||||
|
||||
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
|
||||
versions and bound versions (programs which run under OS/2 and DOS).
|
||||
|
||||
Note that there is also support for OS/2 using the Borland C
|
||||
compiler--see the file README.BCC for details.
|
||||
|
||||
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 - To compile Remind for OS/2, you must use the Microsoft C compiler
|
||||
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
|
||||
|
||||
4 - Examine the file Makefile.os2 and adjust parameters as needed.
|
||||
|
||||
5 - Type:
|
||||
|
||||
make -f Makefile.os2
|
||||
|
||||
to see a list of targets. For example,
|
||||
|
||||
make -f Makefile.os2 emx
|
||||
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
If you define the symbol OS2_POPUP in the OS/2 Makefile, you get
|
||||
"full-screen popups" (as implemented by Russ Herman) for all MSG-
|
||||
and MSF-type reminders. You may or may not like this feature.
|
||||
|
||||
One way of implementing popup reminders is to get the program
|
||||
"pmpopup.exe" from ftp-os2.cdrom.com, and using Remind with the
|
||||
'-k' option as follows from C:\STARTUP.CMD:
|
||||
|
||||
start /pm /inv /n remind "-kstart pmpopup %%s" remfile
|
||||
|
||||
Alternatively, if you have the Vrexx package, you can use this
|
||||
procedure suggested by Norman Walsh:
|
||||
|
||||
Start remind like this in C:\STARTUP.CMD:
|
||||
|
||||
start /pm /inv /n \bin\remind -faz "-kstart popupmsg %%s" .reminders
|
||||
|
||||
The popups are done by POPUPMSG.CMD which looks like this:
|
||||
|
||||
-------------- Cut Here ---------- Cut Here ---------- Cut Here --------
|
||||
/* PopUpMsg */
|
||||
|
||||
'@echo off'
|
||||
|
||||
parse arg theargs
|
||||
if theargs = "" then
|
||||
theargs = "Empty message"
|
||||
|
||||
call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
|
||||
initcode = VInit()
|
||||
if initcode = 'ERROR' then signal CLEANUP
|
||||
|
||||
signal on failure name CLEANUP
|
||||
signal on halt name CLEANUP
|
||||
signal on syntax name CLEANUP
|
||||
|
||||
/* example VMsgBox call */
|
||||
|
||||
msg.0 = 1
|
||||
msg.1 = theargs
|
||||
|
||||
call VDialogPos 50, 50
|
||||
call VMsgBox 'Popup Message', msg, 1
|
||||
|
||||
/* end of CMD file */
|
||||
|
||||
CLEANUP:
|
||||
call VExit
|
||||
|
||||
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
|
||||
|
||||
139
README.UNIX
139
README.UNIX
@@ -1,139 +0,0 @@
|
||||
$Id: README.UNIX,v 1.1 1996-03-27 03:25:49 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
|
||||
BSD 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.
|
||||
|
||||
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.
|
||||
|
||||
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.2 1996-03-31 04:08:11 dfs Exp $
|
||||
REMIND version 3.0.14 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
|
||||
15
WINDOWS
Normal file
15
WINDOWS
Normal file
@@ -0,0 +1,15 @@
|
||||
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.
|
||||
@@ -1,7 +0,0 @@
|
||||
IGNORE=154
|
||||
IGNORE=161
|
||||
IGNORE=100
|
||||
IGNORE=85
|
||||
LINKOPT SC
|
||||
LINKOPT SD
|
||||
LINKOPT NOICONS
|
||||
63
amiga.c
63
amiga.c
@@ -1,63 +0,0 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* AMIGA.C */
|
||||
/* */
|
||||
/* Support functions for AmigaDOS */
|
||||
/* */
|
||||
/* 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 */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static char const RCSID[] = "$Id: amiga.c,v 1.1 1996-03-31 04:01:53 dfs Exp $";
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <exec/types.h>
|
||||
#include <dos/dos.h>
|
||||
#include <dos/dosextens.h>
|
||||
|
||||
#include <proto/dos.h>
|
||||
|
||||
#include "version.h" /* Hopefully this will define VERSION as a string */
|
||||
|
||||
#ifdef __SASC_60
|
||||
/* AmigaDOS 2.04 compatible version string for "version" utility */
|
||||
const static char ver_string[] = "$VER: remind "VERSION" "__AMIGADATE__;
|
||||
#endif
|
||||
|
||||
void sleep(int dt)
|
||||
{
|
||||
register long Ticks;
|
||||
|
||||
if (dt != 0) {
|
||||
Ticks = 50L * dt;
|
||||
Delay(Ticks);
|
||||
}
|
||||
}
|
||||
|
||||
void execvp(char *name, char **argvec)
|
||||
{
|
||||
char *cmdline;
|
||||
int i,l;
|
||||
|
||||
l = strlen(name)+2;
|
||||
i=1;
|
||||
while (argvec[i] != 0L) {
|
||||
l += strlen(argvec[i])+1;
|
||||
i++;
|
||||
};
|
||||
cmdline = malloc(l+1);
|
||||
if (cmdline == 0L) return;
|
||||
strcpy(cmdline,name);
|
||||
i=1;
|
||||
while (argvec[i] != 0L) {
|
||||
strcat(cmdline," ");
|
||||
strcat(cmdline,argvec[i]);
|
||||
i++;
|
||||
};
|
||||
system(cmdline);
|
||||
free(cmdline);
|
||||
}
|
||||
872
build.tk
Executable file
872
build.tk
Executable file
@@ -0,0 +1,872 @@
|
||||
#!/bin/sh
|
||||
# -*-Mode: TCL;-*-
|
||||
|
||||
#--------------------------------------------------------------
|
||||
# BUILD.TK
|
||||
#
|
||||
# A cheesy graphical front-end for building and installing REMIND.
|
||||
#
|
||||
# This file is part of REMIND.
|
||||
# Copyright (C) 1992-1999 David F. Skoll
|
||||
# Copyright (C) 1999-2000 Roaring Penguin Software Inc.
|
||||
#
|
||||
#--------------------------------------------------------------
|
||||
|
||||
# the next line restarts using wish \
|
||||
exec wish "$0" "$@"
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: SetConfigDefaults
|
||||
# %ARGUMENTS:
|
||||
# None
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Sets up default values for various parameters.
|
||||
#***********************************************************************
|
||||
proc SetConfigDefaults {} {
|
||||
global Config
|
||||
set Config(LAT_DEG) 45
|
||||
set Config(LAT_MIN) 24
|
||||
set Config(LON_DEG) 75
|
||||
set Config(LON_MIN) 39
|
||||
set Config(LOCATION) "Ottawa"
|
||||
set Config(DEFAULT_PAGE) "Letter"
|
||||
set Config(DATESEP) "-"
|
||||
set Config(TIMESEP) ":"
|
||||
set Config(ISOLATIN1) 0
|
||||
set Config(IBMEXTENDED) 0
|
||||
set Config(ISOLATIN2) 0
|
||||
set Config(IBM852) 0
|
||||
set Config(NORTHERN_HEMISPHERE) 1
|
||||
set Config(WESTERN_HEMISPHERE) 1
|
||||
set Config(LANGUAGE) "English"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: Bail
|
||||
# %ARGUMENTS:
|
||||
# msg -- a message
|
||||
# %RETURNS:
|
||||
# Does not return
|
||||
# %DESCRIPTION:
|
||||
# Pops up an error dialog; then calls exit.
|
||||
#***********************************************************************
|
||||
proc Bail { msg } {
|
||||
tk_dialog .err "Remind Configuration Error" $msg error 0 "Bummer"
|
||||
exit 1
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: CheckSanity
|
||||
# %ARGUMENTS:
|
||||
# None
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Checks sanity of install dir -- checks for critical files,
|
||||
# warns user if something looks wrong.
|
||||
#***********************************************************************
|
||||
proc CheckSanity {} {
|
||||
if {![file executable ./configure]} {
|
||||
wm withdraw .
|
||||
Bail "I can't seem to execute the file ./configure -- make sure you have all required files and are running this from the top-level Remind directory"
|
||||
}
|
||||
if {![file readable ./src/custom.h.in]} {
|
||||
wm withdraw .
|
||||
Bail "I can't seem to find the file src/custom.h.in -- make sure you have all required files and are running this from the top-level Remind directory"
|
||||
}
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: CreateMainDialog
|
||||
# %ARGUMENTS:
|
||||
# None
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Creates and displays the main configuration dialog
|
||||
#***********************************************************************
|
||||
proc CreateMainDialog {} {
|
||||
global Instdir Loc Options
|
||||
|
||||
wm title . "Remind Configuration"
|
||||
wm iconname . "Remind Config"
|
||||
|
||||
doLogo
|
||||
destroy .c
|
||||
update idletasks
|
||||
|
||||
SetConfigDefaults
|
||||
tabnotebook_create .tn
|
||||
|
||||
set Instdir [tabnotebook_page .tn "Installation Directories"]
|
||||
CreateInstallDirDialog $Instdir
|
||||
|
||||
set Loc [tabnotebook_page .tn "Location"]
|
||||
CreateLocationDialog $Loc
|
||||
|
||||
set Options [tabnotebook_page .tn "Options"]
|
||||
CreateOptionsDialog $Options
|
||||
pack .tn -side top -expand 1 -fill both
|
||||
|
||||
frame .buttons
|
||||
button .build -text "Build Remind" -command BuildRemind
|
||||
button .cancel -text "Cancel" -command exit
|
||||
|
||||
pack .build .cancel -in .buttons -side left -expand 1 -fill both
|
||||
pack .buttons -side top -expand 0 -fill x
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: CreateInstallDirDialog
|
||||
# %ARGUMENTS:
|
||||
# w -- frame containing widgets
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Creates the "installation directories" dialog.
|
||||
#***********************************************************************
|
||||
proc CreateInstallDirDialog { w } {
|
||||
label $w.binlabel -text "Location for programs: "
|
||||
entry $w.bin -width 30
|
||||
$w.bin insert end "/usr/local/bin"
|
||||
|
||||
label $w.manlabel -text "Location for man pages: "
|
||||
entry $w.man -width 30
|
||||
$w.man insert end "/usr/local/man"
|
||||
|
||||
text $w.blurb -width 1 -height 5 -wrap word -relief flat -takefocus 0
|
||||
$w.blurb insert end "\n(Tabbed-notebook Tcl code taken from \"Effective Tcl/Tk Programming\" by Mark Harrison and Michael McLennan, Addison-Wesley Professional Computing Series.)"
|
||||
$w.blurb configure -state disabled
|
||||
# Disable all text-window behaviour
|
||||
bindtags $w.blurb {NoSuchTag}
|
||||
grid $w.binlabel -row 0 -column 0 -sticky e
|
||||
grid $w.bin -row 0 -column 1 -sticky nsew
|
||||
grid $w.manlabel -row 1 -column 0 -sticky e
|
||||
grid $w.man -row 1 -column 1 -sticky nsew
|
||||
grid $w.blurb - -sticky nsew
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: CreateLocationDialog
|
||||
# %ARGUMENTS:
|
||||
# w -- frame containing dialog
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Creates the location dialog
|
||||
#***********************************************************************
|
||||
proc CreateLocationDialog { w } {
|
||||
global Config
|
||||
scale $w.latdeg -label "Latitude (degrees)" -orient horizontal \
|
||||
-from 0 -to 89 -length 300 -variable Config(LAT_DEG)
|
||||
scale $w.latmin -label "Latitude (minutes)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LAT_MIN)
|
||||
scale $w.londeg -label "Longitude (degrees)" -orient horizontal \
|
||||
-from 0 -to 179 -length 300 -variable Config(LON_DEG)
|
||||
scale $w.lonmin -label "Longtude (minutes)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LON_MIN)
|
||||
|
||||
radiobutton $w.north -text "Northern Hemisphere" \
|
||||
-variable Config(NORTHERN_HEMISPHERE) -value 1
|
||||
radiobutton $w.south -text "Southern Hemisphere" \
|
||||
-variable Config(NORTHERN_HEMISPHERE) -value 0
|
||||
radiobutton $w.west -text "Western Hemisphere" \
|
||||
-variable Config(WESTERN_HEMISPHERE) -value 1
|
||||
radiobutton $w.east -text "Eastern Hemisphere" \
|
||||
-variable Config(WESTERN_HEMISPHERE) -value 0
|
||||
|
||||
label $w.loclab -text "City or Town: "
|
||||
entry $w.location -width 20
|
||||
$w.location insert end $Config(LOCATION)
|
||||
grid $w.latdeg -
|
||||
grid $w.latmin -
|
||||
grid $w.londeg -
|
||||
grid $w.lonmin -
|
||||
|
||||
grid $w.north $w.west
|
||||
grid $w.south $w.east
|
||||
grid $w.loclab -sticky e
|
||||
grid $w.location -sticky nsew -row 6 -column 1
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: CreateOptionsDialog
|
||||
# %ARGUMENTS:
|
||||
# w -- frame containing dialog
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Creates the options dialog
|
||||
#***********************************************************************
|
||||
proc CreateOptionsDialog { w } {
|
||||
global Config
|
||||
|
||||
label $w.pagelabel -text "Default page size: "
|
||||
menubutton $w.page -text $Config(DEFAULT_PAGE) \
|
||||
-indicatoron 1 -relief raised \
|
||||
-menu $w.page.menu
|
||||
menu $w.page.menu -tearoff 0
|
||||
$w.page.menu add command -label "Letter" \
|
||||
-command "$w.page configure -text Letter"
|
||||
$w.page.menu add command -label "A4" -command "$w.page configure -text A4"
|
||||
|
||||
grid configure $w.pagelabel -row 0 -column 0 -sticky e
|
||||
grid configure $w.page -row 0 -column 1 -sticky nsew
|
||||
|
||||
label $w.datelabel -text "Default date separator: "
|
||||
menubutton $w.date -text $Config(DATESEP) -indicatoron 1 -relief raised \
|
||||
-menu $w.date.menu
|
||||
menu $w.date.menu -tearoff 0
|
||||
$w.date.menu add command -label "/" -command "$w.date configure -text /"
|
||||
$w.date.menu add command -label "-" -command "$w.date configure -text -"
|
||||
|
||||
grid configure $w.datelabel -row 1 -column 0 -sticky e
|
||||
grid configure $w.date -row 1 -column 1 -sticky nsew
|
||||
|
||||
label $w.timelabel -text "Default time separator: "
|
||||
menubutton $w.time -text $Config(TIMESEP) -indicatoron 1 -relief raised \
|
||||
-menu $w.time.menu
|
||||
menu $w.time.menu -tearoff 0
|
||||
$w.time.menu add command -label ":" -command "$w.time configure -text :"
|
||||
$w.time.menu add command -label "." -command "$w.time configure -text ."
|
||||
|
||||
grid configure $w.timelabel -row 2 -column 0 -sticky e
|
||||
grid configure $w.time -row 2 -column 1 -sticky nsew
|
||||
|
||||
label $w.charlabel -text "Character set: "
|
||||
menubutton $w.char -text "ISO 8859-1" -indicatoron 1 -relief raised \
|
||||
-menu $w.char.menu
|
||||
menu $w.char.menu -tearoff 0
|
||||
$w.char.menu add command -label "ISO 8859-1" -command "$w.char configure -text {ISO 8859-1}"
|
||||
$w.char.menu add command -label "ISO 8859-2" -command "$w.char configure -text {ISO 8859-2}"
|
||||
$w.char.menu add command -label "IBM Extended" -command "$w.char configure -text {IBM Extended}"
|
||||
$w.char.menu add command -label "IBM CPI-852" -command "$w.char configure -text {ISO 8859-2}"
|
||||
$w.char.menu add command -label "Plain ASCII" -command "$w.char configure -text {Plain ASCII}"
|
||||
|
||||
grid configure $w.charlabel -row 3 -column 0 -sticky e
|
||||
grid configure $w.char -row 3 -column 1 -sticky nsew
|
||||
|
||||
label $w.langlabel -text "Language: "
|
||||
menubutton $w.lang -text $Config(LANGUAGE) -indicatoron 1 -relief raised \
|
||||
-menu $w.lang.menu
|
||||
menu $w.lang.menu -tearoff 0
|
||||
foreach lang {
|
||||
"Brazilian Portuguese"
|
||||
"Danish"
|
||||
"Dutch"
|
||||
"English"
|
||||
"Finnish"
|
||||
"French"
|
||||
"German"
|
||||
"Italian"
|
||||
"Norwegian"
|
||||
"Polish"
|
||||
"Romanian"
|
||||
"Spanish"
|
||||
"Icelandic"
|
||||
} {
|
||||
$w.lang.menu add command -label $lang -command [list $w.lang configure -text $lang]
|
||||
}
|
||||
|
||||
grid configure $w.langlabel -row 4 -column 0 -sticky e
|
||||
grid configure $w.lang -row 4 -column 1 -sticky nsew
|
||||
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: BuildRemind
|
||||
# %ARGUMENTS:
|
||||
# None
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Builds Remind by:
|
||||
# -- creating custom.h from custom.h.in
|
||||
# -- running ./configure
|
||||
# -- running make
|
||||
#***********************************************************************
|
||||
proc BuildRemind {} {
|
||||
pack forget .tn
|
||||
pack forget .buttons
|
||||
wm title . "Remind Configuration Status"
|
||||
text .msgs -width 130 -height 35 -wrap char -yscrollcommand ".sb set"
|
||||
scrollbar .sb -orient vertical -command ".msgs yview"
|
||||
|
||||
.msgs tag configure green -foreground #005500
|
||||
.msgs tag configure red -foreground #990000
|
||||
pack .msgs -side left -expand 1 -fill both
|
||||
pack .sb -side left -expand 0 -fill y
|
||||
|
||||
update
|
||||
|
||||
.msgs insert end "\n>>> Creating src/custom.h...\n\n" green
|
||||
CreateCustomH
|
||||
.msgs insert end ">>> Calling `./configure'...\n\n" green
|
||||
CallConfigure
|
||||
.msgs insert end ">>> Calling `make'...\n\n" green
|
||||
CallMake
|
||||
.msgs insert end "\n----------------------------------------------\n\n"
|
||||
.msgs insert end "Remind" red
|
||||
.msgs insert end " has been built. To install it, type:\n\n"
|
||||
.msgs insert end "make install\n\n" green
|
||||
.msgs insert end "from the top-level "
|
||||
.msgs insert end "Remind" red
|
||||
.msgs insert end " directory. (You may need to be root.)\n\n"
|
||||
.msgs insert end "After it's installed, create an empty file called:\n"
|
||||
.msgs insert end " \$HOME/.reminders\n" green
|
||||
.msgs insert end "and type "
|
||||
.msgs insert end "tkremind" green
|
||||
.msgs insert end " for a nice easy introduction to "
|
||||
.msgs insert end "Remind.\n\n" red
|
||||
.msgs insert end "Press me to exit --> "
|
||||
button .msgs.ok -text "OK" -command "exit"
|
||||
.msgs window create end -window .msgs.ok
|
||||
.msgs see end
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: RunCommand
|
||||
# %ARGUMENTS:
|
||||
# cmd -- shell command to run
|
||||
# %RETURNS:
|
||||
# Return code of command
|
||||
# %DESCRIPTION:
|
||||
# Runs a command putting output into ".msgs"
|
||||
#***********************************************************************
|
||||
proc RunCommand { cmd } {
|
||||
global CmdDone
|
||||
|
||||
set CmdDone 0
|
||||
|
||||
.msgs insert end "$cmd\n" red
|
||||
|
||||
set problem [catch {set CmdFile [open "|$cmd" "r"]} err]
|
||||
if {$problem} {
|
||||
Bail "Error running command `$cmd': $err"
|
||||
}
|
||||
|
||||
fconfigure $CmdFile -blocking 0
|
||||
|
||||
fileevent $CmdFile readable "CommandReadable $CmdFile"
|
||||
vwait CmdDone
|
||||
|
||||
set problem [catch {close $CmdFile} err]
|
||||
if {$problem} {
|
||||
Bail "Error running command `$cmd': $err"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: CommandReadable
|
||||
# %ARGUMENTS:
|
||||
# f -- file to read from
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Reads characters from command pipelin and appends them to .msg.
|
||||
#***********************************************************************
|
||||
proc CommandReadable { f } {
|
||||
global CmdDone
|
||||
set stuff [read $f]
|
||||
.msgs insert end $stuff
|
||||
.msgs see end
|
||||
if {[eof $f]} {
|
||||
set CmdDone 1
|
||||
}
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: CallConfigure
|
||||
# %ARGUMENTS:
|
||||
# None
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Executes "./configure" with appropriate arguments
|
||||
# %PRECONDITIONS:
|
||||
# Any preconditions
|
||||
# %POSTCONDITIONS:
|
||||
# Any postconditions
|
||||
# %SIDE EFFECTS:
|
||||
# Any side effects
|
||||
#***********************************************************************
|
||||
proc CallConfigure {} {
|
||||
global Instdir
|
||||
set bin [$Instdir.bin get]
|
||||
set man [$Instdir.man get]
|
||||
RunCommand "./configure --bindir=$bin --mandir=$man"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: CreateCustomH
|
||||
# %ARGUMENTS:
|
||||
# None
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Creates "src/custom.h" from "src/custom.h.in"
|
||||
#***********************************************************************
|
||||
proc CreateCustomH {} {
|
||||
global Loc Options Config
|
||||
set problem [catch {set in [open "src/custom.h.in" "r"]} err]
|
||||
if {$problem} {
|
||||
Bail "Can't read src/custom.h.in: $err"
|
||||
}
|
||||
set problem [catch {set out [open "src/custom.h" "w"]} err]
|
||||
if {$problem} {
|
||||
Bail "Can't write src/custom.h: $err"
|
||||
}
|
||||
|
||||
# Retrieve values
|
||||
# The latitude/longitude ones are tied to the scales; we can't
|
||||
# modify them willy-nilly
|
||||
set LAT_DEG $Config(LAT_DEG)
|
||||
set LAT_MIN $Config(LAT_MIN)
|
||||
set LON_DEG $Config(LON_DEG)
|
||||
set LON_MIN $Config(LON_MIN)
|
||||
if {!$Config(NORTHERN_HEMISPHERE)} {
|
||||
set LAT_DEG "-$LAT_DEG"
|
||||
set LAT_MIN "-$LAT_MIN"
|
||||
}
|
||||
if {!$Config(WESTERN_HEMISPHERE)} {
|
||||
set LON_DEG "-$LON_DEG"
|
||||
set LON_MIN "-$LON_MIN"
|
||||
}
|
||||
set Config(LOCATION) [$Loc.location get]
|
||||
|
||||
switch -- [$Options.page cget -text] {
|
||||
"A4" {
|
||||
set Config(DEFAULT_PAGE) "{\"A4\", 595, 842}"
|
||||
}
|
||||
default {
|
||||
set Config(DEFAULT_PAGE) "{\"Letter\", 612, 792}"
|
||||
}
|
||||
}
|
||||
set Config(DATESEP) [$Options.date cget -text]
|
||||
set Config(TIMESEP) [$Options.time cget -text]
|
||||
|
||||
switch -- [$Options.char cget -text] {
|
||||
"ISO 8859-1" {
|
||||
set Config(ISOLATIN1) 1
|
||||
}
|
||||
"ISO 8859-2" {
|
||||
set Config(ISOLATIN2) 1
|
||||
}
|
||||
"IBM CPI-852" {
|
||||
set Config(IBM852) 1
|
||||
}
|
||||
"IBM Extended" {
|
||||
set Config(IBMEXTENDED) 1
|
||||
}
|
||||
}
|
||||
|
||||
while {[gets $in line] != -1} {
|
||||
switch -glob -- $line {
|
||||
"#define LAT_DEG *" {
|
||||
puts $out "#define LAT_DEG $LAT_DEG"
|
||||
.msgs insert end "#define LAT_DEG $LAT_DEG\n"
|
||||
}
|
||||
"#define LAT_MIN *" {
|
||||
puts $out "#define LAT_MIN $LAT_MIN"
|
||||
.msgs insert end "#define LAT_MIN $LAT_MIN\n"
|
||||
}
|
||||
"#define LON_DEG *" {
|
||||
puts $out "#define LON_DEG $LON_DEG"
|
||||
.msgs insert end "#define LON_DEG $LON_DEG\n"
|
||||
}
|
||||
"#define LON_MIN *" {
|
||||
puts $out "#define LON_MIN $LON_MIN"
|
||||
.msgs insert end "#define LON_MIN $LON_MIN\n"
|
||||
}
|
||||
"#define LOCATION *" {
|
||||
puts $out "#define LOCATION \"$Config(LOCATION)\""
|
||||
.msgs insert end "#define LOCATION \"$Config(LOCATION)\"\n"
|
||||
}
|
||||
"#define DEFAULT_PAGE *" {
|
||||
puts $out "#define DEFAULT_PAGE $Config(DEFAULT_PAGE)"
|
||||
.msgs insert end "#define DEFAULT_PAGE $Config(DEFAULT_PAGE)\n"
|
||||
}
|
||||
"#define DATESEP *" {
|
||||
puts $out "#define DATESEP '$Config(DATESEP)'"
|
||||
.msgs insert end "#define DATESEP '$Config(DATESEP)'\n"
|
||||
}
|
||||
"#define TIMESEP *" {
|
||||
puts $out "#define TIMESEP '$Config(TIMESEP)'"
|
||||
.msgs insert end "#define TIMESEP '$Config(TIMESEP)'\n"
|
||||
}
|
||||
"#define ISOLATIN1 *" {
|
||||
puts $out "#define ISOLATIN1 $Config(ISOLATIN1)"
|
||||
.msgs insert end "#define ISOLATIN1 $Config(ISOLATIN1)\n"
|
||||
}
|
||||
"#define ISOLATIN2 *" {
|
||||
puts $out "#define ISOLATIN2 $Config(ISOLATIN2)"
|
||||
.msgs insert end "#define ISOLATIN2 $Config(ISOLATIN2)\n"
|
||||
}
|
||||
"#define IBM852 *" {
|
||||
puts $out "#define IBM852 $Config(IBM852)"
|
||||
.msgs insert end "#define IBM852 $Config(IBM852)\n"
|
||||
}
|
||||
"#define IBMEXTENDED *" {
|
||||
puts $out "#define IBMEXTENDED $Config(IBMEXTENDED)"
|
||||
.msgs insert end "#define IBMEXTENDED $Config(IBMEXTENDED)\n"
|
||||
}
|
||||
default {
|
||||
puts $out $line
|
||||
}
|
||||
}
|
||||
}
|
||||
close $in
|
||||
close $out
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: CallMake
|
||||
# %ARGUMENTS:
|
||||
# None
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Runs "make" with appropriate language definitions
|
||||
#***********************************************************************
|
||||
proc CallMake {} {
|
||||
global Options
|
||||
set lang [$Options.lang cget -text]
|
||||
switch -- $lang {
|
||||
"German" { set lang GERMAN }
|
||||
"Dutch" { set lang DUTCH }
|
||||
"Finnish" { set lang FINNISH }
|
||||
"French" { set lang FRENCH }
|
||||
"Norwegian" { set lang NORWEGIAN }
|
||||
"Danish" { set lang DANISH }
|
||||
"Polish" { set lang POLISH }
|
||||
"Brazilian Portuguese" { set lang BRAZPORT }
|
||||
"Italian" { set lang ITALIAN }
|
||||
"Romanian" { set lang ROMANIAN }
|
||||
"Spanish" { set lang SPANISH }
|
||||
"Icelandic" { set lang ICELANDIC }
|
||||
default { set lang ENGLISH }
|
||||
}
|
||||
RunCommand "make \"LANGDEF=-DLANG=$lang\""
|
||||
}
|
||||
|
||||
|
||||
# Tabbed notebook code from "Effective Tcl/Tk Programming"
|
||||
# ----------------------------------------------------------------------
|
||||
# EXAMPLE: tabnotebook that can dial up pages
|
||||
# ----------------------------------------------------------------------
|
||||
# Effective Tcl/Tk Programming
|
||||
# Mark Harrison, DSC Communications Corp.
|
||||
# Michael McLennan, Bell Labs Innovations for Lucent Technologies
|
||||
# Addison-Wesley Professional Computing Series
|
||||
# ======================================================================
|
||||
# Copyright (c) 1996-1997 Lucent Technologies Inc. and Mark Harrison
|
||||
# ======================================================================
|
||||
|
||||
option add *Tabnotebook.tabs.background #666666 widgetDefault
|
||||
option add *Tabnotebook.margin 6 widgetDefault
|
||||
option add *Tabnotebook.tabColor #a6a6a6 widgetDefault
|
||||
option add *Tabnotebook.activeTabColor #d9d9d9 widgetDefault
|
||||
option add *Tabnotebook.tabFont \
|
||||
-*-helvetica-bold-r-normal--*-120-* widgetDefault
|
||||
|
||||
proc tabnotebook_create {win} {
|
||||
global tnInfo
|
||||
|
||||
frame $win -class Tabnotebook
|
||||
canvas $win.tabs -highlightthickness 0
|
||||
pack $win.tabs -fill x
|
||||
|
||||
notebook_create $win.notebook
|
||||
pack $win.notebook -expand yes -fill both
|
||||
|
||||
set tnInfo($win-tabs) ""
|
||||
set tnInfo($win-current) ""
|
||||
set tnInfo($win-pending) ""
|
||||
return $win
|
||||
}
|
||||
|
||||
proc tabnotebook_page {win name} {
|
||||
global tnInfo
|
||||
|
||||
set page [notebook_page $win.notebook $name]
|
||||
lappend tnInfo($win-tabs) $name
|
||||
|
||||
if {$tnInfo($win-pending) == ""} {
|
||||
set id [after idle [list tabnotebook_refresh $win]]
|
||||
set tnInfo($win-pending) $id
|
||||
}
|
||||
return $page
|
||||
}
|
||||
|
||||
proc tabnotebook_refresh {win} {
|
||||
global tnInfo
|
||||
|
||||
$win.tabs delete all
|
||||
|
||||
set margin [option get $win margin Margin]
|
||||
set color [option get $win tabColor Color]
|
||||
set font [option get $win tabFont Font]
|
||||
set x 2
|
||||
set maxh 0
|
||||
|
||||
foreach name $tnInfo($win-tabs) {
|
||||
set id [$win.tabs create text \
|
||||
[expr $x+$margin+2] [expr -0.5*$margin] \
|
||||
-anchor sw -text $name -font $font \
|
||||
-tags [list $name]]
|
||||
|
||||
set bbox [$win.tabs bbox $id]
|
||||
set wd [expr [lindex $bbox 2]-[lindex $bbox 0]]
|
||||
set ht [expr [lindex $bbox 3]-[lindex $bbox 1]]
|
||||
if {$ht > $maxh} {
|
||||
set maxh $ht
|
||||
}
|
||||
|
||||
$win.tabs create polygon 0 0 $x 0 \
|
||||
[expr $x+$margin] [expr -$ht-$margin] \
|
||||
[expr $x+$margin+$wd] [expr -$ht-$margin] \
|
||||
[expr $x+$wd+2*$margin] 0 \
|
||||
2000 0 2000 10 0 10 \
|
||||
-outline black -fill $color \
|
||||
-tags [list $name tab tab-$name]
|
||||
|
||||
$win.tabs raise $id
|
||||
|
||||
$win.tabs bind $name <ButtonPress-1> \
|
||||
[list tabnotebook_display $win $name]
|
||||
|
||||
set x [expr $x+$wd+2*$margin]
|
||||
}
|
||||
set height [expr $maxh+2*$margin]
|
||||
$win.tabs move all 0 $height
|
||||
|
||||
$win.tabs configure -width $x -height [expr $height+4]
|
||||
|
||||
if {$tnInfo($win-current) != ""} {
|
||||
tabnotebook_display $win $tnInfo($win-current)
|
||||
} else {
|
||||
tabnotebook_display $win [lindex $tnInfo($win-tabs) 0]
|
||||
}
|
||||
set tnInfo($win-pending) ""
|
||||
}
|
||||
|
||||
proc tabnotebook_display {win name} {
|
||||
global tnInfo
|
||||
|
||||
notebook_display $win.notebook $name
|
||||
|
||||
set normal [option get $win tabColor Color]
|
||||
$win.tabs itemconfigure tab -fill $normal
|
||||
|
||||
set active [option get $win activeTabColor Color]
|
||||
$win.tabs itemconfigure tab-$name -fill $active
|
||||
$win.tabs raise $name
|
||||
|
||||
set tnInfo($win-current) $name
|
||||
}
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# EXAMPLE: simple notebook that can dial up pages
|
||||
# ----------------------------------------------------------------------
|
||||
# Effective Tcl/Tk Programming
|
||||
# Mark Harrison, DSC Communications Corp.
|
||||
# Michael McLennan, Bell Labs Innovations for Lucent Technologies
|
||||
# Addison-Wesley Professional Computing Series
|
||||
# ======================================================================
|
||||
# Copyright (c) 1996-1997 Lucent Technologies Inc. and Mark Harrison
|
||||
# ======================================================================
|
||||
|
||||
option add *Notebook.borderWidth 2 widgetDefault
|
||||
option add *Notebook.relief sunken widgetDefault
|
||||
|
||||
proc notebook_create {win} {
|
||||
global nbInfo
|
||||
|
||||
frame $win -class Notebook
|
||||
pack propagate $win 0
|
||||
|
||||
set nbInfo($win-count) 0
|
||||
set nbInfo($win-pages) ""
|
||||
set nbInfo($win-current) ""
|
||||
return $win
|
||||
}
|
||||
|
||||
proc notebook_page {win name} {
|
||||
global nbInfo
|
||||
|
||||
set page "$win.page[incr nbInfo($win-count)]"
|
||||
lappend nbInfo($win-pages) $page
|
||||
set nbInfo($win-page-$name) $page
|
||||
|
||||
frame $page
|
||||
|
||||
if {$nbInfo($win-count) == 1} {
|
||||
after idle [list notebook_display $win $name]
|
||||
}
|
||||
return $page
|
||||
}
|
||||
|
||||
proc notebook_display {win name} {
|
||||
global nbInfo
|
||||
|
||||
set page ""
|
||||
if {[info exists nbInfo($win-page-$name)]} {
|
||||
set page $nbInfo($win-page-$name)
|
||||
} elseif {[winfo exists $win.page$name]} {
|
||||
set page $win.page$name
|
||||
}
|
||||
if {$page == ""} {
|
||||
error "bad notebook page \"$name\""
|
||||
}
|
||||
|
||||
notebook_fix_size $win
|
||||
|
||||
if {$nbInfo($win-current) != ""} {
|
||||
pack forget $nbInfo($win-current)
|
||||
}
|
||||
pack $page -expand yes -fill both
|
||||
set nbInfo($win-current) $page
|
||||
}
|
||||
|
||||
proc notebook_fix_size {win} {
|
||||
global nbInfo
|
||||
|
||||
update idletasks
|
||||
|
||||
set maxw 0
|
||||
set maxh 0
|
||||
foreach page $nbInfo($win-pages) {
|
||||
set w [winfo reqwidth $page]
|
||||
if {$w > $maxw} {
|
||||
set maxw $w
|
||||
}
|
||||
set h [winfo reqheight $page]
|
||||
if {$h > $maxh} {
|
||||
set maxh $h
|
||||
}
|
||||
}
|
||||
set bd [$win cget -borderwidth]
|
||||
set maxw [expr $maxw+2*$bd]
|
||||
set maxh [expr $maxh+2*$bd]
|
||||
$win configure -width $maxw -height $maxh
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: drawLogo
|
||||
# %ARGUMENTS:
|
||||
# c -- canvas to draw logo in
|
||||
# bg -- background color of canvas
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Draws Roaring Penguin logo in a Tcl canvas
|
||||
#***********************************************************************
|
||||
proc drawLogo { c bg } {
|
||||
set logo_objs {
|
||||
{polygon 558 0 557 0 556 0 554 0 551 0 550 0 549 0 547 0 546 0 544 0 542 1 539 1 537 2 535 3 534 3 533 3 532 3 530 4 528 5 525 6 523 6 522 7 521 7 519 8 516 9 514 10 512 11 510 11 509 12 507 12 507 13 506 13 505 12 502 12 500 11 498 11 497 11 496 11 495 11 493 11 491 12 489 12 488 12 488 13 487 13 485 14 483 15 482 16 481 17 480 19 478 21 477 22 476 23 476 24 475 25 474 26 473 28 472 30 470 33 467 37 464 41 462 45 459 48 457 52 456 54 455 55 454 56 454 57 453 58 452 59 452 61 451 63 449 65 448 68 447 71 445 74 443 77 442 81 440 86 438 90 436 95 435 99 434 103 433 105 433 106 432 107 432 108 432 109 431 111 431 113 430 116 429 121 428 125 427 130 425 135 425 138 424 140 424 142 424 143 424 144 424 145 423 147 423 149 423 152 422 157 421 162 421 167 420 172 420 176 419 180 419 183 419 187 419 189 419 192 418 195 418 196 418 198 418 199 417 199 416 199 415 199 414 199 413 200 412 200 411 200 411 201 410 201 410 202 409 202 409 203 408 203 407 204 407 205 408 205 410 206 413 208 416 209 418 210 419 210 419 211 420 211 421 211 422 212 424 212 426 212 429 213 432 213 435 214 439 214 442 214 444 214 445 214 446 214 447 214 449 214 452 214 457 214 461 214 464 214 466 214 467 214 468 214 469 214 470 214 472 214 474 214 477 213 482 213 486 213 490 212 494 212 497 212 500 211 502 211 505 211 507 211 508 210 509 210 510 210 510 208 511 206 512 203 513 198 514 194 515 189 516 185 517 182 517 179 518 178 518 177 518 176 518 175 519 174 519 171 520 169 520 166 521 163 522 160 522 157 523 153 524 149 524 144 525 139 526 135 526 132 526 130 526 129 526 128 526 127 527 127 527 126 527 124 527 122 527 119 527 115 527 110 527 106 527 102 527 99 527 96 527 95 527 94 527 93 527 92 527 91 527 88 527 85 526 81 526 77 525 72 524 67 524 64 523 60 522 57 521 54 521 51 520 49 520 47 519 45 519 44 518 43 520 42 521 42 523 41 524 40 525 40 526 40 527 40 528 39 530 39 532 39 533 38 534 38 536 38 538 37 539 37 540 37 541 36 543 35 544 34 545 33 546 32 545 32 543 33 542 33 541 34 540 34 539 34 537 34 536 34 534 34 532 34 531 34 530 34 529 34 527 33 525 33 524 33 523 33 522 33 520 32 518 32 517 32 515 31 514 31 514 30 516 29 517 27 519 25 520 24 521 23 521 22 522 22 523 21 524 20 526 19 528 17 530 15 533 14 534 13 535 12 536 12 537 11 538 10 541 9 543 7 545 6 546 6 546 5 547 5 549 4 551 3 553 2 555 1 556 0 557 0 -outline {} -fill \#000000 -width 0}
|
||||
{line 558 0 557 0 556 0 554 0 551 0 550 0 549 0 547 0 546 0 544 0 542 1 539 1 537 2 535 3 534 3 533 3 532 3 530 4 528 5 525 6 523 6 522 7 521 7 519 8 516 9 514 10 512 11 510 11 509 12 507 12 507 13 506 13 505 12 502 12 500 11 498 11 497 11 496 11 495 11 493 11 491 12 489 12 488 12 488 13 487 13 485 14 483 15 482 16 481 17 480 19 478 21 477 22 476 23 476 24 475 25 474 26 473 28 472 30 470 33 467 37 464 41 462 45 459 48 457 52 456 54 455 55 454 56 454 57 453 58 452 59 452 61 451 63 449 65 448 68 447 71 445 74 443 77 442 81 440 86 438 90 436 95 435 99 434 103 433 105 433 106 432 107 432 108 432 109 431 111 431 113 430 116 429 121 428 125 427 130 425 135 425 138 424 140 424 142 424 143 424 144 424 145 423 147 423 149 423 152 422 157 421 162 421 167 420 172 420 176 419 180 419 183 419 187 419 189 419 192 418 195 418 196 418 198 418 199 417 199 416 199 415 199 414 199 413 200 412 200 411 200 411 201 410 201 410 202 409 202 409 203 408 203 407 204 407 205 408 205 410 206 413 208 416 209 418 210 419 210 419 211 420 211 421 211 422 212 424 212 426 212 429 213 432 213 435 214 439 214 442 214 444 214 445 214 446 214 447 214 449 214 452 214 457 214 461 214 464 214 466 214 467 214 468 214 469 214 470 214 472 214 474 214 477 213 482 213 486 213 490 212 494 212 497 212 500 211 502 211 505 211 507 211 508 210 509 210 510 210 510 208 511 206 512 203 513 198 514 194 515 189 516 185 517 182 517 179 518 178 518 177 518 176 518 175 519 174 519 171 520 169 520 166 521 163 522 160 522 157 523 153 524 149 524 144 525 139 526 135 526 132 526 130 526 129 526 128 526 127 527 127 527 126 527 124 527 122 527 119 527 115 527 110 527 106 527 102 527 99 527 96 527 95 527 94 527 93 527 92 527 91 527 88 527 85 526 81 526 77 525 72 524 67 524 64 523 60 522 57 521 54 521 51 520 49 520 47 519 45 519 44 518 43 520 42 521 42 523 41 524 40 525 40 526 40 527 40 528 39 530 39 532 39 533 38 534 38 536 38 538 37 539 37 540 37 541 36 543 35 544 34 545 33 546 32 545 32 543 33 542 33 541 34 540 34 539 34 537 34 536 34 534 34 532 34 531 34 530 34 529 34 527 33 525 33 524 33 523 33 522 33 520 32 518 32 517 32 515 31 514 31 514 30 516 29 517 27 519 25 520 24 521 23 521 22 522 22 523 21 524 20 526 19 528 17 530 15 533 14 534 13 535 12 536 12 537 11 538 10 541 9 543 7 545 6 546 6 546 5 547 5 549 4 551 3 553 2 555 1 556 0 557 0 558 0 -joinstyle bevel}
|
||||
{polygon 490 94 490 95 490 96 489 99 489 103 489 106 488 109 488 111 488 112 488 113 488 115 487 117 487 119 487 121 486 123 485 126 485 130 484 133 483 136 483 137 483 138 483 139 482 139 482 140 482 141 481 144 480 147 479 150 478 153 477 154 477 155 477 156 476 157 476 159 475 161 473 164 472 167 471 170 470 172 468 175 467 176 467 178 466 179 466 180 465 180 465 179 464 177 463 174 462 171 461 169 461 168 461 167 460 166 460 165 460 163 459 161 458 158 458 155 457 152 457 151 457 150 457 149 457 148 456 146 456 143 456 141 456 139 456 138 456 137 456 136 456 134 456 132 456 129 457 126 457 124 457 123 457 121 458 121 458 120 458 121 458 123 458 125 458 127 457 129 457 130 457 131 457 132 458 134 458 136 458 139 458 141 458 143 458 144 459 145 459 148 460 150 460 151 460 152 460 153 461 154 461 155 462 158 462 160 463 162 464 164 464 166 465 167 465 168 465 169 466 169 466 168 467 166 468 163 470 160 470 158 471 157 471 156 472 155 472 154 473 152 474 150 475 147 476 144 477 141 478 139 478 138 479 137 479 136 480 134 480 132 481 129 482 126 483 124 483 122 483 121 484 121 484 120 484 118 485 116 486 112 487 109 487 106 488 103 488 101 489 99 489 97 490 95 490 94 -outline {} -fill $bg -width 0}
|
||||
{line 490 94 490 95 490 96 489 99 489 103 489 106 488 109 488 111 488 112 488 113 488 115 487 117 487 119 487 121 486 123 485 126 485 130 484 133 483 136 483 137 483 138 483 139 482 139 482 140 482 141 481 144 480 147 479 150 478 153 477 154 477 155 477 156 476 157 476 159 475 161 473 164 472 167 471 170 470 172 468 175 467 176 467 178 466 179 466 180 465 180 465 179 464 177 463 174 462 171 461 169 461 168 461 167 460 166 460 165 460 163 459 161 458 158 458 155 457 152 457 151 457 150 457 149 457 148 456 146 456 143 456 141 456 139 456 138 456 137 456 136 456 134 456 132 456 129 457 126 457 124 457 123 457 121 458 121 458 120 458 121 458 123 458 125 458 127 457 129 457 130 457 131 457 132 458 134 458 136 458 139 458 141 458 143 458 144 459 145 459 148 460 150 460 151 460 152 460 153 461 154 461 155 462 158 462 160 463 162 464 164 464 166 465 167 465 168 465 169 466 169 466 168 467 166 468 163 470 160 470 158 471 157 471 156 472 155 472 154 473 152 474 150 475 147 476 144 477 141 478 139 478 138 479 137 479 136 480 134 480 132 481 129 482 126 483 124 483 122 483 121 484 121 484 120 484 118 485 116 486 112 487 109 487 106 488 103 488 101 489 99 489 97 490 95 490 94 -joinstyle bevel}
|
||||
{polygon 503 22 503 23 504 23 504 24 505 24 505 25 505 26 505 27 505 28 505 29 504 29 504 30 503 30 502 30 502 31 501 31 501 30 500 30 499 30 499 29 499 28 499 27 499 26 499 25 499 24 500 24 500 23 501 23 502 22 503 22 -outline {} -fill $bg -width 0}
|
||||
{line 503 22 503 23 504 23 504 24 505 24 505 25 505 26 505 27 505 28 505 29 504 29 504 30 503 30 502 30 502 31 501 31 501 30 500 30 499 30 499 29 499 28 499 27 499 26 499 25 499 24 500 24 500 23 501 23 502 22 503 22 -joinstyle bevel}
|
||||
{polygon 517 44 516 45 515 46 513 47 513 48 512 48 511 48 510 49 508 49 506 50 505 50 504 50 503 50 501 50 498 50 497 51 496 51 495 50 492 50 490 50 487 50 486 49 484 49 483 49 482 48 481 48 481 49 480 51 479 53 479 54 478 55 478 56 477 58 477 59 477 61 477 62 477 63 477 65 477 67 476 68 476 69 477 71 477 72 477 74 477 75 477 76 478 76 479 77 481 77 484 78 485 79 486 79 487 79 488 80 490 81 491 82 493 83 494 84 495 85 496 87 498 88 498 89 499 90 500 92 500 94 500 96 501 98 501 99 501 100 501 101 500 102 500 103 500 104 500 105 499 106 499 107 498 108 498 109 498 110 497 111 497 112 497 113 497 114 497 115 498 115 498 116 499 117 499 118 500 118 500 119 501 120 502 121 502 122 503 122 503 123 502 125 502 128 501 132 501 136 500 139 500 141 500 142 499 143 499 144 499 146 498 148 497 151 496 153 495 156 494 160 493 163 492 165 491 167 491 168 491 169 490 169 490 171 489 174 487 177 486 180 485 182 484 184 484 185 483 185 483 186 482 188 481 190 479 193 478 197 477 199 476 202 475 204 474 206 473 208 472 209 472 210 474 210 476 209 479 209 483 209 488 208 492 207 496 207 499 206 502 206 503 206 504 205 504 204 505 201 506 198 507 193 509 188 510 183 512 179 513 176 514 173 514 172 514 171 514 170 515 169 515 167 516 165 516 162 517 160 518 157 518 154 519 150 520 146 521 142 521 137 522 133 523 129 523 126 523 124 523 122 524 122 524 121 524 120 524 118 524 116 524 113 524 109 524 105 525 101 525 97 525 94 525 92 525 91 525 90 525 89 525 88 525 87 524 85 524 82 524 78 523 74 523 70 522 66 522 62 521 59 521 56 520 54 519 51 519 49 518 47 518 46 518 45 518 44 -outline {} -fill $bg -width 0}
|
||||
{line 517 44 516 45 515 46 513 47 513 48 512 48 511 48 510 49 508 49 506 50 505 50 504 50 503 50 501 50 498 50 497 51 496 51 495 50 492 50 490 50 487 50 486 49 484 49 483 49 482 48 481 48 481 49 480 51 479 53 479 54 478 55 478 56 477 58 477 59 477 61 477 62 477 63 477 65 477 67 476 68 476 69 477 71 477 72 477 74 477 75 477 76 478 76 479 77 481 77 484 78 485 79 486 79 487 79 488 80 490 81 491 82 493 83 494 84 495 85 496 87 498 88 498 89 499 90 500 92 500 94 500 96 501 98 501 99 501 100 501 101 500 102 500 103 500 104 500 105 499 106 499 107 498 108 498 109 498 110 497 111 497 112 497 113 497 114 497 115 498 115 498 116 499 117 499 118 500 118 500 119 501 120 502 121 502 122 503 122 503 123 502 125 502 128 501 132 501 136 500 139 500 141 500 142 499 143 499 144 499 146 498 148 497 151 496 153 495 156 494 160 493 163 492 165 491 167 491 168 491 169 490 169 490 171 489 174 487 177 486 180 485 182 484 184 484 185 483 185 483 186 482 188 481 190 479 193 478 197 477 199 476 202 475 204 474 206 473 208 472 209 472 210 474 210 476 209 479 209 483 209 488 208 492 207 496 207 499 206 502 206 503 206 504 205 504 204 505 201 506 198 507 193 509 188 510 183 512 179 513 176 514 173 514 172 514 171 514 170 515 169 515 167 516 165 516 162 517 160 518 157 518 154 519 150 520 146 521 142 521 137 522 133 523 129 523 126 523 124 523 122 524 122 524 121 524 120 524 118 524 116 524 113 524 109 524 105 525 101 525 97 525 94 525 92 525 91 525 90 525 89 525 88 525 87 524 85 524 82 524 78 523 74 523 70 522 66 522 62 521 59 521 56 520 54 519 51 519 49 518 47 518 46 518 45 518 44 517 44 -joinstyle bevel}
|
||||
{polygon 11 126 12 126 13 126 16 126 19 126 23 126 27 126 32 126 36 126 39 126 41 126 43 126 45 126 47 126 50 127 51 127 52 127 53 128 54 128 56 129 57 130 58 132 59 132 59 133 60 134 61 135 61 137 62 138 62 139 62 140 62 142 62 144 62 145 62 147 62 148 62 149 62 150 61 152 61 154 61 155 61 156 60 157 60 158 59 159 58 161 57 162 57 163 56 164 55 165 54 166 53 167 51 168 49 169 48 169 47 170 46 170 47 171 49 171 51 172 52 172 53 173 54 174 55 175 56 177 56 178 57 180 57 181 57 182 57 183 57 184 57 185 57 187 57 189 57 190 57 191 56 192 56 194 56 196 56 199 56 200 56 201 56 202 55 203 55 205 55 206 55 207 55 208 55 209 56 209 56 210 56 211 57 212 58 212 58 213 57 213 56 213 55 213 51 213 47 213 43 213 40 213 38 213 37 213 37 212 37 211 36 210 36 209 36 208 36 207 36 206 36 205 37 204 37 203 37 202 37 201 37 199 37 198 37 197 37 196 37 195 37 194 38 192 38 189 38 188 38 187 38 186 38 185 38 184 38 182 37 181 37 180 37 179 36 179 36 178 35 178 34 177 33 177 32 177 31 177 30 177 28 177 26 177 24 177 24 178 24 179 24 182 23 186 23 190 22 195 22 200 21 205 21 208 20 211 20 213 19 213 17 213 14 213 10 213 7 213 4 213 2 213 1 213 1 212 1 211 2 208 2 205 2 201 3 196 4 190 4 184 5 177 6 169 7 162 8 155 9 149 9 143 10 138 10 134 11 131 11 129 11 127 11 126 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 26 163 27 163 29 163 31 163 32 163 33 162 35 162 36 162 37 161 38 161 39 160 40 159 40 158 41 157 42 156 42 154 43 153 43 152 43 151 43 150 43 149 43 148 43 147 43 146 42 145 42 144 42 143 41 143 41 142 40 142 40 141 39 141 38 141 37 141 36 140 35 140 34 140 33 140 31 140 30 140 29 140 28 141 28 142 28 145 28 148 27 151 27 155 26 158 26 161 26 162 26 163 -outline {} -fill \#000000 -width 0}
|
||||
{line 11 126 12 126 13 126 16 126 19 126 23 126 27 126 32 126 36 126 39 126 41 126 43 126 45 126 47 126 50 127 51 127 52 127 53 128 54 128 56 129 57 130 58 132 59 132 59 133 60 134 61 135 61 137 62 138 62 139 62 140 62 142 62 144 62 145 62 147 62 148 62 149 62 150 61 152 61 154 61 155 61 156 60 157 60 158 59 159 58 161 57 162 57 163 56 164 55 165 54 166 53 167 51 168 49 169 48 169 47 170 46 170 47 171 49 171 51 172 52 172 53 173 54 174 55 175 56 177 56 178 57 180 57 181 57 182 57 183 57 184 57 185 57 187 57 189 57 190 57 191 56 192 56 194 56 196 56 199 56 200 56 201 56 202 55 203 55 205 55 206 55 207 55 208 55 209 56 209 56 210 56 211 57 212 58 212 58 213 57 213 56 213 55 213 51 213 47 213 43 213 40 213 38 213 37 213 37 212 37 211 36 210 36 209 36 208 36 207 36 206 36 205 37 204 37 203 37 202 37 201 37 199 37 198 37 197 37 196 37 195 37 194 38 192 38 189 38 188 38 187 38 186 38 185 38 184 38 182 37 181 37 180 37 179 36 179 36 178 35 178 34 177 33 177 32 177 31 177 30 177 28 177 26 177 24 177 24 178 24 179 24 182 23 186 23 190 22 195 22 200 21 205 21 208 20 211 20 213 19 213 17 213 14 213 10 213 7 213 4 213 2 213 1 213 1 212 1 211 2 208 2 205 2 201 3 196 4 190 4 184 5 177 6 169 7 162 8 155 9 149 9 143 10 138 10 134 11 131 11 129 11 127 11 126 -joinstyle bevel}
|
||||
{polygon 26 163 27 163 29 163 31 163 32 163 33 162 35 162 36 162 37 161 38 161 39 160 40 159 40 158 41 157 42 156 42 154 43 153 43 152 43 151 43 150 43 149 43 148 43 147 43 146 42 145 42 144 42 143 41 143 41 142 40 142 40 141 39 141 38 141 37 141 36 140 35 140 34 140 33 140 31 140 30 140 29 140 28 141 28 142 28 145 28 148 27 151 27 155 26 158 26 161 26 162 26 163 -outline {} -fill $bg -width 0}
|
||||
{polygon 90 215 89 215 86 214 84 214 81 213 79 213 78 213 77 213 77 212 75 212 74 211 72 209 70 207 69 205 68 204 68 203 68 202 67 202 67 200 66 198 66 195 66 193 66 192 66 191 66 190 66 188 66 185 66 182 66 180 66 177 66 175 66 174 67 172 67 171 67 170 67 169 67 167 68 165 68 162 68 159 69 156 69 155 69 154 70 152 70 151 70 149 71 147 72 144 73 142 74 139 75 138 75 137 76 136 76 135 77 134 79 132 81 130 82 129 83 129 83 128 84 128 85 127 88 126 91 125 93 125 95 124 97 124 99 124 100 124 101 124 102 124 104 125 107 125 110 126 112 126 113 126 114 127 115 127 116 128 117 129 118 130 120 131 121 133 122 135 123 136 123 137 123 138 123 139 124 141 124 143 125 146 125 148 125 149 125 150 125 152 125 156 125 159 124 162 124 164 124 166 124 168 124 169 123 169 123 170 123 171 123 173 122 177 122 180 122 182 121 183 121 184 121 185 121 187 120 189 120 191 119 193 118 196 117 199 116 200 116 201 116 202 115 203 114 204 112 206 111 208 109 209 109 210 108 210 107 211 106 211 103 213 100 213 98 214 96 214 94 215 92 215 91 215 90 215 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 91 201 92 201 94 200 95 200 96 200 96 199 97 198 98 197 99 196 99 195 100 194 100 193 100 191 101 189 101 188 101 187 102 185 102 182 103 179 103 177 103 175 103 173 104 171 104 170 104 169 104 168 104 166 104 163 105 160 105 158 105 157 105 156 105 154 105 153 106 150 106 148 105 146 105 145 105 144 105 143 105 142 104 141 104 140 103 139 101 138 100 138 99 138 98 138 96 138 95 139 94 139 94 140 93 141 92 142 91 143 91 144 91 145 91 146 90 148 89 150 89 151 89 152 89 154 88 157 88 160 87 162 87 164 87 166 87 168 86 169 86 170 86 171 86 173 86 176 85 179 85 181 85 182 85 183 85 185 85 186 85 189 85 191 85 193 85 194 85 195 85 196 86 197 86 198 86 199 87 199 88 200 89 201 90 201 91 201 -outline {} -fill $bg -width 0}
|
||||
{line 90 215 89 215 86 214 84 214 81 213 79 213 78 213 77 213 77 212 75 212 74 211 72 209 70 207 69 205 68 204 68 203 68 202 67 202 67 200 66 198 66 195 66 193 66 192 66 191 66 190 66 188 66 185 66 182 66 180 66 177 66 175 66 174 67 172 67 171 67 170 67 169 67 167 68 165 68 162 68 159 69 156 69 155 69 154 70 152 70 151 70 149 71 147 72 144 73 142 74 139 75 138 75 137 76 136 76 135 77 134 79 132 81 130 82 129 83 129 83 128 84 128 85 127 88 126 91 125 93 125 95 124 97 124 99 124 100 124 101 124 102 124 104 125 107 125 110 126 112 126 113 126 114 127 115 127 116 128 117 129 118 130 120 131 121 133 122 135 123 136 123 137 123 138 123 139 124 141 124 143 125 146 125 148 125 149 125 150 125 152 125 156 125 159 124 162 124 164 124 166 124 168 124 169 123 169 123 170 123 171 123 173 122 177 122 180 122 182 121 183 121 184 121 185 121 187 120 189 120 191 119 193 118 196 117 199 116 200 116 201 116 202 115 203 114 204 112 206 111 208 109 209 109 210 108 210 107 211 106 211 103 213 100 213 98 214 96 214 94 215 92 215 91 215 90 215 -joinstyle bevel}
|
||||
{polygon 149 126 173 126 182 213 163 213 162 197 142 197 138 213 118 213 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 158 142 147 181 161 181 -outline {} -fill \#000000 -width 0}
|
||||
{line 149 126 173 126 182 213 163 213 162 197 142 197 138 213 118 213 149 126}
|
||||
{polygon 158 142 147 181 161 181 -outline {} -fill $bg -width 0}
|
||||
{polygon 196 126 197 126 198 126 201 126 204 126 208 126 212 126 217 126 221 126 224 126 226 126 228 126 230 126 232 126 235 127 236 127 237 127 238 128 239 128 241 129 242 130 244 132 244 133 245 133 245 134 246 135 246 137 247 138 247 139 247 140 247 142 247 144 247 145 247 147 247 148 247 149 247 150 246 152 246 154 246 155 246 156 245 157 245 158 244 159 244 161 242 162 242 163 241 164 240 165 239 166 238 167 236 168 235 169 233 169 232 169 232 170 231 170 232 171 234 171 236 172 237 172 238 172 238 173 239 174 240 175 241 177 241 178 242 180 242 181 242 182 242 183 242 184 242 185 242 187 242 189 242 190 242 191 241 192 241 194 241 196 241 199 241 200 241 201 241 202 241 203 240 205 240 206 240 207 240 208 241 208 241 209 241 210 241 211 242 212 243 212 243 213 242 213 240 213 236 213 232 213 228 213 225 213 223 213 222 213 222 212 222 211 221 210 221 209 221 208 221 207 221 206 221 205 221 204 221 203 221 202 222 201 222 199 222 198 222 197 222 196 222 195 222 194 223 192 223 189 223 188 223 187 223 186 223 185 223 184 223 182 222 181 222 180 222 179 221 178 220 178 218 177 217 177 216 177 215 177 213 177 211 177 209 177 209 178 209 179 209 182 208 186 208 190 207 195 206 200 206 205 206 208 205 211 205 213 204 213 202 213 199 213 196 213 192 213 189 213 187 213 186 213 186 212 186 211 187 208 187 205 188 201 188 196 189 190 190 184 190 177 191 169 192 162 193 155 194 149 194 143 195 138 196 134 196 131 196 129 196 127 196 126 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 211 163 212 163 214 163 216 163 217 163 218 162 220 162 221 162 222 161 223 161 224 160 225 159 225 158 226 157 227 157 227 156 227 154 228 153 228 152 228 151 228 150 228 149 228 148 228 147 228 146 227 145 227 144 227 143 226 142 225 142 225 141 224 141 223 141 222 141 221 140 220 140 219 140 218 140 217 140 215 140 214 140 214 141 213 142 213 145 213 148 212 151 212 155 212 158 211 161 211 162 211 163 -outline {} -fill \#000000 -width 0}
|
||||
{line 196 126 197 126 198 126 201 126 204 126 208 126 212 126 217 126 221 126 224 126 226 126 228 126 230 126 232 126 235 127 236 127 237 127 238 128 239 128 241 129 242 130 244 132 244 133 245 133 245 134 246 135 246 137 247 138 247 139 247 140 247 142 247 144 247 145 247 147 247 148 247 149 247 150 246 152 246 154 246 155 246 156 245 157 245 158 244 159 244 161 242 162 242 163 241 164 240 165 239 166 238 167 236 168 235 169 233 169 232 169 232 170 231 170 232 171 234 171 236 172 237 172 238 172 238 173 239 174 240 175 241 177 241 178 242 180 242 181 242 182 242 183 242 184 242 185 242 187 242 189 242 190 242 191 241 192 241 194 241 196 241 199 241 200 241 201 241 202 241 203 240 205 240 206 240 207 240 208 241 208 241 209 241 210 241 211 242 212 243 212 243 213 242 213 240 213 236 213 232 213 228 213 225 213 223 213 222 213 222 212 222 211 221 210 221 209 221 208 221 207 221 206 221 205 221 204 221 203 221 202 222 201 222 199 222 198 222 197 222 196 222 195 222 194 223 192 223 189 223 188 223 187 223 186 223 185 223 184 223 182 222 181 222 180 222 179 221 178 220 178 218 177 217 177 216 177 215 177 213 177 211 177 209 177 209 178 209 179 209 182 208 186 208 190 207 195 206 200 206 205 206 208 205 211 205 213 204 213 202 213 199 213 196 213 192 213 189 213 187 213 186 213 186 212 186 211 187 208 187 205 188 201 188 196 189 190 190 184 190 177 191 169 192 162 193 155 194 149 194 143 195 138 196 134 196 131 196 129 196 127 196 126 -joinstyle bevel}
|
||||
{polygon 211 163 212 163 214 163 216 163 217 163 218 162 220 162 221 162 222 161 223 161 224 160 225 159 225 158 226 157 227 157 227 156 227 154 228 153 228 152 228 151 228 150 228 149 228 148 228 147 228 146 227 145 227 144 227 143 226 142 225 142 225 141 224 141 223 141 222 141 221 140 220 140 219 140 218 140 217 140 215 140 214 140 214 141 213 142 213 145 213 148 212 151 212 155 212 158 211 161 211 162 211 163 -outline {} -fill $bg -width 0}
|
||||
{polygon 259 126 278 126 268 213 249 213 -outline {} -fill \#000000 -width 0}
|
||||
{line 259 126 278 126 268 213 249 213 259 126}
|
||||
{polygon 288 126 310 126 319 183 326 126 343 126 333 213 311 213 302 153 295 213 278 213 -outline {} -fill \#000000 -width 0}
|
||||
{line 288 126 310 126 319 183 326 126 343 126 333 213 311 213 302 153 295 213 278 213 288 126}
|
||||
{polygon 383 152 384 151 384 150 384 149 384 148 384 147 384 146 384 145 384 144 383 143 383 142 383 141 382 140 382 139 381 139 380 138 379 138 378 138 377 138 376 138 375 139 374 139 373 139 373 140 372 141 371 142 370 144 370 145 369 145 369 146 368 148 368 151 368 152 368 153 367 154 367 157 366 160 366 162 366 164 366 166 365 168 365 169 365 170 365 171 365 173 365 176 364 179 364 181 364 182 364 183 364 185 364 186 364 189 364 191 364 193 364 194 364 195 364 196 364 197 365 198 365 199 366 199 366 200 368 201 369 201 370 201 371 201 373 201 373 200 374 200 375 200 375 199 376 198 377 197 377 196 378 196 378 195 379 193 379 192 379 191 380 189 380 187 380 186 381 185 381 184 381 183 381 182 381 181 381 180 380 180 377 180 374 180 373 180 372 180 373 179 373 176 373 173 374 170 374 168 374 166 375 166 376 166 379 166 383 166 387 166 392 166 395 166 398 166 400 166 401 166 401 167 400 168 400 171 400 174 399 179 398 184 398 190 397 196 397 201 396 205 395 209 395 211 395 213 394 213 392 213 389 213 385 213 383 213 382 213 382 212 382 209 382 207 383 205 382 205 381 206 380 208 380 209 379 209 378 210 377 211 376 212 375 213 374 213 372 214 371 214 370 214 368 215 367 215 365 215 364 215 363 215 361 214 359 214 356 213 355 213 354 213 353 213 352 212 351 211 349 209 348 207 346 205 346 204 346 203 345 201 345 198 344 196 344 194 344 193 344 192 344 190 344 186 344 184 344 181 345 179 345 177 345 175 345 174 345 172 345 171 346 171 346 169 346 166 347 163 347 160 347 158 347 156 348 156 348 155 348 153 348 152 349 150 349 148 350 145 351 142 352 140 353 138 353 137 354 137 354 136 355 134 357 132 359 131 360 130 361 129 362 128 364 127 366 126 369 125 371 125 374 124 376 124 378 124 379 124 380 124 381 124 383 125 386 125 388 125 390 126 391 126 392 126 392 127 394 127 395 128 397 129 398 131 400 133 400 134 400 135 401 136 401 138 402 140 402 141 402 142 402 143 402 146 402 148 402 150 402 151 402 152 401 152 399 152 396 152 393 152 389 152 386 152 384 152 -outline {} -fill \#000000 -width 0}
|
||||
{line 383 152 384 151 384 150 384 149 384 148 384 147 384 146 384 145 384 144 383 143 383 142 383 141 382 140 382 139 381 139 380 138 379 138 378 138 377 138 376 138 375 139 374 139 373 139 373 140 372 141 371 142 370 144 370 145 369 145 369 146 368 148 368 151 368 152 368 153 367 154 367 157 366 160 366 162 366 164 366 166 365 168 365 169 365 170 365 171 365 173 365 176 364 179 364 181 364 182 364 183 364 185 364 186 364 189 364 191 364 193 364 194 364 195 364 196 364 197 365 198 365 199 366 199 366 200 368 201 369 201 370 201 371 201 373 201 373 200 374 200 375 200 375 199 376 198 377 197 377 196 378 196 378 195 379 193 379 192 379 191 380 189 380 187 380 186 381 185 381 184 381 183 381 182 381 181 381 180 380 180 377 180 374 180 373 180 372 180 373 179 373 176 373 173 374 170 374 168 374 166 375 166 376 166 379 166 383 166 387 166 392 166 395 166 398 166 400 166 401 166 401 167 400 168 400 171 400 174 399 179 398 184 398 190 397 196 397 201 396 205 395 209 395 211 395 213 394 213 392 213 389 213 385 213 383 213 382 213 382 212 382 209 382 207 383 205 382 205 381 206 380 208 380 209 379 209 378 210 377 211 376 212 375 213 374 213 372 214 371 214 370 214 368 215 367 215 365 215 364 215 363 215 361 214 359 214 356 213 355 213 354 213 353 213 352 212 351 211 349 209 348 207 346 205 346 204 346 203 345 201 345 198 344 196 344 194 344 193 344 192 344 190 344 186 344 184 344 181 345 179 345 177 345 175 345 174 345 172 345 171 346 171 346 169 346 166 347 163 347 160 347 158 347 156 348 156 348 155 348 153 348 152 349 150 349 148 350 145 351 142 352 140 353 138 353 137 354 137 354 136 355 134 357 132 359 131 360 130 361 129 362 128 364 127 366 126 369 125 371 125 374 124 376 124 378 124 379 124 380 124 381 124 383 125 386 125 388 125 390 126 391 126 392 126 392 127 394 127 395 128 397 129 398 131 400 133 400 134 400 135 401 136 401 138 402 140 402 141 402 142 402 143 402 146 402 148 402 150 402 151 402 152 401 152 399 152 396 152 393 152 389 152 386 152 384 152 383 152 -joinstyle bevel}
|
||||
{polygon 118 229 119 229 121 229 124 229 128 229 133 229 137 229 142 229 145 229 146 229 147 229 148 229 150 229 152 230 155 230 156 230 157 231 158 231 159 231 160 232 162 233 163 235 165 236 165 237 166 237 166 238 166 239 167 241 167 243 168 243 168 244 168 245 168 247 168 249 168 251 168 252 168 253 168 254 167 255 167 258 166 261 166 262 166 263 165 264 165 265 164 267 162 269 161 271 160 272 159 273 157 274 155 275 154 276 153 276 153 277 152 277 149 278 147 278 145 279 143 279 142 279 140 279 139 279 137 279 135 279 132 279 131 279 130 280 130 281 130 283 130 286 129 291 128 295 128 300 127 304 127 307 127 309 127 310 127 311 126 311 124 311 121 311 117 311 113 311 110 311 109 311 108 311 108 310 108 308 108 305 109 301 109 297 110 291 111 284 112 277 113 270 114 263 115 255 115 249 116 243 117 238 117 235 118 232 118 230 118 229 -outline {} -fill \#1892ff -width 0}
|
||||
{polygon 132 265 133 265 134 265 136 265 137 265 138 265 139 265 140 264 141 264 142 264 143 264 143 263 144 263 145 262 146 262 146 261 146 260 147 259 148 258 148 256 148 255 148 254 148 253 148 252 148 251 148 250 148 249 148 248 147 247 147 246 146 245 145 244 144 244 143 243 142 243 141 243 140 243 138 243 137 243 135 243 135 244 135 245 134 247 134 250 134 254 133 257 133 261 133 263 133 264 132 265 -outline {} -fill \#1892ff -width 0}
|
||||
{line 118 229 119 229 121 229 124 229 128 229 133 229 137 229 142 229 145 229 146 229 147 229 148 229 150 229 152 230 155 230 156 230 157 231 158 231 159 231 160 232 162 233 163 235 165 236 165 237 166 237 166 238 166 239 167 241 167 243 168 243 168 244 168 245 168 247 168 249 168 251 168 252 168 253 168 254 167 255 167 258 166 261 166 262 166 263 165 264 165 265 164 267 162 269 161 271 160 272 159 273 157 274 155 275 154 276 153 276 153 277 152 277 149 278 147 278 145 279 143 279 142 279 140 279 139 279 137 279 135 279 132 279 131 279 130 280 130 281 130 283 130 286 129 291 128 295 128 300 127 304 127 307 127 309 127 310 127 311 126 311 124 311 121 311 117 311 113 311 110 311 109 311 108 311 108 310 108 308 108 305 109 301 109 297 110 291 111 284 112 277 113 270 114 263 115 255 115 249 116 243 117 238 117 235 118 232 118 230 118 229 -joinstyle bevel -fill \#1892ff}
|
||||
{polygon 176 229 223 229 221 244 193 244 191 261 217 261 215 277 189 277 187 295 215 295 214 311 166 311 -outline {} -fill \#1892ff -width 0}
|
||||
{line 176 229 223 229 221 244 193 244 191 261 217 261 215 277 189 277 187 295 215 295 214 311 166 311 176 229 -fill \#1892ff}
|
||||
{polygon 232 229 254 229 263 282 270 229 288 229 277 311 256 311 246 254 239 311 222 311 -outline {} -fill \#1892ff -width 0}
|
||||
{line 232 229 254 229 263 282 270 229 288 229 277 311 256 311 246 254 239 311 222 311 232 229 -fill \#1892ff}
|
||||
{polygon 328 254 328 253 328 251 328 250 328 249 328 248 328 247 328 246 328 245 328 244 327 243 327 242 326 242 325 241 324 241 323 240 322 240 321 240 319 241 318 241 317 242 316 243 315 244 314 246 314 247 314 248 313 250 312 252 312 253 312 254 312 256 311 259 311 261 311 263 310 265 310 267 310 268 310 270 310 271 309 273 309 276 309 279 308 281 308 282 308 283 308 284 308 286 308 288 308 290 308 292 308 293 308 294 309 296 309 297 310 298 311 299 312 300 313 300 314 300 315 300 316 300 317 299 318 299 319 299 319 298 320 298 321 297 322 296 322 295 323 293 323 292 324 291 324 289 325 287 325 285 325 284 325 283 325 282 326 282 326 281 326 280 325 280 324 280 321 280 319 280 317 280 317 279 317 276 318 273 318 270 318 268 319 267 321 267 324 267 327 267 332 267 336 267 340 267 343 267 344 267 345 267 345 268 345 269 344 271 344 274 343 279 343 284 342 289 341 294 341 300 340 304 340 307 340 309 339 310 339 311 338 311 336 311 333 311 330 311 328 311 327 311 326 311 327 310 327 307 327 305 327 304 327 303 326 304 325 306 324 307 324 308 323 308 322 309 321 310 320 311 319 311 318 311 317 312 316 312 315 312 314 312 313 312 311 313 310 313 309 313 308 313 307 313 306 312 303 312 301 311 299 311 298 311 298 310 296 310 295 309 294 308 292 306 291 304 290 302 290 301 290 300 289 297 289 295 289 293 289 292 289 291 289 289 289 286 289 283 289 280 289 278 289 275 290 274 290 273 290 272 290 271 290 270 291 267 291 264 291 261 292 259 292 258 292 257 292 256 292 255 293 253 293 252 294 249 295 247 296 244 297 242 298 240 298 239 299 238 300 237 301 235 303 234 304 232 305 232 306 231 308 230 311 229 313 228 316 228 318 227 320 227 322 227 323 227 324 227 325 227 327 228 330 228 333 229 335 229 336 229 337 229 338 230 340 231 341 232 343 234 344 236 345 237 345 238 346 240 346 242 347 244 347 246 347 247 347 250 347 251 346 252 346 253 346 254 345 254 343 254 341 254 337 254 334 254 331 254 329 254 328 254 -outline {} -fill \#1892ff -width 0}
|
||||
{line 328 254 328 253 328 251 328 250 328 249 328 248 328 247 328 246 328 245 328 244 327 243 327 242 326 242 325 241 324 241 323 240 322 240 321 240 319 241 318 241 317 242 316 243 315 244 314 246 314 247 314 248 313 250 312 252 312 253 312 254 312 256 311 259 311 261 311 263 310 265 310 267 310 268 310 270 310 271 309 273 309 276 309 279 308 281 308 282 308 283 308 284 308 286 308 288 308 290 308 292 308 293 308 294 309 296 309 297 310 298 311 299 312 300 313 300 314 300 315 300 316 300 317 299 318 299 319 299 319 298 320 298 321 297 322 296 322 295 323 293 323 292 324 291 324 289 325 287 325 285 325 284 325 283 325 282 326 282 326 281 326 280 325 280 324 280 321 280 319 280 317 280 317 279 317 276 318 273 318 270 318 268 319 267 321 267 324 267 327 267 332 267 336 267 340 267 343 267 344 267 345 267 345 268 345 269 344 271 344 274 343 279 343 284 342 289 341 294 341 300 340 304 340 307 340 309 339 310 339 311 338 311 336 311 333 311 330 311 328 311 327 311 326 311 327 310 327 307 327 305 327 304 327 303 326 304 325 306 324 307 324 308 323 308 322 309 321 310 320 311 319 311 318 311 317 312 316 312 315 312 314 312 313 312 311 313 310 313 309 313 308 313 307 313 306 312 303 312 301 311 299 311 298 311 298 310 296 310 295 309 294 308 292 306 291 304 290 302 290 301 290 300 289 297 289 295 289 293 289 292 289 291 289 289 289 286 289 283 289 280 289 278 289 275 290 274 290 273 290 272 290 271 290 270 291 267 291 264 291 261 292 259 292 258 292 257 292 256 292 255 293 253 293 252 294 249 295 247 296 244 297 242 298 240 298 239 299 238 300 237 301 235 303 234 304 232 305 232 306 231 308 230 311 229 313 228 316 228 318 227 320 227 322 227 323 227 324 227 325 227 327 228 330 228 333 229 335 229 336 229 337 229 338 230 340 231 341 232 343 234 344 236 345 237 345 238 346 240 346 242 347 244 347 246 347 247 347 250 347 251 346 252 346 253 346 254 345 254 343 254 341 254 337 254 334 254 331 254 329 254 328 254 -joinstyle bevel -fill \#1892ff}
|
||||
{polygon 405 284 404 286 404 289 403 291 403 293 403 294 402 295 402 297 401 299 400 301 398 303 397 304 397 305 396 306 394 307 392 309 391 309 391 310 390 310 389 310 386 311 384 312 381 312 380 312 378 313 376 313 375 313 374 313 372 312 369 312 367 312 365 311 364 311 363 311 362 310 360 310 358 309 356 307 355 306 354 305 354 304 353 303 353 301 352 299 352 298 352 297 351 295 351 293 351 290 351 288 352 286 352 285 352 284 352 283 352 282 352 280 353 277 353 273 354 268 355 262 355 256 356 250 357 245 357 240 358 236 358 233 359 231 359 229 360 229 362 229 365 229 368 229 372 229 375 229 377 229 378 229 377 230 377 232 377 234 376 238 376 242 375 247 375 253 374 259 373 265 372 271 372 276 371 280 371 284 370 287 370 288 370 289 370 290 370 291 370 292 370 293 370 294 370 295 370 296 371 297 372 298 372 299 373 299 374 299 374 300 375 300 376 300 377 300 378 300 379 299 380 299 381 299 381 298 382 297 383 297 383 296 383 295 384 295 384 294 384 293 385 292 385 291 385 290 385 289 385 288 386 287 386 284 386 280 387 276 388 271 388 265 389 259 390 253 390 247 391 242 392 238 392 234 392 232 393 230 393 229 394 229 396 229 399 229 402 229 406 229 409 229 411 229 412 229 412 231 411 233 411 236 410 240 410 245 409 250 408 256 407 262 407 268 406 273 406 277 405 280 405 282 405 283 -outline {} -fill \#1892ff -width 0}
|
||||
{line 405 284 404 286 404 289 403 291 403 293 403 294 402 295 402 297 401 299 400 301 398 303 397 304 397 305 396 306 394 307 392 309 391 309 391 310 390 310 389 310 386 311 384 312 381 312 380 312 378 313 376 313 375 313 374 313 372 312 369 312 367 312 365 311 364 311 363 311 362 310 360 310 358 309 356 307 355 306 354 305 354 304 353 303 353 301 352 299 352 298 352 297 351 295 351 293 351 290 351 288 352 286 352 285 352 284 352 283 352 282 352 280 353 277 353 273 354 268 355 262 355 256 356 250 357 245 357 240 358 236 358 233 359 231 359 229 360 229 362 229 365 229 368 229 372 229 375 229 377 229 378 229 377 230 377 232 377 234 376 238 376 242 375 247 375 253 374 259 373 265 372 271 372 276 371 280 371 284 370 287 370 288 370 289 370 290 370 291 370 292 370 293 370 294 370 295 370 296 371 297 372 298 372 299 373 299 374 299 374 300 375 300 376 300 377 300 378 300 379 299 380 299 381 299 381 298 382 297 383 297 383 296 383 295 384 295 384 294 384 293 385 292 385 291 385 290 385 289 385 288 386 287 386 284 386 280 387 276 388 271 388 265 389 259 390 253 390 247 391 242 392 238 392 234 392 232 393 230 393 229 394 229 396 229 399 229 402 229 406 229 409 229 411 229 412 229 412 231 411 233 411 236 410 240 410 245 409 250 408 256 407 262 407 268 406 273 406 277 405 280 405 282 405 283 405 284 -joinstyle bevel -fill \#1892ff}
|
||||
{polygon 421 229 439 229 429 311 410 311 -outline {} -fill \#1892ff -width 0}
|
||||
{line 421 229 439 229 429 311 410 311 421 229 -fill \#1892ff}
|
||||
{polygon 449 229 471 229 480 282 487 229 504 229 494 311 473 311 463 254 456 311 439 311 -outline {} -fill \#1892ff -width 0}
|
||||
{line 449 229 471 229 480 282 487 229 504 229 494 311 473 311 463 254 456 311 439 311 449 229 -fill \#1892ff}
|
||||
{polygon 114 354 114 355 114 356 114 357 114 358 114 359 115 359 115 360 116 360 117 360 118 360 119 359 119 358 120 358 120 357 120 356 119 355 119 354 118 353 117 352 116 352 115 351 114 350 113 350 112 349 110 348 109 347 109 346 108 345 108 343 107 342 107 341 107 340 107 339 107 338 108 337 108 336 108 335 109 334 109 333 110 333 110 332 111 331 112 331 113 331 114 330 115 330 116 330 117 330 118 330 119 330 120 330 121 331 122 331 123 332 124 332 124 333 125 334 125 335 125 336 126 336 126 337 126 338 126 339 126 340 125 340 123 340 121 340 119 340 119 339 119 338 119 337 119 336 118 336 118 335 117 335 116 335 116 336 115 336 115 337 114 337 114 338 114 339 115 340 115 341 115 342 116 343 117 343 118 344 120 345 121 345 122 346 123 347 124 347 124 348 125 349 126 351 126 352 126 353 126 354 126 355 126 356 126 358 126 359 126 360 125 361 125 362 124 363 123 364 122 364 122 365 121 365 120 365 119 366 118 366 117 366 116 366 115 366 114 365 113 365 112 365 111 364 110 364 109 363 108 362 108 361 108 360 107 359 107 358 107 357 107 356 107 355 107 354 108 354 110 354 112 354 113 354 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 152 366 151 365 149 365 148 365 147 364 146 364 145 363 144 361 143 360 143 359 143 357 142 357 142 356 142 354 142 352 142 351 142 349 142 348 142 347 142 345 142 343 142 342 142 341 142 340 143 339 143 337 143 336 144 335 144 334 145 333 146 332 146 331 148 331 149 330 150 330 151 330 152 330 154 330 155 331 157 331 158 332 159 333 160 334 161 335 161 336 161 337 162 339 162 340 162 341 162 342 162 344 162 345 162 346 162 347 162 348 162 349 162 351 162 352 162 353 162 354 162 355 162 357 161 358 161 360 161 361 160 362 159 363 159 364 158 364 157 365 155 365 154 366 153 366 152 366 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 152 360 153 360 154 360 154 359 155 358 155 357 155 356 155 355 155 354 155 353 155 351 155 350 155 349 155 348 155 346 155 344 155 343 155 342 155 341 155 339 155 338 154 337 154 336 153 336 153 335 152 335 152 336 151 336 150 336 150 337 150 338 149 338 149 339 149 340 149 341 149 342 149 343 149 345 149 346 149 347 149 348 149 349 149 351 149 352 149 353 149 354 149 355 149 356 149 357 149 358 150 358 150 359 151 360 152 360 -outline {} -fill $bg -width 0}
|
||||
{polygon 179 331 195 331 195 337 185 337 185 344 195 344 195 351 185 351 185 365 179 365 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 215 337 209 337 209 331 228 331 228 337 222 337 222 365 215 365 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 241 331 248 331 251 355 254 331 260 331 263 355 266 331 272 331 267 365 260 365 257 341 254 365 247 365 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 293 331 301 331 308 365 302 365 301 358 294 358 293 365 286 365 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 297 337 295 352 299 352 -outline {} -fill $bg -width 0}
|
||||
{polygon 324 331 325 331 327 331 329 331 332 331 334 331 335 331 336 331 337 331 338 331 339 332 340 332 340 333 341 333 341 334 342 334 342 335 342 336 343 337 343 338 343 339 343 340 343 341 343 342 343 343 342 343 342 344 342 345 341 345 341 346 340 347 339 348 338 348 339 349 340 349 341 349 341 350 342 351 342 352 342 353 342 354 342 355 343 356 343 357 343 358 343 359 343 360 343 361 343 362 343 363 343 364 344 364 344 365 342 365 340 365 338 365 337 365 336 365 336 364 336 363 336 362 336 361 336 360 336 359 336 358 336 357 336 356 336 355 336 354 335 353 335 352 335 351 334 351 333 351 332 351 331 351 330 351 330 352 330 355 330 358 330 361 330 364 330 365 329 365 327 365 325 365 324 365 324 364 324 363 324 360 324 357 324 353 324 348 324 343 324 339 324 335 324 333 324 331 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 330 345 331 345 332 345 333 345 334 345 335 345 335 344 335 343 336 343 336 342 336 341 336 340 336 339 335 338 335 337 334 337 333 336 332 336 331 336 330 336 330 337 330 338 330 341 330 343 330 345 -outline {} -fill $bg -width 0}
|
||||
{polygon 360 331 376 331 376 337 367 337 367 344 376 344 376 351 367 351 367 358 377 358 377 365 360 365 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 416 331 423 331 423 365 416 365 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 440 331 448 331 454 353 454 331 460 331 460 365 452 365 446 341 446 365 440 365 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 485 343 485 342 485 341 485 340 485 339 485 338 485 337 484 337 484 336 483 336 483 335 482 335 482 336 481 336 480 337 480 338 480 339 480 340 480 341 479 341 479 343 479 344 479 346 479 347 479 348 479 349 479 351 479 352 479 353 480 354 480 355 480 356 480 357 480 358 480 359 481 359 481 360 482 360 483 360 484 360 484 359 485 359 485 358 485 357 485 356 485 355 485 354 485 353 485 352 487 352 489 352 491 352 492 352 492 353 492 354 492 356 492 357 491 357 491 358 491 359 491 360 490 361 490 362 490 363 489 363 488 364 487 364 486 365 485 365 484 366 482 366 480 365 479 365 478 365 477 365 477 364 476 364 476 363 475 362 474 361 474 360 473 358 473 357 473 356 473 355 473 353 472 352 472 350 472 349 472 348 472 347 472 346 473 344 473 343 473 342 473 341 473 339 473 338 474 336 474 335 475 334 476 333 476 332 478 331 479 330 481 330 482 330 483 330 485 330 486 330 486 331 487 331 488 332 489 332 489 333 490 333 490 334 491 335 491 336 491 337 491 338 492 340 492 341 492 342 492 343 491 343 490 343 488 343 486 343 485 343 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 500 356 506 356 506 365 500 365 -outline {} -fill \#000000 -width 0}
|
||||
{polygon 132 265 133 265 134 265 136 265 137 265 138 265 139 265 140 264 141 264 142 264 143 264 143 263 144 263 145 262 146 262 146 261 146 260 147 259 148 258 148 256 148 255 148 254 148 253 148 252 148 251 148 250 148 249 148 248 147 247 147 246 146 245 145 244 144 244 143 243 142 243 141 243 140 243 138 243 137 243 135 243 135 244 135 245 134 247 134 250 134 254 133 257 133 261 133 263 133 264 132 265 -outline {} -fill $bg -width 0}
|
||||
}
|
||||
foreach obj $logo_objs {
|
||||
eval $c create $obj -tags logo
|
||||
}
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: doLogo
|
||||
# %ARGUMENTS:
|
||||
# None
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Does the logo thing
|
||||
#***********************************************************************
|
||||
proc doLogo {} {
|
||||
canvas .c -width 600 -height 400 -bg #FFFFFF
|
||||
pack .c
|
||||
drawLogo .c #FFFFFF
|
||||
|
||||
# Funky effect
|
||||
.c create text 4 4 -anchor nw -text "Welcome to Remind" \
|
||||
-fill red -font {-family times -size -24 -weight bold} -tags remind
|
||||
.c lower remind
|
||||
|
||||
.c move logo -300 20
|
||||
|
||||
update idletasks
|
||||
|
||||
for {set i 0} {$i < 16} {incr i} {
|
||||
.c move logo 20 0
|
||||
update idletasks
|
||||
after 30
|
||||
}
|
||||
|
||||
.c create text 4 28 -anchor nw -text "http://www.roaringpenguin.com" \
|
||||
-fill red -font {-family courier -size -14 -weight bold}
|
||||
update idletasks
|
||||
after 2500
|
||||
}
|
||||
|
||||
|
||||
CheckSanity
|
||||
CreateMainDialog
|
||||
48
configure.in
Normal file
48
configure.in
Normal file
@@ -0,0 +1,48 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
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 Integer sizes
|
||||
AC_CHECK_SIZEOF(unsigned short)
|
||||
AC_CHECK_SIZEOF(unsigned int)
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_CHECK_HEADERS(sys/file.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_STRUCT_TM
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_HEADER_TIME
|
||||
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS(setenv unsetenv)
|
||||
AC_OUTPUT(src/Makefile)
|
||||
104
docs/README.UNIX
Normal file
104
docs/README.UNIX
Normal file
@@ -0,0 +1,104 @@
|
||||
REMIND version 3.1 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.
|
||||
|
||||
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>
|
||||
http://www.roaringpenguin.com/remind/
|
||||
@@ -1,5 +1,432 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* Version 3.1 Patch 1 - 23 August 2007
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
- Added the "nonomitted" function that solves a number of
|
||||
moving-reminder-in-response-to-holiday problems. The real-world
|
||||
problems solved are the "moving-garbage-day" problem and the
|
||||
"six-day-school-cycle" problem.
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- A few minor performance improvements in response to profiling runs.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Prevent compilation failure with gcc 2.95.
|
||||
|
||||
- Fix trailing "s" bug with -k option. This was fixed in Debian's release,
|
||||
but the Debian maintainer never bothered to let me know.
|
||||
|
||||
- Removed obsolete scripts: kall, rem, remind-all.sh, remind-all.csh
|
||||
|
||||
- Made "-n" output always use "/" as date separator for consistency with
|
||||
"-p" and "-s".
|
||||
|
||||
- Moon PNG images are transparent. Output of moon phases in rem2html
|
||||
improved slightly.
|
||||
|
||||
- Various man-page fixes.
|
||||
|
||||
* Version 3.1 Patch 0 - 14 August 2007
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
- Added the FROM clause. This lets you write reminders like:
|
||||
|
||||
REM Mon FROM 16 July 2007 UNTIL 13 Aug 2007 MSG Some Mondays...
|
||||
|
||||
- Remind now has a new datatype: A DATETIME object represents a date AND
|
||||
a time (to the nearest minute). DATETIME constants are written
|
||||
as '2007-09-01@14:33'. Various operators and functions have been
|
||||
modified to do sensible things with DATETIMEs and several new DATETIME
|
||||
functions have been added.
|
||||
|
||||
- The SPECIAL COLOR reminder type has been hacked to behave more like
|
||||
a MSG type. It sorts properly and is emitted as a normal reminder
|
||||
in non-calendar mode. Simlarly, SPECIAL HTML sorts with -g as well.
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- TkRemind can e-mail you reminders if you don't dismiss the popup window
|
||||
after one minute. This is useful if you need to leave your workstation
|
||||
but want reminders to "follow" you via e-mail.
|
||||
|
||||
- A new "-y" option to Remind generates tags for all reminders that lack
|
||||
a TAG clause. This may be useful for conversion tools that want each
|
||||
reminder to have a unique identifier.
|
||||
|
||||
- A new "tzconvert" function lets you convert datetimes between different
|
||||
time zones. It's only as good as your C library, so test thoroughly
|
||||
please! Based on a patch from Stefan Wehr.
|
||||
|
||||
- TkRemind sorts reminders by invoking Remind with the '-g' option.
|
||||
|
||||
- The time and date separator characters can be changed at runtime by
|
||||
setting $TimeSep and $DateSep respectively.
|
||||
|
||||
- The simple calendar ('-s') option can be immediately followed by an 'a'.
|
||||
This causes Remind to output reminders with deltas before the actual
|
||||
trigger date. Based loosely on an idea from Frank Terbeck.
|
||||
|
||||
+ MINOR CHANGES
|
||||
|
||||
- Default date separator is now '-' instead of '/'
|
||||
|
||||
- trigdate() and trigtime() behave differently - they return the integer 0
|
||||
if the last reminder could not be computed or did not have an AT clause
|
||||
(respectively).
|
||||
|
||||
- Maximum length of variable names has been increased from 12 to 16 characters.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed a potential memory leak in queue.c
|
||||
|
||||
- Fixed compile error on Mac OS X.
|
||||
|
||||
- Fixed behaviour of "-sa" option so deltas correctly obey omitted days
|
||||
and the scheduling function (if one is used).
|
||||
|
||||
- rem2ps would produce invalid PostScript in some rare cases
|
||||
(eg, for February 2007). This has been fixed.
|
||||
|
||||
* Version 3.0 Patch 24
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Permit the DURATION of a reminder to be as high as you like. Previously,
|
||||
DURATIONs could be at most 23:59. Fix courtesy of Paul Pelzl.
|
||||
|
||||
- The "-n" flag can be usefully combined with "-s", "-p" and "-l" now.
|
||||
Fix courtesy of Paul Pelzl.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- The "-k" command escapes all characters except those known to be
|
||||
safe, rather than attempting to escape only characters thought to be
|
||||
unsafe.
|
||||
|
||||
- Removed the crufty code that supported non-ANSI C compilers.
|
||||
|
||||
- Removed all support for non-UNIX/non-Linux systems.
|
||||
|
||||
- Fixed a bug in the tokenizer that could make Remind segfault. Fix courtesy
|
||||
of Stan Tobias.
|
||||
|
||||
* Version 3.0 Patch 23
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Added the COLOR special for putting colored reminders in the calendar.
|
||||
Supported by the HTML, Tcl/Tk and PostScript back-ends.
|
||||
|
||||
- Many minor tweaks to tkremind.
|
||||
|
||||
- Added ability to specify paper size in inches or centimetres to rem2ps.
|
||||
|
||||
- Added the "-l" option to Remind. This outputs additional information
|
||||
for back-end programs that use the "-p" output format. Currently
|
||||
used only by the "tkremind" back-end.
|
||||
|
||||
- Fixed dates for Yom Hazikaron and Yom Ha'atzmaut if 5 Iyar falls on a
|
||||
Saturday. (Hebrew calendar fix.)
|
||||
|
||||
- Added support for the Icelandic language, courtesy of Björn Davíðsson.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed parser error for unterminated date constant: '2005/01/01
|
||||
|
||||
* Version 3.0 Patch 22
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Added option to have TkRemind display all of today's reminders in a text
|
||||
box on startup. This option is on by default.
|
||||
|
||||
- Makefile in "www" directory allows you to add ".cgi" suffix to CGI scripts.
|
||||
|
||||
- Added option to completely delete a reminder from the reminder file in
|
||||
the timed reminder popup dialog.
|
||||
|
||||
- Clarified build instructions.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed packing order in TkRemind so resizing window doesn't make control
|
||||
buttons disappear.
|
||||
|
||||
- Fixed serious bug in which background queued reminders were ignored and
|
||||
Remind simply exited. Doh! Sorry about that.
|
||||
|
||||
* 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
|
||||
|
||||
- The tar file now unpacks into a Remind subdirectory rather than into
|
||||
the current working directory.
|
||||
|
||||
- I no longer support Remind under DOS. I don't think I've done anything
|
||||
to stop it from working under DOS, but will no longer compile and test
|
||||
it under DOS, and can't help you if you get stuck. Sorry -- I no longer
|
||||
have a DOS machine.
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Changed psshade() to accept 1 or 3 arguments for colored shading in
|
||||
PostScript calendar mode.
|
||||
|
||||
- Added a Print dialog to tkremind.
|
||||
|
||||
- Added support for Brazilian Portuguese courtesy of Marco Paganini
|
||||
|
||||
- Added support for Italian courtesy of Valerio Aimale
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed confusing error in rem2ps help messages.
|
||||
|
||||
- Fixed bug in TkRemind which caused a crash if the "-m" option was used
|
||||
for a month beginning on Sunday. Doh!!!
|
||||
|
||||
* Version 3.0 Patch 14
|
||||
|
||||
+ CHANGE IN COPYING POLICY
|
||||
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,21 +17,18 @@
|
||||
# "#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 $
|
||||
#
|
||||
|
||||
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 +157,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 +304,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 +377,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 +393,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
|
||||
##########################################################################
|
||||
# #
|
||||
@@ -460,6 +468,8 @@ SET Reform 0
|
||||
FSET _h(x, y) TRIGGER(HEBDATE(x,y))
|
||||
FSET _h2(x, y) HEBDATE(x, y, TODAY()-7)
|
||||
FSET _PastSat(x, y) TRIGGER(IIF(WKDAYNUM(_h2(x,y))!=6, _h2(x,y), _h2(x,y)+1))
|
||||
FSET _PastSun(x, y) TRIGGER(IIF(WKDAYNUM(_h2(x,y))!=0, _h2(x,y), _h2(x,y)+1))
|
||||
FSET _PastMon(x, y) TRIGGER(IIF(WKDAYNUM(_h2(x,y))!=1, _h2(x,y), _h2(x,y)+1))
|
||||
|
||||
# Default values in case InIsrael and Reform are not set
|
||||
SET InIsrael VALUE("InIsrael", 0)
|
||||
@@ -529,9 +539,24 @@ IF !InIsrael && !Reform
|
||||
[_h(22, "Nisan")] MSG %"Pesach 8%"
|
||||
ENDIF
|
||||
|
||||
[_h(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
|
||||
[_h(4, "Iyar")] ++4 MSG %"Yom HaZikaron%" is %b.
|
||||
[_h(5, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
|
||||
[_PastSun(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
|
||||
|
||||
# If 4 Iyar is a Friday, then Yom Hazikaron is
|
||||
# the Wednesday before and Yom Ha'atzmaut is on
|
||||
# Thursday. If 4 Iyar is a Sunday, then Yom Hazikaron
|
||||
# moves to 5 Iyar and Yom Ha'atzmaut to 6 Iyar.
|
||||
IF WKDAYNUM(_h2(4, "Iyar")) == 5
|
||||
[_h(2, "Iyar")] ++4 MSG %"Yom Hazikaron%" is %b.
|
||||
[_h(3, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
|
||||
ELSE
|
||||
IF WKDAYNUM(_h2, 4, "Iyar") == 0
|
||||
[_h(5, "Iyar")] ++4 MSG %"Yom Hazikaron%" is %b.
|
||||
[_h(6, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
|
||||
ELSE
|
||||
[_h(4, "Iyar")] ++4 MSG %"Yom Hazikaron%" is %b.
|
||||
[_h(5, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
# Not sure about Reform's position on Lag B'Omer
|
||||
IF !Reform
|
||||
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
|
||||
42
kall
42
kall
@@ -1,42 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id: kall,v 1.1 1996-03-27 03:25:59 dfs Exp $
|
||||
#
|
||||
# kall - kill all processes belonging to this user that match
|
||||
# specified string.
|
||||
|
||||
signal=`echo $1 | grep '^\-.*'`
|
||||
me=`basename $0`
|
||||
|
||||
if [ "$signal" != "" ]; then
|
||||
shift
|
||||
else
|
||||
signal="-TERM"
|
||||
fi
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
echo "usage: $me [-signal] string [string...]"
|
||||
echo " kills all of your processes where command name matches"
|
||||
echo " any of the given strings."
|
||||
exit
|
||||
fi
|
||||
|
||||
msg="0"
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
|
||||
# NOTE: You may have to modify the next line, since PS is non-portable.
|
||||
# The 'awk' command picks out the process IDs to pass them on to kill.
|
||||
rprocs=`ps cx | awk '{if(prog == $NF && $1 != mypid) print $1}' prog=$1 mypid=$$ -`
|
||||
if [ "$rprocs" != "" ]; then
|
||||
msg="1"
|
||||
echo -n "${me}: Sending $signal signal to $1 process(es)"
|
||||
echo '...'
|
||||
kill $signal $rprocs
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if [ $msg = "1" ]; then
|
||||
echo "${me}: Done."
|
||||
fi
|
||||
28
kall.1
28
kall.1
@@ -1,28 +0,0 @@
|
||||
.\" $Id: kall.1,v 1.2 1996-04-28 02:01:58 dfs Exp $
|
||||
.TH KALL 1 "26 February 1991"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
kall \- kill processes by command name
|
||||
.SH SYNOPSIS
|
||||
.B kall
|
||||
[\-\fIsignal\fR] prog1 [prog2...]
|
||||
.SH DESCRIPTION
|
||||
.B Kall
|
||||
sends the specified \fIsignal\fR (defaults to \fB-TERM\fR) to all processes
|
||||
whose command name is specified on the command line. For example:
|
||||
.PP
|
||||
.nf
|
||||
kall -HUP remind foobar
|
||||
.fi
|
||||
.PP
|
||||
sends a \fBHUP\fR signal to all \fIremind\fR and \fIfoobar\fR programs.
|
||||
Note that \fBkall\fR sends signals only to those processes owned by the
|
||||
user invoking \fBkall\fR.
|
||||
.SH AUTHOR
|
||||
David F. Skoll
|
||||
.SH BUGS
|
||||
.B Kall
|
||||
is a sh(1) script and depends on the behaviour of ps(1); thus, it is
|
||||
not especially portable.
|
||||
.SH SEE ALSO
|
||||
remind, rem
|
||||
20
lnk.bcc
20
lnk.bcc
@@ -1,20 +0,0 @@
|
||||
calendar.obj
|
||||
dorem.obj
|
||||
dosubst.obj
|
||||
expr.obj
|
||||
files.obj
|
||||
funcs.obj
|
||||
globals.obj
|
||||
hbcal.obj
|
||||
init.obj
|
||||
main.obj
|
||||
moon.obj
|
||||
omit.obj
|
||||
os2func.obj
|
||||
queue.obj
|
||||
sort.obj
|
||||
token.obj
|
||||
trigger.obj
|
||||
userfns.obj
|
||||
utils.obj
|
||||
var.obj
|
||||
23
lnk.msc
23
lnk.msc
@@ -1,23 +0,0 @@
|
||||
calendar.obj +
|
||||
dorem.obj +
|
||||
dosubst.obj +
|
||||
expr.obj +
|
||||
files.obj +
|
||||
funcs.obj +
|
||||
globals.obj +
|
||||
hbcal.obj +
|
||||
init.obj +
|
||||
main.obj +
|
||||
moon.obj +
|
||||
omit.obj +
|
||||
sort.obj +
|
||||
token.obj +
|
||||
trigger.obj +
|
||||
userfns.obj +
|
||||
utils.obj +
|
||||
var.obj
|
||||
remind.exe
|
||||
nul
|
||||
|
||||
|
||||
|
||||
19
lnk.tc
19
lnk.tc
@@ -1,19 +0,0 @@
|
||||
-eremind.exe
|
||||
calendar.obj
|
||||
dorem.obj
|
||||
dosubst.obj
|
||||
expr.obj
|
||||
files.obj
|
||||
funcs.obj
|
||||
globals.obj
|
||||
hbcal.obj
|
||||
init.obj
|
||||
main.obj
|
||||
moon.obj
|
||||
omit.obj
|
||||
sort.obj
|
||||
token.obj
|
||||
trigger.obj
|
||||
userfns.obj
|
||||
utils.obj
|
||||
var.obj
|
||||
97
makefile.bcc
97
makefile.bcc
@@ -1,97 +0,0 @@
|
||||
# Makefile for REMIND for Borland C++
|
||||
# $Id: makefile.bcc,v 1.2 1996-03-31 04:08:11 dfs Exp $
|
||||
|
||||
VERSION= 03.00.14
|
||||
|
||||
MODEL=l
|
||||
|
||||
!if $d(__OS2__)
|
||||
CFLAGS= -DOS2_POPUP -w-pia -O2
|
||||
BINDIR= ..\OS2-EX
|
||||
DELFLAG= /f
|
||||
!else
|
||||
CFLAGS= -w-pia -O2 -m$(MODEL)
|
||||
BINDIR= ..\MSDOS-EX
|
||||
DELFLAG=
|
||||
!endif
|
||||
|
||||
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
|
||||
|
||||
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
|
||||
main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c \
|
||||
queue.c moon.c os2func.c
|
||||
|
||||
OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
|
||||
globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
|
||||
utils.obj userfns.obj var.obj hbcal.obj queue.obj moon.obj os2func.obj
|
||||
|
||||
all: exes test-rem.cmd test-rem.bat
|
||||
test-rem
|
||||
|
||||
clean:
|
||||
-del $(DELFLAG) *.obj
|
||||
-del $(DELFLAG) $(BINDIR)\*.exe
|
||||
|
||||
exes: $(BINDIR)\remind.exe $(BINDIR)\rem2ps.exe
|
||||
|
||||
..\os2-ex\remind.exe: $(OBJS)
|
||||
bcc -e..\os2-ex\remind @lnk.bcc -lap;Toe
|
||||
|
||||
..\msdos-ex\remind.exe: $(OBJS)
|
||||
bcc -e..\msdos-ex\remind -m$(MODEL) @lnk.bcc
|
||||
|
||||
..\os2-ex\rem2ps.exe: rem2ps.obj
|
||||
bcc -e..\os2-ex\rem2ps rem2ps.obj -lap;Toe
|
||||
|
||||
..\msdos-ex\rem2ps.exe: rem2ps.obj
|
||||
bcc -e..\msdos-ex\rem2ps -m$(MODEL) rem2ps.obj
|
||||
|
||||
.c.obj:
|
||||
bcc $(CFLAGS) -c {$< }
|
||||
|
||||
rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
|
||||
|
||||
calendar.obj: calendar.c $(STDHDRS) expr.h
|
||||
|
||||
dorem.obj: dorem.c $(STDHDRS) expr.h
|
||||
|
||||
dosubst.obj: dosubst.c $(STDHDRS) $(LANGHDRS)
|
||||
|
||||
expr.obj: expr.c $(STDHDRS) expr.h
|
||||
|
||||
files.obj: files.c $(STDHDRS)
|
||||
|
||||
funcs.obj: funcs.c $(STDHDRS) expr.h version.h
|
||||
|
||||
globals.obj: globals.c config.h types.h globals.h err.h lang.h
|
||||
|
||||
init.obj: init.c $(STDHDRS) expr.h version.h
|
||||
|
||||
main.obj: main.c $(STDHDRS) expr.h
|
||||
|
||||
moon.obj: moon.c $(STDHDRS) expr.h
|
||||
|
||||
omit.obj: omit.c $(STDHDRS)
|
||||
|
||||
os2func.obj: os2func.c $(STDHDRS)
|
||||
|
||||
queue.obj: queue.c $(STDHDRS)
|
||||
|
||||
sort.obj: sort.c $(STDHDRS)
|
||||
|
||||
token.obj: token.c $(STDHDRS)
|
||||
|
||||
trigger.obj: trigger.c $(STDHDRS) expr.h
|
||||
|
||||
userfns.obj: userfns.c $(STDHDRS) expr.h
|
||||
|
||||
utils.obj: utils.c $(STDHDRS)
|
||||
|
||||
var.obj: var.c $(STDHDRS) expr.h
|
||||
74
makefile.msc
74
makefile.msc
@@ -1,74 +0,0 @@
|
||||
# Makefile for REMIND for Microsoft C for MSDOS
|
||||
# $Id: makefile.msc,v 1.1 1996-03-27 03:26:01 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 \
|
||||
utils.obj var.obj sort.obj hbcal.obj moon.obj
|
||||
|
||||
DEFINES= /D__MSDOS__ /D__MSC__
|
||||
|
||||
MODEL= /AM
|
||||
|
||||
calendar.obj: calendar.c
|
||||
cl /c $(DEFINES) $(MODEL) /Focalendar.obj calendar.c
|
||||
|
||||
dorem.obj: dorem.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fodorem.obj dorem.c
|
||||
|
||||
dosubst.obj: dosubst.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fodosubst.obj dosubst.c
|
||||
|
||||
expr.obj: expr.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foexpr.obj expr.c
|
||||
|
||||
hbcal.obj: hbcal.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fohbcal.obj hbcal.c
|
||||
|
||||
sort.obj: sort.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fosort.obj sort.c
|
||||
|
||||
files.obj: files.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fofiles.obj files.c
|
||||
|
||||
funcs.obj: funcs.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fofuncs.obj funcs.c
|
||||
|
||||
globals.obj: globals.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foglobals.obj globals.c
|
||||
|
||||
init.obj: init.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foinit.obj init.c
|
||||
|
||||
main.obj: main.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fomain.obj main.c
|
||||
|
||||
moon.obj: moon.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fomoon.obj moon.c
|
||||
|
||||
omit.obj: omit.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foomit.obj omit.c
|
||||
|
||||
token.obj: token.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fotoken.obj token.c
|
||||
|
||||
trigger.obj: trigger.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fotrigger.obj trigger.c
|
||||
|
||||
userfns.obj: userfns.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fouserfns.obj userfns.c
|
||||
|
||||
utils.obj: utils.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foutils.obj utils.c
|
||||
|
||||
var.obj: var.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fovar.obj var.c
|
||||
|
||||
remind.exe: $(OBJS)
|
||||
link /NOI @lnk.msc
|
||||
|
||||
rem2ps.obj: rem2ps.c
|
||||
cl /c $(DEFINES) $(MODEL) /Forem2ps.obj rem2ps.c
|
||||
|
||||
rem2ps.exe: rem2ps.obj
|
||||
link /NOI rem2ps,rem2ps.exe,,,
|
||||
|
||||
110
makefile.os2
110
makefile.os2
@@ -1,110 +0,0 @@
|
||||
# Makefile for REMIND
|
||||
#
|
||||
# $Id: makefile.os2,v 1.1 1996-03-27 03:26:02 dfs Exp $
|
||||
#
|
||||
# - for GNU gcc (emx 0.8g kit) [executables for OS/2 2.x or DOS (32-bit)]
|
||||
# - for Microsoft C 6.00A [executables for OS/2 or MSDOS (16-bit)]
|
||||
|
||||
# To use, enter "make -f Makefile.os2" (this makefile depends on its
|
||||
# name being "Makefile.os2").
|
||||
#
|
||||
# Tested with dmake 3.8 and GNU make 3.68 under OS/2
|
||||
|
||||
default:
|
||||
@echo "Enter $(MAKE) -f Makefile.os2 target "
|
||||
@echo " where 'target' is chosen from "
|
||||
@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] "
|
||||
|
||||
|
||||
msc:
|
||||
$(MAKE) -f Makefile.os2 all \
|
||||
CC="cl -nologo -AM" O=".obj" \
|
||||
CFLAGS="-D__STDC__ -D__OS2__" \
|
||||
LFLAGS="-Lp" \
|
||||
LFLAGS2="setargv.obj remind.def -link /NOE"
|
||||
|
||||
mscbnd:
|
||||
$(MAKE) -f Makefile.os2 all \
|
||||
CC="cl -nologo -AM" O=".obj" \
|
||||
CFLAGS="-D__STDC__ -D__OS2__ -D__MSDOS__" \
|
||||
LFLAGS="-Lp" LBIND="-Fb" \
|
||||
LFLAGS2="setargv.obj remind.def -link /NOE" \
|
||||
BIND="bind remind /n DOSMAKEPIPE DOSCWAIT VIOENDPOPUP VIOPOPUP"
|
||||
|
||||
emx:
|
||||
$(MAKE) -f Makefile.os2 all \
|
||||
CC="gcc -O -s" O=".o" \
|
||||
CFLAGS="-D__OS2__ -D__MSDOS__" \
|
||||
LFLAGS=""
|
||||
|
||||
|
||||
# OS2_POPUP enables Russ Herman's popup reminders
|
||||
#OS2_POPUP =
|
||||
OS2_POPUP = -DOS2_POPUP
|
||||
|
||||
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
|
||||
|
||||
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 os2func.c
|
||||
|
||||
MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
|
||||
remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
|
||||
makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
|
||||
defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
|
||||
tstlang.rem README.BCC lnk.bcc makefile.bcc os2func.c \
|
||||
test-rem.bat test-rem.cmd test1.cmp test2.cmp
|
||||
|
||||
|
||||
OBJS= $(SRCS:.c=$O)
|
||||
|
||||
all: remind.exe rem2ps.exe
|
||||
|
||||
.c$O:
|
||||
$(CC) -c $(CFLAGS) $(OS2_POPUP) $*.c
|
||||
|
||||
rem2ps.exe: rem2ps$O
|
||||
$(CC) $(LFLAGS) $(LBIND) -o $@ rem2ps$O $(LFLAGS2)
|
||||
|
||||
remind.exe: $(OBJS)
|
||||
$(CC) $(LFLAGS) -o $@ $(OBJS) $(LFLAGS2)
|
||||
$(BIND)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.obj *~ core *.bak
|
||||
|
||||
clobber:
|
||||
rm -f *.o *.obj *~ remind.exe rem2ps.exe test.out core *.bak
|
||||
|
||||
test:
|
||||
test-rem.cmd
|
||||
|
||||
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 $(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
|
||||
68
makefile.tc
68
makefile.tc
@@ -1,68 +0,0 @@
|
||||
# Makefile for REMIND for Turbo C for MSDOS
|
||||
# $Id: makefile.tc,v 1.2 1996-03-31 04:08:11 dfs Exp $
|
||||
|
||||
CC= tcc
|
||||
VERSION= 03.00.14
|
||||
|
||||
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
|
||||
|
||||
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
|
||||
moon.c main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
|
||||
|
||||
OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
|
||||
globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
|
||||
utils.obj userfns.obj var.obj hbcal.obj
|
||||
|
||||
all: remind.exe rem2ps.exe
|
||||
|
||||
remind.exe: $(OBJS)
|
||||
$(CC) @lnk.tc
|
||||
|
||||
rem2ps.exe: rem2ps.obj
|
||||
$(CC) -erem2ps.exe rem2ps.obj
|
||||
|
||||
.c.obj:
|
||||
$(CC) -w-pia -c -O -mm {$< }
|
||||
|
||||
rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
|
||||
|
||||
calendar.obj: calendar.c $(STDHDRS) expr.h
|
||||
|
||||
dorem.obj: dorem.c $(STDHDRS) expr.h
|
||||
|
||||
dosubst.obj: dosubst.c $(STDHDRS) $(LANGHDRS)
|
||||
|
||||
expr.obj: expr.c $(STDHDRS) expr.h
|
||||
|
||||
files.obj: files.c $(STDHDRS)
|
||||
|
||||
funcs.obj: funcs.c $(STDHDRS) expr.h version.h
|
||||
|
||||
globals.obj: globals.c config.h types.h globals.h err.h lang.h
|
||||
|
||||
init.obj: init.c $(STDHDRS) expr.h version.h
|
||||
|
||||
main.obj: main.c $(STDHDRS) expr.h
|
||||
|
||||
moon.obj: moon.c $(STDHDRS) expr.h
|
||||
|
||||
omit.obj: omit.c $(STDHDRS)
|
||||
|
||||
sort.obj: sort.c $(STDHDRS)
|
||||
|
||||
token.obj: token.c $(STDHDRS)
|
||||
|
||||
trigger.obj: trigger.c $(STDHDRS) expr.h
|
||||
|
||||
userfns.obj: userfns.c $(STDHDRS) expr.h
|
||||
|
||||
utils.obj: utils.c $(STDHDRS)
|
||||
|
||||
var.obj: var.c $(STDHDRS) expr.h
|
||||
28
man/cm2rem.1
Normal file
28
man/cm2rem.1
Normal file
@@ -0,0 +1,28 @@
|
||||
.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,4 @@
|
||||
.\" $Id: rem2ps.1,v 1.2 1996-04-28 02:02:01 dfs Exp $
|
||||
.TH REM2PS 1 "27 April 1996"
|
||||
.TH REM2PS 1 "11 April 2005"
|
||||
.UC4
|
||||
.SH NAME
|
||||
rem2ps \- draw a PostScript calendar from Remind output
|
||||
@@ -9,6 +8,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
|
||||
@@ -73,10 +77,10 @@ Letter
|
||||
8.5 x 11 in.
|
||||
.TP
|
||||
Legal
|
||||
11 x 17 in.
|
||||
8.5 x 14 in.
|
||||
.TP
|
||||
Ledger
|
||||
8.5 x 14 in.
|
||||
11 x 17 in.
|
||||
.TP
|
||||
Statement
|
||||
5.5 x 8.5 in.
|
||||
@@ -107,11 +111,20 @@ Quarto
|
||||
.TP
|
||||
10x14
|
||||
10 x 14 in.
|
||||
.TP
|
||||
\fIX\fRx\fIY\fRin
|
||||
\fIX\fR by \fIY\fR inches, where \fIX\fR and \fIY\fR can be floating-point
|
||||
numbers.
|
||||
.TP
|
||||
\fIX\fRx\fIY\fRcm
|
||||
\fIX\fR by \fIY\fR centimetres, where \fIX\fR and \fIY\fR can be floating-point
|
||||
numbers.
|
||||
|
||||
.PP
|
||||
Type "rem2ps -m help" for a list of available media. Note that the media
|
||||
Type "rem2ps \-m help" for a list of available media. Note that the media
|
||||
type (and all \fBRem2ps\fR options) are case-sensitive. If you don't use
|
||||
the \fB\-m\fR option, the media defaults to a compiled-in default - this
|
||||
is usually Letter for North America and A4 for Europe. The "-m help"
|
||||
is usually Letter for North America and A4 for Europe. The "\-m help"
|
||||
option will display the compiled-in default.
|
||||
.RE
|
||||
.TP
|
||||
@@ -124,7 +137,7 @@ specifying:
|
||||
.RS
|
||||
.PP
|
||||
.nf
|
||||
-ftshe Helvetica -fd Helvetica-BoldOblique
|
||||
\-ftshe Helvetica \-fd Helvetica-BoldOblique
|
||||
.fi
|
||||
.PP
|
||||
In other words, the heading, entry and small-calendar fonts are set
|
||||
@@ -140,7 +153,7 @@ are equivalent to specifying:
|
||||
.RS
|
||||
.PP
|
||||
.nf
|
||||
-sthd 14 -se 8
|
||||
\-sthd 14 \-se 8
|
||||
.fi
|
||||
.PP
|
||||
In other words, the heading and day numbers are 14-point fonts, and the
|
||||
@@ -166,7 +179,7 @@ for good output:
|
||||
.PP
|
||||
.nf
|
||||
# This gives good results for putting into a binder
|
||||
rem2ps -ol 72 -sh 12
|
||||
rem2ps \-ol 72 \-sh 12
|
||||
.fi
|
||||
.SH USAGE
|
||||
To use \fBRem2ps\fR, you should pipe the output of \fBRemind\fR with the \fB\-p\fR
|
||||
@@ -174,14 +187,14 @@ option to \fBRem2ps\fR, and then send the result to a printer. This is most eas
|
||||
illustrated with examples:
|
||||
.PP
|
||||
.nf
|
||||
remind -p12 /dev/null 1 jan 1994 | rem2ps | lpr -Plaser
|
||||
remind \-p12 /dev/null 1 jan 1994 | rem2ps | lpr \-Plaser
|
||||
.fi
|
||||
.PP
|
||||
That example creates a blank calendar for the entire year of 1994, and
|
||||
sends it the the printer named "laser."
|
||||
.PP
|
||||
.nf
|
||||
remind -p ~/.reminders | rem2ps -l -sd 18 > cal.ps
|
||||
remind \-p ~/.reminders | rem2ps \-l \-sd 18 > cal.ps
|
||||
.fi
|
||||
.PP
|
||||
This reminder creates a calendar for the current month, filling in
|
||||
@@ -300,8 +313,88 @@ 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. Note that the date components are
|
||||
always separated by "/" even if the date separator in \fBRemind\fR has
|
||||
been set to "-". The consistent use of "/" is designed to ease parsing.
|
||||
.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
|
||||
If you supply the \fB\-l\fR option to \fBremind\fR, then reminders
|
||||
may be preceded by a line that looks like this:
|
||||
.PP
|
||||
\fB# fileinfo \fIlineno filename\fR
|
||||
.PP
|
||||
The word \fBfileinfo\fR is literal; \fIlineno\fR and \fIfilename\fR specify
|
||||
the line number and file name of the file containing the reminder. Back-ends
|
||||
that don't care about this information should ignore lines starting with
|
||||
"#" (except, of course, for the # rem2ps lines.)
|
||||
.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
|
||||
File diff suppressed because it is too large
Load Diff
356
man/tkremind.1
Normal file
356
man/tkremind.1
Normal file
@@ -0,0 +1,356 @@
|
||||
.TH TKREMIND 1 "15 February 1998"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
tkremind \- graphical front-end to Remind calendar program
|
||||
.SH SYNOPSIS
|
||||
.B tkremind \fR[\fIoptions\fR] [\fIread_file\fR] [\fIwrite_file\fR]
|
||||
.SH DESCRIPTION
|
||||
\fBTkRemind\fR is a graphical front-end to the \fBRemind\fR program.
|
||||
It provides a friendly graphical interface which allows you to view
|
||||
your calendar and add reminders without learning the syntax of \fBRemind\fR.
|
||||
Although not all of \fBRemind\fR's features are available with \fBTkRemind\fR,
|
||||
\fBTkRemind\fR gives you an opportunity to edit the reminder commands which
|
||||
it creates. This allows you to learn \fBRemind\fR's syntax and then add
|
||||
extra features as you become a more sophisticated \fBRemind\fR programmer.
|
||||
|
||||
\fBTkRemind\fR is written in Tcl, and requires 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
|
||||
on to \fBRemind\fR. The options it passes are
|
||||
\fB\-b\fR, \fB\-g\fR, \fB\-x\fR, \fB\-i\fR and \fB\-m\fR.
|
||||
See the \fBRemind\fR man page for details about the options.
|
||||
|
||||
\fIRead_file\fR is the file from which \fBTkRemind\fR reads reminders.
|
||||
It is in standard \fBRemind\fR format. \fIWrite_file\fR is the file
|
||||
to which \fBTkRemind\fR writes reminders which you add using the GUI.
|
||||
If \fIRead_file\fR is omitted, it defaults to \fB$HOME/.reminders\fR.
|
||||
If \fIWrite_file\fR is omitted, it defaults to \fIRead_file\fR.
|
||||
|
||||
You may wish to have a different \fIWrite_file\fR from \fIRead_file\fR if
|
||||
you want to collect all of \fBTkRemind\fR's reminders in one place. Suppose
|
||||
your main file is \fI$HOME/.reminders\fR and you want \fBTkRemind\fR to put
|
||||
its reminders in \fI$HOME/.tkreminders\fR. In \fI$HOME/.reminders\fR,
|
||||
include the line:
|
||||
.PP
|
||||
.nf
|
||||
INCLUDE [getenv("HOME")]/.tkreminders
|
||||
.fi
|
||||
.PP
|
||||
|
||||
.SH THE CALENDAR WINDOW
|
||||
When you start \fBTkRemind\fR, it displays a calendar for the current
|
||||
month, with today's date highlighted. Reminders are filled into each
|
||||
box on the calendar. If a box contains many reminders, you can scroll
|
||||
it up and down by dragging mouse button 2 in the box. Note that there
|
||||
is no specific indication of an over-full box; you'll just have to
|
||||
notice that the box appears completely full.
|
||||
|
||||
.SH NAVIGATING
|
||||
To change to the previous or next month, click the \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.
|
||||
|
||||
.SH ADDING REMINDERS
|
||||
To add a reminder, click button 1 in any day number in the calendar.
|
||||
The \fBAdd Reminder...\fR dialog will pop up, with values preselected for
|
||||
the day you clicked.
|
||||
|
||||
The dialog has six basic groups of controls. The first three lines
|
||||
select one of three types of reminders. Choose the type of reminder
|
||||
with the radio buttons, and choose the values of the days, months, and
|
||||
years by selecting values from pull-down menus. The pull-down menus
|
||||
appear when you click the raised value buttons.
|
||||
|
||||
The next control specifies an expiry date for the reminder. Select
|
||||
the check button to enable an expiry date, and fill in the values
|
||||
using pull-down menus.
|
||||
|
||||
The third control specifes how much advance notice you want (if any),
|
||||
and whether or not weekends and holidays are counted when computing advance
|
||||
notice.
|
||||
|
||||
The fourth control specifies which days \fBRemind\fR considers
|
||||
as part of the weekend. This can affect the interpretation of "weekday"
|
||||
in the second and third types of reminders.
|
||||
|
||||
The fifth control associates a time with the reminder.
|
||||
You can also specify advance notice, possibly repeating.
|
||||
|
||||
The sixth control specifies what \fBRemind\fR should do if a reminder
|
||||
falls on a holiday or weekend.
|
||||
|
||||
Enter the body of the reminder into the \fBBody:\fR text entry.
|
||||
|
||||
To add the reminder to the reminder file, click \fBAdd to reminder file\fR.
|
||||
To close the dialog without adding the reminder to the file, click
|
||||
\fBCancel\fR. To preview the reminder, click \fBPreview reminder\fR.
|
||||
This pops up the \fBPreview reminder\fR dialog box.
|
||||
|
||||
.SH PREVIEWING REMINDERS
|
||||
The \fBPreview reminder\fR dialog box is an excellent way to learn
|
||||
\fBRemind\fR. It displays the \fBRemind\fR command which realizes the
|
||||
reminder you entered using the \fBAdd Reminder...\fR dialog. You can
|
||||
edit the reminder, thereby gaining access to advanced features of
|
||||
\fBRemind\fR. You can also use it simply to play around and discover
|
||||
\fBRemind\fR's idioms for expressing different types of reminders.
|
||||
|
||||
.SH PRINTING
|
||||
To print the current month's calender, click \fBPrint...\fR on the
|
||||
main calendar window. This brings up the print dialog. Printing
|
||||
either produces a PostScript file or sends PostScript to a UNIX command.
|
||||
|
||||
Select the print destination by choosing either \fBTo file:\fR or
|
||||
\fBTo command:\fR in the print dialog. Press \fBBrowse...\fR to bring
|
||||
up a file browser. In the file browser, you can enter a filename in
|
||||
the text entry, double-click on a filename in the listbox, or
|
||||
double-click on a directory to navigate the file system. You can also
|
||||
type the first few characters of a file name in the text entry box and
|
||||
press space to complete the name to the first matching entry.
|
||||
|
||||
The \fBMatch:\fR box contains a filename wildcard which filters files
|
||||
in the listbox. You can change the filter and press enter to rescan
|
||||
the directory.
|
||||
|
||||
Select the appropriate paper size and orientation. Activate
|
||||
\fBFill page\fR if you want the calendar to fill the page. This should
|
||||
be the normal case unless you have many reminders in a particular
|
||||
day. (See the \fBRem2PS\fR documentation.)
|
||||
|
||||
Finally, click \fBPrint\fR to print or \fBCancel\fR to cancel.
|
||||
Note that during printing, \fBRemind\fR is \fInot\fR called with
|
||||
the \fB-itkremind=1\fR option, because it is operated in normal
|
||||
PostScript-producing mode.
|
||||
|
||||
.SH 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 USING A TEXT EDITOR
|
||||
|
||||
If you have set the "text editor" option correctly, right-clicking
|
||||
on a reminder will bring up a text editor on the file containing
|
||||
the reminder. The cursor will be positioned on the line that
|
||||
generated the reminder.
|
||||
|
||||
.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 Show Today's Reminders on Startup
|
||||
If this is selected, \fBTkRemind\fR shows a text window containing reminders
|
||||
which would be issued by "remind -q -a -r" on startup, and when the date
|
||||
changes at midnight.
|
||||
|
||||
.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.
|
||||
|
||||
.TP
|
||||
.B E-mail reminders here if popup not dismissed
|
||||
If you enter a non-blank e-mail address in this field, then \fBTkRemind\fR
|
||||
will e-mail you a reminder if you don't dismiss the popup box within
|
||||
one minute. This is useful if you need to leave your terminal but
|
||||
want your reminders to "follow" you via e-mail.
|
||||
|
||||
.TP
|
||||
.B Name or IP address of SMTP server
|
||||
\fBTkRemind\fR uses a direct SMTP connection to send mail. Enter the
|
||||
IP address of your SMTP server here.
|
||||
|
||||
.TP
|
||||
.B Text Editor
|
||||
This specifies a text editor to invoke when a reminder is right-clicked.
|
||||
The characters "%d" are replaced with the lined number of the file
|
||||
containing the reminder, and "%s" are replaced with the file name.
|
||||
Useful strings might be "emacs +%d %s" or "gvim +%d %s"
|
||||
|
||||
.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
|
||||
-itkremind=1
|
||||
.fi
|
||||
.PP
|
||||
on the command line. So, in your \fBRemind\fR file, you can include:
|
||||
.PP
|
||||
.nf
|
||||
IF defined("tkremind")
|
||||
# Then I'm probably being invoked by TkRemind
|
||||
ENDIF
|
||||
.fi
|
||||
.PP
|
||||
You can use this to activate certain reminders in different ways
|
||||
for \fBTkRemind\fR (for example).
|
||||
.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
|
||||
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-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
|
||||
158
os2func.c
158
os2func.c
@@ -1,158 +0,0 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* OS2FUNC.C */
|
||||
/* */
|
||||
/* Functions to support OS/2. */
|
||||
/* */
|
||||
/* 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 */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
static char const RCSID[] = "$Id: os2func.c,v 1.1 1996-03-27 03:26:04 dfs Exp $";
|
||||
|
||||
#ifdef OS2_POPUP
|
||||
#define INCL_VIO
|
||||
#define INCL_KBD
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define INCL_DOSPROCESS
|
||||
#endif
|
||||
|
||||
#if defined(OS2_POPUP) || defined(_MSC_VER)
|
||||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
#ifdef OS2_POPUP
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef OS2DBG
|
||||
#include <dos.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include "config.h"
|
||||
#include "globals.h"
|
||||
|
||||
/* EMX defines PS_TYPE, so we undefine it here to avoid
|
||||
a redefinition warning when we include "types.h" */
|
||||
#ifdef PS_TYPE
|
||||
#undef PS_TYPE
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
typedef USHORT APIRET;
|
||||
#endif
|
||||
|
||||
static APIRET apiret = 0;
|
||||
static KBDKEYINFO kbci;
|
||||
static char *pszPressAny = "\r\nPress any key to continue";
|
||||
static USHORT pflags = VP_WAIT; /* | VP_TRANSPARENT; */
|
||||
static HKBD hkbd = 0;
|
||||
static char VioSubstBuffer[SHELLSIZE + 1];
|
||||
|
||||
void StartPopUp()
|
||||
{
|
||||
if (OS2MODE)
|
||||
if (!(DebugFlag & DB_ECHO_LINE))
|
||||
VioPopUp(&pflags, 0);
|
||||
}
|
||||
|
||||
void EndPopUp()
|
||||
{
|
||||
if (DebugFlag & DB_ECHO_LINE)
|
||||
return;
|
||||
if (OS2MODE) {
|
||||
VioWrtTTY(pszPressAny, strlen(pszPressAny), 0);
|
||||
KbdCharIn(&kbci, IO_WAIT, hkbd);
|
||||
VioEndPopUp(0);
|
||||
}
|
||||
}
|
||||
|
||||
int PutsPopUp(char *s)
|
||||
{
|
||||
char c, *os = VioSubstBuffer;
|
||||
|
||||
if (DebugFlag & DB_ECHO_LINE)
|
||||
printf("%s", s);
|
||||
else {
|
||||
do {
|
||||
/* Convert \n to \r\n in auxiliary buffer for VIO */
|
||||
if ((c= *s++) == '\n')
|
||||
*os++ = '\r';
|
||||
*os++ = c;
|
||||
} while (c > 0);
|
||||
VioWrtTTY(VioSubstBuffer, strlen(VioSubstBuffer), 0);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
int PutlPopUp(char *s)
|
||||
{
|
||||
StartPopUp();
|
||||
PutsPopUp(s);
|
||||
if (DebugFlag & DB_ECHO_LINE)
|
||||
fputc('\n', stdout);
|
||||
else
|
||||
VioWrtTTY("\r\n", 2, 0);
|
||||
EndPopUp();
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int PutcPopUp(int c)
|
||||
{
|
||||
char *s = " ";
|
||||
|
||||
if (DebugFlag & DB_ECHO_LINE)
|
||||
fputc(c, stdout);
|
||||
else {
|
||||
switch (c) {
|
||||
case '\n':
|
||||
VioWrtTTY("\r\n", 2, 0);
|
||||
break;
|
||||
default:
|
||||
s[0] = c;
|
||||
VioWrtTTY(s, 1, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef OS2DBG
|
||||
#define DB_ECHO_LINE 16
|
||||
int DebugFlag = 0;
|
||||
void main(/* int argc, char **argv */)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = os2fputs("Test VIO PopUp Writing");
|
||||
if (ret)
|
||||
fprintf(stderr, "Test VIO PopUP Writing returned %d %ld",
|
||||
ret, apiret);
|
||||
exit(ret);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
unsigned sleep(unsigned sec)
|
||||
{
|
||||
return DosSleep(sec * 1000L);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __EMX__
|
||||
int fork()
|
||||
{
|
||||
return(-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
176
protos.h
176
protos.h
@@ -1,176 +0,0 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* PROTOS.H */
|
||||
/* */
|
||||
/* Function Prototypes. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: protos.h,v 1.2 1996-03-31 04:01:57 dfs Exp $ */
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
#define ARGS(x) x
|
||||
#else
|
||||
#define ARGS(x) ()
|
||||
#endif
|
||||
|
||||
/* Define a string assignment macro - be careful!!! */
|
||||
#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
|
||||
|
||||
/* Define a general malloc routine for creating pointers to objects */
|
||||
#define NEW(type) ((type *) malloc(sizeof(type)))
|
||||
|
||||
#ifdef NO_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));
|
||||
int DoRem ARGS ((ParsePtr p));
|
||||
int DoFlush ARGS ((ParsePtr p));
|
||||
void DoExit ARGS ((ParsePtr p));
|
||||
int ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim));
|
||||
#ifdef OS2_POPUP
|
||||
int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul,
|
||||
int AsPopUp));
|
||||
#else
|
||||
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 EvalExpr ARGS ((char **e, Value *v));
|
||||
int DoCoerce ARGS ((char type, Value *v));
|
||||
void PrintValue ARGS ((Value *v, FILE *fp));
|
||||
int CopyValue ARGS ((Value *dest, const Value *src));
|
||||
int ReadLine ARGS ((void));
|
||||
int OpenFile ARGS ((const char *fname));
|
||||
int PopFile ARGS ((void));
|
||||
int DoInclude ARGS ((ParsePtr p));
|
||||
int IncludeFile ARGS ((const char *fname));
|
||||
int GetAccessDate ARGS ((char *file));
|
||||
int SetAccessDate ARGS ((char *fname, int jul));
|
||||
int TopLevel ARGS ((void));
|
||||
int CallFunc ARGS ((Operator *f, int nargs));
|
||||
void InitRemind ARGS ((int argc, char *argv[]));
|
||||
void Usage ARGS ((void));
|
||||
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 EvaluateExpr ARGS ((ParsePtr p, Value *v));
|
||||
int Evaluate ARGS ((char **s, Var *locals));
|
||||
int FnPopValStack ARGS ((Value *val));
|
||||
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));
|
||||
long SystemTime ARGS ((int realtime));
|
||||
int SystemDate ARGS ((int *y, int *m, int *d));
|
||||
int DoIf ARGS ((ParsePtr p));
|
||||
int DoElse ARGS ((ParsePtr p));
|
||||
int DoEndif ARGS ((ParsePtr p));
|
||||
int DoIfTrig ARGS ((ParsePtr p));
|
||||
int ShouldIgnoreLine ARGS ((void));
|
||||
int VerifyEoln ARGS ((ParsePtr p));
|
||||
int DoDebug ARGS ((ParsePtr p));
|
||||
int DoBanner ARGS ((ParsePtr p));
|
||||
int DoRun ARGS ((ParsePtr p));
|
||||
int DoErrMsg ARGS ((ParsePtr p));
|
||||
int ClearGlobalOmits ARGS ((void));
|
||||
int DoClear ARGS ((ParsePtr p));
|
||||
int DestroyOmitContexts ARGS ((void));
|
||||
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));
|
||||
void HandleQueuedReminders ARGS ((void));
|
||||
char *FindInitialToken ARGS ((Token *tok, char *s));
|
||||
void FindToken ARGS ((const char *s, Token *tok));
|
||||
void FindNumericToken ARGS ((const char *s, Token *t));
|
||||
int ComputeTrigger ARGS ((int today, Trigger *trig, int *err));
|
||||
char *StrnCpy ARGS ((char *dest, const char *source, int n));
|
||||
int StrMatch ARGS ((const char *s1, const char *s2, int n));
|
||||
int StrinCmp ARGS ((const char *s1, const char *s2, int n));
|
||||
char *StrDup ARGS ((const char *s));
|
||||
int StrCmpi ARGS ((const char *s1, const char *s2));
|
||||
Var *FindVar ARGS ((const char *str, int create));
|
||||
int DeleteVar ARGS ((const char *str));
|
||||
int SetVar ARGS ((const char *str, Value *val));
|
||||
int GetVarValue ARGS ((const char *str, Value *val, Var *locals));
|
||||
int DoSet ARGS ((Parser *p));
|
||||
int DoUnset ARGS ((Parser *p));
|
||||
int DoDump ARGS ((ParsePtr p));
|
||||
void DumpVarTable ARGS ((void));
|
||||
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 ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
|
||||
unsigned int HashVal ARGS ((const char *str));
|
||||
int DateOK ARGS ((int y, int m, int d));
|
||||
Operator *FindFunc ARGS ((char *name, Operator where[], int num));
|
||||
int InsertIntoSortBuffer ARGS ((int jul, int tim, char *body, int typ, int prio));
|
||||
void IssueSortedReminders ARGS ((void));
|
||||
int UserFuncExists ARGS ((char *fn));
|
||||
void JulToHeb ARGS((int jul, int *hy, int *hm, int *hd));
|
||||
int HebNameToNum ARGS((const char *mname));
|
||||
char *HebMonthName ARGS((int m, int y));
|
||||
int RoshHashana ARGS((int i));
|
||||
long DaysToHebYear ARGS((int y));
|
||||
int DaysInHebYear ARGS((int y));
|
||||
char *DaysInHebMonths ARGS((int ylen));
|
||||
int HebToJul ARGS((int hy, int hm, int hd));
|
||||
int GetValidHebDate ARGS((int yin, int min, int din, int adarbehave, int *mout, int *dout, int yahr));
|
||||
int GetNextHebrewDate ARGS((int julstart, int hm, int hd, int yahr, int adarbehave, int *ans));
|
||||
int ComputeJahr ARGS ((int y, int m, int d, int *ans));
|
||||
int GetSysVar ARGS ((const char *name, Value *val));
|
||||
int SetSysVar ARGS ((const char *name, Value *val));
|
||||
void DumpSysVarByName ARGS ((const char *name));
|
||||
int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
|
||||
#ifdef OS2_POPUP
|
||||
void FillParagraph ARGS ((char *s, int AsPopUp));
|
||||
#else
|
||||
void FillParagraph ARGS ((char *s));
|
||||
#endif
|
||||
void LocalToUTC ARGS ((int locdate, int loctime, int *utcdate, int *utctime));
|
||||
void UTCToLocal ARGS ((int utcdate, int utctime, int *locdate, int *loctime));
|
||||
int MoonPhase ARGS ((int date, int time));
|
||||
void HuntPhase ARGS ((int startdate, int starttim, int phas, int *date, int *time));
|
||||
int CompareRems ARGS ((int dat1, int tim1, int prio1, int dat2, int tim2, int prio2, int bydate, int bytime, int byprio));
|
||||
#ifdef __BORLANDC__
|
||||
void __cdecl SigIntHandler ARGS ((int d));
|
||||
#else
|
||||
#ifdef SIGHANDLER_INT_ARG
|
||||
void SigIntHandler ARGS ((int d));
|
||||
#else
|
||||
void SigIntHandler ARGS ((void));
|
||||
#endif
|
||||
#endif
|
||||
void GotSigInt ARGS ((void));
|
||||
|
||||
#if defined(__OS2__)
|
||||
int fork ARGS ((void));
|
||||
#if defined(OS2_POPUP)
|
||||
void StartPopUp ARGS ((void));
|
||||
void EndPopUp ARGS ((void));
|
||||
int PutcPopUp ARGS ((int c));
|
||||
int PutlPopUp ARGS ((char *s));
|
||||
int PutsPopUp ARGS ((char *s));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
int SafePutChar ARGS ((int ch));
|
||||
int SafePutc ARGS ((int ch, FILE *fp));
|
||||
#endif
|
||||
45
rem
45
rem
@@ -1,45 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# rem - by David Skoll - 26 February 1991
|
||||
#
|
||||
# $Id: rem,v 1.1 1996-03-27 03:26:06 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
|
||||
# you use rem unless you wanted to accept the default??)
|
||||
|
||||
# ------ You may wish to change the defaults below this line ------
|
||||
|
||||
# The default reminder file
|
||||
DEFAULT=$HOME/.reminders
|
||||
|
||||
# The executable file (you may wish to change this to /usr/local/bin/remind
|
||||
# or whatever.
|
||||
EXECUTABLE=remind
|
||||
|
||||
# No options yet
|
||||
OPTIONS=""
|
||||
|
||||
# No parameters yet
|
||||
PARAMETERS=""
|
||||
|
||||
# ------ You shouldn't change anything below this line -----
|
||||
|
||||
# Scan for options
|
||||
while test "$1" != ""
|
||||
do
|
||||
case $1 in
|
||||
|
||||
-F) DEFAULT=$2
|
||||
shift
|
||||
shift ;;
|
||||
|
||||
-*) OPTIONS="$OPTIONS $1"
|
||||
shift ;;
|
||||
|
||||
*) PARAMETERS=$*
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
$EXECUTABLE $OPTIONS $DEFAULT $PARAMETERS
|
||||
35
rem.1
35
rem.1
@@ -1,35 +0,0 @@
|
||||
.\" $Id: rem.1,v 1.2 1996-04-28 02:02:01 dfs Exp $
|
||||
.TH REM 1 "26 February 1991"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
rem \- run 'remind' with a default reminder file
|
||||
.SH SYNOPSIS
|
||||
.B rem
|
||||
[\-F \fIfilename\fR] [\fIremind_options\fR] [\fIremind_params\fR]
|
||||
.SH DESCRIPTION
|
||||
.B Rem
|
||||
runs the \fBremind\fR program with a default reminder file of
|
||||
"$HOME/.reminders". You can supply remind options on the command line,
|
||||
as well as a date specification, just as with \fBremind\fR.
|
||||
|
||||
If you don't want to use the default filename, you can override it with
|
||||
the "-F" option, followed by a space and a filename. (This, however,
|
||||
defeats the purpose of \fBrem\fR)
|
||||
.PP
|
||||
For example, typing:
|
||||
.PP
|
||||
.nf
|
||||
rem -c 1 jan 1992
|
||||
.fi
|
||||
.PP
|
||||
has the same effect as typing:
|
||||
.PP
|
||||
.nf
|
||||
remind -c $HOME/.reminders 1 jan 1992
|
||||
.fi
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
David F. Skoll
|
||||
.SH SEE ALSO
|
||||
remind, kall
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/bin/csh -f
|
||||
|
||||
# Shell script to mail all users reminders.
|
||||
|
||||
# $Id: remind-all.csh,v 1.1 1996-03-27 03:26:08 dfs Exp $
|
||||
|
||||
# Run it AFTER MIDNIGHT so that date is correct!
|
||||
# On our system, we have the following in our crontab:
|
||||
# 05 5 * * * /usr/share/lib/remind/remind-all > /dev/null 2>&1
|
||||
|
||||
# This script must be run by root. The -u option MUST be supplied
|
||||
# to Remind, or a severe security hole will exist. Note that Remind
|
||||
# must be compiled to support the -u option for this script to work.
|
||||
# Also, the -r and -q options must be used.
|
||||
|
||||
# The following line gets a list of users for systems using SUN's
|
||||
# NIS service:
|
||||
set USERS = `ypcat passwd | awk -F: '{print $1}'`
|
||||
|
||||
# The following line gets a list of users by examining /etc/passwd:
|
||||
# set USERS = `awk -F: '{print $1}' /etc/passwd`
|
||||
|
||||
# If neither of the above methods works, you must come up with some
|
||||
# way of getting a list of users on the system
|
||||
|
||||
# Set the following variables as appropriate for your system
|
||||
set REMIND = /usr/local/bin/remind
|
||||
set MAIL = /usr/ucb/mail
|
||||
set RM = "/usr/bin/rm -f"
|
||||
|
||||
set REMFILE = /tmp/RemFile.$$
|
||||
|
||||
# Scan each user's directory for a .reminders file
|
||||
foreach i ($USERS)
|
||||
if (-r ~$i/.reminders) then
|
||||
# echo "$i has a .reminders file." DEBUGGING PURPOSES ONLY
|
||||
|
||||
$REMIND -u$i -h -r -q -iremind_all=1 ~$i/.reminders < /dev/null > $REMFILE
|
||||
if (! -z $REMFILE) then
|
||||
# echo "Sending mail to $i" DEBUGGING PURPOSES ONLY
|
||||
|
||||
$MAIL -s "Reminders" $i < $REMFILE
|
||||
endif
|
||||
$RM $REMFILE
|
||||
endif
|
||||
end
|
||||
@@ -1,54 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Shell script to mail all users reminders.
|
||||
|
||||
# This file is part of REMIND
|
||||
#
|
||||
# $Id: remind-all.sh,v 1.1 1996-03-27 03:26:08 dfs Exp $
|
||||
#
|
||||
# REMIND is Copyright (C) 1992-1996 by David F. Skoll
|
||||
# This file is Copyright (C) 1990 by Bill Aten
|
||||
|
||||
# Thanks to Bill Aten for this script.
|
||||
|
||||
# Run it AFTER MIDNIGHT so that date is correct!
|
||||
# On our system, we have the following in our crontab:
|
||||
# 02 00 * * * /usr/local/adm/remind-all >/dev/null 2>&1
|
||||
|
||||
# This script must be run by root. The -u option MUST be supplied
|
||||
# to Remind, or a severe security hole will exist. Note that Remind
|
||||
# must be compiled to support the -u option for this script to work.
|
||||
# Also, the -r and -q options must be used.
|
||||
|
||||
# The following line gets a list of users for systems using SUN's
|
||||
# NIS service:
|
||||
# USERS=`ypcat passwd | awk -F: '{print $1}'`
|
||||
|
||||
# The following line gets a list of users by examining /etc/passwd:
|
||||
USERS=`awk -F: '{print $1}' /etc/passwd`
|
||||
|
||||
# If neither of the above methods works, you must come up with some
|
||||
# way of getting a list of users on the system
|
||||
|
||||
# Set the following variables as appropriate for your system
|
||||
REMIND=/usr/local/bin/remind
|
||||
MAIL=/usr/bin/mail
|
||||
RM="/bin/rm -f"
|
||||
|
||||
REMFILE=/tmp/RemFile.$$
|
||||
|
||||
# Scan each user's directory for a .reminders file
|
||||
for i in $USERS
|
||||
do
|
||||
HOME=`grep \^$i: /etc/passwd | awk -F: '{print $6}'`
|
||||
if [ -r $HOME/.reminders ]; then
|
||||
|
||||
# echo "$i has a .reminders file." DEBUGGING PURPOSES ONLY
|
||||
|
||||
$REMIND -u$i -h -r -q -iremind_all=1 $HOME/.reminders < /dev/null > $REMFILE
|
||||
if [ -s $REMFILE ]; then
|
||||
# echo "Sending mail to $i" DEBUGGING PURPOSES ONLY
|
||||
$MAIL -s "Reminders" $i < $REMFILE
|
||||
fi
|
||||
$RM $REMFILE
|
||||
fi
|
||||
done
|
||||
@@ -1 +0,0 @@
|
||||
NAME WINDOWCOMPAT NEWFILES
|
||||
4
scripts/README
Normal file
4
scripts/README
Normal file
@@ -0,0 +1,4 @@
|
||||
Files in this directory:
|
||||
|
||||
tkremind -- Tcl/Tk graphical calendar using Remind as engine
|
||||
cm2rem.tcl -- Convert Sun's "cm" calendar manager files to Remind.
|
||||
359
scripts/cm2rem.tcl
Executable file
359
scripts/cm2rem.tcl
Executable file
@@ -0,0 +1,359 @@
|
||||
#!/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.
|
||||
#
|
||||
#--------------------------------------------------------------
|
||||
|
||||
# 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
|
||||
2788
scripts/tkremind
Executable file
2788
scripts/tkremind
Executable file
File diff suppressed because it is too large
Load Diff
93
smakefile
93
smakefile
@@ -1,93 +0,0 @@
|
||||
# $Id: smakefile,v 1.2 1996-04-29 19:34:39 dfs Exp $
|
||||
# Makefile for REMIND, suitable for SAS/C 6.50 under AmigaDOS
|
||||
# English version
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# THINGS FOR YOU TO EDIT START BELOW
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Uncomment the next line if you are running on a SYSV system
|
||||
# SYSV= -DSYSV
|
||||
|
||||
# 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= SC
|
||||
LD= SC
|
||||
|
||||
# Put any additional flags for the C compiler or linker here - if you
|
||||
# are not using gcc, you probably want to remove '-ansi'.
|
||||
CFLAGS= OPT NOSTKCHK NOSINT MATH=IEEE
|
||||
CDEFS=
|
||||
LDFLAGS= LINK
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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 amiga.c
|
||||
|
||||
OBJS= calendar.o dorem.o dosubst.o expr.o files.o funcs.o globals.o hbcal.o \
|
||||
init.o main.o moon.o omit.o sort.o queue.o token.o trigger.o userfns.o \
|
||||
utils.o var.o amiga.o
|
||||
|
||||
MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
|
||||
remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
|
||||
makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
|
||||
defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
|
||||
tstlang.rem README.BCC lnk.bcc makefile.bcc os2func.c \
|
||||
test-rem.bat test-rem.cmd test1.cmp test2.cmp
|
||||
|
||||
|
||||
all: remind rem2ps
|
||||
|
||||
.c.o:
|
||||
$(CC) $(UNIX) $(SYSV) $(CFLAGS) $(CDEFS) $*.c
|
||||
|
||||
rem2ps: rem2ps.o
|
||||
$(LD) MATH=IEEE $(LDFLAGS) PNAME=rem2ps rem2ps.o
|
||||
|
||||
remind: $(OBJS)
|
||||
$(LD) MATH=IEEE $(LDFLAGS) PNAME=remind $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -f *.o *~ core *.bak
|
||||
|
||||
clobber:
|
||||
rm -f *.o *~ remind rem2ps test.out core *.bak
|
||||
|
||||
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
|
||||
|
||||
amiga.o: amiga.c
|
||||
$(CC) OBJNAME=amiga.o $(CFLAGS) amiga.c
|
||||
88
src/Makefile.in
Normal file
88
src/Makefile.in
Normal file
@@ -0,0 +1,88 @@
|
||||
# Makefile.in for REMIND
|
||||
#
|
||||
|
||||
VERSION=03.01.01
|
||||
SHELL= /bin/sh
|
||||
BETA = 1
|
||||
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/tkremind $(srcdir)/../scripts/cm2rem.tcl
|
||||
|
||||
MANS= $(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 md5.c moon.c omit.c queue.c \
|
||||
sort.c token.c trigger.c userfns.c utils.c var.c
|
||||
|
||||
REMINDHDRS=config.h custom.h dynbuf.h err.h expr.h globals.h lang.h \
|
||||
md5.h protos.h rem2ps.h types.h version.h
|
||||
REMINDOBJS= $(REMINDSRCS:.c=.o)
|
||||
|
||||
all: remind rem2ps
|
||||
|
||||
test: remind
|
||||
sh ../tests/test-rem
|
||||
|
||||
.c.o:
|
||||
@CC@ -c @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -I. -I$(srcdir) $<
|
||||
|
||||
rem2ps: rem2ps.o dynbuf.o
|
||||
@CC@ @LDFLAGS@ $(LDEXTRA) -o rem2ps rem2ps.o dynbuf.o
|
||||
|
||||
remind: $(REMINDOBJS)
|
||||
@CC@ @LDFLAGS@ $(LDEXTRA) -o remind $(REMINDOBJS) @LIBS@
|
||||
|
||||
install: all
|
||||
-mkdir -p $(DESTDIR)$(bindir) || true
|
||||
for prog in $(PROGS) $(SCRIPTS) ; do \
|
||||
$(INSTALL_PROGRAM) $$prog $(DESTDIR)$(bindir) || exit 1; \
|
||||
done
|
||||
-strip $(DESTDIR)$(bindir)/remind || true
|
||||
-strip $(DESTDIR)$(bindir)/rem2ps || true
|
||||
-mkdir -p $(DESTDIR)$(mandir)/man1 || true
|
||||
for man in $(MANS) ; do \
|
||||
$(INSTALL_DATA) $$man $(DESTDIR)$(mandir)/man1 || exit 1; \
|
||||
done
|
||||
|
||||
clean:
|
||||
rm -f *.o *~ core *.bak $(PROGS)
|
||||
|
||||
clobber:
|
||||
rm -f *.o *~ remind rem2ps test.out core *.bak
|
||||
|
||||
depend:
|
||||
gccmakedep @DEFS@ $(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 git.
|
||||
distro:
|
||||
ln -s . ../remind-$(VERSION)
|
||||
(cd ..; git-ls-files) | sed -e 's/^/remind-$(VERSION)\//' | xargs tar -C .. -cvf remind-$(VERSION).tar
|
||||
gzip -f -v -9 remind-$(VERSION).tar
|
||||
rm -f ../remind-$(VERSION)
|
||||
|
||||
beta-tgz:
|
||||
ln -s . ../remind-$(VERSION)-BETA-$(BETA)
|
||||
(cd ..; git-ls-files) | sed -e 's/^/remind-$(VERSION)-BETA-$(BETA)\//' | xargs tar -C .. -cvf remind-$(VERSION)-BETA-$(BETA).tar
|
||||
gzip -f -v -9 remind-$(VERSION)-BETA-$(BETA).tar
|
||||
rm -f ../remind-$(VERSION)-BETA-$(BETA)
|
||||
|
||||
#---------------- Stuff after this added by "make depend" -----------------
|
||||
|
||||
@@ -5,27 +5,25 @@
|
||||
/* 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"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
#include "md5.h"
|
||||
|
||||
/* Data structures used by the calendar */
|
||||
typedef struct cal_entry {
|
||||
@@ -34,6 +32,11 @@ typedef struct cal_entry {
|
||||
char *pos;
|
||||
int time;
|
||||
int priority;
|
||||
char tag[TAG_LEN+1];
|
||||
char passthru[PASSTHRU_LEN+1];
|
||||
int duration;
|
||||
char *filename;
|
||||
int lineno;
|
||||
} CalEntry;
|
||||
|
||||
/* Global variables */
|
||||
@@ -42,22 +45,22 @@ static CalEntry *CalPs[7];
|
||||
|
||||
static int ColSpaces;
|
||||
|
||||
PRIVATE void SortCol ARGS((CalEntry **col));
|
||||
PRIVATE void DoCalendarOneWeek ARGS ((void));
|
||||
PRIVATE void DoCalendarOneMonth ARGS ((void));
|
||||
PRIVATE int WriteCalendarRow ARGS ((void));
|
||||
PRIVATE void PrintLeft ARGS ((char *s, int width, char pad));
|
||||
PRIVATE void PrintCentered ARGS ((char *s, int width, char pad));
|
||||
PRIVATE int WriteOneCalLine ARGS ((void));
|
||||
PRIVATE int WriteOneColLine ARGS ((int col));
|
||||
PRIVATE void GenerateCalEntries ARGS ((int col));
|
||||
PRIVATE void WriteCalHeader ARGS ((void));
|
||||
PRIVATE void WriteCalTrailer ARGS ((void));
|
||||
PRIVATE int DoCalRem ARGS ((ParsePtr p, int col));
|
||||
PRIVATE void WriteSimpleEntries ARGS ((int col, int jul));
|
||||
PRIVATE void WriteSolidCalLine ARGS ((void));
|
||||
PRIVATE void WriteIntermediateCalLine ARGS ((void));
|
||||
PRIVATE void WriteCalDays ARGS ((void));
|
||||
static void SortCol (CalEntry **col);
|
||||
static void DoCalendarOneWeek (void);
|
||||
static void DoCalendarOneMonth (void);
|
||||
static int WriteCalendarRow (void);
|
||||
static void PrintLeft (char *s, int width, char pad);
|
||||
static void PrintCentered (char *s, int width, char pad);
|
||||
static int WriteOneCalLine (void);
|
||||
static int WriteOneColLine (int col);
|
||||
static void GenerateCalEntries (int col);
|
||||
static void WriteCalHeader (void);
|
||||
static void WriteCalTrailer (void);
|
||||
static int DoCalRem (ParsePtr p, int col);
|
||||
static void WriteSimpleEntries (int col, int jul);
|
||||
static void WriteSolidCalLine (void);
|
||||
static void WriteIntermediateCalLine (void);
|
||||
static void WriteCalDays (void);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -66,11 +69,7 @@ PRIVATE void WriteCalDays ARGS ((void));
|
||||
/* Main loop for generating a calendar. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void ProduceCalendar(void)
|
||||
#else
|
||||
void ProduceCalendar()
|
||||
#endif
|
||||
void ProduceCalendar(void)
|
||||
{
|
||||
int y, m, d;
|
||||
|
||||
@@ -81,7 +80,7 @@ void ProduceCalendar()
|
||||
|
||||
if (CalMonths) {
|
||||
FromJulian(JulianToday, &y, &m, &d);
|
||||
JulianToday = Julian(y, m, 1);
|
||||
JulianToday = Julian(y, m, 1);
|
||||
while (CalMonths--)
|
||||
DoCalendarOneMonth();
|
||||
return;
|
||||
@@ -108,11 +107,7 @@ void ProduceCalendar()
|
||||
/* Write a calendar for a single week */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void DoCalendarOneWeek(void)
|
||||
#else
|
||||
static void DoCalendarOneWeek()
|
||||
#endif
|
||||
static void DoCalendarOneWeek(void)
|
||||
{
|
||||
int y, m, d, done, i, l, wd;
|
||||
char buf[81];
|
||||
@@ -141,9 +136,9 @@ static void DoCalendarOneWeek()
|
||||
PutChar('|');
|
||||
for (i=0; i<7; i++) {
|
||||
FromJulian(OrigJul+i, &y, &m, &d);
|
||||
sprintf(buf, "%d %c%c%c ", d, MonthName[m][0], MonthName[m][1],
|
||||
sprintf(buf, "%d %c%c%c ", d, MonthName[m][0], MonthName[m][1],
|
||||
MonthName[m][2]);
|
||||
if (OrigJul+i == RealToday)
|
||||
if (OrigJul+i == RealToday)
|
||||
PrintLeft(buf, ColSpaces, '*');
|
||||
else
|
||||
PrintLeft(buf, ColSpaces, ' ');
|
||||
@@ -176,7 +171,7 @@ static void DoCalendarOneWeek()
|
||||
PutChar('\n');
|
||||
}
|
||||
|
||||
/* Write the final line */
|
||||
/* Write the final line */
|
||||
WriteIntermediateCalLine();
|
||||
}
|
||||
|
||||
@@ -187,11 +182,7 @@ static void DoCalendarOneWeek()
|
||||
/* Produce a calendar for the current month. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void DoCalendarOneMonth(void)
|
||||
#else
|
||||
static void DoCalendarOneMonth()
|
||||
#endif
|
||||
static void DoCalendarOneMonth(void)
|
||||
{
|
||||
int y, m, d, mm, yy;
|
||||
|
||||
@@ -203,6 +194,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;
|
||||
@@ -219,7 +213,7 @@ static void DoCalendarOneMonth()
|
||||
|
||||
if (PsCal) printf("%s\n", PSEND);
|
||||
if (!DoSimpleCalendar) WriteCalTrailer();
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -228,11 +222,7 @@ static void DoCalendarOneMonth()
|
||||
/* Write one row of the calendar */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int WriteCalendarRow(void)
|
||||
#else
|
||||
static int WriteCalendarRow()
|
||||
#endif
|
||||
static int WriteCalendarRow(void)
|
||||
{
|
||||
int y, m, d, wd, i, l;
|
||||
int done;
|
||||
@@ -261,7 +251,7 @@ static int WriteCalendarRow()
|
||||
}
|
||||
return (d+7-wd <= DaysInMonth(m, y));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Here come the first few lines... */
|
||||
PutChar('|');
|
||||
@@ -314,14 +304,7 @@ static int WriteCalendarRow()
|
||||
/* Left-justify a piece of text. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void PrintLeft(char *s, int width, char pad)
|
||||
#else
|
||||
static void PrintLeft(s, width, pad)
|
||||
char *s;
|
||||
int width;
|
||||
char pad;
|
||||
#endif
|
||||
static void PrintLeft(char *s, int width, char pad)
|
||||
{
|
||||
int len = strlen(s);
|
||||
printf("%s", s);
|
||||
@@ -335,14 +318,7 @@ char pad;
|
||||
/* Center a piec of text */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void PrintCentered(char *s, int width, char pad)
|
||||
#else
|
||||
static void PrintCentered(s, width, pad)
|
||||
char *s;
|
||||
int width;
|
||||
char pad;
|
||||
#endif
|
||||
static void PrintCentered(char *s, int width, char pad)
|
||||
{
|
||||
int len = strlen(s);
|
||||
int d = (width - len) / 2;
|
||||
@@ -362,11 +338,7 @@ char pad;
|
||||
/* Write a single line. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int WriteOneCalLine(void)
|
||||
#else
|
||||
static int WriteOneCalLine()
|
||||
#endif
|
||||
static int WriteOneCalLine(void)
|
||||
{
|
||||
int done = 1, i;
|
||||
|
||||
@@ -384,7 +356,7 @@ static int WriteOneCalLine()
|
||||
return done;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* WriteOneColLine */
|
||||
@@ -393,12 +365,7 @@ static int WriteOneCalLine()
|
||||
/* the column still has entries; 0 otherwise. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int WriteOneColLine(int col)
|
||||
#else
|
||||
static int WriteOneColLine(col)
|
||||
int col;
|
||||
#endif
|
||||
static int WriteOneColLine(int col)
|
||||
{
|
||||
CalEntry *e = CalColumn[col];
|
||||
char *s;
|
||||
@@ -415,6 +382,7 @@ int col;
|
||||
PrintLeft("", ColSpaces, ' ');
|
||||
CalColumn[col] = e->next;
|
||||
free(e->text);
|
||||
free(e->filename);
|
||||
free(e);
|
||||
return 1;
|
||||
}
|
||||
@@ -454,6 +422,7 @@ int col;
|
||||
if (!*s && !e->next) {
|
||||
CalColumn[col] = e->next;
|
||||
free(e->text);
|
||||
free(e->filename);
|
||||
free(e);
|
||||
} else {
|
||||
e->pos = s;
|
||||
@@ -468,12 +437,7 @@ int col;
|
||||
/* Generate the calendar entries for the ith column */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void GenerateCalEntries(int col)
|
||||
#else
|
||||
static void GenerateCalEntries(col)
|
||||
int col;
|
||||
#endif
|
||||
static void GenerateCalEntries(int col)
|
||||
{
|
||||
int r;
|
||||
Token tok;
|
||||
@@ -517,7 +481,7 @@ int col;
|
||||
|
||||
switch(tok.type) {
|
||||
|
||||
case T_Empty:
|
||||
case T_Empty:
|
||||
case T_Comment:
|
||||
break;
|
||||
|
||||
@@ -534,7 +498,7 @@ int col;
|
||||
case T_UnSet: r=DoUnset(&p); break;
|
||||
case T_Clr: r=DoClear(&p); break;
|
||||
case T_Flush: r=DoFlush(&p); break;
|
||||
case T_Debug: break; /* IGNORE DEBUG CMD */
|
||||
case T_Debug: break; /* IGNORE DEBUG CMD */
|
||||
case T_Dumpvars: break; /* IGNORE DUMPVARS CMD */
|
||||
case T_Banner: break; /* IGNORE BANNER CMD */
|
||||
case T_Omit: r=DoOmit(&p);
|
||||
@@ -546,7 +510,7 @@ int col;
|
||||
break;
|
||||
case T_Pop: r=PopOmitContext(&p); break;
|
||||
case T_Push: r=PushOmitContext(&p); break;
|
||||
case T_Preserve: r=DoPreserve(&p); break;
|
||||
case T_Preserve: r=DoPreserve(&p); break;
|
||||
case T_RemType: if (tok.val == RUN_TYPE) {
|
||||
r=DoRun(&p);
|
||||
break;
|
||||
@@ -578,11 +542,7 @@ int col;
|
||||
/* WriteCalHeader */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void WriteCalHeader(void)
|
||||
#else
|
||||
static void WriteCalHeader()
|
||||
#endif
|
||||
static void WriteCalHeader(void)
|
||||
{
|
||||
char buf[80];
|
||||
int y, m, d;
|
||||
@@ -607,11 +567,7 @@ static void WriteCalHeader()
|
||||
/* WriteCalTrailer */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void WriteCalTrailer(void)
|
||||
#else
|
||||
static void WriteCalTrailer()
|
||||
#endif
|
||||
static void WriteCalTrailer(void)
|
||||
{
|
||||
PutChar('\f');
|
||||
}
|
||||
@@ -623,15 +579,9 @@ static void WriteCalTrailer()
|
||||
/* Do the REM command in the context of a calendar. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int DoCalRem(ParsePtr p, int col)
|
||||
#else
|
||||
static int DoCalRem(p, col)
|
||||
ParsePtr p;
|
||||
int col;
|
||||
#endif
|
||||
static int DoCalRem(ParsePtr p, int col)
|
||||
{
|
||||
|
||||
int oldLen;
|
||||
Trigger trig;
|
||||
TimeTrig tim;
|
||||
Value v;
|
||||
@@ -641,26 +591,36 @@ 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;
|
||||
|
||||
/* Don't include timed reminders in calendar if -a option supplied. */
|
||||
#ifdef HAVE_QUEUED
|
||||
if (DontIssueAts && tim.ttime != NO_TIME) return OK;
|
||||
#endif
|
||||
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);
|
||||
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,65 +630,165 @@ 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) {
|
||||
if (trig.typ == PASSTHRU_TYPE) {
|
||||
if (strcmp(trig.passthru, "COLOR")) return OK;
|
||||
/* Strip off the three color numbers */
|
||||
DBufFree(&buf);
|
||||
r=ParseToken(p, &buf);
|
||||
DBufFree(&buf);
|
||||
if (r) return r;
|
||||
r=ParseToken(p, &buf);
|
||||
DBufFree(&buf);
|
||||
if (r) return r;
|
||||
r=ParseToken(p, &buf);
|
||||
DBufFree(&buf);
|
||||
if (r) return r;
|
||||
}
|
||||
}
|
||||
|
||||
/* 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 && strcmp(trig.passthru, "COLOR")) {
|
||||
tim.ttime = NO_TIME;
|
||||
tim.duration = NO_TIME;
|
||||
}
|
||||
|
||||
/* If trigger date == today, add it to the current entry */
|
||||
if (jul == JulianToday) {
|
||||
/* If trigger date == today, add it to the current entry */
|
||||
DBufInit(&obuf);
|
||||
if ((jul == JulianToday) ||
|
||||
(DoSimpleCalendar &&
|
||||
DoSimpleCalDelta &&
|
||||
ShouldTriggerReminder(&trig, &tim, jul))) {
|
||||
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) {
|
||||
/* Suppress time if it's not today */
|
||||
if (jul != JulianToday) {
|
||||
if (DBufPuts(&obuf, SimpleTime(NO_TIME)) != OK) {
|
||||
DBufFree(&obuf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
} else {
|
||||
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);
|
||||
|
||||
/* In -sa mode, run in ADVANCE mode if we're triggering
|
||||
* before the actual date */
|
||||
if (jul != JulianToday) {
|
||||
r = DoSubst(p, &obuf, &trig, &tim, jul, ADVANCE_MODE);
|
||||
} else {
|
||||
r = DoSubst(p, &obuf, &trig, &tim, jul, CAL_MODE);
|
||||
}
|
||||
if (r) {
|
||||
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]) {
|
||||
if (SynthesizeTags) {
|
||||
SynthesizeTag(e->tag);
|
||||
} else {
|
||||
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";
|
||||
e->filename = StrDup(FileName);
|
||||
if(!e->filename) {
|
||||
free(e);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
e->lineno = LineNo;
|
||||
|
||||
/* Ugly hack... SPECIAL COLOR and SPECIAL HTML are not treated
|
||||
as "passthru" to preserve ordering and make them behave like
|
||||
a MSG-type reminder */
|
||||
|
||||
if (trig.typ == PASSTHRU_TYPE &&
|
||||
strcmp(trig.passthru, "COLOR") &&
|
||||
strcmp(trig.passthru, "HTML")) {
|
||||
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
|
||||
e->pos = e->passthru;
|
||||
e->time = NO_TIME;
|
||||
e->next = CurPs;
|
||||
CalPs[col] = e;
|
||||
SortCol(&CalPs[col]);
|
||||
} else {
|
||||
if (trig.typ == PASSTHRU_TYPE) {
|
||||
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
|
||||
} else {
|
||||
e->passthru[0] = 0;
|
||||
}
|
||||
e->pos = e->text;
|
||||
e->time = tim.ttime;
|
||||
if (jul == JulianToday) {
|
||||
e->time = tim.ttime;
|
||||
} else {
|
||||
e->time = NO_TIME;
|
||||
}
|
||||
e->next = CurCol;
|
||||
CalColumn[col] = e;
|
||||
SortCol(&CalColumn[col]);
|
||||
@@ -744,36 +804,60 @@ int col;
|
||||
/* Write entries in 'simple calendar' format. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void WriteSimpleEntries(int col, int jul)
|
||||
#else
|
||||
static void WriteSimpleEntries(col, jul)
|
||||
int col, jul;
|
||||
#endif
|
||||
static void WriteSimpleEntries(int col, int jul)
|
||||
{
|
||||
CalEntry *e = CalPs[col];
|
||||
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);
|
||||
if (DoPrefixLineNo) printf("# fileinfo %d %s\n", e->lineno, e->filename);
|
||||
printf("%04d/%02d/%02d ", y, m+1, d);
|
||||
printf("%s %s ", e->passthru, 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);
|
||||
free(e->filename);
|
||||
n = e->next;
|
||||
free(e);
|
||||
e = n;
|
||||
}
|
||||
CalPs[col] = NULL;
|
||||
|
||||
e = CalColumn[col];
|
||||
e = CalColumn[col];
|
||||
while(e) {
|
||||
printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
|
||||
if (DoPrefixLineNo) printf("# fileinfo %d %s\n", e->lineno, e->filename);
|
||||
printf("%04d/%02d/%02d", y, m+1, d);
|
||||
if (e->passthru[0]) {
|
||||
printf(" %s", e->passthru);
|
||||
} else {
|
||||
printf(" *");
|
||||
}
|
||||
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);
|
||||
free(e->filename);
|
||||
n = e->next;
|
||||
free(e);
|
||||
e = n;
|
||||
@@ -786,11 +870,7 @@ int col, jul;
|
||||
/* Various functions for writing different types of lines. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void WriteSolidCalLine(void)
|
||||
#else
|
||||
static void WriteSolidCalLine()
|
||||
#endif
|
||||
static void WriteSolidCalLine(void)
|
||||
{
|
||||
PutChar('+');
|
||||
PrintCentered("", CalWidth-2, '-');
|
||||
@@ -798,11 +878,7 @@ static void WriteSolidCalLine()
|
||||
PutChar('\n');
|
||||
}
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void WriteIntermediateCalLine(void)
|
||||
#else
|
||||
static void WriteIntermediateCalLine()
|
||||
#endif
|
||||
static void WriteIntermediateCalLine(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -814,11 +890,7 @@ static void WriteIntermediateCalLine()
|
||||
PutChar('\n');
|
||||
}
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void WriteCalDays(void)
|
||||
#else
|
||||
static void WriteCalDays()
|
||||
#endif
|
||||
static void WriteCalDays(void)
|
||||
{
|
||||
int i;
|
||||
PutChar('|');
|
||||
@@ -837,49 +909,39 @@ 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)
|
||||
#else
|
||||
char *SimpleTime(tim, out)
|
||||
int tim;
|
||||
char *out;
|
||||
#endif
|
||||
char *SimpleTime(int tim)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -889,12 +951,7 @@ char *out;
|
||||
/* Sort the calendar entries in a column by time and priority */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void SortCol(CalEntry **col)
|
||||
#else
|
||||
static void SortCol(col)
|
||||
CalEntry **col;
|
||||
#endif
|
||||
static void SortCol(CalEntry **col)
|
||||
{
|
||||
CalEntry *cur, *prev, *next;
|
||||
|
||||
@@ -923,3 +980,22 @@ CalEntry **col;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SynthesizeTag(char *out)
|
||||
{
|
||||
struct MD5Context ctx;
|
||||
unsigned char buf[16];
|
||||
MD5Init(&ctx);
|
||||
MD5Update(&ctx, (unsigned char *) CurLine, strlen(CurLine));
|
||||
MD5Final(buf, &ctx);
|
||||
sprintf(out, "__syn__%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
|
||||
(unsigned int) buf[0], (unsigned int) buf[1],
|
||||
(unsigned int) buf[2], (unsigned int) buf[3],
|
||||
(unsigned int) buf[4], (unsigned int) buf[5],
|
||||
(unsigned int) buf[6], (unsigned int) buf[7],
|
||||
(unsigned int) buf[8], (unsigned int) buf[9],
|
||||
(unsigned int) buf[10], (unsigned int) buf[11],
|
||||
(unsigned int) buf[12], (unsigned int) buf[13],
|
||||
(unsigned int) buf[14], (unsigned int) buf[15]);
|
||||
}
|
||||
|
||||
28
src/config.h.in
Normal file
28
src/config.h.in
Normal file
@@ -0,0 +1,28 @@
|
||||
/* src/config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* 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 if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
#undef HAVE_SETENV
|
||||
|
||||
#undef HAVE_UNSETENV
|
||||
|
||||
/* The number of bytes in a unsigned int. */
|
||||
#undef SIZEOF_UNSIGNED_INT
|
||||
|
||||
/* The number of bytes in a unsigned long. */
|
||||
#undef SIZEOF_UNSIGNED_LONG
|
||||
|
||||
/* The number of bytes in a unsigned short. */
|
||||
#undef SIZEOF_UNSIGNED_SHORT
|
||||
|
||||
#include "custom.h"
|
||||
@@ -1,27 +1,25 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* 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.4 1996-05-25 18:14:51 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 +30,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 */
|
||||
@@ -56,11 +39,11 @@
|
||||
/* #define DEFAULT_PAGE {"A4", 595, 842} */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* DATESEP: The default date separator. North American usage is '/'; */
|
||||
/* others may prefer '-'. */
|
||||
/* DATESEP: The default date separator. Standard usage is '-'; */
|
||||
/* others may prefer '/'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DATESEP '/'
|
||||
/* #define DATESEP '-' */
|
||||
#define DATESEP '-'
|
||||
/* #define DATESEP '/' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* TIMESEP: The default time separator. North American usage is ':'; */
|
||||
@@ -70,18 +53,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 */
|
||||
#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 +92,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 +113,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 +120,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! */
|
||||
@@ -137,19 +132,16 @@
|
||||
#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. */
|
||||
/* YR_RANGE: The range of years allowed. With 32-bit signed integers, */
|
||||
/* the DATETIME type can store 2^31 minutes or about 4074 years. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define YR_RANGE 88
|
||||
#define YR_RANGE 4000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* VAR_NAME_LEN: The maximum length of variable names. Don't make it */
|
||||
/* any less than 12. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define VAR_NAME_LEN 12
|
||||
#define VAR_NAME_LEN 16
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* MAX_PRT_LEN: The maximum number of characters to print when */
|
||||
@@ -157,20 +149,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? */
|
||||
@@ -183,68 +170,20 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#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
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* 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? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TRIG_ATTEMPTS 25
|
||||
#define TRIG_ATTEMPTS 50
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_FULL_OMITS 75
|
||||
#define MAX_FULL_OMITS 250
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#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
|
||||
#define MAX_PARTIAL_OMITS 250
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* A newline - some systems need "\n\r" */
|
||||
@@ -259,16 +198,13 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Don't change the next definitions */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define PUBLIC
|
||||
#define PRIVATE static
|
||||
|
||||
#ifdef UNIX
|
||||
#define _POSIX_SOURCE
|
||||
#endif
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* TAG_LEN: The maximum length of tags. Don't change it */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TAG_LEN 48
|
||||
|
||||
#ifdef SYSV
|
||||
#define _SVID_SOURCE
|
||||
#endif
|
||||
#define PASSTHRU_LEN 32
|
||||
|
||||
#define PSBEGIN "# rem2ps begin"
|
||||
#define PSEND "# rem2ps end"
|
||||
218
src/custom.h.in
Normal file
218
src/custom.h.in
Normal file
@@ -0,0 +1,218 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* 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. Standard 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. With 32-bit signed integers, */
|
||||
/* the DATETIME type can store 2^31 minutes or about 4074 years. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define YR_RANGE 4000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* VAR_NAME_LEN: The maximum length of variable names. Don't make it */
|
||||
/* any less than 12. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define VAR_NAME_LEN 16
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* 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))
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many attempts to resolve a weird date spec? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TRIG_ATTEMPTS 50
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_FULL_OMITS 250
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_PARTIAL_OMITS 250
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* 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 48
|
||||
|
||||
#define PASSTHRU_LEN 32
|
||||
|
||||
#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
|
||||
979
src/dorem.c
Normal file
979
src/dorem.c
Normal file
@@ -0,0 +1,979 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* 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-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
|
||||
/* Define the shell characters not to escape */
|
||||
static char const DontEscapeMe[] =
|
||||
"1234567890_-=+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.,";
|
||||
|
||||
static int ParseTimeTrig (ParsePtr s, TimeTrig *tim);
|
||||
static int ParseLocalOmit (ParsePtr s, Trigger *t);
|
||||
static int ParseScanFrom (ParsePtr s, Trigger *t, int type);
|
||||
static int ParsePriority (ParsePtr s, Trigger *t);
|
||||
static int ParseUntil (ParsePtr s, Trigger *t);
|
||||
static int ShouldTriggerBasedOnWarn (Trigger *t, int jul);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DoRem */
|
||||
/* */
|
||||
/* Do the REM command. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
int DoRem(ParsePtr p)
|
||||
{
|
||||
|
||||
Trigger trig;
|
||||
TimeTrig tim;
|
||||
int r;
|
||||
int jul;
|
||||
DynamicBuffer buf;
|
||||
Token tok;
|
||||
|
||||
DBufInit(&buf);
|
||||
|
||||
/* 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(DBufValue(&buf), &tok);
|
||||
DBufFree(&buf);
|
||||
if (tok.type == T_Empty || tok.type == T_Comment) {
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
if (tok.type != T_RemType || tok.val == SAT_TYPE) {
|
||||
DBufFree(&buf);
|
||||
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;
|
||||
} else {
|
||||
/* Calculate the trigger date */
|
||||
jul = ComputeTrigger(trig.scanfrom, &trig, &r);
|
||||
if (r) return r;
|
||||
}
|
||||
|
||||
/* Queue the reminder, if necessary */
|
||||
if (jul == JulianToday &&
|
||||
!(!IgnoreOnce &&
|
||||
trig.once != NO_ONCE &&
|
||||
FileAccessDate == JulianToday))
|
||||
QueueReminder(p, &trig, &tim, trig.sched);
|
||||
/* If we're in daemon mode, do nothing over here */
|
||||
if (Daemon) return OK;
|
||||
|
||||
if (ShouldTriggerReminder(&trig, &tim, jul)) {
|
||||
if ( (r=TriggerReminder(p, &trig, &tim, jul)) )
|
||||
{
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseRem */
|
||||
/* */
|
||||
/* Given a parse pointer, parse line and fill in a */
|
||||
/* trigger structure. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim)
|
||||
{
|
||||
register int r;
|
||||
DynamicBuffer buf;
|
||||
Token tok;
|
||||
|
||||
DBufInit(&buf);
|
||||
|
||||
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;
|
||||
trig->tag[0] = 0;
|
||||
tim->ttime = NO_TIME;
|
||||
tim->delta = NO_DELTA;
|
||||
tim->rep = NO_REP;
|
||||
tim->duration = NO_TIME;
|
||||
LastTriggerTime = NO_TIME;
|
||||
|
||||
while(1) {
|
||||
/* Read space-delimited string */
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
|
||||
/* Figure out what we've got */
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
switch(tok.type) {
|
||||
case T_WkDay:
|
||||
DBufFree(&buf);
|
||||
if (trig->wd & (1 << tok.val)) return E_WD_TWICE;
|
||||
trig->wd |= (1 << tok.val);
|
||||
break;
|
||||
|
||||
case T_Month:
|
||||
DBufFree(&buf);
|
||||
if (trig->m != NO_MON) return E_MON_TWICE;
|
||||
trig->m = tok.val;
|
||||
break;
|
||||
|
||||
case T_Skip:
|
||||
DBufFree(&buf);
|
||||
if (trig->skip != NO_SKIP) return E_SKIP_ERR;
|
||||
trig->skip = tok.val;
|
||||
break;
|
||||
|
||||
case T_Priority:
|
||||
DBufFree(&buf);
|
||||
r=ParsePriority(s, trig);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_At:
|
||||
DBufFree(&buf);
|
||||
r=ParseTimeTrig(s, tim);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_Scanfrom:
|
||||
DBufFree(&buf);
|
||||
r=ParseScanFrom(s, trig, tok.val);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_RemType:
|
||||
DBufFree(&buf);
|
||||
trig->typ = tok.val;
|
||||
if (s->isnested) return E_CANT_NEST_RTYPE;
|
||||
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
|
||||
if (trig->typ == PASSTHRU_TYPE) {
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
if (!DBufLen(&buf)) {
|
||||
DBufFree(&buf);
|
||||
return E_EOLN;
|
||||
}
|
||||
StrnCpy(trig->passthru, DBufValue(&buf), PASSTHRU_LEN);
|
||||
}
|
||||
return OK;
|
||||
|
||||
case T_Until:
|
||||
DBufFree(&buf);
|
||||
r=ParseUntil(s, trig);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_Year:
|
||||
DBufFree(&buf);
|
||||
if (trig->y != NO_YR) return E_YR_TWICE;
|
||||
trig->y = tok.val;
|
||||
break;
|
||||
|
||||
case T_Day:
|
||||
DBufFree(&buf);
|
||||
if (trig->d != NO_DAY) return E_DAY_TWICE;
|
||||
trig->d = tok.val;
|
||||
break;
|
||||
|
||||
case T_Rep:
|
||||
DBufFree(&buf);
|
||||
if (trig->rep != NO_REP) return E_REP_TWICE;
|
||||
trig->rep = tok.val;
|
||||
break;
|
||||
|
||||
case T_Delta:
|
||||
DBufFree(&buf);
|
||||
if (trig->delta != NO_DELTA) return E_DELTA_TWICE;
|
||||
trig->delta = tok.val;
|
||||
break;
|
||||
|
||||
case T_Back:
|
||||
DBufFree(&buf);
|
||||
if (trig->back != NO_BACK) return E_BACK_TWICE;
|
||||
trig->back = tok.val;
|
||||
break;
|
||||
|
||||
case T_Once:
|
||||
DBufFree(&buf);
|
||||
if (trig->once != NO_ONCE) return E_ONCE_TWICE;
|
||||
trig->once = ONCE_ONCE;
|
||||
break;
|
||||
|
||||
case T_Omit:
|
||||
DBufFree(&buf);
|
||||
r = ParseLocalOmit(s, trig);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_Empty:
|
||||
DBufFree(&buf);
|
||||
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
|
||||
return OK;
|
||||
|
||||
case T_Warn:
|
||||
r=ParseToken(s, &buf);
|
||||
if(r) return r;
|
||||
StrnCpy(trig->warn, DBufValue(&buf), VAR_NAME_LEN);
|
||||
DBufFree(&buf);
|
||||
break;
|
||||
|
||||
case T_Tag:
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
StrnCpy(trig->tag, DBufValue(&buf), TAG_LEN);
|
||||
break;
|
||||
|
||||
case T_Duration:
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
DBufFree(&buf);
|
||||
switch(tok.type) {
|
||||
case T_Time:
|
||||
case T_LongTime:
|
||||
tim->duration = tok.val;
|
||||
break;
|
||||
default:
|
||||
return E_BAD_TIME;
|
||||
}
|
||||
break;
|
||||
|
||||
case T_Sched:
|
||||
r=ParseToken(s, &buf);
|
||||
if(r) return r;
|
||||
StrnCpy(trig->sched, DBufValue(&buf), VAR_NAME_LEN);
|
||||
DBufFree(&buf);
|
||||
break;
|
||||
|
||||
case T_LongTime:
|
||||
DBufFree(&buf);
|
||||
return E_BAD_TIME;
|
||||
break;
|
||||
|
||||
default:
|
||||
PushToken(DBufValue(&buf), s);
|
||||
DBufFree(&buf);
|
||||
trig->typ = MSG_TYPE;
|
||||
if (s->isnested) return E_CANT_NEST_RTYPE;
|
||||
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseTimeTrig - parse the AT part of a timed reminder */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static int ParseTimeTrig(ParsePtr s, TimeTrig *tim)
|
||||
{
|
||||
Token tok;
|
||||
int r;
|
||||
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
while(1) {
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
switch(tok.type) {
|
||||
case T_Time:
|
||||
DBufFree(&buf);
|
||||
tim->ttime = tok.val;
|
||||
break;
|
||||
|
||||
case T_Delta:
|
||||
DBufFree(&buf);
|
||||
tim->delta = (tok.val > 0) ? tok.val : -tok.val;
|
||||
break;
|
||||
|
||||
case T_Rep:
|
||||
DBufFree(&buf);
|
||||
tim->rep = tok.val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (tim->ttime == NO_TIME) return E_EXPECT_TIME;
|
||||
|
||||
/* Save trigger time in global variable */
|
||||
LastTriggerTime = tim->ttime;
|
||||
PushToken(DBufValue(&buf), s);
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseLocalOmit - parse the local OMIT portion of a */
|
||||
/* reminder. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static int ParseLocalOmit(ParsePtr s, Trigger *t)
|
||||
{
|
||||
Token tok;
|
||||
int r;
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
while(1) {
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
switch(tok.type) {
|
||||
case T_WkDay:
|
||||
DBufFree(&buf);
|
||||
t->localomit |= (1 << tok.val);
|
||||
break;
|
||||
|
||||
default:
|
||||
PushToken(DBufValue(&buf), s);
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseUntil - parse the UNTIL portion of a reminder */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static int ParseUntil(ParsePtr s, Trigger *t)
|
||||
{
|
||||
int y = NO_YR,
|
||||
m = NO_MON,
|
||||
d = NO_DAY;
|
||||
|
||||
Token tok;
|
||||
int r;
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
if (t->until != NO_UNTIL) return E_UNTIL_TWICE;
|
||||
|
||||
while(1) {
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
switch(tok.type) {
|
||||
case T_Year:
|
||||
DBufFree(&buf);
|
||||
if (y != NO_YR) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_YR_TWICE]);
|
||||
return E_YR_TWICE;
|
||||
}
|
||||
y = tok.val;
|
||||
break;
|
||||
|
||||
case T_Month:
|
||||
DBufFree(&buf);
|
||||
if (m != NO_MON) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_MON_TWICE]);
|
||||
return E_MON_TWICE;
|
||||
}
|
||||
m = tok.val;
|
||||
break;
|
||||
|
||||
case T_Day:
|
||||
DBufFree(&buf);
|
||||
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]);
|
||||
DBufFree(&buf);
|
||||
return E_INCOMPLETE;
|
||||
}
|
||||
if (!DateOK(y, m, d)) {
|
||||
DBufFree(&buf);
|
||||
return E_BAD_DATE;
|
||||
}
|
||||
t->until = Julian(y, m, d);
|
||||
PushToken(DBufValue(&buf), s);
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ParseScanFrom - parse the FROM/SCANFROM portion */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static int ParseScanFrom(ParsePtr s, Trigger *t, int type)
|
||||
{
|
||||
int y = NO_YR,
|
||||
m = NO_MON,
|
||||
d = NO_DAY;
|
||||
|
||||
Token tok;
|
||||
int r;
|
||||
DynamicBuffer buf;
|
||||
char const *word;
|
||||
|
||||
DBufInit(&buf);
|
||||
if (type == SCANFROM_TYPE) {
|
||||
word = "SCANFROM";
|
||||
} else {
|
||||
word = "FROM";
|
||||
}
|
||||
|
||||
if (t->scanfrom != NO_DATE) return E_SCAN_TWICE;
|
||||
|
||||
while(1) {
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
switch(tok.type) {
|
||||
case T_Year:
|
||||
DBufFree(&buf);
|
||||
if (y != NO_YR) {
|
||||
Eprint("%s: %s", word, ErrMsg[E_YR_TWICE]);
|
||||
return E_YR_TWICE;
|
||||
}
|
||||
y = tok.val;
|
||||
break;
|
||||
|
||||
case T_Month:
|
||||
DBufFree(&buf);
|
||||
if (m != NO_MON) {
|
||||
Eprint("%s: %s", word, ErrMsg[E_MON_TWICE]);
|
||||
return E_MON_TWICE;
|
||||
}
|
||||
m = tok.val;
|
||||
break;
|
||||
|
||||
case T_Day:
|
||||
DBufFree(&buf);
|
||||
if (d != NO_DAY) {
|
||||
Eprint("%s: %s", word, ErrMsg[E_DAY_TWICE]);
|
||||
return E_DAY_TWICE;
|
||||
}
|
||||
d = tok.val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (y == NO_YR || m == NO_MON || d == NO_DAY) {
|
||||
Eprint("%s: %s", word, ErrMsg[E_INCOMPLETE]);
|
||||
DBufFree(&buf);
|
||||
return E_INCOMPLETE;
|
||||
}
|
||||
if (!DateOK(y, m, d)) {
|
||||
DBufFree(&buf);
|
||||
return E_BAD_DATE;
|
||||
}
|
||||
t->scanfrom = Julian(y, m, d);
|
||||
if (type == FROM_TYPE) {
|
||||
if (t->scanfrom < JulianToday) {
|
||||
t->scanfrom = JulianToday;
|
||||
}
|
||||
}
|
||||
|
||||
PushToken(DBufValue(&buf), s);
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* TriggerReminder */
|
||||
/* */
|
||||
/* Trigger the reminder if it's a RUN or MSG type. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
|
||||
{
|
||||
int r, y, m, d;
|
||||
char PrioExpr[25];
|
||||
char tmpBuf[64];
|
||||
DynamicBuffer buf, calRow;
|
||||
char *s;
|
||||
Value v;
|
||||
|
||||
DBufInit(&buf);
|
||||
DBufInit(&calRow);
|
||||
if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
|
||||
if ((t->typ == PASSTHRU_TYPE && strcmp(t->passthru, "COLOR")) ||
|
||||
t->typ == CAL_TYPE ||
|
||||
t->typ == PS_TYPE ||
|
||||
t->typ == PSF_TYPE)
|
||||
return OK;
|
||||
|
||||
/* Handle COLOR types */
|
||||
if (t->typ == PASSTHRU_TYPE && !strcmp(t->passthru, "COLOR")) {
|
||||
/* Strip off three tokens */
|
||||
r = ParseToken(p, &buf);
|
||||
DBufFree(&buf);
|
||||
if (r) return r;
|
||||
r = ParseToken(p, &buf);
|
||||
DBufFree(&buf);
|
||||
if (r) return r;
|
||||
r = ParseToken(p, &buf);
|
||||
DBufFree(&buf);
|
||||
if (r) return r;
|
||||
t->typ = MSG_TYPE;
|
||||
}
|
||||
/* 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(DBufValue(&Banner), &buf,
|
||||
JulianToday, NO_TIME) &&
|
||||
DBufLen(&buf)) {
|
||||
printf("%s\n", DBufValue(&buf));
|
||||
}
|
||||
DBufFree(&buf);
|
||||
}
|
||||
|
||||
/* If it's NextMode, process as a CAL-type entry, and issue simple-calendar
|
||||
format. */
|
||||
if (NextMode) {
|
||||
if ( (r=DoSubst(p, &buf, t, tim, jul, CAL_MODE)) ) return r;
|
||||
if (!DBufLen(&buf)) {
|
||||
DBufFree(&buf);
|
||||
return OK;
|
||||
}
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
sprintf(tmpBuf, "%04d/%02d/%02d ", y, m+1, d);
|
||||
if (DBufPuts(&calRow, tmpBuf) != OK) {
|
||||
DBufFree(&calRow);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
/* If DoSimpleCalendar==1, output *all* simple calendar fields */
|
||||
if (DoSimpleCalendar) {
|
||||
/* ignore passthru field when in NextMode */
|
||||
if (DBufPuts(&calRow, "* ") != OK) {
|
||||
DBufFree(&calRow);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
if (t->tag[0]) {
|
||||
sprintf(tmpBuf, "%s ", t->tag);
|
||||
} else {
|
||||
sprintf(tmpBuf, "* ");
|
||||
}
|
||||
if (DBufPuts(&calRow, tmpBuf) != OK) {
|
||||
DBufFree(&calRow);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
if (tim->duration != NO_TIME) {
|
||||
sprintf(tmpBuf, "%d ", tim->duration);
|
||||
} else {
|
||||
sprintf(tmpBuf, "* ");
|
||||
}
|
||||
if (DBufPuts(&calRow, tmpBuf) != OK) {
|
||||
DBufFree(&calRow);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
if (tim->ttime != NO_TIME) {
|
||||
sprintf(tmpBuf, "%d ", tim->ttime);
|
||||
} else {
|
||||
sprintf(tmpBuf, "* ");
|
||||
}
|
||||
if (DBufPuts(&calRow, tmpBuf) != OK) {
|
||||
DBufFree(&calRow);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
if (DBufPuts(&calRow, SimpleTime(tim->ttime)) != OK) {
|
||||
DBufFree(&calRow);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
printf("%s%s\n", DBufValue(&calRow), DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
DBufFree(&calRow);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Put the substituted string into the substitution buffer */
|
||||
if (UserFuncExists("msgprefix") == 1) {
|
||||
sprintf(PrioExpr, "msgprefix(%d)", t->priority);
|
||||
s = PrioExpr;
|
||||
r = EvalExpr(&s, &v);
|
||||
if (!r) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
if (DBufPuts(&buf, v.v.str) != OK) {
|
||||
DBufFree(&buf);
|
||||
DestroyValue(v);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
DestroyValue(v);
|
||||
}
|
||||
}
|
||||
if ( (r=DoSubst(p, &buf, t, tim, jul, NORMAL_MODE)) ) return r;
|
||||
if (UserFuncExists("msgsuffix") == 1) {
|
||||
sprintf(PrioExpr, "msgsuffix(%d)", t->priority);
|
||||
s = PrioExpr;
|
||||
r = EvalExpr(&s, &v);
|
||||
if (!r) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
if (DBufPuts(&buf, v.v.str) != OK) {
|
||||
DBufFree(&buf);
|
||||
DestroyValue(v);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
DestroyValue(v);
|
||||
}
|
||||
}
|
||||
if ((!MsgCommand && t->typ == MSG_TYPE) || t->typ == MSF_TYPE) {
|
||||
if (DBufPutc(&buf, '\n') != OK) {
|
||||
DBufFree(&buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we are sorting, just queue it up in the sort buffer */
|
||||
if (SortByDate) {
|
||||
if (InsertIntoSortBuffer(jul, tim->ttime, DBufValue(&buf),
|
||||
t->typ, t->priority) == OK) {
|
||||
DBufFree(&buf);
|
||||
NumTriggered++;
|
||||
return OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we didn't insert the reminder into the sort buffer, issue the
|
||||
reminder now. */
|
||||
switch(t->typ) {
|
||||
case MSG_TYPE:
|
||||
case PASSTHRU_TYPE:
|
||||
if (MsgCommand) {
|
||||
DoMsgCommand(MsgCommand, DBufValue(&buf));
|
||||
} else {
|
||||
printf("%s", DBufValue(&buf));
|
||||
}
|
||||
break;
|
||||
|
||||
case MSF_TYPE:
|
||||
FillParagraph(DBufValue(&buf));
|
||||
break;
|
||||
|
||||
case RUN_TYPE:
|
||||
system(DBufValue(&buf));
|
||||
break;
|
||||
|
||||
default: /* Unknown/illegal type? */
|
||||
DBufFree(&buf);
|
||||
return E_SWERR;
|
||||
}
|
||||
|
||||
DBufFree(&buf);
|
||||
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. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int jul)
|
||||
{
|
||||
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 */
|
||||
if (jul == JulianToday && DontIssueAts && tim->ttime != NO_TIME) return 0;
|
||||
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
|
||||
{
|
||||
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 */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static int ParsePriority(ParsePtr s, Trigger *t)
|
||||
{
|
||||
int p, r;
|
||||
char *u;
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
r = ParseToken(s, &buf);
|
||||
if(r) return r;
|
||||
u = DBufValue(&buf);
|
||||
|
||||
if (!isdigit(*u)) {
|
||||
DBufFree(&buf);
|
||||
return E_EXPECTING_NUMBER;
|
||||
}
|
||||
p = 0;
|
||||
while (isdigit(*u)) {
|
||||
p = p*10 + *u - '0';
|
||||
u++;
|
||||
}
|
||||
if (*u) {
|
||||
DBufFree(&buf);
|
||||
return E_EXPECTING_NUMBER;
|
||||
}
|
||||
|
||||
DBufFree(&buf);
|
||||
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
int DoMsgCommand(char *cmd, char *msg)
|
||||
{
|
||||
int r;
|
||||
int i, l;
|
||||
DynamicBuffer execBuffer;
|
||||
|
||||
DynamicBuffer buf;
|
||||
char *s;
|
||||
|
||||
DBufInit(&buf);
|
||||
DBufInit(&execBuffer);
|
||||
|
||||
/* Escape shell characters in msg INCLUDING WHITESPACE! */
|
||||
for (s=msg; *s; s++) {
|
||||
if (isspace(*s) || !strchr(DontEscapeMe, *s)) {
|
||||
if (DBufPutc(&buf, '\\') != OK) {
|
||||
r = E_NO_MEM;
|
||||
goto finished;
|
||||
}
|
||||
}
|
||||
if (DBufPutc(&buf, *s) != OK) {
|
||||
r = E_NO_MEM;
|
||||
goto finished;
|
||||
}
|
||||
}
|
||||
msg = DBufValue(&buf);
|
||||
|
||||
/* Do "%s" substitution */
|
||||
l = strlen(cmd);
|
||||
for (i=0; i<l; i++) {
|
||||
if (cmd[i] == '%' && cmd[i+1] == 's') {
|
||||
++i;
|
||||
if (DBufPuts(&execBuffer, msg) != OK) {
|
||||
r = E_NO_MEM;
|
||||
goto finished;
|
||||
}
|
||||
} else {
|
||||
if (DBufPutc(&execBuffer, cmd[i]) != OK) {
|
||||
r = E_NO_MEM;
|
||||
goto finished;
|
||||
}
|
||||
}
|
||||
}
|
||||
r = OK;
|
||||
|
||||
system(DBufValue(&execBuffer));
|
||||
|
||||
finished:
|
||||
DBufFree(&buf);
|
||||
DBufFree(&execBuffer);
|
||||
return r;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ShouldTriggerBasedOnWarn */
|
||||
/* */
|
||||
/* Determine whether to trigger a reminder based on its WARN */
|
||||
/* function. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static int ShouldTriggerBasedOnWarn(Trigger *t, int jul)
|
||||
{
|
||||
char buffer[VAR_NAME_LEN+32];
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,29 +6,25 @@
|
||||
/* 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.2 1996-04-29 19:34:36 dfs Exp $";
|
||||
|
||||
#define L_IN_DOSUBST
|
||||
#include "config.h"
|
||||
#define L_IN_DOSUBST
|
||||
#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 +33,8 @@ static char const RCSID[] = "$Id: dosubst.c,v 1.2 1996-04-29 19:34:36 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 */
|
||||
@@ -44,18 +42,10 @@ static char TOMORROW[] = L_TOMORROW;
|
||||
/* Process the % escapes in the reminder. If */
|
||||
/* mode==NORMAL_MODE, ignore the %" sequence. If */
|
||||
/* mode==CAL_MODE, process the %" sequence. */
|
||||
/* If mode==ADVANCE_MODE, ignore %" but don't add newline */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoSubst(ParsePtr p, char *out, Trigger *t, TimeTrig *tt, int jul, int mode)
|
||||
#else
|
||||
int DoSubst(p, out, t, tt, jul, mode)
|
||||
ParsePtr p;
|
||||
char *out;
|
||||
Trigger *t;
|
||||
TimeTrig *tt;
|
||||
int jul, mode;
|
||||
#endif
|
||||
int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode)
|
||||
{
|
||||
int diff = jul - JulianToday;
|
||||
int curtime = SystemTime(0) / 60;
|
||||
@@ -68,8 +58,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);
|
||||
|
||||
@@ -78,10 +69,21 @@ int jul, mode;
|
||||
adiff = ABS(tdiff);
|
||||
mdiff = adiff % 60;
|
||||
hdiff = adiff / 60;
|
||||
|
||||
#ifdef L_MPLU_OVER
|
||||
L_MPLU_OVER
|
||||
#else /* L_MPLU_OVER */
|
||||
mplu = (mdiff == 1 ? "" : L_MPLU);
|
||||
#endif /* L_MPLU_OVER */
|
||||
|
||||
#ifdef L_HPLU_OVER
|
||||
L_HPLU_OVER
|
||||
#else /* L_HPLU_OVER */
|
||||
hplu = (hdiff == 1 ? "" : L_HPLU);
|
||||
#endif /* L_HPLU_OVER */
|
||||
|
||||
when = (tdiff < 0 ? L_AGO : L_FROMNOW);
|
||||
|
||||
|
||||
h = tim / 60;
|
||||
min = tim % 60;
|
||||
|
||||
@@ -91,7 +93,7 @@ int jul, mode;
|
||||
pm = (h < 12) ? L_AM : L_PM;
|
||||
#endif
|
||||
hh = (h == 12) ? 12 : h % 12;
|
||||
|
||||
|
||||
ch = curtime / 60;
|
||||
cmin = curtime % 60;
|
||||
|
||||
@@ -109,46 +111,52 @@ int jul, mode;
|
||||
case 1:
|
||||
case 21:
|
||||
case 31: plu = "st"; break;
|
||||
|
||||
|
||||
case 2:
|
||||
case 22: plu = "nd"; break;
|
||||
|
||||
|
||||
case 3:
|
||||
case 23: plu = "rd"; break;
|
||||
|
||||
|
||||
default: plu = "th"; break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
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 && mode != ADVANCE_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)) {
|
||||
#ifndef L_NOTOMORROW_A
|
||||
case 'A':
|
||||
case 'A':
|
||||
#endif
|
||||
#ifndef L_NOTOMORROW_B
|
||||
case 'B':
|
||||
case 'B':
|
||||
#endif
|
||||
#ifndef L_NOTOMORROW_C
|
||||
case 'C':
|
||||
@@ -184,96 +192,96 @@ int jul, mode;
|
||||
case 'V':
|
||||
#endif
|
||||
sprintf(s, "%s", (diff ? TOMORROW : TODAY));
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
done = 1;
|
||||
break;
|
||||
|
||||
default: done = 0;
|
||||
|
||||
default: done = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!done) switch(UPPER(c)) {
|
||||
case 'A':
|
||||
#ifdef L_A_OVER
|
||||
L_A_OVER
|
||||
#else
|
||||
#else
|
||||
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':
|
||||
#ifdef L_B_OVER
|
||||
L_B_OVER
|
||||
#else
|
||||
#else
|
||||
sprintf(s, L_INXDAYS, diff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
break;
|
||||
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
#ifdef L_C_OVER
|
||||
L_C_OVER
|
||||
#else
|
||||
#else
|
||||
sprintf(s, "%s %s", L_ON, DayName[jul%7]);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
#ifdef L_D_OVER
|
||||
L_D_OVER
|
||||
#else
|
||||
#else
|
||||
sprintf(s, "%d", d);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
#ifdef L_E_OVER
|
||||
L_E_OVER
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, d, DATESEP,
|
||||
m+1, DATESEP, y);
|
||||
#else
|
||||
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':
|
||||
#ifdef L_F_OVER
|
||||
L_F_OVER
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, m+1, DATESEP, d, DATESEP, y);
|
||||
#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':
|
||||
#ifdef L_G_OVER
|
||||
L_G_OVER
|
||||
#else
|
||||
#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':
|
||||
#ifdef L_H_OVER
|
||||
L_H_OVER
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, d, DATESEP, m+1);
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, d, DateSep, m+1);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
#ifdef L_I_OVER
|
||||
L_I_OVER
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, m+1, DATESEP, d);
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, m+1, DateSep, d);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'J':
|
||||
@@ -283,7 +291,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':
|
||||
@@ -293,16 +301,16 @@ 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':
|
||||
#ifdef L_L_OVER
|
||||
L_L_OVER
|
||||
#else
|
||||
sprintf(s, "%s %04d%c%02d%c%02d", L_ON, y, DATESEP, m+1, DATESEP, d);
|
||||
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':
|
||||
@@ -311,7 +319,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%s", MonthName[m]);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
@@ -320,7 +328,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", m+1);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
@@ -330,25 +338,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':
|
||||
@@ -357,16 +365,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':
|
||||
@@ -375,7 +383,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%02d", m+1);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'U':
|
||||
@@ -385,7 +393,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':
|
||||
@@ -395,16 +403,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':
|
||||
@@ -413,7 +421,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", diff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'Y':
|
||||
@@ -422,7 +430,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", y);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case 'Z':
|
||||
@@ -431,16 +439,16 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", y % 100);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '1':
|
||||
#ifdef L_1_OVER
|
||||
L_1_OVER
|
||||
#else
|
||||
if (tdiff == 0)
|
||||
sprintf(s, L_NOW);
|
||||
else if (hdiff == 0)
|
||||
if (tdiff == 0)
|
||||
sprintf(s, "%s", L_NOW);
|
||||
else if (hdiff == 0)
|
||||
sprintf(s, "%d %s%s %s", mdiff, L_MINUTE, mplu, when);
|
||||
else if (mdiff == 0)
|
||||
sprintf(s, "%d %s%s %s", hdiff, L_HOUR, hplu, when);
|
||||
@@ -448,16 +456,16 @@ 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':
|
||||
#ifdef L_2_OVER
|
||||
L_2_OVER
|
||||
#else
|
||||
sprintf(s, "%s %d%c%02d%s", L_AT, hh, TIMESEP, min, pm);
|
||||
sprintf(s, "%s %d%c%02d%s", L_AT, hh, TimeSep, min, pm);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '3':
|
||||
@@ -465,9 +473,9 @@ int jul, mode;
|
||||
L_3_OVER
|
||||
#else
|
||||
|
||||
sprintf(s, "%s %02d%c%02d", L_AT, h, TIMESEP, min);
|
||||
sprintf(s, "%s %02d%c%02d", L_AT, h, TimeSep, min);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '4':
|
||||
@@ -476,7 +484,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", tdiff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '5':
|
||||
@@ -485,16 +493,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':
|
||||
@@ -503,7 +511,7 @@ int jul, mode;
|
||||
#else
|
||||
sprintf(s, "%d", hdiff);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '8':
|
||||
@@ -512,60 +520,60 @@ 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 '@':
|
||||
#ifdef L_AT_OVER
|
||||
L_AT_OVER
|
||||
#else
|
||||
sprintf(s, "%d%c%02d%s", chh, TIMESEP, cmin, cpm);
|
||||
sprintf(s, "%d%c%02d%s", chh, TimeSep, cmin, cpm);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '#':
|
||||
#ifdef L_HASH_OVER
|
||||
L_HASH_OVER
|
||||
#else
|
||||
sprintf(s, "%02d%c%02d", ch, TIMESEP, cmin);
|
||||
sprintf(s, "%02d%c%02d", ch, TimeSep, cmin);
|
||||
#endif
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '_':
|
||||
if (mode != CAL_MODE && !MsgCommand)
|
||||
case '_':
|
||||
if (mode != CAL_MODE && mode != ADVANCE_MODE && !MsgCommand)
|
||||
sprintf(s, "%s", NL);
|
||||
else
|
||||
else
|
||||
sprintf(s, " ");
|
||||
s += strlen(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case QUOTE_MARKER:
|
||||
@@ -573,14 +581,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
|
||||
@@ -591,38 +602,43 @@ 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 == ADVANCE_MODE || 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;
|
||||
if (mode == NORMAL_MODE) {
|
||||
while (*s) {
|
||||
if (*s != QUOTE_MARKER) *os++ = *s;
|
||||
s++;
|
||||
ss = DBufValue(dbuf) + origLen;
|
||||
os = ss;
|
||||
if (mode == NORMAL_MODE || mode == ADVANCE_MODE) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -633,15 +649,8 @@ int jul, mode;
|
||||
/* default triggers and a mode of NORMAL_MODE. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoSubstFromString(char *source, char *dest, int jul, int tim)
|
||||
#else
|
||||
int DoSubstFromString(source, dest, jul, tim)
|
||||
char *source;
|
||||
char *dest;
|
||||
int jul;
|
||||
int tim;
|
||||
#endif
|
||||
int DoSubstFromString(char *source, DynamicBuffer *dbuf,
|
||||
int jul, int tim)
|
||||
{
|
||||
Trigger tempTrig;
|
||||
TimeTrig tempTime;
|
||||
@@ -654,8 +663,8 @@ int tim;
|
||||
tempP.allownested = 0;
|
||||
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;
|
||||
}
|
||||
177
src/dynbuf.c
Normal file
177
src/dynbuf.c
Normal file
@@ -0,0 +1,177 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include "dynbuf.h"
|
||||
#include "err.h"
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/**********************************************************************
|
||||
%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'
|
||||
**********************************************************************/
|
||||
static int DBufMakeRoom(DynamicBuffer *dbuf, int n)
|
||||
{
|
||||
/* 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
|
||||
**********************************************************************/
|
||||
void DBufInit(DynamicBuffer *dbuf)
|
||||
{
|
||||
dbuf->buffer = dbuf->staticBuf;
|
||||
dbuf->len = 0;
|
||||
dbuf->allocatedLen = DBUF_STATIC_SIZE;
|
||||
dbuf->buffer[0] = 0;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
%FUNCTION: DBufPutcFN
|
||||
%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.
|
||||
**********************************************************************/
|
||||
int DBufPutcFN(DynamicBuffer *dbuf, char c)
|
||||
{
|
||||
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.
|
||||
**********************************************************************/
|
||||
int DBufPuts(DynamicBuffer *dbuf, char *str)
|
||||
{
|
||||
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
|
||||
**********************************************************************/
|
||||
void DBufFree(DynamicBuffer *dbuf)
|
||||
{
|
||||
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.
|
||||
**********************************************************************/
|
||||
int DBufGets(DynamicBuffer *dbuf, FILE *fp)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
37
src/dynbuf.h
Normal file
37
src/dynbuf.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#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;
|
||||
|
||||
void DBufInit(DynamicBuffer *dbuf);
|
||||
int DBufPutcFN(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)
|
||||
|
||||
#define DBufPutc(dbuf, c) ( (dbuf)->allocatedLen < (dbuf)->len+1 ) ? (dbuf)->buffer[(dbuf)->len++] = c, (dbuf)->buffer[(dbuf)->len] = 0, OK : DBufPutcFN((dbuf), c)
|
||||
|
||||
#endif /* DYNBUF_H */
|
||||
@@ -5,12 +5,11 @@
|
||||
/* 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 $ */
|
||||
|
||||
/* Note that not all of the "errors" are really errors - some are just
|
||||
messages for information purposes. Constants beginning with M_ should
|
||||
never be returned as error indicators - they should only be used to
|
||||
@@ -117,6 +116,7 @@
|
||||
#define M_QUEUED 96
|
||||
#define E_EXPECTING_NUMBER 97
|
||||
#define M_BAD_WARN_FUNC 98
|
||||
#define E_CANT_CONVERT_TZ 99
|
||||
|
||||
#ifdef MK_GLOBALS
|
||||
#undef EXTERN
|
||||
@@ -205,7 +205,7 @@ EXTERN char *ErrMsg[]
|
||||
"Expecting time after AT",
|
||||
"UNTIL keyword used twice",
|
||||
"Incomplete date specification",
|
||||
"SCANFROM keyword used twice",
|
||||
"FROM/SCANFROM keyword used twice",
|
||||
"Variable",
|
||||
"Value",
|
||||
"*UNDEFINED*",
|
||||
@@ -229,7 +229,8 @@ EXTERN char *ErrMsg[]
|
||||
"No reminders.",
|
||||
"%d reminder(s) queued for later today.\n",
|
||||
"Expecting number",
|
||||
"Bad function in WARN clause"
|
||||
"Bad function in WARN clause",
|
||||
"Can't convert between time zones"
|
||||
}
|
||||
#endif /* MK_GLOBALS */
|
||||
;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,18 +5,19 @@
|
||||
/* 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 $ */
|
||||
|
||||
/* Define the types of values */
|
||||
#define ERR_TYPE 0
|
||||
#define INT_TYPE 1
|
||||
#define TIM_TYPE 2
|
||||
#define DATE_TYPE 3
|
||||
#define STR_TYPE 4
|
||||
#define ERR_TYPE 0
|
||||
#define INT_TYPE 1
|
||||
#define TIME_TYPE 2
|
||||
#define DATE_TYPE 3
|
||||
#define STR_TYPE 4
|
||||
#define DATETIME_TYPE 5
|
||||
#define SPECIAL_TYPE 6 /* Only for system variables */
|
||||
|
||||
/* Define stuff for parsing expressions */
|
||||
#define BEG_OF_EXPR '['
|
||||
@@ -7,33 +7,28 @@
|
||||
/* 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"
|
||||
|
||||
#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 <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef TM_IN_SYS_TIME
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
|
||||
#if defined(__MSDOS__)
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSC__
|
||||
#include <dos.h>
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
@@ -55,6 +50,7 @@ typedef struct cheader {
|
||||
struct cheader *next;
|
||||
char *filename;
|
||||
CachedLine *cache;
|
||||
int ownedByMe;
|
||||
} CachedFile;
|
||||
|
||||
/* Define the structures needed by the INCLUDE file system */
|
||||
@@ -65,6 +61,7 @@ typedef struct {
|
||||
int NumIfs;
|
||||
long offset;
|
||||
CachedLine *CLine;
|
||||
int ownedByMe;
|
||||
} IncludeStruct;
|
||||
|
||||
static CachedFile *CachedFiles = (CachedFile *) NULL;
|
||||
@@ -75,9 +72,10 @@ static FILE *fp;
|
||||
static IncludeStruct IStack[INCLUDE_NEST];
|
||||
static int IStackPtr = 0;
|
||||
|
||||
PRIVATE int ReadLineFromFile ARGS ((void));
|
||||
PRIVATE int CacheFile ARGS ((const char *fname));
|
||||
PRIVATE void DestroyCache ARGS ((CachedFile *cf));
|
||||
static int ReadLineFromFile (void);
|
||||
static int CacheFile (const char *fname);
|
||||
static void DestroyCache (CachedFile *cf);
|
||||
static int CheckSafety (void);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -86,11 +84,7 @@ PRIVATE void DestroyCache ARGS ((CachedFile *cf));
|
||||
/* Read a line from the file or cache. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ReadLine(void)
|
||||
#else
|
||||
int ReadLine()
|
||||
#endif
|
||||
int ReadLine(void)
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -121,39 +115,50 @@ int ReadLine()
|
||||
/* Read a line from the file pointed to by fp. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ReadLineFromFile(void)
|
||||
#else
|
||||
static ReadLineFromFile()
|
||||
#endif
|
||||
static int ReadLineFromFile(void)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -166,16 +171,14 @@ static ReadLineFromFile()
|
||||
/* ShouldCache is 1, cache the file */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int OpenFile(const char *fname)
|
||||
#else
|
||||
int OpenFile(fname)
|
||||
char *fname;
|
||||
#endif
|
||||
int OpenFile(const 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 +186,9 @@ char *fname;
|
||||
CLine = h->cache;
|
||||
STRSET(FileName, fname);
|
||||
LineNo = 0;
|
||||
if (!h->ownedByMe) {
|
||||
RunDisabled |= RUN_NOTOWNER;
|
||||
}
|
||||
if (FileName) return OK; else return E_NO_MEM;
|
||||
}
|
||||
h = h->next;
|
||||
@@ -194,7 +200,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 +209,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);
|
||||
@@ -223,12 +230,7 @@ char *fname;
|
||||
/* Returns an indication of success or failure. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int CacheFile(const char *fname)
|
||||
#else
|
||||
static int CacheFile(fname)
|
||||
char *fname;
|
||||
#endif
|
||||
static int CacheFile(const char *fname)
|
||||
{
|
||||
int r;
|
||||
CachedFile *cf;
|
||||
@@ -248,6 +250,12 @@ char *fname;
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
if (RunDisabled & RUN_NOTOWNER) {
|
||||
cf->ownedByMe = 0;
|
||||
} else {
|
||||
cf->ownedByMe = 1;
|
||||
}
|
||||
|
||||
/* Read the file */
|
||||
while(fp) {
|
||||
r = ReadLineFromFile();
|
||||
@@ -258,13 +266,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 +283,7 @@ char *fname;
|
||||
} else {
|
||||
cl->next = NEW(CachedLine);
|
||||
if (!cl->next) {
|
||||
DBufFree(&LineBuffer);
|
||||
DestroyCache(cf);
|
||||
ShouldCache = 0;
|
||||
FCLOSE(fp);
|
||||
@@ -284,6 +294,7 @@ char *fname;
|
||||
cl->next = NULL;
|
||||
cl->LineNo = LineNo;
|
||||
cl->text = StrDup(s);
|
||||
DBufFree(&LineBuffer);
|
||||
if (!cl->text) {
|
||||
DestroyCache(cf);
|
||||
ShouldCache = 0;
|
||||
@@ -306,14 +317,13 @@ char *fname;
|
||||
/* file, or return E_EOF */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int PopFile(void)
|
||||
#else
|
||||
int PopFile()
|
||||
#endif
|
||||
int PopFile(void)
|
||||
{
|
||||
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 +335,17 @@ int PopFile()
|
||||
CLine = i->CLine;
|
||||
fp = NULL;
|
||||
STRSET(FileName, i->filename);
|
||||
if (!i->ownedByMe) {
|
||||
RunDisabled |= RUN_NOTOWNER;
|
||||
}
|
||||
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... */
|
||||
}
|
||||
@@ -346,20 +360,20 @@ int PopFile()
|
||||
/* The INCLUDE command. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoInclude(ParsePtr p)
|
||||
#else
|
||||
int DoInclude(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int DoInclude(ParsePtr p)
|
||||
{
|
||||
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;
|
||||
@@ -373,15 +387,11 @@ ParsePtr p;
|
||||
/* inclusion. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int IncludeFile(const char *fname)
|
||||
#else
|
||||
int IncludeFile(fname)
|
||||
char *fname;
|
||||
#endif
|
||||
int IncludeFile(const char *fname)
|
||||
{
|
||||
IncludeStruct *i;
|
||||
int r;
|
||||
int oldRunDisabled;
|
||||
|
||||
if (IStackPtr+1 >= INCLUDE_NEST) return E_NESTED_INCLUDE;
|
||||
i = &IStack[IStackPtr];
|
||||
@@ -393,6 +403,11 @@ char *fname;
|
||||
i->IfFlags = IfFlags;
|
||||
i->CLine = CLine;
|
||||
i->offset = -1L;
|
||||
if (RunDisabled & RUN_NOTOWNER) {
|
||||
i->ownedByMe = 0;
|
||||
} else {
|
||||
i->ownedByMe = 1;
|
||||
}
|
||||
if (fp) {
|
||||
i->offset = ftell(fp);
|
||||
FCLOSE(fp);
|
||||
@@ -400,10 +415,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);
|
||||
@@ -415,22 +432,13 @@ char *fname;
|
||||
/* GetAccessDate - get the access date of a file. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int GetAccessDate(char *file)
|
||||
#else
|
||||
int GetAccessDate(file)
|
||||
char *file;
|
||||
#endif
|
||||
int GetAccessDate(char *file)
|
||||
{
|
||||
struct stat statbuf;
|
||||
struct tm *t1;
|
||||
|
||||
if (stat(file, &statbuf)) return -1;
|
||||
#ifdef __TURBOC__
|
||||
t1 = localtime( (time_t *) &(statbuf.st_atime) );
|
||||
#else
|
||||
t1 = localtime(&(statbuf.st_atime));
|
||||
#endif
|
||||
|
||||
if (t1->tm_year + 1900 < BASE)
|
||||
return 0;
|
||||
@@ -438,71 +446,6 @@ char *file;
|
||||
return Julian(t1->tm_year+1900, t1->tm_mon, t1->tm_mday);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* SetAccessDate */
|
||||
/* */
|
||||
/* Used only by DOS to set access date after we close the */
|
||||
/* file. Not needed for UNIX. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#if defined(__MSDOS__)
|
||||
/*
|
||||
* WARNING WARNING WARNING WARNING
|
||||
* In the version of Turbo C which I have, there is a bug in the
|
||||
* stdio.h file. The following lines correct the bug. YOU MAY
|
||||
* HAVE TO REMOVE THESE LINES FOR LATER VERSIONS OF TURBOC
|
||||
*/
|
||||
#ifdef __TURBOC__
|
||||
#ifndef fileno
|
||||
#define fileno(f) ((f)->fd)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int SetAccessDate(char *fname, int jul)
|
||||
#else
|
||||
int SetAccessDate(fname, jul)
|
||||
char *fname;
|
||||
int jul;
|
||||
#endif
|
||||
{
|
||||
|
||||
#ifdef __TURBOC__
|
||||
int y, m, d;
|
||||
struct ftime ft;
|
||||
FILE *f;
|
||||
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
ft.ft_tsec = 0;
|
||||
ft.ft_min = 0;
|
||||
ft.ft_hour = 12; /* Arbitrarily set time to noon. */
|
||||
ft.ft_day = (unsigned int) d;
|
||||
ft.ft_month = (unsigned int) m+1;
|
||||
ft.ft_year = (unsigned int) (y - 1980);
|
||||
|
||||
f = fopen(fname, "r");
|
||||
if (!f || setftime(fileno(f) , &ft)) {
|
||||
|
||||
#else /* Must be MSC */
|
||||
if (utime(fname, (struct utimbuf *) NULL)) {
|
||||
#endif
|
||||
fprintf(ErrFp, ErrMsg[M_CANTSET_ACCESS], fname);
|
||||
|
||||
#ifdef __TURBOC__
|
||||
if (f) FCLOSE(f);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef __TURBOC__
|
||||
FCLOSE(f);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DestroyCache */
|
||||
@@ -510,12 +453,7 @@ int jul;
|
||||
/* Free all the memory used by a cached file. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void DestroyCache(CachedFile *cf)
|
||||
#else
|
||||
static void DestroyCache(cf)
|
||||
CachedFile *cf;
|
||||
#endif
|
||||
static void DestroyCache(CachedFile *cf)
|
||||
{
|
||||
CachedLine *cl, *cnext;
|
||||
CachedFile *temp;
|
||||
@@ -548,11 +486,62 @@ CachedFile *cf;
|
||||
/* Returns 1 if current file is top level, 0 otherwise. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int TopLevel(void)
|
||||
#else
|
||||
int TopLevel()
|
||||
#endif
|
||||
int TopLevel(void)
|
||||
{
|
||||
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 */
|
||||
/***************************************************************/
|
||||
static int CheckSafety(void)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,15 +8,16 @@
|
||||
/* 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"
|
||||
|
||||
#include <stdio.h> /* For defintion of FILE - sigh! */
|
||||
#include "types.h"
|
||||
#include "custom.h"
|
||||
#define MK_GLOBALS
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
@@ -7,12 +7,11 @@
|
||||
/* MK_GLOBALS. Also contains useful macro definitions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-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 $ */
|
||||
|
||||
#ifdef MK_GLOBALS
|
||||
#undef EXTERN
|
||||
#define EXTERN
|
||||
@@ -23,6 +22,8 @@
|
||||
#define INIT(var, val) var
|
||||
#endif
|
||||
|
||||
#define MINUTES_PER_DAY 1440
|
||||
|
||||
#define DaysInYear(y) (((y) % 4) ? 365 : ((!((y) % 100) && ((y) % 400)) ? 365 : 366 ))
|
||||
#define IsLeapYear(y) (((y) % 4) ? 0 : ((!((y) % 100) && ((y) % 400)) ? 0 : 1 ))
|
||||
#define DaysInMonth(m, y) ((m) != 1 ? MonthDays[m] : 28 + IsLeapYear(y))
|
||||
@@ -36,14 +37,13 @@ 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);
|
||||
EXTERN INIT( int DoCalendar, 0);
|
||||
EXTERN INIT( int DoSimpleCalendar, 0);
|
||||
EXTERN INIT( int DoSimpleCalDelta, 0);
|
||||
EXTERN INIT( int DoPrefixLineNo, 0);
|
||||
EXTERN INIT( int MondayFirst, 0);
|
||||
EXTERN INIT( int Iterations, 1);
|
||||
EXTERN INIT( int PsCal, 0);
|
||||
@@ -69,8 +69,9 @@ EXTERN INIT( int DontQueue, 0);
|
||||
EXTERN INIT( int NumQueued, 0);
|
||||
EXTERN INIT( int DontIssueAts, 0);
|
||||
EXTERN INIT( int Daemon, 0);
|
||||
|
||||
|
||||
EXTERN INIT( char DateSep, DATESEP);
|
||||
EXTERN INIT( char TimeSep, TIMESEP);
|
||||
EXTERN INIT( int SynthesizeTags, 0);
|
||||
EXTERN INIT( int ScFormat, SC_AMPM);
|
||||
EXTERN INIT( int MaxSatIter, 150);
|
||||
EXTERN INIT( char *FileName, NULL);
|
||||
@@ -113,9 +114,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
|
||||
@@ -171,12 +174,3 @@ EXTERN int MonthIndex[2][12]
|
||||
#endif
|
||||
;
|
||||
|
||||
#if defined(__OS2__)
|
||||
#if defined(_MSC_VER) || defined(__EMX__)
|
||||
#define OS2MODE (_osmode == OS2_MODE)
|
||||
#define DOSMODE (_osmode == DOS_MODE)
|
||||
#else
|
||||
#define OS2MODE 1
|
||||
#define DOSMODE 0
|
||||
#endif
|
||||
#endif
|
||||
@@ -5,17 +5,17 @@
|
||||
/* Support for the Hebrew calendar */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-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"
|
||||
|
||||
#include <stdio.h> /* For FILE used by protos.h - sigh. */
|
||||
#include "config.h"
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "globals.h"
|
||||
@@ -63,7 +63,7 @@ static char MaxMonLen[] = {
|
||||
30, 30, 30, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29, 29};
|
||||
|
||||
static char HebIsLeap[] = {0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1};
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* RoshHashana */
|
||||
@@ -72,12 +72,7 @@ static char HebIsLeap[] = {0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1};
|
||||
/* Hebrew year. (ie, 5751, not 1990) */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int RoshHashana(int i)
|
||||
#else
|
||||
int RoshHashana(i)
|
||||
int i;
|
||||
#endif
|
||||
int RoshHashana(int i)
|
||||
{
|
||||
long j;
|
||||
j = DaysToHebYear(i-3744) - CORRECTION;
|
||||
@@ -92,12 +87,7 @@ int i;
|
||||
/* from new moon before Tishrey 1 5701. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC long DaysToHebYear(int y)
|
||||
#else
|
||||
long DaysToHebYear(y)
|
||||
int y;
|
||||
#endif
|
||||
long DaysToHebYear(int y)
|
||||
{
|
||||
long m, nm, dw, s, l;
|
||||
|
||||
@@ -130,12 +120,7 @@ int y;
|
||||
/* */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DaysInHebYear(int y)
|
||||
#else
|
||||
int DaysInHebYear(y)
|
||||
int y;
|
||||
#endif
|
||||
int DaysInHebYear(int y)
|
||||
{
|
||||
long thisyear, nextyear;
|
||||
|
||||
@@ -152,12 +137,7 @@ int y;
|
||||
/* given the LENGTH of the Hebrew year. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *DaysInHebMonths(int ylen)
|
||||
#else
|
||||
char *DaysInHebMonths(ylen)
|
||||
int ylen;
|
||||
#endif
|
||||
char *DaysInHebMonths(int ylen)
|
||||
{
|
||||
static char monlen[13] =
|
||||
{30, 29, 30, 29, 30, 0, 29, 30, 29, 30, 29, 30, 29};
|
||||
@@ -183,12 +163,7 @@ int ylen;
|
||||
/* non-leap-years. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int HebToJul(int hy, int hm, int hd)
|
||||
#else
|
||||
int HebToJul(hy, hm, hd)
|
||||
int hy, hm, hd;
|
||||
#endif
|
||||
int HebToJul(int hy, int hm, int hd)
|
||||
{
|
||||
int ylen;
|
||||
char *monlens;
|
||||
@@ -221,12 +196,7 @@ int hy, hm, hd;
|
||||
/* non-leap-years. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void JulToHeb(int jul, int *hy, int *hm, int *hd)
|
||||
#else
|
||||
void JulToHeb(jul, hy, hm, hd)
|
||||
int jul, *hy, *hm, *hd;
|
||||
#endif
|
||||
void JulToHeb(int jul, int *hy, int *hm, int *hd)
|
||||
{
|
||||
int y, m, d;
|
||||
int rh;
|
||||
@@ -262,12 +232,7 @@ int jul, *hy, *hm, *hd;
|
||||
/* year. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int HebNameToNum(const char *mname)
|
||||
#else
|
||||
int HebNameToNum(mname)
|
||||
char *mname;
|
||||
#endif
|
||||
int HebNameToNum(const char *mname)
|
||||
{
|
||||
int i;
|
||||
int m=-1;
|
||||
@@ -289,12 +254,7 @@ char *mname;
|
||||
/* year. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *HebMonthName(int m, int y)
|
||||
#else
|
||||
char *HebMonthName(m, y)
|
||||
int m, y;
|
||||
#endif
|
||||
char *HebMonthName(int m, int y)
|
||||
{
|
||||
if (m != ADARA && m != ADARB) return HebMonthNames[m];
|
||||
|
||||
@@ -330,13 +290,8 @@ int m, y;
|
||||
/* Change 30 Adar A to 30 Shvat in nonleap */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int GetValidHebDate(int yin, int min, int din, int adarbehave,
|
||||
int GetValidHebDate(int yin, int min, int din, int adarbehave,
|
||||
int *mout, int *dout, int jahr)
|
||||
#else
|
||||
int GetValidHebDate(yin, min, din, adarbehave, mout, dout, jahr)
|
||||
int yin, min, din, adarbehave, *mout, *dout, jahr;
|
||||
#endif
|
||||
{
|
||||
char *monlen;
|
||||
int ylen;
|
||||
@@ -435,13 +390,8 @@ int yin, min, din, adarbehave, *mout, *dout, jahr;
|
||||
/* Returns 0 for success, non-zero for failure. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int GetNextHebrewDate(int julstart, int hm, int hd,
|
||||
int GetNextHebrewDate(int julstart, int hm, int hd,
|
||||
int jahr, int adarbehave, int *ans)
|
||||
#else
|
||||
int GetNextHebrewDate(julstart, hm, hd, jahr, adarbehave, ans)
|
||||
int julstart, hm, hd, jahr, adarbehave, *ans;
|
||||
#endif
|
||||
{
|
||||
int r, yout, mout, dout, jul=1;
|
||||
int adarflag = adarbehave;
|
||||
@@ -496,12 +446,7 @@ int julstart, hm, hd, jahr, adarbehave, *ans;
|
||||
/* Given a date of death, compute the value to use for jahr. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ComputeJahr(int y, int m, int d, int *ans)
|
||||
#else
|
||||
int ComputeJahr(y, m, d, ans)
|
||||
int y, m, d, *ans;
|
||||
#endif
|
||||
int ComputeJahr(int y, int m, int d, int *ans)
|
||||
{
|
||||
char *monlen;
|
||||
int len;
|
||||
@@ -7,30 +7,23 @@
|
||||
/* 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-2007 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
static char const RCSID[] = "$Id: init.c,v 1.2 1996-04-28 02:01:58 dfs Exp $";
|
||||
#include "config.h"
|
||||
|
||||
#define L_IN_INIT 1
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <ctype.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#ifdef UNIX
|
||||
#include <sys/types.h>
|
||||
#include <pwd.h>
|
||||
#ifdef HAVE_UNISTD
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
@@ -49,6 +42,8 @@ static char const RCSID[] = "$Id: init.c,v 1.2 1996-04-28 02:01:58 dfs Exp $";
|
||||
* -w[n,n,n] = Specify output device width, padding and spacing
|
||||
* -s[n] = Produce calendar in "simple calendar" format
|
||||
* -p[n] = Produce calendar in format compatible with rem2ps
|
||||
* -l = Prefix simple calendar lines with a comment containing
|
||||
* their trigger line numbers and filenames
|
||||
* -v = Verbose mode
|
||||
* -o = Ignore ONCE directives
|
||||
* -a = Don't issue timed reminders which will be queued
|
||||
@@ -77,18 +72,15 @@ static char const RCSID[] = "$Id: init.c,v 1.2 1996-04-28 02:01:58 dfs Exp $";
|
||||
|
||||
/* For parsing an integer */
|
||||
#define PARSENUM(var, s) \
|
||||
var = 0; \
|
||||
while (isdigit(*(s))) { \
|
||||
var *= 10; \
|
||||
var += *(s) - '0'; \
|
||||
s++; \
|
||||
}
|
||||
var = 0; \
|
||||
while (isdigit(*(s))) { \
|
||||
var *= 10; \
|
||||
var += *(s) - '0'; \
|
||||
s++; \
|
||||
}
|
||||
|
||||
#ifdef UNIX
|
||||
PRIVATE void ChgUser ARGS((char *uname));
|
||||
#endif
|
||||
|
||||
PRIVATE void InitializeVar ARGS ((char *str));
|
||||
static void ChgUser(char *u);
|
||||
static void InitializeVar(char *str);
|
||||
|
||||
static char *BadDate = "Illegal date on command line\n";
|
||||
|
||||
@@ -99,19 +91,27 @@ static char *BadDate = "Illegal date on command line\n";
|
||||
/* Initialize the system - called only once at beginning! */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void InitRemind(int argc, char *argv[])
|
||||
#else
|
||||
void InitRemind(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
#endif
|
||||
void InitRemind(int argc, char *argv[])
|
||||
{
|
||||
char *arg;
|
||||
int i;
|
||||
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 */
|
||||
if (getgid() != getegid() ||
|
||||
getuid() != geteuid()) {
|
||||
fprintf(ErrFp, "\nRemind should not be installed set-uid or set-gid.\nCHECK YOUR SYSTEM SECURITY.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
y = NO_YR;
|
||||
m = NO_MON;
|
||||
d = NO_DAY;
|
||||
@@ -125,19 +125,6 @@ char *argv[];
|
||||
JulianToday = RealToday;
|
||||
FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
|
||||
|
||||
#if !defined(HAVE_QUEUED)
|
||||
DontFork = 1;
|
||||
DontQueue = 1;
|
||||
NumQueued = 0;
|
||||
DontIssueAts = 0;
|
||||
Daemon = 0;
|
||||
#elif defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
DontFork = 1;
|
||||
#elif defined(__OS2__) && defined (__MSDOS__)
|
||||
if (DOSMODE)
|
||||
DontFork = 1;
|
||||
#endif
|
||||
|
||||
/* Parse the command-line options */
|
||||
i = 1;
|
||||
while (i < argc) {
|
||||
@@ -159,19 +146,17 @@ char *argv[];
|
||||
InitializeVar(arg);
|
||||
while(*arg) arg++;
|
||||
break;
|
||||
|
||||
|
||||
case 'n':
|
||||
case 'N':
|
||||
NextMode = 1;
|
||||
#ifdef HAVE_QUEUED
|
||||
DontQueue = 1;
|
||||
Daemon = 0;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
case 'R':
|
||||
RunDisabled = 1;
|
||||
RunDisabled = RUN_CMDLINE;
|
||||
break;
|
||||
|
||||
case 'm':
|
||||
@@ -184,6 +169,11 @@ char *argv[];
|
||||
IgnoreOnce = 1;
|
||||
break;
|
||||
|
||||
case 'y':
|
||||
case 'Y':
|
||||
SynthesizeTags = 1;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
case 'T':
|
||||
InfiniteDelta = 1;
|
||||
@@ -221,21 +211,25 @@ char *argv[];
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(UNIX) && defined(WANT_U_OPTION)
|
||||
case 'u':
|
||||
case 'U':
|
||||
ChgUser(arg);
|
||||
RunDisabled = RUN_CMDLINE;
|
||||
while (*arg) arg++;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_QUEUED
|
||||
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':
|
||||
@@ -252,7 +246,6 @@ char *argv[];
|
||||
case 'F':
|
||||
DontFork = 1;
|
||||
break;
|
||||
#endif
|
||||
case 'c':
|
||||
case 'C':
|
||||
DoCalendar = 1;
|
||||
@@ -269,6 +262,10 @@ char *argv[];
|
||||
case 's':
|
||||
case 'S':
|
||||
DoSimpleCalendar = 1;
|
||||
if (*arg == 'a' || *arg == 'A') {
|
||||
DoSimpleCalDelta = 1;
|
||||
arg++;
|
||||
}
|
||||
if (*arg == '+') {
|
||||
arg++;
|
||||
PARSENUM(CalWeeks, arg);
|
||||
@@ -283,15 +280,24 @@ char *argv[];
|
||||
case 'P':
|
||||
DoSimpleCalendar = 1;
|
||||
PsCal = 1;
|
||||
if (*arg == 'a' || *arg == 'A') {
|
||||
DoSimpleCalDelta = 1;
|
||||
arg++;
|
||||
}
|
||||
PARSENUM(CalMonths, arg);
|
||||
if (!CalMonths) CalMonths = 1;
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
case 'L':
|
||||
DoPrefixLineNo = 1;
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
case 'W':
|
||||
if (*arg != ',') {
|
||||
PARSENUM(CalWidth, arg);
|
||||
if (CalWidth < 80) CalWidth = 80;
|
||||
if (CalWidth < 71) CalWidth = 71;
|
||||
}
|
||||
if (*arg == ',') {
|
||||
arg++;
|
||||
@@ -370,10 +376,8 @@ char *argv[];
|
||||
if (SysTime != -1L) Usage();
|
||||
else {
|
||||
SysTime = (long) tok.val * 60L;
|
||||
#ifdef HAVE_QUEUED
|
||||
DontQueue = 1;
|
||||
Daemon = 0;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -449,13 +453,10 @@ char *argv[];
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifndef L_USAGE_OVERRIDE
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
void Usage(void)
|
||||
{
|
||||
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-2007 Roaring Penguin Software Inc.\n");
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
@@ -466,18 +467,17 @@ void Usage()
|
||||
fprintf(ErrFp, " -c[n] Produce a calendar for n (default 1) months\n");
|
||||
fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
|
||||
fprintf(ErrFp, " -w[n[,p[,s]]] Specify width, padding and spacing of calendar\n");
|
||||
fprintf(ErrFp, " -s[+][n] Produce `simple calendar' for n (1) months (weeks)\n");
|
||||
fprintf(ErrFp, " -p[n] Same as -s, but input compatible with rem2ps\n");
|
||||
fprintf(ErrFp, " -s[a][+][n] Produce `simple calendar' for n (1) months (weeks)\n");
|
||||
fprintf(ErrFp, " -p[a][n] Same as -s, but input compatible with rem2ps\n");
|
||||
fprintf(ErrFp, " -l Prefix each simple calendar line with line number and filename comment\n");
|
||||
fprintf(ErrFp, " -v Verbose mode\n");
|
||||
fprintf(ErrFp, " -o Ignore ONCE directives\n");
|
||||
fprintf(ErrFp, " -t Trigger all future reminders regardless of delta\n");
|
||||
fprintf(ErrFp, " -h `Hush' mode - be very quiet\n");
|
||||
#ifdef HAVE_QUEUED
|
||||
fprintf(ErrFp, " -a Don't trigger timed reminders immediately - just queue them\n");
|
||||
fprintf(ErrFp, " -q Don't queue timed reminders\n");
|
||||
fprintf(ErrFp, " -f Trigger timed reminders by staying in foreground\n");
|
||||
fprintf(ErrFp, " -z[n] Enter daemon mode, waking every n (5) minutes.\n");
|
||||
#endif
|
||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||
fprintf(ErrFp, " -e Divert messages normally sent to stderr to stdout\n");
|
||||
fprintf(ErrFp, " -b[n] Time format for cal: 0=am/pm, 1=24hr, 2=none\n");
|
||||
@@ -486,6 +486,7 @@ void Usage()
|
||||
fprintf(ErrFp, " -g[ddd] Sort reminders by date, time and priority before issuing\n");
|
||||
fprintf(ErrFp, " -ivar=val Initialize var to val and preserve var\n");
|
||||
fprintf(ErrFp, " -m Start calendar with Monday rather than Sunday\n");
|
||||
fprintf(ErrFp, " -y Synthesize tags for tagless reminders\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif /* L_USAGE_OVERRIDE */
|
||||
@@ -499,20 +500,9 @@ void Usage()
|
||||
/* USER environment variables. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#if defined(UNIX) && defined(WANT_U_OPTION)
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void ChgUser(char *user)
|
||||
#else
|
||||
static void ChgUser(user)
|
||||
char *user;
|
||||
#endif /* HAVE_PROTOS */
|
||||
static void ChgUser(char *user)
|
||||
{
|
||||
#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;
|
||||
@@ -569,8 +559,6 @@ char *user;
|
||||
putenv(logname);
|
||||
}
|
||||
}
|
||||
#endif /* UNIX && WANT_U_OPTION */
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* InitializeVar */
|
||||
@@ -578,12 +566,7 @@ char *user;
|
||||
/* Initialize and preserve a variable */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void InitializeVar(char *str)
|
||||
#else
|
||||
static void InitializeVar(str)
|
||||
char *str;
|
||||
#endif
|
||||
static void InitializeVar(char *str)
|
||||
{
|
||||
char *varname, *expr;
|
||||
|
||||
@@ -5,12 +5,11 @@
|
||||
/* Header file for language support for various languages. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: lang.h,v 1.2 1996-04-29 19:34:38 dfs Exp $ */
|
||||
|
||||
/* I'm chauvinistic and name each language with its English name... */
|
||||
|
||||
#define ENGLISH 0 /* original by David F. Skoll */
|
||||
@@ -21,8 +20,13 @@
|
||||
#define NORWEGIAN 5 /* translated by Trygve Randen */
|
||||
#define DANISH 6 /* translated by Mogens Lynnerup */
|
||||
#define POLISH 7 /* translated by Jerzy Sobczyk */
|
||||
#define BRAZPORT 8 /* Brazilian Portuguese by Marco Paganini */
|
||||
#define ITALIAN 9 /* translated by Valerio Aimale */
|
||||
#define ROMANIAN 10 /* translated by Liviu Daia */
|
||||
#define SPANISH 11 /* translated by Rafa Couto */
|
||||
#define ICELANDIC 12 /* translated by Björn Davíðsson */
|
||||
|
||||
/* 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
|
||||
@@ -41,24 +45,34 @@
|
||||
|
||||
/* 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 "langs/portbr.h"
|
||||
#elif LANG == ITALIAN
|
||||
#include "langs/italian.h"
|
||||
#elif LANG == ROMANIAN
|
||||
#include "langs/romanian.h"
|
||||
#elif LANG == SPANISH
|
||||
#include "langs/spanish.h"
|
||||
#elif LANG == ICELANDIC
|
||||
#include "langs/icelandic.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,17 @@
|
||||
/* */
|
||||
/* 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 $ */
|
||||
|
||||
/* 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 +26,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 +51,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 +72,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"
|
||||
@@ -105,11 +101,11 @@
|
||||
#define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<5) ? " om natten" : " om formiddagen" : (hour > 17) ? " om aftenen" : " om eftermiddagen";
|
||||
#define L_ORDINAL_OVERRIDE plu = ".";
|
||||
#define L_A_OVER sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y);
|
||||
#define L_E_OVER sprintf(s, "den %02d%c%02d%c%04d", d, DATESEP, m+1, DATESEP, y);
|
||||
#define L_F_OVER sprintf(s, "den %02d%c%02d%c%04d", m+1, DATESEP, d, DATESEP, y);
|
||||
#define L_E_OVER sprintf(s, "den %02d%c%02d%c%04d", d, DateSep, m+1, DateSep, y);
|
||||
#define L_F_OVER sprintf(s, "den %02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
|
||||
#define L_G_OVER sprintf(s, "%s %s, den %d. %s", L_ON, DayName[jul%7], d, MonthName[m]);
|
||||
#define L_H_OVER sprintf(s, "den %02d%c%02d", d, DATESEP, m+1);
|
||||
#define L_I_OVER sprintf(s, "den %02d%c%02d", m+1, DATESEP, d);
|
||||
#define L_H_OVER sprintf(s, "den %02d%c%02d", d, DateSep, m+1);
|
||||
#define L_I_OVER sprintf(s, "den %02d%c%02d", m+1, DateSep, d);
|
||||
#define L_U_OVER L_A_OVER
|
||||
#define L_V_OVER L_G_OVER
|
||||
|
||||
@@ -11,12 +11,11 @@
|
||||
/* Further corrections by Erik-Jan Vens */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-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 $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Dutch"
|
||||
|
||||
@@ -29,9 +28,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,12 +5,11 @@
|
||||
/* 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 $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "English"
|
||||
|
||||
@@ -23,9 +22,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,19 +4,18 @@
|
||||
/* */
|
||||
/* 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 $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Finnish"
|
||||
|
||||
@@ -29,19 +28,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 +51,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 +61,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 +75,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 +91,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 +121,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 +134,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 +161,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, \
|
||||
#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_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, \
|
||||
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_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, \
|
||||
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_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 +207,7 @@ else { \
|
||||
#define L_ERR_OVERRIDE 1
|
||||
EXTERN char *ErrMsg[] =
|
||||
{
|
||||
#if defined(ISOLATIN1)
|
||||
#if ISOLATIN1
|
||||
"Ok",
|
||||
"Puuttuva ']'",
|
||||
"Puuttuva lainausmerkki",
|
||||
@@ -287,7 +282,7 @@ EXTERN char *ErrMsg[] =
|
||||
"AT-sanan per\xE4st\xE4 puuttuu aika",
|
||||
"UNTIL-sanaa k\xE4ytetty kahdesti",
|
||||
"Ep\xE4t\xE4ydellinen p\xE4iv\xE4ys",
|
||||
"SCANFROM-sanaa k\xE4ytetty kahdesti",
|
||||
"FROM/SCANFROM-sanaa k\xE4ytetty kahdesti",
|
||||
"Muuttuja",
|
||||
"Arvo",
|
||||
"*M\xC4\xC4RITTELEM\xC4T\xD6N*",
|
||||
@@ -311,9 +306,10 @@ 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",
|
||||
"Can't convert between time zones"
|
||||
|
||||
#elif defined(IBMEXTENDED)
|
||||
#elif IBMEXTENDED
|
||||
"Ok",
|
||||
"Puuttuva ']'",
|
||||
"Puuttuva lainausmerkki",
|
||||
@@ -388,7 +384,7 @@ EXTERN char *ErrMsg[] =
|
||||
"AT-sanan per\x84st\x84 puuttuu aika",
|
||||
"UNTIL-sanaa k\x84ytetty kahdesti",
|
||||
"Ep\x84t\x84ydellinen p\x84iv\x84ys",
|
||||
"SCANFROM-sanaa k\x84ytetty kahdesti",
|
||||
"FROM/SCANFROM-sanaa k\x84ytetty kahdesti",
|
||||
"Muuttuja",
|
||||
"Arvo",
|
||||
"*M\x8E\x8ERITTELEM\x8ET\x99N*",
|
||||
@@ -412,7 +408,8 @@ 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",
|
||||
"Can't convert between time zones"
|
||||
#else
|
||||
"Ok",
|
||||
"Puuttuva ']'",
|
||||
@@ -488,7 +485,7 @@ EXTERN char *ErrMsg[] =
|
||||
"AT-sanan per{st{ puuttuu aika",
|
||||
"UNTIL-sanaa k{ytetty kahdesti",
|
||||
"Ep{t{ydellinen p{iv{ys",
|
||||
"SCANFROM-sanaa k{ytetty kahdesti",
|
||||
"FROM/SCANFROM-sanaa k{ytetty kahdesti",
|
||||
"Muuttuja",
|
||||
"Arvo",
|
||||
"*M[[RITTELEM[T\\N*",
|
||||
@@ -512,7 +509,9 @@ 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",
|
||||
"Can't convert between time zones"
|
||||
|
||||
#endif
|
||||
};
|
||||
#endif /* MK_GLOBALS */
|
||||
@@ -520,17 +519,14 @@ EXTERN char *ErrMsg[] =
|
||||
/* The following is only used in init.c */
|
||||
#ifdef L_IN_INIT
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
void Usage(void)
|
||||
{
|
||||
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 +555,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,14 +8,13 @@
|
||||
/* */
|
||||
/* 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 $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "French"
|
||||
|
||||
@@ -28,12 +27,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 +39,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 +47,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 +82,7 @@
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#define L_NOW "maintenant"
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
#define L_AT "\340"
|
||||
#else
|
||||
#define L_AT "a"
|
||||
@@ -94,7 +90,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 +144,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",
|
||||
@@ -223,7 +219,7 @@ EXTERN char *ErrMsg[] =
|
||||
"Heure attendue apr\350s AT",
|
||||
"Mot-cl\351 UNTIL utilis\351 deux fois",
|
||||
"Sp\351cification de date incompl\350te",
|
||||
"Mot-cl\351 SCANFROM utilis\351 deux fois",
|
||||
"Mot-cl\351 FROM/SCANFROM utilis\351 deux fois",
|
||||
"Variable",
|
||||
"Valeur",
|
||||
"*NON-DEFINI*",
|
||||
@@ -247,7 +243,8 @@ EXTERN char *ErrMsg[] =
|
||||
"Pas de rappels.",
|
||||
"%d rappel(s) en file pour aujourd'hui.\n",
|
||||
"Nombre attendu",
|
||||
"Fonction ill\351gale apr\350s WARN"
|
||||
"Fonction ill\351gale apr\350s WARN",
|
||||
"Can't convert between time zones"
|
||||
#else /* ISOLATIN1 */
|
||||
"Ok",
|
||||
"']' manquant",
|
||||
@@ -323,7 +320,7 @@ EXTERN char *ErrMsg[] =
|
||||
"Heure attendue apres AT",
|
||||
"Mot-cle UNTIL utilise deux fois",
|
||||
"Specification de date incomplete",
|
||||
"Mot-cle SCANFROM utilise deux fois",
|
||||
"Mot-cle FROM/SCANFROM utilise deux fois",
|
||||
"Variable",
|
||||
"Valeur",
|
||||
"*NON-DEFINI*",
|
||||
@@ -347,7 +344,8 @@ EXTERN char *ErrMsg[] =
|
||||
"Pas de rappels.",
|
||||
"%d rappel(s) en file pour aujourd'hui.\n",
|
||||
"Nombre attendu",
|
||||
"Fonction illegale apres WARN"
|
||||
"Fonction illegale apres WARN",
|
||||
"Can't convert between time zones"
|
||||
#endif /* ISOLATIN1 */
|
||||
};
|
||||
#endif /* MK_GLOBALS */
|
||||
@@ -355,17 +353,14 @@ EXTERN char *ErrMsg[] =
|
||||
/* The following is only used in init.c */
|
||||
#ifdef L_IN_INIT
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
void Usage(void)
|
||||
{
|
||||
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,12 +9,11 @@
|
||||
/* 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 $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "German"
|
||||
|
||||
@@ -27,13 +26,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 +49,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:"
|
||||
84
src/langs/icelandic.h
Normal file
84
src/langs/icelandic.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ICELANDIC.H */
|
||||
/* */
|
||||
/* Support for the Icelandic language. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* Translated by Björn Davíðsson (bjossi@snerpa.is) */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Icelandic"
|
||||
|
||||
/* Day names */
|
||||
#define L_SUNDAY "sunnudagur"
|
||||
#define L_MONDAY "mánudagur"
|
||||
#define L_TUESDAY "þriðjudagur"
|
||||
#define L_WEDNESDAY "miðvikudagur"
|
||||
#define L_THURSDAY "fimmtudagur"
|
||||
#define L_FRIDAY "föstudagur"
|
||||
#define L_SATURDAY "laugardagur"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "janúar"
|
||||
#define L_FEB "febrúar"
|
||||
#define L_MAR "mars"
|
||||
#define L_APR "apríl"
|
||||
#define L_MAY "maí"
|
||||
#define L_JUN "júní"
|
||||
#define L_JUL "júlí"
|
||||
#define L_AUG "ágúst"
|
||||
#define L_SEP "september"
|
||||
#define L_OCT "október"
|
||||
#define L_NOV "nóvember"
|
||||
#define L_DEC "desember"
|
||||
|
||||
/* Today and tomorrow */
|
||||
#define L_TODAY "í dag"
|
||||
#define L_TOMORROW "á morgun"
|
||||
|
||||
/* The default banner */
|
||||
#define L_BANNER "Minnisatriði: %w, %d%s %m, %y%o:"
|
||||
|
||||
/* "am" and "pm" */
|
||||
#define L_AM "fh"
|
||||
#define L_PM "eh"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "síðan"
|
||||
#define L_FROMNOW "frá því nú"
|
||||
|
||||
/* "in %d days' time" */
|
||||
#define L_INXDAYS "eftir %d daga"
|
||||
|
||||
/* "on" as in "on date..." */
|
||||
#define L_ON "þann"
|
||||
|
||||
/* Pluralizing - this is a problem for many languages and may require
|
||||
a more drastic fix */
|
||||
#define L_PLURAL "a"
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#define L_NOW "núna"
|
||||
#define L_AT "kl."
|
||||
#define L_MINUTE "mínútu"
|
||||
#define L_HOUR "klukkustund"
|
||||
#define L_IS "er"
|
||||
#define L_WAS "var"
|
||||
#define L_AND "og"
|
||||
/* What to add to make "hour" plural */
|
||||
#define L_HPLU "ir"
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU "r"
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
134
src/langs/italian.h
Normal file
134
src/langs/italian.h
Normal file
@@ -0,0 +1,134 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ITALIAN.H */
|
||||
/* */
|
||||
/* Support for the Italian language. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* It is Copyright (C) 1996 by Valerio Aimale */
|
||||
/* */
|
||||
/* Remind is copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Italian"
|
||||
|
||||
/* Day names */
|
||||
#if ISOLATIN1
|
||||
#define L_SUNDAY "Domenica"
|
||||
#define L_MONDAY "Luned\354"
|
||||
#define L_TUESDAY "Marted\354"
|
||||
#define L_WEDNESDAY "Mercoled\354"
|
||||
#define L_THURSDAY "Gioved\354"
|
||||
#define L_FRIDAY "Venerd\354"
|
||||
#define L_SATURDAY "Sabato"
|
||||
#else /* ISOLATIN1 */
|
||||
#define L_SUNDAY "Domenica"
|
||||
#define L_MONDAY "Lunedi`"
|
||||
#define L_TUESDAY "Martedi`"
|
||||
#define L_WEDNESDAY "Mercoledi`"
|
||||
#define L_THURSDAY "Giovedi`"
|
||||
#define L_FRIDAY "Venerdi`"
|
||||
#define L_SATURDAY "Sabato"
|
||||
#endif /* ISOLATIN */
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "Gennaio"
|
||||
#define L_FEB "Febbraio"
|
||||
#define L_MAR "Marzo"
|
||||
#define L_APR "Aprile"
|
||||
#define L_MAY "Maggio"
|
||||
#define L_JUN "Giugno"
|
||||
#define L_JUL "Luglio"
|
||||
#define L_AUG "Agosto"
|
||||
#define L_SEP "Settembre"
|
||||
#define L_OCT "Ottobre"
|
||||
#define L_NOV "Novembre"
|
||||
#define L_DEC "Dicembre"
|
||||
|
||||
/* Today and tomorrow */
|
||||
#define L_TODAY "oggi"
|
||||
|
||||
#define L_TOMORROW "domani"
|
||||
|
||||
/* The default banner */
|
||||
#define L_BANNER "Promemoria per %w, %d %m %y%o:"
|
||||
|
||||
/* "am" and "pm" */
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "fa"
|
||||
#define L_FROMNOW "da oggi"
|
||||
|
||||
/* "in %d days' time" */
|
||||
#define L_INXDAYS "fra %d giorni"
|
||||
|
||||
/* "on" as in "on date..." */
|
||||
#define L_ON ""
|
||||
|
||||
/* Pluralizing - this is a problem for many languages and may require
|
||||
a more drastic fix */
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#define L_NOW "ora"
|
||||
#define L_AT "alle"
|
||||
#define L_MINUTE "minut"
|
||||
#define L_HOUR "or"
|
||||
#if ISOLATIN1
|
||||
#define L_IS "\350"
|
||||
#else /* ISOLATIN1 */
|
||||
#define L_IS "e`"
|
||||
#endif/* ISOLATIN1 */
|
||||
#define L_WAS "era"
|
||||
#define L_AND "e"
|
||||
/* What to add to make "hour" plural */
|
||||
#define L_HPLU "s"
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU "s"
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
|
||||
#define L_P_OVER sprintf(s, (diff == 1 ? "o" : "i"));
|
||||
#define L_Q_OVER sprintf(s, (diff == 1 ? "a" : "e"));
|
||||
|
||||
#define L_HPLU_OVER hplu = (hdiff == 1 ? "a" : "e");
|
||||
#define L_MPLU_OVER mplu = (mdiff == 1 ? "o" : "i");
|
||||
|
||||
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d,\
|
||||
MonthName[m], y);
|
||||
#define L_C_OVER sprintf(s, "%s", DayName[jul%7]);
|
||||
|
||||
#define L_E_OVER sprintf(s, "%02d%c%02d%c%04d", d, DateSep,\
|
||||
m+1, DateSep, y);
|
||||
|
||||
#define L_F_OVER sprintf(s, "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
|
||||
|
||||
#define L_G_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
|
||||
|
||||
#define L_H_OVER sprintf(s, "%02d%c%02d", d, DateSep, m+1);
|
||||
|
||||
#define L_I_OVER sprintf(s, "%02d%c%02d", m+1, DateSep, d);
|
||||
|
||||
#define L_J_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, \
|
||||
MonthName[m], y);
|
||||
|
||||
#define L_K_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
|
||||
MonthName[m]);
|
||||
#define L_L_OVER sprintf(s, "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
|
||||
|
||||
#define L_U_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, \
|
||||
MonthName[m], y);
|
||||
|
||||
#define L_V_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
|
||||
MonthName[m]);
|
||||
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
@@ -6,17 +6,16 @@
|
||||
/* */
|
||||
/* 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 $ */
|
||||
|
||||
/* 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 +25,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 +50,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 +65,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 +82,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,16 @@
|
||||
/* 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 $ */
|
||||
|
||||
/* 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 +36,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 +98,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 +107,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 +121,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 +179,7 @@ else \
|
||||
#define L_ERR_OVERRIDE 1
|
||||
EXTERN char *ErrMsg[] =
|
||||
{
|
||||
#ifdef ISOLATIN1
|
||||
#if ISOLATIN1
|
||||
"OK",
|
||||
"Brakuj\261cy ']'",
|
||||
"Brakuj\261cy nawias",
|
||||
@@ -262,7 +254,7 @@ EXTERN char *ErrMsg[] =
|
||||
"Po AT oczekiwany jest czas",
|
||||
"S\263owo UNTIL u\277yte dw\363krotnie",
|
||||
"Niekompletna specyfikacja daty",
|
||||
"S\263owo SCANFROM u\277yte dw\363krotnie",
|
||||
"S\263owo FROM/SCANFROM u\277yte dw\363krotnie",
|
||||
"Zmienna",
|
||||
"Warto\266\346",
|
||||
"*NIE ZDEFINIOWANE*",
|
||||
@@ -286,7 +278,8 @@ EXTERN char *ErrMsg[] =
|
||||
"Brak przypomnie\361.",
|
||||
"%d Przypomnienia zakolejkowane na p\363\274niej.\n",
|
||||
"Spodziewana liczba",
|
||||
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)"
|
||||
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)",
|
||||
"Can't convert between time zones"
|
||||
#else /* ISOLATIN1 */
|
||||
"OK",
|
||||
"Brakujacy ']'",
|
||||
@@ -362,7 +355,7 @@ EXTERN char *ErrMsg[] =
|
||||
"Po AT oczekiwany jest czas",
|
||||
"Slowo UNTIL uzyte dwokrotnie",
|
||||
"Niekompletna specyfikacja daty",
|
||||
"Slowo SCANFROM uzyte dwokrotnie",
|
||||
"Slowo FROM/SCANFROM uzyte dwokrotnie",
|
||||
"Zmienna",
|
||||
"Wartosc",
|
||||
"*UNDEFINED*",
|
||||
@@ -386,7 +379,8 @@ EXTERN char *ErrMsg[] =
|
||||
"Brak przypomnien.",
|
||||
"%d Przypomnienia zakolejkowane na pozniej.\n",
|
||||
"Spodziewana liczba",
|
||||
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)"
|
||||
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)",
|
||||
"Can't convert between time zones"
|
||||
#endif /* ISOLATIN1 */
|
||||
};
|
||||
#endif /* MK_GLOBALS */
|
||||
@@ -394,17 +388,14 @@ EXTERN char *ErrMsg[] =
|
||||
/* The following is only used in init.c */
|
||||
#ifdef L_IN_INIT
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
void Usage(void)
|
||||
{
|
||||
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");
|
||||
291
src/langs/portbr.h
Normal file
291
src/langs/portbr.h
Normal file
@@ -0,0 +1,291 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* PORTBR.H */
|
||||
/* */
|
||||
/* Support for the Brazilian Portuguese Language. */
|
||||
/* */
|
||||
/* Contributed by Marco Paganini (paganini@ism.com.br). */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-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. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Brazilian Portuguese"
|
||||
|
||||
/* Day names */
|
||||
#define L_SUNDAY "domingo"
|
||||
#define L_MONDAY "segunda"
|
||||
#define L_TUESDAY "terca"
|
||||
#define L_WEDNESDAY "quarta"
|
||||
#define L_THURSDAY "quinta"
|
||||
#define L_FRIDAY "sexta"
|
||||
#define L_SATURDAY "sabado"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "janeiro"
|
||||
#define L_FEB "fevereiro"
|
||||
#define L_MAR "marco"
|
||||
#define L_APR "abril"
|
||||
#define L_MAY "maio"
|
||||
#define L_JUN "junho"
|
||||
#define L_JUL "julho"
|
||||
#define L_AUG "agosto"
|
||||
#define L_SEP "setembro"
|
||||
#define L_OCT "outubro"
|
||||
#define L_NOV "novembro"
|
||||
#define L_DEC "dezembro"
|
||||
|
||||
/* Today and tomorrow */
|
||||
#define L_TODAY "hoje"
|
||||
#define L_TOMORROW "amanha"
|
||||
|
||||
/* The default banner */
|
||||
#define L_BANNER "Avisos para %w, %d de %m de %y%o:"
|
||||
|
||||
/* "am" and "pm" */
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "atras"
|
||||
#define L_FROMNOW "adiante"
|
||||
|
||||
/* "in %d days' time" */
|
||||
#define L_INXDAYS "em %d dias"
|
||||
|
||||
/* "on" as in "on date..." */
|
||||
#define L_ON "em"
|
||||
|
||||
/* Pluralizing - this is a problem for many languages and may require
|
||||
a more drastic fix */
|
||||
#define L_PLURAL "s"
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#define L_NOW "agora"
|
||||
#define L_AT "as"
|
||||
#define L_MINUTE "minuto"
|
||||
#define L_HOUR "hora"
|
||||
#define L_IS "sao"
|
||||
#define L_WAS "eram"
|
||||
#define L_AND "e"
|
||||
|
||||
/* What to add to make "hour" plural */
|
||||
#define L_HPLU "s"
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU "s"
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
|
||||
#define L_ORDINAL_OVERRIDE plu = "";
|
||||
|
||||
/* Portuguese weekdays must be treated separately */
|
||||
#define _ON_WEEKDAY(x) ((x % 7) < 2) ? "no" : "na"
|
||||
|
||||
#define L_A_OVER \
|
||||
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m], y);
|
||||
|
||||
#define L_C_OVER \
|
||||
sprintf(s, "%s %s", _ON_WEEKDAY(jul), DayName[jul%7]);
|
||||
|
||||
#define L_G_OVER \
|
||||
sprintf(s, "%s %s, %d %s", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m]);
|
||||
|
||||
#define L_J_OVER \
|
||||
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m], y);
|
||||
|
||||
#define L_K_OVER \
|
||||
sprintf(s, "%s %s, %d de %s", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m]);
|
||||
|
||||
/* Portuguese does not use some suffixes, some some %u and %j are the same */
|
||||
#define L_U_OVER \
|
||||
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m], y);
|
||||
|
||||
#define L_V_OVER \
|
||||
sprintf(s, "%s %s, %d de %s", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m]);
|
||||
|
||||
#define L_1_OVER \
|
||||
{ \
|
||||
if (tdiff == 0) \
|
||||
sprintf(s, L_NOW); \
|
||||
else \
|
||||
if (hdiff == 0) \
|
||||
{ \
|
||||
if (mdiff > 0) \
|
||||
sprintf(s, "em %d %s%s", mdiff, L_MINUTE, mplu); \
|
||||
else \
|
||||
sprintf(s, "%d %s%s atras", mdiff, L_MINUTE, mplu); \
|
||||
} \
|
||||
else if (mdiff == 0) \
|
||||
{ \
|
||||
if (hdiff > 0) \
|
||||
sprintf(s, "em %d %s%s", hdiff, L_HOUR, hplu); \
|
||||
else \
|
||||
sprintf(s, "%d %s%s atras", hdiff, L_HOUR, hplu); \
|
||||
} else { \
|
||||
if (tdiff > 0) \
|
||||
sprintf(s, "em %d %s%s %s %d %s%s", hdiff, L_HOUR, hplu, L_AND, mdiff, L_MINUTE, mplu); \
|
||||
else \
|
||||
sprintf(s, "%d %s%s %s %d %s%s atras", hdiff, L_HOUR, hplu, L_AND, mdiff, L_MINUTE, mplu); \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
/* The next ones are used only when MK_GLOBALS is set */
|
||||
#ifdef MK_GLOBALS
|
||||
#define L_ERR_OVERRIDE 1
|
||||
EXTERN char *ErrMsg[] =
|
||||
{
|
||||
"Ok",
|
||||
"Falta um ']'",
|
||||
"Falta uma aspa",
|
||||
"Expressao muito complexa - muitos operadores",
|
||||
"Expressao muito complexa - muitos operandos",
|
||||
"Falta um ')'",
|
||||
"Funcao nao definida",
|
||||
"Caracter ilegal",
|
||||
"Esperando operador binario",
|
||||
"Sem memoria",
|
||||
"Numero mal-formado",
|
||||
"Op stack underflow - erro interno",
|
||||
"Va stack underflow - erro interno",
|
||||
"Nao consigo fazer 'coerce'",
|
||||
"Type mismatch",
|
||||
"Overflow na data",
|
||||
"Erro de stack - erro interno",
|
||||
"Divisao por zero",
|
||||
"Variavel nao definida",
|
||||
"Fim da linha nao esperado",
|
||||
"Fim de arquivo nao esperado",
|
||||
"Erro de I/O",
|
||||
"Linha muito longa",
|
||||
"Erro interno",
|
||||
"Especificacao de data invalida",
|
||||
"Argumentos insuficientes",
|
||||
"Argumentos em excesso",
|
||||
"Hora mal-formada",
|
||||
"Numero muito grande",
|
||||
"Numero muito pequeno",
|
||||
"Nao consigo abrir o arquivo",
|
||||
"Ninho de INCLUDEs muito profundo",
|
||||
"Erro de parsing",
|
||||
"Nao consigo computar o 'trigger'",
|
||||
"Muitos IFs aninhados",
|
||||
"ELSE sem o IF correspondente",
|
||||
"ENDIF sem o IF correspondente",
|
||||
"Nao se pode usar OMIT para todos os dias da semana",
|
||||
"Token nao reconhecido na linha",
|
||||
"POP-OMIT-CONTEXT sem PUSH-OMIT-CONTEXT correspondente",
|
||||
"RUN desabilitado",
|
||||
"Erro de dominio",
|
||||
"Identificados invalido",
|
||||
"Chamada de funcao recursiva detectada",
|
||||
"",
|
||||
"Nao posso modificar variavel de sistema",
|
||||
"Funcao da biblioteca C nao pode representar data/hora",
|
||||
"Tentativa de redefinir funcao interna",
|
||||
"Nao e' possivel aninhar definicao de funcao em expressao",
|
||||
"Data deve ser completamente especificada para usar o fator de REPEAT",
|
||||
"Ano especificado duas vezes",
|
||||
"Mes especificado duas vezes",
|
||||
"Dia especificado duas vezes",
|
||||
"Token desconhecido",
|
||||
"Mes e dia devem ser especificados no comando OMIT",
|
||||
"Muitos OMITs parciais",
|
||||
"Muitos OMITs full",
|
||||
"Aviso: PUSH-OMIT-CONTEXT sem POP-OMIT-CONTEXT correspondente",
|
||||
"Erro na leitura do arquivo",
|
||||
"Aguardando fim do arquivo",
|
||||
"Data hebraica invalida",
|
||||
"IIF necessita de numero impar de argumentos",
|
||||
"Warning: ENDIF faltando",
|
||||
"Esperando virgula",
|
||||
"Dia da semana especificado duas vezes",
|
||||
"Use apenas um de BEFORE, AFTER ou SKIP",
|
||||
"Nao e possivel aninhar MSG, MSF, RUN, etc. em expressoes",
|
||||
"Valor de Repeat especificado duas vezes",
|
||||
"Valor de Delta especificado duas vezes",
|
||||
"Valor de Back especificado duas vezes",
|
||||
"ONCE usado duas vezes (Eheheh)",
|
||||
"Esperando hora apos AT",
|
||||
"Keyword UNTIL usada duas vezes",
|
||||
"Especificacao de data incompleta",
|
||||
"Keyword FROM/SCANFROM usada duas vezes",
|
||||
"Variavel",
|
||||
"Valor",
|
||||
"*INDEFINIDO*",
|
||||
"Entrando UserFN",
|
||||
"Saindo UserFN",
|
||||
"Expirou",
|
||||
"fork() falhou - Nao posso processar compromissos na fila",
|
||||
"Nao consigo acessar o arquivo",
|
||||
"Data do sistema ilegal: Ano e menor que %d\n",
|
||||
"Flag de debug desconhecido '%c'\n",
|
||||
"Opcao desconhecida '%c'\n",
|
||||
"Usuario desconhecido '%s'\n",
|
||||
"Nao consigo mudar gid para %d\n",
|
||||
"Nao consigo mudar uid para %d\n",
|
||||
"Sem memoria para o environment\n",
|
||||
"Falta o sinal de '='",
|
||||
"Falta o nome da variavel",
|
||||
"Falta a expressao",
|
||||
"Nao consigo resetar a data de acesso de %s\n",
|
||||
"Remind: '-i' opcao: %s\n",
|
||||
"Sem compromissos.",
|
||||
"%d compromisso(s) colocados na fila para mais tarde.\n",
|
||||
"Esperando numero",
|
||||
"Funcao ilegal na clausula WARN",
|
||||
"Can't convert between time zones"
|
||||
};
|
||||
#endif /* MK_GLOBALS */
|
||||
|
||||
/* The following is only used in init.c */
|
||||
#ifdef L_IN_INIT
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
void Usage(void)
|
||||
{
|
||||
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
|
||||
fprintf(ErrFp, "Uso: remind [opcoes] arquivo [data] [hora] [*rep]\n");
|
||||
fprintf(ErrFp, "Opcoes:\n");
|
||||
fprintf(ErrFp, " -n Imprime a proxima ocorrencia em formato simples\n");
|
||||
fprintf(ErrFp, " -r Desabilita a diretiva RUN\n");
|
||||
fprintf(ErrFp, " -c[n] Produz calendario para n (default 1) meses\n");
|
||||
fprintf(ErrFp, " -c+[n] Produz calendario para n (default 1) semanas\n");
|
||||
fprintf(ErrFp, " -w[n[,p[,s]]] Especifica largura, preenchimento e espacejamento do calendario\n");
|
||||
fprintf(ErrFp, " -s[+][n] Produz um `calendario simples' para n (1) meses (semanas)\n");
|
||||
fprintf(ErrFp, " -p[n] Identico a -s, porem com saida compativel com rem2ps\n");
|
||||
fprintf(ErrFp, " -v Modo verbose\n");
|
||||
fprintf(ErrFp, " -o Ignora diretivas ONCE\n");
|
||||
fprintf(ErrFp, " -t Aciona todos os compromissos futuros, sem considerar o delta\n");
|
||||
fprintf(ErrFp, " -h Modo `Hush' - quieto\n");
|
||||
#ifdef HAVE_QUEUED
|
||||
fprintf(ErrFp, " -a Nao aciona compromissos com hora imediatamente - apenas coloca na fila\n");
|
||||
fprintf(ErrFp, " -q Nao coloca compromissos com hora na fila\n");
|
||||
fprintf(ErrFp, " -f Aciona compromissos com hora em modo foreground\n");
|
||||
fprintf(ErrFp, " -z[n] Modo `daemon', acordando a cada n (5) minutos.\n");
|
||||
#endif
|
||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trigger v=dumpvars l=showline\n");
|
||||
fprintf(ErrFp, " -e Desvia mensagens normalmente enviadas a stderr para stdout\n");
|
||||
fprintf(ErrFp, " -b[n] Formato da hora para o cal: 0=am/pm, 1=24hr, 2=nenhum\n");
|
||||
fprintf(ErrFp, " -x[n] Limite de iteracoes para a clausula SATISFY (default=150)\n");
|
||||
fprintf(ErrFp, " -kcmd Executa `cmd' para os compromissos com MSG\n");
|
||||
fprintf(ErrFp, " -g[ddd] Classifica compromissos por data, hora e prioridade antes de exibir\n");
|
||||
fprintf(ErrFp, " -ivar=val Inicializa (e preserva) variavel var com val\n");
|
||||
fprintf(ErrFp, " -m Inicia o calendario na segunda, ao inves de domingo\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif /* L_IN_INIT */
|
||||
163
src/langs/romanian.h
Normal file
163
src/langs/romanian.h
Normal file
@@ -0,0 +1,163 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* 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 */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* 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 */
|
||||
97
src/langs/spanish.h
Normal file
97
src/langs/spanish.h
Normal file
@@ -0,0 +1,97 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* 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. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#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 */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
249
src/md5.c
Normal file
249
src/md5.c
Normal file
@@ -0,0 +1,249 @@
|
||||
/*
|
||||
* This code implements the MD5 message-digest algorithm.
|
||||
* The algorithm is due to Ron Rivest. This code was
|
||||
* written by Colin Plumb in 1993, no copyright is claimed.
|
||||
* This code is in the public domain; do with it what you wish.
|
||||
*
|
||||
* Equivalent code is available from RSA Data Security, Inc.
|
||||
* This code has been tested against that, and is equivalent,
|
||||
* except that you don't need to include two pages of legalese
|
||||
* with every copy.
|
||||
*
|
||||
* LIC: GPL
|
||||
*
|
||||
* To compute the message digest of a chunk of bytes, declare an
|
||||
* MD5Context structure, pass it to MD5Init, call MD5Update as
|
||||
* needed on buffers full of bytes, and then call MD5Final, which
|
||||
* will fill a supplied 16-byte array with the digest.
|
||||
*/
|
||||
#include <string.h> /* for memcpy() */
|
||||
#include "md5.h"
|
||||
|
||||
static void byteReverse(unsigned char *buf, unsigned longs);
|
||||
|
||||
/*
|
||||
* Note: this code is harmless on little-endian machines.
|
||||
*/
|
||||
static void
|
||||
byteReverse(unsigned char *buf, unsigned longs)
|
||||
{
|
||||
uint32 t;
|
||||
do {
|
||||
t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
|
||||
((unsigned) buf[1] << 8 | buf[0]);
|
||||
*(uint32 *) buf = t;
|
||||
buf += 4;
|
||||
} while (--longs);
|
||||
}
|
||||
|
||||
/*
|
||||
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
|
||||
* initialization constants.
|
||||
*/
|
||||
void MD5Init(struct MD5Context *ctx)
|
||||
{
|
||||
ctx->buf[0] = 0x67452301;
|
||||
ctx->buf[1] = 0xefcdab89;
|
||||
ctx->buf[2] = 0x98badcfe;
|
||||
ctx->buf[3] = 0x10325476;
|
||||
|
||||
ctx->bits[0] = 0;
|
||||
ctx->bits[1] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update context to reflect the concatenation of another buffer full
|
||||
* of bytes.
|
||||
*/
|
||||
void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
|
||||
{
|
||||
uint32 t;
|
||||
|
||||
/* Update bitcount */
|
||||
|
||||
t = ctx->bits[0];
|
||||
if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
|
||||
ctx->bits[1]++; /* Carry from low to high */
|
||||
ctx->bits[1] += len >> 29;
|
||||
|
||||
t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
|
||||
|
||||
/* Handle any leading odd-sized chunks */
|
||||
|
||||
if (t) {
|
||||
unsigned char *p = (unsigned char *) ctx->in + t;
|
||||
|
||||
t = 64 - t;
|
||||
if (len < t) {
|
||||
memcpy(p, buf, len);
|
||||
return;
|
||||
}
|
||||
memcpy(p, buf, t);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
buf += t;
|
||||
len -= t;
|
||||
}
|
||||
/* Process data in 64-byte chunks */
|
||||
|
||||
while (len >= 64) {
|
||||
memcpy(ctx->in, buf, 64);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
buf += 64;
|
||||
len -= 64;
|
||||
}
|
||||
|
||||
/* Handle any remaining bytes of data. */
|
||||
|
||||
memcpy(ctx->in, buf, len);
|
||||
}
|
||||
|
||||
/*
|
||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||
* 1 0* (64-bit count of bits processed, MSB-first)
|
||||
*/
|
||||
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
|
||||
{
|
||||
unsigned count;
|
||||
unsigned char *p;
|
||||
|
||||
/* Compute number of bytes mod 64 */
|
||||
count = (ctx->bits[0] >> 3) & 0x3F;
|
||||
|
||||
/* Set the first char of padding to 0x80. This is safe since there is
|
||||
always at least one byte free */
|
||||
p = ctx->in + count;
|
||||
*p++ = 0x80;
|
||||
|
||||
/* Bytes of padding needed to make 64 bytes */
|
||||
count = 64 - 1 - count;
|
||||
|
||||
/* Pad out to 56 mod 64 */
|
||||
if (count < 8) {
|
||||
/* Two lots of padding: Pad the first block to 64 bytes */
|
||||
memset(p, 0, count);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
|
||||
/* Now fill the next block with 56 bytes */
|
||||
memset(ctx->in, 0, 56);
|
||||
} else {
|
||||
/* Pad block to 56 bytes */
|
||||
memset(p, 0, count - 8);
|
||||
}
|
||||
byteReverse(ctx->in, 14);
|
||||
|
||||
/* Append length in bits and transform */
|
||||
((uint32 *) ctx->in)[14] = ctx->bits[0];
|
||||
((uint32 *) ctx->in)[15] = ctx->bits[1];
|
||||
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
byteReverse((unsigned char *) ctx->buf, 4);
|
||||
memcpy(digest, ctx->buf, 16);
|
||||
memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
|
||||
}
|
||||
|
||||
#ifndef ASM_MD5
|
||||
|
||||
/* The four core functions - F1 is optimized somewhat */
|
||||
|
||||
/* #define F1(x, y, z) (x & y | ~x & z) */
|
||||
#define F1(x, y, z) (z ^ (x & (y ^ z)))
|
||||
#define F2(x, y, z) F1(z, x, y)
|
||||
#define F3(x, y, z) (x ^ y ^ z)
|
||||
#define F4(x, y, z) (y ^ (x | ~z))
|
||||
|
||||
/* This is the central step in the MD5 algorithm. */
|
||||
#define MD5STEP(f, w, x, y, z, data, s) \
|
||||
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
|
||||
|
||||
/*
|
||||
* The core of the MD5 algorithm, this alters an existing MD5 hash to
|
||||
* reflect the addition of 16 longwords of new data. MD5Update blocks
|
||||
* the data and converts bytes into longwords for this routine.
|
||||
*/
|
||||
void MD5Transform(uint32 buf[4], uint32 const in[16])
|
||||
{
|
||||
register uint32 a, b, c, d;
|
||||
|
||||
a = buf[0];
|
||||
b = buf[1];
|
||||
c = buf[2];
|
||||
d = buf[3];
|
||||
|
||||
MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
|
||||
|
||||
MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
|
||||
|
||||
MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
|
||||
|
||||
MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
|
||||
|
||||
buf[0] += a;
|
||||
buf[1] += b;
|
||||
buf[2] += c;
|
||||
buf[3] += d;
|
||||
}
|
||||
|
||||
#endif
|
||||
34
src/md5.h
Normal file
34
src/md5.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef MD5_H
|
||||
#define MD5_H
|
||||
/*
|
||||
* LIC: GPL
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if SIZEOF_UNSIGNED_INT == 4
|
||||
typedef unsigned int uint32;
|
||||
#elif SIZEOF_UNSIGNED_LONG == 4
|
||||
typedef unsigned long uint32;
|
||||
#else
|
||||
# error Could not find a 32-bit integer type
|
||||
#endif
|
||||
|
||||
struct MD5Context {
|
||||
uint32 buf[4];
|
||||
uint32 bits[2];
|
||||
unsigned char in[64];
|
||||
};
|
||||
|
||||
void MD5Init(struct MD5Context *context);
|
||||
void MD5Update(struct MD5Context *context, unsigned char const *buf,
|
||||
unsigned len);
|
||||
void MD5Final(unsigned char digest[16], struct MD5Context *context);
|
||||
void MD5Transform(uint32 buf[4], uint32 const in[16]);
|
||||
|
||||
/*
|
||||
* This is needed to make RSAREF happy on some MS-DOS compilers.
|
||||
*/
|
||||
typedef struct MD5Context MD5_CTX;
|
||||
|
||||
#endif /* !MD5_H */
|
||||
@@ -5,11 +5,12 @@
|
||||
/* Calculations for figuring out moon phases. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-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"
|
||||
|
||||
/* All of these routines were adapted from the program "moontool"
|
||||
by John Walker, February 1988. Here's the blurb from moontool:
|
||||
@@ -59,10 +60,7 @@ 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>
|
||||
@@ -73,14 +71,14 @@ static char const RCSID[] = "$Id: moon.c,v 1.1 1996-03-27 03:26:03 dfs Exp $";
|
||||
#include "err.h"
|
||||
|
||||
/* Function prototypes */
|
||||
PRIVATE long jdate ARGS((int y, int mon, int day));
|
||||
PRIVATE double jtime ARGS((int y, int mon, int day, int hour, int min, int sec));
|
||||
PRIVATE void jyear ARGS((double td, int *yy, int *mm, int *dd));
|
||||
PRIVATE void jhms ARGS((double j, int *h, int *m, int *s));
|
||||
PRIVATE double meanphase ARGS((double sdate, double phase, double *usek));
|
||||
PRIVATE double truephase ARGS((double k, double phase));
|
||||
PRIVATE double kepler ARGS((double m, double ecc));
|
||||
PRIVATE double phase ARGS((double, double *, double *, double *, double *, double *, double *));
|
||||
static long jdate (int y, int mon, int day);
|
||||
static double jtime (int y, int mon, int day, int hour, int min, int sec);
|
||||
static void jyear (double td, int *yy, int *mm, int *dd);
|
||||
static void jhms (double j, int *h, int *m, int *s);
|
||||
static double meanphase (double sdate, double phase, double *usek);
|
||||
static double truephase (double k, double phase);
|
||||
static double kepler (double m, double ecc);
|
||||
static double phase (double, double *, double *, double *, double *, double *, double *);
|
||||
|
||||
|
||||
/* Astronomical constants */
|
||||
@@ -149,12 +147,7 @@ PRIVATE double phase ARGS((double, double *, double *, double *, double *, doubl
|
||||
/* Convert a date and time to Julian day and fraction. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE long jdate(int y, int mon, int day)
|
||||
#else
|
||||
static long jdate(y, mon, day)
|
||||
int y, mon, day;
|
||||
#endif
|
||||
static long jdate(int y, int mon, int day)
|
||||
{
|
||||
long c, m;
|
||||
|
||||
@@ -178,12 +171,7 @@ int y, mon, day;
|
||||
/* i.e. Julian date plus day fraction, expressed as a double */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double jtime(int y, int mon, int day, int hour, int min, int sec)
|
||||
#else
|
||||
static double jtime(y, mon, day, hour, min, sec)
|
||||
int y, mon, day, hour, min, sec;
|
||||
#endif
|
||||
static double jtime(int y, int mon, int day, int hour, int min, int sec)
|
||||
{
|
||||
return (jdate(y, mon, day)-0.5) +
|
||||
(sec + 60L * (long) min + 3600L * (long) hour) / 86400.0;
|
||||
@@ -196,13 +184,7 @@ int y, mon, day, hour, min, sec;
|
||||
/* Convert a Julian date to year, month, day. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void jyear(double td, int *yy, int *mm, int *dd)
|
||||
#else
|
||||
static void jyear(td, yy, mm, dd)
|
||||
double td;
|
||||
int *yy, *mm, *dd;
|
||||
#endif
|
||||
static void jyear(double td, int *yy, int *mm, int *dd)
|
||||
{
|
||||
double j, d, y, m;
|
||||
|
||||
@@ -237,13 +219,7 @@ int *yy, *mm, *dd;
|
||||
/* Convert a Julian time to hour, minutes and seconds. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void jhms(double j, int *h, int *m, int *s)
|
||||
#else
|
||||
static void jhms(j, h, m, s)
|
||||
double j;
|
||||
int *h, *m, *s;
|
||||
#endif
|
||||
static void jhms(double j, int *h, int *m, int *s)
|
||||
{
|
||||
long ij;
|
||||
|
||||
@@ -271,13 +247,7 @@ int *h, *m, *s;
|
||||
/* than this calculation reveals. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double meanphase(double sdate, double phase, double *usek)
|
||||
#else
|
||||
static double meanphase(sdate, phase, usek)
|
||||
double sdate, phase;
|
||||
double *usek;
|
||||
#endif
|
||||
static double meanphase(double sdate, double phase, double *usek)
|
||||
{
|
||||
double k, t, t2, t3, nt1;
|
||||
|
||||
@@ -313,12 +283,7 @@ double *usek;
|
||||
/* the true, corrected phase time. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double truephase(double k, double phase)
|
||||
#else
|
||||
static double truephase(k, phase)
|
||||
double k, phase;
|
||||
#endif
|
||||
static double truephase(double k, double phase)
|
||||
{
|
||||
double t, t2, t3, pt, m, mprime, f;
|
||||
int apcor = 0;
|
||||
@@ -399,12 +364,7 @@ double k, phase;
|
||||
/* Solve the equation of Kepler. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double kepler(double m, double ecc)
|
||||
#else
|
||||
static double kepler(m, ecc)
|
||||
double m, ecc;
|
||||
#endif
|
||||
static double kepler(double m, double ecc)
|
||||
{
|
||||
double e, delta;
|
||||
#define EPSILON 1E-6
|
||||
@@ -432,24 +392,13 @@ double m, ecc;
|
||||
/* the centre of the Earth. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double phase(double pdate,
|
||||
double *pphase,
|
||||
double *mage,
|
||||
double *dist,
|
||||
double *angdia,
|
||||
double *sudist,
|
||||
double *suangdia)
|
||||
#else
|
||||
static double phase(pdate, pphase, mage, dist, angdia, sudist, suangdia)
|
||||
double pdate;
|
||||
double *pphase; /* Illuminated fraction */
|
||||
double *mage; /* Age of moon in days */
|
||||
double *dist; /* Distance in kilometres */
|
||||
double *angdia; /* Angular diameter in degrees */
|
||||
double *sudist; /* Distance to Sun */
|
||||
double *suangdia; /* Sun's angular diameter */
|
||||
#endif
|
||||
static double phase(double pdate,
|
||||
double *pphase,
|
||||
double *mage,
|
||||
double *dist,
|
||||
double *angdia,
|
||||
double *sudist,
|
||||
double *suangdia)
|
||||
{
|
||||
|
||||
double Day, N, M, Ec, Lambdasun, ml, MM, MN, Ev, Ae, A3, MmP,
|
||||
@@ -562,12 +511,7 @@ double *suangdia; /* Sun's angular diameter */
|
||||
/* that date and time as a number from 0 to 360. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int MoonPhase(int date, int time)
|
||||
#else
|
||||
int MoonPhase(date, time)
|
||||
int date, time;
|
||||
#endif
|
||||
int MoonPhase(int date, int time)
|
||||
{
|
||||
int utcd, utct;
|
||||
int y, m, d;
|
||||
@@ -597,12 +541,7 @@ int date, time;
|
||||
/* 0 to 3 for new, 1stq, full, 3rdq */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void HuntPhase(int startdate, int starttim, int phas, int *date, int *time)
|
||||
#else
|
||||
void HuntPhase(startdate, starttim, phas, date, time)
|
||||
int startdate, starttim, phas, *date, *time;
|
||||
#endif
|
||||
void HuntPhase(int startdate, int starttim, int phas, int *date, int *time)
|
||||
{
|
||||
int utcd, utct;
|
||||
int y, m, d;
|
||||
@@ -6,27 +6,23 @@
|
||||
/* 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"
|
||||
|
||||
#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"
|
||||
#include "err.h"
|
||||
|
||||
PRIVATE int BexistsIntArray ARGS ((int array[], int num, int key));
|
||||
PRIVATE void InsertIntoSortedArray ARGS ((int *array, int num, int key));
|
||||
static int BexistsIntArray (int array[], int num, int key);
|
||||
static void InsertIntoSortedArray (int *array, int num, int key);
|
||||
|
||||
/* Arrays for the global omits */
|
||||
static int FullOmitArray[MAX_FULL_OMITS];
|
||||
@@ -53,11 +49,7 @@ static OmitContext *SavedOmitContexts = NULL;
|
||||
/* Clear all the global OMIT context. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ClearGlobalOmits(void)
|
||||
#else
|
||||
int ClearGlobalOmits()
|
||||
#endif
|
||||
int ClearGlobalOmits(void)
|
||||
{
|
||||
NumFullOmits = NumPartialOmits = 0;
|
||||
return OK;
|
||||
@@ -70,12 +62,7 @@ int ClearGlobalOmits()
|
||||
/* The command-line function CLEAR-OMIT-CONTEXT */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoClear(ParsePtr p)
|
||||
#else
|
||||
int DoClear(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int DoClear(ParsePtr p)
|
||||
{
|
||||
ClearGlobalOmits();
|
||||
return VerifyEoln(p);
|
||||
@@ -90,11 +77,7 @@ ParsePtr p;
|
||||
/* destroyed. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DestroyOmitContexts(void)
|
||||
#else
|
||||
int DestroyOmitContexts()
|
||||
#endif
|
||||
int DestroyOmitContexts(void)
|
||||
{
|
||||
OmitContext *c = SavedOmitContexts;
|
||||
OmitContext *d;
|
||||
@@ -119,12 +102,7 @@ int DestroyOmitContexts()
|
||||
/* Push the OMIT context on to the stack. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int PushOmitContext(ParsePtr p)
|
||||
#else
|
||||
int PushOmitContext(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int PushOmitContext(ParsePtr p)
|
||||
{
|
||||
register int i;
|
||||
OmitContext *context;
|
||||
@@ -167,12 +145,7 @@ ParsePtr p;
|
||||
/* Pop the OMIT context off of the stack. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int PopOmitContext(ParsePtr p)
|
||||
#else
|
||||
int PopOmitContext(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int PopOmitContext(ParsePtr p)
|
||||
{
|
||||
|
||||
register int i;
|
||||
@@ -207,12 +180,7 @@ ParsePtr p;
|
||||
/* Return non-zero if date is OMITted, zero if it is not. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int IsOmitted(int jul, int localomit)
|
||||
#else
|
||||
int IsOmitted(jul, localomit)
|
||||
int jul, localomit;
|
||||
#endif
|
||||
int IsOmitted(int jul, int localomit)
|
||||
{
|
||||
int y, m, d;
|
||||
|
||||
@@ -239,12 +207,7 @@ int jul, localomit;
|
||||
/* element is found, 0 otherwise. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int BexistsIntArray(int array[], int num, int key)
|
||||
#else
|
||||
static int BexistsIntArray(array, num, key)
|
||||
int array[], num, key;
|
||||
#endif
|
||||
static int BexistsIntArray(int array[], int num, int key)
|
||||
{
|
||||
int top=num-1, bot=0, mid;
|
||||
|
||||
@@ -265,12 +228,7 @@ int array[], num, key;
|
||||
/* room in the array for it. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void InsertIntoSortedArray(int *array, int num, int key)
|
||||
#else
|
||||
static void InsertIntoSortedArray(array, num, key)
|
||||
int *array, num, key;
|
||||
#endif
|
||||
static void InsertIntoSortedArray(int *array, int num, int key)
|
||||
{
|
||||
/* num is number of elements CURRENTLY in the array. */
|
||||
int *cur = array+num;
|
||||
@@ -289,50 +247,57 @@ int *array, num, key;
|
||||
/* Do a global OMIT command. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoOmit(ParsePtr p)
|
||||
#else
|
||||
int DoOmit(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int DoOmit(ParsePtr p)
|
||||
{
|
||||
int y = NO_YR, m = NO_MON, d = NO_DAY, r;
|
||||
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;
|
||||
}
|
||||
}
|
||||
135
src/protos.h
Normal file
135
src/protos.h
Normal file
@@ -0,0 +1,135 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* PROTOS.H */
|
||||
/* */
|
||||
/* Function Prototypes. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* Define a string assignment macro - be careful!!! */
|
||||
#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
|
||||
|
||||
/* Define a general malloc routine for creating pointers to objects */
|
||||
#define NEW(type) ((type *) malloc(sizeof(type)))
|
||||
|
||||
#include "dynbuf.h"
|
||||
|
||||
int CallUserFunc (char *name, int nargs);
|
||||
int DoFset (ParsePtr p);
|
||||
void ProduceCalendar (void);
|
||||
char *SimpleTime (int tim);
|
||||
int DoRem (ParsePtr p);
|
||||
int DoFlush (ParsePtr p);
|
||||
void DoExit (ParsePtr p);
|
||||
int ParseRem (ParsePtr s, Trigger *trig, TimeTrig *tim);
|
||||
int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int jul);
|
||||
int ShouldTriggerReminder (Trigger *t, TimeTrig *tim, int jul);
|
||||
int DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode);
|
||||
int DoSubstFromString (char *source, DynamicBuffer *dbuf, int jul, int tim);
|
||||
int EvalExpr (char **e, Value *v);
|
||||
int DoCoerce (char type, Value *v);
|
||||
void PrintValue (Value *v, FILE *fp);
|
||||
int CopyValue (Value *dest, const Value *src);
|
||||
int ReadLine (void);
|
||||
int OpenFile (const char *fname);
|
||||
int PopFile (void);
|
||||
int DoInclude (ParsePtr p);
|
||||
int IncludeFile (const char *fname);
|
||||
int GetAccessDate (char *file);
|
||||
int SetAccessDate (char *fname, int jul);
|
||||
int TopLevel (void);
|
||||
int CallFunc (Operator *f, int nargs);
|
||||
void InitRemind (int argc, char *argv[]);
|
||||
void Usage (void);
|
||||
int main (int argc, char *argv[]);
|
||||
int Julian (int year, int month, int day);
|
||||
void FromJulian (int jul, int *y, int *m, int *d);
|
||||
int ParseChar (ParsePtr p, int *err, int peek);
|
||||
int ParseToken (ParsePtr p, DynamicBuffer *dbuf);
|
||||
int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf);
|
||||
int EvaluateExpr (ParsePtr p, Value *v);
|
||||
int Evaluate (char **s, Var *locals);
|
||||
int FnPopValStack (Value *val);
|
||||
void Eprint (const char *fmt, ...);
|
||||
void OutputLine (FILE *fp);
|
||||
void CreateParser (char *s, ParsePtr p);
|
||||
void DestroyParser (ParsePtr p);
|
||||
int PushToken (const char *tok, ParsePtr p);
|
||||
long SystemTime (int realtime);
|
||||
int SystemDate (int *y, int *m, int *d);
|
||||
int DoIf (ParsePtr p);
|
||||
int DoElse (ParsePtr p);
|
||||
int DoEndif (ParsePtr p);
|
||||
int DoIfTrig (ParsePtr p);
|
||||
int ShouldIgnoreLine (void);
|
||||
int VerifyEoln (ParsePtr p);
|
||||
int DoDebug (ParsePtr p);
|
||||
int DoBanner (ParsePtr p);
|
||||
int DoRun (ParsePtr p);
|
||||
int DoErrMsg (ParsePtr p);
|
||||
int ClearGlobalOmits (void);
|
||||
int DoClear (ParsePtr p);
|
||||
int DestroyOmitContexts (void);
|
||||
int PushOmitContext (ParsePtr p);
|
||||
int PopOmitContext (ParsePtr p);
|
||||
int IsOmitted (int jul, int localomit);
|
||||
int DoOmit (ParsePtr p);
|
||||
int QueueReminder (ParsePtr p, Trigger *trig, TimeTrig *tim, const char *sched);
|
||||
void HandleQueuedReminders (void);
|
||||
char *FindInitialToken (Token *tok, char *s);
|
||||
void FindToken (const char *s, Token *tok);
|
||||
void FindNumericToken (const char *s, Token *t);
|
||||
int ComputeTrigger (int today, Trigger *trig, int *err);
|
||||
char *StrnCpy (char *dest, const char *source, int n);
|
||||
int StrMatch (const char *s1, const char *s2, int n);
|
||||
int StrinCmp (const char *s1, const char *s2, int n);
|
||||
char *StrDup (const char *s);
|
||||
int StrCmpi (const char *s1, const char *s2);
|
||||
Var *FindVar (const char *str, int create);
|
||||
int DeleteVar (const char *str);
|
||||
int SetVar (const char *str, Value *val);
|
||||
int GetVarValue (const char *str, Value *val, Var *locals);
|
||||
int DoSet (Parser *p);
|
||||
int DoUnset (Parser *p);
|
||||
int DoDump (ParsePtr p);
|
||||
void DumpVarTable (void);
|
||||
void DestroyVars (int all);
|
||||
int PreserveVar (char *name);
|
||||
int DoPreserve (Parser *p);
|
||||
int DoSatRemind (Trigger *trig, TimeTrig *tim, ParsePtr p);
|
||||
int DoMsgCommand (char *cmd, char *msg);
|
||||
int ParseNonSpaceChar (ParsePtr p, int *err, int peek);
|
||||
unsigned int HashVal (const char *str);
|
||||
int DateOK (int y, int m, int d);
|
||||
Operator *FindFunc (char *name, Operator where[], int num);
|
||||
int InsertIntoSortBuffer (int jul, int tim, char *body, int typ, int prio);
|
||||
void IssueSortedReminders (void);
|
||||
int UserFuncExists (char *fn);
|
||||
void JulToHeb (int jul, int *hy, int *hm, int *hd);
|
||||
int HebNameToNum (const char *mname);
|
||||
char *HebMonthName (int m, int y);
|
||||
int RoshHashana (int i);
|
||||
long DaysToHebYear (int y);
|
||||
int DaysInHebYear (int y);
|
||||
char *DaysInHebMonths (int ylen);
|
||||
int HebToJul (int hy, int hm, int hd);
|
||||
int GetValidHebDate (int yin, int min, int din, int adarbehave, int *mout, int *dout, int yahr);
|
||||
int GetNextHebrewDate (int julstart, int hm, int hd, int yahr, int adarbehave, int *ans);
|
||||
int ComputeJahr (int y, int m, int d, int *ans);
|
||||
int GetSysVar (const char *name, Value *val);
|
||||
int SetSysVar (const char *name, Value *val);
|
||||
void DumpSysVarByName (const char *name);
|
||||
int CalcMinsFromUTC (int jul, int tim, int *mins, int *isdst);
|
||||
void FillParagraph (char *s);
|
||||
void LocalToUTC (int locdate, int loctime, int *utcdate, int *utctime);
|
||||
void UTCToLocal (int utcdate, int utctime, int *locdate, int *loctime);
|
||||
int MoonPhase (int date, int time);
|
||||
void HuntPhase (int startdate, int starttim, int phas, int *date, int *time);
|
||||
int CompareRems (int dat1, int tim1, int prio1, int dat2, int tim2, int prio2, int bydate, int bytime, int byprio);
|
||||
void SigIntHandler (int d);
|
||||
void GotSigInt (void);
|
||||
void SynthesizeTag(char *);
|
||||
@@ -5,38 +5,28 @@
|
||||
/* 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"
|
||||
|
||||
/* 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
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <sys/time.h>
|
||||
#include <sys/select.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__OS2__) || defined(__MSDOS__)
|
||||
#include <io.h>
|
||||
#if defined(__BORLANDC__)
|
||||
#include <dos.h>
|
||||
#endif
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
@@ -52,6 +42,7 @@ typedef struct queuedrem {
|
||||
int ntrig;
|
||||
char *text;
|
||||
char sched[VAR_NAME_LEN+1];
|
||||
char tag[TAG_LEN+1];
|
||||
TimeTrig tt;
|
||||
} QueuedRem;
|
||||
|
||||
@@ -61,10 +52,12 @@ static QueuedRem *QueueHead;
|
||||
static time_t FileModTime;
|
||||
static struct stat StatBuf;
|
||||
|
||||
PRIVATE void CheckInitialFile ARGS ((void));
|
||||
PRIVATE int CalculateNextTime ARGS ((QueuedRem *q));
|
||||
PRIVATE QueuedRem *FindNextReminder ARGS ((void));
|
||||
PRIVATE int CalculateNextTimeUsingSched ARGS ((QueuedRem *q));
|
||||
static void CheckInitialFile (void);
|
||||
static int CalculateNextTime (QueuedRem *q);
|
||||
static QueuedRem *FindNextReminder (void);
|
||||
static int CalculateNextTimeUsingSched (QueuedRem *q);
|
||||
static void DaemonWait (unsigned int sleeptime);
|
||||
static void reread (void);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -74,23 +67,16 @@ PRIVATE int CalculateNextTimeUsingSched ARGS ((QueuedRem *q));
|
||||
/* enabled. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int QueueReminder(ParsePtr p, int typ, TimeTrig *tim, const char *sched)
|
||||
#else
|
||||
int QueueReminder(p, typ, tim, sched)
|
||||
ParsePtr p;
|
||||
int typ;
|
||||
TimeTrig *tim;
|
||||
char *sched;
|
||||
#endif
|
||||
int QueueReminder(ParsePtr p, Trigger *trig,
|
||||
TimeTrig *tim, const char *sched)
|
||||
{
|
||||
QueuedRem *qelem;
|
||||
|
||||
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 +87,18 @@ char *sched;
|
||||
free(qelem);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
qelem->typ = typ;
|
||||
NumQueued++;
|
||||
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);
|
||||
if (! *qelem->tag && SynthesizeTags) {
|
||||
SynthesizeTag(qelem->tag);
|
||||
}
|
||||
QueueHead = qelem;
|
||||
NumQueued++;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -119,21 +109,20 @@ char *sched;
|
||||
/* Handle the issuing of queued reminders in the background */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void HandleQueuedReminders(void)
|
||||
#else
|
||||
void HandleQueuedReminders()
|
||||
#endif
|
||||
void HandleQueuedReminders(void)
|
||||
{
|
||||
QueuedRem *q = QueueHead;
|
||||
long TimeToSleep;
|
||||
int TimeToSleep;
|
||||
unsigned SleepTime;
|
||||
Parser p;
|
||||
Trigger trig;
|
||||
|
||||
/* 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,27 +138,23 @@ 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);
|
||||
Daemon = 0;
|
||||
} else FileModTime = StatBuf.st_mtime;
|
||||
}
|
||||
|
||||
|
||||
/* Initialize the queue - initialize all the entries time of issue */
|
||||
|
||||
|
||||
while (q) {
|
||||
q->tt.nexttime = (int) (SystemTime(0)/60 - 1);
|
||||
q->tt.nexttime = CalculateNextTime(q);
|
||||
q = q->next;
|
||||
}
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
signal(SIGINT, SigIntHandler);
|
||||
#else
|
||||
if (!DontFork || Daemon) signal(SIGINT, SigIntHandler);
|
||||
#endif
|
||||
|
||||
/* Sit in a loop, issuing reminders when necessary */
|
||||
while(1) {
|
||||
@@ -178,46 +163,77 @@ 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
|
||||
TimeToSleep = (long) q->tt.nexttime * 60L - SystemTime(0);
|
||||
if (Daemon && !q) {
|
||||
if (Daemon < 0) {
|
||||
/* Sleep until midnight */
|
||||
TimeToSleep = MINUTES_PER_DAY*60 - SystemTime(0);
|
||||
} else {
|
||||
TimeToSleep = 60*Daemon;
|
||||
}
|
||||
} else {
|
||||
TimeToSleep = q->tt.nexttime * 60L - SystemTime(0);
|
||||
}
|
||||
|
||||
while (TimeToSleep > 0L) {
|
||||
SleepTime = (unsigned) ((TimeToSleep > 30000L) ? 30000 : TimeToSleep);
|
||||
SleepTime = 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) {
|
||||
if (Daemon < 0) {
|
||||
/* Sleep until midnight */
|
||||
TimeToSleep = MINUTES_PER_DAY*60 - SystemTime(0);
|
||||
} else {
|
||||
TimeToSleep = 60*Daemon;
|
||||
}
|
||||
} else {
|
||||
TimeToSleep = q->tt.nexttime * 60L - SystemTime(0);
|
||||
}
|
||||
|
||||
if (Daemon && !q)
|
||||
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;
|
||||
#ifdef OS2_POPUP
|
||||
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday, 1);
|
||||
#else
|
||||
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;
|
||||
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
|
||||
#endif
|
||||
if (Daemon < 0) {
|
||||
printf("NOTE endreminder\n");
|
||||
}
|
||||
fflush(stdout);
|
||||
|
||||
|
||||
/* Calculate the next trigger time */
|
||||
q->tt.nexttime = CalculateNextTime(q);
|
||||
DestroyParser(&p);
|
||||
}
|
||||
#ifdef __BORLANDC__
|
||||
signal(SIGINT, SIG_DFL);
|
||||
#endif
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -230,12 +246,7 @@ void HandleQueuedReminders()
|
||||
/* fails, revert to AT with delta and rep. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int CalculateNextTime(QueuedRem *q)
|
||||
#else
|
||||
static int CalculateNextTime(q)
|
||||
QueuedRem *q;
|
||||
#endif
|
||||
static int CalculateNextTime(QueuedRem *q)
|
||||
{
|
||||
int tim = q->tt.ttime;
|
||||
int rep = q->tt.rep;
|
||||
@@ -249,8 +260,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;
|
||||
@@ -267,11 +283,7 @@ QueuedRem *q;
|
||||
/* Find the next reminder to trigger */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE QueuedRem *FindNextReminder(void)
|
||||
#else
|
||||
static QueuedRem *FindNextReminder()
|
||||
#endif
|
||||
static QueuedRem *FindNextReminder(void)
|
||||
{
|
||||
QueuedRem *q = QueueHead;
|
||||
QueuedRem *ans = NULL;
|
||||
@@ -281,12 +293,12 @@ static QueuedRem *FindNextReminder()
|
||||
if (!ans) ans = q;
|
||||
else if (q->tt.nexttime < ans->tt.nexttime) ans = q;
|
||||
}
|
||||
|
||||
|
||||
q = q->next;
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -296,11 +308,7 @@ static QueuedRem *FindNextReminder()
|
||||
/* This will be necessary for OS/2 multithreaded. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
void GotSigInt(void)
|
||||
#else
|
||||
void GotSigInt()
|
||||
#endif
|
||||
{
|
||||
QueuedRem *q = QueueHead;
|
||||
|
||||
@@ -309,8 +317,8 @@ void GotSigInt()
|
||||
while (q) {
|
||||
if (q->tt.nexttime != NO_TIME) {
|
||||
printf("Trigger: %02d%c%02d Activate: %02d%c%02d Rep: %d Delta: %d Sched: %s",
|
||||
q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
|
||||
q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
|
||||
q->tt.ttime / 60, TimeSep, q->tt.ttime % 60,
|
||||
q->tt.nexttime / 60, TimeSep, q->tt.nexttime % 60,
|
||||
q->tt.rep, q->tt.delta, q->sched);
|
||||
if (*q->sched) printf("(%d)", q->ntrig+1);
|
||||
printf("%s", NL);
|
||||
@@ -332,11 +340,7 @@ void GotSigInt()
|
||||
/* daemon. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void CheckInitialFile(void)
|
||||
#else
|
||||
static void CheckInitialFile()
|
||||
#endif
|
||||
static void CheckInitialFile(void)
|
||||
{
|
||||
/* If date has rolled around, or file has changed, spawn a new version. */
|
||||
time_t tim = FileModTime;
|
||||
@@ -344,8 +348,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();
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -355,12 +360,7 @@ static void CheckInitialFile()
|
||||
/* Call the scheduling function. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int CalculateNextTimeUsingSched(QueuedRem *q)
|
||||
#else
|
||||
static int CalculateNextTimeUsingSched(q)
|
||||
QueuedRem *q;
|
||||
#endif
|
||||
static int CalculateNextTimeUsingSched(QueuedRem *q)
|
||||
{
|
||||
/* Use LineBuffer for temp. string storage. */
|
||||
int r;
|
||||
@@ -377,17 +377,18 @@ 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;
|
||||
return NO_TIME;
|
||||
}
|
||||
if (v.type == TIM_TYPE) {
|
||||
if (v.type == TIME_TYPE) {
|
||||
ThisTime = v.v.val;
|
||||
} else if (v.type == INT_TYPE) {
|
||||
if (v.v.val > 0)
|
||||
if (v.v.val > 0)
|
||||
ThisTime = q->tt.nexttime + v.v.val;
|
||||
else
|
||||
ThisTime = q->tt.ttime + v.v.val;
|
||||
@@ -398,7 +399,7 @@ QueuedRem *q;
|
||||
return NO_TIME;
|
||||
}
|
||||
if (ThisTime < 0) ThisTime = 0; /* Can't be less than 00:00 */
|
||||
if (ThisTime > 1439) ThisTime = 1439; /* or greater than 11:59 */
|
||||
if (ThisTime > (MINUTES_PER_DAY-1)) ThisTime = (MINUTES_PER_DAY-1); /* or greater than 11:59 */
|
||||
if (ThisTime > q->tt.nexttime) return ThisTime;
|
||||
if (ThisTime <= LastTime) {
|
||||
q->sched[0] = 0;
|
||||
@@ -409,4 +410,82 @@ QueuedRem *q;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* HAVE_QUEUED from way at the top */
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DaemonWait */
|
||||
/* */
|
||||
/* Sleep or read command from stdin in "daemon -1" mode */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static void DaemonWait(unsigned int sleeptime)
|
||||
{
|
||||
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 */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static void reread(void)
|
||||
{
|
||||
execvp(ArgV[0], ArgV);
|
||||
}
|
||||
|
||||
@@ -5,42 +5,35 @@
|
||||
/* 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.3 1996-04-28 02:02:02 dfs Exp $";
|
||||
|
||||
#include "config.h"
|
||||
#include "lang.h"
|
||||
#include "dynbuf.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#ifdef HAVE_UNISTD
|
||||
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include "rem2ps.h"
|
||||
#include "version.h"
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef __TURBOC__
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
#define ARGS(x) x
|
||||
#else
|
||||
#define ARGS(x) ()
|
||||
#endif
|
||||
#define NEW(type) ((type *) malloc(sizeof(type)))
|
||||
|
||||
#define SPECIAL_NORMAL 0
|
||||
#define SPECIAL_POSTSCRIPT 1
|
||||
#define SPECIAL_PSFILE 2
|
||||
#define SPECIAL_MOON 3
|
||||
#define SPECIAL_SHADE 4
|
||||
#define SPECIAL_COLOR 5
|
||||
|
||||
typedef struct calentry {
|
||||
struct calentry *next;
|
||||
int special;
|
||||
char *entry;
|
||||
} CalEntry;
|
||||
|
||||
@@ -49,7 +42,7 @@ typedef struct {
|
||||
int xsize, ysize;
|
||||
} PageType;
|
||||
|
||||
char Days[]=L_DAYINIT;
|
||||
char DayName[7][33];
|
||||
|
||||
char *SmallCalLoc[] = {
|
||||
"",
|
||||
@@ -77,7 +70,8 @@ PageType Pages[] =
|
||||
{"B5", 519, 729},
|
||||
{"Folio", 612, 936},
|
||||
{"Quarto", 612, 780},
|
||||
{"10x14", 720, 1008}
|
||||
{"10x14", 720, 1008},
|
||||
{"-custom-", 0, 0}
|
||||
};
|
||||
|
||||
PageType DefaultPage[1] =
|
||||
@@ -94,8 +88,6 @@ char PortraitMode;
|
||||
char NoSmallCal;
|
||||
char UseISO;
|
||||
|
||||
char LineBuffer[LINELEN];
|
||||
|
||||
char *HeadFont="Helvetica";
|
||||
char *TitleFont="Helvetica";
|
||||
char *DayFont="Helvetica-BoldOblique";
|
||||
@@ -123,31 +115,28 @@ int LeftMarg, RightMarg, TopMarg, BotMarg;
|
||||
int FillPage;
|
||||
int Verbose = 0;
|
||||
|
||||
void Init ARGS ((int argc, char *argv[]));
|
||||
void Usage ARGS ((char *s));
|
||||
void DoPsCal ARGS ((void));
|
||||
int DoQueuedPs ARGS ((void));
|
||||
void DoSmallCal ARGS((char *m, int days, int first, int col, int which));
|
||||
void WriteProlog ARGS ((void));
|
||||
void WriteCalEntry ARGS ((void));
|
||||
void WriteOneEntry ARGS ((char *s));
|
||||
void GetSmallLocations ARGS ((void));
|
||||
void Init (int argc, char *argv[]);
|
||||
void Usage (char *s);
|
||||
void DoPsCal (void);
|
||||
int DoQueuedPs (void);
|
||||
void DoSmallCal (char *m, int days, int first, int col, int which);
|
||||
void WriteProlog (void);
|
||||
void WriteCalEntry (void);
|
||||
void WriteOneEntry (CalEntry *c);
|
||||
void GetSmallLocations (void);
|
||||
char *EatToken(char *in, char *out, int maxlen);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* MAIN PROGRAM */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int main(int argc, char *argv[])
|
||||
#else
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char argv[];
|
||||
#endif
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
/* If stdin is a tty - probably wrong. */
|
||||
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
Init(argc, argv);
|
||||
|
||||
if (isatty(0)) {
|
||||
@@ -156,11 +145,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");
|
||||
}
|
||||
}
|
||||
@@ -184,11 +173,7 @@ char argv[];
|
||||
/* DoPsCal - emit PostScript for the calendar. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
void DoPsCal(void)
|
||||
#else
|
||||
void DoPsCal()
|
||||
#endif
|
||||
{
|
||||
char month[40], year[40];
|
||||
char prevm[40], nextm[40];
|
||||
@@ -197,25 +182,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 +221,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);
|
||||
|
||||
@@ -264,50 +259,95 @@ void DoPsCal()
|
||||
fprintf(stderr, "Input from REMIND is corrupt!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
gets(LineBuffer);
|
||||
if (!strcmp(LineBuffer, PSEND)) break;
|
||||
|
||||
/* Read the day number - a bit of a hack! */
|
||||
DayNum = (LineBuffer[8] - '0') * 10 + LineBuffer[9] - '0';
|
||||
DBufGets(&buf, stdin);
|
||||
if (!strcmp(DBufValue(&buf), PSEND)) {
|
||||
DBufFree(&buf);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Ignore lines beginning with '#' */
|
||||
if (DBufValue(&buf)[0] == '#') {
|
||||
continue;
|
||||
}
|
||||
/* Read the day number - a bit of a hack! */
|
||||
DayNum = (DBufValue(&buf)[8] - '0') * 10 + DBufValue(&buf)[9] - '0';
|
||||
if (DayNum != CurDay) {
|
||||
for(; CurDay<DayNum; CurDay++) {
|
||||
WriteCalEntry();
|
||||
WkDayNum = (WkDayNum + 1) % 7;
|
||||
}
|
||||
}
|
||||
/* Add the text */
|
||||
/* Add the text */
|
||||
c = NEW(CalEntry);
|
||||
if (!c) {
|
||||
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);
|
||||
c->special = SPECIAL_NORMAL;
|
||||
|
||||
/* 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);
|
||||
if (!c->entry) {
|
||||
fprintf(stderr, "malloc failed - aborting.\n");
|
||||
exit(1);
|
||||
}
|
||||
strcpy(c->entry+is_ps, LineBuffer+10);
|
||||
strcpy(c->entry, startOfBody);
|
||||
|
||||
if (is_ps) {
|
||||
/* Save the 'P' or 'F' flag */
|
||||
*(c->entry) = *LineBuffer;
|
||||
if (!PsEntries[DayNum]) PsEntries[DayNum] = c;
|
||||
else {
|
||||
/* Save the type of SPECIAL */
|
||||
if (!strcmp(passthru, "PostScript")) {
|
||||
c->special = SPECIAL_POSTSCRIPT;
|
||||
} else if (!strcmp(passthru, "SHADE")) {
|
||||
c->special = SPECIAL_SHADE;
|
||||
} else if (!strcmp(passthru, "MOON")) {
|
||||
c->special = SPECIAL_MOON;
|
||||
} else {
|
||||
c->special = SPECIAL_PSFILE;
|
||||
}
|
||||
|
||||
if (!PsEntries[DayNum]) {
|
||||
PsEntries[DayNum] = c;
|
||||
} else {
|
||||
d = PsEntries[DayNum];
|
||||
while(d->next) d = d->next;
|
||||
d->next = c;
|
||||
}
|
||||
} else {
|
||||
/* Put on linked list */
|
||||
if (!CurEntries) CurEntries = c;
|
||||
else {
|
||||
} else if (!strcmp(passthru, "*") ||
|
||||
!strcmp(passthru, "COLOR")) {
|
||||
/* Put on linked list */
|
||||
if (!CurEntries) {
|
||||
CurEntries = c;
|
||||
} else {
|
||||
d = CurEntries;
|
||||
while(d->next) d = d->next;
|
||||
d->next = c;
|
||||
}
|
||||
if (!strcmp(passthru, "COLOR")) {
|
||||
c->special = SPECIAL_COLOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(; CurDay<=days; CurDay++) {
|
||||
@@ -343,11 +383,7 @@ void DoPsCal()
|
||||
/* WriteProlog - write the PostScript prologue */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
void WriteProlog(void)
|
||||
#else
|
||||
void WriteProlog()
|
||||
#endif
|
||||
{
|
||||
int i;
|
||||
int x = CurPage->xsize;
|
||||
@@ -355,7 +391,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 +403,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 +424,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 +466,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);
|
||||
}
|
||||
@@ -448,11 +484,7 @@ void WriteProlog()
|
||||
/* WriteCalEntry - write all entries for one day */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
void WriteCalEntry(void)
|
||||
#else
|
||||
void WriteCalEntry()
|
||||
#endif
|
||||
{
|
||||
CalEntry *c = CurEntries;
|
||||
CalEntry *d;
|
||||
@@ -471,7 +503,7 @@ void WriteCalEntry()
|
||||
CurEntries = NULL;
|
||||
|
||||
while(c) {
|
||||
WriteOneEntry(c->entry);
|
||||
WriteOneEntry(c);
|
||||
free(c->entry);
|
||||
d = c->next;
|
||||
free(c);
|
||||
@@ -491,7 +523,7 @@ void WriteCalEntry()
|
||||
/* If WkDayNum is a Sunday or Monday, depending on MondayFirst,
|
||||
move to next row. Also handle the queued PS and PSFILE reminders */
|
||||
if ((!MondayFirst && WkDayNum == 6) ||
|
||||
(MondayFirst && WkDayNum == 0) || CurDay == MaxDay) {
|
||||
(MondayFirst && WkDayNum == 0) || CurDay == MaxDay) {
|
||||
HadQPS = 0;
|
||||
if (MondayFirst) begin = CurDay - (WkDayNum ? WkDayNum-1 : 6);
|
||||
else begin = CurDay - WkDayNum;
|
||||
@@ -539,35 +571,61 @@ void WriteCalEntry()
|
||||
/* WriteOneEntry - write an entry for one day */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
void WriteOneEntry(char *s)
|
||||
#else
|
||||
void WriteOneEntry(s)
|
||||
char *s;
|
||||
#endif
|
||||
void WriteOneEntry(CalEntry *c)
|
||||
{
|
||||
int c;
|
||||
int ch, i;
|
||||
char *s = c->entry;
|
||||
|
||||
printf(" [");
|
||||
|
||||
/* Chew up leading spaces */
|
||||
while(isspace(*s)) s++;
|
||||
/* Chew up leading spaces */
|
||||
while(isspace((unsigned char) *s)) s++;
|
||||
|
||||
/* Skip three decimal numbers for COLOR special */
|
||||
if (c->special == SPECIAL_COLOR) {
|
||||
for (i=0; i<3; i++) {
|
||||
while(*s && !isspace(*s)) s++;
|
||||
while(*s && isspace(*s)) s++;
|
||||
}
|
||||
}
|
||||
|
||||
PutChar('(');
|
||||
while(*s) {
|
||||
c = *s++;
|
||||
if (c == '\\' || c == '(' || c == ')') PutChar('\\');
|
||||
if (!isspace(c)) PutChar(c);
|
||||
/* Use the "unsigned char" cast to fix problem on Solaris 2.5 */
|
||||
/* which treated some latin1 characters as white space. */
|
||||
ch = (unsigned char) *s++;
|
||||
if (ch == '\\' || ch == '(' || ch == ')') PutChar('\\');
|
||||
if (!isspace(ch)) PutChar(ch);
|
||||
else {
|
||||
PutChar(')');
|
||||
while(isspace(*s)) s++;
|
||||
while(isspace((unsigned char)*s)) s++;
|
||||
if (!*s) {
|
||||
printf("]\n");
|
||||
return;
|
||||
goto finish;
|
||||
}
|
||||
PutChar('(');
|
||||
}
|
||||
}
|
||||
printf(")]\n");
|
||||
printf(")\n");
|
||||
finish:
|
||||
if (c->special == SPECIAL_COLOR) {
|
||||
int r, g, b;
|
||||
if (sscanf(c->entry, "%d %d %d", &r, &g, &b) == 3) {
|
||||
if (r < 0) r = 0;
|
||||
else if (r > 255) r = 255;
|
||||
if (g < 0) g = 0;
|
||||
else if (g > 255) g = 255;
|
||||
if (b < 0) b = 0;
|
||||
else if (b > 255) b = 255;
|
||||
printf("(gsave %f %f %f setrgbcolor)(grestore)",
|
||||
r / 255.0, g / 255.0, b / 255.0);
|
||||
} else {
|
||||
/* Punt... unrecognized color is black */
|
||||
printf("()()");
|
||||
}
|
||||
} else {
|
||||
printf("()()");
|
||||
}
|
||||
printf("]\n");
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -575,13 +633,7 @@ char *s;
|
||||
/* Init - set up parameters */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Init(int argc, char *argv[])
|
||||
#else
|
||||
void Init(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
#endif
|
||||
void Init(int argc, char *argv[])
|
||||
{
|
||||
char *s, *t;
|
||||
int i=1;
|
||||
@@ -625,9 +677,9 @@ char *argv[];
|
||||
case 'e': EntrySize = t; break;
|
||||
case 'd': DaySize = t; break;
|
||||
case 't': TitleSize = t; break;
|
||||
default: Usage("Size must specify h, t, e, or d");
|
||||
default: Usage("Size must specify h, t, e, or d");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
@@ -640,9 +692,9 @@ char *argv[];
|
||||
case 'd': DayFont = t; break;
|
||||
case 's': SmallFont = t; break;
|
||||
case 't': TitleFont = t; break;
|
||||
default: Usage("Font must specify s, h, t, e, or d");
|
||||
default: Usage("Font must specify s, h, t, e, or d");
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
@@ -653,20 +705,35 @@ char *argv[];
|
||||
if (i == argc) Usage("Media must be supplied");
|
||||
t = argv[i++];
|
||||
CurPage = NULL;
|
||||
for (j=0; j<NUMPAGES; j++)
|
||||
for (j=0; j<NUMPAGES-1; j++)
|
||||
if (!strcmp(t, Pages[j].name)) {
|
||||
CurPage = &Pages[j];
|
||||
CurPage = &Pages[j];
|
||||
break;
|
||||
}
|
||||
|
||||
if (!CurPage) {
|
||||
double w, h;
|
||||
if (sscanf(t, "%lfx%lfin", &w, &h) == 2) {
|
||||
CurPage = &Pages[NUMPAGES-1];
|
||||
CurPage->xsize = (int) (w * 72.0);
|
||||
CurPage->ysize = (int) (h * 72.0);
|
||||
} else if (sscanf(t, "%lfx%lfcm", &w, &h) == 2) {
|
||||
CurPage = &Pages[NUMPAGES-1];
|
||||
CurPage->xsize = (int) ((double) w * 28.346457);
|
||||
CurPage->ysize = (int) ((double) w * 28.346457);
|
||||
}
|
||||
}
|
||||
if (!CurPage) {
|
||||
fprintf(stderr, "\nUnknown media specified.\n");
|
||||
fprintf(stderr, "\nAvailable media types:\n");
|
||||
for (j=0; j<NUMPAGES; j++)
|
||||
for (j=0; j<NUMPAGES-1; j++) {
|
||||
fprintf(stderr, " %s\n", Pages[j].name);
|
||||
}
|
||||
fprintf(stderr, " WxHin Specify size in inches (W and H are decimal numbers)\n");
|
||||
fprintf(stderr, " WxHcm Specify size in centimetres (W and H are decimal numbers)\n");
|
||||
fprintf(stderr, "Default media type is %s\n", DefaultPage[0].name);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
@@ -724,12 +791,7 @@ char *argv[];
|
||||
/* Usage - print usage information */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(char *s)
|
||||
#else
|
||||
void Usage(s)
|
||||
char *s;
|
||||
#endif
|
||||
void Usage(char *s)
|
||||
{
|
||||
if (s) fprintf(stderr, "Rem2PS: %s\n\n", s);
|
||||
|
||||
@@ -740,7 +802,6 @@ char *s;
|
||||
fprintf(stderr, "-p file Include user-supplied PostScript code in prologue\n");
|
||||
fprintf(stderr, "-l Do calendar in landscape mode\n");
|
||||
fprintf(stderr, "-c[n] Control small calendars: 0=none; 1=bt; 2=tb; 3=sbt\n");
|
||||
fprintf(stderr, " and next month\n");
|
||||
fprintf(stderr, "-i Use ISO 8859-1 encoding in PostScript output\n");
|
||||
fprintf(stderr, "-m media Set page size (eg, Letter, Legal, A4.) Case sensitive!\n");
|
||||
fprintf(stderr, " (Default page size is %s)\n", DefaultPage[0].name);
|
||||
@@ -759,13 +820,7 @@ char *s;
|
||||
/* month. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
void DoSmallCal(char *m, int days, int first, int col, int which)
|
||||
#else
|
||||
void DoSmallCal(m, days, first, col, which)
|
||||
char *m;
|
||||
int days, first, col;
|
||||
#endif
|
||||
{
|
||||
/* Do the small calendar */
|
||||
int i, j;
|
||||
@@ -793,14 +848,14 @@ int days, first, col;
|
||||
/* Move origin to upper-left hand corner of appropriate box */
|
||||
printf("%d xincr mul MinX add ysmall%d translate\n", col, which);
|
||||
|
||||
/* Print the month */
|
||||
/* Print the month */
|
||||
printf("SmallWidth 7 mul (%s) stringwidth pop sub 2 div Border add Border neg SmallFontSize sub moveto (%s) show\n", m, m);
|
||||
|
||||
/* Print the days of the week */
|
||||
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 */
|
||||
@@ -819,11 +874,7 @@ int days, first, col;
|
||||
/* DoQueuedPs - do the queued PS and PSFILE reminders. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoQueuedPs(void)
|
||||
#else
|
||||
int DoQueuedPs()
|
||||
#endif
|
||||
int DoQueuedPs(void)
|
||||
{
|
||||
int i;
|
||||
int HadPS = 0;
|
||||
@@ -833,7 +884,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);
|
||||
@@ -857,23 +911,131 @@ int DoQueuedPs()
|
||||
|
||||
while (e) {
|
||||
|
||||
/* Now do the user's PostScript code */
|
||||
fnoff = 1;
|
||||
/* Now do the PostScript SPECIAL */
|
||||
fnoff = 0;
|
||||
while (isspace(*(e->entry+fnoff))) fnoff++;
|
||||
if (*(e->entry) == 'P') {
|
||||
switch(e->special) {
|
||||
case SPECIAL_POSTSCRIPT: /* Send PostScript through */
|
||||
printf("%s\n", e->entry+fnoff);
|
||||
} else {
|
||||
break;
|
||||
case SPECIAL_PSFILE: /* 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 SPECIAL_SHADE: /* 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 SPECIAL_MOON: /* 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 */
|
||||
@@ -895,11 +1057,7 @@ int DoQueuedPs()
|
||||
/* Set up the locations for the small calendars. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void GetSmallLocations(void)
|
||||
#else
|
||||
void GetSmallLocations()
|
||||
#endif
|
||||
void GetSmallLocations(void)
|
||||
{
|
||||
char c;
|
||||
char *s = SmallLocation;
|
||||
@@ -918,14 +1076,14 @@ void GetSmallLocations()
|
||||
switch(c) {
|
||||
case 'b':
|
||||
/* Adjust Feb. if we want it on the bottom */
|
||||
if (MaxDay == 28 && colfirst == 0) {
|
||||
if (MaxDay == 28 && colfirst == 0) {
|
||||
printf("/ysmallbot ymin def /ymin ysmallbot MinBoxSize sub def\n");
|
||||
printf("MinX ymin MaxX ymin L\n");
|
||||
printf("/ysmall1 ysmallbot def /ysmall2 ysmallbot def\n");
|
||||
SmallCol1 = 5;
|
||||
SmallCol2 = 6;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (collast <= 4) {
|
||||
printf("/ysmall1 ysmallbot def /ysmall2 ysmallbot def\n");
|
||||
SmallCol1 = 5;
|
||||
@@ -956,4 +1114,29 @@ void GetSmallLocations()
|
||||
NoSmallCal = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* EatToken */
|
||||
/* */
|
||||
/* Read a space-delimited token into an output buffer. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
char *EatToken(char *in, char *out, int maxlen)
|
||||
{
|
||||
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,16 @@
|
||||
/* 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 $ */
|
||||
|
||||
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",
|
||||
@@ -176,8 +176,22 @@ char *PSProlog2[] =
|
||||
" /width exch def",
|
||||
" /xleft exch def",
|
||||
" /curline () def",
|
||||
" % The last two strings in the word array are actually the PostScript",
|
||||
" % code to execute before and after the entry is printed.",
|
||||
" dup dup",
|
||||
" length 1 sub",
|
||||
" get",
|
||||
" exch",
|
||||
" dup dup",
|
||||
" length 2 sub",
|
||||
" get",
|
||||
" dup length 0 gt",
|
||||
" {cvx exec} {pop} ifelse",
|
||||
" dup length 2 sub 0 exch getinterval",
|
||||
" {EnterOneWord} forall",
|
||||
" FinishFormatting",
|
||||
" dup length 0 gt",
|
||||
" {cvx exec} {pop} ifelse",
|
||||
" y",
|
||||
"} bind def",
|
||||
"% Variables for calendar boxes:",
|
||||
@@ -5,24 +5,17 @@
|
||||
/* 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"
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
@@ -42,8 +35,8 @@ typedef struct sortrem {
|
||||
/* The sorted reminder queue */
|
||||
static Sortrem *SortedQueue = (Sortrem *) NULL;
|
||||
|
||||
PRIVATE Sortrem *MakeSortRem ARGS ((int jul, int tim, char *body, int typ, int prio));
|
||||
PRIVATE void IssueSortBanner ARGS ((int jul));
|
||||
static Sortrem *MakeSortRem (int jul, int tim, char *body, int typ, int prio);
|
||||
static void IssueSortBanner (int jul);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -52,14 +45,7 @@ PRIVATE void IssueSortBanner ARGS ((int jul));
|
||||
/* Create a new Sortrem entry - return NULL on failure. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE Sortrem *MakeSortRem(int jul, int tim, char *body, int typ, int prio)
|
||||
#else
|
||||
static Sortrem *MakeSortRem(jul, tim, body, typ, prio)
|
||||
int jul, tim;
|
||||
char *body;
|
||||
int typ, prio;
|
||||
#endif
|
||||
static Sortrem *MakeSortRem(int jul, int tim, char *body, int typ, int prio)
|
||||
{
|
||||
Sortrem *new = NEW(Sortrem);
|
||||
if (!new) return NULL;
|
||||
@@ -85,15 +71,7 @@ int typ, prio;
|
||||
/* Insert a reminder into the sort buffer */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int InsertIntoSortBuffer(int jul, int tim, char *body, int typ, int prio)
|
||||
#else
|
||||
int InsertIntoSortBuffer(jul, tim, body, typ, prio)
|
||||
int jul;
|
||||
int tim;
|
||||
char *body;
|
||||
int typ, prio;
|
||||
#endif
|
||||
int InsertIntoSortBuffer(int jul, int tim, char *body, int typ, int prio)
|
||||
{
|
||||
Sortrem *new = MakeSortRem(jul, tim, body, typ, prio);
|
||||
Sortrem *cur = SortedQueue, *prev = NULL;
|
||||
@@ -146,11 +124,7 @@ int typ, prio;
|
||||
/* Issue all of the sorted reminders and free memory. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void IssueSortedReminders(void)
|
||||
#else
|
||||
void IssueSortedReminders()
|
||||
#endif
|
||||
void IssueSortedReminders(void)
|
||||
{
|
||||
Sortrem *cur = SortedQueue;
|
||||
Sortrem *next;
|
||||
@@ -172,11 +146,7 @@ void IssueSortedReminders()
|
||||
break;
|
||||
|
||||
case MSF_TYPE:
|
||||
#ifdef OS2_POPUP
|
||||
FillParagraph(cur->text, 0);
|
||||
#else
|
||||
FillParagraph(cur->text);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case RUN_TYPE:
|
||||
@@ -198,17 +168,13 @@ void IssueSortedReminders()
|
||||
/* defined to take one argument. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void IssueSortBanner(int jul)
|
||||
#else
|
||||
static void IssueSortBanner(jul)
|
||||
int jul;
|
||||
#endif
|
||||
static void IssueSortBanner(int jul)
|
||||
{
|
||||
char BanExpr[25];
|
||||
char BanExpr[64];
|
||||
int y, m, d;
|
||||
Value v;
|
||||
char *s = BanExpr;
|
||||
DynamicBuffer buf;
|
||||
|
||||
if (UserFuncExists("sortbanner") != 1) return;
|
||||
|
||||
@@ -217,8 +183,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);
|
||||
}
|
||||
|
||||
@@ -232,14 +201,9 @@ int jul;
|
||||
/* sorting direction by date and time, resp. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int CompareRems(int dat1, int tim1, int prio1,
|
||||
int dat2, int tim2, int prio2,
|
||||
int bydate, int bytime, int byprio)
|
||||
#else
|
||||
int CompareRems(dat1, tim1, prio1, dat2, tim2, prio2, bydate, bytime, byprio)
|
||||
int dat1, tim1, prio1, dat2, tim2, prio2, bydate, bytime, byprio;
|
||||
#endif
|
||||
int CompareRems(int dat1, int tim1, int prio1,
|
||||
int dat2, int tim2, int prio2,
|
||||
int bydate, int bytime, int byprio)
|
||||
{
|
||||
int dafter, tafter, pafter;
|
||||
|
||||
@@ -6,22 +6,18 @@
|
||||
/* 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"
|
||||
|
||||
#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"
|
||||
@@ -38,67 +34,69 @@ while (isdigit(*(string))) { \
|
||||
string++; \
|
||||
}
|
||||
|
||||
#define UPPER(c) (islower(c) ? toupper(c) : c)
|
||||
|
||||
/* The big array holding all recognized (literal) tokens in reminder file.
|
||||
Keep this array sorted, or software will not work. */
|
||||
Token TokArray[] = {
|
||||
/* NAME MINLEN TYPE VALUE */
|
||||
|
||||
{ "after", 3, T_Skip, AFTER_SKIP },
|
||||
{ "after", 3, T_Skip, AFTER_SKIP },
|
||||
{ "april", 3, T_Month, 3 },
|
||||
{ "at", 2, T_At, 0 },
|
||||
{ "august", 3, T_Month, 7 },
|
||||
{ "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 },
|
||||
{ "else", 4, T_Else, 0 },
|
||||
{ "endif", 5, T_EndIf, 0 },
|
||||
{ "errmsg", 6, T_ErrMsg, 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 },
|
||||
{ "duration", 3, T_Duration, 0 },
|
||||
{ "else", 4, T_Else, 0 },
|
||||
{ "endif", 5, T_EndIf, 0 },
|
||||
{ "errmsg", 6, T_ErrMsg, 0 },
|
||||
{ "exit", 4, T_Exit, 0 },
|
||||
{ "february", 3, T_Month, 1 },
|
||||
{ "february", 3, T_Month, 1 },
|
||||
{ "flush", 5, T_Flush, 0 },
|
||||
{ "friday", 3, T_WkDay, 4 },
|
||||
{ "from", 4, T_Scanfrom, FROM_TYPE },
|
||||
{ "fset", 4, T_Fset, 0 },
|
||||
{ "if", 2, T_If, 0 },
|
||||
{ "iftrig", 6, T_IfTrig, 0 },
|
||||
{ "include", 3, T_Include, 0 },
|
||||
{ "january", 3, T_Month, 0 },
|
||||
{ "include", 3, T_Include, 0 },
|
||||
{ "january", 3, T_Month, 0 },
|
||||
{ "july", 3, T_Month, 6 },
|
||||
{ "june", 3, T_Month, 5 },
|
||||
{ "march", 3, T_Month, 2 },
|
||||
{ "may", 3, T_Month, 4 },
|
||||
{ "may", 3, T_Month, 4 },
|
||||
{ "monday", 3, T_WkDay, 0 },
|
||||
{ "msf", 3, T_RemType, MSF_TYPE },
|
||||
{ "msg", 3, T_RemType, MSG_TYPE },
|
||||
{ "november", 3, T_Month, 10 },
|
||||
{ "october", 3, T_Month, 9 },
|
||||
{ "msg", 3, T_RemType, MSG_TYPE },
|
||||
{ "november", 3, T_Month, 10 },
|
||||
{ "october", 3, T_Month, 9 },
|
||||
{ "omit", 3, T_Omit, 0 },
|
||||
{ "once", 3, T_Once, 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 },
|
||||
{ "push-omit-context", 4, T_Push, 0 },
|
||||
{ "ps", 2, T_RemType, PS_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 },
|
||||
{ "run", 3, T_RemType, RUN_TYPE },
|
||||
{ "satisfy", 7, T_RemType, SAT_TYPE },
|
||||
{ "saturday", 3, T_WkDay, 5 },
|
||||
{ "scanfrom", 4, T_Scanfrom, 0 },
|
||||
{ "scanfrom", 4, T_Scanfrom, SCANFROM_TYPE },
|
||||
{ "sched", 5, T_Sched, 0 },
|
||||
{ "september", 3, T_Month, 8 },
|
||||
{ "september", 3, T_Month, 8 },
|
||||
{ "set", 3, T_Set, 0 },
|
||||
{ "skip", 3, T_Skip, SKIP_SKIP },
|
||||
{ "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 },
|
||||
{ "unset", 5, T_UnSet, 0 },
|
||||
{ "until", 3, T_Until, 0 },
|
||||
{ "tuesday", 3, T_WkDay, 1 },
|
||||
{ "unset", 5, T_UnSet, 0 },
|
||||
{ "until", 3, T_Until, 0 },
|
||||
{ "warn", 4, T_Warn, 0 },
|
||||
{ "wednesday", 3, T_WkDay, 2 }
|
||||
};
|
||||
@@ -109,28 +107,28 @@ 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
|
||||
|
||||
PRIVATE int TokStrCmp ARGS((const Token *t, const char *s));
|
||||
static int TokStrCmp (const Token *t, const char *s);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -140,34 +138,25 @@ PRIVATE int TokStrCmp ARGS((const Token *t, const char *s));
|
||||
/* left square bracket, return a T_Illegal type. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *FindInitialToken(Token *tok, char *s)
|
||||
#else
|
||||
char *FindInitialToken(tok, s)
|
||||
Token *tok;
|
||||
char *s;
|
||||
#endif
|
||||
char *FindInitialToken(Token *tok, char *s)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -176,15 +165,9 @@ char *s;
|
||||
/* Given a string, which token is it? */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void FindToken(const char *s, Token *tok)
|
||||
#else
|
||||
void FindToken(s, tok)
|
||||
char *s;
|
||||
Token *tok;
|
||||
#endif
|
||||
void FindToken(const char *s, Token *tok)
|
||||
{
|
||||
register int top, bot, mid, r;
|
||||
int top, bot, mid, r, max;
|
||||
int l;
|
||||
|
||||
tok->type = T_Illegal;
|
||||
@@ -192,7 +175,7 @@ Token *tok;
|
||||
tok->type = T_Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (*s == '#' || *s == ';') {
|
||||
tok->type = T_Comment;
|
||||
return;
|
||||
@@ -205,8 +188,14 @@ Token *tok;
|
||||
}
|
||||
|
||||
l = strlen(s);
|
||||
|
||||
/* Ignore trailing commas */
|
||||
if (l > 0 && s[l-1] == ',') {
|
||||
l--;
|
||||
}
|
||||
bot = 0;
|
||||
top = sizeof(TokArray) / sizeof(TokArray[0]) - 1;
|
||||
max = sizeof(TokArray) / sizeof(TokArray[0]);
|
||||
|
||||
while(top >= bot) {
|
||||
mid = (top + bot) / 2;
|
||||
@@ -218,9 +207,13 @@ Token *tok;
|
||||
return;
|
||||
} else {
|
||||
while (mid && !TokStrCmp(&TokArray[mid-1],s)) mid--;
|
||||
while (!TokStrCmp(&TokArray[mid], s) && l < TokArray[mid].MinLen)
|
||||
while (mid < max &&
|
||||
!TokStrCmp(&TokArray[mid], s) &&
|
||||
l < TokArray[mid].MinLen) {
|
||||
mid++;
|
||||
if (!TokStrCmp(&TokArray[mid], s)) {
|
||||
}
|
||||
if (mid < max &&
|
||||
!TokStrCmp(&TokArray[mid], s)) {
|
||||
tok->type = TokArray[mid].type;
|
||||
tok->val = TokArray[mid].val;
|
||||
return;
|
||||
@@ -235,7 +228,7 @@ Token *tok;
|
||||
array. */
|
||||
#if LANG != ENGLISH
|
||||
for (r=0; r<(sizeof(NonEnglishToks) / sizeof(Token)); r++) {
|
||||
if (l >= NonEnglishToks[r].MinLen &&
|
||||
if (l >= NonEnglishToks[r].MinLen &&
|
||||
!TokStrCmp(&NonEnglishToks[r], s)) {
|
||||
tok->type = NonEnglishToks[r].type;
|
||||
tok->val = NonEnglishToks[r].val;
|
||||
@@ -243,7 +236,7 @@ Token *tok;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -259,13 +252,7 @@ Token *tok;
|
||||
/* Rep - *n */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void FindNumericToken(const char *s, Token *t)
|
||||
#else
|
||||
void FindNumericToken(s, t)
|
||||
char *s;
|
||||
Token *t;
|
||||
#endif
|
||||
void FindNumericToken(const char *s, Token *t)
|
||||
{
|
||||
int mult = 1, hour, min;
|
||||
|
||||
@@ -274,14 +261,32 @@ 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) {
|
||||
if (*s == ':' || *s == '.' || *s == TimeSep) {
|
||||
s++;
|
||||
hour = t->val;
|
||||
PARSENUM(min, s);
|
||||
if (*s || hour > 23 || min > 59) return; /* Illegal time */
|
||||
if (*s || min > 59) return; /* Illegal time */
|
||||
t->val = hour*60 + min; /* Convert to minutes past midnight */
|
||||
t->type = T_Time;
|
||||
if (hour <= 23) {
|
||||
t->type = T_Time;
|
||||
} else {
|
||||
t->type = T_LongTime;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -330,22 +335,18 @@ Token *t;
|
||||
/* Compare a token to a string. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int TokStrCmp(const Token *t, const char *s)
|
||||
#else
|
||||
static int TokStrCmp(t, s)
|
||||
Token *t;
|
||||
char *s;
|
||||
#endif
|
||||
static int TokStrCmp(const Token *t, const char *s)
|
||||
{
|
||||
register int r;
|
||||
char *tk = t->name;
|
||||
while(*tk && *s) {
|
||||
r = UPPER(*tk) - UPPER(*s);
|
||||
while(*tk && *s && !(*s == ',' && *(s+1) == 0)) {
|
||||
r = *tk - tolower(*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,15 @@
|
||||
/* 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"
|
||||
#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"
|
||||
@@ -30,10 +25,10 @@ static char const RCSID[] = "$Id: trigger.c,v 1.2 1996-05-25 19:10:13 dfs Exp $"
|
||||
#define GOT_YR 4
|
||||
#define GOT_WD 8
|
||||
|
||||
static int JYear ARGS((int jul));
|
||||
static int JMonth ARGS((int jul));
|
||||
static int NextSimpleTrig ARGS((int startdate, Trigger *trig, int *err));
|
||||
static int GetNextTriggerDate ARGS((Trigger *trig, int start, int *err, int *nextstart));
|
||||
static int JYear(int jul);
|
||||
static int JMonth(int jul);
|
||||
static int NextSimpleTrig(int startdate, Trigger *trig, int *err);
|
||||
static int GetNextTriggerDate(Trigger *trig, int start, int *err, int *nextstart);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -47,14 +42,7 @@ static int GetNextTriggerDate ARGS((Trigger *trig, int start, int *err, int *nex
|
||||
/* so that dates with a REP can be handled properly. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int NextSimpleTrig(int startdate, Trigger *trig, int *err)
|
||||
#else
|
||||
static int NextSimpleTrig(startdate, trig, err)
|
||||
int startdate;
|
||||
Trigger *trig;
|
||||
int *err;
|
||||
#endif
|
||||
static int NextSimpleTrig(int startdate, Trigger *trig, int *err)
|
||||
{
|
||||
int typ = 0;
|
||||
int d, m, y, j, d2, m2, y2;
|
||||
@@ -267,12 +255,7 @@ int *err;
|
||||
/* JMonth - Given a Julian date, what's the month? */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int JMonth(int jul)
|
||||
#else
|
||||
static int JMonth(jul)
|
||||
int jul;
|
||||
#endif
|
||||
static int JMonth(int jul)
|
||||
{
|
||||
int y, m, d;
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
@@ -284,12 +267,7 @@ int jul;
|
||||
/* JYear - Given a Julian date, what's the year? */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int JYear(int jul)
|
||||
#else
|
||||
static int JYear(jul)
|
||||
int jul;
|
||||
#endif
|
||||
static int JYear(int jul)
|
||||
{
|
||||
int y, m, d;
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
@@ -306,15 +284,7 @@ int jul;
|
||||
/* expired, -2 if can't compute trigger date. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int GetNextTriggerDate(Trigger *trig, int start, int *err, int *nextstart)
|
||||
#else
|
||||
static int GetNextTriggerDate(trig, start, err, nextstart)
|
||||
Trigger *trig;
|
||||
int start;
|
||||
int *err;
|
||||
int *nextstart;
|
||||
#endif
|
||||
static int GetNextTriggerDate(Trigger *trig, int start, int *err, int *nextstart)
|
||||
{
|
||||
int simple, mod;
|
||||
|
||||
@@ -376,14 +346,7 @@ int *nextstart;
|
||||
/* today's date. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ComputeTrigger(int today, Trigger *trig, int *err)
|
||||
#else
|
||||
int ComputeTrigger(today, trig, err)
|
||||
int today;
|
||||
Trigger *trig;
|
||||
int *err;
|
||||
#endif
|
||||
int ComputeTrigger(int today, Trigger *trig, int *err)
|
||||
{
|
||||
int nattempts = 0,
|
||||
start = today,
|
||||
@@ -392,6 +355,7 @@ int *err;
|
||||
result;
|
||||
|
||||
LastTrigValid = 0;
|
||||
|
||||
/* Assume everything works */
|
||||
*err = OK;
|
||||
|
||||
@@ -5,11 +5,13 @@
|
||||
/* 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 $ */
|
||||
#include <limits.h>
|
||||
#include "dynbuf.h"
|
||||
|
||||
/* Values */
|
||||
typedef struct {
|
||||
@@ -25,11 +27,7 @@ typedef struct {
|
||||
char *name;
|
||||
char prec;
|
||||
char type;
|
||||
#ifdef HAVE_PROTOS
|
||||
int (*func)(void);
|
||||
#else
|
||||
int (*func) ();
|
||||
#endif
|
||||
} Operator;
|
||||
|
||||
/* Define the structure of a variable */
|
||||
@@ -58,6 +56,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 +66,7 @@ typedef struct {
|
||||
int nexttime;
|
||||
int delta;
|
||||
int rep;
|
||||
int duration;
|
||||
} TimeTrig;
|
||||
|
||||
/* The parse pointer */
|
||||
@@ -76,6 +77,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 */
|
||||
@@ -97,7 +100,7 @@ typedef Parser *ParsePtr; /* Pointer to parser structure */
|
||||
#define BEFORE_SKIP 2
|
||||
#define AFTER_SKIP 3
|
||||
|
||||
#define NO_TIME 1500 /* >1440, ie > than the largest possible legal time */
|
||||
#define NO_TIME INT_MAX
|
||||
|
||||
#define NO_PRIORITY 5000 /* Default priority is midway between 0 and 9999 */
|
||||
|
||||
@@ -109,6 +112,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 +143,10 @@ enum TokTypes
|
||||
T_Flush,
|
||||
T_Priority,
|
||||
T_Sched,
|
||||
T_Warn
|
||||
T_Warn,
|
||||
T_Tag,
|
||||
T_Duration,
|
||||
T_LongTime
|
||||
};
|
||||
|
||||
/* The structure of a token */
|
||||
@@ -159,13 +167,16 @@ typedef struct {
|
||||
#define IF_ELSE_MASK 2
|
||||
|
||||
/* Flags for the DoSubst function */
|
||||
#define NORMAL_MODE 0
|
||||
#define CAL_MODE 1
|
||||
#define NORMAL_MODE 0
|
||||
#define CAL_MODE 1
|
||||
#define ADVANCE_MODE 2
|
||||
|
||||
#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. */
|
||||
@@ -176,3 +187,7 @@ typedef struct {
|
||||
#define SORT_NONE 0
|
||||
#define SORT_ASCEND 1
|
||||
#define SORT_DESCEND 2
|
||||
|
||||
/* Flags for FROM / SCANFROM */
|
||||
#define SCANFROM_TYPE 0
|
||||
#define FROM_TYPE 1
|
||||
@@ -6,21 +6,17 @@
|
||||
/* 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"
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
@@ -35,7 +31,6 @@ typedef struct udf_struct {
|
||||
char name[VAR_NAME_LEN+1];
|
||||
char *text;
|
||||
Var *locals;
|
||||
char IsCached;
|
||||
char IsActive;
|
||||
int nargs;
|
||||
} UserFunc;
|
||||
@@ -51,11 +46,11 @@ extern Operator Func[];
|
||||
extern Value ValStack[];
|
||||
extern int ValStackPtr;
|
||||
|
||||
PRIVATE void DestroyUserFunc ARGS ((UserFunc *f));
|
||||
PRIVATE void FUnset ARGS ((char *name));
|
||||
PRIVATE void FSet ARGS ((UserFunc *f));
|
||||
PRIVATE int SetUpLocalVars ARGS ((UserFunc *f));
|
||||
PRIVATE void DestroyLocalVals ARGS ((UserFunc *f));
|
||||
static void DestroyUserFunc (UserFunc *f);
|
||||
static void FUnset (char *name);
|
||||
static void FSet (UserFunc *f);
|
||||
static int SetUpLocalVars (UserFunc *f);
|
||||
static void DestroyLocalVals (UserFunc *f);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -64,39 +59,49 @@ PRIVATE void DestroyLocalVals ARGS ((UserFunc *f));
|
||||
/* Define a user-defined function - the FSET command. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoFset(ParsePtr p)
|
||||
#else
|
||||
int DoFset(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int DoFset(ParsePtr p)
|
||||
{
|
||||
int r;
|
||||
int c;
|
||||
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 +116,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 +149,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 */
|
||||
@@ -168,12 +170,7 @@ ParsePtr p;
|
||||
/* Free up all the resources used by a user-defined function. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void DestroyUserFunc(UserFunc *f)
|
||||
#else
|
||||
static void DestroyUserFunc(f)
|
||||
UserFunc *f;
|
||||
#endif
|
||||
static void DestroyUserFunc(UserFunc *f)
|
||||
{
|
||||
Var *v, *prev;
|
||||
|
||||
@@ -187,7 +184,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);
|
||||
@@ -201,12 +198,7 @@ UserFunc *f;
|
||||
/* it exists. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void FUnset(char *name)
|
||||
#else
|
||||
static void FUnset(name)
|
||||
char *name;
|
||||
#endif
|
||||
static void FUnset(char *name)
|
||||
{
|
||||
UserFunc *cur, *prev;
|
||||
int h;
|
||||
@@ -232,12 +224,7 @@ char *name;
|
||||
/* Insert a user-defined function into the hash table. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void FSet(UserFunc *f)
|
||||
#else
|
||||
static void FSet(f)
|
||||
UserFunc *f;
|
||||
#endif
|
||||
static void FSet(UserFunc *f)
|
||||
{
|
||||
int h = HashVal(f->name) % FUNC_HASH_SIZE;
|
||||
f->next = FuncHash[h];
|
||||
@@ -251,13 +238,7 @@ UserFunc *f;
|
||||
/* Call a user-defined function. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int CallUserFunc(char *name, int nargs)
|
||||
#else
|
||||
int CallUserFunc(name, nargs)
|
||||
char *name;
|
||||
int nargs;
|
||||
#endif
|
||||
int CallUserFunc(char *name, int nargs)
|
||||
{
|
||||
UserFunc *f;
|
||||
int h = HashVal(name) % FUNC_HASH_SIZE;
|
||||
@@ -336,12 +317,7 @@ int nargs;
|
||||
/* Set up the local variables from the stack frame. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int SetUpLocalVars(UserFunc *f)
|
||||
#else
|
||||
static int SetUpLocalVars(f)
|
||||
UserFunc *f;
|
||||
#endif
|
||||
static int SetUpLocalVars(UserFunc *f)
|
||||
{
|
||||
int i, r;
|
||||
Var *var;
|
||||
@@ -363,12 +339,7 @@ UserFunc *f;
|
||||
/* the function. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void DestroyLocalVals(UserFunc *f)
|
||||
#else
|
||||
static void DestroyLocalVals(f)
|
||||
UserFunc *f;
|
||||
#endif
|
||||
static void DestroyLocalVals(UserFunc *f)
|
||||
{
|
||||
Var *v = f->locals;
|
||||
|
||||
@@ -385,12 +356,7 @@ UserFunc *f;
|
||||
/* it is defined, or -1 if it is not defined. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int UserFuncExists(char *fn)
|
||||
#else
|
||||
int UserFuncExists(fn)
|
||||
char *fn;
|
||||
#endif
|
||||
int UserFuncExists(char *fn)
|
||||
{
|
||||
UserFunc *f;
|
||||
int h = HashVal(fn) % FUNC_HASH_SIZE;
|
||||
@@ -5,27 +5,23 @@
|
||||
/* 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"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
|
||||
#define UPPER(c) (islower(c) ? toupper(c) : c)
|
||||
#define UPPER(c) toupper(c)
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -34,13 +30,7 @@ static char const RCSID[] = "$Id: utils.c,v 1.2 1996-03-31 04:02:00 dfs Exp $";
|
||||
/* Just like strncpy EXCEPT we ALWAYS copy the trailing 0. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *StrnCpy(char *dest, const char *source, int n)
|
||||
#else
|
||||
char *StrnCpy(dest, source, n)
|
||||
char *dest, *source;
|
||||
int n;
|
||||
#endif
|
||||
char *StrnCpy(char *dest, const char *source, int n)
|
||||
{
|
||||
register char *odest = dest;
|
||||
|
||||
@@ -58,13 +48,7 @@ int n;
|
||||
/* of the first string, whichever is greater. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int StrMatch(const char *s1, const char *s2, int n)
|
||||
#else
|
||||
int StrMatch(s1, s2, n)
|
||||
char *s1, *s2;
|
||||
int n;
|
||||
#endif
|
||||
int StrMatch(const char *s1, const char *s2, int n)
|
||||
{
|
||||
int l;
|
||||
if ((l = strlen(s1)) < n) return 0;
|
||||
@@ -76,13 +60,7 @@ int n;
|
||||
/* StrinCmp - compare strings, case-insensitive */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int StrinCmp(const char *s1, const char *s2, int n)
|
||||
#else
|
||||
int StrinCmp(s1, s2, n)
|
||||
char *s1, *s2;
|
||||
int n;
|
||||
#endif
|
||||
int StrinCmp(const char *s1, const char *s2, int n)
|
||||
{
|
||||
register int r;
|
||||
while (n && *s1 && *s2) {
|
||||
@@ -102,12 +80,7 @@ int n;
|
||||
/* Like ANSI strdup */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *StrDup(const char *s)
|
||||
#else
|
||||
char *StrDup(s)
|
||||
char *s;
|
||||
#endif
|
||||
char *StrDup(const char *s)
|
||||
{
|
||||
char *ret = (char *) malloc(strlen(s)+1);
|
||||
if (!ret) return (char *) NULL;
|
||||
@@ -122,12 +95,7 @@ char *s;
|
||||
/* Compare strings, case insensitive. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int StrCmpi(const char *s1, const char *s2)
|
||||
#else
|
||||
int StrCmpi(s1, s2)
|
||||
char *s1, *s2;
|
||||
#endif
|
||||
int StrCmpi(const char *s1, const char *s2)
|
||||
{
|
||||
int r;
|
||||
while (*s1 && *s2) {
|
||||
@@ -139,26 +107,6 @@ char *s1, *s2;
|
||||
return UPPER(*s1) - UPPER(*s2);
|
||||
}
|
||||
|
||||
#ifdef NO_STRSTR
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *strstr(char *s1, char *s2)
|
||||
#else
|
||||
char *strstr(s1, s2)
|
||||
char *s1, *s2;
|
||||
#endif
|
||||
{
|
||||
char *s = s1;
|
||||
int len2 = strlen(s2);
|
||||
int len1 = strlen(s1);
|
||||
|
||||
while (s-s1 <= len1-len2) {
|
||||
if (!strncmp(s, s2, len2)) return s;
|
||||
s++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DateOK */
|
||||
@@ -166,12 +114,7 @@ char *s1, *s2;
|
||||
/* Return 1 if the date is OK, 0 otherwise. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DateOK(int y, int m, int d)
|
||||
#else
|
||||
int DateOK(y, m, d)
|
||||
int y, m, d;
|
||||
#endif
|
||||
int DateOK(int y, int m, int d)
|
||||
{
|
||||
if (d < 1 ||
|
||||
m < 0 ||
|
||||
@@ -181,31 +124,3 @@ int y, m, d;
|
||||
d > DaysInMonth(m, y) ) return 0;
|
||||
else return 1;
|
||||
}
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* Safe versions of putc and putchar */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int SafePutChar(int c)
|
||||
#else
|
||||
int SafePutChar(c)
|
||||
int c;
|
||||
#endif
|
||||
{
|
||||
return putchar(c);
|
||||
}
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int SafePutc(int c, FILE *fp)
|
||||
#else
|
||||
int SafePutc(c, fp)
|
||||
int c;
|
||||
FILE *fp;
|
||||
#endif
|
||||
{
|
||||
return putc(c, fp);
|
||||
}
|
||||
#endif
|
||||
@@ -6,22 +6,18 @@
|
||||
/* 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-2007 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"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "types.h"
|
||||
#include "expr.h"
|
||||
#include "globals.h"
|
||||
@@ -38,18 +34,53 @@ static char const RCSID[] = "$Id: var.c,v 1.3 1996-04-28 02:02:12 dfs Exp $";
|
||||
|
||||
static Var *VHashTbl[VAR_HASH_SIZE];
|
||||
|
||||
typedef int (*SysVarFunc)(int, Value *);
|
||||
|
||||
static int date_sep_func(int do_set, Value *val)
|
||||
{
|
||||
if (!do_set) {
|
||||
val->v.str = malloc(2);
|
||||
if (!val->v.str) return E_NO_MEM;
|
||||
val->v.str[0] = DateSep;
|
||||
val->v.str[1] = 0;
|
||||
val->type = STR_TYPE;
|
||||
return OK;
|
||||
}
|
||||
if (val->type != STR_TYPE) return E_BAD_TYPE;
|
||||
if (strcmp(val->v.str, "/") &&
|
||||
strcmp(val->v.str, "-")) {
|
||||
return E_BAD_TYPE;
|
||||
}
|
||||
DateSep = val->v.str[0];
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int time_sep_func(int do_set, Value *val)
|
||||
{
|
||||
if (!do_set) {
|
||||
val->v.str = malloc(2);
|
||||
if (!val->v.str) return E_NO_MEM;
|
||||
val->v.str[0] = TimeSep;
|
||||
val->v.str[1] = 0;
|
||||
val->type = STR_TYPE;
|
||||
return OK;
|
||||
}
|
||||
if (val->type != STR_TYPE) return E_BAD_TYPE;
|
||||
if (strcmp(val->v.str, ":") &&
|
||||
strcmp(val->v.str, ".")) {
|
||||
return E_BAD_TYPE;
|
||||
}
|
||||
TimeSep = val->v.str[0];
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* HashVal */
|
||||
/* Given a string, compute the hash value. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC unsigned int HashVal(const char *str)
|
||||
#else
|
||||
unsigned int HashVal(str)
|
||||
char *str;
|
||||
#endif
|
||||
unsigned int HashVal(const char *str)
|
||||
{
|
||||
register unsigned int i=0;
|
||||
register unsigned int j=1;
|
||||
@@ -71,13 +102,7 @@ char *str;
|
||||
/* string. If create is 1, create the variable. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC Var *FindVar(const char *str, int create)
|
||||
#else
|
||||
Var *FindVar(str, create)
|
||||
char *str;
|
||||
int create;
|
||||
#endif
|
||||
Var *FindVar(const char *str, int create)
|
||||
{
|
||||
register int h;
|
||||
register Var *v;
|
||||
@@ -114,12 +139,7 @@ int create;
|
||||
/* string and delete it. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DeleteVar(const char *str)
|
||||
#else
|
||||
int DeleteVar(str)
|
||||
char *str;
|
||||
#endif
|
||||
int DeleteVar(const char *str)
|
||||
{
|
||||
register int h;
|
||||
register Var *v;
|
||||
@@ -148,13 +168,7 @@ char *str;
|
||||
/* Set the indicate variable to the specified value. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int SetVar(const char *str, Value *val)
|
||||
#else
|
||||
int SetVar(str, val)
|
||||
char *str;
|
||||
Value *val;
|
||||
#endif
|
||||
int SetVar(const char *str, Value *val)
|
||||
{
|
||||
Var *v = FindVar(str, 1);
|
||||
|
||||
@@ -172,14 +186,7 @@ Value *val;
|
||||
/* Get a copy of the value of the variable. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int GetVarValue(const char *str, Value *val, Var *locals)
|
||||
#else
|
||||
int GetVarValue(str, val, locals)
|
||||
char *str;
|
||||
Value *val;
|
||||
Var *locals;
|
||||
#endif
|
||||
int GetVarValue(const char *str, Value *val, Var *locals)
|
||||
{
|
||||
Var *v;
|
||||
|
||||
@@ -205,24 +212,27 @@ Var *locals;
|
||||
/* DoSet - set a variable. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoSet (Parser *p)
|
||||
#else
|
||||
int DoSet (p)
|
||||
Parser *p;
|
||||
#endif
|
||||
int DoSet (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;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -230,27 +240,31 @@ Parser *p;
|
||||
/* DoUnset - delete a bunch of variables. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoUnset (Parser *p)
|
||||
#else
|
||||
int DoUnset (p)
|
||||
Parser *p;
|
||||
#endif
|
||||
int DoUnset (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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -261,39 +275,45 @@ Parser *p;
|
||||
/* Command file command to dump variable table. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoDump(ParsePtr p)
|
||||
#else
|
||||
int DoDump(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int DoDump(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,11 +324,7 @@ ParsePtr p;
|
||||
/* Dump the variable table to stderr. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void DumpVarTable(void)
|
||||
#else
|
||||
void DumpVarTable()
|
||||
#endif
|
||||
void DumpVarTable(void)
|
||||
{
|
||||
register Var *v;
|
||||
register int i;
|
||||
@@ -334,12 +350,7 @@ void DumpVarTable()
|
||||
/* preserved variables unless ALL is non-zero. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void DestroyVars(int all)
|
||||
#else
|
||||
void DestroyVars(all)
|
||||
int all;
|
||||
#endif
|
||||
void DestroyVars(int all)
|
||||
{
|
||||
int i;
|
||||
Var *v, *next, *prev;
|
||||
@@ -372,12 +383,7 @@ int all;
|
||||
/* Given the name of a variable, "preserve" it. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int PreserveVar(char *name)
|
||||
#else
|
||||
int PreserveVar(name)
|
||||
char *name;
|
||||
#endif
|
||||
int PreserveVar(char *name)
|
||||
{
|
||||
Var *v;
|
||||
|
||||
@@ -392,28 +398,34 @@ char *name;
|
||||
/* DoPreserve - preserve a bunch of variables. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoPreserve (Parser *p)
|
||||
#else
|
||||
int DoPreserve (p)
|
||||
Parser *p;
|
||||
#endif
|
||||
int DoPreserve (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;
|
||||
}
|
||||
}
|
||||
@@ -441,13 +453,15 @@ typedef struct {
|
||||
#define been_malloced min
|
||||
|
||||
/* Flag for no min/max constraint */
|
||||
#define ANY 4532
|
||||
#define ANY -31415926
|
||||
|
||||
/* All of the system variables sorted alphabetically */
|
||||
static SysVar SysVarArr[] = {
|
||||
/* name mod type value min/mal max */
|
||||
{ "CalcUTC", 1, INT_TYPE, &CalculateUTC, 0, 1 },
|
||||
{ "CalMode", 0, INT_TYPE, &DoCalendar, 0, 0 },
|
||||
{ "Daemon", 0, INT_TYPE, &Daemon, 0, 0 },
|
||||
{ "DateSep", 1, SPECIAL_TYPE, date_sep_func, 0, 0 },
|
||||
{ "DefaultPrio", 1, INT_TYPE, &DefaultPrio, 0, 9999 },
|
||||
{ "DontFork", 0, INT_TYPE, &DontFork, 0, 0 },
|
||||
{ "DontQueue", 0, INT_TYPE, &DontQueue, 0, 0 },
|
||||
@@ -472,18 +486,20 @@ static SysVar SysVarArr[] = {
|
||||
{ "NextMode", 0, INT_TYPE, &NextMode, 0, 0 },
|
||||
{ "NumQueued", 0, INT_TYPE, &NumQueued, 0, 0 },
|
||||
{ "NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
|
||||
{ "PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
|
||||
{ "PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo,0, 0 },
|
||||
{ "PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
|
||||
{ "RunOff", 0, INT_TYPE, &RunDisabled, 0, 0 },
|
||||
{ "SimpleCal", 0, INT_TYPE, &DoSimpleCalendar, 0, 0 },
|
||||
{ "SortByDate", 0, INT_TYPE, &SortByDate, 0, 0},
|
||||
{ "SortByPrio", 0, INT_TYPE, &SortByPrio, 0, 0},
|
||||
{ "SortByTime", 0, INT_TYPE, &SortByTime, 0, 0},
|
||||
{ "SubsIndent", 1, INT_TYPE, &SubsIndent, 0, 132}
|
||||
{ "SubsIndent", 1, INT_TYPE, &SubsIndent, 0, 132},
|
||||
{ "TimeSep", 1, SPECIAL_TYPE, time_sep_func, 0, 0 }
|
||||
};
|
||||
|
||||
#define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
|
||||
PRIVATE SysVar *FindSysVar ARGS((const char *name));
|
||||
PRIVATE void DumpSysVar ARGS((const char *name, const SysVar *v));
|
||||
static SysVar *FindSysVar (const char *name);
|
||||
static void DumpSysVar (const char *name, const SysVar *v);
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* SetSysVar */
|
||||
@@ -491,24 +507,22 @@ PRIVATE void DumpSysVar ARGS((const char *name, const SysVar *v));
|
||||
/* Set a system variable to the indicated value. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int SetSysVar(const char *name, Value *value)
|
||||
#else
|
||||
int SetSysVar(name, value)
|
||||
char *name;
|
||||
Value *value;
|
||||
#endif
|
||||
int SetSysVar(const char *name, Value *value)
|
||||
{
|
||||
SysVar *v = FindSysVar(name);
|
||||
if (!v) return E_NOSUCH_VAR;
|
||||
if (v->type != value->type) return E_BAD_TYPE;
|
||||
if (v->type != SPECIAL_TYPE &&
|
||||
v->type != value->type) return E_BAD_TYPE;
|
||||
if (!v->modifiable) {
|
||||
Eprint("%s: `$%s'", ErrMsg[E_CANT_MODIFY], name);
|
||||
return E_CANT_MODIFY;
|
||||
}
|
||||
|
||||
/* If it's a string variable, special measures must be taken */
|
||||
if (v->type == STR_TYPE) {
|
||||
if (v->type == SPECIAL_TYPE) {
|
||||
SysVarFunc f = (SysVarFunc) v->value;
|
||||
return f(1, value);
|
||||
} else if (v->type == STR_TYPE) {
|
||||
/* If it's a string variable, special measures must be taken */
|
||||
if (v->been_malloced) free(*((char **)(v->value)));
|
||||
v->been_malloced = 1;
|
||||
*((char **) v->value) = value->v.str;
|
||||
@@ -528,25 +542,31 @@ Value *value;
|
||||
/* Get the value of a system variable */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int GetSysVar(const char *name, Value *val)
|
||||
#else
|
||||
int GetSysVar(name, val)
|
||||
char *name;
|
||||
Value *val;
|
||||
#endif
|
||||
int GetSysVar(const char *name, Value *val)
|
||||
{
|
||||
SysVar *v = FindSysVar(name);
|
||||
|
||||
val->type = ERR_TYPE;
|
||||
if (!v) return E_NOSUCH_VAR;
|
||||
if (v->type == STR_TYPE) {
|
||||
if (v->type == SPECIAL_TYPE) {
|
||||
SysVarFunc f = (SysVarFunc) v->value;
|
||||
return f(0, val);
|
||||
} else if (v->type == STR_TYPE) {
|
||||
val->v.str = StrDup(*((char **) v->value));
|
||||
if (!val->v.str) return E_NO_MEM;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -557,12 +577,7 @@ Value *val;
|
||||
/* Find a system var with specified name. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE SysVar *FindSysVar(const char *name)
|
||||
#else
|
||||
static SysVar *FindSysVar(name)
|
||||
char *name;
|
||||
#endif
|
||||
static SysVar *FindSysVar(const char *name)
|
||||
{
|
||||
int top=NUMSYSVARS-1, bottom=0;
|
||||
int mid=(top + bottom) / 2;
|
||||
@@ -577,7 +592,7 @@ char *name;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DumpSysVarByName */
|
||||
@@ -586,12 +601,7 @@ char *name;
|
||||
/* If name is "", dump all system variables. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void DumpSysVarByName(const char *name)
|
||||
#else
|
||||
void DumpSysVarByName(name)
|
||||
char *name;
|
||||
#endif
|
||||
void DumpSysVarByName(const char *name)
|
||||
{
|
||||
int i;
|
||||
SysVar *v;
|
||||
@@ -600,7 +610,7 @@ char *name;
|
||||
for (i=0; i<NUMSYSVARS; i++) DumpSysVar(name, SysVarArr + i);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
v = FindSysVar(name);
|
||||
DumpSysVar(name, v);
|
||||
return;
|
||||
@@ -613,28 +623,37 @@ char *name;
|
||||
/* Dump the system variable. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void DumpSysVar(const char *name, const SysVar *v)
|
||||
#else
|
||||
static void DumpSysVar(name, v)
|
||||
char *name;
|
||||
SysVar *v;
|
||||
#endif
|
||||
static void DumpSysVar(const char *name, const SysVar *v)
|
||||
{
|
||||
char buffer[VAR_NAME_LEN+10];
|
||||
|
||||
if (name && !*name) name=NULL;
|
||||
if (!v && !name) return; /* Shouldn't happen... */
|
||||
|
||||
|
||||
buffer[0]='$'; buffer[1] = 0;
|
||||
if (name) strcat(buffer, name); else strcat(buffer, v->name);
|
||||
fprintf(ErrFp, "%*s ", VAR_NAME_LEN, buffer);
|
||||
fprintf(ErrFp, "%*s ", VAR_NAME_LEN+1, buffer);
|
||||
if (v) {
|
||||
if (v->type == STR_TYPE) {
|
||||
if (v->type == SPECIAL_TYPE) {
|
||||
Value val;
|
||||
SysVarFunc f = (SysVarFunc) v->value;
|
||||
f(0, &val);
|
||||
if (DoCoerce(STR_TYPE, &val) == OK) {
|
||||
fprintf(ErrFp, "\"%s\"\n", val.v.str);
|
||||
}
|
||||
DestroyValue(val);
|
||||
} else if (v->type == STR_TYPE) {
|
||||
char *s = *((char **)v->value);
|
||||
int y;
|
||||
Putc('"', ErrFp);
|
||||
for (y=0; y<MAX_PRT_LEN && *s; y++) Putc(*s++, ErrFp);
|
||||
for (y=0; y<MAX_PRT_LEN && *s; y++) {
|
||||
if (*s == '"') {
|
||||
fprintf(ErrFp, "\" + char(34) + \"");
|
||||
s++;
|
||||
} else {
|
||||
Putc(*s++, ErrFp);
|
||||
}
|
||||
}
|
||||
Putc('"', ErrFp);
|
||||
if (*s) fprintf(ErrFp, "...");
|
||||
Putc('\n', ErrFp);
|
||||
@@ -652,4 +671,3 @@ SysVar *v;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
/* What version of remind do we have? */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1996 by David F. Skoll */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999-2007 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: version.h,v 1.2 1996-03-31 04:08:14 dfs Exp $ */
|
||||
#define VERSION "03.00.14"
|
||||
#define VERSION "03.01.01"
|
||||
830
test-rem.ami
830
test-rem.ami
@@ -1,830 +0,0 @@
|
||||
# Test file for REMIND
|
||||
#
|
||||
# Use this file to test the date calculation routines
|
||||
# of the REMIND program by typing:
|
||||
#
|
||||
# ./test-rem # From WITHIN Remind source directory!
|
||||
|
||||
REM MSG Today is [hebday(today())] [hebmon(today())] [hebyear(today())]
|
||||
test.rem(8): Trig = Saturday, 16 February, 1991
|
||||
Reminders for Saturday, 16th February, 1991:
|
||||
|
||||
today() => 1991/02/16
|
||||
hebday(1991/02/16) => 2
|
||||
today() => 1991/02/16
|
||||
hebmon(1991/02/16) => "Adar"
|
||||
today() => 1991/02/16
|
||||
hebyear(1991/02/16) => 5751
|
||||
Today is 2 Adar 5751
|
||||
|
||||
fset _h(x, y) trigger(hebdate(x,y))
|
||||
|
||||
[_h(1, "Tishrey")] MSG Rosh Hashana 1
|
||||
Entering UserFN _h(1, "Tishrey")
|
||||
x => 1
|
||||
y => "Tishrey"
|
||||
hebdate(1, "Tishrey") => 1991/09/09
|
||||
trigger(1991/09/09) => "9 September 1991"
|
||||
Leaving UserFN _h() => "9 September 1991"
|
||||
test.rem(11): Trig = Monday, 9 September, 1991
|
||||
[_h(2, "Tishrey")] MSG Rosh Hashana 2
|
||||
Entering UserFN _h(2, "Tishrey")
|
||||
x => 2
|
||||
y => "Tishrey"
|
||||
hebdate(2, "Tishrey") => 1991/09/10
|
||||
trigger(1991/09/10) => "10 September 1991"
|
||||
Leaving UserFN _h() => "10 September 1991"
|
||||
test.rem(12): Trig = Tuesday, 10 September, 1991
|
||||
[_h(3, "Tishrey")] MSG Tzom Gedalia
|
||||
Entering UserFN _h(3, "Tishrey")
|
||||
x => 3
|
||||
y => "Tishrey"
|
||||
hebdate(3, "Tishrey") => 1991/09/11
|
||||
trigger(1991/09/11) => "11 September 1991"
|
||||
Leaving UserFN _h() => "11 September 1991"
|
||||
test.rem(13): Trig = Wednesday, 11 September, 1991
|
||||
[_h(10, "Tishrey")] MSG Yom Kippur
|
||||
Entering UserFN _h(10, "Tishrey")
|
||||
x => 10
|
||||
y => "Tishrey"
|
||||
hebdate(10, "Tishrey") => 1991/09/18
|
||||
trigger(1991/09/18) => "18 September 1991"
|
||||
Leaving UserFN _h() => "18 September 1991"
|
||||
test.rem(14): Trig = Wednesday, 18 September, 1991
|
||||
[_h(15, "Tishrey")] MSG Sukkot 1
|
||||
Entering UserFN _h(15, "Tishrey")
|
||||
x => 15
|
||||
y => "Tishrey"
|
||||
hebdate(15, "Tishrey") => 1991/09/23
|
||||
trigger(1991/09/23) => "23 September 1991"
|
||||
Leaving UserFN _h() => "23 September 1991"
|
||||
test.rem(15): Trig = Monday, 23 September, 1991
|
||||
[_h(25, "Kislev")] MSG Channuka
|
||||
Entering UserFN _h(25, "Kislev")
|
||||
x => 25
|
||||
y => "Kislev"
|
||||
hebdate(25, "Kislev") => 1991/12/02
|
||||
trigger(1991/12/02) => "2 December 1991"
|
||||
Leaving UserFN _h() => "2 December 1991"
|
||||
test.rem(16): Trig = Monday, 2 December, 1991
|
||||
[_h(10, "Tevet")] MSG Asara B'Tevet
|
||||
Entering UserFN _h(10, "Tevet")
|
||||
x => 10
|
||||
y => "Tevet"
|
||||
hebdate(10, "Tevet") => 1991/12/17
|
||||
trigger(1991/12/17) => "17 December 1991"
|
||||
Leaving UserFN _h() => "17 December 1991"
|
||||
test.rem(17): Trig = Tuesday, 17 December, 1991
|
||||
[_h(15, "Shvat")] MSG Tu B'Shvat
|
||||
Entering UserFN _h(15, "Shvat")
|
||||
x => 15
|
||||
y => "Shvat"
|
||||
hebdate(15, "Shvat") => 1992/01/20
|
||||
trigger(1992/01/20) => "20 January 1992"
|
||||
Leaving UserFN _h() => "20 January 1992"
|
||||
test.rem(18): Trig = Monday, 20 January, 1992
|
||||
[_h(15, "Adar A")] MSG Purim Katan
|
||||
Entering UserFN _h(15, "Adar A")
|
||||
x => 15
|
||||
y => "Adar A"
|
||||
hebdate(15, "Adar A") => 1992/02/19
|
||||
trigger(1992/02/19) => "19 February 1992"
|
||||
Leaving UserFN _h() => "19 February 1992"
|
||||
test.rem(19): Trig = Wednesday, 19 February, 1992
|
||||
[_h(14, "Adar")] MSG Purim
|
||||
Entering UserFN _h(14, "Adar")
|
||||
x => 14
|
||||
y => "Adar"
|
||||
hebdate(14, "Adar") => 1991/02/28
|
||||
trigger(1991/02/28) => "28 February 1991"
|
||||
Leaving UserFN _h() => "28 February 1991"
|
||||
test.rem(20): Trig = Thursday, 28 February, 1991
|
||||
[_h(15, "Nisan")] MSG Pesach
|
||||
Entering UserFN _h(15, "Nisan")
|
||||
x => 15
|
||||
y => "Nisan"
|
||||
hebdate(15, "Nisan") => 1991/03/30
|
||||
trigger(1991/03/30) => "30 March 1991"
|
||||
Leaving UserFN _h() => "30 March 1991"
|
||||
test.rem(21): Trig = Saturday, 30 March, 1991
|
||||
[_h(27, "Nisan")] MSG Yom HaShoah
|
||||
Entering UserFN _h(27, "Nisan")
|
||||
x => 27
|
||||
y => "Nisan"
|
||||
hebdate(27, "Nisan") => 1991/04/11
|
||||
trigger(1991/04/11) => "11 April 1991"
|
||||
Leaving UserFN _h() => "11 April 1991"
|
||||
test.rem(22): Trig = Thursday, 11 April, 1991
|
||||
[_h(4, "Iyar")] MSG Yom HaZikaron
|
||||
Entering UserFN _h(4, "Iyar")
|
||||
x => 4
|
||||
y => "Iyar"
|
||||
hebdate(4, "Iyar") => 1991/04/18
|
||||
trigger(1991/04/18) => "18 April 1991"
|
||||
Leaving UserFN _h() => "18 April 1991"
|
||||
test.rem(23): Trig = Thursday, 18 April, 1991
|
||||
[_h(5, "Iyar")] MSG Yom Ha'atzmaut
|
||||
Entering UserFN _h(5, "Iyar")
|
||||
x => 5
|
||||
y => "Iyar"
|
||||
hebdate(5, "Iyar") => 1991/04/19
|
||||
trigger(1991/04/19) => "19 April 1991"
|
||||
Leaving UserFN _h() => "19 April 1991"
|
||||
test.rem(24): Trig = Friday, 19 April, 1991
|
||||
[_h(28, "Iyar")] MSG Yom Yerushalayim
|
||||
Entering UserFN _h(28, "Iyar")
|
||||
x => 28
|
||||
y => "Iyar"
|
||||
hebdate(28, "Iyar") => 1991/05/12
|
||||
trigger(1991/05/12) => "12 May 1991"
|
||||
Leaving UserFN _h() => "12 May 1991"
|
||||
test.rem(25): Trig = Sunday, 12 May, 1991
|
||||
[_h(6, "Sivan")] MSG Shavuot
|
||||
Entering UserFN _h(6, "Sivan")
|
||||
x => 6
|
||||
y => "Sivan"
|
||||
hebdate(6, "Sivan") => 1991/05/19
|
||||
trigger(1991/05/19) => "19 May 1991"
|
||||
Leaving UserFN _h() => "19 May 1991"
|
||||
test.rem(26): Trig = Sunday, 19 May, 1991
|
||||
[_h(9, "Av")] MSG Tish'a B'Av
|
||||
Entering UserFN _h(9, "Av")
|
||||
x => 9
|
||||
y => "Av"
|
||||
hebdate(9, "Av") => 1991/07/20
|
||||
trigger(1991/07/20) => "20 July 1991"
|
||||
Leaving UserFN _h() => "20 July 1991"
|
||||
test.rem(27): Trig = Saturday, 20 July, 1991
|
||||
|
||||
# Test some jahrzeit cases
|
||||
fset _i(x,y,z,a) trigger(hebdate(x,y,z,a))
|
||||
[_i(30, "Heshvan", today(), 5759)] MSG Complete-Complete
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Heshvan", 1991/02/16, 5759)
|
||||
x => 30
|
||||
y => "Heshvan"
|
||||
z => 1991/02/16
|
||||
a => 5759
|
||||
hebdate(30, "Heshvan", 1991/02/16, 5759) => 1991/11/07
|
||||
trigger(1991/11/07) => "7 November 1991"
|
||||
Leaving UserFN _i() => "7 November 1991"
|
||||
test.rem(31): Trig = Thursday, 7 November, 1991
|
||||
[_i(30, "Heshvan", today(), 5760)] MSG Complete-Defective
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Heshvan", 1991/02/16, 5760)
|
||||
x => 30
|
||||
y => "Heshvan"
|
||||
z => 1991/02/16
|
||||
a => 5760
|
||||
hebdate(30, "Heshvan", 1991/02/16, 5760) => 1991/11/07
|
||||
trigger(1991/11/07) => "7 November 1991"
|
||||
Leaving UserFN _i() => "7 November 1991"
|
||||
test.rem(32): Trig = Thursday, 7 November, 1991
|
||||
[_i(30, "Heshvan", today(), 5761)] MSG Illegal
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Heshvan", 1991/02/16, 5761)
|
||||
x => 30
|
||||
y => "Heshvan"
|
||||
z => 1991/02/16
|
||||
a => 5761
|
||||
hebdate(30, "Heshvan", 1991/02/16, 5761) => test.rem(33): 30 Heshvan 5761: Invalid Hebrew date
|
||||
Invalid Hebrew date
|
||||
Leaving UserFN _i() => Invalid Hebrew date
|
||||
|
||||
[_i(30, "Kislev", today(), 5759)] MSG Complete-Complete
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Kislev", 1991/02/16, 5759)
|
||||
x => 30
|
||||
y => "Kislev"
|
||||
z => 1991/02/16
|
||||
a => 5759
|
||||
hebdate(30, "Kislev", 1991/02/16, 5759) => 1991/12/07
|
||||
trigger(1991/12/07) => "7 December 1991"
|
||||
Leaving UserFN _i() => "7 December 1991"
|
||||
test.rem(35): Trig = Saturday, 7 December, 1991
|
||||
[_i(30, "Kislev", today(), 5760)] MSG Complete-Defective
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Kislev", 1991/02/16, 5760)
|
||||
x => 30
|
||||
y => "Kislev"
|
||||
z => 1991/02/16
|
||||
a => 5760
|
||||
hebdate(30, "Kislev", 1991/02/16, 5760) => 1991/12/07
|
||||
trigger(1991/12/07) => "7 December 1991"
|
||||
Leaving UserFN _i() => "7 December 1991"
|
||||
test.rem(36): Trig = Saturday, 7 December, 1991
|
||||
[_i(30, "Kislev", today(), 5761)] MSG Illegal
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Kislev", 1991/02/16, 5761)
|
||||
x => 30
|
||||
y => "Kislev"
|
||||
z => 1991/02/16
|
||||
a => 5761
|
||||
hebdate(30, "Kislev", 1991/02/16, 5761) => test.rem(37): 30 Kislev 5761: Invalid Hebrew date
|
||||
Invalid Hebrew date
|
||||
Leaving UserFN _i() => Invalid Hebrew date
|
||||
|
||||
[_i(30, "Adar A", today(), 5755)] MSG Leap
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Adar A", 1991/02/16, 5755)
|
||||
x => 30
|
||||
y => "Adar A"
|
||||
z => 1991/02/16
|
||||
a => 5755
|
||||
hebdate(30, "Adar A", 1991/02/16, 5755) => 1992/03/05
|
||||
trigger(1992/03/05) => "5 March 1992"
|
||||
Leaving UserFN _i() => "5 March 1992"
|
||||
test.rem(39): Trig = Thursday, 5 March, 1992
|
||||
[_i(30, "Adar A", today(), 5756)] MSG Illegal
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Adar A", 1991/02/16, 5756)
|
||||
x => 30
|
||||
y => "Adar A"
|
||||
z => 1991/02/16
|
||||
a => 5756
|
||||
hebdate(30, "Adar A", 1991/02/16, 5756) => test.rem(40): No Adar A in 5756
|
||||
Invalid Hebrew date
|
||||
Leaving UserFN _i() => Invalid Hebrew date
|
||||
[_i(29, "Adar A", today(), 5755)] MSG Leap
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(29, "Adar A", 1991/02/16, 5755)
|
||||
x => 29
|
||||
y => "Adar A"
|
||||
z => 1991/02/16
|
||||
a => 5755
|
||||
hebdate(29, "Adar A", 1991/02/16, 5755) => 1991/03/15
|
||||
trigger(1991/03/15) => "15 March 1991"
|
||||
Leaving UserFN _i() => "15 March 1991"
|
||||
test.rem(41): Trig = Friday, 15 March, 1991
|
||||
[_i(29, "Adar A", today(), 5756)] MSG Illegal
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(29, "Adar A", 1991/02/16, 5756)
|
||||
x => 29
|
||||
y => "Adar A"
|
||||
z => 1991/02/16
|
||||
a => 5756
|
||||
hebdate(29, "Adar A", 1991/02/16, 5756) => test.rem(42): No Adar A in 5756
|
||||
Invalid Hebrew date
|
||||
Leaving UserFN _i() => Invalid Hebrew date
|
||||
|
||||
# Test each possible case of the basic reminders.
|
||||
|
||||
REM MSG Every Day
|
||||
test.rem(46): Trig = Saturday, 16 February, 1991
|
||||
Every Day
|
||||
|
||||
|
||||
REM 18 MSG Every 18th
|
||||
test.rem(48): Trig = Monday, 18 February, 1991
|
||||
REM 15 MSG Every 15th
|
||||
test.rem(49): Trig = Friday, 15 March, 1991
|
||||
|
||||
REM Feb MSG February
|
||||
test.rem(51): Trig = Saturday, 16 February, 1991
|
||||
February
|
||||
|
||||
REM Jan MSG January
|
||||
test.rem(52): Trig = Wednesday, 1 January, 1992
|
||||
REM March MSG March
|
||||
test.rem(53): Trig = Friday, 1 March, 1991
|
||||
|
||||
REM 13 Jan MSG 13 Jan
|
||||
test.rem(55): Trig = Monday, 13 January, 1992
|
||||
REM 15 Feb MSG 15 Feb
|
||||
test.rem(56): Trig = Saturday, 15 February, 1992
|
||||
REM 28 Feb MSG 28 Feb
|
||||
test.rem(57): Trig = Thursday, 28 February, 1991
|
||||
REM 29 Feb MSG 29 Feb
|
||||
test.rem(58): Trig = Saturday, 29 February, 1992
|
||||
REM 5 Mar MSG 5 Mar
|
||||
test.rem(59): Trig = Tuesday, 5 March, 1991
|
||||
|
||||
REM 1990 MSG 1990
|
||||
test.rem(61): Expired
|
||||
REM 1991 MSG 1991
|
||||
test.rem(62): Trig = Saturday, 16 February, 1991
|
||||
1991
|
||||
|
||||
REM 1992 MSG 1991
|
||||
test.rem(63): Trig = Wednesday, 1 January, 1992
|
||||
|
||||
REM 1 1990 MSG 1 1990
|
||||
test.rem(65): Expired
|
||||
REM 29 1991 MSG 29 1991
|
||||
test.rem(66): Trig = Friday, 29 March, 1991
|
||||
REM 29 1992 MSG 29 1992
|
||||
test.rem(67): Trig = Wednesday, 29 January, 1992
|
||||
REM 16 1991 MSG 16 1991
|
||||
test.rem(68): Trig = Saturday, 16 February, 1991
|
||||
16 1991
|
||||
|
||||
|
||||
REM Jan 1990 MSG Jan 1990
|
||||
test.rem(70): Expired
|
||||
REM Feb 1991 MSG Feb 1991
|
||||
test.rem(71): Trig = Saturday, 16 February, 1991
|
||||
Feb 1991
|
||||
|
||||
REM Dec 1991 MSG Dec 1991
|
||||
test.rem(72): Trig = Sunday, 1 December, 1991
|
||||
REM May 1992 MSG May 1992
|
||||
test.rem(73): Trig = Friday, 1 May, 1992
|
||||
|
||||
REM 1 Jan 1991 MSG 1 Jan 1991
|
||||
test.rem(75): Expired
|
||||
REM 16 Feb 1991 MSG 16 Feb 1991
|
||||
test.rem(76): Trig = Saturday, 16 February, 1991
|
||||
16 Feb 1991
|
||||
|
||||
REM 29 Dec 1992 MSG 29 Dec 1992
|
||||
test.rem(77): Trig = Tuesday, 29 December, 1992
|
||||
|
||||
REM Sun MSG Sun
|
||||
test.rem(79): Trig = Sunday, 17 February, 1991
|
||||
REM Fri Sat Tue MSG Fri Sat Tue
|
||||
test.rem(80): Trig = Saturday, 16 February, 1991
|
||||
Fri Sat Tue
|
||||
|
||||
|
||||
REM Sun 16 MSG Sun 16
|
||||
test.rem(82): Trig = Sunday, 17 February, 1991
|
||||
REM Mon Tue Wed Thu Fri 1 MSG Mon Tue Wed Thu Fri 1
|
||||
test.rem(83): Trig = Friday, 1 March, 1991
|
||||
|
||||
REM Sun Feb MSG Sun Feb
|
||||
test.rem(85): Trig = Sunday, 17 February, 1991
|
||||
REM Mon Tue March MSG Mon Tue March
|
||||
test.rem(86): Trig = Monday, 4 March, 1991
|
||||
|
||||
REM Sun 16 Feb MSG Sun 16 Feb
|
||||
test.rem(88): Trig = Sunday, 17 February, 1991
|
||||
REM Mon Tue 10 March MSG Mon Tue 10 March
|
||||
test.rem(89): Trig = Monday, 11 March, 1991
|
||||
|
||||
REM Sat Sun 1991 MSG Sat Sun 1991
|
||||
test.rem(91): Trig = Saturday, 16 February, 1991
|
||||
Sat Sun 1991
|
||||
|
||||
REM Mon Tue 1992 MSG Mon Tue 1992
|
||||
test.rem(92): Trig = Monday, 6 January, 1992
|
||||
|
||||
REM Sun 16 1991 MSG Sun 16 1991
|
||||
test.rem(94): Trig = Sunday, 17 February, 1991
|
||||
REM Mon Tue Wed Thu Fri 1 1992 MSG Mon Tue Wed Thu Fri 1 1992
|
||||
test.rem(95): Trig = Wednesday, 1 January, 1992
|
||||
|
||||
REM Mon Feb 1991 MSG Mon Feb 1991
|
||||
test.rem(97): Trig = Monday, 18 February, 1991
|
||||
REM Tue Jan 1992 MSG Tue Jan 1992
|
||||
test.rem(98): Trig = Tuesday, 7 January, 1992
|
||||
|
||||
REM Sun Mon 16 Feb 1991 MSG Sun Mon 16 Feb 1991
|
||||
test.rem(100): Trig = Sunday, 17 February, 1991
|
||||
REM Tue 28 Jan 1992 MSG Tue 28 Jan 1992
|
||||
test.rem(101): Trig = Tuesday, 28 January, 1992
|
||||
|
||||
# Try some Backs
|
||||
CLEAR-OMIT-CONTEXT
|
||||
REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun
|
||||
test.rem(105): Trig = Thursday, 28 February, 1991
|
||||
REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun
|
||||
test.rem(106): Trig = Thursday, 28 February, 1991
|
||||
|
||||
OMIT 28 Feb
|
||||
REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun (28 Feb omitted)
|
||||
test.rem(109): Trig = Wednesday, 27 February, 1991
|
||||
REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun (28 Feb omitted)
|
||||
test.rem(110): Trig = Thursday, 28 February, 1991
|
||||
|
||||
CLEAR-OMIT-CONTEXT
|
||||
|
||||
# Try out UNTIL
|
||||
REM Wed UNTIL 21 Feb 1991 MSG Wed UNTIL 21 Feb 1991
|
||||
test.rem(115): Trig = Wednesday, 20 February, 1991
|
||||
|
||||
# Try playing with the OMIT context
|
||||
|
||||
OMIT 28 Feb 1991
|
||||
REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
|
||||
test.rem(120): Trig = Wednesday, 27 February, 1991
|
||||
REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
|
||||
test.rem(121): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
|
||||
test.rem(122): Trig = Wednesday, 27 February, 1991
|
||||
REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
|
||||
test.rem(123): Trig = Friday, 28 February, 1992
|
||||
REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
|
||||
test.rem(124): Trig = Friday, 1 March, 1991
|
||||
|
||||
PUSH-OMIT-CONTEXT
|
||||
CLEAR-OMIT-CONTEXT
|
||||
REM 1 Mar -1 MSG 1 mar -1
|
||||
test.rem(128): Trig = Thursday, 28 February, 1991
|
||||
REM 1 Mar --1 MSG 1 mar --1
|
||||
test.rem(129): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb BEFORE MSG 28 Feb BEFORE
|
||||
test.rem(130): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb SKIP MSG 28 Feb SKIP
|
||||
test.rem(131): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb AFTER MSG 28 Feb AFTER
|
||||
test.rem(132): Trig = Thursday, 28 February, 1991
|
||||
|
||||
POP-OMIT-CONTEXT
|
||||
REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
|
||||
test.rem(135): Trig = Wednesday, 27 February, 1991
|
||||
REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
|
||||
test.rem(136): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
|
||||
test.rem(137): Trig = Wednesday, 27 February, 1991
|
||||
REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
|
||||
test.rem(138): Trig = Friday, 28 February, 1992
|
||||
REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
|
||||
test.rem(139): Trig = Friday, 1 March, 1991
|
||||
|
||||
|
||||
REM 13 March 1991 *1 UNTIL 19 March 1991 MSG 13-19 Mar 91
|
||||
test.rem(142): Trig = Wednesday, 13 March, 1991
|
||||
|
||||
# Test BACK
|
||||
CLEAR-OMIT-CONTEXT
|
||||
REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1
|
||||
test.rem(146): Trig = Monday, 18 February, 1991
|
||||
|
||||
OMIT 17 Feb 1991
|
||||
REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1 (17Feb91 omitted)
|
||||
test.rem(149): Trig = Monday, 18 February, 1991
|
||||
18 Feb 1991 +1 (17Feb91 omitted)
|
||||
|
||||
REM 18 Feb 1991 ++1 MSG 18 Feb 1991 ++1 (17Feb91 omitted)
|
||||
test.rem(150): Trig = Monday, 18 February, 1991
|
||||
|
||||
CLEAR-OMIT-CONTEXT
|
||||
# Test the scanfrom clause
|
||||
REM Fri SATISFY 1
|
||||
test.rem(154): Trig = Friday, 22 February, 1991
|
||||
OMIT [trigger(trigdate())]
|
||||
trigdate() => 1991/02/22
|
||||
trigger(1991/02/22) => "22 February 1991"
|
||||
REM Fri after MSG 23 Feb 1991
|
||||
test.rem(156): Trig = Saturday, 23 February, 1991
|
||||
CLEAR-OMIT-CONTEXT
|
||||
REM Fri SCANFROM [trigger(today()-7)] SATISFY 1
|
||||
today() => 1991/02/16
|
||||
1991/02/16 - 7 => 1991/02/09
|
||||
trigger(1991/02/09) => "9 February 1991"
|
||||
test.rem(158): Trig = Friday, 15 February, 1991
|
||||
OMIT [trigger(trigdate())]
|
||||
trigdate() => 1991/02/15
|
||||
trigger(1991/02/15) => "15 February 1991"
|
||||
REM Fri after MSG 16 Feb 1991
|
||||
test.rem(160): Trig = Saturday, 16 February, 1991
|
||||
16 Feb 1991
|
||||
|
||||
CLEAR-OMIT-CONTEXT
|
||||
set a000 abs(1)
|
||||
abs(1) => 1
|
||||
set a001 abs(-1)
|
||||
- 1 => -1
|
||||
abs(-1) => 1
|
||||
set a002 asc("foo")
|
||||
asc("foo") => 102
|
||||
set a003 baseyr()
|
||||
baseyr() => 1990
|
||||
set a004 char(66,55,66,77,66)
|
||||
char(66, 55, 66, 77, 66) => "B7BMB"
|
||||
set a005 choose(3, "foo", "bar", "baz", "blech")
|
||||
choose(3, "foo", "bar", "baz", "blech") => "baz"
|
||||
set a006 coerce("string", 1)
|
||||
coerce("string", 1) => "1"
|
||||
set a007 coerce("string", today())
|
||||
today() => 1991/02/16
|
||||
coerce("string", 1991/02/16) => "1991/02/16"
|
||||
set a008 coerce("string", 11:44)
|
||||
coerce("string", 11:44) => "11:44"
|
||||
set a009 coerce("int", "badnews")
|
||||
coerce("int", "badnews") => Can't coerce
|
||||
test.rem(171): Can't coerce
|
||||
set a010 coerce("int", "12")
|
||||
coerce("int", "12") => 12
|
||||
set a011 coerce("int", 11:44)
|
||||
coerce("int", 11:44) => 704
|
||||
set a012 coerce("int", today())
|
||||
today() => 1991/02/16
|
||||
coerce("int", 1991/02/16) => 411
|
||||
set a013 date(1992, 2, 2)
|
||||
date(1992, 2, 2) => 1992/02/02
|
||||
set a014 date(1993, 2, 29)
|
||||
date(1993, 2, 29) => Bad date specification
|
||||
test.rem(176): Bad date specification
|
||||
set a015 day(today())
|
||||
today() => 1991/02/16
|
||||
day(1991/02/16) => 16
|
||||
set a016 daysinmon(2, 1991)
|
||||
daysinmon(2, 1991) => 28
|
||||
set a017 daysinmon(2, 1992)
|
||||
daysinmon(2, 1992) => 29
|
||||
set a018 defined("a017")
|
||||
defined("a017") => 1
|
||||
set a019 defined("a019")
|
||||
defined("a019") => 0
|
||||
set a020 filename()
|
||||
filename() => "test.rem"
|
||||
set a021 getenv("TEST_GETENV")
|
||||
getenv("TEST_GETENV") => "foo bar baz"
|
||||
set a022 hour(11:22)
|
||||
hour(11:22) => 11
|
||||
set a023 iif(1, 1, 0)
|
||||
iif(1, 1, 0) => 1
|
||||
set a024 iif(0, 1, 0)
|
||||
iif(0, 1, 0) => 0
|
||||
set a025 index("barfoobar", "foo")
|
||||
index("barfoobar", "foo") => 4
|
||||
set a026 index("barfoobar", "bar", 2)
|
||||
index("barfoobar", "bar", 2) => 7
|
||||
set a027 isleap(today())
|
||||
today() => 1991/02/16
|
||||
isleap(1991/02/16) => 0
|
||||
set a028 isleap(1992)
|
||||
isleap(1992) => 1
|
||||
omit [trigger(today())]
|
||||
today() => 1991/02/16
|
||||
trigger(1991/02/16) => "16 February 1991"
|
||||
set a030 isomitted(today())
|
||||
today() => 1991/02/16
|
||||
isomitted(1991/02/16) => 1
|
||||
clear
|
||||
set a029 isomitted(today())
|
||||
today() => 1991/02/16
|
||||
isomitted(1991/02/16) => 0
|
||||
set a031 lower("FOOBARBAZ")
|
||||
lower("FOOBARBAZ") => "foobarbaz"
|
||||
set a032 max(1, 2, 34, 1, 3)
|
||||
max(1, 2, 34, 1, 3) => 34
|
||||
set a033 max("foo", "bar", "baz")
|
||||
max("foo", "bar", "baz") => "foo"
|
||||
set a034 max(today(), today()+1, today()-1)
|
||||
today() => 1991/02/16
|
||||
today() => 1991/02/16
|
||||
1991/02/16 + 1 => 1991/02/17
|
||||
today() => 1991/02/16
|
||||
1991/02/16 - 1 => 1991/02/15
|
||||
max(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/17
|
||||
set a035 min(1, 2, 34, 1, 3)
|
||||
min(1, 2, 34, 1, 3) => 1
|
||||
set a036 min("foo", "bar", "baz")
|
||||
min("foo", "bar", "baz") => "bar"
|
||||
set a037 min(today(), today()+1, today()-1)
|
||||
today() => 1991/02/16
|
||||
today() => 1991/02/16
|
||||
1991/02/16 + 1 => 1991/02/17
|
||||
today() => 1991/02/16
|
||||
1991/02/16 - 1 => 1991/02/15
|
||||
min(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/15
|
||||
set a038 minute(11:33)
|
||||
minute(11:33) => 33
|
||||
set a039 mon(today())
|
||||
today() => 1991/02/16
|
||||
mon(1991/02/16) => "February"
|
||||
set a040 monnum(today())
|
||||
today() => 1991/02/16
|
||||
monnum(1991/02/16) => 2
|
||||
set a041 ord(3)
|
||||
ord(3) => "3rd"
|
||||
set a042 ord(4)
|
||||
ord(4) => "4th"
|
||||
set a043 ostype()
|
||||
ostype() => "AmigaDOS"
|
||||
set a044 plural(2)
|
||||
plural(2) => "s"
|
||||
set a045 plural(2, "ies")
|
||||
plural(2, "ies") => "iess"
|
||||
set a046 plural(2, "y", "ies")
|
||||
plural(2, "y", "ies") => "ies"
|
||||
set a047 sgn(-2)
|
||||
- 2 => -2
|
||||
sgn(-2) => -1
|
||||
set a048 shell("echo foo")
|
||||
shell("echo foo") => "foo"
|
||||
set a049 strlen("sadjflkhsldkfhsdlfjhk")
|
||||
strlen("sadjflkhsldkfhsdlfjhk") => 21
|
||||
set a050 substr(a049, 2)
|
||||
a049 => 21
|
||||
substr(21, 2) => Type mismatch
|
||||
test.rem(214): Type mismatch
|
||||
set a051 substr(a050, 2, 6)
|
||||
a050 => test.rem(215): Undefined variable: a050
|
||||
set a052 time(1+2, 3+4)
|
||||
1 + 2 => 3
|
||||
3 + 4 => 7
|
||||
time(3, 7) => 03:07
|
||||
rem 10 jan 1992 AT 11:22 CAL
|
||||
test.rem(217): Trig = Friday, 10 January, 1992
|
||||
set a053 trigdate()
|
||||
trigdate() => 1992/01/10
|
||||
set a054 trigtime()
|
||||
trigtime() => 11:22
|
||||
set a055 trigvalid()
|
||||
trigvalid() => 1
|
||||
set a056 upper("sdfjhsdf ksjdfh kjsdfh ksjdfh")
|
||||
upper("sdfjhsdf ksjdfh kjsdfh ksjdfh") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
set a057 value("a05"+"6")
|
||||
"a05" + "6" => "a056"
|
||||
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
set a058 version()
|
||||
version() => "03.00.14"
|
||||
set a059 wkday(today())
|
||||
today() => 1991/02/16
|
||||
wkday(1991/02/16) => "Saturday"
|
||||
set a060 wkdaynum(today())
|
||||
today() => 1991/02/16
|
||||
wkdaynum(1991/02/16) => 6
|
||||
set a061 year(today())
|
||||
today() => 1991/02/16
|
||||
year(1991/02/16) => 1991
|
||||
set a062 1+2*(3+4-(5*7/2))
|
||||
3 + 4 => 7
|
||||
5 * 7 => 35
|
||||
35 / 2 => 17
|
||||
7 - 17 => -10
|
||||
2 * -10 => -20
|
||||
1 + -20 => -19
|
||||
set a063 1>=2
|
||||
1 >= 2 => 0
|
||||
set a064 1<2 || 3 > 4
|
||||
1 < 2 => 1
|
||||
3 > 4 => 0
|
||||
1 || 0 => 1
|
||||
set a065 1 && 1
|
||||
1 && 1 => 1
|
||||
set a066 !a065
|
||||
a065 => 1
|
||||
! 1 => 0
|
||||
set a067 typeof(2)
|
||||
typeof(2) => "INT"
|
||||
set a068 typeof("foo")
|
||||
typeof("foo") => "STRING"
|
||||
set a069 typeof(11:33)
|
||||
typeof(11:33) => "TIME"
|
||||
set a070 typeof(today())
|
||||
today() => 1991/02/16
|
||||
typeof(1991/02/16) => "DATE"
|
||||
fset g(x,y) max(x,y)
|
||||
fset h(x,y) min(g(x+y, x*y), g(x-y, x/y))
|
||||
set a071 g(1, 2)
|
||||
Entering UserFN g(1, 2)
|
||||
x => 1
|
||||
y => 2
|
||||
max(1, 2) => 2
|
||||
Leaving UserFN g() => 2
|
||||
set a072 h(2, 3)
|
||||
Entering UserFN h(2, 3)
|
||||
x => 2
|
||||
y => 3
|
||||
2 + 3 => 5
|
||||
x => 2
|
||||
y => 3
|
||||
2 * 3 => 6
|
||||
Entering UserFN g(5, 6)
|
||||
x => 5
|
||||
y => 6
|
||||
max(5, 6) => 6
|
||||
Leaving UserFN g() => 6
|
||||
x => 2
|
||||
y => 3
|
||||
2 - 3 => -1
|
||||
x => 2
|
||||
y => 3
|
||||
2 / 3 => 0
|
||||
Entering UserFN g(-1, 0)
|
||||
x => -1
|
||||
y => 0
|
||||
max(-1, 0) => 0
|
||||
Leaving UserFN g() => 0
|
||||
min(6, 0) => 0
|
||||
Leaving UserFN h() => 0
|
||||
set a073 h("foo", 11:33)
|
||||
Entering UserFN h("foo", 11:33)
|
||||
x => "foo"
|
||||
y => 11:33
|
||||
"foo" + 11:33 => "foo11:33"
|
||||
x => "foo"
|
||||
y => 11:33
|
||||
"foo" * 11:33 => Type mismatch
|
||||
test.rem(240): '*': Type mismatch
|
||||
Leaving UserFN h() => Type mismatch
|
||||
set a074 dosubst("%a %b %c %d %e %f %g %h", '1992/5/5')
|
||||
dosubst("%a %b %c %d %e %f %g %h", 1992/05/05) => "on Tuesday, 5 May, 1992 in 444 days' tim"...
|
||||
msg [a074]%
|
||||
test.rem(242): Trig = Saturday, 16 February, 1991
|
||||
a074 => "on Tuesday, 5 May, 1992 in 444 days' tim"...
|
||||
on Tuesday, 5 May, 1992 in 444 days' time on Tuesday 5 on 05/05/1992 on 05/05/1992 on Tuesday, 5 May on 05/05
|
||||
set a075 dosubst("%i %j %k %l %m %n %o %p", '1992/5/5')
|
||||
dosubst("%i %j %k %l %m %n %o %p", 1992/05/05) => "on 05/05 on Tuesday, May 5th, 1992 on Tu"...
|
||||
msg [a075]%
|
||||
test.rem(244): Trig = Saturday, 16 February, 1991
|
||||
a075 => "on 05/05 on Tuesday, May 5th, 1992 on Tu"...
|
||||
on 05/05 on Tuesday, May 5th, 1992 on Tuesday, May 5th on 1992/05/05 May 5 s
|
||||
set a076 dosubst("%q %r %s %t %u %v %w %x", '1992/5/5')
|
||||
dosubst("%q %r %s %t %u %v %w %x", 1992/05/05) => "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
|
||||
msg [a076]%
|
||||
test.rem(246): Trig = Saturday, 16 February, 1991
|
||||
a076 => "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
|
||||
s' 05 th 05 on Tuesday, 5th May, 1992 on Tuesday, 5th May Tuesday 444
|
||||
set a077 dosubst("%y %z", '1992/5/5')
|
||||
dosubst("%y %z", 1992/05/05) => "1992 92
|
||||
"
|
||||
msg [a077]%
|
||||
test.rem(248): Trig = Saturday, 16 February, 1991
|
||||
a077 => "1992 92
|
||||
"
|
||||
1992 92
|
||||
set a078 easterdate(today())
|
||||
today() => 1991/02/16
|
||||
easterdate(1991/02/16) => 1991/03/31
|
||||
set a079 easterdate(1992)
|
||||
easterdate(1992) => 1992/04/19
|
||||
set a080 easterdate(1995)
|
||||
easterdate(1995) => 1995/04/16
|
||||
set a081 ""
|
||||
dump
|
||||
Variable Value
|
||||
|
||||
a017 29
|
||||
a036 "bar"
|
||||
a055 1
|
||||
a074 "on Tuesday, 5 May, 1992 in 444 days' tim"...
|
||||
a008 "11:44"
|
||||
a027 0
|
||||
a046 "ies"
|
||||
a065 1
|
||||
a018 1
|
||||
a037 1991/02/15
|
||||
a056 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
a075 "on 05/05 on Tuesday, May 5th, 1992 on Tu"...
|
||||
a028 1
|
||||
a047 -1
|
||||
a066 0
|
||||
a019 0
|
||||
a038 33
|
||||
a057 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
a076 "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
|
||||
a029 0
|
||||
a048 "foo"
|
||||
a067 "INT"
|
||||
a039 "February"
|
||||
a058 "03.00.14"
|
||||
a077 "1992 92
|
||||
"
|
||||
a049 21
|
||||
a068 "STRING"
|
||||
a059 "Saturday"
|
||||
a078 1991/03/31
|
||||
a069 "TIME"
|
||||
a079 1992/04/19
|
||||
a000 1
|
||||
a010 12
|
||||
a001 1
|
||||
a020 "test.rem"
|
||||
a011 704
|
||||
a030 1
|
||||
a002 102
|
||||
a021 "foo bar baz"
|
||||
a040 2
|
||||
a012 411
|
||||
a031 "foobarbaz"
|
||||
a003 1990
|
||||
a022 11
|
||||
a041 "3rd"
|
||||
a060 6
|
||||
a013 1992/02/02
|
||||
a032 34
|
||||
a070 "DATE"
|
||||
a004 "B7BMB"
|
||||
a023 1
|
||||
a042 "4th"
|
||||
a061 1991
|
||||
a080 1995/04/16
|
||||
a033 "foo"
|
||||
a052 03:07
|
||||
a071 2
|
||||
a005 "baz"
|
||||
a024 0
|
||||
a043 "AmigaDOS"
|
||||
a062 -19
|
||||
a081 ""
|
||||
a015 16
|
||||
a034 1991/02/17
|
||||
a053 1992/01/10
|
||||
a072 0
|
||||
a006 "1"
|
||||
a025 4
|
||||
a044 "s"
|
||||
a063 0
|
||||
a016 28
|
||||
a035 1
|
||||
a054 11:22
|
||||
a007 "1991/02/16"
|
||||
a026 7
|
||||
a045 "iess"
|
||||
a064 1
|
||||
|
||||
32
test-rem.bat
32
test-rem.bat
@@ -1,32 +0,0 @@
|
||||
@echo off
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem TEST-REM
|
||||
rem
|
||||
rem $Id: test-rem.bat,v 1.1 1996-03-27 03:26:10 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 ---------------------------------------------------------------------------
|
||||
|
||||
del test.out > nul
|
||||
set TEST_GETENV=foo bar baz
|
||||
if exist ..\msdos-ex\remind.exe goto bcc
|
||||
remind -e -dxte ./test.rem 16 feb 1991 > test.out
|
||||
goto cmp
|
||||
:bcc
|
||||
..\msdos-ex\remind -e -dxte .\test.rem 16 feb 1991 > test.out
|
||||
:cmp
|
||||
echo n | comp test.out test1.cmp
|
||||
if errorlevel 1 goto oops
|
||||
echo "Remind: Acceptance test PASSED"
|
||||
goto quit
|
||||
:oops
|
||||
echo "Remind: Acceptance test FAILED"
|
||||
echo ""
|
||||
echo "Examine the file test.out to see where it differs from the"
|
||||
echo "reference file test1.cmp."
|
||||
:quit
|
||||
34
test-rem.cmd
34
test-rem.cmd
@@ -1,34 +0,0 @@
|
||||
@echo off
|
||||
rem ---------------------------------------------------------------------------
|
||||
rem TEST-REM
|
||||
rem
|
||||
rem $Id: test-rem.cmd,v 1.1 1996-03-27 03:26:11 dfs Exp $
|
||||
rem
|
||||
rem This file runs an OS/2 acceptance test for Remind. To use it, type:
|
||||
rem test-rem
|
||||
rem in the build directory.
|
||||
rem
|
||||
rem This file is part of REMIND.
|
||||
rem Copyright (C) 1992-1996 by David F. Skoll
|
||||
rem ---------------------------------------------------------------------------
|
||||
|
||||
del /f test.out > nul
|
||||
setlocal
|
||||
set TEST_GETENV=foo bar baz
|
||||
if exist ..\os2-ex\remind.exe goto bcc
|
||||
remind -e -dxte ./test.rem 16 feb 1991 > .\test.out
|
||||
goto cmp
|
||||
:bcc
|
||||
..\os2-ex\remind -e -dxte .\test.rem 16 feb 1991 > .\test.out
|
||||
:cmp
|
||||
echo n | comp test.out test2.cmp
|
||||
if errorlevel 1 goto oops
|
||||
echo "Remind: Acceptance test PASSED"
|
||||
goto quit
|
||||
:oops
|
||||
echo "Remind: Acceptance test FAILED"
|
||||
echo ""
|
||||
echo "Examine the file test.out to see where it differs from the"
|
||||
echo "reference file test2.cmp."
|
||||
:quit
|
||||
endlocal
|
||||
@@ -1,23 +0,0 @@
|
||||
/* ---------------------------------------------------------------------------
|
||||
$Id: test-rem.rexx,v 1.1 1996-03-31 04:02:00 dfs Exp $
|
||||
TEST-REM
|
||||
This file runs an AmigaDOS acceptance test for Remind. To use it, type:
|
||||
rx test-rem
|
||||
in the build directory.
|
||||
(Use this with the ENGLISH version only !!!)
|
||||
---------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
address 'COMMAND'
|
||||
options results
|
||||
|
||||
'setenv TEST_GETENV "foo bar baz"'
|
||||
'remind -e -dxte test.rem 16 feb 1991 >ram:test.out'
|
||||
'diff ram:test.out test-rem.ami >NIL:'
|
||||
if rc=0 then do
|
||||
say "Remind: Acceptance test PASSED"
|
||||
end
|
||||
else do
|
||||
say "Remind: Acceptance test FAILED"
|
||||
end
|
||||
'delete ram:test.out quiet'
|
||||
830
test.cmp
830
test.cmp
@@ -1,830 +0,0 @@
|
||||
# Test file for REMIND
|
||||
#
|
||||
# Use this file to test the date calculation routines
|
||||
# of the REMIND program by typing:
|
||||
#
|
||||
# ./test-rem # From WITHIN Remind source directory!
|
||||
|
||||
REM MSG Today is [hebday(today())] [hebmon(today())] [hebyear(today())]
|
||||
./test.rem(8): Trig = Saturday, 16 February, 1991
|
||||
Reminders for Saturday, 16th February, 1991:
|
||||
|
||||
today() => 1991/02/16
|
||||
hebday(1991/02/16) => 2
|
||||
today() => 1991/02/16
|
||||
hebmon(1991/02/16) => "Adar"
|
||||
today() => 1991/02/16
|
||||
hebyear(1991/02/16) => 5751
|
||||
Today is 2 Adar 5751
|
||||
|
||||
fset _h(x, y) trigger(hebdate(x,y))
|
||||
|
||||
[_h(1, "Tishrey")] MSG Rosh Hashana 1
|
||||
Entering UserFN _h(1, "Tishrey")
|
||||
x => 1
|
||||
y => "Tishrey"
|
||||
hebdate(1, "Tishrey") => 1991/09/09
|
||||
trigger(1991/09/09) => "9 September 1991"
|
||||
Leaving UserFN _h() => "9 September 1991"
|
||||
./test.rem(11): Trig = Monday, 9 September, 1991
|
||||
[_h(2, "Tishrey")] MSG Rosh Hashana 2
|
||||
Entering UserFN _h(2, "Tishrey")
|
||||
x => 2
|
||||
y => "Tishrey"
|
||||
hebdate(2, "Tishrey") => 1991/09/10
|
||||
trigger(1991/09/10) => "10 September 1991"
|
||||
Leaving UserFN _h() => "10 September 1991"
|
||||
./test.rem(12): Trig = Tuesday, 10 September, 1991
|
||||
[_h(3, "Tishrey")] MSG Tzom Gedalia
|
||||
Entering UserFN _h(3, "Tishrey")
|
||||
x => 3
|
||||
y => "Tishrey"
|
||||
hebdate(3, "Tishrey") => 1991/09/11
|
||||
trigger(1991/09/11) => "11 September 1991"
|
||||
Leaving UserFN _h() => "11 September 1991"
|
||||
./test.rem(13): Trig = Wednesday, 11 September, 1991
|
||||
[_h(10, "Tishrey")] MSG Yom Kippur
|
||||
Entering UserFN _h(10, "Tishrey")
|
||||
x => 10
|
||||
y => "Tishrey"
|
||||
hebdate(10, "Tishrey") => 1991/09/18
|
||||
trigger(1991/09/18) => "18 September 1991"
|
||||
Leaving UserFN _h() => "18 September 1991"
|
||||
./test.rem(14): Trig = Wednesday, 18 September, 1991
|
||||
[_h(15, "Tishrey")] MSG Sukkot 1
|
||||
Entering UserFN _h(15, "Tishrey")
|
||||
x => 15
|
||||
y => "Tishrey"
|
||||
hebdate(15, "Tishrey") => 1991/09/23
|
||||
trigger(1991/09/23) => "23 September 1991"
|
||||
Leaving UserFN _h() => "23 September 1991"
|
||||
./test.rem(15): Trig = Monday, 23 September, 1991
|
||||
[_h(25, "Kislev")] MSG Channuka
|
||||
Entering UserFN _h(25, "Kislev")
|
||||
x => 25
|
||||
y => "Kislev"
|
||||
hebdate(25, "Kislev") => 1991/12/02
|
||||
trigger(1991/12/02) => "2 December 1991"
|
||||
Leaving UserFN _h() => "2 December 1991"
|
||||
./test.rem(16): Trig = Monday, 2 December, 1991
|
||||
[_h(10, "Tevet")] MSG Asara B'Tevet
|
||||
Entering UserFN _h(10, "Tevet")
|
||||
x => 10
|
||||
y => "Tevet"
|
||||
hebdate(10, "Tevet") => 1991/12/17
|
||||
trigger(1991/12/17) => "17 December 1991"
|
||||
Leaving UserFN _h() => "17 December 1991"
|
||||
./test.rem(17): Trig = Tuesday, 17 December, 1991
|
||||
[_h(15, "Shvat")] MSG Tu B'Shvat
|
||||
Entering UserFN _h(15, "Shvat")
|
||||
x => 15
|
||||
y => "Shvat"
|
||||
hebdate(15, "Shvat") => 1992/01/20
|
||||
trigger(1992/01/20) => "20 January 1992"
|
||||
Leaving UserFN _h() => "20 January 1992"
|
||||
./test.rem(18): Trig = Monday, 20 January, 1992
|
||||
[_h(15, "Adar A")] MSG Purim Katan
|
||||
Entering UserFN _h(15, "Adar A")
|
||||
x => 15
|
||||
y => "Adar A"
|
||||
hebdate(15, "Adar A") => 1992/02/19
|
||||
trigger(1992/02/19) => "19 February 1992"
|
||||
Leaving UserFN _h() => "19 February 1992"
|
||||
./test.rem(19): Trig = Wednesday, 19 February, 1992
|
||||
[_h(14, "Adar")] MSG Purim
|
||||
Entering UserFN _h(14, "Adar")
|
||||
x => 14
|
||||
y => "Adar"
|
||||
hebdate(14, "Adar") => 1991/02/28
|
||||
trigger(1991/02/28) => "28 February 1991"
|
||||
Leaving UserFN _h() => "28 February 1991"
|
||||
./test.rem(20): Trig = Thursday, 28 February, 1991
|
||||
[_h(15, "Nisan")] MSG Pesach
|
||||
Entering UserFN _h(15, "Nisan")
|
||||
x => 15
|
||||
y => "Nisan"
|
||||
hebdate(15, "Nisan") => 1991/03/30
|
||||
trigger(1991/03/30) => "30 March 1991"
|
||||
Leaving UserFN _h() => "30 March 1991"
|
||||
./test.rem(21): Trig = Saturday, 30 March, 1991
|
||||
[_h(27, "Nisan")] MSG Yom HaShoah
|
||||
Entering UserFN _h(27, "Nisan")
|
||||
x => 27
|
||||
y => "Nisan"
|
||||
hebdate(27, "Nisan") => 1991/04/11
|
||||
trigger(1991/04/11) => "11 April 1991"
|
||||
Leaving UserFN _h() => "11 April 1991"
|
||||
./test.rem(22): Trig = Thursday, 11 April, 1991
|
||||
[_h(4, "Iyar")] MSG Yom HaZikaron
|
||||
Entering UserFN _h(4, "Iyar")
|
||||
x => 4
|
||||
y => "Iyar"
|
||||
hebdate(4, "Iyar") => 1991/04/18
|
||||
trigger(1991/04/18) => "18 April 1991"
|
||||
Leaving UserFN _h() => "18 April 1991"
|
||||
./test.rem(23): Trig = Thursday, 18 April, 1991
|
||||
[_h(5, "Iyar")] MSG Yom Ha'atzmaut
|
||||
Entering UserFN _h(5, "Iyar")
|
||||
x => 5
|
||||
y => "Iyar"
|
||||
hebdate(5, "Iyar") => 1991/04/19
|
||||
trigger(1991/04/19) => "19 April 1991"
|
||||
Leaving UserFN _h() => "19 April 1991"
|
||||
./test.rem(24): Trig = Friday, 19 April, 1991
|
||||
[_h(28, "Iyar")] MSG Yom Yerushalayim
|
||||
Entering UserFN _h(28, "Iyar")
|
||||
x => 28
|
||||
y => "Iyar"
|
||||
hebdate(28, "Iyar") => 1991/05/12
|
||||
trigger(1991/05/12) => "12 May 1991"
|
||||
Leaving UserFN _h() => "12 May 1991"
|
||||
./test.rem(25): Trig = Sunday, 12 May, 1991
|
||||
[_h(6, "Sivan")] MSG Shavuot
|
||||
Entering UserFN _h(6, "Sivan")
|
||||
x => 6
|
||||
y => "Sivan"
|
||||
hebdate(6, "Sivan") => 1991/05/19
|
||||
trigger(1991/05/19) => "19 May 1991"
|
||||
Leaving UserFN _h() => "19 May 1991"
|
||||
./test.rem(26): Trig = Sunday, 19 May, 1991
|
||||
[_h(9, "Av")] MSG Tish'a B'Av
|
||||
Entering UserFN _h(9, "Av")
|
||||
x => 9
|
||||
y => "Av"
|
||||
hebdate(9, "Av") => 1991/07/20
|
||||
trigger(1991/07/20) => "20 July 1991"
|
||||
Leaving UserFN _h() => "20 July 1991"
|
||||
./test.rem(27): Trig = Saturday, 20 July, 1991
|
||||
|
||||
# Test some jahrzeit cases
|
||||
fset _i(x,y,z,a) trigger(hebdate(x,y,z,a))
|
||||
[_i(30, "Heshvan", today(), 5759)] MSG Complete-Complete
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Heshvan", 1991/02/16, 5759)
|
||||
x => 30
|
||||
y => "Heshvan"
|
||||
z => 1991/02/16
|
||||
a => 5759
|
||||
hebdate(30, "Heshvan", 1991/02/16, 5759) => 1991/11/07
|
||||
trigger(1991/11/07) => "7 November 1991"
|
||||
Leaving UserFN _i() => "7 November 1991"
|
||||
./test.rem(31): Trig = Thursday, 7 November, 1991
|
||||
[_i(30, "Heshvan", today(), 5760)] MSG Complete-Defective
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Heshvan", 1991/02/16, 5760)
|
||||
x => 30
|
||||
y => "Heshvan"
|
||||
z => 1991/02/16
|
||||
a => 5760
|
||||
hebdate(30, "Heshvan", 1991/02/16, 5760) => 1991/11/07
|
||||
trigger(1991/11/07) => "7 November 1991"
|
||||
Leaving UserFN _i() => "7 November 1991"
|
||||
./test.rem(32): Trig = Thursday, 7 November, 1991
|
||||
[_i(30, "Heshvan", today(), 5761)] MSG Illegal
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Heshvan", 1991/02/16, 5761)
|
||||
x => 30
|
||||
y => "Heshvan"
|
||||
z => 1991/02/16
|
||||
a => 5761
|
||||
hebdate(30, "Heshvan", 1991/02/16, 5761) => ./test.rem(33): 30 Heshvan 5761: Invalid Hebrew date
|
||||
Invalid Hebrew date
|
||||
Leaving UserFN _i() => Invalid Hebrew date
|
||||
|
||||
[_i(30, "Kislev", today(), 5759)] MSG Complete-Complete
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Kislev", 1991/02/16, 5759)
|
||||
x => 30
|
||||
y => "Kislev"
|
||||
z => 1991/02/16
|
||||
a => 5759
|
||||
hebdate(30, "Kislev", 1991/02/16, 5759) => 1991/12/07
|
||||
trigger(1991/12/07) => "7 December 1991"
|
||||
Leaving UserFN _i() => "7 December 1991"
|
||||
./test.rem(35): Trig = Saturday, 7 December, 1991
|
||||
[_i(30, "Kislev", today(), 5760)] MSG Complete-Defective
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Kislev", 1991/02/16, 5760)
|
||||
x => 30
|
||||
y => "Kislev"
|
||||
z => 1991/02/16
|
||||
a => 5760
|
||||
hebdate(30, "Kislev", 1991/02/16, 5760) => 1991/12/07
|
||||
trigger(1991/12/07) => "7 December 1991"
|
||||
Leaving UserFN _i() => "7 December 1991"
|
||||
./test.rem(36): Trig = Saturday, 7 December, 1991
|
||||
[_i(30, "Kislev", today(), 5761)] MSG Illegal
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Kislev", 1991/02/16, 5761)
|
||||
x => 30
|
||||
y => "Kislev"
|
||||
z => 1991/02/16
|
||||
a => 5761
|
||||
hebdate(30, "Kislev", 1991/02/16, 5761) => ./test.rem(37): 30 Kislev 5761: Invalid Hebrew date
|
||||
Invalid Hebrew date
|
||||
Leaving UserFN _i() => Invalid Hebrew date
|
||||
|
||||
[_i(30, "Adar A", today(), 5755)] MSG Leap
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Adar A", 1991/02/16, 5755)
|
||||
x => 30
|
||||
y => "Adar A"
|
||||
z => 1991/02/16
|
||||
a => 5755
|
||||
hebdate(30, "Adar A", 1991/02/16, 5755) => 1992/03/05
|
||||
trigger(1992/03/05) => "5 March 1992"
|
||||
Leaving UserFN _i() => "5 March 1992"
|
||||
./test.rem(39): Trig = Thursday, 5 March, 1992
|
||||
[_i(30, "Adar A", today(), 5756)] MSG Illegal
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(30, "Adar A", 1991/02/16, 5756)
|
||||
x => 30
|
||||
y => "Adar A"
|
||||
z => 1991/02/16
|
||||
a => 5756
|
||||
hebdate(30, "Adar A", 1991/02/16, 5756) => ./test.rem(40): No Adar A in 5756
|
||||
Invalid Hebrew date
|
||||
Leaving UserFN _i() => Invalid Hebrew date
|
||||
[_i(29, "Adar A", today(), 5755)] MSG Leap
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(29, "Adar A", 1991/02/16, 5755)
|
||||
x => 29
|
||||
y => "Adar A"
|
||||
z => 1991/02/16
|
||||
a => 5755
|
||||
hebdate(29, "Adar A", 1991/02/16, 5755) => 1991/03/15
|
||||
trigger(1991/03/15) => "15 March 1991"
|
||||
Leaving UserFN _i() => "15 March 1991"
|
||||
./test.rem(41): Trig = Friday, 15 March, 1991
|
||||
[_i(29, "Adar A", today(), 5756)] MSG Illegal
|
||||
today() => 1991/02/16
|
||||
Entering UserFN _i(29, "Adar A", 1991/02/16, 5756)
|
||||
x => 29
|
||||
y => "Adar A"
|
||||
z => 1991/02/16
|
||||
a => 5756
|
||||
hebdate(29, "Adar A", 1991/02/16, 5756) => ./test.rem(42): No Adar A in 5756
|
||||
Invalid Hebrew date
|
||||
Leaving UserFN _i() => Invalid Hebrew date
|
||||
|
||||
# Test each possible case of the basic reminders.
|
||||
|
||||
REM MSG Every Day
|
||||
./test.rem(46): Trig = Saturday, 16 February, 1991
|
||||
Every Day
|
||||
|
||||
|
||||
REM 18 MSG Every 18th
|
||||
./test.rem(48): Trig = Monday, 18 February, 1991
|
||||
REM 15 MSG Every 15th
|
||||
./test.rem(49): Trig = Friday, 15 March, 1991
|
||||
|
||||
REM Feb MSG February
|
||||
./test.rem(51): Trig = Saturday, 16 February, 1991
|
||||
February
|
||||
|
||||
REM Jan MSG January
|
||||
./test.rem(52): Trig = Wednesday, 1 January, 1992
|
||||
REM March MSG March
|
||||
./test.rem(53): Trig = Friday, 1 March, 1991
|
||||
|
||||
REM 13 Jan MSG 13 Jan
|
||||
./test.rem(55): Trig = Monday, 13 January, 1992
|
||||
REM 15 Feb MSG 15 Feb
|
||||
./test.rem(56): Trig = Saturday, 15 February, 1992
|
||||
REM 28 Feb MSG 28 Feb
|
||||
./test.rem(57): Trig = Thursday, 28 February, 1991
|
||||
REM 29 Feb MSG 29 Feb
|
||||
./test.rem(58): Trig = Saturday, 29 February, 1992
|
||||
REM 5 Mar MSG 5 Mar
|
||||
./test.rem(59): Trig = Tuesday, 5 March, 1991
|
||||
|
||||
REM 1990 MSG 1990
|
||||
./test.rem(61): Expired
|
||||
REM 1991 MSG 1991
|
||||
./test.rem(62): Trig = Saturday, 16 February, 1991
|
||||
1991
|
||||
|
||||
REM 1992 MSG 1991
|
||||
./test.rem(63): Trig = Wednesday, 1 January, 1992
|
||||
|
||||
REM 1 1990 MSG 1 1990
|
||||
./test.rem(65): Expired
|
||||
REM 29 1991 MSG 29 1991
|
||||
./test.rem(66): Trig = Friday, 29 March, 1991
|
||||
REM 29 1992 MSG 29 1992
|
||||
./test.rem(67): Trig = Wednesday, 29 January, 1992
|
||||
REM 16 1991 MSG 16 1991
|
||||
./test.rem(68): Trig = Saturday, 16 February, 1991
|
||||
16 1991
|
||||
|
||||
|
||||
REM Jan 1990 MSG Jan 1990
|
||||
./test.rem(70): Expired
|
||||
REM Feb 1991 MSG Feb 1991
|
||||
./test.rem(71): Trig = Saturday, 16 February, 1991
|
||||
Feb 1991
|
||||
|
||||
REM Dec 1991 MSG Dec 1991
|
||||
./test.rem(72): Trig = Sunday, 1 December, 1991
|
||||
REM May 1992 MSG May 1992
|
||||
./test.rem(73): Trig = Friday, 1 May, 1992
|
||||
|
||||
REM 1 Jan 1991 MSG 1 Jan 1991
|
||||
./test.rem(75): Expired
|
||||
REM 16 Feb 1991 MSG 16 Feb 1991
|
||||
./test.rem(76): Trig = Saturday, 16 February, 1991
|
||||
16 Feb 1991
|
||||
|
||||
REM 29 Dec 1992 MSG 29 Dec 1992
|
||||
./test.rem(77): Trig = Tuesday, 29 December, 1992
|
||||
|
||||
REM Sun MSG Sun
|
||||
./test.rem(79): Trig = Sunday, 17 February, 1991
|
||||
REM Fri Sat Tue MSG Fri Sat Tue
|
||||
./test.rem(80): Trig = Saturday, 16 February, 1991
|
||||
Fri Sat Tue
|
||||
|
||||
|
||||
REM Sun 16 MSG Sun 16
|
||||
./test.rem(82): Trig = Sunday, 17 February, 1991
|
||||
REM Mon Tue Wed Thu Fri 1 MSG Mon Tue Wed Thu Fri 1
|
||||
./test.rem(83): Trig = Friday, 1 March, 1991
|
||||
|
||||
REM Sun Feb MSG Sun Feb
|
||||
./test.rem(85): Trig = Sunday, 17 February, 1991
|
||||
REM Mon Tue March MSG Mon Tue March
|
||||
./test.rem(86): Trig = Monday, 4 March, 1991
|
||||
|
||||
REM Sun 16 Feb MSG Sun 16 Feb
|
||||
./test.rem(88): Trig = Sunday, 17 February, 1991
|
||||
REM Mon Tue 10 March MSG Mon Tue 10 March
|
||||
./test.rem(89): Trig = Monday, 11 March, 1991
|
||||
|
||||
REM Sat Sun 1991 MSG Sat Sun 1991
|
||||
./test.rem(91): Trig = Saturday, 16 February, 1991
|
||||
Sat Sun 1991
|
||||
|
||||
REM Mon Tue 1992 MSG Mon Tue 1992
|
||||
./test.rem(92): Trig = Monday, 6 January, 1992
|
||||
|
||||
REM Sun 16 1991 MSG Sun 16 1991
|
||||
./test.rem(94): Trig = Sunday, 17 February, 1991
|
||||
REM Mon Tue Wed Thu Fri 1 1992 MSG Mon Tue Wed Thu Fri 1 1992
|
||||
./test.rem(95): Trig = Wednesday, 1 January, 1992
|
||||
|
||||
REM Mon Feb 1991 MSG Mon Feb 1991
|
||||
./test.rem(97): Trig = Monday, 18 February, 1991
|
||||
REM Tue Jan 1992 MSG Tue Jan 1992
|
||||
./test.rem(98): Trig = Tuesday, 7 January, 1992
|
||||
|
||||
REM Sun Mon 16 Feb 1991 MSG Sun Mon 16 Feb 1991
|
||||
./test.rem(100): Trig = Sunday, 17 February, 1991
|
||||
REM Tue 28 Jan 1992 MSG Tue 28 Jan 1992
|
||||
./test.rem(101): Trig = Tuesday, 28 January, 1992
|
||||
|
||||
# Try some Backs
|
||||
CLEAR-OMIT-CONTEXT
|
||||
REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun
|
||||
./test.rem(105): Trig = Thursday, 28 February, 1991
|
||||
REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun
|
||||
./test.rem(106): Trig = Thursday, 28 February, 1991
|
||||
|
||||
OMIT 28 Feb
|
||||
REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun (28 Feb omitted)
|
||||
./test.rem(109): Trig = Wednesday, 27 February, 1991
|
||||
REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun (28 Feb omitted)
|
||||
./test.rem(110): Trig = Thursday, 28 February, 1991
|
||||
|
||||
CLEAR-OMIT-CONTEXT
|
||||
|
||||
# Try out UNTIL
|
||||
REM Wed UNTIL 21 Feb 1991 MSG Wed UNTIL 21 Feb 1991
|
||||
./test.rem(115): Trig = Wednesday, 20 February, 1991
|
||||
|
||||
# Try playing with the OMIT context
|
||||
|
||||
OMIT 28 Feb 1991
|
||||
REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
|
||||
./test.rem(120): Trig = Wednesday, 27 February, 1991
|
||||
REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
|
||||
./test.rem(121): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
|
||||
./test.rem(122): Trig = Wednesday, 27 February, 1991
|
||||
REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
|
||||
./test.rem(123): Trig = Friday, 28 February, 1992
|
||||
REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
|
||||
./test.rem(124): Trig = Friday, 1 March, 1991
|
||||
|
||||
PUSH-OMIT-CONTEXT
|
||||
CLEAR-OMIT-CONTEXT
|
||||
REM 1 Mar -1 MSG 1 mar -1
|
||||
./test.rem(128): Trig = Thursday, 28 February, 1991
|
||||
REM 1 Mar --1 MSG 1 mar --1
|
||||
./test.rem(129): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb BEFORE MSG 28 Feb BEFORE
|
||||
./test.rem(130): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb SKIP MSG 28 Feb SKIP
|
||||
./test.rem(131): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb AFTER MSG 28 Feb AFTER
|
||||
./test.rem(132): Trig = Thursday, 28 February, 1991
|
||||
|
||||
POP-OMIT-CONTEXT
|
||||
REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
|
||||
./test.rem(135): Trig = Wednesday, 27 February, 1991
|
||||
REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
|
||||
./test.rem(136): Trig = Thursday, 28 February, 1991
|
||||
REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
|
||||
./test.rem(137): Trig = Wednesday, 27 February, 1991
|
||||
REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
|
||||
./test.rem(138): Trig = Friday, 28 February, 1992
|
||||
REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
|
||||
./test.rem(139): Trig = Friday, 1 March, 1991
|
||||
|
||||
|
||||
REM 13 March 1991 *1 UNTIL 19 March 1991 MSG 13-19 Mar 91
|
||||
./test.rem(142): Trig = Wednesday, 13 March, 1991
|
||||
|
||||
# Test BACK
|
||||
CLEAR-OMIT-CONTEXT
|
||||
REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1
|
||||
./test.rem(146): Trig = Monday, 18 February, 1991
|
||||
|
||||
OMIT 17 Feb 1991
|
||||
REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1 (17Feb91 omitted)
|
||||
./test.rem(149): Trig = Monday, 18 February, 1991
|
||||
18 Feb 1991 +1 (17Feb91 omitted)
|
||||
|
||||
REM 18 Feb 1991 ++1 MSG 18 Feb 1991 ++1 (17Feb91 omitted)
|
||||
./test.rem(150): Trig = Monday, 18 February, 1991
|
||||
|
||||
CLEAR-OMIT-CONTEXT
|
||||
# Test the scanfrom clause
|
||||
REM Fri SATISFY 1
|
||||
./test.rem(154): Trig = Friday, 22 February, 1991
|
||||
OMIT [trigger(trigdate())]
|
||||
trigdate() => 1991/02/22
|
||||
trigger(1991/02/22) => "22 February 1991"
|
||||
REM Fri after MSG 23 Feb 1991
|
||||
./test.rem(156): Trig = Saturday, 23 February, 1991
|
||||
CLEAR-OMIT-CONTEXT
|
||||
REM Fri SCANFROM [trigger(today()-7)] SATISFY 1
|
||||
today() => 1991/02/16
|
||||
1991/02/16 - 7 => 1991/02/09
|
||||
trigger(1991/02/09) => "9 February 1991"
|
||||
./test.rem(158): Trig = Friday, 15 February, 1991
|
||||
OMIT [trigger(trigdate())]
|
||||
trigdate() => 1991/02/15
|
||||
trigger(1991/02/15) => "15 February 1991"
|
||||
REM Fri after MSG 16 Feb 1991
|
||||
./test.rem(160): Trig = Saturday, 16 February, 1991
|
||||
16 Feb 1991
|
||||
|
||||
CLEAR-OMIT-CONTEXT
|
||||
set a000 abs(1)
|
||||
abs(1) => 1
|
||||
set a001 abs(-1)
|
||||
- 1 => -1
|
||||
abs(-1) => 1
|
||||
set a002 asc("foo")
|
||||
asc("foo") => 102
|
||||
set a003 baseyr()
|
||||
baseyr() => 1990
|
||||
set a004 char(66,55,66,77,66)
|
||||
char(66, 55, 66, 77, 66) => "B7BMB"
|
||||
set a005 choose(3, "foo", "bar", "baz", "blech")
|
||||
choose(3, "foo", "bar", "baz", "blech") => "baz"
|
||||
set a006 coerce("string", 1)
|
||||
coerce("string", 1) => "1"
|
||||
set a007 coerce("string", today())
|
||||
today() => 1991/02/16
|
||||
coerce("string", 1991/02/16) => "1991/02/16"
|
||||
set a008 coerce("string", 11:44)
|
||||
coerce("string", 11:44) => "11:44"
|
||||
set a009 coerce("int", "badnews")
|
||||
coerce("int", "badnews") => Can't coerce
|
||||
./test.rem(171): Can't coerce
|
||||
set a010 coerce("int", "12")
|
||||
coerce("int", "12") => 12
|
||||
set a011 coerce("int", 11:44)
|
||||
coerce("int", 11:44) => 704
|
||||
set a012 coerce("int", today())
|
||||
today() => 1991/02/16
|
||||
coerce("int", 1991/02/16) => 411
|
||||
set a013 date(1992, 2, 2)
|
||||
date(1992, 2, 2) => 1992/02/02
|
||||
set a014 date(1993, 2, 29)
|
||||
date(1993, 2, 29) => Bad date specification
|
||||
./test.rem(176): Bad date specification
|
||||
set a015 day(today())
|
||||
today() => 1991/02/16
|
||||
day(1991/02/16) => 16
|
||||
set a016 daysinmon(2, 1991)
|
||||
daysinmon(2, 1991) => 28
|
||||
set a017 daysinmon(2, 1992)
|
||||
daysinmon(2, 1992) => 29
|
||||
set a018 defined("a017")
|
||||
defined("a017") => 1
|
||||
set a019 defined("a019")
|
||||
defined("a019") => 0
|
||||
set a020 filename()
|
||||
filename() => "./test.rem"
|
||||
set a021 getenv("TEST_GETENV")
|
||||
getenv("TEST_GETENV") => "foo bar baz"
|
||||
set a022 hour(11:22)
|
||||
hour(11:22) => 11
|
||||
set a023 iif(1, 1, 0)
|
||||
iif(1, 1, 0) => 1
|
||||
set a024 iif(0, 1, 0)
|
||||
iif(0, 1, 0) => 0
|
||||
set a025 index("barfoobar", "foo")
|
||||
index("barfoobar", "foo") => 4
|
||||
set a026 index("barfoobar", "bar", 2)
|
||||
index("barfoobar", "bar", 2) => 7
|
||||
set a027 isleap(today())
|
||||
today() => 1991/02/16
|
||||
isleap(1991/02/16) => 0
|
||||
set a028 isleap(1992)
|
||||
isleap(1992) => 1
|
||||
omit [trigger(today())]
|
||||
today() => 1991/02/16
|
||||
trigger(1991/02/16) => "16 February 1991"
|
||||
set a030 isomitted(today())
|
||||
today() => 1991/02/16
|
||||
isomitted(1991/02/16) => 1
|
||||
clear
|
||||
set a029 isomitted(today())
|
||||
today() => 1991/02/16
|
||||
isomitted(1991/02/16) => 0
|
||||
set a031 lower("FOOBARBAZ")
|
||||
lower("FOOBARBAZ") => "foobarbaz"
|
||||
set a032 max(1, 2, 34, 1, 3)
|
||||
max(1, 2, 34, 1, 3) => 34
|
||||
set a033 max("foo", "bar", "baz")
|
||||
max("foo", "bar", "baz") => "foo"
|
||||
set a034 max(today(), today()+1, today()-1)
|
||||
today() => 1991/02/16
|
||||
today() => 1991/02/16
|
||||
1991/02/16 + 1 => 1991/02/17
|
||||
today() => 1991/02/16
|
||||
1991/02/16 - 1 => 1991/02/15
|
||||
max(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/17
|
||||
set a035 min(1, 2, 34, 1, 3)
|
||||
min(1, 2, 34, 1, 3) => 1
|
||||
set a036 min("foo", "bar", "baz")
|
||||
min("foo", "bar", "baz") => "bar"
|
||||
set a037 min(today(), today()+1, today()-1)
|
||||
today() => 1991/02/16
|
||||
today() => 1991/02/16
|
||||
1991/02/16 + 1 => 1991/02/17
|
||||
today() => 1991/02/16
|
||||
1991/02/16 - 1 => 1991/02/15
|
||||
min(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/15
|
||||
set a038 minute(11:33)
|
||||
minute(11:33) => 33
|
||||
set a039 mon(today())
|
||||
today() => 1991/02/16
|
||||
mon(1991/02/16) => "February"
|
||||
set a040 monnum(today())
|
||||
today() => 1991/02/16
|
||||
monnum(1991/02/16) => 2
|
||||
set a041 ord(3)
|
||||
ord(3) => "3rd"
|
||||
set a042 ord(4)
|
||||
ord(4) => "4th"
|
||||
set a043 ostype()
|
||||
ostype() => "UNIX"
|
||||
set a044 plural(2)
|
||||
plural(2) => "s"
|
||||
set a045 plural(2, "ies")
|
||||
plural(2, "ies") => "iess"
|
||||
set a046 plural(2, "y", "ies")
|
||||
plural(2, "y", "ies") => "ies"
|
||||
set a047 sgn(-2)
|
||||
- 2 => -2
|
||||
sgn(-2) => -1
|
||||
set a048 shell("echo foo")
|
||||
shell("echo foo") => "foo"
|
||||
set a049 strlen("sadjflkhsldkfhsdlfjhk")
|
||||
strlen("sadjflkhsldkfhsdlfjhk") => 21
|
||||
set a050 substr(a049, 2)
|
||||
a049 => 21
|
||||
substr(21, 2) => Type mismatch
|
||||
./test.rem(214): Type mismatch
|
||||
set a051 substr(a050, 2, 6)
|
||||
a050 => ./test.rem(215): Undefined variable: a050
|
||||
set a052 time(1+2, 3+4)
|
||||
1 + 2 => 3
|
||||
3 + 4 => 7
|
||||
time(3, 7) => 03:07
|
||||
rem 10 jan 1992 AT 11:22 CAL
|
||||
./test.rem(217): Trig = Friday, 10 January, 1992
|
||||
set a053 trigdate()
|
||||
trigdate() => 1992/01/10
|
||||
set a054 trigtime()
|
||||
trigtime() => 11:22
|
||||
set a055 trigvalid()
|
||||
trigvalid() => 1
|
||||
set a056 upper("sdfjhsdf ksjdfh kjsdfh ksjdfh")
|
||||
upper("sdfjhsdf ksjdfh kjsdfh ksjdfh") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
set a057 value("a05"+"6")
|
||||
"a05" + "6" => "a056"
|
||||
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
set a058 version()
|
||||
version() => "03.00.14"
|
||||
set a059 wkday(today())
|
||||
today() => 1991/02/16
|
||||
wkday(1991/02/16) => "Saturday"
|
||||
set a060 wkdaynum(today())
|
||||
today() => 1991/02/16
|
||||
wkdaynum(1991/02/16) => 6
|
||||
set a061 year(today())
|
||||
today() => 1991/02/16
|
||||
year(1991/02/16) => 1991
|
||||
set a062 1+2*(3+4-(5*7/2))
|
||||
3 + 4 => 7
|
||||
5 * 7 => 35
|
||||
35 / 2 => 17
|
||||
7 - 17 => -10
|
||||
2 * -10 => -20
|
||||
1 + -20 => -19
|
||||
set a063 1>=2
|
||||
1 >= 2 => 0
|
||||
set a064 1<2 || 3 > 4
|
||||
1 < 2 => 1
|
||||
3 > 4 => 0
|
||||
1 || 0 => 1
|
||||
set a065 1 && 1
|
||||
1 && 1 => 1
|
||||
set a066 !a065
|
||||
a065 => 1
|
||||
! 1 => 0
|
||||
set a067 typeof(2)
|
||||
typeof(2) => "INT"
|
||||
set a068 typeof("foo")
|
||||
typeof("foo") => "STRING"
|
||||
set a069 typeof(11:33)
|
||||
typeof(11:33) => "TIME"
|
||||
set a070 typeof(today())
|
||||
today() => 1991/02/16
|
||||
typeof(1991/02/16) => "DATE"
|
||||
fset g(x,y) max(x,y)
|
||||
fset h(x,y) min(g(x+y, x*y), g(x-y, x/y))
|
||||
set a071 g(1, 2)
|
||||
Entering UserFN g(1, 2)
|
||||
x => 1
|
||||
y => 2
|
||||
max(1, 2) => 2
|
||||
Leaving UserFN g() => 2
|
||||
set a072 h(2, 3)
|
||||
Entering UserFN h(2, 3)
|
||||
x => 2
|
||||
y => 3
|
||||
2 + 3 => 5
|
||||
x => 2
|
||||
y => 3
|
||||
2 * 3 => 6
|
||||
Entering UserFN g(5, 6)
|
||||
x => 5
|
||||
y => 6
|
||||
max(5, 6) => 6
|
||||
Leaving UserFN g() => 6
|
||||
x => 2
|
||||
y => 3
|
||||
2 - 3 => -1
|
||||
x => 2
|
||||
y => 3
|
||||
2 / 3 => 0
|
||||
Entering UserFN g(-1, 0)
|
||||
x => -1
|
||||
y => 0
|
||||
max(-1, 0) => 0
|
||||
Leaving UserFN g() => 0
|
||||
min(6, 0) => 0
|
||||
Leaving UserFN h() => 0
|
||||
set a073 h("foo", 11:33)
|
||||
Entering UserFN h("foo", 11:33)
|
||||
x => "foo"
|
||||
y => 11:33
|
||||
"foo" + 11:33 => "foo11:33"
|
||||
x => "foo"
|
||||
y => 11:33
|
||||
"foo" * 11:33 => Type mismatch
|
||||
./test.rem(240): `*': Type mismatch
|
||||
Leaving UserFN h() => Type mismatch
|
||||
set a074 dosubst("%a %b %c %d %e %f %g %h", '1992/5/5')
|
||||
dosubst("%a %b %c %d %e %f %g %h", 1992/05/05) => "on Tuesday, 5 May, 1992 in 444 days' tim"...
|
||||
msg [a074]%
|
||||
./test.rem(242): Trig = Saturday, 16 February, 1991
|
||||
a074 => "on Tuesday, 5 May, 1992 in 444 days' tim"...
|
||||
on Tuesday, 5 May, 1992 in 444 days' time on Tuesday 5 on 05/05/1992 on 05/05/1992 on Tuesday, 5 May on 05/05
|
||||
set a075 dosubst("%i %j %k %l %m %n %o %p", '1992/5/5')
|
||||
dosubst("%i %j %k %l %m %n %o %p", 1992/05/05) => "on 05/05 on Tuesday, May 5th, 1992 on Tu"...
|
||||
msg [a075]%
|
||||
./test.rem(244): Trig = Saturday, 16 February, 1991
|
||||
a075 => "on 05/05 on Tuesday, May 5th, 1992 on Tu"...
|
||||
on 05/05 on Tuesday, May 5th, 1992 on Tuesday, May 5th on 1992/05/05 May 5 s
|
||||
set a076 dosubst("%q %r %s %t %u %v %w %x", '1992/5/5')
|
||||
dosubst("%q %r %s %t %u %v %w %x", 1992/05/05) => "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
|
||||
msg [a076]%
|
||||
./test.rem(246): Trig = Saturday, 16 February, 1991
|
||||
a076 => "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
|
||||
s' 05 th 05 on Tuesday, 5th May, 1992 on Tuesday, 5th May Tuesday 444
|
||||
set a077 dosubst("%y %z", '1992/5/5')
|
||||
dosubst("%y %z", 1992/05/05) => "1992 92
|
||||
"
|
||||
msg [a077]%
|
||||
./test.rem(248): Trig = Saturday, 16 February, 1991
|
||||
a077 => "1992 92
|
||||
"
|
||||
1992 92
|
||||
set a078 easterdate(today())
|
||||
today() => 1991/02/16
|
||||
easterdate(1991/02/16) => 1991/03/31
|
||||
set a079 easterdate(1992)
|
||||
easterdate(1992) => 1992/04/19
|
||||
set a080 easterdate(1995)
|
||||
easterdate(1995) => 1995/04/16
|
||||
set a081 ""
|
||||
dump
|
||||
Variable Value
|
||||
|
||||
a017 29
|
||||
a036 "bar"
|
||||
a055 1
|
||||
a074 "on Tuesday, 5 May, 1992 in 444 days' tim"...
|
||||
a008 "11:44"
|
||||
a027 0
|
||||
a046 "ies"
|
||||
a065 1
|
||||
a018 1
|
||||
a037 1991/02/15
|
||||
a056 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
a075 "on 05/05 on Tuesday, May 5th, 1992 on Tu"...
|
||||
a028 1
|
||||
a047 -1
|
||||
a066 0
|
||||
a019 0
|
||||
a038 33
|
||||
a057 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||
a076 "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
|
||||
a029 0
|
||||
a048 "foo"
|
||||
a067 "INT"
|
||||
a039 "February"
|
||||
a058 "03.00.14"
|
||||
a077 "1992 92
|
||||
"
|
||||
a049 21
|
||||
a068 "STRING"
|
||||
a059 "Saturday"
|
||||
a078 1991/03/31
|
||||
a069 "TIME"
|
||||
a079 1992/04/19
|
||||
a000 1
|
||||
a010 12
|
||||
a001 1
|
||||
a020 "./test.rem"
|
||||
a011 704
|
||||
a030 1
|
||||
a002 102
|
||||
a021 "foo bar baz"
|
||||
a040 2
|
||||
a012 411
|
||||
a031 "foobarbaz"
|
||||
a003 1990
|
||||
a022 11
|
||||
a041 "3rd"
|
||||
a060 6
|
||||
a013 1992/02/02
|
||||
a032 34
|
||||
a070 "DATE"
|
||||
a004 "B7BMB"
|
||||
a023 1
|
||||
a042 "4th"
|
||||
a061 1991
|
||||
a080 1995/04/16
|
||||
a033 "foo"
|
||||
a052 03:07
|
||||
a071 2
|
||||
a005 "baz"
|
||||
a024 0
|
||||
a043 "UNIX"
|
||||
a062 -19
|
||||
a081 ""
|
||||
a015 16
|
||||
a034 1991/02/17
|
||||
a053 1992/01/10
|
||||
a072 0
|
||||
a006 "1"
|
||||
a025 4
|
||||
a044 "s"
|
||||
a063 0
|
||||
a016 28
|
||||
a035 1
|
||||
a054 11:22
|
||||
a007 "1991/02/16"
|
||||
a026 7
|
||||
a045 "iess"
|
||||
a064 1
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user