Compare commits

..

87 Commits

Author SHA1 Message Date
David F. Skoll
487338d10c Updated for 3.1.4 release. 2008-02-03 17:12:16 -05:00
David F. Skoll
3d1c0e5667 Fix awful bug in rem2html for a 28-day February that starts on Sunday... 2008-01-31 23:31:45 -05:00
David F. Skoll
ce3bb191c4 More code cleanups and const-correctness. 2008-01-30 21:37:19 -05:00
David F. Skoll
03e9dbf364 More const qualification. 2008-01-28 11:39:15 -05:00
David F. Skoll
518aab3d02 Don't trash argv[] so reread works properly. 2008-01-28 11:28:17 -05:00
David F. Skoll
f055664f77 More const-correctness. 2008-01-27 11:02:03 -05:00
David F. Skoll
ba3e01f2ce Add a bunch of const qualifiers. 2008-01-26 21:55:58 -05:00
David F. Skoll
b6883c8a45 Keep version number in ONE place (configure.in) instead of two. 2008-01-26 15:34:32 -05:00
David F. Skoll
9e49ee3acb Make tkremind obey -b1 option (24-hour mode.) 2008-01-26 12:01:43 -05:00
David F. Skoll
7481f68bb2 Make tkremind work better with Tk8.5. 2007-12-24 11:40:22 -05:00
David F. Skoll
99792eec03 Add a test. 2007-11-05 11:52:50 -05:00
David F. Skoll
91458c7845 Better patch for parsing bug. 2007-11-05 11:44:48 -05:00
David F. Skoll
cad5849dc0 Merge branch 'master' of ssh://magnesium.roaringpenguin.com/home/dfs/personal-git-repos/Remind 2007-11-05 11:38:17 -05:00
David F. Skoll
a38e120e99 Fix weird parsing bug if you have a SKIP on an omitted day with a SATISFY. 2007-11-05 11:37:48 -05:00
David F. Skoll
0b31a78cf2 Patch to clean up HTML output (Jorey Bump) 2007-10-16 11:46:58 -04:00
David F. Skoll
861858c1a6 Bump version to 03.01.04. 2007-10-15 14:17:09 -04:00
David F. Skoll
d43a2277da Updated WHATSNEW. 2007-10-15 14:00:09 -04:00
David F. Skoll
f678dc96b8 Write man page for rem2html 2007-10-07 22:24:35 -04:00
David F. Skoll
c2e371904e Update distclean target. 2007-10-07 22:10:25 -04:00
David F. Skoll
2a1cbff22e Add www/Makfile to gitignore. 2007-10-07 22:09:47 -04:00
David F. Skoll
a2d9f277c4 Minor tweaks to Makefile.in 2007-10-07 22:09:37 -04:00
David F. Skoll
d939059417 Improve www/Makefile stuff. 2007-10-07 22:05:35 -04:00
David F. Skoll
740cd4cfed Update README. 2007-10-06 11:41:40 -04:00
David F. Skoll
91a5306a67 Fix typo. 2007-10-06 11:38:23 -04:00
David F. Skoll
b78ffcbffd Tidy up option processing. 2007-10-06 11:35:57 -04:00
David F. Skoll
4f72f557b7 Minor fix to --nostyle output. 2007-10-05 11:52:16 -04:00
David F. Skoll
e3b21d6d0d More tweaks. 2007-10-04 22:02:27 -04:00
David F. Skoll
af28c49d8d Fixed up the www stuff. 2007-10-04 22:01:09 -04:00
David F. Skoll
67f4635573 Fix DST rules. 2007-10-04 13:41:42 -04:00
David F. Skoll
5f8d10908d Minor cleanups. 2007-10-03 12:32:41 -04:00
David F. Skoll
7307421812 Add --nostyle option to rem2html so it can produce basic HTML that does
not rely on an external stylesheet.
2007-10-02 18:47:38 -04:00
David F. Skoll
5cd3b628c5 Minor tweaks. 2007-10-02 14:03:19 -04:00
David F. Skoll
29e483ab64 Updated Makefile and rem2html to use IMGBASE for stylesheet also. 2007-10-02 11:31:06 -04:00
David F. Skoll
66ddba45af Add support for HTMLCLASS special. Add CSS code for rem-today class to
highlight "today".
2007-10-02 11:21:40 -04:00
David F. Skoll
9325b3f035 Minor tweaks to CSS. 2007-10-01 18:03:21 -04:00
David F. Skoll
522c4c94e1 Add --imgbase option. 2007-10-01 17:59:33 -04:00
David F. Skoll
730505cff3 Less verbose. 2007-10-01 17:27:58 -04:00
David F. Skoll
019783e1fa Redo rem2html. Uses CSS instead of hard-coded stuff. 2007-10-01 17:21:59 -04:00
David F. Skoll
8612bb6480 Do not evaluate SATISFY expression if reminder has expired. 2007-09-26 08:41:34 -04:00
David F. Skoll
7f1e6d21d9 Update version number and copyright year. 2007-09-24 10:32:06 -04:00
David F. Skoll
e6c0371be1 Make calendar times show duration. 2007-09-16 17:44:33 -04:00
David F. Skoll
58feaa7e0c Update version in test.cmp 2007-09-12 10:08:04 -04:00
David F. Skoll
a828378466 Update version. 2007-09-12 09:55:40 -04:00
David F. Skoll
53316e8b06 Update WHATSNEW for 3.1.2 release. 2007-09-11 21:41:00 -04:00
David F. Skoll
6127e390a1 Make tkremind notify when firing up editor. 2007-09-10 16:56:10 -04:00
David F. Skoll
4caa77f6b1 Make PgUp and PgDn work like Left and Right, respectively. 2007-09-06 14:25:52 -04:00
David F. Skoll
70419e8757 Found dates for almost all releases. 2007-09-05 17:25:50 -04:00
David F. Skoll
21d8bd1406 Add dates (where known) to releases. 2007-09-05 17:07:48 -04:00
David F. Skoll
25abee3259 Ensure that tkremind draws moons before anything else. 2007-09-05 16:20:33 -04:00
David F. Skoll
2d490c2b7a Clarify WHATSNEW 2007-09-05 15:52:57 -04:00
David F. Skoll
902b7895b7 Merge branch 'master' of ssh://magnesium.roaringpenguin.com/home/dfs/personal-git-repos/Remind 2007-09-05 07:04:36 -04:00
David F. Skoll
1c80bb649f Trigger queued reminders at least once even if we hibernate past trigger time. 2007-09-05 07:04:11 -04:00
David F. Skoll
4508215617 Merge branch 'master' of ssh://magnesium.roaringpenguin.com/home/dfs/personal-git-repos/Remind 2007-09-04 21:58:37 -04:00
David F. Skoll
739b68347a Update WHATSNEW 2007-09-04 21:53:33 -04:00
David F. Skoll
d834760cda Merge branch 'master' of ssh://magnesium.roaringpenguin.com/home/dfs/personal-git-repos/Remind 2007-09-04 21:46:16 -04:00
David F. Skoll
1bc78650bf Exit in queue mode if date rolls over. 2007-09-04 21:44:59 -04:00
David F. Skoll
ec4e203099 Fix typo that caused SEGV. 2007-09-04 14:38:46 -04:00
David F. Skoll
d23528da82 Don't trigger reminders if they are more than 60 seconds in the past.
We want to avoid a huge flurry of triggering up emerging from suspend
or hibernation on a laptop.
2007-09-04 14:24:32 -04:00
David F. Skoll
7401a0ba23 In queue mode, wake up once a minute to recalibrate sleep time. Required
for laptops that hibernate or suspend.
2007-09-04 14:16:12 -04:00
David F. Skoll
b14b4f08b1 build.tk tries to reuse existing settings if an installed version of Remind
is found.
2007-09-03 21:37:58 -04:00
David F. Skoll
70ece81340 Flash buttons before invoking. 2007-09-03 10:23:15 -04:00
David F. Skoll
19ac350527 Silence gcc warning on Ubuntu Feisty. 2007-09-03 10:09:07 -04:00
David F. Skoll
a9b08d7db8 Updated docs. 2007-09-03 07:06:53 -04:00
David F. Skoll
df8fa05632 Note that psmoon and psshade are deprecated. 2007-09-03 06:48:38 -04:00
David F. Skoll
6556137aad Warn about deprecated psmoon and psshade functions. 2007-09-03 06:46:58 -04:00
David F. Skoll
aa1ab2bbb4 Don't sort SPECIALs ahead of normal reminders. Allow all SPECIALs to include
times; back-ends can use or ignore them as they see fit.
2007-09-03 06:28:34 -04:00
David F. Skoll
be38d86521 Make non-PSFile and non-PostScript SPECIALs preserve time
in -p field.
2007-09-02 23:02:25 -04:00
David F. Skoll
3931afb6b1 Remove all mention of remind-all. 2007-08-31 23:37:19 -04:00
David F. Skoll
7d2df86b75 Remove mention of remind-all 2007-08-31 23:36:06 -04:00
David F. Skoll
5a3bd5839b Tweak "make distro" 2007-08-31 23:29:39 -04:00
David F. Skoll
b91ce9a3f7 Incorporate rem's functionality directly into Remind. 2007-08-31 23:10:40 -04:00
David F. Skoll
ac889dd329 Corrections to Jewish Holidays from Art Werschulz. 2007-08-31 11:37:40 -04:00
David F. Skoll
420df9b6ed Bump version to 03.01.02. 2007-08-31 11:06:19 -04:00
David F. Skoll
f862b6811d Add test for REM AT ... SPECIAL COLOR ... 2007-08-31 11:02:26 -04:00
David F. Skoll
c072698927 Handle queued SPECIAL COLOR reminders properly. 2007-08-31 11:00:49 -04:00
David F. Skoll
d22895831b Fix enter/leave events. 2007-08-31 10:32:01 -04:00
David F. Skoll
3c41f4ade4 add rem2ps to gitignore. 2007-08-30 23:31:42 -04:00
David F. Skoll
335d5fb984 Don't include .gitignore when making distro. 2007-08-30 23:30:51 -04:00
David F. Skoll
66bd2b8fac Add a .gitignore file. 2007-08-30 23:29:20 -04:00
David F. Skoll
fed3cad3b8 Fix regression that broke non-COLOR specials. 2007-08-30 23:23:45 -04:00
David F. Skoll
b20578f24f Add and document keyboard shortcuts to tkremind. 2007-08-30 22:31:11 -04:00
David F. Skoll
7a86e7f777 Use spacing rather than "....." to separate reminders in TkRemind. 2007-08-30 22:19:50 -04:00
David F. Skoll
16c93fcad6 Add rem.1 man page to install target. 2007-08-30 21:58:28 -04:00
David F. Skoll
edd66d8d89 Added man page for rem script.
Added more tests.
2007-08-30 21:57:30 -04:00
David F. Skoll
3ba39b6efe Add "rem" Perl script. 2007-08-30 17:33:26 -04:00
David F. Skoll
c656a1a169 Make SPECIAL COLOR always output color triplet in calendar mode even with %"%" escapes. 2007-08-30 15:40:25 -04:00
David F. Skoll
19f03e419a Fix test.cmp for new version. 2007-08-22 20:32:49 -04:00
64 changed files with 5320 additions and 5153 deletions

15
.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
*.bak
autom4te.cache
config.log
config.status
src/Makefile
www/Makefile
*.o
src/config.h
src/remind
src/*.tar.gz*
tests/test.out
.gitignore
*~
src/rem2ps
src/version.h

View File

@@ -3,7 +3,7 @@ THE REMIND COPYRIGHT
1. REMIND refers to the entire set of files and documentation in the 1. REMIND refers to the entire set of files and documentation in the
REMIND package. REMIND package.
2. REMIND is Copyright 1999-2005 Roaring Penguin Software Inc., 2. REMIND is Copyright 1999-2007 Roaring Penguin Software Inc.,
except where noted in individual files. except where noted in individual files.
3. DISTRIBUTION AND USE 3. DISTRIBUTION AND USE

View File

@@ -24,9 +24,14 @@ clean:
find . -name '*~' -exec rm {} \; find . -name '*~' -exec rm {} \;
cd src; $(MAKE) clean cd src; $(MAKE) clean
test:
cd src && $(MAKE) test
distclean: clean distclean: clean
rm -f config.cache config.log config.status src/Makefile src/config.h tests/test.out rm -f config.cache config.log config.status src/Makefile src/config.h tests/test.out www/Makefile
src/Makefile: src/Makefile.in src/Makefile: src/Makefile.in
./configure ./configure
# DO NOT DELETE # DO NOT DELETE

120
build.tk
View File

@@ -41,6 +41,8 @@ proc SetConfigDefaults {} {
set Config(NORTHERN_HEMISPHERE) 1 set Config(NORTHERN_HEMISPHERE) 1
set Config(WESTERN_HEMISPHERE) 1 set Config(WESTERN_HEMISPHERE) 1
set Config(LANGUAGE) "English" set Config(LANGUAGE) "English"
set Config(INST_DIR) "/usr/local/bin"
set Config(MAN_DIR) "/usr/local/man"
} }
#*********************************************************************** #***********************************************************************
@@ -97,7 +99,7 @@ proc CreateMainDialog {} {
destroy .c destroy .c
update idletasks update idletasks
SetConfigDefaults SetConfigFromRemind
tabnotebook_create .tn tabnotebook_create .tn
set Instdir [tabnotebook_page .tn "Installation Directories"] set Instdir [tabnotebook_page .tn "Installation Directories"]
@@ -128,13 +130,14 @@ proc CreateMainDialog {} {
# Creates the "installation directories" dialog. # Creates the "installation directories" dialog.
#*********************************************************************** #***********************************************************************
proc CreateInstallDirDialog { w } { proc CreateInstallDirDialog { w } {
global Config
label $w.binlabel -text "Location for programs: " label $w.binlabel -text "Location for programs: "
entry $w.bin -width 30 entry $w.bin -width 30
$w.bin insert end "/usr/local/bin" $w.bin insert end $Config(INST_DIR)
label $w.manlabel -text "Location for man pages: " label $w.manlabel -text "Location for man pages: "
entry $w.man -width 30 entry $w.man -width 30
$w.man insert end "/usr/local/man" $w.man insert end $Config(MAN_DIR)
text $w.blurb -width 1 -height 5 -wrap word -relief flat -takefocus 0 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 insert end "\n(Tabbed-notebook Tcl code taken from \"Effective Tcl/Tk Programming\" by Mark Harrison and Michael McLennan, Addison-Wesley Professional Computing Series.)"
@@ -863,10 +866,121 @@ proc doLogo {} {
.c create text 4 28 -anchor nw -text "http://www.roaringpenguin.com" \ .c create text 4 28 -anchor nw -text "http://www.roaringpenguin.com" \
-fill red -font {-family courier -size -14 -weight bold} -fill red -font {-family courier -size -14 -weight bold}
set rem [FindRemind]
if {$rem != ""} {
.c create text 4 52 -anchor nw -text "Found existing Remind... reusing settings" -fill red -font {-family courier -size -14 -weight bold}
.c create text 4 66 -anchor nw -text "from $rem" -fill red -font {-family courier -size -14 -weight bold}
}
update idletasks update idletasks
after 2500 after 2500
} }
#***********************************************************************
# %PROCEDURE: FindRemind
# %ARGUMENTS:
# None
# %RETURNS:
# Full path to an existing "remind" if one is found. Otherwise,
# empty string.
#***********************************************************************
proc FindRemind {} {
global env
set path [concat [split $env(PATH) ":"] "/bin" "/usr/bin" "/usr/local/bin"]
foreach thing $path {
if [file executable [file join $thing "remind"]] {
return [file join $thing "remind"]
}
}
return {}
}
#***********************************************************************
# %PROCEDURE: SetConfigFromRemind
# %ARGUMENTS:
# None
# %RETURNS:
# Sets config settings based on existing remind (if one found) or else
# sensible defaults.
#***********************************************************************
proc SetConfigFromRemind {} {
global Config
SetConfigDefaults
set rem [FindRemind]
if {"$rem" == ""} {
return
}
set dir [file dirname $rem]
set Config(INST_DIR) $dir
if {"$dir" == "/usr/local/bin"} {
set Config(MAN_DIR) "/usr/local/man"
} elseif {$dir == "/usr/bin"} {
set Config(MAN_DIR) "/usr/share/man"
}
# Check for existing man page
if {[file readable "/usr/share/man/man1/remind.1"]} {
set Config(MAN_DIR) "/usr/share/man"
} elseif {[file readable "/usr/man/man1/remind.1"]} {
set Config(MAN_DIR) "/usr/man"
} elseif {[file readable "/usr/local/man/man1/remind.1"]} {
set Config(MAN_DIR) "/usr/local/man"
}
# Query Remind for the rest
QueryRemind $rem LAT_DEG {$LatDeg}
QueryRemind $rem LAT_MIN {$LatMin}
QueryRemind $rem LON_DEG {$LongDeg}
QueryRemind $rem LON_MIN {$LongMin}
QueryRemind $rem LOCATION {$Location}
QueryRemind $rem DATESEP {$DateSep}
QueryRemind $rem TIMESEP {$TimeSep}
QueryRemind $rem LANGUAGE {language()}
set $Config(LAT_MIN) [expr abs($Config(LAT_MIN))]
if {$Config(LAT_DEG) >= 0} {
set Config(NORTHERN_HEMISPHERE) 1
} else {
set Config(NORTHERN_HEMISPHERE) 0
set Config(LAT_DEG) [expr abs($Config(LAT_DEG))]
}
set $Config(LON_MIN) [expr abs($Config(LON_MIN))]
if {$Config(LON_DEG) >= 0} {
set Config(WESTERN_HEMISPHERE) 1
} else {
set Config(WESTERN_HEMISPHERE) 0
set Config(LON_DEG) [expr abs($Config(LON_DEG))]
}
# Get default page from rem2ps
set rem2ps [file join $dir "rem2ps"]
catch {
exec $rem2ps -m help
} err
set errlist [split $err "\n"]
set err [lindex $errlist end]
if {[string match "Default media type is*" $err]} {
set Config(DEFAULT_PAGE) [lindex $err end]
}
}
proc QueryRemind { rem symbol rem_msg } {
global Config
catch {
set fp [open "| $rem -" "r+"]
puts $fp "banner %\nMSG \[$rem_msg\]%\nFLUSH\n"
flush $fp
gets $fp line
catch { close $fp }
}
if {"$line" == ""} {
return
}
set Config($symbol) $line
}
CheckSanity CheckSanity
CreateMainDialog CreateMainDialog

5301
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -45,4 +45,6 @@ if test "$GCC" = yes; then
fi fi
AC_CHECK_FUNCS(setenv unsetenv) AC_CHECK_FUNCS(setenv unsetenv)
AC_OUTPUT(src/Makefile) VERSION=03.01.04
AC_SUBST(VERSION)
AC_OUTPUT(src/Makefile www/Makefile src/version.h)

View File

@@ -1,6 +1,98 @@
CHANGES TO REMIND CHANGES TO REMIND
* Version 3.1 Patch 1 - 23 August 2007 * Version 3.1 Patch 4 - 2008-02-03
- ENHANCMENT: tkremind respects the "-b1" option and operates in 24-hour
clock mode if the option is supplied.
- ENHANCEMENT: tkremind has been tweaked to look better with Tcl/Tk 8.5.
- CLEANUP: Version is kept only in configure.in instead of two different
places.
- CLEANUP: Added "const" qualifier to many places in the code that previously
lacked it.
- BUG FIX: A rare parsing error involving interaction between SATISFY and
SKIP has been fixed.
- BUG FIX: rem2html would output a horribly-wrong calendar for a 28-day
February starting on Sunday (such as February 2009.) This has been fixed.
* Version 3.1 Patch 3 - 2007-10-15
+ MINOR ENHANCEMENTS
- rem2html now uses CSS for a much better-looking calendar.
NOTE: rem2html was completely rewritten and some of the command-line
options have changed!
- If a reminder has a DURATION clause, then the starting and ending times
are output in calendar mode.
+ BUG FIXES
- DST rules in "defs.rem" were updated to reflect new US/Canadian DST rules.
- If a REM command cannot compute a trigger date, the SATISFY expression
is not evaluated. This helps avoid spurious error messages in some
reminders.
* Version 3.1 Patch 2 - 2007-09-12
+ MINOR ENHANCEMENTS
- build.tk tries to set defaults for location, paper size, etc from an
existing "remind" installation if it detects one.
- In queue mode, wake up once a minute and recalibrate sleep time.
This should make Remind work better on laptops that suspend or
hibernate. Note that "remind -q" does *not* handle date-rollover
well; it simply exits if it notices date rollover. "remind -z0"
(as used by tkremind) handles date rollover properly; it rereads the
reminder file and rebuilds the queue if it notices date rollover.
- tkremind: Added some key bindings to make navigation easier.
- tkremind: Made calendar boxes use space more efficiently.
- remind: The functionality of "rem" is now built into remind. If you
invoke remind as "rem", then it uses a default filename. The installer
sets up "rem" as a symbolic link to "remind".
+ CHANGE
- "remind -p" no longer sorts SPECIAL reminders before non-SPECIAL.
*** THIS MAY AFFECT BACKENDS ***
Backends supplied by Roaring Penguin (rem2ps, rem2html and tkremind)
are known to work properly.
- "remind -p" no longer suppresses any AT-time associated with SPECIAL
reminders.
*** THIS MAY AFFECT BACKENDS ***
Backends supplied by Roaring Penguin (rem2ps, rem2html and tkremind)
are known to work properly.
+ BUG FIXES
- examples/defs.rem: A few corrections to Jewish holidays courtesy of
Art Werschulz.
- src/Makefile.in: Added install-nostripped target.
- SPECIAL COLOR now works more like MSG, including proper support for AT and
for the %" %" escape sequence.
- SPECIAL COLOR is queued correctly if it has an AT clause.
- Using the psshade() or psmoon() functions emits a warning on stderr. You
should use SPECIAL SHADE or SPECIAL MOON instead.
* Version 3.1 Patch 1 - 2007-08-23
+ MAJOR ENHANCEMENTS + MAJOR ENHANCEMENTS
@@ -30,7 +122,7 @@ CHANGES TO REMIND
- Various man-page fixes. - Various man-page fixes.
* Version 3.1 Patch 0 - 14 August 2007 * Version 3.1 Patch 0 - 2007-07-14
+ MAJOR ENHANCEMENTS + MAJOR ENHANCEMENTS
@@ -93,7 +185,7 @@ CHANGES TO REMIND
- rem2ps would produce invalid PostScript in some rare cases - rem2ps would produce invalid PostScript in some rare cases
(eg, for February 2007). This has been fixed. (eg, for February 2007). This has been fixed.
* Version 3.0 Patch 24 * Version 3.0 Patch 24 - 2005-11-19
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -116,7 +208,7 @@ CHANGES TO REMIND
- Fixed a bug in the tokenizer that could make Remind segfault. Fix courtesy - Fixed a bug in the tokenizer that could make Remind segfault. Fix courtesy
of Stan Tobias. of Stan Tobias.
* Version 3.0 Patch 23 * Version 3.0 Patch 23 - 2005-04-14
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -140,7 +232,7 @@ CHANGES TO REMIND
- Fixed parser error for unterminated date constant: '2005/01/01 - Fixed parser error for unterminated date constant: '2005/01/01
* Version 3.0 Patch 22 * Version 3.0 Patch 22 - 2000-06-16
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -162,7 +254,7 @@ CHANGES TO REMIND
- Fixed serious bug in which background queued reminders were ignored and - Fixed serious bug in which background queued reminders were ignored and
Remind simply exited. Doh! Sorry about that. Remind simply exited. Doh! Sorry about that.
* Version 3.0 Patch 21 * Version 3.0 Patch 21 - 2000-03-15
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -193,7 +285,7 @@ CHANGES TO REMIND
- Fixed compilation problem on FreeBSD, IRIX, Tru64 and other UNIXes. - Fixed compilation problem on FreeBSD, IRIX, Tru64 and other UNIXes.
* Version 3.0 Patch 20 * Version 3.0 Patch 20 - 1999-04-12
+ NEWS + NEWS
@@ -222,7 +314,7 @@ CHANGES TO REMIND
- Fixed a typo in danish.h, courtesy of Niels Kristian Bech Jensen. - Fixed a typo in danish.h, courtesy of Niels Kristian Bech Jensen.
* Version 3.0 Patch 19 * Version 3.0 Patch 19 - 1998-05-09
+ MAJOR ENHANCEMENTS + MAJOR ENHANCEMENTS
@@ -264,7 +356,7 @@ CHANGES TO REMIND
- Lots more silly little bugs squashed -- too many to go into in - Lots more silly little bugs squashed -- too many to go into in
detail. detail.
* Version 3.0 Patch 18 * Version 3.0 Patch 18 - 1998-02-15
+ MAJOR ENHANCEMENTS + MAJOR ENHANCEMENTS
@@ -328,7 +420,7 @@ CHANGES TO REMIND
- Getting rid of fixed-sized buffers meant lots of changes to code. - Getting rid of fixed-sized buffers meant lots of changes to code.
No doubt, I missed a few regression tests. No doubt, I missed a few regression tests.
* Version 3.0 Patch 17 * Version 3.0 Patch 17 - 1997-09-07
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -369,7 +461,7 @@ CHANGES TO REMIND
library. All three of these fixes are courtesy of Christopher library. All three of these fixes are courtesy of Christopher
J. Madsen <madsen@iglobal.net>. Thanks, Christopher. J. Madsen <madsen@iglobal.net>. Thanks, Christopher.
* Version 3.0 Patch 16 * Version 3.0 Patch 16 - 1997-02-11
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -397,7 +489,7 @@ CHANGES TO REMIND
- Fixed a problem under Solaris 2.5 whereby rem2ps was skipping some - Fixed a problem under Solaris 2.5 whereby rem2ps was skipping some
latin1 characters which it interpreted as white space. latin1 characters which it interpreted as white space.
* Version 3.0 Patch 15 * Version 3.0 Patch 15 - 1996-10-27
+ IMPORTANT NOTES + IMPORTANT NOTES
@@ -427,7 +519,7 @@ CHANGES TO REMIND
- Fixed bug in TkRemind which caused a crash if the "-m" option was used - Fixed bug in TkRemind which caused a crash if the "-m" option was used
for a month beginning on Sunday. Doh!!! for a month beginning on Sunday. Doh!!!
* Version 3.0 Patch 14 * Version 3.0 Patch 14 - 1996-05-25
+ CHANGE IN COPYING POLICY + CHANGE IN COPYING POLICY
@@ -486,7 +578,7 @@ CHANGES TO REMIND
_not_ support MS Windows, and in fact do not allow Remind to run _not_ support MS Windows, and in fact do not allow Remind to run
under Windows (see COPYRIGHT). under Windows (see COPYRIGHT).
* Version 3.0 Patch 13 * Version 3.0 Patch 13 - 1994-05-06
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -521,7 +613,7 @@ CHANGES TO REMIND
- Updated the copyright notices everywhere. - Updated the copyright notices everywhere.
* Version 3.0 Patch 12 * Version 3.0 Patch 12 - 1994-02-01
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -540,7 +632,7 @@ CHANGES TO REMIND
- Fixed a problem with the '-k' option which resulted in a newline being - Fixed a problem with the '-k' option which resulted in a newline being
placed after the message text. This was giving sh(1) heartburn... placed after the message text. This was giving sh(1) heartburn...
* Version 3.0 Patch 11 * Version 3.0 Patch 11 - 1993-11-26
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -620,7 +712,7 @@ CHANGES TO REMIND
- Fixed the Finnish language support which was missing a few newlines. - Fixed the Finnish language support which was missing a few newlines.
* Version 3.0 Patch 9 * Version 3.0 Patch 9 - 1993-10-04
+ NOTES + NOTES
@@ -677,7 +769,7 @@ CHANGES TO REMIND
so that newlines in the body start new paragraphs, rather than being so that newlines in the body start new paragraphs, rather than being
swallowed as white-space. swallowed as white-space.
* Version 3.0 Patch 8 * Version 3.0 Patch 8 - 1993-09-08
+ MAJOR ENHANCEMENTS + MAJOR ENHANCEMENTS
@@ -729,7 +821,7 @@ CHANGES TO REMIND
range [-128, 255] (but not 0) so that char(asc(s)) works even range [-128, 255] (but not 0) so that char(asc(s)) works even
on machines with signed char types. on machines with signed char types.
* Version 3.0 Patch 7 * Version 3.0 Patch 7 - 1993-07-22
+ MAJOR ENHANCEMENTS + MAJOR ENHANCEMENTS
@@ -772,7 +864,7 @@ CHANGES TO REMIND
- Changed kall so that "kall sh" doesn't commit suicide - patch courtesy - Changed kall so that "kall sh" doesn't commit suicide - patch courtesy
of Michael Salmon. of Michael Salmon.
* Version 3.0 Patch 6 * Version 3.0 Patch 6 - 1993-05-05
+ MINOR ENHANCEMENTS + MINOR ENHANCEMENTS
@@ -795,7 +887,7 @@ CHANGES TO REMIND
- Fixed a bug in the -u option which sometimes caused a core dump - Fixed a bug in the -u option which sometimes caused a core dump
(embarrassed grin!) The fix is due to Tina Hoeltig. Thanks, Tina! (embarrassed grin!) The fix is due to Tina Hoeltig. Thanks, Tina!
* Version 3.0 Patch 5 * Version 3.0 Patch 5 - 1993-04-27
+ MAJOR ENHANCEMENTS: + MAJOR ENHANCEMENTS:
@@ -830,7 +922,7 @@ CHANGES TO REMIND
- Fixed a bug in the man page - thanks to Ed Oskiewicz. - Fixed a bug in the man page - thanks to Ed Oskiewicz.
* Version 3.0 Patch 4 * Version 3.0 Patch 4 - 1993-03-08
- Added the -g option - this sorts reminders by date/time before - Added the -g option - this sorts reminders by date/time before
issuing them. (You can see I'm running out of letters to issuing them. (You can see I'm running out of letters to
@@ -889,13 +981,13 @@ CHANGES TO REMIND
- Put my new mailing address in the README files. - Put my new mailing address in the README files.
* Version 3.0 Patch 3 * Version 3.0 Patch 3 - 1993-02-21
- Corrected bugs in Remind and Rem2PS. No new features added. You - Corrected bugs in Remind and Rem2PS. No new features added. You
should NOT use patch level 2 - either stick to 3.0.1 or upgrade to should NOT use patch level 2 - either stick to 3.0.1 or upgrade to
3.0.3. 3.0.3.
* Version 3.0 Patch 2 * Version 3.0 Patch 2 - 1993-02-04
- Added the -u option to Remind so that root can run it as any user. - Added the -u option to Remind so that root can run it as any user.
This simplifies the remind-all scripts, and makes them more efficient. This simplifies the remind-all scripts, and makes them more efficient.
@@ -935,7 +1027,7 @@ CHANGES TO REMIND
- Changed Remind so that supplying the -a option causes timed reminders - Changed Remind so that supplying the -a option causes timed reminders
not to be placed into the calendar in calendar mode. not to be placed into the calendar in calendar mode.
* Version 3.0 Patch 1 * Version 3.0 Patch 1 - 1992-12-18
- Wrote the Rem2ps program to produce PostScript calendars - Wrote the Rem2ps program to produce PostScript calendars
@@ -975,7 +1067,7 @@ CHANGES TO REMIND
- Re-formatted the WHATSNEW.30 file. - Re-formatted the WHATSNEW.30 file.
* Version 3.0 * Version 3.0 - 1992-11-09
- Total rewrite from previous versions - Total rewrite from previous versions
@@ -996,23 +1088,23 @@ CHANGES TO REMIND
- Fixed a lurking bug in trigger date calculation which, amazingly, had not - Fixed a lurking bug in trigger date calculation which, amazingly, had not
been caught in the couple of years that Remind has been out! been caught in the couple of years that Remind has been out!
* Version 2.3 Patch 5 * Version 2.3 Patch 5 - 1992-04-11
- Added the "c+n" option for printing a calendar by - Added the "c+n" option for printing a calendar by
weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil). weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
* Version 2.3 Patch 4 * Version 2.3 Patch 4 - 1991-11-06
- Made the init.c file nicer. Made the Makefile - Made the init.c file nicer. Made the Makefile
prettier. Added "make test", "make tar" and "make shar" Makefile targets. prettier. Added "make test", "make tar" and "make shar" Makefile targets.
* Version 2.3 Patch 3 * Version 2.3 Patch 3 - 1991-09-11
- Added a command-line option for Remind to process - Added a command-line option for Remind to process
queued reminders in the foreground. This makes automatic termination queued reminders in the foreground. This makes automatic termination
of Remind processes from within X-Windows and Sunview easier. of Remind processes from within X-Windows and Sunview easier.
* Version 2.3 Patch 2 * Version 2.3 Patch 2 - 1991-07-19
- Fixed up a problem with timed reminders which resulted - Fixed up a problem with timed reminders which resulted
in cursor not starting from left side of screen on some systems. in cursor not starting from left side of screen on some systems.
@@ -1029,7 +1121,7 @@ CHANGES TO REMIND
- Made the Makefile more portable - Made the Makefile more portable
* Version 2.3 Patch 1 * Version 2.3 Patch 1 - 1991-03-08
- Added the "-t" command-line option to get Remind - Added the "-t" command-line option to get Remind
to trigger all non-expired reminders. to trigger all non-expired reminders.
@@ -1043,7 +1135,7 @@ CHANGES TO REMIND
- Added manual pages for "kall" and "rem". - Added manual pages for "kall" and "rem".
* Version 2.3 * Version 2.3 - 1991-02-20
- Added the UNTIL keyword for forcing reminders to expire. - Added the UNTIL keyword for forcing reminders to expire.
@@ -1065,28 +1157,28 @@ CHANGES TO REMIND
- Modified the calendar and SimpleCalendar formats so that the % escape - Modified the calendar and SimpleCalendar formats so that the % escape
substitutions ARE performed. substitutions ARE performed.
* Version 2.2 - Patch 5 * Version 2.2 - Patch 5 - 1990-12-03
- Added the BEFORE, AFTER and SKIP tokens to make the - Added the BEFORE, AFTER and SKIP tokens to make the
handling of holidays more sensible. Also corrected a few more bugs. handling of holidays more sensible. Also corrected a few more bugs.
* Version 2.2 - Patch 3 * Version 2.2 - Patch 3 - 1990-11-28
- Added the MSG or RUN tokens in an OMIT command; also - Added the MSG or RUN tokens in an OMIT command; also
allowed RUN-type reminders to be explicitly included in the calendar by allowed RUN-type reminders to be explicitly included in the calendar by
using the %" escape sequence. using the %" escape sequence.
* Version 2.2 * Version 2.2 - 1990-11-16
- Added the AT keyword, the timed reminders daemon, and the - Added the AT keyword, the timed reminders daemon, and the
calendar facility. calendar facility.
* Version 2.1 * Version 2.1 - 1990-11-06
- Added the "repeat" token for repeating reminders with a period - Added the "repeat" token for repeating reminders with a period
other than 7 days. Also fixed some bugs from version 2.0 other than 7 days. Also fixed some bugs from version 2.0
* Version 2.0 * Version 2.0 - 1990-11-01
- first public release. Included advanced date specifications, - first public release. Included advanced date specifications,
character substitution, and the RUN keyword. character substitution, and the RUN keyword.

View File

@@ -27,8 +27,8 @@ RUN OFF
################################################ ################################################
# Ensure required version of remind is used... # # Ensure required version of remind is used... #
################################################ ################################################
IF version() < "03.00.19" IF version() < "03.01.02"
ERRMSG This file requires at least version 03.00.19 of Remind.% ERRMSG This file requires at least version 03.01.02 of Remind.%
ERRMSG This version is version [version()]. ERRMSG This version is version [version()].
EXIT EXIT
ENDIF ENDIF
@@ -93,7 +93,7 @@ SET Week_1 1
SET Week_2 8 SET Week_2 8
SET Week_3 15 SET Week_3 15
SET Week_4 22 SET Week_4 22
FSET _last(mo) "1 " + MON((mo%12)+1)+" --7" FSET _last(mo) "1 " + MON((mo%12)+1) + " --7"
# Shorthand for commonly used expression... # Shorthand for commonly used expression...
FSET _trig() TRIGGER(TRIGDATE()) FSET _trig() TRIGGER(TRIGDATE())
@@ -101,46 +101,6 @@ FSET _trig() TRIGGER(TRIGDATE())
# Handy function to provide SCANFROM dates... # Handy function to provide SCANFROM dates...
FSET _back(days) TRIGGER(TODAY()-days) FSET _back(days) TRIGGER(TODAY()-days)
###########################################################
# On MS-DOS systems, the standard C library functions are #
# not reliable for computing offsets from local time to #
# UTC. The following provides a work-around for the #
# sunrise() and sunset() functions. Note, however, that #
# if Daylight Savings Time is in effect for today(), the #
# sun functions return times in DST even for dates on #
# which DST is not in effect; the converse can also occur.#
# #
# Change the timezone to your timezone - the default is #
# for EST which is 5 hours (300 minutes) behind UTC. #
# The code is correct for places in which Daylight Savings#
# Time begins on the last Sunday in April and ends on the #
# last Sunday in October. #
###########################################################
IF OSTYPE() == "MSDOS"
# Eastern Standard Time
SET TimeZone -300
# Use --8 rather than --7 because we want the last day BEFORE
# the time switch occurs.
REM Sun 1 May --8 SATISFY 1
SET BegDst TRIGDATE()
REM Sun 1 Nov --8 SATISFY 1
SET EndDst TRIGDATE()
SET $CalcUTC 0
# Check out the following IF statement and figure out why it works!
IF EndDst < BegDst
# Daylight Savings Time
SET $MinsFromUTC TimeZone+60
ELSE
# Standard Time
SET $MinsFromUTC TimeZone
ENDIF
ENDIF
########################################################### ###########################################################
# Function which returns a string in "am/pm" format based # # Function which returns a string in "am/pm" format based #
# on the time. For example, set a am_pm(NOW())... # # on the time. For example, set a am_pm(NOW())... #
@@ -347,7 +307,12 @@ REM Feb 14 MSG %"Valentine's%" Day
REM Mon Feb [Week_3] SCANFROM [_back(7)] SATISFY 1 REM Mon Feb [Week_3] SCANFROM [_back(7)] SATISFY 1
OMIT [_trig()] MSG %"President's Day%" OMIT [_trig()] MSG %"President's Day%"
REM Mar 17 MSG %"St. Patrick's%" Day REM Mar 17 MSG %"St. Patrick's%" Day
REM Sun Apr 1 ++2 MSG Daylight Savings Time - %"DST starts%" %b
# The DST rules are accurate for most locations in
# North America
REM Sun Apr 1 ++2 UNTIL 1 Jan 2007 MSG Daylight Savings Time - %"DST starts%" %b
REM Sun Mar 8 ++2 FROM 1 Jan 2007 MSG Daylight Savings Time - %"DST starts%" %b
REM Apr 1 MSG %"April Fool's%" Day REM Apr 1 MSG %"April Fool's%" Day
REM Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due REM Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
REM May 5 MSG %"Cinco de Mayo%" REM May 5 MSG %"Cinco de Mayo%"
@@ -362,7 +327,12 @@ REM Mon Sep [Week_1] SCANFROM [_back(7)] SATISFY 1
OMIT [_trig()] MSG %"Labor Day%" OMIT [_trig()] MSG %"Labor Day%"
REM Mon Oct [Week_2] MSG %"Columbus Day%" REM Mon Oct [Week_2] MSG %"Columbus Day%"
REM Nov 11 MSG %"Veterans Day%" REM Nov 11 MSG %"Veterans Day%"
REM Sun [_last(Oct)] MSG Daylight Savings Time - %"DST over%"
# The DST rules are accurate for most locations in
# North America
REM Sun [_last(Oct)] UNTIL 1 Jan 2007 MSG Daylight Savings Time - %"DST over%"
REM Sun 1 Nov FROM 1 Jan 2007 MSG Daylight Savings Time - %"DST over%"
REM Oct 30 MSG %"Mischief Night%" REM Oct 30 MSG %"Mischief Night%"
REM Oct 31 MSG %"Halloween%" REM Oct 31 MSG %"Halloween%"
REM Tue Nov 2 SCANFROM [_back(7)] \ REM Tue Nov 2 SCANFROM [_back(7)] \
@@ -490,7 +460,7 @@ IF !InIsrael
[_h(16, "Tishrey")] MSG %"Sukkot 2%" [_h(16, "Tishrey")] MSG %"Sukkot 2%"
ENDIF ENDIF
[_h(21, "Tishrey")] ++4 MSG %"Hashana Rabba%" is %b. [_h(21, "Tishrey")] ++4 MSG %"Hoshana Rabba%" is %b.
[_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b. [_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b.
IF InIsrael IF InIsrael
@@ -518,7 +488,8 @@ IF !Reform
ENDIF ENDIF
[_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b. [_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b.
[_h(15, "Adar A")] ++4 MSG %"Purim Katan%" is %b. [_h(14, "Adar A")] ++4 MSG %"Purim Katan%" is %b.
[_h(15, "Adar A")] ++4 MSG %"Shushan Purim Katan%" is %b.
# If Purim is on Sunday, then Fast of Esther is 11 Adar. # If Purim is on Sunday, then Fast of Esther is 11 Adar.
IF WKDAYNUM(_h2(13, "Adar")) != 6 IF WKDAYNUM(_h2(13, "Adar")) != 6
@@ -527,6 +498,7 @@ ELSE
REM [TRIGGER(_h2(11, "Adar"))] ++4 MSG %"Fast of Esther%" is %b. REM [TRIGGER(_h2(11, "Adar"))] ++4 MSG %"Fast of Esther%" is %b.
ENDIF ENDIF
[_h(14, "Adar")] ++4 MSG %"Purim%" is %b. [_h(14, "Adar")] ++4 MSG %"Purim%" is %b.
[_h(15, "Adar")] ++4 MSG %"Shushan Purim%" is %b.
[_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b. [_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b.
IF !InIsrael IF !InIsrael

20
man/rem.1 Normal file
View File

@@ -0,0 +1,20 @@
.TH REM 1 "30 August 2007"
.UC4
.SH NAME
rem \- Invoke Remind with a default filename
.SH SYNOPSIS
.B rem [\fIoptions\fR] [\fIdate\fR] [\fI*rep\fR] [\fItime\fR]
.SH DESCRIPTION
\fBrem\fR is a symbolic link to \fBremind\fR. When \fBremind\fR
determines that it has been invoked as \fBrem\fR, it uses a default
filename rather than expecting a filename to be supplied on the command
line.
.PP
If the environment variable DOTREMINDERS is set, \fBremind\fR uses the
value of DOTREMINDERS as the filename. Otherwise, \fBremind\fR uses
the filename $HOME/.reminders
.PP
.SH AUTHOR
Remind was written by David F. Skoll <dfs@roaringpenguin.com>
.SH SEE ALSO
\fBremind\fR

View File

@@ -407,4 +407,4 @@ You should ensure that the values you supply for margin widths are sensible.
If they are too big for the media size, \fBRem2ps\fR will not complain, If they are too big for the media size, \fBRem2ps\fR will not complain,
but again, the PostScript output will probably not work. but again, the PostScript output will probably not work.
.SH SEE ALSO .SH SEE ALSO
\fBRemind\fR \fBremind\fR

View File

@@ -2317,12 +2317,13 @@ If three arguments are supplied, returns \fIstr1\fR if \fInum\fR is 1, and
.RE .RE
.TP .TP
.B psmoon(i_phase [,i_size [,s_note [,i_notesize]]]) .B psmoon(i_phase [,i_size [,s_note [,i_notesize]]])
Returns a \fBSTRING\fR consisting of PostScript code to draw a moon in [DEPRECATED] Returns a \fBSTRING\fR consisting of PostScript code to
the upper-left hand corner of the calendar box. \fIPhase\fR specifies draw a moon in the upper-left hand corner of the calendar box.
the phase of the moon, and is 0 (new moon), 1 (first quarter), 2 (full \fIPhase\fR specifies the phase of the moon, and is 0 (new moon), 1
moon) or 3 (third quarter). If \fIsize\fR is specified, it controls (first quarter), 2 (full moon) or 3 (third quarter). If \fIsize\fR is
the radius of the moon in PostScript units (1/72 inch.) If it is not specified, it controls the radius of the moon in PostScript units
specified or is negative, the size of the day-number font is used. (1/72 inch.) If it is not specified or is negative, the size of the
day-number font is used.
.PP .PP
.PP .PP
.RS .RS
@@ -2353,7 +2354,7 @@ Note how the time is coerced to a string by concatenating the null string.
.RE .RE
.TP .TP
\fBpsshade(i_gray)\fR or \fBpsshade(i_red, i_green, i_blue)\fR \fBpsshade(i_gray)\fR or \fBpsshade(i_red, i_green, i_blue)\fR
Returns a \fBSTRING\fR that consists of PostScript commands to [DEPRECATED] Returns a \fBSTRING\fR that consists of PostScript commands to
shade a calendar box. \fINum\fR can range from 0 (completely black) shade a calendar box. \fINum\fR can range from 0 (completely black)
to 100 (completely white.) If three arguments are given, they specify to 100 (completely white.) If three arguments are given, they specify
red, green and blue intensity from 0 to 100. red, green and blue intensity from 0 to 100.
@@ -3243,12 +3244,6 @@ You should not have any spaces between the \fB\-i\fR option and the equal
sign; otherwise, strange variable names are created that can only be accessed sign; otherwise, strange variable names are created that can only be accessed
with the \fBvalue()\fR or \fBdefined()\fR functions. with the \fBvalue()\fR or \fBdefined()\fR functions.
.PP .PP
If your site uses the \fBRemind-all\fR shell script to mail reminders
to users, the script will initialize the variable \fIremind_all\fR to 1
using the \fB\-i\fR option. Thus, you can detect when your reminder
script is being processed by \fBRemind-all\fR and can use this information
to control which reminders you want mailed to you.
.PP
.SH MORE ABOUT POSTSCRIPT .SH MORE ABOUT POSTSCRIPT
.PP .PP
The \fBPS\fR and \fBPSFILE\fR reminders pass PostScript code directly The \fBPS\fR and \fBPSFILE\fR reminders pass PostScript code directly
@@ -4043,4 +4038,4 @@ Catalog\fR, Jewish Publication Society of America.
.PP .PP
.SH SEE ALSO .SH SEE ALSO
.PP .PP
rem2ps, tkremind rem, rem2ps, tkremind

View File

@@ -21,6 +21,8 @@ extra features as you become a more sophisticated \fBRemind\fR programmer.
on to \fBRemind\fR. The options it passes are 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. \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. See the \fBRemind\fR man page for details about the options.
Note that \fBTkRemind\fR will respect the \fB\-m\fR and
\fB\-b1\fR options and adjust its appearance accordingly.
\fIRead_file\fR is the file from which \fBTkRemind\fR reads reminders. \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 It is in standard \fBRemind\fR format. \fIWrite_file\fR is the file
@@ -235,6 +237,22 @@ press \fBApply Options\fR to put them into effect, \fBSave Options\fR
to put them into effect and save them in $HOME/.tkremindrc, or to put them into effect and save them in $HOME/.tkremindrc, or
\fBCancel\fR to cancel any changes you made. \fBCancel\fR to cancel any changes you made.
.SH KEYBOARD SHORTCUTS
\fBTkRemind\fR's main window includes the following keyboard shortcuts:
.TP
.B Ctrl-Q
Quit
.TP
.B Left Arrow
Previous Month
.TP
.B Right Arrow
Next Month
.TP
.B Home
Today
.SH ODDS AND ENDS .SH ODDS AND ENDS
\fBTkRemind\fR performs some basic consistency checks when you add or \fBTkRemind\fR performs some basic consistency checks when you add or
preview a reminder. However, if you edit a reminder in the previewer, preview a reminder. However, if you edit a reminder in the previewer,
@@ -268,7 +286,7 @@ for \fBTkRemind\fR (for example).
script file. It also places special comments in the reminder script file. It also places special comments in the reminder
file to store additional state. You can certainly mix file to store additional state. You can certainly mix
"hand-crafted" reminders with reminders created by \fBTkRemind\fR "hand-crafted" reminders with reminders created by \fBTkRemind\fR
if you are awared of the following rules and limitations: if you are aware of the following rules and limitations:
.TP .TP
o o
Do not use the \fBTAG\fR keyword in hand-crafted reminders. Do not use the \fBTAG\fR keyword in hand-crafted reminders.

View File

@@ -1,4 +1,4 @@
Files in this directory: Files in this directory:
tkremind -- Tcl/Tk graphical calendar using Remind as engine tkremind -- Tcl/Tk graphical calendar using Remind as engine
cm2rem.tcl -- Convert Sun's "cm" calendar manager files to Remind. cm2rem.tcl -- Convert Sun's "cm" calendar manager files to Remind.

View File

@@ -95,6 +95,9 @@ catch {set AppendFile $ReminderFile}
#---------------- DON'T CHANGE STUFF BELOW HERE ------------------ #---------------- DON'T CHANGE STUFF BELOW HERE ------------------
# 24-hour clock mode
set TwentyFourHourMode 0
# Is Monday in first column? # Is Monday in first column?
set MondayFirst 0 set MondayFirst 0
@@ -153,7 +156,7 @@ set HighestTagSoFar 0
proc Initialize {} { proc Initialize {} {
global DayNames argc argv CommandLine ReminderFile AppendFile Remind PSCmd global DayNames argc argv CommandLine ReminderFile AppendFile Remind PSCmd
global MondayFirst global MondayFirst TwentyFourHourMode
set CommandLine "|$Remind -itkremind=1 -p -y -l" set CommandLine "|$Remind -itkremind=1 -p -y -l"
set PSCmd "$Remind -p -l" set PSCmd "$Remind -p -l"
@@ -165,6 +168,9 @@ proc Initialize {} {
if {[regexp -- {m} [lindex $argv $i]]} { if {[regexp -- {m} [lindex $argv $i]]} {
set MondayFirst 1 set MondayFirst 1
} }
if {"[lindex $argv $i]" == "-b1"} {
set TwentyFourHourMode 1
}
} else { } else {
break break
} }
@@ -298,10 +304,8 @@ proc CreateCalFrame { w dayNames } {
set f [expr $n+$j] set f [expr $n+$j]
button $w.l$f -text "" -justify center -command "" \ button $w.l$f -text "" -justify center -command "" \
-state disabled -relief flat -border 0 -padx 0 -pady 0 -state disabled -relief flat -border 0 -padx 0 -pady 0
text $w.t$f -width 12 -height $h -border 1 -wrap word -relief flat \ text $w.t$f -width 12 -height $h -border 1 -spacing3 3 -wrap word -relief flat \
-state disabled -takefocus 0 -cursor {} -state disabled -takefocus 0 -cursor {}
$w.t$f tag bind TAGGED <Enter> "TaggedEnter $w.t$f"
$w.t$f tag bind TAGGED <Leave> "TaggedLeave $w.t$f"
$w.t$f tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$f" $w.t$f tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$f"
$w.t$f tag bind REM <ButtonPress-3> "FireEditor $w.t$f" $w.t$f tag bind REM <ButtonPress-3> "FireEditor $w.t$f"
@@ -331,10 +335,17 @@ proc CreateCalFrame { w dayNames } {
#*********************************************************************** #***********************************************************************
proc ConfigureCalFrame { w firstDay numDays } { proc ConfigureCalFrame { w firstDay numDays } {
global CurMonth CurYear TodayMonth TodayYear TodayDay global CurMonth CurYear TodayMonth TodayYear TodayDay
global tk_version
set offset [CalEntryOffset $firstDay] set offset [CalEntryOffset $firstDay]
set first [expr $offset+1] set first [expr $offset+1]
set last [expr $offset+$numDays] set last [expr $offset+$numDays]
if {$tk_version >= 8.5} {
set bg "#d9d9d9"
} else {
set bg [lindex [$w.t0 configure -background] 3]
}
for {set i 0} {$i < $first} {incr i} { for {set i 0} {$i < $first} {incr i} {
grid $w.l$i $w.t$i grid $w.l$i $w.t$i
$w.l$i configure -text "" -command "" -state disabled -relief flat $w.l$i configure -text "" -command "" -state disabled -relief flat
@@ -343,13 +354,11 @@ proc ConfigureCalFrame { w firstDay numDays } {
foreach t [$w.t$i tag names] { foreach t [$w.t$i tag names] {
$w.t$i tag delete $t $w.t$i tag delete $t
} }
$w.t$i tag bind TAGGED <Enter> "TaggedEnter $w.t$i"
$w.t$i tag bind TAGGED <Leave> "TaggedLeave $w.t$i"
$w.t$i tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i" $w.t$i tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i"
$w.t$i tag bind REM <ButtonPress-3> "FireEditor $w.t$i" $w.t$i tag bind REM <ButtonPress-3> "FireEditor $w.t$i"
$w.t$i configure -state disabled $w.t$i configure -state disabled
$w.t$i configure -background [lindex [$w.t$i configure -background] 3] $w.t$i configure -background $bg
$w.l$i configure -background [lindex [$w.l$i configure -background] 3] $w.l$i configure -background $bg
} }
for {set i $first} {$i <= $last} {incr i} { for {set i $first} {$i <= $last} {incr i} {
grid $w.l$i $w.t$i grid $w.l$i $w.t$i
@@ -361,13 +370,11 @@ proc ConfigureCalFrame { w firstDay numDays } {
foreach t [$w.t$i tag names] { foreach t [$w.t$i tag names] {
$w.t$i tag delete $t $w.t$i tag delete $t
} }
$w.t$i tag bind TAGGED <Enter> "TaggedEnter $w.t$i"
$w.t$i tag bind TAGGED <Leave> "TaggedLeave $w.t$i"
$w.t$i tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i" $w.t$i tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i"
$w.t$i tag bind REM <ButtonPress-3> "FireEditor $w.t$i" $w.t$i tag bind REM <ButtonPress-3> "FireEditor $w.t$i"
$w.t$i configure -state disabled $w.t$i configure -state disabled
$w.t$i configure -background [lindex [$w.t$i configure -background] 3] $w.t$i configure -background $bg
$w.l$i configure -background [lindex [$w.l$i configure -background] 3] $w.l$i configure -background $bg
} }
set forgetIt 0 set forgetIt 0
for {set i [expr $last+1]} {$i < 42} {incr i} { for {set i [expr $last+1]} {$i < 42} {incr i} {
@@ -388,13 +395,11 @@ proc ConfigureCalFrame { w firstDay numDays } {
foreach t [$w.t$i tag names] { foreach t [$w.t$i tag names] {
$w.t$i tag delete $t $w.t$i tag delete $t
} }
$w.t$i tag bind TAGGED <Enter> "TaggedEnter $w.t$i"
$w.t$i tag bind TAGGED <Leave> "TaggedLeave $w.t$i"
$w.t$i tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i" $w.t$i tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i"
$w.t$i tag bind REM <ButtonPress-3> "FireEditor $w.t$i" $w.t$i tag bind REM <ButtonPress-3> "FireEditor $w.t$i"
$w.t$i configure -state disabled $w.t$i configure -state disabled
$w.t$i configure -background [lindex [$w.t$i configure -background] 3] $w.t$i configure -background $bg
$w.l$i configure -background [lindex [$w.l$i configure -background] 3] $w.l$i configure -background $bg
} }
if { $CurMonth == $TodayMonth && $CurYear == $TodayYear } { if { $CurMonth == $TodayMonth && $CurYear == $TodayYear } {
set n [expr $TodayDay + $offset] set n [expr $TodayDay + $offset]
@@ -435,6 +440,13 @@ proc CreateCalWindow { dayNames } {
wm iconname . "" wm iconname . ""
wm protocol . WM_DELETE_WINDOW Quit wm protocol . WM_DELETE_WINDOW Quit
wm deiconify . wm deiconify .
bind . <Control-KeyPress-q> Quit
bind . <KeyPress-Left> ".b.prev flash; .b.prev invoke"
bind . <KeyPress-Right> ".b.next flash; .b.next invoke"
bind . <KeyPress-Prior> ".b.prev flash; .b.prev invoke"
bind . <KeyPress-Next> ".b.next flash; .b.next invoke"
bind . <KeyPress-Home> ".b.this flash; .b.this invoke"
if {$Option(StartIconified)} { if {$Option(StartIconified)} {
wm iconify . wm iconify .
} }
@@ -701,10 +713,6 @@ proc FillCalWindow {} {
ConfigureCalWindow $monthName $year $firstWkday $daysInMonth ConfigureCalWindow $monthName $year $firstWkday $daysInMonth
set offset [CalEntryOffset $firstWkday] set offset [CalEntryOffset $firstWkday]
for {set i 1} {$i <= 31} {incr i} {
set didSomething($i) 0
}
set fntag "x" set fntag "x"
while { [gets $file line] >= 0 } { while { [gets $file line] >= 0 } {
# File info # File info
@@ -763,12 +771,10 @@ proc FillCalWindow {} {
continue continue
} }
.cal.t$n configure -state normal .cal.t$n configure -state normal
if { $didSomething($day) } {
.cal.t$n insert end " .....\n"
}
set didSomething($day) 1
if {[regexp {TKTAG([0-9]+)} $tag all tagno]} { if {[regexp {TKTAG([0-9]+)} $tag all tagno]} {
.cal.t$n insert end [string trim $stuff] [list REM TAGGED "TKTAG$tagno" $extratags $fntag] .cal.t$n insert end [string trim $stuff] [list REM TAGGED "TKTAG$tagno" $extratags $fntag]
.cal.t$n tag bind "TKTAG$tagno" <Enter> "TaggedEnter .cal.t$n"
.cal.t$n tag bind "TKTAG$tagno" <Leave> "TaggedLeave .cal.t$n"
} else { } else {
.cal.t$n insert end [string trim $stuff] [list REM $extratags $fntag] .cal.t$n insert end [string trim $stuff] [list REM $extratags $fntag]
} }
@@ -1074,7 +1080,7 @@ proc CreateModifyDialog {w day firstDay args} {
# Set up: Year, Month, Day, WeekdayName # Set up: Year, Month, Day, WeekdayName
global CurYear CurMonth EnglishDayNames MonthNames OptionType SkipType global CurYear CurMonth EnglishDayNames MonthNames OptionType SkipType
global ModifyDialogResult global ModifyDialogResult TwentyFourHourMode
set OptionType 1 set OptionType 1
set SkipType 1 set SkipType 1
@@ -1194,7 +1200,11 @@ proc CreateModifyDialog {w day firstDay args} {
checkbutton $w.timebut -text "Timed reminder at" checkbutton $w.timebut -text "Timed reminder at"
$w.timebut deselect $w.timebut deselect
menubutton $w.timehour -text "12" -menu $w.timehour.menu -relief raised menubutton $w.timehour -text "12" -menu $w.timehour.menu -relief raised
CreateDayMenu $w.timehour 1 12 0 if {$TwentyFourHourMode} {
CreateDayMenu $w.timehour 0 23 0
} else {
CreateDayMenu $w.timehour 1 12 0
}
menubutton $w.timemin -text "00" -menu $w.timemin.menu -relief raised menubutton $w.timemin -text "00" -menu $w.timemin.menu -relief raised
menu $w.timemin.menu -tearoff 0 menu $w.timemin.menu -tearoff 0
foreach i {00 05 10 15 20 25 30 35 40 45 50 55} { foreach i {00 05 10 15 20 25 30 35 40 45 50 55} {
@@ -1202,10 +1212,12 @@ proc CreateModifyDialog {w day firstDay args} {
-command "$w.timemin configure -text $i" -command "$w.timemin configure -text $i"
} }
menubutton $w.ampm -text "PM" -menu $w.ampm.menu -relief raised if {!$TwentyFourHourMode} {
menu $w.ampm.menu -tearoff 0 menubutton $w.ampm -text "PM" -menu $w.ampm.menu -relief raised
$w.ampm.menu add command -label "AM" -command "$w.ampm configure -text {AM}" menu $w.ampm.menu -tearoff 0
$w.ampm.menu add command -label "PM" -command "$w.ampm configure -text {PM}" $w.ampm.menu add command -label "AM" -command "$w.ampm configure -text {AM}"
$w.ampm.menu add command -label "PM" -command "$w.ampm configure -text {PM}"
}
checkbutton $w.timeadvbut -text "with" checkbutton $w.timeadvbut -text "with"
$w.timeadvbut deselect $w.timeadvbut deselect
@@ -1224,7 +1236,11 @@ proc CreateModifyDialog {w day firstDay args} {
$w.timerep.menu add command -label $i -command "$w.timerep configure -text $i" $w.timerep.menu add command -label $i -command "$w.timerep configure -text $i"
} }
label $w.timelab2 -text "minutes" label $w.timelab2 -text "minutes"
pack $w.timebut $w.timehour $w.timemin $w.ampm $w.timeadvbut $w.timeadv $w.timelab1 $w.timerepbut $w.timerep $w.timelab2 -side left -anchor w -in $w.time if {$TwentyFourHourMode} {
pack $w.timebut $w.timehour $w.timemin $w.timeadvbut $w.timeadv $w.timelab1 $w.timerepbut $w.timerep $w.timelab2 -side left -anchor w -in $w.time
} else {
pack $w.timebut $w.timehour $w.timemin $w.ampm $w.timeadvbut $w.timeadv $w.timelab1 $w.timerepbut $w.timerep $w.timelab2 -side left -anchor w -in $w.time
}
# SKIP TYPE # SKIP TYPE
label $w.labhol -text "On holidays or weekends:" label $w.labhol -text "On holidays or weekends:"
@@ -1248,7 +1264,10 @@ proc CreateModifyDialog {w day firstDay args} {
pack $w.but$nbut -side left -anchor w -in $w.buttons -expand 1 -fill x pack $w.but$nbut -side left -anchor w -in $w.buttons -expand 1 -fill x
} }
bind $w <KeyPress-Escape> "$w.but1 invoke" bind $w <KeyPress-Escape> "$w.but1 flash; $w.but1 invoke"
if {$nbut >= 2} {
bind $w.entry <KeyPress-Return> "$w.but2 flash; $w.but2 invoke"
}
set ModifyDialogResult 0 set ModifyDialogResult 0
# Center the window on the root # Center the window on the root
@@ -1299,13 +1318,20 @@ proc RemindDialogToOptions { w } {
#*********************************************************************** #***********************************************************************
proc OptionsToRemindDialog { w opts } { proc OptionsToRemindDialog { w opts } {
global OptionType SkipType repbut expbut advbut advcount global OptionType SkipType repbut expbut advbut advcount
global timebut timeadvbut timerepbut global timebut timeadvbut timerepbut TwentyFourHourMode
global dSaturday dSunday dMonday dTuesday dWednesday dThursday dFriday global dSaturday dSunday dMonday dTuesday dWednesday dThursday dFriday
set hour ""
set ampm ""
foreach {flag value} $opts { foreach {flag value} $opts {
switch -glob -- $flag { switch -glob -- $flag {
"-text-*" { "-text-*" {
set win [string range $flag 6 end] set win [string range $flag 6 end]
$w.$win configure -text $value catch { $w.$win configure -text $value }
if {"$flag" == "-text-ampm"} {
set ampm $value
} elseif {"$flag" == "-text-timehour"} {
set hour $value
}
} }
"-global-*" { "-global-*" {
set win [string range $flag 8 end] set win [string range $flag 8 end]
@@ -1318,6 +1344,24 @@ proc OptionsToRemindDialog { w opts } {
} }
} }
} }
if {"$hour" != ""} {
if {$TwentyFourHourMode} {
if {"$ampm" != ""} {
if {"$ampm" == "PM" && $hour < 12} {
incr hour 12;
$w.timehour configure -text $hour
}
}
} else {
if {$hour > 12} {
incr hour -12
$w.timehour configure -text $hour
$w.ampm configure -text "PM"
} else {
$w.ampm configure -text "AM"
}
}
}
} }
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
@@ -1471,7 +1515,7 @@ proc CenterWindow {w} {
# The reminder as a string. # The reminder as a string.
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
proc CreateReminder {w} { proc CreateReminder {w} {
global DidOmit global DidOmit TwentyFourHourMode
set body [string trim [$w.entry get]] set body [string trim [$w.entry get]]
@@ -1508,13 +1552,15 @@ proc CreateReminder {w} {
if {$timebut} { if {$timebut} {
set hour [$w.timehour cget -text] set hour [$w.timehour cget -text]
set min [$w.timemin cget -text] set min [$w.timemin cget -text]
if {[$w.ampm cget -text] == "PM"} { if {!$TwentyFourHourMode} {
if {$hour < 12} { if {[$w.ampm cget -text] == "PM"} {
incr hour 12 if {$hour < 12} {
} incr hour 12
} else { }
if {$hour == 12} { } else {
set hour 0 if {$hour == 12} {
set hour 0
}
} }
} }
append rem " AT $hour:$min" append rem " AT $hour:$min"
@@ -1734,7 +1780,7 @@ proc EditReminder {rem args} {
} }
pack .edit.t -side top -fill both -expand 1 pack .edit.t -side top -fill both -expand 1
pack .edit.f -side top -fill x -expand 1 pack .edit.f -side top -fill x -expand 1
bind .edit <KeyPress-Escape> ".edit.but1 invoke" bind .edit <KeyPress-Escape> ".edit.but1 flash; .edit.but1 invoke"
set ModifyDialogResult 0 set ModifyDialogResult 0
CenterWindow .edit CenterWindow .edit
tkwait visibility .edit tkwait visibility .edit
@@ -2289,6 +2335,8 @@ proc FireEditor { w } {
return return
} }
} }
Status "Firing up editor..."
after 1500 DisplayTime
set EditorPid [exec sh -c $editor &] set EditorPid [exec sh -c $editor &]
} }
@@ -2630,12 +2678,13 @@ proc DoMoonSpecial { n stuff } {
3 { set image last } 3 { set image last }
} }
.cal.t$n configure -state normal .cal.t$n configure -state normal
.cal.t$n image create end -image $image .cal.t$n image create 1.0 -image $image
if {$msg != ""} { if {$msg != ""} {
.cal.t$n insert end " $msg" .cal.t$n insert 1.1 " $msg\n"
} else {
.cal.t$n insert 1.1 "\n"
} }
.cal.t$n insert end "\n"
.cal.t$n configure -state disabled .cal.t$n configure -state disabled
} }
#*********************************************************************** #***********************************************************************
@@ -2648,7 +2697,12 @@ proc DoMoonSpecial { n stuff } {
# Displays current date and time in status window # Displays current date and time in status window
#*********************************************************************** #***********************************************************************
proc DisplayTime {} { proc DisplayTime {} {
set msg [clock format [clock seconds] -format "%e %b %Y %I:%M%p"] global TwentyFourHourMode
if {$TwentyFourHourMode} {
set msg [clock format [clock seconds] -format "%e %b %Y %H:%M"]
} else {
set msg [clock format [clock seconds] -format "%e %b %Y %I:%M%p"]
}
Status $msg Status $msg
} }

View File

@@ -1,7 +1,6 @@
# Makefile.in for REMIND # Makefile.in for REMIND
# #
VERSION=03.01.01
SHELL= /bin/sh SHELL= /bin/sh
BETA = 1 BETA = 1
srcdir=@srcdir@ srcdir=@srcdir@
@@ -10,7 +9,9 @@ exec_prefix=@exec_prefix@
mandir=@mandir@ mandir=@mandir@
bindir=@bindir@ bindir=@bindir@
datadir=@datadir@ datadir=@datadir@
datarootdir=@datarootdir@
VPATH=$(srcdir) VPATH=$(srcdir)
VERSION=@VERSION@
INSTALL=@INSTALL@ INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@ INSTALL_PROGRAM=@INSTALL_PROGRAM@
@@ -20,7 +21,8 @@ PROGS= remind rem2ps
SCRIPTS= $(srcdir)/../scripts/tkremind $(srcdir)/../scripts/cm2rem.tcl SCRIPTS= $(srcdir)/../scripts/tkremind $(srcdir)/../scripts/cm2rem.tcl
MANS= $(srcdir)/../man/rem2ps.1 $(srcdir)/../man/remind.1 \ MANS= $(srcdir)/../man/rem2ps.1 $(srcdir)/../man/remind.1 \
$(srcdir)/../man/tkremind.1 $(srcdir)/../man/cm2rem.1 $(srcdir)/../man/tkremind.1 $(srcdir)/../man/cm2rem.1 \
$(srcdir)/../man/rem.1
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .o .SUFFIXES: .c .o
@@ -47,18 +49,22 @@ rem2ps: rem2ps.o dynbuf.o
remind: $(REMINDOBJS) remind: $(REMINDOBJS)
@CC@ @LDFLAGS@ $(LDEXTRA) -o remind $(REMINDOBJS) @LIBS@ @CC@ @LDFLAGS@ $(LDEXTRA) -o remind $(REMINDOBJS) @LIBS@
install: all install-nostripped: all
-mkdir -p $(DESTDIR)$(bindir) || true -mkdir -p $(DESTDIR)$(bindir) || true
for prog in $(PROGS) $(SCRIPTS) ; do \ for prog in $(PROGS) $(SCRIPTS) ; do \
$(INSTALL_PROGRAM) $$prog $(DESTDIR)$(bindir) || exit 1; \ $(INSTALL_PROGRAM) $$prog $(DESTDIR)$(bindir) || exit 1; \
done done
-strip $(DESTDIR)$(bindir)/remind || true rm -f $(DESTDIR)$(bindir)/rem > /dev/null 2>&1 || true
-strip $(DESTDIR)$(bindir)/rem2ps || true ln -s remind $(DESTDIR)$(bindir)/rem
-mkdir -p $(DESTDIR)$(mandir)/man1 || true -mkdir -p $(DESTDIR)$(mandir)/man1 || true
for man in $(MANS) ; do \ for man in $(MANS) ; do \
$(INSTALL_DATA) $$man $(DESTDIR)$(mandir)/man1 || exit 1; \ $(INSTALL_DATA) $$man $(DESTDIR)$(mandir)/man1 || exit 1; \
done done
install: install-nostripped
strip $(DESTDIR)$(bindir)/remind || true
strip $(DESTDIR)$(bindir)/rem2ps || true
clean: clean:
rm -f *.o *~ core *.bak $(PROGS) rm -f *.o *~ core *.bak $(PROGS)
@@ -74,15 +80,16 @@ depend:
# Build a tar file based on all files checked into git. # Build a tar file based on all files checked into git.
distro: distro:
ln -s . ../remind-$(VERSION) ln -s . ../remind-$(VERSION)
(cd ..; git-ls-files) | sed -e 's/^/remind-$(VERSION)\//' | xargs tar -C .. -cvf remind-$(VERSION).tar (cd ..; git-ls-files -x .gitignore) | sed -e 's/^/remind-$(VERSION)\//' | xargs tar -C .. -cvf remind-$(VERSION).tar
gzip -f -v -9 remind-$(VERSION).tar gzip -f -v -9 remind-$(VERSION).tar
rm -f ../remind-$(VERSION) rm -f ../remind-$(VERSION)
beta-tgz: beta-tgz:
ln -s . ../remind-$(VERSION)-BETA-$(BETA) 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 (cd ..; git-ls-files -x .gitignore) | 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 gzip -f -v -9 remind-$(VERSION)-BETA-$(BETA).tar
rm -f ../remind-$(VERSION)-BETA-$(BETA) rm -f ../remind-$(VERSION)-BETA-$(BETA)
#---------------- Stuff after this added by "make depend" ----------------- #---------------- Stuff after this added by "make depend" -----------------

View File

@@ -28,20 +28,19 @@
/* Data structures used by the calendar */ /* Data structures used by the calendar */
typedef struct cal_entry { typedef struct cal_entry {
struct cal_entry *next; struct cal_entry *next;
char *text; char const *text;
char *pos; char const *pos;
int time; int time;
int priority; int priority;
char tag[TAG_LEN+1]; char tag[TAG_LEN+1];
char passthru[PASSTHRU_LEN+1]; char passthru[PASSTHRU_LEN+1];
int duration; int duration;
char *filename; char const *filename;
int lineno; int lineno;
} CalEntry; } CalEntry;
/* Global variables */ /* Global variables */
static CalEntry *CalColumn[7]; static CalEntry *CalColumn[7];
static CalEntry *CalPs[7];
static int ColSpaces; static int ColSpaces;
@@ -49,8 +48,8 @@ static void SortCol (CalEntry **col);
static void DoCalendarOneWeek (void); static void DoCalendarOneWeek (void);
static void DoCalendarOneMonth (void); static void DoCalendarOneMonth (void);
static int WriteCalendarRow (void); static int WriteCalendarRow (void);
static void PrintLeft (char *s, int width, char pad); static void PrintLeft (char const *s, int width, char pad);
static void PrintCentered (char *s, int width, char pad); static void PrintCentered (char const *s, int width, char pad);
static int WriteOneCalLine (void); static int WriteOneCalLine (void);
static int WriteOneColLine (int col); static int WriteOneColLine (int col);
static void GenerateCalEntries (int col); static void GenerateCalEntries (int col);
@@ -304,7 +303,7 @@ static int WriteCalendarRow(void)
/* Left-justify a piece of text. */ /* Left-justify a piece of text. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static void PrintLeft(char *s, int width, char pad) static void PrintLeft(char const *s, int width, char pad)
{ {
int len = strlen(s); int len = strlen(s);
printf("%s", s); printf("%s", s);
@@ -318,7 +317,7 @@ static void PrintLeft(char *s, int width, char pad)
/* Center a piec of text */ /* Center a piec of text */
/* */ /* */
/***************************************************************/ /***************************************************************/
static void PrintCentered(char *s, int width, char pad) static void PrintCentered(char const *s, int width, char pad)
{ {
int len = strlen(s); int len = strlen(s);
int d = (width - len) / 2; int d = (width - len) / 2;
@@ -368,8 +367,8 @@ static int WriteOneCalLine(void)
static int WriteOneColLine(int col) static int WriteOneColLine(int col)
{ {
CalEntry *e = CalColumn[col]; CalEntry *e = CalColumn[col];
char *s; char const *s;
char *space; char const *space;
int numwritten = 0; int numwritten = 0;
/* Print as many characters as possible within the column */ /* Print as many characters as possible within the column */
@@ -381,8 +380,8 @@ static int WriteOneColLine(int col)
if (!*s && e->next) { if (!*s && e->next) {
PrintLeft("", ColSpaces, ' '); PrintLeft("", ColSpaces, ' ');
CalColumn[col] = e->next; CalColumn[col] = e->next;
free(e->text); free((char *) e->text);
free(e->filename); free((char *) e->filename);
free(e); free(e);
return 1; return 1;
} }
@@ -421,8 +420,8 @@ static int WriteOneColLine(int col)
/* If done, free memory if no next entry. */ /* If done, free memory if no next entry. */
if (!*s && !e->next) { if (!*s && !e->next) {
CalColumn[col] = e->next; CalColumn[col] = e->next;
free(e->text); free((char *) e->text);
free(e->filename); free((char *) e->filename);
free(e); free(e);
} else { } else {
e->pos = s; e->pos = s;
@@ -441,7 +440,7 @@ static void GenerateCalEntries(int col)
{ {
int r; int r;
Token tok; Token tok;
char *s; char const *s;
Parser p; Parser p;
/* Do some initialization first... */ /* Do some initialization first... */
@@ -588,13 +587,13 @@ static int DoCalRem(ParsePtr p, int col)
int r; int r;
int jul; int jul;
CalEntry *CurCol = CalColumn[col]; CalEntry *CurCol = CalColumn[col];
CalEntry *CurPs = CalPs[col];
CalEntry *e; CalEntry *e;
char *s, *s2; char const *s, *s2;
DynamicBuffer buf, obuf; DynamicBuffer buf, obuf, pre_buf;
Token tok; Token tok;
DBufInit(&buf); DBufInit(&buf);
DBufInit(&pre_buf);
/* Parse the trigger date and time */ /* Parse the trigger date and time */
if ( (r=ParseRem(p, &trig, &tim)) ) return r; if ( (r=ParseRem(p, &trig, &tim)) ) return r;
@@ -638,27 +637,30 @@ static int DoCalRem(ParsePtr p, int col)
strcpy(trig.passthru, "PSFile"); strcpy(trig.passthru, "PSFile");
trig.typ = PASSTHRU_TYPE; trig.typ = PASSTHRU_TYPE;
} }
if (!PsCal) { if (trig.typ == PASSTHRU_TYPE) {
if (trig.typ == PASSTHRU_TYPE) { if (!PsCal && strcmp(trig.passthru, "COLOR")) return OK;
if (strcmp(trig.passthru, "COLOR")) return OK; if (!strcmp(trig.passthru, "COLOR")) {
/* Strip off the three color numbers */ /* Strip off the three color numbers */
DBufFree(&buf); DBufFree(&buf);
r=ParseToken(p, &buf); r=ParseToken(p, &buf);
DBufFree(&buf); DBufPuts(&pre_buf, DBufValue(&buf));
if (r) return r; DBufPutc(&pre_buf, ' ');
r=ParseToken(p, &buf); DBufFree(&buf);
DBufFree(&buf); if (r) return r;
if (r) return r; r=ParseToken(p, &buf);
r=ParseToken(p, &buf); DBufPuts(&pre_buf, DBufValue(&buf));
DBufFree(&buf); DBufPutc(&pre_buf, ' ');
if (r) return r; DBufFree(&buf);
} if (r) return r;
} r=ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
/* Remove any "at" times from PS or PSFILE reminders */ DBufPutc(&pre_buf, ' ');
if (trig.typ == PASSTHRU_TYPE && strcmp(trig.passthru, "COLOR")) { DBufFree(&buf);
tim.ttime = NO_TIME; if (r) return r;
tim.duration = NO_TIME; if (!PsCal && !DoSimpleCalendar) {
DBufFree(&pre_buf);
}
}
} }
/* If trigger date == today, add it to the current entry */ /* If trigger date == today, add it to the current entry */
@@ -670,15 +672,19 @@ static int DoCalRem(ParsePtr p, int col)
NumTriggered++; NumTriggered++;
if (DoSimpleCalendar || tim.ttime != NO_TIME) { if (DoSimpleCalendar || tim.ttime != NO_TIME) {
/* Suppress time if it's not today */ /* Suppress time if it's not today or if it's a non-COLOR special */
if (jul != JulianToday) { if (jul != JulianToday ||
(trig.typ == PASSTHRU_TYPE &&
strcmp(trig.passthru, "COLOR"))) {
if (DBufPuts(&obuf, SimpleTime(NO_TIME)) != OK) { if (DBufPuts(&obuf, SimpleTime(NO_TIME)) != OK) {
DBufFree(&obuf); DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
} else { } else {
if (DBufPuts(&obuf, SimpleTime(tim.ttime)) != OK) { if (DBufPuts(&obuf, CalendarTime(tim.ttime, tim.duration)) != OK) {
DBufFree(&obuf); DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
} }
@@ -694,6 +700,7 @@ static int DoCalRem(ParsePtr p, int col)
if (DBufPuts(&obuf, v.v.str) != OK) { if (DBufPuts(&obuf, v.v.str) != OK) {
DestroyValue(v); DestroyValue(v);
DBufFree(&obuf); DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
} }
@@ -710,11 +717,13 @@ static int DoCalRem(ParsePtr p, int col)
r = DoSubst(p, &obuf, &trig, &tim, jul, CAL_MODE); r = DoSubst(p, &obuf, &trig, &tim, jul, CAL_MODE);
} }
if (r) { if (r) {
DBufFree(&pre_buf);
DBufFree(&obuf); DBufFree(&obuf);
return r; return r;
} }
if (DBufLen(&obuf) <= oldLen) { if (DBufLen(&obuf) <= oldLen) {
DBufFree(&obuf); DBufFree(&obuf);
DBufFree(&pre_buf);
return OK; return OK;
} }
if (trig.typ != PASSTHRU_TYPE && if (trig.typ != PASSTHRU_TYPE &&
@@ -728,6 +737,7 @@ static int DoCalRem(ParsePtr p, int col)
if (DBufPuts(&obuf, v.v.str) != OK) { if (DBufPuts(&obuf, v.v.str) != OK) {
DestroyValue(v); DestroyValue(v);
DBufFree(&obuf); DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
} }
@@ -736,13 +746,17 @@ static int DoCalRem(ParsePtr p, int col)
} }
s = DBufValue(&obuf); s = DBufValue(&obuf);
if (!DoSimpleCalendar) while (isspace(*s)) s++; if (!DoSimpleCalendar) while (isspace(*s)) s++;
DBufPuts(&pre_buf, s);
s = DBufValue(&pre_buf);
e = NEW(CalEntry); e = NEW(CalEntry);
if (!e) { if (!e) {
DBufFree(&obuf); DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
e->text = StrDup(s); e->text = StrDup(s);
DBufFree(&obuf); DBufFree(&obuf);
DBufFree(&pre_buf);
if (!e->text) { if (!e->text) {
free(e); free(e);
return E_NO_MEM; return E_NO_MEM;
@@ -764,35 +778,20 @@ static int DoCalRem(ParsePtr p, int col)
} }
e->lineno = LineNo; e->lineno = LineNo;
/* Ugly hack... SPECIAL COLOR and SPECIAL HTML are not treated if (trig.typ == PASSTHRU_TYPE) {
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); 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 { } else {
if (trig.typ == PASSTHRU_TYPE) { e->passthru[0] = 0;
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
} else {
e->passthru[0] = 0;
}
e->pos = e->text;
if (jul == JulianToday) {
e->time = tim.ttime;
} else {
e->time = NO_TIME;
}
e->next = CurCol;
CalColumn[col] = e;
SortCol(&CalColumn[col]);
} }
e->pos = e->text;
if (jul == JulianToday) {
e->time = tim.ttime;
} else {
e->time = NO_TIME;
}
e->next = CurCol;
CalColumn[col] = e;
SortCol(&CalColumn[col]);
} }
return OK; return OK;
} }
@@ -806,36 +805,11 @@ static int DoCalRem(ParsePtr p, int col)
/***************************************************************/ /***************************************************************/
static void WriteSimpleEntries(int col, int jul) static void WriteSimpleEntries(int col, int jul)
{ {
CalEntry *e = CalPs[col]; CalEntry *e = CalColumn[col];
CalEntry *n; CalEntry *n;
int y, m, d; int y, m, d;
/* Do all the PASSTHRU entries first, if any */
FromJulian(jul, &y, &m, &d); FromJulian(jul, &y, &m, &d);
while(e) {
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];
while(e) { while(e) {
if (DoPrefixLineNo) printf("# fileinfo %d %s\n", e->lineno, e->filename); if (DoPrefixLineNo) printf("# fileinfo %d %s\n", e->lineno, e->filename);
printf("%04d/%02d/%02d", y, m+1, d); printf("%04d/%02d/%02d", y, m+1, d);
@@ -856,8 +830,8 @@ static void WriteSimpleEntries(int col, int jul)
printf("* "); printf("* ");
} }
printf("%s\n", e->text); printf("%s\n", e->text);
free(e->text); free((char *) e->text);
free(e->filename); free((char *) e->filename);
n = e->next; n = e->next;
free(e); free(e);
e = n; e = n;
@@ -904,6 +878,89 @@ static void WriteCalDays(void)
PutChar('\n'); PutChar('\n');
} }
/***************************************************************/
/* */
/* CalendarTime */
/* */
/* Format the time according to simple time format. */
/* Answer is returned in a static buffer. */
/* A trailing space is always added. */
/* This takes into account duration */
/* */
/***************************************************************/
char const *
CalendarTime(int tim, int duration)
{
static char buf[128];
int h, min, hh;
int h2, min2, hh2, newtim, days;
char const *ampm1;
char const *ampm2;
char daybuf[64];
buf[0] = 0;
if (duration == NO_TIME) {
/* No duration... just call into SimpleTime */
return SimpleTime(tim);
}
if (tim == NO_TIME) {
/* No time... nothing to return */
return buf;
}
h = tim/60;
min = tim % 60;
if (h == 0) hh=12;
else if (h > 12) hh=h-12;
else hh = h;
newtim = tim + duration;
/* How many days in duration? */
days = newtim / MINUTES_PER_DAY;
newtim = newtim % MINUTES_PER_DAY;
h2 = newtim/60;
min2 = newtim % 60;
if (h2 == 0) hh2=12;
else if (h2 > 12) hh2=h2-12;
else hh2 = h2;
if (days) {
sprintf(daybuf, "+%d", days);
} else {
daybuf[0] = 0;
}
if (h >= 12) {
ampm1 = L_PM;
} else {
ampm1 = L_AM;
}
if (h2 >= 12) {
ampm2 = L_PM;
} else {
ampm2 = L_AM;
}
if (!days) {
if (!strcmp(ampm1, ampm2)) {
ampm1 = "";
}
}
switch(ScFormat) {
case SC_AMPM:
sprintf(buf, "%d%c%02d%s-%d%c%02d%s%s ",
hh, TimeSep, min, ampm1, hh2, TimeSep, min2, ampm2, daybuf);
break;
case SC_MIL:
sprintf(buf, "%02d%c%02d-%02d%c%02d%s ",
h, TimeSep, min, h2, TimeSep, min2, daybuf);
break;
}
return buf;
}
/***************************************************************/ /***************************************************************/
/* */ /* */
/* SimpleTime */ /* SimpleTime */
@@ -913,7 +970,7 @@ static void WriteCalDays(void)
/* A trailing space is always added. */ /* A trailing space is always added. */
/* */ /* */
/***************************************************************/ /***************************************************************/
char *SimpleTime(int tim) char const *SimpleTime(int tim)
{ {
static char buf[32]; static char buf[32];
int h, min, hh; int h, min, hh;
@@ -929,7 +986,7 @@ char *SimpleTime(int tim)
if (h == 0) hh=12; if (h == 0) hh=12;
else if (h > 12) hh=h-12; else if (h > 12) hh=h-12;
else hh=h; else hh=h;
sprintf(buf, "%2d%c%02d%s ", hh, TimeSep, min, (h>=12) ? L_PM : L_AM); sprintf(buf, "%d%c%02d%s ", hh, TimeSep, min, (h>=12) ? L_PM : L_AM);
} }
break; break;

View File

@@ -1,5 +1,3 @@
/* src/config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if utime(file, NULL) sets file's timestamp to the present. */ /* Define if utime(file, NULL) sets file's timestamp to the present. */
#undef HAVE_UTIME_NULL #undef HAVE_UTIME_NULL

View File

@@ -87,8 +87,7 @@
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
/* WANT_U_OPTION: Comment out the next define to permanently disable */ /* 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 */ /* the -u option. */
/* work. */
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
#define WANT_U_OPTION 1 #define WANT_U_OPTION 1

View File

@@ -87,8 +87,7 @@
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
/* WANT_U_OPTION: Comment out the next define to permanently disable */ /* 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 */ /* the -u option. */
/* work. */
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
#define WANT_U_OPTION 1 #define WANT_U_OPTION 1

View File

@@ -62,6 +62,7 @@ int DoRem(ParsePtr p)
if (trig.typ == SAT_TYPE) { if (trig.typ == SAT_TYPE) {
r=DoSatRemind(&trig, &tim, p); r=DoSatRemind(&trig, &tim, p);
if (r) return r; if (r) return r;
if (!LastTrigValid) return OK;
r=ParseToken(p, &buf); r=ParseToken(p, &buf);
if (r) return r; if (r) return r;
FindToken(DBufValue(&buf), &tok); FindToken(DBufValue(&buf), &tok);
@@ -145,6 +146,7 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim)
trig->sched[0] = 0; trig->sched[0] = 0;
trig->warn[0] = 0; trig->warn[0] = 0;
trig->tag[0] = 0; trig->tag[0] = 0;
trig->passthru[0] = 0;
tim->ttime = NO_TIME; tim->ttime = NO_TIME;
tim->delta = NO_DELTA; tim->delta = NO_DELTA;
tim->rep = NO_REP; tim->rep = NO_REP;
@@ -552,11 +554,13 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
char PrioExpr[25]; char PrioExpr[25];
char tmpBuf[64]; char tmpBuf[64];
DynamicBuffer buf, calRow; DynamicBuffer buf, calRow;
char *s; DynamicBuffer pre_buf;
char const *s;
Value v; Value v;
DBufInit(&buf); DBufInit(&buf);
DBufInit(&calRow); DBufInit(&calRow);
DBufInit(&pre_buf);
if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED; if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
if ((t->typ == PASSTHRU_TYPE && strcmp(t->passthru, "COLOR")) || if ((t->typ == PASSTHRU_TYPE && strcmp(t->passthru, "COLOR")) ||
t->typ == CAL_TYPE || t->typ == CAL_TYPE ||
@@ -568,12 +572,18 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
if (t->typ == PASSTHRU_TYPE && !strcmp(t->passthru, "COLOR")) { if (t->typ == PASSTHRU_TYPE && !strcmp(t->passthru, "COLOR")) {
/* Strip off three tokens */ /* Strip off three tokens */
r = ParseToken(p, &buf); r = ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
DBufPutc(&pre_buf, ' ');
DBufFree(&buf); DBufFree(&buf);
if (r) return r; if (r) return r;
r = ParseToken(p, &buf); r = ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
DBufPutc(&pre_buf, ' ');
DBufFree(&buf); DBufFree(&buf);
if (r) return r; if (r) return r;
r = ParseToken(p, &buf); r = ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
DBufPutc(&pre_buf, ' ');
DBufFree(&buf); DBufFree(&buf);
if (r) return r; if (r) return r;
t->typ = MSG_TYPE; t->typ = MSG_TYPE;
@@ -595,12 +605,14 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
if ( (r=DoSubst(p, &buf, t, tim, jul, CAL_MODE)) ) return r; if ( (r=DoSubst(p, &buf, t, tim, jul, CAL_MODE)) ) return r;
if (!DBufLen(&buf)) { if (!DBufLen(&buf)) {
DBufFree(&buf); DBufFree(&buf);
DBufFree(&pre_buf);
return OK; return OK;
} }
FromJulian(jul, &y, &m, &d); FromJulian(jul, &y, &m, &d);
sprintf(tmpBuf, "%04d/%02d/%02d ", y, m+1, d); sprintf(tmpBuf, "%04d/%02d/%02d ", y, m+1, d);
if (DBufPuts(&calRow, tmpBuf) != OK) { if (DBufPuts(&calRow, tmpBuf) != OK) {
DBufFree(&calRow); DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
/* If DoSimpleCalendar==1, output *all* simple calendar fields */ /* If DoSimpleCalendar==1, output *all* simple calendar fields */
@@ -608,6 +620,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
/* ignore passthru field when in NextMode */ /* ignore passthru field when in NextMode */
if (DBufPuts(&calRow, "* ") != OK) { if (DBufPuts(&calRow, "* ") != OK) {
DBufFree(&calRow); DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
if (t->tag[0]) { if (t->tag[0]) {
@@ -617,6 +630,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
} }
if (DBufPuts(&calRow, tmpBuf) != OK) { if (DBufPuts(&calRow, tmpBuf) != OK) {
DBufFree(&calRow); DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
if (tim->duration != NO_TIME) { if (tim->duration != NO_TIME) {
@@ -626,6 +640,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
} }
if (DBufPuts(&calRow, tmpBuf) != OK) { if (DBufPuts(&calRow, tmpBuf) != OK) {
DBufFree(&calRow); DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
if (tim->ttime != NO_TIME) { if (tim->ttime != NO_TIME) {
@@ -635,16 +650,19 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
} }
if (DBufPuts(&calRow, tmpBuf) != OK) { if (DBufPuts(&calRow, tmpBuf) != OK) {
DBufFree(&calRow); DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
} }
if (DBufPuts(&calRow, SimpleTime(tim->ttime)) != OK) { if (DBufPuts(&calRow, SimpleTime(tim->ttime)) != OK) {
DBufFree(&calRow); DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM; return E_NO_MEM;
} }
printf("%s%s\n", DBufValue(&calRow), DBufValue(&buf)); printf("%s%s%s\n", DBufValue(&calRow), DBufValue(&pre_buf), DBufValue(&buf));
DBufFree(&buf); DBufFree(&buf);
DBufFree(&pre_buf);
DBufFree(&calRow); DBufFree(&calRow);
return OK; return OK;
} }
@@ -794,7 +812,8 @@ int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
{ {
int iter, jul, r; int iter, jul, r;
Value v; Value v;
char *s, *t; char const *s;
char const *t;
t = p->pos; t = p->pos;
iter = 0; iter = 0;
@@ -804,6 +823,9 @@ int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
if (r) { if (r) {
if (r == E_CANT_TRIG) return OK; else return r; if (r == E_CANT_TRIG) return OK; else return r;
} }
if (jul == -1) {
return OK;
}
s = p->pos; s = p->pos;
r = EvaluateExpr(p, &v); r = EvaluateExpr(p, &v);
t = p->pos; t = p->pos;
@@ -827,7 +849,7 @@ int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
static int ParsePriority(ParsePtr s, Trigger *t) static int ParsePriority(ParsePtr s, Trigger *t)
{ {
int p, r; int p, r;
char *u; char const *u;
DynamicBuffer buf; DynamicBuffer buf;
DBufInit(&buf); DBufInit(&buf);
@@ -865,14 +887,14 @@ static int ParsePriority(ParsePtr s, Trigger *t)
/* Execute the '-k' command, escaping shell chars in message. */ /* Execute the '-k' command, escaping shell chars in message. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int DoMsgCommand(char *cmd, char *msg) int DoMsgCommand(char const *cmd, char const *msg)
{ {
int r; int r;
int i, l; int i, l;
DynamicBuffer execBuffer; DynamicBuffer execBuffer;
DynamicBuffer buf; DynamicBuffer buf;
char *s; char const *s;
DBufInit(&buf); DBufInit(&buf);
DBufInit(&execBuffer); DBufInit(&execBuffer);
@@ -930,7 +952,7 @@ static int ShouldTriggerBasedOnWarn(Trigger *t, int jul)
{ {
char buffer[VAR_NAME_LEN+32]; char buffer[VAR_NAME_LEN+32];
int i; int i;
char *s; char const *s;
int r; int r;
Value v; Value v;
int lastReturnVal = 0; /* Silence compiler warning */ int lastReturnVal = 0; /* Silence compiler warning */

View File

@@ -54,11 +54,12 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
int d, m, y; int d, m, y;
int tim = tt->ttime; int tim = tt->ttime;
int h, min, hh, ch, cmin, chh; int h, min, hh, ch, cmin, chh;
char *pm, *cpm; char const *pm, *cpm;
int tdiff, adiff, mdiff, hdiff; int tdiff, adiff, mdiff, hdiff;
char *mplu, *hplu, *when, *plu; char const *mplu, *hplu, *when, *plu;
int has_quote = 0; int has_quote = 0;
char *ss, *os; char *ss;
char *os;
char s[256]; char s[256];
int origLen = DBufLen(dbuf); int origLen = DBufLen(dbuf);
@@ -649,7 +650,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
/* default triggers and a mode of NORMAL_MODE. */ /* default triggers and a mode of NORMAL_MODE. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int DoSubstFromString(char *source, DynamicBuffer *dbuf, int DoSubstFromString(char const *source, DynamicBuffer *dbuf,
int jul, int tim) int jul, int tim)
{ {
Trigger tempTrig; Trigger tempTrig;

View File

@@ -42,7 +42,7 @@ static int DBufMakeRoom(DynamicBuffer *dbuf, int n)
} }
/* Allocate memory */ /* Allocate memory */
buf = (char *) malloc(size); buf = malloc(size);
if (!buf) return E_NO_MEM; if (!buf) return E_NO_MEM;
/* Copy contents */ /* Copy contents */
@@ -102,7 +102,7 @@ int DBufPutcFN(DynamicBuffer *dbuf, char c)
%DESCRIPTION: %DESCRIPTION:
Appends a string to the buffer. Appends a string to the buffer.
**********************************************************************/ **********************************************************************/
int DBufPuts(DynamicBuffer *dbuf, char *str) int DBufPuts(DynamicBuffer *dbuf, char const *str)
{ {
int l = strlen(str); int l = strlen(str);
if (!l) return OK; if (!l) return OK;

View File

@@ -25,7 +25,7 @@ typedef struct {
void DBufInit(DynamicBuffer *dbuf); void DBufInit(DynamicBuffer *dbuf);
int DBufPutcFN(DynamicBuffer *dbuf, char c); int DBufPutcFN(DynamicBuffer *dbuf, char c);
int DBufPuts(DynamicBuffer *dbuf, char *str); int DBufPuts(DynamicBuffer *dbuf, char const *str);
void DBufFree(DynamicBuffer *dbuf); void DBufFree(DynamicBuffer *dbuf);
int DBufGets(DynamicBuffer *dbuf, FILE *fp); int DBufGets(DynamicBuffer *dbuf, FILE *fp);

View File

@@ -41,8 +41,8 @@ static int Multiply(void), Divide(void), Mod(void), Add(void),
UnMinus(void), LogNot(void), UnMinus(void), LogNot(void),
Compare(int); Compare(int);
static int MakeValue (char *s, Value *v, Var *locals); static int MakeValue (char const *s, Value *v, Var *locals);
static int ParseLiteralDate (char **s, int *jul, int *tim); static int ParseLiteralDate (char const **s, int *jul, int *tim);
/* Binary operators - all left-associative */ /* Binary operators - all left-associative */
@@ -132,9 +132,9 @@ static void CleanStack(void)
/* PeekChar - peek ahead to next char. */ /* PeekChar - peek ahead to next char. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static char PeekChar(char **s) static char PeekChar(char const **s)
{ {
char *t = *s; char const *t = *s;
while (*t && isspace(*t)) t++; while (*t && isspace(*t)) t++;
return *t; return *t;
} }
@@ -146,7 +146,7 @@ static char PeekChar(char **s)
/* Read a token. */ /* Read a token. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static int ParseExprToken(DynamicBuffer *buf, char **in) static int ParseExprToken(DynamicBuffer *buf, char const **in)
{ {
char c; char c;
@@ -266,7 +266,7 @@ static int ParseExprToken(DynamicBuffer *buf, char **in)
/* Put the result into value pointed to by v. */ /* Put the result into value pointed to by v. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int EvalExpr(char **e, Value *v) int EvalExpr(char const **e, Value *v)
{ {
int r; int r;
@@ -289,7 +289,7 @@ int EvalExpr(char **e, Value *v)
} }
/* Evaluate - do the actual work of evaluation. */ /* Evaluate - do the actual work of evaluation. */
int Evaluate(char **s, Var *locals) int Evaluate(char const **s, Var *locals)
{ {
int OpBase, ValBase; int OpBase, ValBase;
int r; int r;
@@ -297,7 +297,7 @@ int Evaluate(char **s, Var *locals)
int args; /* Number of function arguments */ int args; /* Number of function arguments */
Operator op, op2; Operator op, op2;
Value va; Value va;
char *ufname = NULL; /* Stop GCC from complaining about use of uninit var */ char const *ufname = NULL; /* Stop GCC from complaining about use of uninit var */
OpBase = OpStackPtr; OpBase = OpStackPtr;
ValBase = ValStackPtr; ValBase = ValStackPtr;
@@ -339,7 +339,7 @@ int Evaluate(char **s, Var *locals)
if (f) r = CallFunc(f, 0); if (f) r = CallFunc(f, 0);
else { else {
r = CallUserFunc(ufname, 0); r = CallUserFunc(ufname, 0);
free(ufname); free((char *) ufname);
} }
if (r) return r; if (r) return r;
r = ParseExprToken(&ExprBuf, s); /* Guaranteed to be right paren. */ r = ParseExprToken(&ExprBuf, s); /* Guaranteed to be right paren. */
@@ -349,12 +349,12 @@ int Evaluate(char **s, Var *locals)
args++; args++;
r = Evaluate(s, locals); r = Evaluate(s, locals);
if (r) { if (r) {
if (!f) free(ufname); if (!f) free((char *) ufname);
return r; return r;
} }
if (*DBufValue(&ExprBuf) == ')') break; if (*DBufValue(&ExprBuf) == ')') break;
else if (*DBufValue(&ExprBuf) != ',') { else if (*DBufValue(&ExprBuf) != ',') {
if (!f) free(ufname); if (!f) free((char *) ufname);
Eprint("%s: `%c'", ErrMsg[E_EXPECT_COMMA], Eprint("%s: `%c'", ErrMsg[E_EXPECT_COMMA],
*DBufValue(&ExprBuf)); *DBufValue(&ExprBuf));
DBufFree(&ExprBuf); DBufFree(&ExprBuf);
@@ -364,7 +364,7 @@ int Evaluate(char **s, Var *locals)
if (f) r = CallFunc(f, args); if (f) r = CallFunc(f, args);
else { else {
r = CallUserFunc(ufname, args); r = CallUserFunc(ufname, args);
free(ufname); free((char *) ufname);
} }
DBufFree(&ExprBuf); DBufFree(&ExprBuf);
if (r) return r; if (r) return r;
@@ -448,7 +448,7 @@ int Evaluate(char **s, Var *locals)
/* a date or the value of a symbol. */ /* a date or the value of a symbol. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static int MakeValue(char *s, Value *v, Var *locals) static int MakeValue(char const *s, Value *v, Var *locals)
{ {
int len; int len;
int h, m, r; int h, m, r;
@@ -456,7 +456,7 @@ static int MakeValue(char *s, Value *v, Var *locals)
if (*s == '\"') { /* It's a literal string "*/ if (*s == '\"') { /* It's a literal string "*/
len = strlen(s)-1; len = strlen(s)-1;
v->type = STR_TYPE; v->type = STR_TYPE;
v->v.str = (char *) malloc(len); v->v.str = malloc(len);
if (! v->v.str) { if (! v->v.str) {
v->type = ERR_TYPE; v->type = ERR_TYPE;
return E_NO_MEM; return E_NO_MEM;
@@ -533,7 +533,7 @@ static int MakeValue(char *s, Value *v, Var *locals)
int DoCoerce(char type, Value *v) int DoCoerce(char type, Value *v)
{ {
int h, d, m, y, i, k; int h, d, m, y, i, k;
char *s; char const *s;
/* Do nothing if value is already the right type */ /* Do nothing if value is already the right type */
if (type == v->type) return OK; if (type == v->type) return OK;
@@ -751,7 +751,7 @@ static int Add(void)
return r; return r;
} }
v3.type = STR_TYPE; v3.type = STR_TYPE;
v3.v.str = (char *) malloc(strlen(v1.v.str) + strlen(v2.v.str) + 1); v3.v.str = malloc(strlen(v1.v.str) + strlen(v2.v.str) + 1);
if (!v3.v.str) { if (!v3.v.str) {
DestroyValue(v1); DestroyValue(v2); DestroyValue(v1); DestroyValue(v2);
return E_NO_MEM; return E_NO_MEM;
@@ -1078,7 +1078,7 @@ static int LogNot(void)
/* Find a function. */ /* Find a function. */
/* */ /* */
/***************************************************************/ /***************************************************************/
Operator *FindFunc(char *name, Operator where[], int num) Operator *FindFunc(char const *name, Operator where[], int num)
{ {
int top=num-1, bot=0; int top=num-1, bot=0;
int mid, r; int mid, r;
@@ -1102,7 +1102,7 @@ Operator *FindFunc(char *name, Operator where[], int num)
void PrintValue (Value *v, FILE *fp) void PrintValue (Value *v, FILE *fp)
{ {
int y, m, d; int y, m, d;
char *s; char const *s;
if (v->type == STR_TYPE) { if (v->type == STR_TYPE) {
s=v->v.str; s=v->v.str;
@@ -1154,7 +1154,7 @@ int CopyValue(Value *dest, const Value *src)
/* and tim; update s. */ /* and tim; update s. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static int ParseLiteralDate(char **s, int *jul, int *tim) static int ParseLiteralDate(char const **s, int *jul, int *tim)
{ {
int y, m, d; int y, m, d;
int hour, min; int hour, min;

View File

@@ -42,20 +42,20 @@
/* Define the structures needed by the file caching system */ /* Define the structures needed by the file caching system */
typedef struct cache { typedef struct cache {
struct cache *next; struct cache *next;
char *text; char const *text;
int LineNo; int LineNo;
} CachedLine; } CachedLine;
typedef struct cheader { typedef struct cheader {
struct cheader *next; struct cheader *next;
char *filename; char const *filename;
CachedLine *cache; CachedLine *cache;
int ownedByMe; int ownedByMe;
} CachedFile; } CachedFile;
/* Define the structures needed by the INCLUDE file system */ /* Define the structures needed by the INCLUDE file system */
typedef struct { typedef struct {
char *filename; char const *filename;
int LineNo; int LineNo;
unsigned int IfFlags; unsigned int IfFlags;
int NumIfs; int NumIfs;
@@ -73,7 +73,7 @@ static IncludeStruct IStack[INCLUDE_NEST];
static int IStackPtr = 0; static int IStackPtr = 0;
static int ReadLineFromFile (void); static int ReadLineFromFile (void);
static int CacheFile (const char *fname); static int CacheFile (char const *fname);
static void DestroyCache (CachedFile *cf); static void DestroyCache (CachedFile *cf);
static int CheckSafety (void); static int CheckSafety (void);
@@ -171,7 +171,7 @@ static int ReadLineFromFile(void)
/* ShouldCache is 1, cache the file */ /* ShouldCache is 1, cache the file */
/* */ /* */
/***************************************************************/ /***************************************************************/
int OpenFile(const char *fname) int OpenFile(char const *fname)
{ {
CachedFile *h = CachedFiles; CachedFile *h = CachedFiles;
int r; int r;
@@ -230,12 +230,12 @@ int OpenFile(const char *fname)
/* Returns an indication of success or failure. */ /* Returns an indication of success or failure. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static int CacheFile(const char *fname) static int CacheFile(char const *fname)
{ {
int r; int r;
CachedFile *cf; CachedFile *cf;
CachedLine *cl; CachedLine *cl;
char *s; char const *s;
cl = NULL; cl = NULL;
/* Create a file header */ /* Create a file header */
@@ -349,7 +349,7 @@ int PopFile(void)
if (fp != stdin) if (fp != stdin)
(void) fseek(fp, i->offset, 0); /* Trust that it works... */ (void) fseek(fp, i->offset, 0); /* Trust that it works... */
} }
free(i->filename); free((char *) i->filename);
return OK; return OK;
} }
@@ -387,7 +387,7 @@ int DoInclude(ParsePtr p)
/* inclusion. */ /* inclusion. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int IncludeFile(const char *fname) int IncludeFile(char const *fname)
{ {
IncludeStruct *i; IncludeStruct *i;
int r; int r;
@@ -432,7 +432,7 @@ int IncludeFile(const char *fname)
/* GetAccessDate - get the access date of a file. */ /* GetAccessDate - get the access date of a file. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int GetAccessDate(char *file) int GetAccessDate(char const *file)
{ {
struct stat statbuf; struct stat statbuf;
struct tm *t1; struct tm *t1;
@@ -457,10 +457,10 @@ static void DestroyCache(CachedFile *cf)
{ {
CachedLine *cl, *cnext; CachedLine *cl, *cnext;
CachedFile *temp; CachedFile *temp;
if (cf->filename) free(cf->filename); if (cf->filename) free((char *) cf->filename);
cl = cf->cache; cl = cf->cache;
while (cl) { while (cl) {
if (cl->text) free (cl->text); if (cl->text) free ((char *) cl->text);
cnext = cl->next; cnext = cl->next;
free(cl); free(cl);
cl = cnext; cl = cnext;

View File

@@ -11,6 +11,7 @@
/* */ /* */
/***************************************************************/ /***************************************************************/
#include "version.h"
#include "config.h" #include "config.h"
#include <stdio.h> #include <stdio.h>
@@ -47,7 +48,6 @@
#include "protos.h" #include "protos.h"
#include "err.h" #include "err.h"
#include "expr.h" #include "expr.h"
#include "version.h"
/* Function prototypes */ /* Function prototypes */
static int FCurrent (void); static int FCurrent (void);
@@ -358,11 +358,11 @@ static int CleanUpAfterFunc(void)
/* Return a string value from a function. */ /* Return a string value from a function. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static int RetStrVal(const char *s) static int RetStrVal(char const *s)
{ {
RetVal.type = STR_TYPE; RetVal.type = STR_TYPE;
if (!s) { if (!s) {
RetVal.v.str = (char *) malloc(1); RetVal.v.str = malloc(1);
if (RetVal.v.str) *RetVal.v.str = 0; if (RetVal.v.str) *RetVal.v.str = 0;
} else } else
RetVal.v.str = StrDup(s); RetVal.v.str = StrDup(s);
@@ -493,7 +493,7 @@ static int FDateTime(void)
/***************************************************************/ /***************************************************************/
static int FCoerce(void) static int FCoerce(void)
{ {
char *s; char const *s;
if (ARG(0).type != STR_TYPE) return E_BAD_TYPE; if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
s = ARG(0).v.str; s = ARG(0).v.str;
@@ -591,7 +591,7 @@ static int FChar(void)
if (ARG(0).v.val < -128) return E_2LOW; if (ARG(0).v.val < -128) return E_2LOW;
if (ARG(0).v.val > 255) return E_2HIGH; if (ARG(0).v.val > 255) return E_2HIGH;
len = ARG(0).v.val ? 2 : 1; len = ARG(0).v.val ? 2 : 1;
RetVal.v.str = (char *) malloc(len); RetVal.v.str = malloc(len);
if (!RetVal.v.str) return E_NO_MEM; if (!RetVal.v.str) return E_NO_MEM;
RetVal.type = STR_TYPE; RetVal.type = STR_TYPE;
*(RetVal.v.str) = ARG(0).v.val; *(RetVal.v.str) = ARG(0).v.val;
@@ -599,7 +599,7 @@ static int FChar(void)
return OK; return OK;
} }
RetVal.v.str = (char *) malloc(Nargs + 1); RetVal.v.str = malloc(Nargs + 1);
if (!RetVal.v.str) return E_NO_MEM; if (!RetVal.v.str) return E_NO_MEM;
RetVal.type = STR_TYPE; RetVal.type = STR_TYPE;
for (i=0; i<Nargs; i++) { for (i=0; i<Nargs; i++) {
@@ -710,7 +710,7 @@ static int FWkdaynum(void)
static int FWkday(void) static int FWkday(void)
{ {
char *s; char const *s;
if (!HASDATE(ARG(0)) && ARG(0).type != INT_TYPE) return E_BAD_TYPE; if (!HASDATE(ARG(0)) && ARG(0).type != INT_TYPE) return E_BAD_TYPE;
if (ARG(0).type == INT_TYPE) { if (ARG(0).type == INT_TYPE) {
@@ -726,7 +726,7 @@ static int FWkday(void)
static int FMon(void) static int FMon(void)
{ {
char *s; char const *s;
int y, m, d, v; int y, m, d, v;
if (!HASDATE(ARG(0)) && ARG(0).type != INT_TYPE) return E_BAD_TYPE; if (!HASDATE(ARG(0)) && ARG(0).type != INT_TYPE) return E_BAD_TYPE;
@@ -833,7 +833,7 @@ static int FSgn(void)
static int FOrd(void) static int FOrd(void)
{ {
int t, u, v; int t, u, v;
char *s; char const *s;
if (ARG(0).type != INT_TYPE) return E_BAD_TYPE; if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
@@ -874,7 +874,7 @@ static int FPlural(void)
return OK; return OK;
} }
RetVal.type = STR_TYPE; RetVal.type = STR_TYPE;
RetVal.v.str = (char *) malloc(strlen(ARG(1).v.str)+2); RetVal.v.str = malloc(strlen(ARG(1).v.str)+2);
if (!RetVal.v.str) { if (!RetVal.v.str) {
RetVal.type = ERR_TYPE; RetVal.type = ERR_TYPE;
return E_NO_MEM; return E_NO_MEM;
@@ -1315,7 +1315,8 @@ static int FIsomitted(void)
/***************************************************************/ /***************************************************************/
static int FSubstr(void) static int FSubstr(void)
{ {
char *s, *t; char *s;
char const *t;
int start, end; int start, end;
if (ARG(0).type != STR_TYPE || ARG(1).type != INT_TYPE) return E_BAD_TYPE; if (ARG(0).type != STR_TYPE || ARG(1).type != INT_TYPE) return E_BAD_TYPE;
@@ -1349,7 +1350,7 @@ static int FSubstr(void)
/***************************************************************/ /***************************************************************/
static int FIndex(void) static int FIndex(void)
{ {
char *s; char const *s;
int start; int start;
if (ARG(0).type != STR_TYPE || ARG(1).type != STR_TYPE || if (ARG(0).type != STR_TYPE || ARG(1).type != STR_TYPE ||
@@ -1463,7 +1464,7 @@ static int FFiledir(void)
static int FAccess(void) static int FAccess(void)
{ {
int amode; int amode;
char *s; char const *s;
if (ARG(0).type != STR_TYPE || if (ARG(0).type != STR_TYPE ||
(ARG(1).type != INT_TYPE && ARG(1).type != STR_TYPE)) return E_BAD_TYPE; (ARG(1).type != INT_TYPE && ARG(1).type != STR_TYPE)) return E_BAD_TYPE;
@@ -2046,6 +2047,7 @@ static int FFiledatetime(void)
/* Canned PostScript code for shading a calendar square */ /* Canned PostScript code for shading a calendar square */
/* */ /* */
/***************************************************************/ /***************************************************************/
static int psshade_warned = 0;
static int FPsshade(void) static int FPsshade(void)
{ {
char psbuff[256]; char psbuff[256];
@@ -2061,6 +2063,11 @@ static int FPsshade(void)
if (ARG(i).v.val > 100) return E_2HIGH; if (ARG(i).v.val > 100) return E_2HIGH;
} }
if (!psshade_warned) {
psshade_warned = 1;
Eprint("psshade() is deprecated; use SPECIAL SHADE instead.");
}
sprintf(s, "/_A LineWidth 2 div def "); sprintf(s, "/_A LineWidth 2 div def ");
s += strlen(s); s += strlen(s);
sprintf(s, "_A _A moveto "); sprintf(s, "_A _A moveto ");
@@ -2082,13 +2089,15 @@ static int FPsshade(void)
/* Canned PostScript code for generating moon phases */ /* Canned PostScript code for generating moon phases */
/* */ /* */
/***************************************************************/ /***************************************************************/
static int psmoon_warned = 0;
static int FPsmoon(void) static int FPsmoon(void)
{ {
char psbuff[512]; char psbuff[512];
char sizebuf[30]; char sizebuf[30];
char fontsizebuf[30]; char fontsizebuf[30];
char *s = psbuff; char *s = psbuff;
char *extra = NULL; char const *extra = NULL;
int size = -1; int size = -1;
int fontsize = -1; int fontsize = -1;
@@ -2109,6 +2118,10 @@ static int FPsmoon(void)
} }
} }
} }
if (!psmoon_warned) {
psmoon_warned = 1;
Eprint("psmoon() is deprecated; use SPECIAL MOON instead.");
}
if (size > 0) { if (size > 0) {
sprintf(sizebuf, "%d", size); sprintf(sizebuf, "%d", size);
} else { } else {
@@ -2354,7 +2367,7 @@ static int tz_convert(int year, int month, int day,
int r; int r;
time_t t; time_t t;
struct tm *res; struct tm *res;
char *old_tz; char const *old_tz;
/* init tm struct */ /* init tm struct */
tm->tm_sec = 0; tm->tm_sec = 0;

View File

@@ -37,7 +37,7 @@ EXTERN int CurMon;
EXTERN int CurYear; EXTERN int CurYear;
EXTERN int LineNo; EXTERN int LineNo;
EXTERN int FreshLine; EXTERN int FreshLine;
EXTERN INIT( char *MsgCommand, NULL); EXTERN INIT( char const *MsgCommand, NULL);
EXTERN INIT( int ShowAllErrors, 0); EXTERN INIT( int ShowAllErrors, 0);
EXTERN INIT( int DebugFlag, 0); EXTERN INIT( int DebugFlag, 0);
EXTERN INIT( int DoCalendar, 0); EXTERN INIT( int DoCalendar, 0);
@@ -61,7 +61,7 @@ EXTERN INIT( int SortByPrio, 0);
EXTERN INIT( int DefaultPrio, NO_PRIORITY); EXTERN INIT( int DefaultPrio, NO_PRIORITY);
EXTERN INIT( long SysTime, -1L); EXTERN INIT( long SysTime, -1L);
EXTERN char *InitialFile; EXTERN char const *InitialFile;
EXTERN int FileAccessDate; EXTERN int FileAccessDate;
EXTERN INIT( int DontFork, 0); EXTERN INIT( int DontFork, 0);
@@ -83,10 +83,10 @@ EXTERN INIT( int LastTriggerDate, 0);
EXTERN INIT( int LastTrigValid, 0); EXTERN INIT( int LastTrigValid, 0);
EXTERN INIT( int LastTriggerTime, 0); EXTERN INIT( int LastTriggerTime, 0);
EXTERN INIT( int ShouldCache, 0); EXTERN INIT( int ShouldCache, 0);
EXTERN char *CurLine; EXTERN char const *CurLine;
EXTERN INIT( int NumTriggered, 0); EXTERN INIT( int NumTriggered, 0);
EXTERN int ArgC; EXTERN int ArgC;
EXTERN char **ArgV; EXTERN char const **ArgV;
EXTERN INIT( int CalLines, CAL_LINES); EXTERN INIT( int CalLines, CAL_LINES);
EXTERN INIT( int CalPad, 1); EXTERN INIT( int CalPad, 1);

View File

@@ -55,7 +55,7 @@
#define ADAR2ADARA 1 #define ADAR2ADARA 1
#define ADAR2BOTH 2 #define ADAR2BOTH 2
static char *HebMonthNames[] = { static char const *HebMonthNames[] = {
"Tishrey", "Heshvan", "Kislev", "Tevet", "Shvat", "Adar A", "Adar B", "Tishrey", "Heshvan", "Kislev", "Tevet", "Shvat", "Adar A", "Adar B",
"Nisan", "Iyar", "Sivan", "Tamuz", "Av", "Elul", "Adar"}; "Nisan", "Iyar", "Sivan", "Tamuz", "Av", "Elul", "Adar"};
@@ -137,7 +137,7 @@ int DaysInHebYear(int y)
/* given the LENGTH of the Hebrew year. */ /* given the LENGTH of the Hebrew year. */
/* */ /* */
/***************************************************************/ /***************************************************************/
char *DaysInHebMonths(int ylen) char const *DaysInHebMonths(int ylen)
{ {
static char monlen[13] = static char monlen[13] =
{30, 29, 30, 29, 30, 0, 29, 30, 29, 30, 29, 30, 29}; {30, 29, 30, 29, 30, 0, 29, 30, 29, 30, 29, 30, 29};
@@ -166,7 +166,7 @@ char *DaysInHebMonths(int ylen)
int HebToJul(int hy, int hm, int hd) int HebToJul(int hy, int hm, int hd)
{ {
int ylen; int ylen;
char *monlens; char const *monlens;
int rh; int rh;
int m; int m;
@@ -201,7 +201,7 @@ void JulToHeb(int jul, int *hy, int *hm, int *hd)
int y, m, d; int y, m, d;
int rh; int rh;
int ylen; int ylen;
char *monlen; char const *monlen;
/* Get the common year */ /* Get the common year */
FromJulian(jul, &y, &m, &d); FromJulian(jul, &y, &m, &d);
y += 3763; /* Over-estimate a bit to be on the safe side below... */ y += 3763; /* Over-estimate a bit to be on the safe side below... */
@@ -232,7 +232,7 @@ void JulToHeb(int jul, int *hy, int *hm, int *hd)
/* year. */ /* year. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int HebNameToNum(const char *mname) int HebNameToNum(char const *mname)
{ {
int i; int i;
int m=-1; int m=-1;
@@ -254,7 +254,7 @@ int HebNameToNum(const char *mname)
/* year. */ /* year. */
/* */ /* */
/***************************************************************/ /***************************************************************/
char *HebMonthName(int m, int y) char const *HebMonthName(int m, int y)
{ {
if (m != ADARA && m != ADARB) return HebMonthNames[m]; if (m != ADARA && m != ADARB) return HebMonthNames[m];
@@ -293,7 +293,7 @@ char *HebMonthName(int m, int y)
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) int *mout, int *dout, int jahr)
{ {
char *monlen; char const *monlen;
int ylen; int ylen;
*mout = min; *mout = min;
@@ -448,7 +448,7 @@ int GetNextHebrewDate(int julstart, int hm, int hd,
/***************************************************************/ /***************************************************************/
int ComputeJahr(int y, int m, int d, int *ans) int ComputeJahr(int y, int m, int d, int *ans)
{ {
char *monlen; char const *monlen;
int len; int len;
*ans = JAHR_NONE; *ans = JAHR_NONE;

View File

@@ -12,6 +12,7 @@
/* */ /* */
/***************************************************************/ /***************************************************************/
#include "version.h"
#include "config.h" #include "config.h"
#define L_IN_INIT 1 #define L_IN_INIT 1
@@ -28,7 +29,6 @@
#include "protos.h" #include "protos.h"
#include "expr.h" #include "expr.h"
#include "err.h" #include "err.h"
#include "version.h"
#include "globals.h" #include "globals.h"
/*************************************************************** /***************************************************************
@@ -79,10 +79,41 @@ while (isdigit(*(s))) { \
s++; \ s++; \
} }
static void ChgUser(char *u); static void ChgUser(char const *u);
static void InitializeVar(char *str); static void InitializeVar(char const *str);
static char *BadDate = "Illegal date on command line\n"; static char const *BadDate = "Illegal date on command line\n";
static DynamicBuffer default_filename_buf;
/***************************************************************/
/* */
/* DefaultFilename */
/* */
/* If we're invoked as "rem" rather than "remind", use a */
/* default filename. Use $DOTREMINDERS or $HOME/.reminders */
/* */
/***************************************************************/
static char const *DefaultFilename(void)
{
char const *s;
DBufInit(&default_filename_buf);
s = getenv("DOTREMINDERS");
if (s) {
return s;
}
s = getenv("HOME");
if (!s) {
fprintf(stderr, "HOME environment variable not set. Unable to determine reminder file.\n");
exit(1);
}
DBufPuts(&default_filename_buf, s);
DBufPuts(&default_filename_buf, "/.reminders");
return DBufValue(&default_filename_buf);
}
/***************************************************************/ /***************************************************************/
/* */ /* */
@@ -91,12 +122,14 @@ static char *BadDate = "Illegal date on command line\n";
/* Initialize the system - called only once at beginning! */ /* Initialize the system - called only once at beginning! */
/* */ /* */
/***************************************************************/ /***************************************************************/
void InitRemind(int argc, char *argv[]) void InitRemind(int argc, char const *argv[])
{ {
char *arg; char const *arg;
int i; int i;
int y, m, d, rep; int y, m, d, rep;
Token tok; Token tok;
int InvokedAsRem = 0;
char const *s;
/* Initialize global dynamic buffers */ /* Initialize global dynamic buffers */
DBufInit(&Banner); DBufInit(&Banner);
@@ -125,6 +158,19 @@ void InitRemind(int argc, char *argv[])
JulianToday = RealToday; JulianToday = RealToday;
FromJulian(JulianToday, &CurYear, &CurMon, &CurDay); FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
/* See if we were invoked as "rem" rather than "remind" */
if (argv[0]) {
s = strrchr(argv[0], '/');
if (!s) {
s = argv[0];
} else {
s++;
}
if (!strcmp(s, "rem")) {
InvokedAsRem = 1;
}
}
/* Parse the command-line options */ /* Parse the command-line options */
i = 1; i = 1;
while (i < argc) { while (i < argc) {
@@ -223,11 +269,11 @@ void InitRemind(int argc, char *argv[])
if (*arg == '0') { if (*arg == '0') {
PARSENUM(Daemon, arg); PARSENUM(Daemon, arg);
if (Daemon == 0) Daemon = -1; if (Daemon == 0) Daemon = -1;
else if (Daemon < 5) Daemon = 5; else if (Daemon < 1) Daemon = 1;
else if (Daemon > 60) Daemon = 60; else if (Daemon > 60) Daemon = 60;
} else { } else {
PARSENUM(Daemon, arg); PARSENUM(Daemon, arg);
if (Daemon<5) Daemon=5; if (Daemon<1) Daemon=1;
else if (Daemon>60) Daemon=60; else if (Daemon>60) Daemon=60;
} }
break; break;
@@ -360,11 +406,15 @@ void InitRemind(int argc, char *argv[])
} }
/* Get the filename. */ /* Get the filename. */
if (i >= argc) { if (!InvokedAsRem) {
Usage(); if (i >= argc) {
exit(1); Usage();
exit(1);
}
InitialFile = argv[i++];
} else {
InitialFile = DefaultFilename();
} }
InitialFile = argv[i++];
/* Get the date, if any */ /* Get the date, if any */
if (i < argc) { if (i < argc) {
@@ -500,12 +550,15 @@ void Usage(void)
/* USER environment variables. */ /* USER environment variables. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static void ChgUser(char *user) static void ChgUser(char const *user)
{ {
uid_t myuid; uid_t myuid;
struct passwd *pwent; struct passwd *pwent;
static char *home, *shell, *username, *logname; static char *home;
static char *shell;
static char *username;
static char *logname;
myuid = getuid(); myuid = getuid();
@@ -566,22 +619,29 @@ static void ChgUser(char *user)
/* Initialize and preserve a variable */ /* Initialize and preserve a variable */
/* */ /* */
/***************************************************************/ /***************************************************************/
static void InitializeVar(char *str) static void InitializeVar(char const *str)
{ {
char *varname, *expr; char const *expr;
char varname[VAR_NAME_LEN+1];
Value val; Value val;
int r; int r;
/* Scan for an '=' sign */ /* Scan for an '=' sign */
varname = str; r = 0;
while (*str && *str != '=') str++; while (*str && *str != '=') {
if (r < VAR_NAME_LEN) {
varname[r++] = *str;
}
str++;
}
varname[r] = 0;
if (!*str) { if (!*str) {
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_EQ]); fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_EQ]);
return; return;
} }
*str = 0;
if (!*varname) { if (!*varname) {
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_VAR]); fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_VAR]);
return; return;

View File

@@ -62,9 +62,9 @@ int main(int argc, char *argv[])
/* Set up global vars */ /* Set up global vars */
ArgC = argc; ArgC = argc;
ArgV = argv; ArgV = (char const **) argv;
InitRemind(argc, argv); InitRemind(argc, (char const **) argv);
if (DoCalendar || (DoSimpleCalendar && (!NextMode || PsCal))) { if (DoCalendar || (DoSimpleCalendar && (!NextMode || PsCal))) {
ProduceCalendar(); ProduceCalendar();
return 0; return 0;
@@ -134,7 +134,7 @@ static void DoReminders(void)
{ {
int r; int r;
Token tok; Token tok;
char *s; char const *s;
Parser p; Parser p;
if (!UseStdin) { if (!UseStdin) {
@@ -330,7 +330,7 @@ int ParseChar(ParsePtr p, int *err, int peek)
return *(p->epos++); return *(p->epos++);
} }
} }
free(p->etext); /* End of substituted expression */ free((void *) p->etext); /* End of substituted expression */
p->etext = NULL; p->etext = NULL;
p->epos = NULL; p->epos = NULL;
p->isnested = 0; p->isnested = 0;
@@ -503,7 +503,7 @@ int EvaluateExpr(ParsePtr p, Value *v)
/* Eprint - print an error message. */ /* Eprint - print an error message. */
/* */ /* */
/***************************************************************/ /***************************************************************/
void Eprint(const char *fmt, ...) void Eprint(char const *fmt, ...)
{ {
va_list argptr; va_list argptr;
@@ -536,8 +536,8 @@ void Eprint(const char *fmt, ...)
/***************************************************************/ /***************************************************************/
void OutputLine(FILE *fp) void OutputLine(FILE *fp)
{ {
register char *s = CurLine; char const *s = CurLine;
register char c = 0; char c = 0;
while (*s) { while (*s) {
if (*s == '\n') Putc('\\', fp); if (*s == '\n') Putc('\\', fp);
@@ -554,7 +554,7 @@ void OutputLine(FILE *fp)
/* Create a parser given a string buffer */ /* Create a parser given a string buffer */
/* */ /* */
/***************************************************************/ /***************************************************************/
void CreateParser(char *s, ParsePtr p) void CreateParser(char const *s, ParsePtr p)
{ {
p->text = s; p->text = s;
p->pos = s; p->pos = s;
@@ -576,7 +576,7 @@ void CreateParser(char *s, ParsePtr p)
void DestroyParser(ParsePtr p) void DestroyParser(ParsePtr p)
{ {
if (p->isnested && p->etext) { if (p->isnested && p->etext) {
free(p->etext); free((void *) p->etext);
p->etext = NULL; p->etext = NULL;
p->isnested = 0; p->isnested = 0;
} }
@@ -589,10 +589,10 @@ void DestroyParser(ParsePtr p)
/* on a per-parser basis. */ /* on a per-parser basis. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int PushToken(const char *tok, ParsePtr p) int PushToken(char const *tok, ParsePtr p)
{ {
DBufFree(&p->pushedToken); DBufFree(&p->pushedToken);
if (DBufPuts(&p->pushedToken, (char *) tok) != OK || if (DBufPuts(&p->pushedToken, tok) != OK ||
DBufPutc(&p->pushedToken, ' ') != OK) { DBufPutc(&p->pushedToken, ' ') != OK) {
DBufFree(&p->pushedToken); DBufFree(&p->pushedToken);
return E_NO_MEM; return E_NO_MEM;
@@ -977,7 +977,7 @@ int DoErrMsg(ParsePtr p)
TimeTrig tt; TimeTrig tt;
Trigger t; Trigger t;
int r; int r;
char *s; char const *s;
DynamicBuffer buf; DynamicBuffer buf;
@@ -1079,7 +1079,7 @@ int CalcMinsFromUTC(int jul, int tim, int *mins, int *isdst)
/* A macro safe ONLY if used with arg with no side effects! */ /* A macro safe ONLY if used with arg with no side effects! */
#define ISBLANK(c) (isspace(c) && (c) != '\n') #define ISBLANK(c) (isspace(c) && (c) != '\n')
void FillParagraph(char *s) void FillParagraph(char const *s)
{ {
int line = 0; int line = 0;
@@ -1087,7 +1087,7 @@ void FillParagraph(char *s)
int doublespace = 1; int doublespace = 1;
int pendspace; int pendspace;
int len; int len;
char *t; char const *t;
int roomleft; int roomleft;

View File

@@ -113,12 +113,12 @@ int PushOmitContext(ParsePtr p)
context->numfull = NumFullOmits; context->numfull = NumFullOmits;
context->numpart = NumPartialOmits; context->numpart = NumPartialOmits;
context->fullsave = (int *) malloc(NumFullOmits * sizeof(int)); context->fullsave = malloc(NumFullOmits * sizeof(int));
if (NumFullOmits && !context->fullsave) { if (NumFullOmits && !context->fullsave) {
free(context); free(context);
return E_NO_MEM; return E_NO_MEM;
} }
context->partsave = (int *) malloc(NumPartialOmits * sizeof(int)); context->partsave = malloc(NumPartialOmits * sizeof(int));
if (NumPartialOmits && !context->partsave) { if (NumPartialOmits && !context->partsave) {
free(context->fullsave); free(context->fullsave);
free(context); free(context);

View File

@@ -14,14 +14,15 @@
#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); } #define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
/* Define a general malloc routine for creating pointers to objects */ /* Define a general malloc routine for creating pointers to objects */
#define NEW(type) ((type *) malloc(sizeof(type))) #define NEW(type) (malloc(sizeof(type)))
#include "dynbuf.h" #include "dynbuf.h"
int CallUserFunc (char *name, int nargs); int CallUserFunc (char const *name, int nargs);
int DoFset (ParsePtr p); int DoFset (ParsePtr p);
void ProduceCalendar (void); void ProduceCalendar (void);
char *SimpleTime (int tim); char const *SimpleTime (int tim);
char const *CalendarTime (int tim, int duration);
int DoRem (ParsePtr p); int DoRem (ParsePtr p);
int DoFlush (ParsePtr p); int DoFlush (ParsePtr p);
void DoExit (ParsePtr p); void DoExit (ParsePtr p);
@@ -29,36 +30,35 @@ int ParseRem (ParsePtr s, Trigger *trig, TimeTrig *tim);
int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int jul); int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int jul);
int ShouldTriggerReminder (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 DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode);
int DoSubstFromString (char *source, DynamicBuffer *dbuf, int jul, int tim); int DoSubstFromString (char const *source, DynamicBuffer *dbuf, int jul, int tim);
int EvalExpr (char **e, Value *v); int EvalExpr (char const **e, Value *v);
int DoCoerce (char type, Value *v); int DoCoerce (char type, Value *v);
void PrintValue (Value *v, FILE *fp); void PrintValue (Value *v, FILE *fp);
int CopyValue (Value *dest, const Value *src); int CopyValue (Value *dest, const Value *src);
int ReadLine (void); int ReadLine (void);
int OpenFile (const char *fname); int OpenFile (char const *fname);
int PopFile (void); int PopFile (void);
int DoInclude (ParsePtr p); int DoInclude (ParsePtr p);
int IncludeFile (const char *fname); int IncludeFile (char const *fname);
int GetAccessDate (char *file); int GetAccessDate (char const *file);
int SetAccessDate (char *fname, int jul); int SetAccessDate (char const *fname, int jul);
int TopLevel (void); int TopLevel (void);
int CallFunc (Operator *f, int nargs); int CallFunc (Operator *f, int nargs);
void InitRemind (int argc, char *argv[]); void InitRemind (int argc, char const *argv[]);
void Usage (void); void Usage (void);
int main (int argc, char *argv[]);
int Julian (int year, int month, int day); int Julian (int year, int month, int day);
void FromJulian (int jul, int *y, int *m, int *d); void FromJulian (int jul, int *y, int *m, int *d);
int ParseChar (ParsePtr p, int *err, int peek); int ParseChar (ParsePtr p, int *err, int peek);
int ParseToken (ParsePtr p, DynamicBuffer *dbuf); int ParseToken (ParsePtr p, DynamicBuffer *dbuf);
int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf); int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf);
int EvaluateExpr (ParsePtr p, Value *v); int EvaluateExpr (ParsePtr p, Value *v);
int Evaluate (char **s, Var *locals); int Evaluate (char const **s, Var *locals);
int FnPopValStack (Value *val); int FnPopValStack (Value *val);
void Eprint (const char *fmt, ...); void Eprint (char const *fmt, ...);
void OutputLine (FILE *fp); void OutputLine (FILE *fp);
void CreateParser (char *s, ParsePtr p); void CreateParser (char const *s, ParsePtr p);
void DestroyParser (ParsePtr p); void DestroyParser (ParsePtr p);
int PushToken (const char *tok, ParsePtr p); int PushToken (char const *tok, ParsePtr p);
long SystemTime (int realtime); long SystemTime (int realtime);
int SystemDate (int *y, int *m, int *d); int SystemDate (int *y, int *m, int *d);
int DoIf (ParsePtr p); int DoIf (ParsePtr p);
@@ -78,53 +78,53 @@ int PushOmitContext (ParsePtr p);
int PopOmitContext (ParsePtr p); int PopOmitContext (ParsePtr p);
int IsOmitted (int jul, int localomit); int IsOmitted (int jul, int localomit);
int DoOmit (ParsePtr p); int DoOmit (ParsePtr p);
int QueueReminder (ParsePtr p, Trigger *trig, TimeTrig *tim, const char *sched); int QueueReminder (ParsePtr p, Trigger *trig, TimeTrig *tim, char const *sched);
void HandleQueuedReminders (void); void HandleQueuedReminders (void);
char *FindInitialToken (Token *tok, char *s); char const *FindInitialToken (Token *tok, char const *s);
void FindToken (const char *s, Token *tok); void FindToken (char const *s, Token *tok);
void FindNumericToken (const char *s, Token *t); void FindNumericToken (char const *s, Token *t);
int ComputeTrigger (int today, Trigger *trig, int *err); int ComputeTrigger (int today, Trigger *trig, int *err);
char *StrnCpy (char *dest, const char *source, int n); char *StrnCpy (char *dest, char const *source, int n);
int StrMatch (const char *s1, const char *s2, int n); int StrMatch (char const *s1, char const *s2, int n);
int StrinCmp (const char *s1, const char *s2, int n); int StrinCmp (char const *s1, char const *s2, int n);
char *StrDup (const char *s); char *StrDup (char const *s);
int StrCmpi (const char *s1, const char *s2); int StrCmpi (char const *s1, char const *s2);
Var *FindVar (const char *str, int create); Var *FindVar (char const *str, int create);
int DeleteVar (const char *str); int DeleteVar (char const *str);
int SetVar (const char *str, Value *val); int SetVar (char const *str, Value *val);
int GetVarValue (const char *str, Value *val, Var *locals); int GetVarValue (char const *str, Value *val, Var *locals);
int DoSet (Parser *p); int DoSet (Parser *p);
int DoUnset (Parser *p); int DoUnset (Parser *p);
int DoDump (ParsePtr p); int DoDump (ParsePtr p);
void DumpVarTable (void); void DumpVarTable (void);
void DestroyVars (int all); void DestroyVars (int all);
int PreserveVar (char *name); int PreserveVar (char const *name);
int DoPreserve (Parser *p); int DoPreserve (Parser *p);
int DoSatRemind (Trigger *trig, TimeTrig *tim, ParsePtr p); int DoSatRemind (Trigger *trig, TimeTrig *tim, ParsePtr p);
int DoMsgCommand (char *cmd, char *msg); int DoMsgCommand (char const *cmd, char const *msg);
int ParseNonSpaceChar (ParsePtr p, int *err, int peek); int ParseNonSpaceChar (ParsePtr p, int *err, int peek);
unsigned int HashVal (const char *str); unsigned int HashVal (char const *str);
int DateOK (int y, int m, int d); int DateOK (int y, int m, int d);
Operator *FindFunc (char *name, Operator where[], int num); Operator *FindFunc (char const *name, Operator where[], int num);
int InsertIntoSortBuffer (int jul, int tim, char *body, int typ, int prio); int InsertIntoSortBuffer (int jul, int tim, char const *body, int typ, int prio);
void IssueSortedReminders (void); void IssueSortedReminders (void);
int UserFuncExists (char *fn); int UserFuncExists (char const *fn);
void JulToHeb (int jul, int *hy, int *hm, int *hd); void JulToHeb (int jul, int *hy, int *hm, int *hd);
int HebNameToNum (const char *mname); int HebNameToNum (char const *mname);
char *HebMonthName (int m, int y); char const *HebMonthName (int m, int y);
int RoshHashana (int i); int RoshHashana (int i);
long DaysToHebYear (int y); long DaysToHebYear (int y);
int DaysInHebYear (int y); int DaysInHebYear (int y);
char *DaysInHebMonths (int ylen); char const *DaysInHebMonths (int ylen);
int HebToJul (int hy, int hm, int hd); 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 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 GetNextHebrewDate (int julstart, int hm, int hd, int yahr, int adarbehave, int *ans);
int ComputeJahr (int y, int m, int d, int *ans); int ComputeJahr (int y, int m, int d, int *ans);
int GetSysVar (const char *name, Value *val); int GetSysVar (char const *name, Value *val);
int SetSysVar (const char *name, Value *val); int SetSysVar (char const *name, Value *val);
void DumpSysVarByName (const char *name); void DumpSysVarByName (char const *name);
int CalcMinsFromUTC (int jul, int tim, int *mins, int *isdst); int CalcMinsFromUTC (int jul, int tim, int *mins, int *isdst);
void FillParagraph (char *s); void FillParagraph (char const *s);
void LocalToUTC (int locdate, int loctime, int *utcdate, int *utctime); void LocalToUTC (int locdate, int loctime, int *utcdate, int *utctime);
void UTCToLocal (int utcdate, int utctime, int *locdate, int *loctime); void UTCToLocal (int utcdate, int utctime, int *locdate, int *loctime);
int MoonPhase (int date, int time); int MoonPhase (int date, int time);

View File

@@ -40,7 +40,8 @@ typedef struct queuedrem {
int typ; int typ;
int RunDisabled; int RunDisabled;
int ntrig; int ntrig;
char *text; char const *text;
char passthru[PASSTHRU_LEN+1];
char sched[VAR_NAME_LEN+1]; char sched[VAR_NAME_LEN+1];
char tag[TAG_LEN+1]; char tag[TAG_LEN+1];
TimeTrig tt; TimeTrig tt;
@@ -68,7 +69,7 @@ static void reread (void);
/* */ /* */
/***************************************************************/ /***************************************************************/
int QueueReminder(ParsePtr p, Trigger *trig, int QueueReminder(ParsePtr p, Trigger *trig,
TimeTrig *tim, const char *sched) TimeTrig *tim, char const *sched)
{ {
QueuedRem *qelem; QueuedRem *qelem;
@@ -89,6 +90,7 @@ int QueueReminder(ParsePtr p, Trigger *trig,
} }
NumQueued++; NumQueued++;
qelem->typ = trig->typ; qelem->typ = trig->typ;
strcpy(qelem->passthru, trig->passthru);
qelem->tt = *tim; qelem->tt = *tim;
qelem->next = QueueHead; qelem->next = QueueHead;
qelem->RunDisabled = RunDisabled; qelem->RunDisabled = RunDisabled;
@@ -179,13 +181,30 @@ void HandleQueuedReminders(void)
if (Daemon > 0 && SleepTime > 60*Daemon) SleepTime = 60*Daemon; if (Daemon > 0 && SleepTime > 60*Daemon) SleepTime = 60*Daemon;
/* Wake up once a minute to recalibrate sleep time in
case of laptop hibernation */
if (Daemon <= 0) {
if (SleepTime > 60) {
SleepTime = 60;
}
}
if (Daemon >= 0) { if (Daemon >= 0) {
sleep(SleepTime); sleep(SleepTime);
} else { } else {
DaemonWait(SleepTime); DaemonWait(SleepTime);
} }
if (Daemon> 0 && SleepTime) CheckInitialFile(); /* If not in daemon mode and day has rolled around,
exit -- not much we can do. */
if (!Daemon) {
int y, m, d;
if (RealToday != SystemDate(&y, &m, &d)) {
exit(0);
}
}
if (Daemon > 0 && SleepTime) CheckInitialFile();
if (Daemon && !q) { if (Daemon && !q) {
if (Daemon < 0) { if (Daemon < 0) {
@@ -200,36 +219,45 @@ void HandleQueuedReminders(void)
} }
/* Trigger the reminder */ /* Do NOT trigger the reminder if tt.nexttime is more than a
CreateParser(q->text, &p); minute in the past. This can happen if the clock is
trig.typ = q->typ; changed or a laptop awakes from hibernation.
RunDisabled = q->RunDisabled; However, DO triger if tt.nexttime == tt.ttime so all
if (Daemon < 0) { queued reminders are triggered at least once. */
printf("NOTE reminder %s ", if ((SystemTime(0) - (q->tt.nexttime * 60) <= 60) ||
SimpleTime(q->tt.ttime)); (q->tt.nexttime == q->tt.ttime)) {
printf("%s ", SimpleTime(SystemTime(0)/60)); /* Trigger the reminder */
if (!*q->tag) { CreateParser(q->text, &p);
printf("*"); trig.typ = q->typ;
} else { strcpy(trig.passthru, q->passthru);
printf("%s", q->tag); RunDisabled = q->RunDisabled;
if (Daemon < 0) {
printf("NOTE reminder %s",
SimpleTime(q->tt.ttime));
printf("%s", SimpleTime(SystemTime(0)/60));
if (!*q->tag) {
printf("*");
} else {
printf("%s", q->tag);
}
printf("\n");
} }
printf("\n");
}
/* Set up global variables so some functions like trigdate() /* Set up global variables so some functions like trigdate()
and trigtime() work correctly */ and trigtime() work correctly */
LastTriggerDate = JulianToday; LastTriggerDate = JulianToday;
LastTriggerTime = q->tt.ttime; LastTriggerTime = q->tt.ttime;
LastTrigValid = 1; LastTrigValid = 1;
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday); (void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
if (Daemon < 0) { if (Daemon < 0) {
printf("NOTE endreminder\n"); printf("NOTE endreminder\n");
}
fflush(stdout);
DestroyParser(&p);
} }
fflush(stdout);
/* Calculate the next trigger time */ /* Calculate the next trigger time */
q->tt.nexttime = CalculateNextTime(q); q->tt.nexttime = CalculateNextTime(q);
DestroyParser(&p);
} }
exit(0); exit(0);
} }
@@ -322,8 +350,11 @@ void GotSigInt(void)
q->tt.rep, q->tt.delta, q->sched); q->tt.rep, q->tt.delta, q->sched);
if (*q->sched) printf("(%d)", q->ntrig+1); if (*q->sched) printf("(%d)", q->ntrig+1);
printf("%s", NL); printf("%s", NL);
printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" : printf("Text: %s %s%s%s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
((q->typ == MSF_TYPE) ? "MSF" :"RUN")), ((q->typ == MSF_TYPE) ? "MSF" :
((q->typ == RUN_TYPE) ? "RUN" : "SPECIAL"))),
q->passthru,
(*(q->passthru)) ? " " : "",
q->text, q->text,
NL, NL); NL, NL);
} }
@@ -365,7 +396,7 @@ static int CalculateNextTimeUsingSched(QueuedRem *q)
/* Use LineBuffer for temp. string storage. */ /* Use LineBuffer for temp. string storage. */
int r; int r;
Value v; Value v;
char *s; char const *s;
int LastTime = -1; int LastTime = -1;
int ThisTime; int ThisTime;
@@ -486,6 +517,6 @@ static void DaemonWait(unsigned int sleeptime)
/***************************************************************/ /***************************************************************/
static void reread(void) static void reread(void)
{ {
execvp(ArgV[0], ArgV); execvp(ArgV[0], (char **) ArgV);
} }

View File

@@ -10,6 +10,7 @@
/* */ /* */
/***************************************************************/ /***************************************************************/
#include "version.h"
#include "config.h" #include "config.h"
#include "dynbuf.h" #include "dynbuf.h"
@@ -20,9 +21,8 @@
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include "rem2ps.h" #include "rem2ps.h"
#include "version.h"
#define NEW(type) ((type *) malloc(sizeof(type))) #define NEW(type) (malloc(sizeof(type)))
#define SPECIAL_NORMAL 0 #define SPECIAL_NORMAL 0
#define SPECIAL_POSTSCRIPT 1 #define SPECIAL_POSTSCRIPT 1
@@ -38,13 +38,13 @@ typedef struct calentry {
} CalEntry; } CalEntry;
typedef struct { typedef struct {
char *name; char const *name;
int xsize, ysize; int xsize, ysize;
} PageType; } PageType;
char DayName[7][33]; char DayName[7][33];
char *SmallCalLoc[] = { char const *SmallCalLoc[] = {
"", "",
"bt", "bt",
"tb", "tb",
@@ -52,7 +52,7 @@ char *SmallCalLoc[] = {
}; };
#define NUMSMALL (sizeof(SmallCalLoc)/sizeof(SmallCalLoc[0])) #define NUMSMALL (sizeof(SmallCalLoc)/sizeof(SmallCalLoc[0]))
char *SmallLocation; char const *SmallLocation;
int SmallCol1, SmallCol2; int SmallCol1, SmallCol2;
PageType Pages[] = PageType Pages[] =
@@ -88,20 +88,20 @@ char PortraitMode;
char NoSmallCal; char NoSmallCal;
char UseISO; char UseISO;
char *HeadFont="Helvetica"; char const *HeadFont="Helvetica";
char *TitleFont="Helvetica"; char const *TitleFont="Helvetica";
char *DayFont="Helvetica-BoldOblique"; char const *DayFont="Helvetica-BoldOblique";
char *EntryFont="Helvetica"; char const *EntryFont="Helvetica";
char *SmallFont="Helvetica"; char const *SmallFont="Helvetica";
char *LineWidth = "1"; char const *LineWidth = "1";
char *HeadSize="14"; char const *HeadSize="14";
char *TitleSize="14"; char const *TitleSize="14";
char *DaySize="14"; char const *DaySize="14";
char *EntrySize="8"; char const *EntrySize="8";
char *BorderSize = "6"; char const *BorderSize = "6";
char *UserProlog = NULL; char const *UserProlog = NULL;
int validfile = 0; int validfile = 0;
@@ -116,15 +116,15 @@ int FillPage;
int Verbose = 0; int Verbose = 0;
void Init (int argc, char *argv[]); void Init (int argc, char *argv[]);
void Usage (char *s); void Usage (char const *s);
void DoPsCal (void); void DoPsCal (void);
int DoQueuedPs (void); int DoQueuedPs (void);
void DoSmallCal (char *m, int days, int first, int col, int which); void DoSmallCal (char const *m, int days, int first, int col, int which);
void WriteProlog (void); void WriteProlog (void);
void WriteCalEntry (void); void WriteCalEntry (void);
void WriteOneEntry (CalEntry *c); void WriteOneEntry (CalEntry *c);
void GetSmallLocations (void); void GetSmallLocations (void);
char *EatToken(char *in, char *out, int maxlen); char const *EatToken(char const *in, char *out, int maxlen);
/***************************************************************/ /***************************************************************/
/* */ /* */
@@ -182,7 +182,7 @@ void DoPsCal(void)
int i; int i;
int is_ps; int is_ps;
int firstcol; int firstcol;
char *startOfBody; char const *startOfBody;
char passthru[PASSTHRU_LEN+1]; char passthru[PASSTHRU_LEN+1];
DynamicBuffer buf; DynamicBuffer buf;
CalEntry *c, *d; CalEntry *c, *d;
@@ -388,7 +388,7 @@ void WriteProlog(void)
int i; int i;
int x = CurPage->xsize; int x = CurPage->xsize;
int y = CurPage->ysize; int y = CurPage->ysize;
char *isostuff; char const *isostuff;
FILE *fp; FILE *fp;
int nread; int nread;
char buffer[512]; char buffer[512];
@@ -574,7 +574,7 @@ void WriteCalEntry(void)
void WriteOneEntry(CalEntry *c) void WriteOneEntry(CalEntry *c)
{ {
int ch, i; int ch, i;
char *s = c->entry; char const *s = c->entry;
printf(" ["); printf(" [");
@@ -635,7 +635,8 @@ void WriteOneEntry(CalEntry *c)
/***************************************************************/ /***************************************************************/
void Init(int argc, char *argv[]) void Init(int argc, char *argv[])
{ {
char *s, *t; char const *s;
char const *t;
int i=1; int i=1;
int j; int j;
int offset; int offset;
@@ -791,7 +792,7 @@ void Init(int argc, char *argv[])
/* Usage - print usage information */ /* Usage - print usage information */
/* */ /* */
/***************************************************************/ /***************************************************************/
void Usage(char *s) void Usage(char const *s)
{ {
if (s) fprintf(stderr, "Rem2PS: %s\n\n", s); if (s) fprintf(stderr, "Rem2PS: %s\n\n", s);
@@ -820,7 +821,7 @@ void Usage(char *s)
/* month. */ /* month. */
/* */ /* */
/***************************************************************/ /***************************************************************/
void DoSmallCal(char *m, int days, int first, int col, int which) void DoSmallCal(char const *m, int days, int first, int col, int which)
{ {
/* Do the small calendar */ /* Do the small calendar */
int i, j; int i, j;
@@ -885,7 +886,7 @@ int DoQueuedPs(void)
FILE *fp; FILE *fp;
int fnoff; int fnoff;
char buffer[512]; char buffer[512];
char *size, *extra; char const *size, *extra;
int num, r, g, b, phase, fontsize, moonsize; int num, r, g, b, phase, fontsize, moonsize;
unsigned char c; unsigned char c;
@@ -1060,7 +1061,7 @@ int DoQueuedPs(void)
void GetSmallLocations(void) void GetSmallLocations(void)
{ {
char c; char c;
char *s = SmallLocation; char const *s = SmallLocation;
int colfirst, collast; int colfirst, collast;
/* Figure out the first and last columns */ /* Figure out the first and last columns */
@@ -1122,7 +1123,7 @@ void GetSmallLocations(void)
/* Read a space-delimited token into an output buffer. */ /* Read a space-delimited token into an output buffer. */
/* */ /* */
/***************************************************************/ /***************************************************************/
char *EatToken(char *in, char *out, int maxlen) char const *EatToken(char const *in, char *out, int maxlen)
{ {
int i = 0; int i = 0;

View File

@@ -25,7 +25,7 @@
/* The structure of a sorted entry */ /* The structure of a sorted entry */
typedef struct sortrem { typedef struct sortrem {
struct sortrem *next; struct sortrem *next;
char *text; char const *text;
int trigdate; int trigdate;
int trigtime; int trigtime;
int typ; int typ;
@@ -35,7 +35,7 @@ typedef struct sortrem {
/* The sorted reminder queue */ /* The sorted reminder queue */
static Sortrem *SortedQueue = (Sortrem *) NULL; static Sortrem *SortedQueue = (Sortrem *) NULL;
static Sortrem *MakeSortRem (int jul, int tim, char *body, int typ, int prio); static Sortrem *MakeSortRem (int jul, int tim, char const *body, int typ, int prio);
static void IssueSortBanner (int jul); static void IssueSortBanner (int jul);
/***************************************************************/ /***************************************************************/
@@ -45,7 +45,7 @@ static void IssueSortBanner (int jul);
/* Create a new Sortrem entry - return NULL on failure. */ /* Create a new Sortrem entry - return NULL on failure. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static Sortrem *MakeSortRem(int jul, int tim, char *body, int typ, int prio) static Sortrem *MakeSortRem(int jul, int tim, char const *body, int typ, int prio)
{ {
Sortrem *new = NEW(Sortrem); Sortrem *new = NEW(Sortrem);
if (!new) return NULL; if (!new) return NULL;
@@ -71,7 +71,7 @@ static Sortrem *MakeSortRem(int jul, int tim, char *body, int typ, int prio)
/* Insert a reminder into the sort buffer */ /* Insert a reminder into the sort buffer */
/* */ /* */
/***************************************************************/ /***************************************************************/
int InsertIntoSortBuffer(int jul, int tim, char *body, int typ, int prio) int InsertIntoSortBuffer(int jul, int tim, char const *body, int typ, int prio)
{ {
Sortrem *new = MakeSortRem(jul, tim, body, typ, prio); Sortrem *new = MakeSortRem(jul, tim, body, typ, prio);
Sortrem *cur = SortedQueue, *prev = NULL; Sortrem *cur = SortedQueue, *prev = NULL;
@@ -154,7 +154,7 @@ void IssueSortedReminders(void)
break; break;
} }
free(cur->text); free((char *) cur->text);
free(cur); free(cur);
cur = next; cur = next;
} }
@@ -173,7 +173,7 @@ static void IssueSortBanner(int jul)
char BanExpr[64]; char BanExpr[64];
int y, m, d; int y, m, d;
Value v; Value v;
char *s = BanExpr; char const *s = BanExpr;
DynamicBuffer buf; DynamicBuffer buf;
if (UserFuncExists("sortbanner") != 1) return; if (UserFuncExists("sortbanner") != 1) return;

View File

@@ -128,7 +128,7 @@ Token NonEnglishToks[] = {
}; };
#endif #endif
static int TokStrCmp (const Token *t, const char *s); static int TokStrCmp (Token const *t, char const *s);
/***************************************************************/ /***************************************************************/
/* */ /* */
@@ -138,7 +138,7 @@ static int TokStrCmp (const Token *t, const char *s);
/* left square bracket, return a T_Illegal type. */ /* left square bracket, return a T_Illegal type. */
/* */ /* */
/***************************************************************/ /***************************************************************/
char *FindInitialToken(Token *tok, char *s) char const *FindInitialToken(Token *tok, char const *s)
{ {
DynamicBuffer buf; DynamicBuffer buf;
DBufInit(&buf); DBufInit(&buf);
@@ -165,7 +165,7 @@ char *FindInitialToken(Token *tok, char *s)
/* Given a string, which token is it? */ /* Given a string, which token is it? */
/* */ /* */
/***************************************************************/ /***************************************************************/
void FindToken(const char *s, Token *tok) void FindToken(char const *s, Token *tok)
{ {
int top, bot, mid, r, max; int top, bot, mid, r, max;
int l; int l;
@@ -252,7 +252,7 @@ void FindToken(const char *s, Token *tok)
/* Rep - *n */ /* Rep - *n */
/* */ /* */
/***************************************************************/ /***************************************************************/
void FindNumericToken(const char *s, Token *t) void FindNumericToken(char const *s, Token *t)
{ {
int mult = 1, hour, min; int mult = 1, hour, min;
@@ -335,10 +335,10 @@ void FindNumericToken(const char *s, Token *t)
/* Compare a token to a string. */ /* Compare a token to a string. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static int TokStrCmp(const Token *t, const char *s) static int TokStrCmp(Token const *t, char const *s)
{ {
register int r; register int r;
char *tk = t->name; char const *tk = t->name;
while(*tk && *s && !(*s == ',' && *(s+1) == 0)) { while(*tk && *s && !(*s == ',' && *(s+1) == 0)) {
r = *tk - tolower(*s); r = *tk - tolower(*s);
tk++; tk++;

View File

@@ -350,7 +350,7 @@ int ComputeTrigger(int today, Trigger *trig, int *err)
{ {
int nattempts = 0, int nattempts = 0,
start = today, start = today,
nextstart, nextstart = 0,
y, m, d, y, m, d,
result; result;
@@ -419,6 +419,14 @@ int ComputeTrigger(int today, Trigger *trig, int *err)
} }
return -1; return -1;
} }
if (trig->skip == SKIP_SKIP &&
IsOmitted(result, trig->localomit) &&
nextstart <= start &&
result >= start) {
nextstart = result + 1;
}
/* Keep scanning... unless there's no point in doing it.*/ /* Keep scanning... unless there's no point in doing it.*/
if (nextstart <= start) { if (nextstart <= start) {
if (result != -1) { if (result != -1) {

View File

@@ -24,7 +24,7 @@ typedef struct {
/* Define the type of operators */ /* Define the type of operators */
typedef struct { typedef struct {
char *name; char const *name;
char prec; char prec;
char type; char type;
int (*func)(void); int (*func)(void);
@@ -73,12 +73,12 @@ typedef struct {
typedef struct { typedef struct {
char isnested; /* Is it a nested expression? */ char isnested; /* Is it a nested expression? */
char allownested; char allownested;
char *text; /* Start of text */ char const *text; /* Start of text */
char *pos; /* Current position */ char const *pos; /* Current position */
char *etext; /* Substituted text */ char const *etext; /* Substituted text */
char *epos; /* Position in substituted text */ char const *epos; /* Position in substituted text */
DynamicBuffer pushedToken; /* Pushed-back token */ DynamicBuffer pushedToken; /* Pushed-back token */
char *tokenPushed; /* NULL if no pushed-back token */ char const *tokenPushed; /* NULL if no pushed-back token */
} Parser; } Parser;
typedef Parser *ParsePtr; /* Pointer to parser structure */ typedef Parser *ParsePtr; /* Pointer to parser structure */

View File

@@ -29,7 +29,7 @@
typedef struct udf_struct { typedef struct udf_struct {
struct udf_struct *next; struct udf_struct *next;
char name[VAR_NAME_LEN+1]; char name[VAR_NAME_LEN+1];
char *text; char const *text;
Var *locals; Var *locals;
char IsActive; char IsActive;
int nargs; int nargs;
@@ -47,7 +47,7 @@ extern Value ValStack[];
extern int ValStackPtr; extern int ValStackPtr;
static void DestroyUserFunc (UserFunc *f); static void DestroyUserFunc (UserFunc *f);
static void FUnset (char *name); static void FUnset (char const *name);
static void FSet (UserFunc *f); static void FSet (UserFunc *f);
static int SetUpLocalVars (UserFunc *f); static int SetUpLocalVars (UserFunc *f);
static void DestroyLocalVals (UserFunc *f); static void DestroyLocalVals (UserFunc *f);
@@ -184,7 +184,7 @@ static void DestroyUserFunc(UserFunc *f)
} }
/* Free the function definition */ /* Free the function definition */
if (f->text) free(f->text); if (f->text) free( (char *) f->text);
/* Free the data structure itself */ /* Free the data structure itself */
free(f); free(f);
@@ -198,7 +198,7 @@ static void DestroyUserFunc(UserFunc *f)
/* it exists. */ /* it exists. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static void FUnset(char *name) static void FUnset(char const *name)
{ {
UserFunc *cur, *prev; UserFunc *cur, *prev;
int h; int h;
@@ -238,12 +238,12 @@ static void FSet(UserFunc *f)
/* Call a user-defined function. */ /* Call a user-defined function. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int CallUserFunc(char *name, int nargs) int CallUserFunc(char const *name, int nargs)
{ {
UserFunc *f; UserFunc *f;
int h = HashVal(name) % FUNC_HASH_SIZE; int h = HashVal(name) % FUNC_HASH_SIZE;
int i; int i;
char *s; char const *s;
/* Search for the function */ /* Search for the function */
f = FuncHash[h]; f = FuncHash[h];
@@ -356,7 +356,7 @@ static void DestroyLocalVals(UserFunc *f)
/* it is defined, or -1 if it is not defined. */ /* it is defined, or -1 if it is not defined. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int UserFuncExists(char *fn) int UserFuncExists(char const *fn)
{ {
UserFunc *f; UserFunc *f;
int h = HashVal(fn) % FUNC_HASH_SIZE; int h = HashVal(fn) % FUNC_HASH_SIZE;

View File

@@ -30,9 +30,9 @@
/* Just like strncpy EXCEPT we ALWAYS copy the trailing 0. */ /* Just like strncpy EXCEPT we ALWAYS copy the trailing 0. */
/* */ /* */
/***************************************************************/ /***************************************************************/
char *StrnCpy(char *dest, const char *source, int n) char *StrnCpy(char *dest, char const *source, int n)
{ {
register char *odest = dest; char *odest = dest;
while (n-- && (*dest++ = *source++)) ; while (n-- && (*dest++ = *source++)) ;
if (*(dest-1)) *dest = 0; if (*(dest-1)) *dest = 0;
@@ -48,7 +48,7 @@ char *StrnCpy(char *dest, const char *source, int n)
/* of the first string, whichever is greater. */ /* of the first string, whichever is greater. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int StrMatch(const char *s1, const char *s2, int n) int StrMatch(char const *s1, char const *s2, int n)
{ {
int l; int l;
if ((l = strlen(s1)) < n) return 0; if ((l = strlen(s1)) < n) return 0;
@@ -60,7 +60,7 @@ int StrMatch(const char *s1, const char *s2, int n)
/* StrinCmp - compare strings, case-insensitive */ /* StrinCmp - compare strings, case-insensitive */
/* */ /* */
/***************************************************************/ /***************************************************************/
int StrinCmp(const char *s1, const char *s2, int n) int StrinCmp(char const *s1, char const *s2, int n)
{ {
register int r; register int r;
while (n && *s1 && *s2) { while (n && *s1 && *s2) {
@@ -80,10 +80,10 @@ int StrinCmp(const char *s1, const char *s2, int n)
/* Like ANSI strdup */ /* Like ANSI strdup */
/* */ /* */
/***************************************************************/ /***************************************************************/
char *StrDup(const char *s) char *StrDup(char const *s)
{ {
char *ret = (char *) malloc(strlen(s)+1); char *ret = malloc(strlen(s)+1);
if (!ret) return (char *) NULL; if (!ret) return NULL;
strcpy(ret, s); strcpy(ret, s);
return ret; return ret;
} }
@@ -95,7 +95,7 @@ char *StrDup(const char *s)
/* Compare strings, case insensitive. */ /* Compare strings, case insensitive. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int StrCmpi(const char *s1, const char *s2) int StrCmpi(char const *s1, char const *s2)
{ {
int r; int r;
while (*s1 && *s2) { while (*s1 && *s2) {

View File

@@ -80,7 +80,7 @@ static int time_sep_func(int do_set, Value *val)
/* Given a string, compute the hash value. */ /* Given a string, compute the hash value. */
/* */ /* */
/***************************************************************/ /***************************************************************/
unsigned int HashVal(const char *str) unsigned int HashVal(char const *str)
{ {
register unsigned int i=0; register unsigned int i=0;
register unsigned int j=1; register unsigned int j=1;
@@ -102,7 +102,7 @@ unsigned int HashVal(const char *str)
/* string. If create is 1, create the variable. */ /* string. If create is 1, create the variable. */
/* */ /* */
/***************************************************************/ /***************************************************************/
Var *FindVar(const char *str, int create) Var *FindVar(char const *str, int create)
{ {
register int h; register int h;
register Var *v; register Var *v;
@@ -139,7 +139,7 @@ Var *FindVar(const char *str, int create)
/* string and delete it. */ /* string and delete it. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int DeleteVar(const char *str) int DeleteVar(char const *str)
{ {
register int h; register int h;
register Var *v; register Var *v;
@@ -168,7 +168,7 @@ int DeleteVar(const char *str)
/* Set the indicate variable to the specified value. */ /* Set the indicate variable to the specified value. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int SetVar(const char *str, Value *val) int SetVar(char const *str, Value *val)
{ {
Var *v = FindVar(str, 1); Var *v = FindVar(str, 1);
@@ -186,7 +186,7 @@ int SetVar(const char *str, Value *val)
/* Get a copy of the value of the variable. */ /* Get a copy of the value of the variable. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int GetVarValue(const char *str, Value *val, Var *locals) int GetVarValue(char const *str, Value *val, Var *locals)
{ {
Var *v; Var *v;
@@ -383,7 +383,7 @@ void DestroyVars(int all)
/* Given the name of a variable, "preserve" it. */ /* Given the name of a variable, "preserve" it. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int PreserveVar(char *name) int PreserveVar(char const *name)
{ {
Var *v; Var *v;
@@ -440,7 +440,7 @@ int DoPreserve (Parser *p)
/* The structure of a system variable */ /* The structure of a system variable */
typedef struct { typedef struct {
char *name; char const *name;
char modifiable; char modifiable;
int type; int type;
void *value; void *value;
@@ -498,8 +498,8 @@ static SysVar SysVarArr[] = {
}; };
#define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) ) #define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
static SysVar *FindSysVar (const char *name); static SysVar *FindSysVar (char const *name);
static void DumpSysVar (const char *name, const SysVar *v); static void DumpSysVar (char const *name, const SysVar *v);
/***************************************************************/ /***************************************************************/
/* */ /* */
/* SetSysVar */ /* SetSysVar */
@@ -507,7 +507,7 @@ static void DumpSysVar (const char *name, const SysVar *v);
/* Set a system variable to the indicated value. */ /* Set a system variable to the indicated value. */
/* */ /* */
/***************************************************************/ /***************************************************************/
int SetSysVar(const char *name, Value *value) int SetSysVar(char const *name, Value *value)
{ {
SysVar *v = FindSysVar(name); SysVar *v = FindSysVar(name);
if (!v) return E_NOSUCH_VAR; if (!v) return E_NOSUCH_VAR;
@@ -542,7 +542,7 @@ int SetSysVar(const char *name, Value *value)
/* Get the value of a system variable */ /* Get the value of a system variable */
/* */ /* */
/***************************************************************/ /***************************************************************/
int GetSysVar(const char *name, Value *val) int GetSysVar(char const *name, Value *val)
{ {
SysVar *v = FindSysVar(name); SysVar *v = FindSysVar(name);
@@ -577,7 +577,7 @@ int GetSysVar(const char *name, Value *val)
/* Find a system var with specified name. */ /* Find a system var with specified name. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static SysVar *FindSysVar(const char *name) static SysVar *FindSysVar(char const *name)
{ {
int top=NUMSYSVARS-1, bottom=0; int top=NUMSYSVARS-1, bottom=0;
int mid=(top + bottom) / 2; int mid=(top + bottom) / 2;
@@ -601,7 +601,7 @@ static SysVar *FindSysVar(const char *name)
/* If name is "", dump all system variables. */ /* If name is "", dump all system variables. */
/* */ /* */
/***************************************************************/ /***************************************************************/
void DumpSysVarByName(const char *name) void DumpSysVarByName(char const *name)
{ {
int i; int i;
SysVar *v; SysVar *v;
@@ -623,7 +623,7 @@ void DumpSysVarByName(const char *name)
/* Dump the system variable. */ /* Dump the system variable. */
/* */ /* */
/***************************************************************/ /***************************************************************/
static void DumpSysVar(const char *name, const SysVar *v) static void DumpSysVar(char const *name, const SysVar *v)
{ {
char buffer[VAR_NAME_LEN+10]; char buffer[VAR_NAME_LEN+10];
@@ -643,7 +643,7 @@ static void DumpSysVar(const char *name, const SysVar *v)
} }
DestroyValue(val); DestroyValue(val);
} else if (v->type == STR_TYPE) { } else if (v->type == STR_TYPE) {
char *s = *((char **)v->value); char const *s = *((char **)v->value);
int y; int y;
Putc('"', ErrFp); Putc('"', ErrFp);
for (y=0; y<MAX_PRT_LEN && *s; y++) { for (y=0; y<MAX_PRT_LEN && *s; y++) {

View File

@@ -1,13 +0,0 @@
/***************************************************************/
/* */
/* VERSION.H */
/* */
/* What version of remind do we have? */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1998 by David F. Skoll */
/* Copyright (C) 1999-2007 by Roaring Penguin Software Inc. */
/* */
/***************************************************************/
#define VERSION "03.01.01"

1
src/version.h.in Normal file
View File

@@ -0,0 +1 @@
#define VERSION "@VERSION@"

View File

@@ -12,7 +12,31 @@
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
TEST_GETENV="foo bar baz" ; export TEST_GETENV TEST_GETENV="foo bar baz" ; export TEST_GETENV
../src/remind -e -dxte ../tests/test.rem 16 feb 1991 > ../tests/test.out echo "Test 1" > ../tests/test.out
echo "" >> ../tests/test.out
../src/remind -e -dxte ../tests/test.rem 16 feb 1991 >> ../tests/test.out
echo "" >> ../tests/test.out
echo "Test 2" >> ../tests/test.out
echo "" >> ../tests/test.out
../src/remind -p ../tests/test2.rem 1 aug 2007 >> ../tests/test.out
echo "" >> ../tests/test.out
echo "Test 3" >> ../tests/test.out
echo "" >> ../tests/test.out
../src/remind -s ../tests/test2.rem 1 aug 2007 >> ../tests/test.out
echo "" >> ../tests/test.out
echo "Test 4" >> ../tests/test.out
echo "" >> ../tests/test.out
../src/remind -sa ../tests/test2.rem 1 aug 2007 >> ../tests/test.out
echo "Test 5" >> ../tests/test.out
echo "" >> ../tests/test.out
../src/remind -p -b0 ../tests/test3.rem 1 aug 2007 >> ../tests/test.out
echo "Test 6" >> ../tests/test.out
echo "" >> ../tests/test.out
../src/remind -p -b1 ../tests/test3.rem 1 aug 2007 >> ../tests/test.out
echo "Test 7" >> ../tests/test.out
echo "" >> ../tests/test.out
../src/remind -p -b2 ../tests/test3.rem 1 aug 2007 >> ../tests/test.out
cmp -s ../tests/test.out ../tests/test.cmp cmp -s ../tests/test.out ../tests/test.cmp
if [ "$?" = "0" ]; then if [ "$?" = "0" ]; then
echo "Remind: Acceptance test PASSED" echo "Remind: Acceptance test PASSED"

View File

@@ -1,3 +1,5 @@
Test 1
# Test file for REMIND # Test file for REMIND
# #
# Use this file to test the date calculation routines # Use this file to test the date calculation routines
@@ -5,8 +7,13 @@
# #
# ./test-rem # From WITHIN Remind source directory! # ./test-rem # From WITHIN Remind source directory!
# Don't evaluate SATISFY expressions if reminder has expired
REM Wed UNTIL 15 Feb 1991 SATISFY [trigdate() > '1990-01-01'] MSG wookie
../tests/test.rem(10): Expired
REM MSG Today is [hebday(today())] [hebmon(today())] [hebyear(today())] REM MSG Today is [hebday(today())] [hebmon(today())] [hebyear(today())]
../tests/test.rem(8): Trig = Saturday, 16 February, 1991 ../tests/test.rem(12): Trig = Saturday, 16 February, 1991
Reminders for Saturday, 16th February, 1991: Reminders for Saturday, 16th February, 1991:
today() => 1991-02-16 today() => 1991-02-16
@@ -26,7 +33,7 @@ y => "Tishrey"
hebdate(1, "Tishrey") => 1991-09-09 hebdate(1, "Tishrey") => 1991-09-09
trigger(1991-09-09) => "9 September 1991" trigger(1991-09-09) => "9 September 1991"
Leaving UserFN _h() => "9 September 1991" Leaving UserFN _h() => "9 September 1991"
../tests/test.rem(11): Trig = Monday, 9 September, 1991 ../tests/test.rem(15): Trig = Monday, 9 September, 1991
[_h(2, "Tishrey")] MSG Rosh Hashana 2 [_h(2, "Tishrey")] MSG Rosh Hashana 2
Entering UserFN _h(2, "Tishrey") Entering UserFN _h(2, "Tishrey")
x => 2 x => 2
@@ -34,7 +41,7 @@ y => "Tishrey"
hebdate(2, "Tishrey") => 1991-09-10 hebdate(2, "Tishrey") => 1991-09-10
trigger(1991-09-10) => "10 September 1991" trigger(1991-09-10) => "10 September 1991"
Leaving UserFN _h() => "10 September 1991" Leaving UserFN _h() => "10 September 1991"
../tests/test.rem(12): Trig = Tuesday, 10 September, 1991 ../tests/test.rem(16): Trig = Tuesday, 10 September, 1991
[_h(3, "Tishrey")] MSG Tzom Gedalia [_h(3, "Tishrey")] MSG Tzom Gedalia
Entering UserFN _h(3, "Tishrey") Entering UserFN _h(3, "Tishrey")
x => 3 x => 3
@@ -42,7 +49,7 @@ y => "Tishrey"
hebdate(3, "Tishrey") => 1991-09-11 hebdate(3, "Tishrey") => 1991-09-11
trigger(1991-09-11) => "11 September 1991" trigger(1991-09-11) => "11 September 1991"
Leaving UserFN _h() => "11 September 1991" Leaving UserFN _h() => "11 September 1991"
../tests/test.rem(13): Trig = Wednesday, 11 September, 1991 ../tests/test.rem(17): Trig = Wednesday, 11 September, 1991
[_h(10, "Tishrey")] MSG Yom Kippur [_h(10, "Tishrey")] MSG Yom Kippur
Entering UserFN _h(10, "Tishrey") Entering UserFN _h(10, "Tishrey")
x => 10 x => 10
@@ -50,7 +57,7 @@ y => "Tishrey"
hebdate(10, "Tishrey") => 1991-09-18 hebdate(10, "Tishrey") => 1991-09-18
trigger(1991-09-18) => "18 September 1991" trigger(1991-09-18) => "18 September 1991"
Leaving UserFN _h() => "18 September 1991" Leaving UserFN _h() => "18 September 1991"
../tests/test.rem(14): Trig = Wednesday, 18 September, 1991 ../tests/test.rem(18): Trig = Wednesday, 18 September, 1991
[_h(15, "Tishrey")] MSG Sukkot 1 [_h(15, "Tishrey")] MSG Sukkot 1
Entering UserFN _h(15, "Tishrey") Entering UserFN _h(15, "Tishrey")
x => 15 x => 15
@@ -58,7 +65,7 @@ y => "Tishrey"
hebdate(15, "Tishrey") => 1991-09-23 hebdate(15, "Tishrey") => 1991-09-23
trigger(1991-09-23) => "23 September 1991" trigger(1991-09-23) => "23 September 1991"
Leaving UserFN _h() => "23 September 1991" Leaving UserFN _h() => "23 September 1991"
../tests/test.rem(15): Trig = Monday, 23 September, 1991 ../tests/test.rem(19): Trig = Monday, 23 September, 1991
[_h(25, "Kislev")] MSG Channuka [_h(25, "Kislev")] MSG Channuka
Entering UserFN _h(25, "Kislev") Entering UserFN _h(25, "Kislev")
x => 25 x => 25
@@ -66,7 +73,7 @@ y => "Kislev"
hebdate(25, "Kislev") => 1991-12-02 hebdate(25, "Kislev") => 1991-12-02
trigger(1991-12-02) => "2 December 1991" trigger(1991-12-02) => "2 December 1991"
Leaving UserFN _h() => "2 December 1991" Leaving UserFN _h() => "2 December 1991"
../tests/test.rem(16): Trig = Monday, 2 December, 1991 ../tests/test.rem(20): Trig = Monday, 2 December, 1991
[_h(10, "Tevet")] MSG Asara B'Tevet [_h(10, "Tevet")] MSG Asara B'Tevet
Entering UserFN _h(10, "Tevet") Entering UserFN _h(10, "Tevet")
x => 10 x => 10
@@ -74,7 +81,7 @@ y => "Tevet"
hebdate(10, "Tevet") => 1991-12-17 hebdate(10, "Tevet") => 1991-12-17
trigger(1991-12-17) => "17 December 1991" trigger(1991-12-17) => "17 December 1991"
Leaving UserFN _h() => "17 December 1991" Leaving UserFN _h() => "17 December 1991"
../tests/test.rem(17): Trig = Tuesday, 17 December, 1991 ../tests/test.rem(21): Trig = Tuesday, 17 December, 1991
[_h(15, "Shvat")] MSG Tu B'Shvat [_h(15, "Shvat")] MSG Tu B'Shvat
Entering UserFN _h(15, "Shvat") Entering UserFN _h(15, "Shvat")
x => 15 x => 15
@@ -82,7 +89,7 @@ y => "Shvat"
hebdate(15, "Shvat") => 1992-01-20 hebdate(15, "Shvat") => 1992-01-20
trigger(1992-01-20) => "20 January 1992" trigger(1992-01-20) => "20 January 1992"
Leaving UserFN _h() => "20 January 1992" Leaving UserFN _h() => "20 January 1992"
../tests/test.rem(18): Trig = Monday, 20 January, 1992 ../tests/test.rem(22): Trig = Monday, 20 January, 1992
[_h(15, "Adar A")] MSG Purim Katan [_h(15, "Adar A")] MSG Purim Katan
Entering UserFN _h(15, "Adar A") Entering UserFN _h(15, "Adar A")
x => 15 x => 15
@@ -90,7 +97,7 @@ y => "Adar A"
hebdate(15, "Adar A") => 1992-02-19 hebdate(15, "Adar A") => 1992-02-19
trigger(1992-02-19) => "19 February 1992" trigger(1992-02-19) => "19 February 1992"
Leaving UserFN _h() => "19 February 1992" Leaving UserFN _h() => "19 February 1992"
../tests/test.rem(19): Trig = Wednesday, 19 February, 1992 ../tests/test.rem(23): Trig = Wednesday, 19 February, 1992
[_h(14, "Adar")] MSG Purim [_h(14, "Adar")] MSG Purim
Entering UserFN _h(14, "Adar") Entering UserFN _h(14, "Adar")
x => 14 x => 14
@@ -98,7 +105,7 @@ y => "Adar"
hebdate(14, "Adar") => 1991-02-28 hebdate(14, "Adar") => 1991-02-28
trigger(1991-02-28) => "28 February 1991" trigger(1991-02-28) => "28 February 1991"
Leaving UserFN _h() => "28 February 1991" Leaving UserFN _h() => "28 February 1991"
../tests/test.rem(20): Trig = Thursday, 28 February, 1991 ../tests/test.rem(24): Trig = Thursday, 28 February, 1991
[_h(15, "Nisan")] MSG Pesach [_h(15, "Nisan")] MSG Pesach
Entering UserFN _h(15, "Nisan") Entering UserFN _h(15, "Nisan")
x => 15 x => 15
@@ -106,7 +113,7 @@ y => "Nisan"
hebdate(15, "Nisan") => 1991-03-30 hebdate(15, "Nisan") => 1991-03-30
trigger(1991-03-30) => "30 March 1991" trigger(1991-03-30) => "30 March 1991"
Leaving UserFN _h() => "30 March 1991" Leaving UserFN _h() => "30 March 1991"
../tests/test.rem(21): Trig = Saturday, 30 March, 1991 ../tests/test.rem(25): Trig = Saturday, 30 March, 1991
[_h(27, "Nisan")] MSG Yom HaShoah [_h(27, "Nisan")] MSG Yom HaShoah
Entering UserFN _h(27, "Nisan") Entering UserFN _h(27, "Nisan")
x => 27 x => 27
@@ -114,7 +121,7 @@ y => "Nisan"
hebdate(27, "Nisan") => 1991-04-11 hebdate(27, "Nisan") => 1991-04-11
trigger(1991-04-11) => "11 April 1991" trigger(1991-04-11) => "11 April 1991"
Leaving UserFN _h() => "11 April 1991" Leaving UserFN _h() => "11 April 1991"
../tests/test.rem(22): Trig = Thursday, 11 April, 1991 ../tests/test.rem(26): Trig = Thursday, 11 April, 1991
[_h(4, "Iyar")] MSG Yom HaZikaron [_h(4, "Iyar")] MSG Yom HaZikaron
Entering UserFN _h(4, "Iyar") Entering UserFN _h(4, "Iyar")
x => 4 x => 4
@@ -122,7 +129,7 @@ y => "Iyar"
hebdate(4, "Iyar") => 1991-04-18 hebdate(4, "Iyar") => 1991-04-18
trigger(1991-04-18) => "18 April 1991" trigger(1991-04-18) => "18 April 1991"
Leaving UserFN _h() => "18 April 1991" Leaving UserFN _h() => "18 April 1991"
../tests/test.rem(23): Trig = Thursday, 18 April, 1991 ../tests/test.rem(27): Trig = Thursday, 18 April, 1991
[_h(5, "Iyar")] MSG Yom Ha'atzmaut [_h(5, "Iyar")] MSG Yom Ha'atzmaut
Entering UserFN _h(5, "Iyar") Entering UserFN _h(5, "Iyar")
x => 5 x => 5
@@ -130,7 +137,7 @@ y => "Iyar"
hebdate(5, "Iyar") => 1991-04-19 hebdate(5, "Iyar") => 1991-04-19
trigger(1991-04-19) => "19 April 1991" trigger(1991-04-19) => "19 April 1991"
Leaving UserFN _h() => "19 April 1991" Leaving UserFN _h() => "19 April 1991"
../tests/test.rem(24): Trig = Friday, 19 April, 1991 ../tests/test.rem(28): Trig = Friday, 19 April, 1991
[_h(28, "Iyar")] MSG Yom Yerushalayim [_h(28, "Iyar")] MSG Yom Yerushalayim
Entering UserFN _h(28, "Iyar") Entering UserFN _h(28, "Iyar")
x => 28 x => 28
@@ -138,7 +145,7 @@ y => "Iyar"
hebdate(28, "Iyar") => 1991-05-12 hebdate(28, "Iyar") => 1991-05-12
trigger(1991-05-12) => "12 May 1991" trigger(1991-05-12) => "12 May 1991"
Leaving UserFN _h() => "12 May 1991" Leaving UserFN _h() => "12 May 1991"
../tests/test.rem(25): Trig = Sunday, 12 May, 1991 ../tests/test.rem(29): Trig = Sunday, 12 May, 1991
[_h(6, "Sivan")] MSG Shavuot [_h(6, "Sivan")] MSG Shavuot
Entering UserFN _h(6, "Sivan") Entering UserFN _h(6, "Sivan")
x => 6 x => 6
@@ -146,7 +153,7 @@ y => "Sivan"
hebdate(6, "Sivan") => 1991-05-19 hebdate(6, "Sivan") => 1991-05-19
trigger(1991-05-19) => "19 May 1991" trigger(1991-05-19) => "19 May 1991"
Leaving UserFN _h() => "19 May 1991" Leaving UserFN _h() => "19 May 1991"
../tests/test.rem(26): Trig = Sunday, 19 May, 1991 ../tests/test.rem(30): Trig = Sunday, 19 May, 1991
[_h(9, "Av")] MSG Tish'a B'Av [_h(9, "Av")] MSG Tish'a B'Av
Entering UserFN _h(9, "Av") Entering UserFN _h(9, "Av")
x => 9 x => 9
@@ -154,7 +161,7 @@ y => "Av"
hebdate(9, "Av") => 1991-07-20 hebdate(9, "Av") => 1991-07-20
trigger(1991-07-20) => "20 July 1991" trigger(1991-07-20) => "20 July 1991"
Leaving UserFN _h() => "20 July 1991" Leaving UserFN _h() => "20 July 1991"
../tests/test.rem(27): Trig = Saturday, 20 July, 1991 ../tests/test.rem(31): Trig = Saturday, 20 July, 1991
# Test some jahrzeit cases # Test some jahrzeit cases
fset _i(x,y,z,a) trigger(hebdate(x,y,z,a)) fset _i(x,y,z,a) trigger(hebdate(x,y,z,a))
@@ -168,7 +175,7 @@ a => 5759
hebdate(30, "Heshvan", 1991-02-16, 5759) => 1991-11-07 hebdate(30, "Heshvan", 1991-02-16, 5759) => 1991-11-07
trigger(1991-11-07) => "7 November 1991" trigger(1991-11-07) => "7 November 1991"
Leaving UserFN _i() => "7 November 1991" Leaving UserFN _i() => "7 November 1991"
../tests/test.rem(31): Trig = Thursday, 7 November, 1991 ../tests/test.rem(35): Trig = Thursday, 7 November, 1991
[_i(30, "Heshvan", today(), 5760)] MSG Complete-Defective [_i(30, "Heshvan", today(), 5760)] MSG Complete-Defective
today() => 1991-02-16 today() => 1991-02-16
Entering UserFN _i(30, "Heshvan", 1991-02-16, 5760) Entering UserFN _i(30, "Heshvan", 1991-02-16, 5760)
@@ -179,7 +186,7 @@ a => 5760
hebdate(30, "Heshvan", 1991-02-16, 5760) => 1991-11-07 hebdate(30, "Heshvan", 1991-02-16, 5760) => 1991-11-07
trigger(1991-11-07) => "7 November 1991" trigger(1991-11-07) => "7 November 1991"
Leaving UserFN _i() => "7 November 1991" Leaving UserFN _i() => "7 November 1991"
../tests/test.rem(32): Trig = Thursday, 7 November, 1991 ../tests/test.rem(36): Trig = Thursday, 7 November, 1991
[_i(30, "Heshvan", today(), 5761)] MSG Illegal [_i(30, "Heshvan", today(), 5761)] MSG Illegal
today() => 1991-02-16 today() => 1991-02-16
Entering UserFN _i(30, "Heshvan", 1991-02-16, 5761) Entering UserFN _i(30, "Heshvan", 1991-02-16, 5761)
@@ -187,7 +194,7 @@ x => 30
y => "Heshvan" y => "Heshvan"
z => 1991-02-16 z => 1991-02-16
a => 5761 a => 5761
hebdate(30, "Heshvan", 1991-02-16, 5761) => ../tests/test.rem(33): 30 Heshvan 5761: Invalid Hebrew date hebdate(30, "Heshvan", 1991-02-16, 5761) => ../tests/test.rem(37): 30 Heshvan 5761: Invalid Hebrew date
Invalid Hebrew date Invalid Hebrew date
Leaving UserFN _i() => Invalid Hebrew date Leaving UserFN _i() => Invalid Hebrew date
@@ -201,7 +208,7 @@ a => 5759
hebdate(30, "Kislev", 1991-02-16, 5759) => 1991-12-07 hebdate(30, "Kislev", 1991-02-16, 5759) => 1991-12-07
trigger(1991-12-07) => "7 December 1991" trigger(1991-12-07) => "7 December 1991"
Leaving UserFN _i() => "7 December 1991" Leaving UserFN _i() => "7 December 1991"
../tests/test.rem(35): Trig = Saturday, 7 December, 1991 ../tests/test.rem(39): Trig = Saturday, 7 December, 1991
[_i(30, "Kislev", today(), 5760)] MSG Complete-Defective [_i(30, "Kislev", today(), 5760)] MSG Complete-Defective
today() => 1991-02-16 today() => 1991-02-16
Entering UserFN _i(30, "Kislev", 1991-02-16, 5760) Entering UserFN _i(30, "Kislev", 1991-02-16, 5760)
@@ -212,7 +219,7 @@ a => 5760
hebdate(30, "Kislev", 1991-02-16, 5760) => 1991-12-07 hebdate(30, "Kislev", 1991-02-16, 5760) => 1991-12-07
trigger(1991-12-07) => "7 December 1991" trigger(1991-12-07) => "7 December 1991"
Leaving UserFN _i() => "7 December 1991" Leaving UserFN _i() => "7 December 1991"
../tests/test.rem(36): Trig = Saturday, 7 December, 1991 ../tests/test.rem(40): Trig = Saturday, 7 December, 1991
[_i(30, "Kislev", today(), 5761)] MSG Illegal [_i(30, "Kislev", today(), 5761)] MSG Illegal
today() => 1991-02-16 today() => 1991-02-16
Entering UserFN _i(30, "Kislev", 1991-02-16, 5761) Entering UserFN _i(30, "Kislev", 1991-02-16, 5761)
@@ -220,7 +227,7 @@ x => 30
y => "Kislev" y => "Kislev"
z => 1991-02-16 z => 1991-02-16
a => 5761 a => 5761
hebdate(30, "Kislev", 1991-02-16, 5761) => ../tests/test.rem(37): 30 Kislev 5761: Invalid Hebrew date hebdate(30, "Kislev", 1991-02-16, 5761) => ../tests/test.rem(41): 30 Kislev 5761: Invalid Hebrew date
Invalid Hebrew date Invalid Hebrew date
Leaving UserFN _i() => Invalid Hebrew date Leaving UserFN _i() => Invalid Hebrew date
@@ -234,7 +241,7 @@ a => 5755
hebdate(30, "Adar A", 1991-02-16, 5755) => 1992-03-05 hebdate(30, "Adar A", 1991-02-16, 5755) => 1992-03-05
trigger(1992-03-05) => "5 March 1992" trigger(1992-03-05) => "5 March 1992"
Leaving UserFN _i() => "5 March 1992" Leaving UserFN _i() => "5 March 1992"
../tests/test.rem(39): Trig = Thursday, 5 March, 1992 ../tests/test.rem(43): Trig = Thursday, 5 March, 1992
[_i(30, "Adar A", today(), 5756)] MSG Illegal [_i(30, "Adar A", today(), 5756)] MSG Illegal
today() => 1991-02-16 today() => 1991-02-16
Entering UserFN _i(30, "Adar A", 1991-02-16, 5756) Entering UserFN _i(30, "Adar A", 1991-02-16, 5756)
@@ -242,7 +249,7 @@ x => 30
y => "Adar A" y => "Adar A"
z => 1991-02-16 z => 1991-02-16
a => 5756 a => 5756
hebdate(30, "Adar A", 1991-02-16, 5756) => ../tests/test.rem(40): No Adar A in 5756 hebdate(30, "Adar A", 1991-02-16, 5756) => ../tests/test.rem(44): No Adar A in 5756
Invalid Hebrew date Invalid Hebrew date
Leaving UserFN _i() => Invalid Hebrew date Leaving UserFN _i() => Invalid Hebrew date
[_i(29, "Adar A", today(), 5755)] MSG Leap [_i(29, "Adar A", today(), 5755)] MSG Leap
@@ -255,7 +262,7 @@ a => 5755
hebdate(29, "Adar A", 1991-02-16, 5755) => 1991-03-15 hebdate(29, "Adar A", 1991-02-16, 5755) => 1991-03-15
trigger(1991-03-15) => "15 March 1991" trigger(1991-03-15) => "15 March 1991"
Leaving UserFN _i() => "15 March 1991" Leaving UserFN _i() => "15 March 1991"
../tests/test.rem(41): Trig = Friday, 15 March, 1991 ../tests/test.rem(45): Trig = Friday, 15 March, 1991
[_i(29, "Adar A", today(), 5756)] MSG Illegal [_i(29, "Adar A", today(), 5756)] MSG Illegal
today() => 1991-02-16 today() => 1991-02-16
Entering UserFN _i(29, "Adar A", 1991-02-16, 5756) Entering UserFN _i(29, "Adar A", 1991-02-16, 5756)
@@ -263,221 +270,221 @@ x => 29
y => "Adar A" y => "Adar A"
z => 1991-02-16 z => 1991-02-16
a => 5756 a => 5756
hebdate(29, "Adar A", 1991-02-16, 5756) => ../tests/test.rem(42): No Adar A in 5756 hebdate(29, "Adar A", 1991-02-16, 5756) => ../tests/test.rem(46): No Adar A in 5756
Invalid Hebrew date Invalid Hebrew date
Leaving UserFN _i() => Invalid Hebrew date Leaving UserFN _i() => Invalid Hebrew date
# Test each possible case of the basic reminders. # Test each possible case of the basic reminders.
REM MSG Every Day REM MSG Every Day
../tests/test.rem(46): Trig = Saturday, 16 February, 1991 ../tests/test.rem(50): Trig = Saturday, 16 February, 1991
Every Day Every Day
REM 18 MSG Every 18th REM 18 MSG Every 18th
../tests/test.rem(48): Trig = Monday, 18 February, 1991 ../tests/test.rem(52): Trig = Monday, 18 February, 1991
REM 15 MSG Every 15th REM 15 MSG Every 15th
../tests/test.rem(49): Trig = Friday, 15 March, 1991 ../tests/test.rem(53): Trig = Friday, 15 March, 1991
REM Feb MSG February REM Feb MSG February
../tests/test.rem(51): Trig = Saturday, 16 February, 1991 ../tests/test.rem(55): Trig = Saturday, 16 February, 1991
February February
REM Jan MSG January REM Jan MSG January
../tests/test.rem(52): Trig = Wednesday, 1 January, 1992 ../tests/test.rem(56): Trig = Wednesday, 1 January, 1992
REM March MSG March REM March MSG March
../tests/test.rem(53): Trig = Friday, 1 March, 1991 ../tests/test.rem(57): Trig = Friday, 1 March, 1991
REM 13 Jan MSG 13 Jan REM 13 Jan MSG 13 Jan
../tests/test.rem(55): Trig = Monday, 13 January, 1992 ../tests/test.rem(59): Trig = Monday, 13 January, 1992
REM 15 Feb MSG 15 Feb REM 15 Feb MSG 15 Feb
../tests/test.rem(56): Trig = Saturday, 15 February, 1992 ../tests/test.rem(60): Trig = Saturday, 15 February, 1992
REM 28 Feb MSG 28 Feb REM 28 Feb MSG 28 Feb
../tests/test.rem(57): Trig = Thursday, 28 February, 1991 ../tests/test.rem(61): Trig = Thursday, 28 February, 1991
REM 29 Feb MSG 29 Feb REM 29 Feb MSG 29 Feb
../tests/test.rem(58): Trig = Saturday, 29 February, 1992 ../tests/test.rem(62): Trig = Saturday, 29 February, 1992
REM 5 Mar MSG 5 Mar REM 5 Mar MSG 5 Mar
../tests/test.rem(59): Trig = Tuesday, 5 March, 1991 ../tests/test.rem(63): Trig = Tuesday, 5 March, 1991
REM 1990 MSG 1990 REM 1990 MSG 1990
../tests/test.rem(61): Expired ../tests/test.rem(65): Expired
REM 1991 MSG 1991 REM 1991 MSG 1991
../tests/test.rem(62): Trig = Saturday, 16 February, 1991 ../tests/test.rem(66): Trig = Saturday, 16 February, 1991
1991 1991
REM 1992 MSG 1991 REM 1992 MSG 1991
../tests/test.rem(63): Trig = Wednesday, 1 January, 1992 ../tests/test.rem(67): Trig = Wednesday, 1 January, 1992
REM 1 1990 MSG 1 1990 REM 1 1990 MSG 1 1990
../tests/test.rem(65): Expired ../tests/test.rem(69): Expired
REM 29 1991 MSG 29 1991 REM 29 1991 MSG 29 1991
../tests/test.rem(66): Trig = Friday, 29 March, 1991 ../tests/test.rem(70): Trig = Friday, 29 March, 1991
REM 29 1992 MSG 29 1992 REM 29 1992 MSG 29 1992
../tests/test.rem(67): Trig = Wednesday, 29 January, 1992 ../tests/test.rem(71): Trig = Wednesday, 29 January, 1992
REM 16 1991 MSG 16 1991 REM 16 1991 MSG 16 1991
../tests/test.rem(68): Trig = Saturday, 16 February, 1991 ../tests/test.rem(72): Trig = Saturday, 16 February, 1991
16 1991 16 1991
REM Jan 1990 MSG Jan 1990 REM Jan 1990 MSG Jan 1990
../tests/test.rem(70): Expired ../tests/test.rem(74): Expired
REM Feb 1991 MSG Feb 1991 REM Feb 1991 MSG Feb 1991
../tests/test.rem(71): Trig = Saturday, 16 February, 1991 ../tests/test.rem(75): Trig = Saturday, 16 February, 1991
Feb 1991 Feb 1991
REM Dec 1991 MSG Dec 1991 REM Dec 1991 MSG Dec 1991
../tests/test.rem(72): Trig = Sunday, 1 December, 1991 ../tests/test.rem(76): Trig = Sunday, 1 December, 1991
REM May 1992 MSG May 1992 REM May 1992 MSG May 1992
../tests/test.rem(73): Trig = Friday, 1 May, 1992 ../tests/test.rem(77): Trig = Friday, 1 May, 1992
REM 1 Jan 1991 MSG 1 Jan 1991 REM 1 Jan 1991 MSG 1 Jan 1991
../tests/test.rem(75): Expired ../tests/test.rem(79): Expired
REM 16 Feb 1991 MSG 16 Feb 1991 REM 16 Feb 1991 MSG 16 Feb 1991
../tests/test.rem(76): Trig = Saturday, 16 February, 1991 ../tests/test.rem(80): Trig = Saturday, 16 February, 1991
16 Feb 1991 16 Feb 1991
REM 29 Dec 1992 MSG 29 Dec 1992 REM 29 Dec 1992 MSG 29 Dec 1992
../tests/test.rem(77): Trig = Tuesday, 29 December, 1992 ../tests/test.rem(81): Trig = Tuesday, 29 December, 1992
REM Sun MSG Sun REM Sun MSG Sun
../tests/test.rem(79): Trig = Sunday, 17 February, 1991 ../tests/test.rem(83): Trig = Sunday, 17 February, 1991
REM Fri Sat Tue MSG Fri Sat Tue REM Fri Sat Tue MSG Fri Sat Tue
../tests/test.rem(80): Trig = Saturday, 16 February, 1991 ../tests/test.rem(84): Trig = Saturday, 16 February, 1991
Fri Sat Tue Fri Sat Tue
REM Sun 16 MSG Sun 16 REM Sun 16 MSG Sun 16
../tests/test.rem(82): Trig = Sunday, 17 February, 1991 ../tests/test.rem(86): Trig = Sunday, 17 February, 1991
REM Mon Tue Wed Thu Fri 1 MSG Mon Tue Wed Thu Fri 1 REM Mon Tue Wed Thu Fri 1 MSG Mon Tue Wed Thu Fri 1
../tests/test.rem(83): Trig = Friday, 1 March, 1991 ../tests/test.rem(87): Trig = Friday, 1 March, 1991
REM Sun Feb MSG Sun Feb REM Sun Feb MSG Sun Feb
../tests/test.rem(85): Trig = Sunday, 17 February, 1991 ../tests/test.rem(89): Trig = Sunday, 17 February, 1991
REM Mon Tue March MSG Mon Tue March REM Mon Tue March MSG Mon Tue March
../tests/test.rem(86): Trig = Monday, 4 March, 1991 ../tests/test.rem(90): Trig = Monday, 4 March, 1991
REM Sun 16 Feb MSG Sun 16 Feb REM Sun 16 Feb MSG Sun 16 Feb
../tests/test.rem(88): Trig = Sunday, 17 February, 1991 ../tests/test.rem(92): Trig = Sunday, 17 February, 1991
REM Mon Tue 10 March MSG Mon Tue 10 March REM Mon Tue 10 March MSG Mon Tue 10 March
../tests/test.rem(89): Trig = Monday, 11 March, 1991 ../tests/test.rem(93): Trig = Monday, 11 March, 1991
REM Sat Sun 1991 MSG Sat Sun 1991 REM Sat Sun 1991 MSG Sat Sun 1991
../tests/test.rem(91): Trig = Saturday, 16 February, 1991 ../tests/test.rem(95): Trig = Saturday, 16 February, 1991
Sat Sun 1991 Sat Sun 1991
REM Mon Tue 1992 MSG Mon Tue 1992 REM Mon Tue 1992 MSG Mon Tue 1992
../tests/test.rem(92): Trig = Monday, 6 January, 1992 ../tests/test.rem(96): Trig = Monday, 6 January, 1992
REM Sun 16 1991 MSG Sun 16 1991 REM Sun 16 1991 MSG Sun 16 1991
../tests/test.rem(94): Trig = Sunday, 17 February, 1991 ../tests/test.rem(98): Trig = Sunday, 17 February, 1991
REM Mon Tue Wed Thu Fri 1 1992 MSG Mon Tue Wed Thu Fri 1 1992 REM Mon Tue Wed Thu Fri 1 1992 MSG Mon Tue Wed Thu Fri 1 1992
../tests/test.rem(95): Trig = Wednesday, 1 January, 1992 ../tests/test.rem(99): Trig = Wednesday, 1 January, 1992
REM Mon Feb 1991 MSG Mon Feb 1991 REM Mon Feb 1991 MSG Mon Feb 1991
../tests/test.rem(97): Trig = Monday, 18 February, 1991 ../tests/test.rem(101): Trig = Monday, 18 February, 1991
REM Tue Jan 1992 MSG Tue Jan 1992 REM Tue Jan 1992 MSG Tue Jan 1992
../tests/test.rem(98): Trig = Tuesday, 7 January, 1992 ../tests/test.rem(102): Trig = Tuesday, 7 January, 1992
REM Sun Mon 16 Feb 1991 MSG Sun Mon 16 Feb 1991 REM Sun Mon 16 Feb 1991 MSG Sun Mon 16 Feb 1991
../tests/test.rem(100): Trig = Sunday, 17 February, 1991 ../tests/test.rem(104): Trig = Sunday, 17 February, 1991
REM Tue 28 Jan 1992 MSG Tue 28 Jan 1992 REM Tue 28 Jan 1992 MSG Tue 28 Jan 1992
../tests/test.rem(101): Trig = Tuesday, 28 January, 1992 ../tests/test.rem(105): Trig = Tuesday, 28 January, 1992
# Try some Backs # Try some Backs
CLEAR-OMIT-CONTEXT CLEAR-OMIT-CONTEXT
REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun
../tests/test.rem(105): Trig = Thursday, 28 February, 1991 ../tests/test.rem(109): Trig = Thursday, 28 February, 1991
REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun
../tests/test.rem(106): Trig = Thursday, 28 February, 1991 ../tests/test.rem(110): Trig = Thursday, 28 February, 1991
OMIT 28 Feb OMIT 28 Feb
REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun (28 Feb omitted) REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun (28 Feb omitted)
../tests/test.rem(109): Trig = Wednesday, 27 February, 1991 ../tests/test.rem(113): Trig = Wednesday, 27 February, 1991
REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun (28 Feb omitted) REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun (28 Feb omitted)
../tests/test.rem(110): Trig = Thursday, 28 February, 1991 ../tests/test.rem(114): Trig = Thursday, 28 February, 1991
CLEAR-OMIT-CONTEXT CLEAR-OMIT-CONTEXT
# Try out UNTIL # Try out UNTIL
REM Wed UNTIL 21 Feb 1991 MSG Wed UNTIL 21 Feb 1991 REM Wed UNTIL 21 Feb 1991 MSG Wed UNTIL 21 Feb 1991
../tests/test.rem(115): Trig = Wednesday, 20 February, 1991 ../tests/test.rem(119): Trig = Wednesday, 20 February, 1991
# Try playing with the OMIT context # Try playing with the OMIT context
OMIT 28 Feb 1991 OMIT 28 Feb 1991
REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted) REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
../tests/test.rem(120): Trig = Wednesday, 27 February, 1991 ../tests/test.rem(124): Trig = Wednesday, 27 February, 1991
REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted) REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
../tests/test.rem(121): Trig = Thursday, 28 February, 1991 ../tests/test.rem(125): Trig = Thursday, 28 February, 1991
REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted) REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
../tests/test.rem(122): Trig = Wednesday, 27 February, 1991 ../tests/test.rem(126): Trig = Wednesday, 27 February, 1991
REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted) REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
../tests/test.rem(123): Trig = Friday, 28 February, 1992 ../tests/test.rem(127): Trig = Friday, 28 February, 1992
REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted) REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
../tests/test.rem(124): Trig = Friday, 1 March, 1991 ../tests/test.rem(128): Trig = Friday, 1 March, 1991
PUSH-OMIT-CONTEXT PUSH-OMIT-CONTEXT
CLEAR-OMIT-CONTEXT CLEAR-OMIT-CONTEXT
REM 1 Mar -1 MSG 1 mar -1 REM 1 Mar -1 MSG 1 mar -1
../tests/test.rem(128): Trig = Thursday, 28 February, 1991
REM 1 Mar --1 MSG 1 mar --1
../tests/test.rem(129): Trig = Thursday, 28 February, 1991
REM 28 Feb BEFORE MSG 28 Feb BEFORE
../tests/test.rem(130): Trig = Thursday, 28 February, 1991
REM 28 Feb SKIP MSG 28 Feb SKIP
../tests/test.rem(131): Trig = Thursday, 28 February, 1991
REM 28 Feb AFTER MSG 28 Feb AFTER
../tests/test.rem(132): Trig = Thursday, 28 February, 1991 ../tests/test.rem(132): Trig = Thursday, 28 February, 1991
REM 1 Mar --1 MSG 1 mar --1
../tests/test.rem(133): Trig = Thursday, 28 February, 1991
REM 28 Feb BEFORE MSG 28 Feb BEFORE
../tests/test.rem(134): Trig = Thursday, 28 February, 1991
REM 28 Feb SKIP MSG 28 Feb SKIP
../tests/test.rem(135): Trig = Thursday, 28 February, 1991
REM 28 Feb AFTER MSG 28 Feb AFTER
../tests/test.rem(136): Trig = Thursday, 28 February, 1991
POP-OMIT-CONTEXT POP-OMIT-CONTEXT
REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted) REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
../tests/test.rem(135): Trig = Wednesday, 27 February, 1991 ../tests/test.rem(139): Trig = Wednesday, 27 February, 1991
REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted) REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
../tests/test.rem(136): Trig = Thursday, 28 February, 1991 ../tests/test.rem(140): Trig = Thursday, 28 February, 1991
REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted) REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
../tests/test.rem(137): Trig = Wednesday, 27 February, 1991 ../tests/test.rem(141): Trig = Wednesday, 27 February, 1991
REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted) REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
../tests/test.rem(138): Trig = Friday, 28 February, 1992 ../tests/test.rem(142): Trig = Friday, 28 February, 1992
REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted) REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
../tests/test.rem(139): Trig = Friday, 1 March, 1991 ../tests/test.rem(143): Trig = Friday, 1 March, 1991
REM 13 March 1991 *1 UNTIL 19 March 1991 MSG 13-19 Mar 91 REM 13 March 1991 *1 UNTIL 19 March 1991 MSG 13-19 Mar 91
../tests/test.rem(142): Trig = Wednesday, 13 March, 1991 ../tests/test.rem(146): Trig = Wednesday, 13 March, 1991
# Test BACK # Test BACK
CLEAR-OMIT-CONTEXT CLEAR-OMIT-CONTEXT
REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1 REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1
../tests/test.rem(146): Trig = Monday, 18 February, 1991 ../tests/test.rem(150): Trig = Monday, 18 February, 1991
OMIT 17 Feb 1991 OMIT 17 Feb 1991
REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1 (17Feb91 omitted) REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1 (17Feb91 omitted)
../tests/test.rem(149): Trig = Monday, 18 February, 1991 ../tests/test.rem(153): Trig = Monday, 18 February, 1991
18 Feb 1991 +1 (17Feb91 omitted) 18 Feb 1991 +1 (17Feb91 omitted)
REM 18 Feb 1991 ++1 MSG 18 Feb 1991 ++1 (17Feb91 omitted) REM 18 Feb 1991 ++1 MSG 18 Feb 1991 ++1 (17Feb91 omitted)
../tests/test.rem(150): Trig = Monday, 18 February, 1991 ../tests/test.rem(154): Trig = Monday, 18 February, 1991
CLEAR-OMIT-CONTEXT CLEAR-OMIT-CONTEXT
# Test the scanfrom clause # Test the scanfrom clause
REM Fri SATISFY 1 REM Fri SATISFY 1
../tests/test.rem(154): Trig = Friday, 22 February, 1991 ../tests/test.rem(158): Trig = Friday, 22 February, 1991
OMIT [trigger(trigdate())] OMIT [trigger(trigdate())]
trigdate() => 1991-02-22 trigdate() => 1991-02-22
trigger(1991-02-22) => "22 February 1991" trigger(1991-02-22) => "22 February 1991"
REM Fri after MSG 23 Feb 1991 REM Fri after MSG 23 Feb 1991
../tests/test.rem(156): Trig = Saturday, 23 February, 1991 ../tests/test.rem(160): Trig = Saturday, 23 February, 1991
CLEAR-OMIT-CONTEXT CLEAR-OMIT-CONTEXT
REM Fri SCANFROM [trigger(today()-7)] SATISFY 1 REM Fri SCANFROM [trigger(today()-7)] SATISFY 1
today() => 1991-02-16 today() => 1991-02-16
1991-02-16 - 7 => 1991-02-09 1991-02-16 - 7 => 1991-02-09
trigger(1991-02-09) => "9 February 1991" trigger(1991-02-09) => "9 February 1991"
../tests/test.rem(158): Trig = Friday, 15 February, 1991 ../tests/test.rem(162): Trig = Friday, 15 February, 1991
OMIT [trigger(trigdate())] OMIT [trigger(trigdate())]
trigdate() => 1991-02-15 trigdate() => 1991-02-15
trigger(1991-02-15) => "15 February 1991" trigger(1991-02-15) => "15 February 1991"
REM Fri after MSG 16 Feb 1991 REM Fri after MSG 16 Feb 1991
../tests/test.rem(160): Trig = Saturday, 16 February, 1991 ../tests/test.rem(164): Trig = Saturday, 16 February, 1991
16 Feb 1991 16 Feb 1991
CLEAR-OMIT-CONTEXT CLEAR-OMIT-CONTEXT
@@ -503,7 +510,7 @@ set a008 coerce("string", 11:44)
coerce("string", 11:44) => "11:44" coerce("string", 11:44) => "11:44"
set a009 coerce("int", "badnews") set a009 coerce("int", "badnews")
coerce("int", "badnews") => Can't coerce coerce("int", "badnews") => Can't coerce
../tests/test.rem(171): Can't coerce ../tests/test.rem(175): Can't coerce
set a010 coerce("int", "12") set a010 coerce("int", "12")
coerce("int", "12") => 12 coerce("int", "12") => 12
set a011 coerce("int", 11:44) set a011 coerce("int", 11:44)
@@ -515,7 +522,7 @@ set a013 date(1992, 2, 2)
date(1992, 2, 2) => 1992-02-02 date(1992, 2, 2) => 1992-02-02
set a014 date(1993, 2, 29) set a014 date(1993, 2, 29)
date(1993, 2, 29) => Bad date specification date(1993, 2, 29) => Bad date specification
../tests/test.rem(176): Bad date specification ../tests/test.rem(180): Bad date specification
set a015 day(today()) set a015 day(today())
today() => 1991-02-16 today() => 1991-02-16
day(1991-02-16) => 16 day(1991-02-16) => 16
@@ -610,15 +617,15 @@ strlen("sadjflkhsldkfhsdlfjhk") => 21
set a050 substr(a049, 2) set a050 substr(a049, 2)
a049 => 21 a049 => 21
substr(21, 2) => Type mismatch substr(21, 2) => Type mismatch
../tests/test.rem(214): Type mismatch ../tests/test.rem(218): Type mismatch
set a051 substr(a050, 2, 6) set a051 substr(a050, 2, 6)
a050 => ../tests/test.rem(215): Undefined variable: a050 a050 => ../tests/test.rem(219): Undefined variable: a050
set a052 time(1+2, 3+4) set a052 time(1+2, 3+4)
1 + 2 => 3 1 + 2 => 3
3 + 4 => 7 3 + 4 => 7
time(3, 7) => 03:07 time(3, 7) => 03:07
rem 10 jan 1992 AT 11:22 CAL rem 10 jan 1992 AT 11:22 CAL
../tests/test.rem(217): Trig = Friday, 10 January, 1992 ../tests/test.rem(221): Trig = Friday, 10 January, 1992
set a053 trigdate() set a053 trigdate()
trigdate() => 1992-01-10 trigdate() => 1992-01-10
set a054 trigtime() set a054 trigtime()
@@ -631,7 +638,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056" "a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH" value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version() set a058 version()
version() => "03.01.00" version() => "03.01.04"
set a059 wkday(today()) set a059 wkday(today())
today() => 1991-02-16 today() => 1991-02-16
wkday(1991-02-16) => "Saturday" wkday(1991-02-16) => "Saturday"
@@ -710,31 +717,31 @@ y => 11:33
x => "foo" x => "foo"
y => 11:33 y => 11:33
"foo" * 11:33 => Type mismatch "foo" * 11:33 => Type mismatch
../tests/test.rem(240): `*': Type mismatch ../tests/test.rem(244): `*': Type mismatch
Leaving UserFN h() => Type mismatch Leaving UserFN h() => Type mismatch
set a074 dosubst("%a %b %c %d %e %f %g %h", '1992/5/5') 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"... dosubst("%a %b %c %d %e %f %g %h", 1992-05-05) => "on Tuesday, 5 May, 1992 in 444 days' tim"...
msg [a074]% msg [a074]%
../tests/test.rem(242): Trig = Saturday, 16 February, 1991 ../tests/test.rem(246): Trig = Saturday, 16 February, 1991
a074 => "on Tuesday, 5 May, 1992 in 444 days' tim"... 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 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') 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"... dosubst("%i %j %k %l %m %n %o %p", 1992-05-05) => "on 05-05 on Tuesday, May 5th, 1992 on Tu"...
msg [a075]% msg [a075]%
../tests/test.rem(244): Trig = Saturday, 16 February, 1991 ../tests/test.rem(248): Trig = Saturday, 16 February, 1991
a075 => "on 05-05 on Tuesday, May 5th, 1992 on Tu"... 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 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') 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"... dosubst("%q %r %s %t %u %v %w %x", 1992-05-05) => "s' 05 th 05 on Tuesday, 5th May, 1992 on"...
msg [a076]% msg [a076]%
../tests/test.rem(246): Trig = Saturday, 16 February, 1991 ../tests/test.rem(250): Trig = Saturday, 16 February, 1991
a076 => "s' 05 th 05 on Tuesday, 5th May, 1992 on"... 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 s' 05 th 05 on Tuesday, 5th May, 1992 on Tuesday, 5th May Tuesday 444
set a077 dosubst("%y %z", '1992/5/5') set a077 dosubst("%y %z", '1992/5/5')
dosubst("%y %z", 1992-05-05) => "1992 92 dosubst("%y %z", 1992-05-05) => "1992 92
" "
msg [a077]% msg [a077]%
../tests/test.rem(248): Trig = Saturday, 16 February, 1991 ../tests/test.rem(252): Trig = Saturday, 16 February, 1991
a077 => "1992 92 a077 => "1992 92
" "
1992 92 1992 92
@@ -772,7 +779,7 @@ dump
a048 "foo" a048 "foo"
a067 "INT" a067 "INT"
a039 "February" a039 "February"
a058 "03.01.00" a058 "03.01.04"
a077 "1992 92 a077 "1992 92
" "
a049 21 a049 21
@@ -828,3 +835,352 @@ dump
a045 "iess" a045 "iess"
a064 1 a064 1
Test 2
# rem2ps begin
August 2007 31 3 0
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
July 31
September 30
2007/08/01 COLOR * * * 0 0 255 Blue Wednesday
2007/08/01 * * * * 0 NonOmit-1
2007/08/01 * * * * 0 NonOmit-2
2007/08/02 COLOR * * * 255 0 0 Red Thursday
2007/08/02 * * * * 1 NonOmit-1
2007/08/02 * * * * 1 NonOmit-2
2007/08/03 SHADE * * * 0 255 0
2007/08/03 * * * * 2 NonOmit-1
2007/08/03 * * * * 2 NonOmit-2
2007/08/04 * * * * 3 NonOmit-1
2007/08/04 * * * * 3 NonOmit-2
2007/08/05 * * * * 4 NonOmit-1
2007/08/05 * * * * 3 NonOmit-2
2007/08/06 * * * * 5 NonOmit-1
2007/08/06 * * * * 3 NonOmit-2
2007/08/06 * * * * Blort
2007/08/07 * * * * 6 NonOmit-1
2007/08/07 * * * * 4 NonOmit-2
2007/08/08 COLOR * * * 0 0 255 Blue Wednesday
2007/08/08 * * * * 7 NonOmit-1
2007/08/08 * * * * 5 NonOmit-2
2007/08/09 COLOR * * * 255 0 0 Red Thursday
2007/08/09 * * * * 8 NonOmit-1
2007/08/09 * * * * 6 NonOmit-2
2007/08/10 SHADE * * * 0 255 0
2007/08/10 * * * * 9 NonOmit-1
2007/08/10 * * * * 7 NonOmit-2
2007/08/11 * * * * 10 NonOmit-1
2007/08/11 * * * * 8 NonOmit-2
2007/08/12 MOON * * * 0
2007/08/12 * * * * 11 NonOmit-1
2007/08/12 * * * * 8 NonOmit-2
2007/08/13 * * * * 12 NonOmit-1
2007/08/13 * * * * 8 NonOmit-2
2007/08/14 * * * * 13 NonOmit-1
2007/08/14 * * * * 9 NonOmit-2
2007/08/15 COLOR * * * 0 0 255 Blue Wednesday
2007/08/15 * * * * 13 NonOmit-1
2007/08/15 * * * * 9 NonOmit-2
2007/08/16 COLOR * * * 255 0 0 Red Thursday
2007/08/16 * * * * 14 NonOmit-1
2007/08/16 * * * * 10 NonOmit-2
2007/08/17 SHADE * * * 0 255 0
2007/08/17 * * * * 15 NonOmit-1
2007/08/17 * * * * 11 NonOmit-2
2007/08/18 * * * * 16 NonOmit-1
2007/08/18 * * * * 12 NonOmit-2
2007/08/19 * * * * 17 NonOmit-1
2007/08/19 * * * * 12 NonOmit-2
2007/08/20 COLOR * * 825 6 7 8 1:45pm Mooo!
2007/08/20 * * * * 18 NonOmit-1
2007/08/20 * * * * 12 NonOmit-2
2007/08/20 * * * * Blort
2007/08/21 PostScript * * 115 (wookie) show
2007/08/21 * * * * 19 NonOmit-1
2007/08/21 * * * * 13 NonOmit-2
2007/08/22 COLOR * * * 0 0 255 Blue Wednesday
2007/08/22 * * * * 20 NonOmit-1
2007/08/22 * * * * 14 NonOmit-2
2007/08/22 PostScript * * * (cabbage) show
2007/08/23 blort * * 1004 snoo glup
2007/08/23 COLOR * * * 255 0 0 Red Thursday
2007/08/23 * * * * 21 NonOmit-1
2007/08/23 * * * * 15 NonOmit-2
2007/08/24 SHADE * * * 0 255 0
2007/08/24 * * * * 22 NonOmit-1
2007/08/24 * * * * 16 NonOmit-2
2007/08/24 blort * * * gulp wookie
2007/08/25 * * * * 23 NonOmit-1
2007/08/25 * * * * 17 NonOmit-2
2007/08/26 * * * * 24 NonOmit-1
2007/08/26 * * * * 17 NonOmit-2
2007/08/27 * * * * 25 NonOmit-1
2007/08/27 * * * * 17 NonOmit-2
2007/08/27 * * * * Blort
2007/08/28 * * * * 26 NonOmit-1
2007/08/28 * * * * 18 NonOmit-2
2007/08/29 COLOR * * * 0 0 255 Blue Wednesday
2007/08/29 * * * * 27 NonOmit-1
2007/08/29 * * * * 19 NonOmit-2
2007/08/30 COLOR * * * 255 0 0 Red Thursday
2007/08/30 * * * * 28 NonOmit-1
2007/08/30 * * * * 20 NonOmit-2
2007/08/31 SHADE * * * 0 255 0
2007/08/31 * * * * 29 NonOmit-1
2007/08/31 * * * * 21 NonOmit-2
# rem2ps end
Test 3
2007/08/01 COLOR * * * 0 0 255 Blue Wednesday
2007/08/01 * * * * 0 NonOmit-1
2007/08/01 * * * * 0 NonOmit-2
2007/08/02 COLOR * * * 255 0 0 Red Thursday
2007/08/02 * * * * 1 NonOmit-1
2007/08/02 * * * * 1 NonOmit-2
2007/08/03 * * * * 2 NonOmit-1
2007/08/03 * * * * 2 NonOmit-2
2007/08/04 * * * * 3 NonOmit-1
2007/08/04 * * * * 3 NonOmit-2
2007/08/05 * * * * 4 NonOmit-1
2007/08/05 * * * * 3 NonOmit-2
2007/08/06 * * * * 5 NonOmit-1
2007/08/06 * * * * 3 NonOmit-2
2007/08/06 * * * * Blort
2007/08/07 * * * * 6 NonOmit-1
2007/08/07 * * * * 4 NonOmit-2
2007/08/08 COLOR * * * 0 0 255 Blue Wednesday
2007/08/08 * * * * 7 NonOmit-1
2007/08/08 * * * * 5 NonOmit-2
2007/08/09 COLOR * * * 255 0 0 Red Thursday
2007/08/09 * * * * 8 NonOmit-1
2007/08/09 * * * * 6 NonOmit-2
2007/08/10 * * * * 9 NonOmit-1
2007/08/10 * * * * 7 NonOmit-2
2007/08/11 * * * * 10 NonOmit-1
2007/08/11 * * * * 8 NonOmit-2
2007/08/12 * * * * 11 NonOmit-1
2007/08/12 * * * * 8 NonOmit-2
2007/08/13 * * * * 12 NonOmit-1
2007/08/13 * * * * 8 NonOmit-2
2007/08/14 * * * * 13 NonOmit-1
2007/08/14 * * * * 9 NonOmit-2
2007/08/15 COLOR * * * 0 0 255 Blue Wednesday
2007/08/15 * * * * 13 NonOmit-1
2007/08/15 * * * * 9 NonOmit-2
2007/08/16 COLOR * * * 255 0 0 Red Thursday
2007/08/16 * * * * 14 NonOmit-1
2007/08/16 * * * * 10 NonOmit-2
2007/08/17 * * * * 15 NonOmit-1
2007/08/17 * * * * 11 NonOmit-2
2007/08/18 * * * * 16 NonOmit-1
2007/08/18 * * * * 12 NonOmit-2
2007/08/19 * * * * 17 NonOmit-1
2007/08/19 * * * * 12 NonOmit-2
2007/08/20 COLOR * * 825 6 7 8 1:45pm Mooo!
2007/08/20 * * * * 18 NonOmit-1
2007/08/20 * * * * 12 NonOmit-2
2007/08/20 * * * * Blort
2007/08/21 * * * * 19 NonOmit-1
2007/08/21 * * * * 13 NonOmit-2
2007/08/22 COLOR * * * 0 0 255 Blue Wednesday
2007/08/22 * * * * 20 NonOmit-1
2007/08/22 * * * * 14 NonOmit-2
2007/08/23 COLOR * * * 255 0 0 Red Thursday
2007/08/23 * * * * 21 NonOmit-1
2007/08/23 * * * * 15 NonOmit-2
2007/08/24 * * * * 22 NonOmit-1
2007/08/24 * * * * 16 NonOmit-2
2007/08/25 * * * * 23 NonOmit-1
2007/08/25 * * * * 17 NonOmit-2
2007/08/26 * * * * 24 NonOmit-1
2007/08/26 * * * * 17 NonOmit-2
2007/08/27 * * * * 25 NonOmit-1
2007/08/27 * * * * 17 NonOmit-2
2007/08/27 * * * * Blort
2007/08/28 * * * * 26 NonOmit-1
2007/08/28 * * * * 18 NonOmit-2
2007/08/29 COLOR * * * 0 0 255 Blue Wednesday
2007/08/29 * * * * 27 NonOmit-1
2007/08/29 * * * * 19 NonOmit-2
2007/08/30 COLOR * * * 255 0 0 Red Thursday
2007/08/30 * * * * 28 NonOmit-1
2007/08/30 * * * * 20 NonOmit-2
2007/08/31 * * * * 29 NonOmit-1
2007/08/31 * * * * 21 NonOmit-2
Test 4
2007/08/01 COLOR * * * 0 0 255 Blue Wednesday
2007/08/01 * * * * 0 NonOmit-1
2007/08/01 * * * * 0 NonOmit-2
2007/08/02 COLOR * * * 255 0 0 Red Thursday
2007/08/02 * * * * 1 NonOmit-1
2007/08/02 * * * * 1 NonOmit-2
2007/08/03 * * * * 2 NonOmit-1
2007/08/03 * * * * 2 NonOmit-2
2007/08/04 * * * * 3 NonOmit-1
2007/08/04 * * * * 3 NonOmit-2
2007/08/05 * * * * 4 NonOmit-1
2007/08/05 * * * * 3 NonOmit-2
2007/08/06 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
2007/08/06 * * * * 5 NonOmit-1
2007/08/06 * * * * 3 NonOmit-2
2007/08/06 * * * * Blort
2007/08/07 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
2007/08/07 * * * * 6 NonOmit-1
2007/08/07 * * * * 4 NonOmit-2
2007/08/08 COLOR * * * 0 0 255 Blue Wednesday
2007/08/08 * * * * 7 NonOmit-1
2007/08/08 * * * * 5 NonOmit-2
2007/08/09 COLOR * * * 255 0 0 Red Thursday
2007/08/09 * * * * 8 NonOmit-1
2007/08/09 * * * * 6 NonOmit-2
2007/08/10 * * * * 9 NonOmit-1
2007/08/10 * * * * 7 NonOmit-2
2007/08/11 * * * * 10 NonOmit-1
2007/08/11 * * * * 8 NonOmit-2
2007/08/12 COLOR * * * 0 0 255 Blue Wednesday is in 3 days' time
2007/08/12 * * * * 11 NonOmit-1
2007/08/12 * * * * 8 NonOmit-2
2007/08/13 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
2007/08/13 * * * * 12 NonOmit-1
2007/08/13 * * * * 8 NonOmit-2
2007/08/14 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
2007/08/14 * * * * 13 NonOmit-1
2007/08/14 * * * * 9 NonOmit-2
2007/08/15 COLOR * * * 0 0 255 Blue Wednesday
2007/08/15 * * * * 13 NonOmit-1
2007/08/15 * * * * 9 NonOmit-2
2007/08/16 COLOR * * * 255 0 0 Red Thursday
2007/08/16 * * * * 14 NonOmit-1
2007/08/16 * * * * 10 NonOmit-2
2007/08/17 * * * * 15 NonOmit-1
2007/08/17 * * * * 11 NonOmit-2
2007/08/18 * * * * 16 NonOmit-1
2007/08/18 * * * * 12 NonOmit-2
2007/08/19 * * * * 17 NonOmit-1
2007/08/19 * * * * 12 NonOmit-2
2007/08/20 COLOR * * 825 6 7 8 1:45pm Mooo!
2007/08/20 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
2007/08/20 * * * * 18 NonOmit-1
2007/08/20 * * * * 12 NonOmit-2
2007/08/20 * * * * Blort
2007/08/21 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
2007/08/21 * * * * 19 NonOmit-1
2007/08/21 * * * * 13 NonOmit-2
2007/08/22 COLOR * * * 0 0 255 Blue Wednesday
2007/08/22 * * * * 20 NonOmit-1
2007/08/22 * * * * 14 NonOmit-2
2007/08/23 COLOR * * * 255 0 0 Red Thursday
2007/08/23 * * * * 21 NonOmit-1
2007/08/23 * * * * 15 NonOmit-2
2007/08/24 * * * * 22 NonOmit-1
2007/08/24 * * * * 16 NonOmit-2
2007/08/25 * * * * 23 NonOmit-1
2007/08/25 * * * * 17 NonOmit-2
2007/08/26 * * * * 24 NonOmit-1
2007/08/26 * * * * 17 NonOmit-2
2007/08/27 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
2007/08/27 * * * * 25 NonOmit-1
2007/08/27 * * * * 17 NonOmit-2
2007/08/27 * * * * Blort
2007/08/28 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
2007/08/28 * * * * 26 NonOmit-1
2007/08/28 * * * * 18 NonOmit-2
2007/08/29 COLOR * * * 0 0 255 Blue Wednesday
2007/08/29 * * * * 27 NonOmit-1
2007/08/29 * * * * 19 NonOmit-2
2007/08/30 COLOR * * * 255 0 0 Red Thursday
2007/08/30 * * * * 28 NonOmit-1
2007/08/30 * * * * 20 NonOmit-2
2007/08/31 * * * * 29 NonOmit-1
2007/08/31 * * * * 21 NonOmit-2
Test 5
# rem2ps begin
August 2007 31 3 0
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
July 31
September 30
2007/08/01 * * * 660 11:00am Wookie
2007/08/01 * * 45 660 11:00-11:45am Lettuce
2007/08/01 * * 105 660 11:00am-12:45pm Apple
2007/08/01 * * 885 660 11:00am-1:45am+1 Green
2007/08/01 * * 1485 660 11:00am-11:45am+1 Yellow
2007/08/01 * * 2205 660 11:00am-11:45pm+1 Purple
2007/08/01 * * 2925 660 11:00am-11:45am+2 Sad
2007/08/01 * * * 720 12:00pm Cookie
2007/08/01 * * 45 720 12:00-12:45pm Cabbage
2007/08/01 * * 165 720 12:00-2:45pm Pear
2007/08/01 * * 885 720 12:00pm-2:45am+1 Blue
2007/08/01 * * 1485 720 12:00pm-12:45pm+1 Orange
2007/08/01 * * 2205 720 12:00pm-12:45am+2 Black
2007/08/01 * * 2925 720 12:00pm-12:45pm+2 Happy
2007/08/01 * * * 780 1:00pm Snookie
2007/08/01 * * 45 780 1:00-1:45pm Tomato
2007/08/01 * * 225 780 1:00-4:45pm Grape
2007/08/01 * * 885 780 1:00pm-3:45am+1 Red
2007/08/01 * * 1485 780 1:00pm-1:45pm+1 Magenta
2007/08/01 * * 2205 780 1:00pm-1:45am+2 Brown
2007/08/01 * * 2925 780 1:00pm-1:45pm+2 Strange
# rem2ps end
Test 6
# rem2ps begin
August 2007 31 3 0
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
July 31
September 30
2007/08/01 * * * 660 11:00 Wookie
2007/08/01 * * 45 660 11:00-11:45 Lettuce
2007/08/01 * * 105 660 11:00-12:45 Apple
2007/08/01 * * 885 660 11:00-01:45+1 Green
2007/08/01 * * 1485 660 11:00-11:45+1 Yellow
2007/08/01 * * 2205 660 11:00-23:45+1 Purple
2007/08/01 * * 2925 660 11:00-11:45+2 Sad
2007/08/01 * * * 720 12:00 Cookie
2007/08/01 * * 45 720 12:00-12:45 Cabbage
2007/08/01 * * 165 720 12:00-14:45 Pear
2007/08/01 * * 885 720 12:00-02:45+1 Blue
2007/08/01 * * 1485 720 12:00-12:45+1 Orange
2007/08/01 * * 2205 720 12:00-00:45+2 Black
2007/08/01 * * 2925 720 12:00-12:45+2 Happy
2007/08/01 * * * 780 13:00 Snookie
2007/08/01 * * 45 780 13:00-13:45 Tomato
2007/08/01 * * 225 780 13:00-16:45 Grape
2007/08/01 * * 885 780 13:00-03:45+1 Red
2007/08/01 * * 1485 780 13:00-13:45+1 Magenta
2007/08/01 * * 2205 780 13:00-01:45+2 Brown
2007/08/01 * * 2925 780 13:00-13:45+2 Strange
# rem2ps end
Test 7
# rem2ps begin
August 2007 31 3 0
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
July 31
September 30
2007/08/01 * * * 660 Wookie
2007/08/01 * * 45 660 Lettuce
2007/08/01 * * 105 660 Apple
2007/08/01 * * 885 660 Green
2007/08/01 * * 1485 660 Yellow
2007/08/01 * * 2205 660 Purple
2007/08/01 * * 2925 660 Sad
2007/08/01 * * * 720 Cookie
2007/08/01 * * 45 720 Cabbage
2007/08/01 * * 165 720 Pear
2007/08/01 * * 885 720 Blue
2007/08/01 * * 1485 720 Orange
2007/08/01 * * 2205 720 Black
2007/08/01 * * 2925 720 Happy
2007/08/01 * * * 780 Snookie
2007/08/01 * * 45 780 Tomato
2007/08/01 * * 225 780 Grape
2007/08/01 * * 885 780 Red
2007/08/01 * * 1485 780 Magenta
2007/08/01 * * 2205 780 Brown
2007/08/01 * * 2925 780 Strange
# rem2ps end

View File

@@ -5,6 +5,10 @@
# #
# ./test-rem # From WITHIN Remind source directory! # ./test-rem # From WITHIN Remind source directory!
# Don't evaluate SATISFY expressions if reminder has expired
REM Wed UNTIL 15 Feb 1991 SATISFY [trigdate() > '1990-01-01'] MSG wookie
REM MSG Today is [hebday(today())] [hebmon(today())] [hebyear(today())] REM MSG Today is [hebday(today())] [hebmon(today())] [hebyear(today())]
fset _h(x, y) trigger(hebdate(x,y)) fset _h(x, y) trigger(hebdate(x,y))

View File

@@ -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() => "MSDOS"
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.19"
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.19"
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 "MSDOS"
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

View File

@@ -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() => "OS/2"
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.19"
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.19"
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 "OS/2"
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

43
tests/test2.rem Normal file
View File

@@ -0,0 +1,43 @@
# Make things sane
set $TimeSep ":"
set $DateSep "/"
set $LatDeg 45
set $LatMin 24
set $LatSec 0
set $Location "Ottawa"
set $LongDeg 75
set $LongMin 39
set $LongSec 0
clear-omit-context
omit 14 aug
# Test the SPECIAL COLOR escapes
REM WED +2 SPECIAL COLOR 0 0 255 %"Blue Wednesday%" is %b
REM THU SPECIAL COLOR 255 0 0 Red Thursday
# Test SPECIAL SHADE
REM FRI SPECIAL SHADE 0 255 0
# Test SPECIAL MOON
REM 12 AUG SPECIAL MOON 0
# Test nonomitted
REM MSG [nonomitted('2007-08-01', today())] NonOmit-1
REM MSG [nonomitted('2007-08-01', today(), "Sat", "Sun")] NonOmit-2
# Test SPECIAL COLOR with an AT clause
REM 20 AUG AT 13:45 SPECIAL COLOR 6 7 8 Mooo!
# Test SPECIAL PostScript with and without AT clause
REM 21 AUG AT 1:55 SPECIAL PostScript (wookie) show
REM 22 AUG SPECIAL PostScript (cabbage) show
# Test a random SPECIAL with and without AT
REM 23 AUG AT 16:44 SPECIAL blort snoo glup
REM 24 AUG SPECIAL blort gulp wookie
# Bug discovered by Paul Pelzl
OMIT 13 August
REM 6 August 2007 *7 SKIP SATISFY [1] MSG Blort

29
tests/test3.rem Normal file
View File

@@ -0,0 +1,29 @@
REM 1 AT 11:00 MSG Wookie
REM 1 AT 12:00 MSG Cookie
REM 1 AT 13:00 MSG Snookie
REM 1 AT 11:00 DURATION 0:45 MSG Lettuce
REM 1 AT 12:00 DURATION 0:45 MSG Cabbage
REM 1 AT 13:00 DURATION 0:45 MSG Tomato
REM 1 AT 11:00 DURATION 1:45 MSG Apple
REM 1 AT 12:00 DURATION 2:45 MSG Pear
REM 1 AT 13:00 DURATION 3:45 MSG Grape
REM 1 AT 11:00 DURATION 14:45 MSG Green
REM 1 AT 12:00 DURATION 14:45 MSG Blue
REM 1 AT 13:00 DURATION 14:45 MSG Red
REM 1 AT 11:00 DURATION 24:45 MSG Yellow
REM 1 AT 12:00 DURATION 24:45 MSG Orange
REM 1 AT 13:00 DURATION 24:45 MSG Magenta
REM 1 AT 11:00 DURATION 36:45 MSG Purple
REM 1 AT 12:00 DURATION 36:45 MSG Black
REM 1 AT 13:00 DURATION 36:45 MSG Brown
REM 1 AT 11:00 DURATION 48:45 MSG Sad
REM 1 AT 12:00 DURATION 48:45 MSG Happy
REM 1 AT 13:00 DURATION 48:45 MSG Strange

View File

@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
echo "Unconfiguring Remind..." echo "Unconfiguring Remind..."
echo rm -f config.cache config.log config.status src/Makefile src/config.h echo rm -f config.cache config.log config.status src/Makefile src/config.h src/version.h
rm -f config.cache config.log config.status src/Makefile src/config.h rm -f config.cache config.log config.status src/Makefile src/config.h src/version.h
exit 0 exit 0

View File

@@ -1,95 +0,0 @@
# Makefile for installing WWW server calendar scripts
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# Copyright (C) 1999 by Roaring Penguin Software Inc.
# The complete name of your www host. Example: www.mycompany.com
WWWHOST = magnesium.roaringpenguin.com
# WWWHOST = www.mycompany.com
# The complete path to where the scripts actually live, as seen by
# the UNIX operating system.
SCRIPTDIR = /var/www/cgi-bin
# SCRIPTDIR = /home/dfs/Remind/www/TEST
# Where the scripts live as seen by the web browser. If
# they live in WWWHOST/cgi-bin, supply /cgi-bin
CGIDIR = /cgi-bin
# The complete path to the directory containing the HTML file "calendar.html".
# This is a sample file containing links to all the scripts. This path
# should be the path as seen by the UNIX operating system
HTMLDIR = /var/www/html/remind
# Where you stick images, as seen by UNIX
IMAGEDIR = /var/www/html/remind
# Where images are, as seen by web browers
IMAGEBASE = /remind
# Location. Typically, the name of your city or town. Example: Ottawa
LOCATION = Ottawa
# LOCATION = New York
# Where do Remind and Rem2PS executables live?
REMIND = /usr/local/bin/remind
REM2PS = /usr/local/bin/rem2ps
# If your Web server requires CGI programs to have a .cgi suffix, use
# the next line. Otherwise, comment it out
CGISUFFIX=.cgi
# Don't change stuff below here.
# --------------------------------------------------------------------
# Construct a rotten mean nasty sed script to do the dirty work
SEDSCRIPT = -e 's/Ottawa/$(LOCATION)/g' \
-e 's@http://your.machine/your.dir@http://$(WWWHOST)$(CGIDIR)@g' \
-e 's@%SCRIPTDIR%@$(SCRIPTDIR)@g' \
-e 's@%REMIND%@$(REMIND)@g' \
-e 's@%IMAGEBASE%@$(IMAGEBASE)@g' \
-e 's@%REM2PS%@$(REM2PS)@g' \
-e 's@cal_dispatch@cal_dispatch$(CGISUFFIX)@g' \
-e 's@rem2html@rem2html$(CGISUFFIX)@g'
SEDSCRIPT2 = -e 's/Ottawa/$(LOCATION)/g' \
-e 's@http://your.machine/your.dir@http://$(WWWHOST)$(CGIDIR)@g' \
-e 's@%SCRIPTDIR%@$(SCRIPTDIR)@g' \
-e 's@%REMIND%@$(REMIND)@g' \
-e 's@%IMAGEBASE%@$(IMAGEBASE)@g' \
-e 's@%REM2PS%@$(REM2PS)@g'
all:
@echo "Edit the Makefile; then type 'make install' to install"
@echo "the www server scripts."
# OK, it's abominable. But it works...
install:
-mkdir $(SCRIPTDIR)
cp calps hebdate hebps hebhtml moon sunrise sunset $(SCRIPTDIR)
sed $(SEDSCRIPT) < cal_dispatch-DIST > $(SCRIPTDIR)/cal_dispatch$(CGISUFFIX)
sed $(SEDSCRIPT) < hebdate.rem-DIST > $(SCRIPTDIR)/hebdate.rem
sed $(SEDSCRIPT) < moon.rem-DIST > $(SCRIPTDIR)/moon.rem
sed $(SEDSCRIPT) < sunrise.rem-DIST > $(SCRIPTDIR)/sunrise.rem
sed $(SEDSCRIPT) < sunset.rem-DIST > $(SCRIPTDIR)/sunset.rem
sed $(SEDSCRIPT) < calendar.html-DIST > $(HTMLDIR)/calendar.html
sed $(SEDSCRIPT) < hebhtml > $(SCRIPTDIR)/hebhtml
sed $(SEDSCRIPT2) < rem2html > $(SCRIPTDIR)/rem2html$(CGISUFFIX)
chmod 644 $(SCRIPTDIR)/sunrise.rem
chmod 644 $(SCRIPTDIR)/moon.rem
chmod 644 $(SCRIPTDIR)/hebdate.rem
chmod 644 $(SCRIPTDIR)/sunset.rem
chmod 644 $(HTMLDIR)/calendar.html
chmod 755 $(SCRIPTDIR)/cal_dispatch$(CGISUFFIX)
chmod 755 $(SCRIPTDIR)/rem2html$(CGISUFFIX)
chmod 755 $(SCRIPTDIR)/calps $(SCRIPTDIR)/hebdate \
$(SCRIPTDIR)/hebps $(SCRIPTDIR)/moon $(SCRIPTDIR)/sunrise \
$(SCRIPTDIR)/sunset $(SCRIPTDIR)/hebhtml $(SCRIPTDIR)/rem2html$(CGISUFFIX)
-mkdir $(IMAGEDIR)
cp firstquarter.png fullmoon.png lastquarter.png newmoon.png $(IMAGEDIR)
chmod 644 $(IMAGEDIR)/firstquarter.png $(IMAGEDIR)/fullmoon.png $(IMAGEDIR)/lastquarter.png $(IMAGEDIR)/newmoon.png

100
www/Makefile.in Normal file
View File

@@ -0,0 +1,100 @@
# Makefile.in for installing WWW server calendar scripts
# This file is part of REMIND.
# Copyright (C) 1992-1997 by David F. Skoll
# Copyright (C) 1999-2007 by Roaring Penguin Software Inc.
# The complete path to where the scripts actually live, as seen by
# the UNIX operating system.
SCRIPTDIR = /var/www/cgi-bin
# Where the scripts live as seen by the web browser.
CGIDIR = /cgi-bin
# The complete path to the directory containing the HTML file "calendar.html".
# This is a sample file containing links to all the scripts. This path
# should be the path as seen by the UNIX operating system
HTMLDIR = /var/www/remind
# Where you stick images and CSS files, as seen by UNIX
IMAGEDIR = /var/www/remind/resources
# Where images are, as seen by web browers
IMAGEBASE = /remind/resources
# Set by configure - don't touch.
srcdir=@srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
mandir=@mandir@
bindir=@bindir@
datadir=@datadir@
datarootdir=@datarootdir@
# Where do Remind and Rem2PS executables live?
REMIND = $(bindir)/remind
REM2PS = $(bindir)/rem2ps
# If your Web server requires CGI programs to have a .cgi suffix, use
# the next line. Otherwise, comment it out
CGISUFFIX=.cgi
# Don't change stuff below here.
# --------------------------------------------------------------------
# Construct a rotten mean nasty sed script to do the dirty work
SEDSCRIPT = -e 's@%CGIDIR%@$(CGIDIR)@g' \
-e 's@%SCRIPTDIR%@$(SCRIPTDIR)@g' \
-e 's@%REMIND%@$(REMIND)@g' \
-e 's@%IMAGEBASE%@$(IMAGEBASE)@g' \
-e 's@%REM2PS%@$(REM2PS)@g' \
-e 's@cal_dispatch@cal_dispatch$(CGISUFFIX)@g' \
-e 's@rem2html@rem2html$(CGISUFFIX)@g'
SEDSCRIPT2 = -e 's@%CGIDIR%@$(CGIDIR)@g' \
-e 's@%SCRIPTDIR%@$(SCRIPTDIR)@g' \
-e 's@%REMIND%@$(REMIND)@g' \
-e 's@%IMAGEBASE%@$(IMAGEBASE)@g' \
-e 's@%REM2PS%@$(REM2PS)@g'
all:
@echo "Edit the Makefile; then type 'make install' to install"
@echo "the www server scripts."
# OK, it's abominable. But it works...
install:
-mkdir -p $(DESTDIR)$(SCRIPTDIR)
-mkdir -p $(DESTDIR)$(HTMLDIR)
cp calps hebdate hebps hebhtml moon sunrise sunset $(DESTDIR)$(SCRIPTDIR)
sed $(SEDSCRIPT) < cal_dispatch-DIST > $(DESTDIR)$(SCRIPTDIR)/cal_dispatch$(CGISUFFIX)
sed $(SEDSCRIPT) < hebdate.rem-DIST > $(DESTDIR)$(SCRIPTDIR)/hebdate.rem
sed $(SEDSCRIPT) < moon.rem-DIST > $(DESTDIR)$(SCRIPTDIR)/moon.rem
sed $(SEDSCRIPT) < sunrise.rem-DIST > $(DESTDIR)$(SCRIPTDIR)/sunrise.rem
sed $(SEDSCRIPT) < sunset.rem-DIST > $(DESTDIR)$(SCRIPTDIR)/sunset.rem
sed $(SEDSCRIPT) < calendar.html-DIST > $(DESTDIR)$(HTMLDIR)/calendar.html
sed $(SEDSCRIPT) < hebhtml > $(DESTDIR)$(SCRIPTDIR)/hebhtml
sed $(SEDSCRIPT2) < rem2html > $(DESTDIR)$(SCRIPTDIR)/rem2html$(CGISUFFIX)
chmod 644 $(DESTDIR)$(SCRIPTDIR)/sunrise.rem
chmod 644 $(DESTDIR)$(SCRIPTDIR)/moon.rem
chmod 644 $(DESTDIR)$(SCRIPTDIR)/hebdate.rem
chmod 644 $(DESTDIR)$(SCRIPTDIR)/sunset.rem
chmod 644 $(DESTDIR)$(HTMLDIR)/calendar.html
chmod 755 $(DESTDIR)$(SCRIPTDIR)/cal_dispatch$(CGISUFFIX)
chmod 755 $(DESTDIR)$(SCRIPTDIR)/rem2html$(CGISUFFIX)
chmod 755 $(DESTDIR)$(SCRIPTDIR)/calps $(DESTDIR)$(SCRIPTDIR)/hebdate \
$(DESTDIR)$(SCRIPTDIR)/hebps $(DESTDIR)$(SCRIPTDIR)/moon \
$(DESTDIR)$(SCRIPTDIR)/sunrise $(DESTDIR)$(SCRIPTDIR)/sunset \
$(DESTDIR)$(SCRIPTDIR)/hebhtml \
$(DESTDIR)$(SCRIPTDIR)/rem2html$(CGISUFFIX)
-mkdir -p $(DESTDIR)$(IMAGEDIR)
cp firstquarter.png fullmoon.png lastquarter.png newmoon.png rem-default.css $(DESTDIR)$(IMAGEDIR)
chmod 644 $(DESTDIR)$(IMAGEDIR)/firstquarter.png \
$(DESTDIR)$(IMAGEDIR)/fullmoon.png \
$(DESTDIR)$(IMAGEDIR)/lastquarter.png \
$(DESTDIR)$(IMAGEDIR)/newmoon.png \
$(DESTDIR)$(IMAGEDIR)/rem-default.css

View File

@@ -1,24 +1,13 @@
REM2HTML REM2HTML
--------
Rem2HTML is a Perl script which transforms the output of Rem2HTML is a Perl script that transforms the output of `remind -p
`remind -p ...' to an HTML table. Type `perl rem2html --help' for ...' to HTML. Type `perl rem2html --help' for usage information.
usage information.
Typical usage: remind -p ~/.reminders | rem2html > file.html Typical usage: remind -p ~/.reminders | rem2html > file.html
You may have to edit the "#!/bin/perl" line to reflect the location You may have to edit the "#!/usr/bin/perl" line to reflect the
of your Perl interpreter. location of your Perl interpreter.
If you make Remind output data for more than one month (for example,
remind -p3 ~/.reminders | rem2html > file.html), then rem2html
creates a _SINGLE_ file of concatenated HTML documents. It's up
to you to split them. In this case, you're probably better off
using the --tableonly option to rem2html and adding the appropriate
head and tail with another program.
Rem2HTML was contributed by Don Schwarz <darkowl@mcs.net>. It
produces HTML compatible with most modern browsers, but *not* with
browsers which don't support tables (like Lynx, as of this writing.)
-- --
David F. Skoll David F. Skoll

View File

@@ -6,10 +6,6 @@
# CAL_DISPATCH -- Shell script for CGI directory to dispatch calendar # CAL_DISPATCH -- Shell script for CGI directory to dispatch calendar
# commands. # commands.
#
# WARNING WARNING WARNING -- If your /bin/sh is really GNU's "bash",
# make sure you don't have a buggy version which treats char 0xFF as
# a command separator -- it is a security risk!
######################### #########################
# #

View File

@@ -1,28 +1,28 @@
<HTML> <HTML>
<!-- Sample HTML file with links to the calendar stuff --> <!-- Sample HTML file with links to the calendar stuff -->
<HEAD> <HEAD>
<TITLE>David Skoll's Calendar Server</TITLE> <TITLE>Remind Calendar Server</TITLE>
</HEAD> </HEAD>
<BODY> <BODY>
<H1>Roaring Penguin's Calendar Server</H1> <H1>Remind Calendar Server</H1>
<a HREF="http://your.machine/your.dir/cal_dispatch?sunrise"> <a HREF="%CGIDIR%/cal_dispatch?sunrise">
Sunrise Information</a><P> Sunrise Information</a><P>
<a HREF="http://your.machine/your.dir/cal_dispatch?sunset"> <a HREF="%CGIDIR%/cal_dispatch?sunset">
Sunset Information</a><P> Sunset Information</a><P>
<a HREF="http://your.machine/your.dir/cal_dispatch?moon"> <a HREF="%CGIDIR%/cal_dispatch?moon">
Moon Phase Information</a><P> Moon Phase Information</a><P>
<a HREF="http://your.machine/your.dir/cal_dispatch?calps"> <a HREF="%CGIDIR%/cal_dispatch?calps">
Blank PostScript Calendar</a> (Approximately 20kB)<P> Blank PostScript Calendar</a> (Approximately 20kB)<P>
<a HREF="http://your.machine/your.dir/cal_dispatch?hebdate"> <a HREF="%CGIDIR%/cal_dispatch?hebdate">
Today's Hebrew Date</a><P> Today's Hebrew Date</a><P>
<a HREF="http://your.machine/your.dir/cal_dispatch?hebps"> <a HREF="%CGIDIR%/cal_dispatch?hebps">
PostScript Calendar with Jewish Holidays</a> (Approximately 35 kB)<P> PostScript Calendar with Jewish Holidays</a> (Approximately 35 kB)<P>
<a HREF="http://your.machine/your.dir/cal_dispatch?hebhtml"> <a HREF="%CGIDIR%/cal_dispatch?hebhtml">
HTML Calendar with Jewish Holidays</a> (Your browser must support tables.)<P> HTML Calendar with Jewish Holidays</a>
<HR> <HR>
<a HREF="http://www.roaringpenguin.com/remind.html"> <a HREF="http://www.roaringpenguin.com/remind">
Get the Remind software</a> that provides this service.<P> Get the Remind software</a> that provides this service.<P>
</BODY> </BODY>

View File

@@ -8,5 +8,5 @@
echo "Content-type: application/postscript" echo "Content-type: application/postscript"
echo echo
$REMIND -p /dev/null | $REM2PS -e -c3 $REMIND -p /dev/null | $REM2PS -e -c3 -l
exit 0 exit 0

View File

@@ -65,7 +65,7 @@ IF !InIsrael
[_h(16, "Tishrey")] MSG %"Sukkot 2%" [_h(16, "Tishrey")] MSG %"Sukkot 2%"
ENDIF ENDIF
[_h(21, "Tishrey")] ++12 MSG %"Hashana Rabba%" is %b. [_h(21, "Tishrey")] ++12 MSG %"Hoshana Rabba%" is %b.
[_h(22, "Tishrey")] ++12 MSG %"Shemini Atzeret%" is %b. [_h(22, "Tishrey")] ++12 MSG %"Shemini Atzeret%" is %b.
IF InIsrael IF InIsrael
@@ -158,8 +158,8 @@ IF ostart <= TODAY() && (TODAY() - ostart < 49)
ENDIF ENDIF
IF !$PSCAL IF !$PSCAL
REM 20 ++40 msg Also available: <a HREF="http://your.machine/your.dir/cal_dispatch?hebps">a PostScript calendar</a> (about 35KB) for %m %y, complete with Hebrew dates, Jewish holidays, and moon phases for Ottawa. (This takes a few seconds to generate.) REM 20 ++40 msg Also available: <a HREF="%CGIDIR%/cal_dispatch?hebps">a PostScript calendar</a> (about 35KB) for %m %y, complete with Hebrew dates, Jewish holidays, and moon phases for [$Location].
REM 20 ++40 msg And: <a HREF="http://your.machine/your.dir/cal_dispatch?hebhtml">an HTML version</a> of the above. (Your browser must handle tables.) REM 20 ++40 msg And: <a HREF="%CGIDIR%/cal_dispatch?hebhtml">an HTML version</a> of the above.
ELSE ELSE
[trigger(moondate(0))] SPECIAL MOON 0 [trigger(moondate(0))] SPECIAL MOON 0
[trigger(moondate(1))] SPECIAL MOON 1 [trigger(moondate(1))] SPECIAL MOON 1

View File

@@ -12,7 +12,7 @@ echo ""
$REMIND - <<EOR $REMIND - <<EOR
BANNER % BANNER %
REM 20 ++40 RUN $REMIND -iHTML=0 -p $DIR/hebdate.rem %m %y | $REM2PS -e -c3 REM 20 ++40 RUN $REMIND -iHTML=0 -p $DIR/hebdate.rem %m %y | $REM2PS -e -c3 -l
EOR EOR
exit 0 exit 0

View File

@@ -9,11 +9,11 @@ set now now()
banner % banner %
MSG <HEAD>% MSG <HEAD>%
MSG <TITLE>Moon over Ottawa</TITLE>% MSG <TITLE>Moon over [$Location]</TITLE>%
MSG </HEAD>% MSG </HEAD>%
MSG <BODY> MSG <BODY>
MSG <H1>Moon over Ottawa</H1> MSG <H1>Moon over [$Location]</H1>
set ndate moondate(0) set ndate moondate(0)
set ntime moontime(0) set ntime moontime(0)
@@ -22,12 +22,12 @@ set ftime moontime(2)
fset t(x) wkday(x)+", "+day(x)+" "+mon(x)+", "+year(x) fset t(x) wkday(x)+", "+day(x)+" "+mon(x)+", "+year(x)
msg Today is %w, %d %m, %y.<P> msg Today is %w, %d %m, %y.<P>
msg The local time in Ottawa is [now].<P> msg The local time in [$Location] is [now].<P>
if ndate < fdate if ndate < fdate
msg The next new moon is on [t(ndate)] at [ntime], Ottawa time.<P> msg The next new moon is on [t(ndate)] at [ntime], [$Location] time.<P>
msg The next full moon is on [t(fdate)] at [ftime], Ottawa time.<P> msg The next full moon is on [t(fdate)] at [ftime], [$Location] time.<P>
else else
msg The next full moon is on [t(fdate)] at [ftime], Ottawa time.<P> msg The next full moon is on [t(fdate)] at [ftime], [$Location] time.<P>
msg The next new moon is on [t(ndate)] at [ntime], Ottawa time.<P> msg The next new moon is on [t(ndate)] at [ntime], [$Location] time.<P>
endif endif

69
www/rem-default.css Normal file
View File

@@ -0,0 +1,69 @@
table.rem-cal {
font-family: helvetica, arial, sans-serif;
font-size: 12pt;
}
table.rem-sc-table {
font-family: helvetica, arial, sans-serif;
font-size: 10pt;
width: 95%;
float: left;
}
caption.rem-cal-caption {
font-size: 14pt;
font-weight: bold;
}
th.rem-cal-hdr {
width: 14%;
border-style: solid;
border-width: 1px;
vertical-align: top;
}
td.rem-empty, td.rem-cell, td.rem-small-calendar {
width: 14%;
height: 7em;
border-style: solid;
border-width: 1px;
vertical-align: top;
}
td.rem-today {
width: 14%;
height: 7em;
border-style: solid;
border-width: 2px;
border-color: #EE3333;
vertical-align: top;
}
table.rem-cal {
width: 100%;
border-collapse: collapse;
}
div.rem-daynumber {
float: right;
text-align: right;
vertical-align: top;
font-size: 14pt;
}
div.rem-moon {
float: left;
text-align: left;
vertical-align: top;
}
th.rem-sc-hdr {
text-align: right;
}
td.rem-sc-empty-cell, td.rem-sc-cell {
text-align: right;
width: 14%;
}
caption.rem-sc-caption {
font-size: 12pt;
}

View File

@@ -1,102 +1,548 @@
#!/usr/bin/perl #!/usr/bin/perl
# rem2html use strict;
# use warnings;
# A script to convert from the output of "remind -p" to Hyper-Text Markup
# Language (HTML), the text format used in WWW documents. By default, it
# outputs a stand-alone file which can be fed directly into a web browser.
# The output uses nested <TABLE> blocks, so it will only work in a browser
# which supports tables (Netscape, MSIE, etc, NOT Lynx).
#
# This script works well on my computer (Linux 2.0.27) under Perl 5.003 and
# 5.004. It should work fine on other unices but I have no idea whether
# it will run under VMS, OS/2, Windows, etc.
#
# [Note from David: The REMIND license prohibits you from using REMIND
# under Windows.]
#
# Rem2html puts "normal" CAL or MSG-type reminders in a <P></P> pair,
# and escapes any special HTML characters.
#
# If you want to put actual HTML code in the calendar (hyper-links, for
# example), use the "SPECIAL HTML" type. For example:
#
# REM Wed SPECIAL HTML <P> Meeting at \
# <A HREF="http://www.linuxhq.com">Linux HQ</A> </P>
#
# This file is Copyright (C) 1997-8 by Don Schwarz <darkowl@mcs.net>
# and David F. Skoll
use Getopt::Long; use Getopt::Long;
@months = (January,February,March,April,May,June,July,August,September,October,November,December); my %Options;
$DefaultImageDir = "%IMAGEBASE%"; my $rem2html_version = '2.0';
if ($DefaultImageDir =~ m@/$@) {
chop $DefaultImageDir;
}
$rem2html_version = "1.0"; my($days, $shades, $moons, $classes, $Month, $Year, $Numdays, $Firstwkday, $Mondayfirst,
@Daynames, $Nextmon, $Nextlen, $Prevmon, $Prevlen);
&parse_options(); my $TIDY_PROGNAME = $0;
$TIDY_PROGNAME =~ s|^.*/||;
# Backgound color -- unfortunately, most Web browsers (as of 14 October 1999) # rem2html -- convert the output of "remind -p" to HTML
# do not correctly handle transparency in PNG images, so I had to make the
# moon image background white.
$Options{'bgcolor'} ||= "BGCOLOR=\"#FFFFFF\"";
if (-t STDIN) { =head1 NAME
print STDERR "(Rem2HTML: Input should not come from a terminal.)\n";
$Options{'help'} = 1;
}
if ($Options{'help'}) { rem2html - Convert the output of "remind -p" to HTML
&show_usage();
} elsif ($Options{'version'}) {
print "Rem2HTML Version $rem2html_version.\n";
} else {
$successes = 0;
while(1) {
last if (!parse_input());
$successes++;
&output_header();
&output_data();
&output_footer();
}
print STDERR "Rem2HTML: Couldn't find any calendar data.\n" if (!$successes);
}
exit(0); =head1 SYNOPSIS
sub show_usage { remind -p ... | rem2html [options]
print STDERR <<EndOfUsage;
Rem2HTML: Produce a HTML calendar from the output of Remind.
Usage: rem2html [options] =head1 OPTIONS
=over 4
=item --help, -h
Print usage information
=item --version
Print version
=item --backurl I<url>
When producing the small calendar for the previous month, make the
month name a link to I<url>.
=item --forwurl I<url>
When producing the small calendar for the next month, make the
month name a link to I<url>.
=item --imgbase I<url>
When creating URLs for images and the stylesheet, use
I<url> as the base URL.
=item --stylesheet I<url.css>
Use I<url.css> as the stylesheet. If this option is used,
I<url.css> is I<not> interpreted relative to B<imgbase>.
=item --nostyle
Produce basic HTML that does not use a CSS stylesheet.
=item --tableonly
Output results as a E<lt>tableE<gt> ... E<lt>/tableE<gt> sequence only
without any E<lt>htmlE<gt> or E<lt>bodyE<gt> tags.
=item --title I<title>
Use I<title> as the content between E<lt>titleE<gt> and E<lt>/titleE<gt>
tags.
=item --prologue I<html_text>
Insert I<html_text> right after the E<lt>bodyE<gt> tag.
=item --epilogue I<html_text>
Insert I<html_text> right before the E<lt>/bodyE<gt> tag.
=back
=head1 AUTHOR
rem2html was written by David F. Skoll with much inspiration from an
earlier version by Don Schwarz.
=cut
sub usage
{
my ($exit_status) = @_;
if (!defined($exit_status)) {
$exit_status = 1;
}
print STDERR <<"EOM";
$TIDY_PROGNAME: Produce an HTML calendar from the output of "remind -p"
Usage: remind -p ... | rem2html [options]
Options: Options:
--help, -h Print this information --help, -h Print usage information
--version Version information --man Show man page (requires "perldoc")
-p file Prepend the specified HTML file to the beginning of the --version Print version
output --backurl url Make the title on the previous month's small calendar
-a file Append the specified HTML file to the end of the output entry a link to <url>
-f[shted] font Set font for small cal, hdr, title, cal entries,day numbers --forwurl url Same as --backurl, but for the next month's small calendar
-s[hted] size Set size for header, title, calendar entries and/or day --imgbase url Base URL of images and default stylesheet file
numbers --stylesheet url.css URL of CSS stylesheet. If specified, imgbase is NOT
--backurl url Make the title on the previous month's small calendar entry prepended to url.css
a hyperlink to <url> --nostyle Produce basic HTML that does not use a CSS stylesheet
--forwurl url Same as --backurl, but with the next month's small calendar --tableonly Output results as a <table> only, no <html>, <body>, etc.
--tableonly Output the results as a <TABLE> block only, no <HTML>, etc. --title string What to put in <title>...</title> tags
--border,-b size Set the border thickness of the table --prologue html_text Text to insert at the top of the body
--cellspace,-t size Set the line thickness of the table --epilogue html_text Text to insert at the end of the body
--bgcolor,-g color Set the background color for the day entries EOM
exit($exit_status);
EndOfUsage
} }
sub escape_html { sub parse_options
{
local $SIG{__WARN__} = sub { print STDERR "$TIDY_PROGNAME: $_[0]\n"; };
if (!GetOptions(\%Options, "help|h",
"man",
"version",
"stylesheet=s",
"nostyle",
"backurl=s",
"forwurl=s",
"title=s",
"prologue=s",
"epilogue=s",
"imgbase=s",
"tableonly")) {
usage(1);
}
$Options{'title'} ||= 'HTML Calendar';
# Fix up imgbase
my $imgbase = '%IMAGEBASE%';
if ($imgbase ne '%' . 'IMAGEBASE' . '%') {
$Options{'imgbase'} ||= $imgbase;
} else {
$Options{'imgbase'} ||= '';
}
$Options{'imgbase'} =~ s|/+$||;
my $stylesheet = $Options{'imgbase'};
$stylesheet .= '/' if ($stylesheet ne '');
$stylesheet .= 'rem-default.css';
$Options{'stylesheet'} ||= $stylesheet;
}
sub start_output
{
return if ($Options{'tableonly'});
print("<html>\n<head>\n<title>" . $Options{'title'} . "</title>\n");
if (!$Options{'nostyle'}) {
if ($Options{'stylesheet'}) {
print('<link rel="stylesheet" type="text/css" href="' .
$Options{'stylesheet'} . '">' . "\n");
}
}
print("</head>\n<body>\n");
if ($Options{'prologue'}) {
print $Options{'prologue'} . "\n";
}
}
sub end_output
{
return if ($Options{'tableonly'});
if ($Options{'epilogue'}) {
print $Options{'epilogue'} . "\n";
}
print("</body>\n</html>\n");
}
sub parse_input
{
undef $days;
undef $shades;
undef $moons;
undef $classes;
my $found_data = 0;
while(<STDIN>) {
chomp;
last if /^\# rem2ps begin$/;
}
my $line;
# Month Year numdays firstday monday_first_flag
$line = <STDIN>;
return 0 unless $line;
chomp($line);
($Month, $Year, $Numdays, $Firstwkday, $Mondayfirst) = split(' ', $line);
# Day names
$line = <STDIN>;
return 0 unless $line;
chomp($line);
@Daynames = split(' ', $line);
# Prevmon prevlen
$line = <STDIN>;
return 0 unless $line;
chomp($line);
($Prevmon, $Prevlen) = split(' ', $line);
# Nextmon nextlen
$line = <STDIN>;
return 0 unless $line;
chomp($line);
($Nextmon, $Nextlen) = split(' ', $line);
$found_data = 1;
my $class;
if ($Options{'nostyle'}) {
$class = '';
} else {
$class = ' class="rem-entry"';
}
while(<STDIN>) {
chomp;
last if /^\# rem2ps end$/;
next if /^\#/;
next unless m/^(\d*).(\d*).(\d*)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*(.*)$/;
my ($y, $m, $d, $special, $tag, $duration, $time, $body) =
($1, $2, $3, $4, $5, $6, $7, $8);
if ($special eq 'HTML') {
push(@{$days->[$d]}, $body);
} elsif ($special eq 'HTMLCLASS') {
$classes->[$d] = $body;
} elsif ($special eq 'MOON') {
if ($body =~ /(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/) {
my ($phase, $moonsize, $fontsize, $msg) = ($1, $2, $3, $4);
$moons->[$d]->{'phase'} = $phase;
$moons->[$d]->{'msg'} = $msg;
} elsif ($body =~ /(\S+)/) {
$moons->[$d]->{'phase'} = $1;
$moons->[$d]->{'msg'} = '';
}
} elsif ($special eq 'SHADE') {
if ($body =~ /(\d+)\s+(\d+)\s+(\d+)/) {
$shades->[$d] = sprintf("#%02X%02X%02X",
($1 % 256), ($2 % 256), ($3 % 256));
}
} elsif ($special eq 'COLOR') {
if ($body =~ /(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/) {
my($r, $g, $b, $text) = ($1, $2, $3, $4);
my $color = sprintf("style=\"color: #%02X%02X%02X;\"",
$r % 256, $g % 256, $b % 256);
push(@{$days->[$d]}, "<p$class $color>" . escape_html($text) . '</p>');
}
} elsif ($special eq '*') {
push(@{$days->[$d]}, "<p$class>" . escape_html($body) . '</p>');
}
}
return $found_data;
}
sub small_calendar
{
my($month, $monlen, $url, $first_col) = @_;
if ($Mondayfirst) {
$first_col--;
if ($first_col < 0) {
$first_col = 6;
}
}
if ($Options{'nostyle'}) {
print "<td width=\"14%\">\n";
print "<table border=\"0\">\n";
print "<caption>";
} else {
print "<td class=\"rem-small-calendar\">\n";
print "<table class=\"rem-sc-table\">\n";
print "<caption class=\"rem-sc-caption\">";
}
print "<a href=\"$url\">" if ($url);
print $month;
print "</a>" if ($url);
print "</caption>\n";
my $class;
if ($Options{'nostyle'}) {
print '<tr>';
$class = ' align="right"';
} else {
print '<tr class="rem-sc-hdr-row">';
$class = ' class="rem-sc-hdr"';
}
if (!$Mondayfirst) {
print "<th$class>" . substr($Daynames[0], 0, 1) . '</th>';
}
for (my $i=1; $i<7; $i++) {
print "<th$class>" . substr($Daynames[$i], 0, 1) . '</th>';
}
if ($Mondayfirst) {
print "<th$class>" . substr($Daynames[0], 0, 1) . '</th>';
}
print("</tr>\n");
my $col = 0;
for (; $col<$first_col; $col++) {
if ($col == 0) {
print("<tr>\n");
}
if ($Options{'nostyle'}) {
print("<td align=\"right\" width=\"14%\">&nbsp;</td>");
} else {
print("<td class=\"rem-sc-empty-cell\">&nbsp;</td>");
}
}
for (my $day=1; $day <= $monlen; $day++) {
if ($col == 0) {
print("<tr>\n");
}
$col++;
if ($Options{'nostyle'}) {
print("<td align=\"right\" width=\"14%\">$day</td>");
} else {
print("<td class=\"rem-sc-cell\">$day</td>");
}
if ($col == 7) {
print("</tr>\n");
$col = 0;
}
}
if ($col) {
while ($col < 7) {
if ($Options{'nostyle'}) {
print("<td align=\"right\" width=\"14%\">&nbsp;</td>");
} else {
print("<td class=\"rem-sc-empty-cell\">&nbsp;</td>");
}
$col++;
}
print("</tr>\n");
}
print("</table>\n");
print "</td>\n";
}
sub output_calendar
{
# Which column is 1st of month in?
my $first_col = $Firstwkday;
if ($Mondayfirst) {
$first_col--;
if ($first_col < 0) {
$first_col = 6;
}
}
# Last column
my $last_col = ($first_col + $Numdays - 1) % 7;
# Start the table
my $class;
if ($Options{'nostyle'}) {
print '<table width="100%" border="1" cellspacing=\"0\"><caption>' .
$Month . ' ' . $Year . '</caption>' . "\n";
print '<tr>';
$class = ' width="14%"';
} else {
print '<table class="rem-cal"><caption class="rem-cal-caption">' .
$Month . ' ' . $Year . '</caption>' . "\n";
print '<tr class="rem-cal-hdr-row">';
$class = ' class="rem-cal-hdr"';
}
if (!$Mondayfirst) {
print "<th$class>" . $Daynames[0] . '</th>';
}
for (my $i=1; $i<7; $i++) {
print "<th$class>" . $Daynames[$i] . '</th>';
}
if ($Mondayfirst) {
print "<th$class>" . $Daynames[0] . '</th>';
}
print "</tr>\n";
# Start the calendar rows
my $col = 0;
if ($Options{'nostyle'}) {
print "<tr>\n";
} else {
print "<tr class=\"rem-cal-row\">\n";
}
if ($first_col > 0) {
small_calendar($Prevmon, $Prevlen, $Options{'backurl'},
($Firstwkday - $Prevlen + 35) % 7);
$col++;
}
if ($last_col == 6 && $first_col > 0) {
small_calendar($Nextmon, $Nextlen, $Options{'forwurl'},
($Firstwkday + $Numdays) % 7);
$col++;
}
if ($Options{'nostyle'}) {
$class = ' width="14%"';
} else {
$class = ' class="rem-empty"';
}
while ($col < $first_col) {
print("<td$class>&nbsp;</td>\n");
$col++;
}
for (my $day=1; $day<=$Numdays; $day++) {
draw_day_cell($day);
$col++;
if ($col == 7) {
$col = 0;
print "</tr>\n";
if ($day < $Numdays) {
if ($Options{'nostyle'}) {
print "<tr>\n";
} else {
print "<tr class=\"rem-cal-row\">\n";
}
}
}
}
if ($col) {
while ($col < 7) {
if ($col == 5) {
if ($first_col == 0) {
small_calendar($Prevmon, $Prevlen, $Options{'backurl'},
($Firstwkday - $Prevlen + 35) % 7);
} else {
print("<td$class>&nbsp;</td>\n");
}
} elsif ($col == 6) {
small_calendar($Nextmon, $Nextlen, $Options{'forwurl'},
($Firstwkday + $Numdays) % 7);
} else {
print("<td$class>&nbsp;</td>\n");
}
$col++;
}
print "</tr>\n";
}
# Add a row for small calendars if they were not yet done!
if ($first_col == 0 && $last_col == 6) {
if ($Options{'nostyle'}) {
print "<tr>\n";
} else {
print "<tr class=\"rem-cal-row\">\n";
}
small_calendar($Prevmon, $Prevlen, $Options{'backurl'},
($Firstwkday - $Prevlen + 35) % 7);
for (my $i=0; $i<5; $i++) {
print("<td$class>&nbsp;</td>\n");
}
small_calendar($Nextmon, $Nextlen, $Options{'forwurl'},
($Firstwkday + $Numdays) % 7);
print("</tr>\n");
}
# End the table
print "</table>\n";
}
sub draw_day_cell
{
my($day) = @_;
my $shade = $shades->[$day];
my $class;
if ($Options{'nostyle'}) {
$class = $classes->[$day] || '';
} else {
$class = $classes->[$day] || "rem-cell";
}
if ($shade) {
$shade = " style=\"background: $shade;\"";
} else {
$shade = "";
}
if ($class ne '') {
print "<td class=\"$class\"$shade>\n";
} else {
print "<td valign=\"top\" $shade>\n";
}
if ($moons->[$day]) {
my $phase = $moons->[$day]->{'phase'};
my $msg = $moons->[$day]->{'msg'};
$msg ||= '';
if ($msg ne '') {
$msg = '&nbsp;' . escape_html($msg);
}
my $img;
my $alt;
my $title;
if ($phase == 0) {
$img = 'newmoon.png';
$title = 'New Moon';
$alt = 'new';
} elsif ($phase == 1) {
$img = 'firstquarter.png';
$title = 'First Quarter';
$alt = '1st';
} elsif ($phase == 2) {
$img = 'fullmoon.png';
$alt = 'full';
$title = 'Full Moon';
} else {
$img = 'lastquarter.png';
$alt = 'last';
$title = 'Last Quarter';
}
if ($Options{'imgbase'}) {
$img = $Options{'imgbase'} . '/' . $img;
}
if ($Options{'nostyle'}) {
print("<div style=\"float: left\"><img border=\"0\" width=\"16\" height=\"16\" alt=\"$alt\" title=\"$title\" src=\"$img\">$msg</div>");
} else {
print("<div class=\"rem-moon\"><img border=\"0\" width=\"16\" height=\"16\" alt=\"$alt\" title=\"$title\" src=\"$img\">$msg</div>");
}
}
if ($Options{'nostyle'}) {
print "<div style=\"float: right\">$day</div>\n";
print "<p>&nbsp;</p>\n";
} else {
print "<div class=\"rem-daynumber\">$day</div>\n";
}
if ($days->[$day]) {
print(join("\n", @{$days->[$day]}));
}
print "</td>\n";
}
sub escape_html
{
my($in) = @_; my($in) = @_;
$in =~ s/\&/\&amp;/g; $in =~ s/\&/\&amp;/g;
$in =~ s/\</\&lt;/g; $in =~ s/\</\&lt;/g;
@@ -104,313 +550,35 @@ sub escape_html {
return $in; return $in;
} }
sub parse_options { parse_options();
%Options = (); if ($Options{'help'}) {
usage(0);
GetOptions (\%Options, "help|h", exit(0);
"version", } elsif ($Options{'man'}) {
"border|b=i", system("perldoc $0");
"cellspace|t=i", exit(0);
"backurl|bu:s", "forwurl|fu:s", } elsif ($Options{'version'}) {
"tableonly|to", print "rem2html version $rem2html_version.\n";
"prologue|p=s", exit(0);
"append|a=s",
"bgcolor|g=s",
"fs=s", "fh=s", "ft=s", "fe=s", "fd=s",
"sh=i", "st=i", "se=i", "sd=i",
);
$Options{'border'} = "BORDER=" . ($Options{'border'} || 1);
$Options{'cellspace'} &&= "CELLSPACING=$Options{'cellspace'}";
$Options{'bgcolor'} &&= "BGCOLOR=$Options{'bgcolor'}";
} }
sub parse_input { if (-t STDIN) {
local $where = 0; print STDERR "$TIDY_PROGNAME: Input should not come from a terminal.\n\n";
local $msg; usage(1);
local $type;
local $day;
@days = ();
@shades = ();
@moons = ();
while (<>) {
chomp($_);
if (/rem2(html|ps) begin/) {
} elsif (!$where) {
next;
} elsif ($where == 1) {
local ($month, $year);
($month, $year, $month_length, $firstday, $mfirst) = split(" ");
$caption = "$month, $year";
for $i ( 1 .. $month_length) { push(@days, ""); }
} elsif ($where == 2) {
@DayNames = split(" ");
} elsif ($where == 3) {
@prevsc = split(" ");
} elsif ($where == 4) {
@nextsc = split(" ");
} else {
return 1 if /rem2(html|ps) end/;
next if /^\#/;
next unless m/^(\d*).(\d*).(\d*)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*(.*)$/;
$type = $4;
$msg = $8;
$day = $3;
if ($type eq "HTML") {
$days[$day] .= "$msg ";
} elsif ($type eq "MOON") {
my($phase, $text);
if ($msg =~ /^\s*(\d+)\s+\S+\s+\S+\s+(.*)$/) {
$phase = $1;
$text = $2;
} elsif ($msg =~ /^\s*(\d+)/) {
$phase = $1;
$text = "";
} else {
next;
}
next if ($phase > 3);
if ($phase == 0) {
$text = "<IMAGE SRC=\"$DefaultImageDir/newmoon.png\" ALT=\"New Moon\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
} elsif ($phase == 1) {
$text = "<IMAGE SRC=\"$DefaultImageDir/firstquarter.png\" ALT=\"First Quarter\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
} elsif ($phase == 2) {
$text = "<IMAGE SRC=\"$DefaultImageDir/fullmoon.png\" ALT=\"Full Moon\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
} else {
$text = "<IMAGE SRC=\"$DefaultImageDir/lastquarter.png\" ALT=\"Last Quarter\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
}
$moons[$day] = $text . "</FONT> ";
} elsif ($type eq "SHADE") {
my($red, $green, $blue);
if ($msg =~ /^\s*(\d+)\s+(\d+)\s+(\d+)\s*$/) {
$red = $1;
$green = $2;
$blue = $3;
} elsif ($msg =~ /^\s*(\d+)\s*$/) {
$red = $1;
$green = $1;
$blue = $1;
} else {
next;
}
next if ($red > 255 || $green > 255 || $blue > 255);
$shades[$day] = sprintf(" BGCOLOR=\"#%02X%02X%02X\"",
$red, $green, $blue);
} elsif ($type eq "COLOR") {
my($red, $green, $blue, $stuff);
if ($msg =~ /^\s*(\d+)\s+(\d+)\s+(\d+)\s*(.*)$/) {
$red = $1;
$green = $2;
$blue = $3;
$stuff = $4;
next if ($red > 255 || $green > 255 || $blue > 255);
$days[$day] .=
sprintf("<P><font color=\"#%02x%02x%02x\">",
$red, $green, $blue) .
escape_html($stuff) . "</font></P>";
} else {
next;
}
} elsif ($type eq "*") {
$msg = &escape_html($msg);
$days[$day] .= "<P>$msg</P>";
}
}
$where++;
}
if ($where) {
return 1;
}
return 0;
} }
sub output_header { my $found_something = 0;
local ($title, $dayheader); while(1) {
last if (!parse_input());
if (!$Options{'tableonly'}) { start_output() unless $found_something;
print <<EndOfHTML; $found_something = 1;
<HTML> output_calendar();
<HEAD><TITLE>Reminders for $caption</TITLE></HEAD> }
<BODY> if ($found_something) {
EndOfHTML end_output();
} exit(0);
} else {
print <<EndOfHTML; print STDERR "$TIDY_PROGNAME: Could not find any calendar data on STDIN.\n";
<!-- This output was produced by Rem2HTML $rem2html_version (written by exit(1);
Don Schwarz <darkowl\@mcs.net>) and Remind (written by David F. Skoll). -->
EndOfHTML
if ($Options{'prologue'}) {
open(PROLOGUE, "< $Options{'prologue'}");
print while ( <PROLOGUE> );
close(PROLOGUE);
}
$caption = &format_font($caption, $Options{'ft'}, $Options{'st'} || "+1");
print <<EndOfHTML;
<TABLE $Options{'border'} $Options{'cellspace'} $Options{'bgcolor'} WIDTH=100%>
<CAPTION><STRONG>$caption</STRONG></CAPTION>
<TR>
EndOfHTML
$mfirst || &print_day_header($DayNames[0]);
for($i=1; $i<7; $i++) {
&print_day_header($DayNames[$i]);
}
$mfirst && &print_day_header($DayNames[0]);
print " </TR>\n";
} }
sub output_footer {
print "</TABLE>\n";
if ($Options{'append'}) {
open(EPILOGUE, "< $Options{'append'}");
print while ( <EPILOGUE> );
close(EPILOGUE);
}
unless ($Options{'tableonly'}) {
print <<EndOfHTML;
</BODY>
</HTML>
EndOfHTML
}
}
sub output_data {
local ($endday, $prevday, $nextday, $week, $weekday);
local ($element, $day, $msg, $fday);
$firstday -= $mfirst;
if ($firstday < 0) { $firstday += 7; }
$endday = $firstday + $month_length;
$endweek = $endday + (6 - ($endday % 7));
$endday %= 7;
if ( $firstday > 1 ) {
$prevday = 0;
$nextday = 1;
} elsif ($endday ? ($endday < 5) : !$firstday) {
$prevday = $endweek - 1;
$nextday = $endweek;
} else {
$prevday = 0;
$nextday = $endweek;
}
for $week ( 0..5 ) {
print " <TR>\n";
for $weekday ( 0..6 ) {
$element = ($week * 7) + ($weekday * 1);
$day = $element - $firstday + 1;
$msg = $days[$day];
$msg = $msg ? &format_font($msg, $Options{'fe'}, $Options{'se'})
: " <BR> <BR> <BR> <BR>";
$fday = &format_font($day, $Options{'fd'}, $Options{'sd'} || -1);
if ($day > 0 && $day <= $month_length) {
print <<EndOfHTML;
<TD HEIGHT="120" VALIGN=TOP WIDTH=14%$shades[$day]>
<P ALIGN=RIGHT>$moons[$day]$fday</P>
$msg
</TD>
EndOfHTML
} elsif ($element == $prevday) {
&small_calendar(@prevsc, 1, $Options{'backurl'});
} elsif ($element == $nextday) {
&small_calendar(@nextsc, 2, $Options{'forwurl'});
} else {
print " <TD WIDTH=14%><BR></TD>";
}
}
print " </TR>\n";
last if $day >= $month_length && $element >= $nextday;
}
}
sub small_calendar {
local ($scname, $scn, $which, $url) = @_;
local ($scstart, $l, $week, $weekday, $tday);
$scname = "<A HREF=\"$url\">$scname</A>", if $url;
$scname = &format_font($scname, $Options{'fs'}, -2);
if ($which == 1) {
$scstart = $firstday - ($scn % 7);
if ($scstart < 0) { $scstart += 7; }
} else {
$scstart = $firstday + ($month_length % 7);
if ($scstart > 6) { $scstart -= 7; }
}
print <<EndOfHTML;
<TD WIDTH=14% VALIGN=TOP>
<TABLE WIDTH=100%>
<CAPTION><STRONG>$scname</STRONG></CAPTION>
<TR>
EndOfHTML
$mfirst || &print_day_header(substr($DayNames[0], 0, 1), 1);
for ($i=1; $i<7; $i++) {
&print_day_header(substr($DayNames[$i], 0, 1), 1);
}
$mfirst && &print_day_header(substr($DayNames[0], 0, 1), 1);
print "</TR>\n";
for $week ( 0..5 ) {
print " <TR>\n";
for $weekday ( 0..6 ) {
$tday = ($week * 7) + ($weekday * 1) - $scstart + 1;
$tday = "", if $tday <= 0 || $tday > $scn;
print " <TD WIDTH=14%><FONT SIZE=-2>$tday</FONT></TD>\n";
}
print " </TR>\n";
last if $tday >= $scn;
}
print <<EndOfHTML;
</TABLE>
</TD>
EndOfHTML
}
sub format_font {
local ($text, $font, $size) = @_;
if (!$text) {
return "";
} elsif ($font && $size) {
return "<FONT FACE=$font SIZE=$size>$text</FONT>";
} elsif ($font) {
return "<FONT FACE=$font>$text</FONT>";
} elsif ($size) {
return "<FONT SIZE=$size>$text</FONT>";
} else {
return $text;
}
}
sub print_day_header {
local ($dheader, $small) = @_;
if ($small) {
$dheader = &format_font($dheader, $Options{'fs'}, -2);
} else {
$dheader = &format_font($dheader, $Options{'fh'}, $Options{'sh'});
}
print " <TH WIDTH=14%>$dheader</TH>\n";
}

View File

@@ -8,11 +8,11 @@ set now now()
banner % banner %
MSG <HEAD>% MSG <HEAD>%
MSG <TITLE>Sunrise in Ottawa</TITLE>% MSG <TITLE>Sunrise in [$Location]</TITLE>%
MSG </HEAD>% MSG </HEAD>%
MSG <BODY> MSG <BODY>
MSG <H1>Sunrise in Ottawa</H1> MSG <H1>Sunrise in [$Location]</H1>
set tod sunrise(today()) set tod sunrise(today())
set tom sunrise(today()+1) set tom sunrise(today()+1)
@@ -34,7 +34,7 @@ set fn iif(diff==0, "now", diff <0, "ago", "from now")
set iw iif(diff<0, "was", "is") set iw iif(diff<0, "was", "is")
set aw iif(tod==tom, " as well.", ".") set aw iif(tod==tom, " as well.", ".")
msg Today is %w, %d %m, %y.<P> msg Today is %w, %d %m, %y.<P>
msg The local time in Ottawa is [now].<P> msg The local time in [$Location] is [now].<P>
msg Sunrise today [iw] at [tod]; in other words, [hstr][astr][mstr] [fn].<P> msg Sunrise today [iw] at [tod]; in other words, [hstr][astr][mstr] [fn].<P>
msg Sunrise tomorrow is at [tom][aw]<P> msg Sunrise tomorrow is at [tom][aw]<P>
msg The daylight portion of tomorrow will be [slen] today.<P> msg The daylight portion of tomorrow will be [slen] today.<P>

View File

@@ -9,11 +9,11 @@ set now now()
banner % banner %
MSG <HEAD>% MSG <HEAD>%
MSG <TITLE>Sunset in Ottawa</TITLE>% MSG <TITLE>Sunset in [$Location]</TITLE>%
MSG </HEAD>% MSG </HEAD>%
MSG <BODY> MSG <BODY>
MSG <H1>Sunset in Ottawa</H1> MSG <H1>Sunset in [$Location]</H1>
set tod sunset(today()) set tod sunset(today())
set tom sunset(today()+1) set tom sunset(today()+1)
@@ -35,7 +35,7 @@ set fn iif(diff==0, "now", diff <0, "ago", "from now")
set iw iif(diff<0, "was", "is") set iw iif(diff<0, "was", "is")
set aw iif(tod==tom, " as well.", ".") set aw iif(tod==tom, " as well.", ".")
msg Today is %w, %d %m, %y.<P> msg Today is %w, %d %m, %y.<P>
msg The local time in Ottawa is [now].<P> msg The local time in [$Location] is [now].<P>
msg Sunset today [iw] at [tod]; in other words, [hstr][astr][mstr] [fn].<P> msg Sunset today [iw] at [tod]; in other words, [hstr][astr][mstr] [fn].<P>
msg Sunset tomorrow is at [tom][aw]<P> msg Sunset tomorrow is at [tom][aw]<P>
msg The daylight portion of tomorrow will be [slen] today.<P> msg The daylight portion of tomorrow will be [slen] today.<P>