Compare commits

..

70 Commits

Author SHA1 Message Date
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
45 changed files with 4919 additions and 4871 deletions

14
.gitignore vendored Normal file
View File

@@ -0,0 +1,14 @@
*.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

View File

@@ -3,7 +3,7 @@ THE REMIND COPYRIGHT
1. REMIND refers to the entire set of files and documentation in the
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.
3. DISTRIBUTION AND USE

View File

@@ -24,9 +24,14 @@ clean:
find . -name '*~' -exec rm {} \;
cd src; $(MAKE) clean
test:
cd src && $(MAKE) test
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
./configure
# DO NOT DELETE

120
build.tk
View File

@@ -41,6 +41,8 @@ proc SetConfigDefaults {} {
set Config(NORTHERN_HEMISPHERE) 1
set Config(WESTERN_HEMISPHERE) 1
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
update idletasks
SetConfigDefaults
SetConfigFromRemind
tabnotebook_create .tn
set Instdir [tabnotebook_page .tn "Installation Directories"]
@@ -128,13 +130,14 @@ proc CreateMainDialog {} {
# Creates the "installation directories" dialog.
#***********************************************************************
proc CreateInstallDirDialog { w } {
global Config
label $w.binlabel -text "Location for programs: "
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: "
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
$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" \
-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
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
CreateMainDialog

5296
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -45,4 +45,4 @@ if test "$GCC" = yes; then
fi
AC_CHECK_FUNCS(setenv unsetenv)
AC_OUTPUT(src/Makefile)
AC_OUTPUT(src/Makefile www/Makefile)

View File

@@ -1,6 +1,79 @@
CHANGES TO REMIND
* Version 3.1 Patch 1 - 23 August 2007
* 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
@@ -30,7 +103,7 @@ CHANGES TO REMIND
- Various man-page fixes.
* Version 3.1 Patch 0 - 14 August 2007
* Version 3.1 Patch 0 - 2007-07-14
+ MAJOR ENHANCEMENTS
@@ -93,7 +166,7 @@ CHANGES TO REMIND
- rem2ps would produce invalid PostScript in some rare cases
(eg, for February 2007). This has been fixed.
* Version 3.0 Patch 24
* Version 3.0 Patch 24 - 2005-11-19
+ MINOR ENHANCEMENTS
@@ -116,7 +189,7 @@ CHANGES TO REMIND
- Fixed a bug in the tokenizer that could make Remind segfault. Fix courtesy
of Stan Tobias.
* Version 3.0 Patch 23
* Version 3.0 Patch 23 - 2005-04-14
+ MINOR ENHANCEMENTS
@@ -140,7 +213,7 @@ CHANGES TO REMIND
- 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
@@ -162,7 +235,7 @@ CHANGES TO REMIND
- Fixed serious bug in which background queued reminders were ignored and
Remind simply exited. Doh! Sorry about that.
* Version 3.0 Patch 21
* Version 3.0 Patch 21 - 2000-03-15
+ MINOR ENHANCEMENTS
@@ -193,7 +266,7 @@ CHANGES TO REMIND
- Fixed compilation problem on FreeBSD, IRIX, Tru64 and other UNIXes.
* Version 3.0 Patch 20
* Version 3.0 Patch 20 - 1999-04-12
+ NEWS
@@ -222,7 +295,7 @@ CHANGES TO REMIND
- 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
@@ -264,7 +337,7 @@ CHANGES TO REMIND
- Lots more silly little bugs squashed -- too many to go into in
detail.
* Version 3.0 Patch 18
* Version 3.0 Patch 18 - 1998-02-15
+ MAJOR ENHANCEMENTS
@@ -328,7 +401,7 @@ CHANGES TO REMIND
- Getting rid of fixed-sized buffers meant lots of changes to code.
No doubt, I missed a few regression tests.
* Version 3.0 Patch 17
* Version 3.0 Patch 17 - 1997-09-07
+ MINOR ENHANCEMENTS
@@ -369,7 +442,7 @@ CHANGES TO REMIND
library. All three of these fixes are courtesy of Christopher
J. Madsen <madsen@iglobal.net>. Thanks, Christopher.
* Version 3.0 Patch 16
* Version 3.0 Patch 16 - 1997-02-11
+ MINOR ENHANCEMENTS
@@ -397,7 +470,7 @@ CHANGES TO REMIND
- Fixed a problem under Solaris 2.5 whereby rem2ps was skipping some
latin1 characters which it interpreted as white space.
* Version 3.0 Patch 15
* Version 3.0 Patch 15 - 1996-10-27
+ IMPORTANT NOTES
@@ -427,7 +500,7 @@ CHANGES TO REMIND
- Fixed bug in TkRemind which caused a crash if the "-m" option was used
for a month beginning on Sunday. Doh!!!
* Version 3.0 Patch 14
* Version 3.0 Patch 14 - 1996-05-25
+ CHANGE IN COPYING POLICY
@@ -486,7 +559,7 @@ CHANGES TO REMIND
_not_ support MS Windows, and in fact do not allow Remind to run
under Windows (see COPYRIGHT).
* Version 3.0 Patch 13
* Version 3.0 Patch 13 - 1994-05-06
+ MINOR ENHANCEMENTS
@@ -521,7 +594,7 @@ CHANGES TO REMIND
- Updated the copyright notices everywhere.
* Version 3.0 Patch 12
* Version 3.0 Patch 12 - 1994-02-01
+ MINOR ENHANCEMENTS
@@ -540,7 +613,7 @@ CHANGES TO REMIND
- Fixed a problem with the '-k' option which resulted in a newline being
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
@@ -620,7 +693,7 @@ CHANGES TO REMIND
- 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
@@ -677,7 +750,7 @@ CHANGES TO REMIND
so that newlines in the body start new paragraphs, rather than being
swallowed as white-space.
* Version 3.0 Patch 8
* Version 3.0 Patch 8 - 1993-09-08
+ MAJOR ENHANCEMENTS
@@ -729,7 +802,7 @@ CHANGES TO REMIND
range [-128, 255] (but not 0) so that char(asc(s)) works even
on machines with signed char types.
* Version 3.0 Patch 7
* Version 3.0 Patch 7 - 1993-07-22
+ MAJOR ENHANCEMENTS
@@ -772,7 +845,7 @@ CHANGES TO REMIND
- Changed kall so that "kall sh" doesn't commit suicide - patch courtesy
of Michael Salmon.
* Version 3.0 Patch 6
* Version 3.0 Patch 6 - 1993-05-05
+ MINOR ENHANCEMENTS
@@ -795,7 +868,7 @@ CHANGES TO REMIND
- Fixed a bug in the -u option which sometimes caused a core dump
(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:
@@ -830,7 +903,7 @@ CHANGES TO REMIND
- 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
issuing them. (You can see I'm running out of letters to
@@ -889,13 +962,13 @@ CHANGES TO REMIND
- 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
should NOT use patch level 2 - either stick to 3.0.1 or upgrade to
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.
This simplifies the remind-all scripts, and makes them more efficient.
@@ -935,7 +1008,7 @@ CHANGES TO REMIND
- Changed Remind so that supplying the -a option causes timed reminders
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
@@ -975,7 +1048,7 @@ CHANGES TO REMIND
- Re-formatted the WHATSNEW.30 file.
* Version 3.0
* Version 3.0 - 1992-11-09
- Total rewrite from previous versions
@@ -996,23 +1069,23 @@ CHANGES TO REMIND
- Fixed a lurking bug in trigger date calculation which, amazingly, had not
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
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
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
queued reminders in the foreground. This makes automatic termination
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
in cursor not starting from left side of screen on some systems.
@@ -1029,7 +1102,7 @@ CHANGES TO REMIND
- 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
to trigger all non-expired reminders.
@@ -1043,7 +1116,7 @@ CHANGES TO REMIND
- 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.
@@ -1065,28 +1138,28 @@ CHANGES TO REMIND
- Modified the calendar and SimpleCalendar formats so that the % escape
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
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
allowed RUN-type reminders to be explicitly included in the calendar by
using the %" escape sequence.
* Version 2.2
* Version 2.2 - 1990-11-16
- Added the AT keyword, the timed reminders daemon, and the
calendar facility.
* Version 2.1
* Version 2.1 - 1990-11-06
- Added the "repeat" token for repeating reminders with a period
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,
character substitution, and the RUN keyword.

View File

@@ -27,8 +27,8 @@ RUN OFF
################################################
# Ensure required version of remind is used... #
################################################
IF version() < "03.00.19"
ERRMSG This file requires at least version 03.00.19 of Remind.%
IF version() < "03.01.02"
ERRMSG This file requires at least version 03.01.02 of Remind.%
ERRMSG This version is version [version()].
EXIT
ENDIF
@@ -93,7 +93,7 @@ SET Week_1 1
SET Week_2 8
SET Week_3 15
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...
FSET _trig() TRIGGER(TRIGDATE())
@@ -101,46 +101,6 @@ FSET _trig() TRIGGER(TRIGDATE())
# Handy function to provide SCANFROM dates...
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 #
# 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
OMIT [_trig()] MSG %"President'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 Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
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%"
REM Mon Oct [Week_2] MSG %"Columbus 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 31 MSG %"Halloween%"
REM Tue Nov 2 SCANFROM [_back(7)] \
@@ -490,7 +460,7 @@ IF !InIsrael
[_h(16, "Tishrey")] MSG %"Sukkot 2%"
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.
IF InIsrael
@@ -518,7 +488,8 @@ IF !Reform
ENDIF
[_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 WKDAYNUM(_h2(13, "Adar")) != 6
@@ -527,6 +498,7 @@ ELSE
REM [TRIGGER(_h2(11, "Adar"))] ++4 MSG %"Fast of Esther%" is %b.
ENDIF
[_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.
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,
but again, the PostScript output will probably not work.
.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
.TP
.B psmoon(i_phase [,i_size [,s_note [,i_notesize]]])
Returns a \fBSTRING\fR consisting of PostScript code to draw a moon in
the upper-left hand corner of the calendar box. \fIPhase\fR specifies
the phase of the moon, and is 0 (new moon), 1 (first quarter), 2 (full
moon) or 3 (third quarter). If \fIsize\fR is specified, it controls
the radius of the moon in PostScript units (1/72 inch.) If it is not
specified or is negative, the size of the day-number font is used.
[DEPRECATED] Returns a \fBSTRING\fR consisting of PostScript code to
draw a moon in the upper-left hand corner of the calendar box.
\fIPhase\fR specifies the phase of the moon, and is 0 (new moon), 1
(first quarter), 2 (full moon) or 3 (third quarter). If \fIsize\fR is
specified, it controls the radius of the moon in PostScript units
(1/72 inch.) If it is not specified or is negative, the size of the
day-number font is used.
.PP
.PP
.RS
@@ -2353,7 +2354,7 @@ Note how the time is coerced to a string by concatenating the null string.
.RE
.TP
\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)
to 100 (completely white.) If three arguments are given, they specify
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
with the \fBvalue()\fR or \fBdefined()\fR functions.
.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
.PP
The \fBPS\fR and \fBPSFILE\fR reminders pass PostScript code directly
@@ -4043,4 +4038,4 @@ Catalog\fR, Jewish Publication Society of America.
.PP
.SH SEE ALSO
.PP
rem2ps, tkremind
rem, rem2ps, tkremind

View File

@@ -235,6 +235,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
\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
\fBTkRemind\fR performs some basic consistency checks when you add or
preview a reminder. However, if you edit a reminder in the previewer,
@@ -268,7 +284,7 @@ for \fBTkRemind\fR (for example).
script file. It also places special comments in the reminder
file to store additional state. You can certainly mix
"hand-crafted" reminders with reminders created by \fBTkRemind\fR
if you are awared of the following rules and limitations:
if you are aware of the following rules and limitations:
.TP
o
Do not use the \fBTAG\fR keyword in hand-crafted reminders.

View File

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

View File

@@ -298,10 +298,8 @@ proc CreateCalFrame { w dayNames } {
set f [expr $n+$j]
button $w.l$f -text "" -justify center -command "" \
-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 {}
$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 REM <ButtonPress-3> "FireEditor $w.t$f"
@@ -343,8 +341,6 @@ proc ConfigureCalFrame { w firstDay numDays } {
foreach t [$w.t$i tag names] {
$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 REM <ButtonPress-3> "FireEditor $w.t$i"
$w.t$i configure -state disabled
@@ -361,8 +357,6 @@ proc ConfigureCalFrame { w firstDay numDays } {
foreach t [$w.t$i tag names] {
$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 REM <ButtonPress-3> "FireEditor $w.t$i"
$w.t$i configure -state disabled
@@ -388,8 +382,6 @@ proc ConfigureCalFrame { w firstDay numDays } {
foreach t [$w.t$i tag names] {
$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 REM <ButtonPress-3> "FireEditor $w.t$i"
$w.t$i configure -state disabled
@@ -435,6 +427,13 @@ proc CreateCalWindow { dayNames } {
wm iconname . ""
wm protocol . WM_DELETE_WINDOW Quit
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)} {
wm iconify .
}
@@ -701,10 +700,6 @@ proc FillCalWindow {} {
ConfigureCalWindow $monthName $year $firstWkday $daysInMonth
set offset [CalEntryOffset $firstWkday]
for {set i 1} {$i <= 31} {incr i} {
set didSomething($i) 0
}
set fntag "x"
while { [gets $file line] >= 0 } {
# File info
@@ -763,12 +758,10 @@ proc FillCalWindow {} {
continue
}
.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]} {
.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 {
.cal.t$n insert end [string trim $stuff] [list REM $extratags $fntag]
}
@@ -1248,7 +1241,10 @@ proc CreateModifyDialog {w day firstDay args} {
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
# Center the window on the root
@@ -1734,7 +1730,7 @@ proc EditReminder {rem args} {
}
pack .edit.t -side top -fill both -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
CenterWindow .edit
tkwait visibility .edit
@@ -2289,6 +2285,8 @@ proc FireEditor { w } {
return
}
}
Status "Firing up editor..."
after 1500 DisplayTime
set EditorPid [exec sh -c $editor &]
}
@@ -2630,12 +2628,13 @@ proc DoMoonSpecial { n stuff } {
3 { set image last }
}
.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 != ""} {
.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
}
#***********************************************************************

View File

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

View File

@@ -41,7 +41,6 @@ typedef struct cal_entry {
/* Global variables */
static CalEntry *CalColumn[7];
static CalEntry *CalPs[7];
static int ColSpaces;
@@ -588,13 +587,13 @@ static int DoCalRem(ParsePtr p, int col)
int r;
int jul;
CalEntry *CurCol = CalColumn[col];
CalEntry *CurPs = CalPs[col];
CalEntry *e;
char *s, *s2;
DynamicBuffer buf, obuf;
DynamicBuffer buf, obuf, pre_buf;
Token tok;
DBufInit(&buf);
DBufInit(&pre_buf);
/* Parse the trigger date and time */
if ( (r=ParseRem(p, &trig, &tim)) ) return r;
@@ -638,27 +637,30 @@ static int DoCalRem(ParsePtr p, int col)
strcpy(trig.passthru, "PSFile");
trig.typ = PASSTHRU_TYPE;
}
if (!PsCal) {
if (trig.typ == PASSTHRU_TYPE) {
if (strcmp(trig.passthru, "COLOR")) return OK;
/* Strip off the three color numbers */
DBufFree(&buf);
r=ParseToken(p, &buf);
DBufFree(&buf);
if (r) return r;
r=ParseToken(p, &buf);
DBufFree(&buf);
if (r) return r;
r=ParseToken(p, &buf);
DBufFree(&buf);
if (r) return r;
}
}
/* Remove any "at" times from PS or PSFILE reminders */
if (trig.typ == PASSTHRU_TYPE && strcmp(trig.passthru, "COLOR")) {
tim.ttime = NO_TIME;
tim.duration = NO_TIME;
if (trig.typ == PASSTHRU_TYPE) {
if (!PsCal && strcmp(trig.passthru, "COLOR")) return OK;
if (!strcmp(trig.passthru, "COLOR")) {
/* Strip off the three color numbers */
DBufFree(&buf);
r=ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
DBufPutc(&pre_buf, ' ');
DBufFree(&buf);
if (r) return r;
r=ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
DBufPutc(&pre_buf, ' ');
DBufFree(&buf);
if (r) return r;
r=ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
DBufPutc(&pre_buf, ' ');
DBufFree(&buf);
if (r) return r;
if (!PsCal && !DoSimpleCalendar) {
DBufFree(&pre_buf);
}
}
}
/* If trigger date == today, add it to the current entry */
@@ -670,15 +672,19 @@ static int DoCalRem(ParsePtr p, int col)
NumTriggered++;
if (DoSimpleCalendar || tim.ttime != NO_TIME) {
/* Suppress time if it's not today */
if (jul != JulianToday) {
/* Suppress time if it's not today or if it's a non-COLOR special */
if (jul != JulianToday ||
(trig.typ == PASSTHRU_TYPE &&
strcmp(trig.passthru, "COLOR"))) {
if (DBufPuts(&obuf, SimpleTime(NO_TIME)) != OK) {
DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM;
}
} else {
if (DBufPuts(&obuf, SimpleTime(tim.ttime)) != OK) {
if (DBufPuts(&obuf, CalendarTime(tim.ttime, tim.duration)) != OK) {
DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM;
}
}
@@ -694,6 +700,7 @@ static int DoCalRem(ParsePtr p, int col)
if (DBufPuts(&obuf, v.v.str) != OK) {
DestroyValue(v);
DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM;
}
}
@@ -710,11 +717,13 @@ static int DoCalRem(ParsePtr p, int col)
r = DoSubst(p, &obuf, &trig, &tim, jul, CAL_MODE);
}
if (r) {
DBufFree(&pre_buf);
DBufFree(&obuf);
return r;
}
if (DBufLen(&obuf) <= oldLen) {
DBufFree(&obuf);
DBufFree(&pre_buf);
return OK;
}
if (trig.typ != PASSTHRU_TYPE &&
@@ -728,6 +737,7 @@ static int DoCalRem(ParsePtr p, int col)
if (DBufPuts(&obuf, v.v.str) != OK) {
DestroyValue(v);
DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM;
}
}
@@ -736,13 +746,17 @@ static int DoCalRem(ParsePtr p, int col)
}
s = DBufValue(&obuf);
if (!DoSimpleCalendar) while (isspace(*s)) s++;
DBufPuts(&pre_buf, s);
s = DBufValue(&pre_buf);
e = NEW(CalEntry);
if (!e) {
DBufFree(&obuf);
DBufFree(&pre_buf);
return E_NO_MEM;
}
e->text = StrDup(s);
DBufFree(&obuf);
DBufFree(&pre_buf);
if (!e->text) {
free(e);
return E_NO_MEM;
@@ -764,35 +778,20 @@ static int DoCalRem(ParsePtr p, int col)
}
e->lineno = LineNo;
/* Ugly hack... SPECIAL COLOR and SPECIAL HTML are not treated
as "passthru" to preserve ordering and make them behave like
a MSG-type reminder */
if (trig.typ == PASSTHRU_TYPE &&
strcmp(trig.passthru, "COLOR") &&
strcmp(trig.passthru, "HTML")) {
if (trig.typ == PASSTHRU_TYPE) {
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
e->pos = e->passthru;
e->time = NO_TIME;
e->next = CurPs;
CalPs[col] = e;
SortCol(&CalPs[col]);
} else {
if (trig.typ == PASSTHRU_TYPE) {
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
} else {
e->passthru[0] = 0;
}
e->pos = e->text;
if (jul == JulianToday) {
e->time = tim.ttime;
} else {
e->time = NO_TIME;
}
e->next = CurCol;
CalColumn[col] = e;
SortCol(&CalColumn[col]);
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]);
}
return OK;
}
@@ -806,36 +805,11 @@ static int DoCalRem(ParsePtr p, int col)
/***************************************************************/
static void WriteSimpleEntries(int col, int jul)
{
CalEntry *e = CalPs[col];
CalEntry *e = CalColumn[col];
CalEntry *n;
int y, m, d;
/* Do all the PASSTHRU entries first, if any */
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) {
if (DoPrefixLineNo) printf("# fileinfo %d %s\n", e->lineno, e->filename);
printf("%04d/%02d/%02d", y, m+1, d);
@@ -904,6 +878,89 @@ static void WriteCalDays(void)
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 *
CalendarTime(int tim, int duration)
{
static char buf[128];
int h, min, hh;
int h2, min2, hh2, newtim, days;
char *ampm1;
char *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 */
@@ -929,7 +986,7 @@ char *SimpleTime(int tim)
if (h == 0) hh=12;
else if (h > 12) hh=h-12;
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;

View File

@@ -87,8 +87,7 @@
/*---------------------------------------------------------------------*/
/* WANT_U_OPTION: Comment out the next define to permanently disable */
/* the -u option. If you do this, however, remind-all.[c]sh will not */
/* work. */
/* the -u option. */
/*---------------------------------------------------------------------*/
#define WANT_U_OPTION 1

View File

@@ -87,8 +87,7 @@
/*---------------------------------------------------------------------*/
/* WANT_U_OPTION: Comment out the next define to permanently disable */
/* the -u option. If you do this, however, remind-all.[c]sh will not */
/* work. */
/* the -u option. */
/*---------------------------------------------------------------------*/
#define WANT_U_OPTION 1

View File

@@ -62,6 +62,7 @@ int DoRem(ParsePtr p)
if (trig.typ == SAT_TYPE) {
r=DoSatRemind(&trig, &tim, p);
if (r) return r;
if (!LastTrigValid) return OK;
r=ParseToken(p, &buf);
if (r) return r;
FindToken(DBufValue(&buf), &tok);
@@ -145,6 +146,7 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim)
trig->sched[0] = 0;
trig->warn[0] = 0;
trig->tag[0] = 0;
trig->passthru[0] = 0;
tim->ttime = NO_TIME;
tim->delta = NO_DELTA;
tim->rep = NO_REP;
@@ -552,11 +554,13 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
char PrioExpr[25];
char tmpBuf[64];
DynamicBuffer buf, calRow;
DynamicBuffer pre_buf;
char *s;
Value v;
DBufInit(&buf);
DBufInit(&calRow);
DBufInit(&pre_buf);
if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
if ((t->typ == PASSTHRU_TYPE && strcmp(t->passthru, "COLOR")) ||
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")) {
/* Strip off three tokens */
r = ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
DBufPutc(&pre_buf, ' ');
DBufFree(&buf);
if (r) return r;
r = ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
DBufPutc(&pre_buf, ' ');
DBufFree(&buf);
if (r) return r;
r = ParseToken(p, &buf);
DBufPuts(&pre_buf, DBufValue(&buf));
DBufPutc(&pre_buf, ' ');
DBufFree(&buf);
if (r) return r;
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 (!DBufLen(&buf)) {
DBufFree(&buf);
DBufFree(&pre_buf);
return OK;
}
FromJulian(jul, &y, &m, &d);
sprintf(tmpBuf, "%04d/%02d/%02d ", y, m+1, d);
if (DBufPuts(&calRow, tmpBuf) != OK) {
DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM;
}
/* 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 */
if (DBufPuts(&calRow, "* ") != OK) {
DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM;
}
if (t->tag[0]) {
@@ -617,6 +630,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
}
if (DBufPuts(&calRow, tmpBuf) != OK) {
DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM;
}
if (tim->duration != NO_TIME) {
@@ -626,6 +640,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
}
if (DBufPuts(&calRow, tmpBuf) != OK) {
DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM;
}
if (tim->ttime != NO_TIME) {
@@ -635,16 +650,19 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
}
if (DBufPuts(&calRow, tmpBuf) != OK) {
DBufFree(&calRow);
DBufFree(&pre_buf);
return E_NO_MEM;
}
}
if (DBufPuts(&calRow, SimpleTime(tim->ttime)) != OK) {
DBufFree(&calRow);
DBufFree(&pre_buf);
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(&pre_buf);
DBufFree(&calRow);
return OK;
}
@@ -804,6 +822,9 @@ int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
if (r) {
if (r == E_CANT_TRIG) return OK; else return r;
}
if (jul == -1) {
return OK;
}
s = p->pos;
r = EvaluateExpr(p, &v);
t = p->pos;

View File

@@ -2046,6 +2046,7 @@ static int FFiledatetime(void)
/* Canned PostScript code for shading a calendar square */
/* */
/***************************************************************/
static int psshade_warned = 0;
static int FPsshade(void)
{
char psbuff[256];
@@ -2061,6 +2062,11 @@ static int FPsshade(void)
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 ");
s += strlen(s);
sprintf(s, "_A _A moveto ");
@@ -2082,6 +2088,8 @@ static int FPsshade(void)
/* Canned PostScript code for generating moon phases */
/* */
/***************************************************************/
static int psmoon_warned = 0;
static int FPsmoon(void)
{
char psbuff[512];
@@ -2109,6 +2117,10 @@ static int FPsmoon(void)
}
}
}
if (!psmoon_warned) {
psmoon_warned = 1;
Eprint("psmoon() is deprecated; use SPECIAL MOON instead.");
}
if (size > 0) {
sprintf(sizebuf, "%d", size);
} else {

View File

@@ -84,6 +84,37 @@ static void InitializeVar(char *str);
static char *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 *DefaultFilename(void)
{
char *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);
}
/***************************************************************/
/* */
/* InitRemind */
@@ -97,6 +128,8 @@ void InitRemind(int argc, char *argv[])
int i;
int y, m, d, rep;
Token tok;
int InvokedAsRem = 0;
char *s;
/* Initialize global dynamic buffers */
DBufInit(&Banner);
@@ -125,6 +158,19 @@ void InitRemind(int argc, char *argv[])
JulianToday = RealToday;
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 */
i = 1;
while (i < argc) {
@@ -223,11 +269,11 @@ void InitRemind(int argc, char *argv[])
if (*arg == '0') {
PARSENUM(Daemon, arg);
if (Daemon == 0) Daemon = -1;
else if (Daemon < 5) Daemon = 5;
else if (Daemon < 1) Daemon = 1;
else if (Daemon > 60) Daemon = 60;
} else {
PARSENUM(Daemon, arg);
if (Daemon<5) Daemon=5;
if (Daemon<1) Daemon=1;
else if (Daemon>60) Daemon=60;
}
break;
@@ -360,11 +406,15 @@ void InitRemind(int argc, char *argv[])
}
/* Get the filename. */
if (i >= argc) {
Usage();
exit(1);
if (!InvokedAsRem) {
if (i >= argc) {
Usage();
exit(1);
}
InitialFile = argv[i++];
} else {
InitialFile = DefaultFilename();
}
InitialFile = argv[i++];
/* Get the date, if any */
if (i < argc) {

View File

@@ -22,6 +22,7 @@ int CallUserFunc (char *name, int nargs);
int DoFset (ParsePtr p);
void ProduceCalendar (void);
char *SimpleTime (int tim);
char *CalendarTime (int tim, int duration);
int DoRem (ParsePtr p);
int DoFlush (ParsePtr p);
void DoExit (ParsePtr p);

View File

@@ -41,6 +41,7 @@ typedef struct queuedrem {
int RunDisabled;
int ntrig;
char *text;
char passthru[PASSTHRU_LEN+1];
char sched[VAR_NAME_LEN+1];
char tag[TAG_LEN+1];
TimeTrig tt;
@@ -89,6 +90,7 @@ int QueueReminder(ParsePtr p, Trigger *trig,
}
NumQueued++;
qelem->typ = trig->typ;
strcpy(qelem->passthru, trig->passthru);
qelem->tt = *tim;
qelem->next = QueueHead;
qelem->RunDisabled = RunDisabled;
@@ -179,13 +181,30 @@ void HandleQueuedReminders(void)
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) {
sleep(SleepTime);
} else {
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 < 0) {
@@ -200,36 +219,45 @@ void HandleQueuedReminders(void)
}
/* Trigger the reminder */
CreateParser(q->text, &p);
trig.typ = q->typ;
RunDisabled = q->RunDisabled;
if (Daemon < 0) {
printf("NOTE reminder %s ",
SimpleTime(q->tt.ttime));
printf("%s ", SimpleTime(SystemTime(0)/60));
if (!*q->tag) {
printf("*");
} else {
printf("%s", q->tag);
/* Do NOT trigger the reminder if tt.nexttime is more than a
minute in the past. This can happen if the clock is
changed or a laptop awakes from hibernation.
However, DO triger if tt.nexttime == tt.ttime so all
queued reminders are triggered at least once. */
if ((SystemTime(0) - (q->tt.nexttime * 60) <= 60) ||
(q->tt.nexttime == q->tt.ttime)) {
/* Trigger the reminder */
CreateParser(q->text, &p);
trig.typ = q->typ;
strcpy(trig.passthru, q->passthru);
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()
and trigtime() work correctly */
LastTriggerDate = JulianToday;
LastTriggerTime = q->tt.ttime;
LastTrigValid = 1;
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
if (Daemon < 0) {
printf("NOTE endreminder\n");
/* Set up global variables so some functions like trigdate()
and trigtime() work correctly */
LastTriggerDate = JulianToday;
LastTriggerTime = q->tt.ttime;
LastTrigValid = 1;
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
if (Daemon < 0) {
printf("NOTE endreminder\n");
}
fflush(stdout);
DestroyParser(&p);
}
fflush(stdout);
/* Calculate the next trigger time */
q->tt.nexttime = CalculateNextTime(q);
DestroyParser(&p);
}
exit(0);
}
@@ -322,8 +350,11 @@ void GotSigInt(void)
q->tt.rep, q->tt.delta, q->sched);
if (*q->sched) printf("(%d)", q->ntrig+1);
printf("%s", NL);
printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
((q->typ == MSF_TYPE) ? "MSF" :"RUN")),
printf("Text: %s %s%s%s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
((q->typ == MSF_TYPE) ? "MSF" :
((q->typ == RUN_TYPE) ? "RUN" : "SPECIAL"))),
q->passthru,
(*(q->passthru)) ? " " : "",
q->text,
NL, NL);
}

View File

@@ -350,7 +350,7 @@ int ComputeTrigger(int today, Trigger *trig, int *err)
{
int nattempts = 0,
start = today,
nextstart,
nextstart = 0,
y, m, d,
result;

View File

@@ -10,4 +10,4 @@
/* */
/***************************************************************/
#define VERSION "03.01.01"
#define VERSION "03.01.03"

View File

@@ -12,7 +12,31 @@
# ---------------------------------------------------------------------------
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
if [ "$?" = "0" ]; then
echo "Remind: Acceptance test PASSED"

View File

@@ -1,3 +1,5 @@
Test 1
# Test file for REMIND
#
# Use this file to test the date calculation routines
@@ -5,8 +7,13 @@
#
# ./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())]
../tests/test.rem(8): Trig = Saturday, 16 February, 1991
../tests/test.rem(12): Trig = Saturday, 16 February, 1991
Reminders for Saturday, 16th February, 1991:
today() => 1991-02-16
@@ -26,7 +33,7 @@ y => "Tishrey"
hebdate(1, "Tishrey") => 1991-09-09
trigger(1991-09-09) => "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
Entering UserFN _h(2, "Tishrey")
x => 2
@@ -34,7 +41,7 @@ y => "Tishrey"
hebdate(2, "Tishrey") => 1991-09-10
trigger(1991-09-10) => "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
Entering UserFN _h(3, "Tishrey")
x => 3
@@ -42,7 +49,7 @@ y => "Tishrey"
hebdate(3, "Tishrey") => 1991-09-11
trigger(1991-09-11) => "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
Entering UserFN _h(10, "Tishrey")
x => 10
@@ -50,7 +57,7 @@ y => "Tishrey"
hebdate(10, "Tishrey") => 1991-09-18
trigger(1991-09-18) => "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
Entering UserFN _h(15, "Tishrey")
x => 15
@@ -58,7 +65,7 @@ y => "Tishrey"
hebdate(15, "Tishrey") => 1991-09-23
trigger(1991-09-23) => "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
Entering UserFN _h(25, "Kislev")
x => 25
@@ -66,7 +73,7 @@ y => "Kislev"
hebdate(25, "Kislev") => 1991-12-02
trigger(1991-12-02) => "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
Entering UserFN _h(10, "Tevet")
x => 10
@@ -74,7 +81,7 @@ y => "Tevet"
hebdate(10, "Tevet") => 1991-12-17
trigger(1991-12-17) => "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
Entering UserFN _h(15, "Shvat")
x => 15
@@ -82,7 +89,7 @@ y => "Shvat"
hebdate(15, "Shvat") => 1992-01-20
trigger(1992-01-20) => "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
Entering UserFN _h(15, "Adar A")
x => 15
@@ -90,7 +97,7 @@ y => "Adar A"
hebdate(15, "Adar A") => 1992-02-19
trigger(1992-02-19) => "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
Entering UserFN _h(14, "Adar")
x => 14
@@ -98,7 +105,7 @@ y => "Adar"
hebdate(14, "Adar") => 1991-02-28
trigger(1991-02-28) => "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
Entering UserFN _h(15, "Nisan")
x => 15
@@ -106,7 +113,7 @@ y => "Nisan"
hebdate(15, "Nisan") => 1991-03-30
trigger(1991-03-30) => "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
Entering UserFN _h(27, "Nisan")
x => 27
@@ -114,7 +121,7 @@ y => "Nisan"
hebdate(27, "Nisan") => 1991-04-11
trigger(1991-04-11) => "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
Entering UserFN _h(4, "Iyar")
x => 4
@@ -122,7 +129,7 @@ y => "Iyar"
hebdate(4, "Iyar") => 1991-04-18
trigger(1991-04-18) => "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
Entering UserFN _h(5, "Iyar")
x => 5
@@ -130,7 +137,7 @@ y => "Iyar"
hebdate(5, "Iyar") => 1991-04-19
trigger(1991-04-19) => "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
Entering UserFN _h(28, "Iyar")
x => 28
@@ -138,7 +145,7 @@ y => "Iyar"
hebdate(28, "Iyar") => 1991-05-12
trigger(1991-05-12) => "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
Entering UserFN _h(6, "Sivan")
x => 6
@@ -146,7 +153,7 @@ y => "Sivan"
hebdate(6, "Sivan") => 1991-05-19
trigger(1991-05-19) => "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
Entering UserFN _h(9, "Av")
x => 9
@@ -154,7 +161,7 @@ y => "Av"
hebdate(9, "Av") => 1991-07-20
trigger(1991-07-20) => "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
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
trigger(1991-11-07) => "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
today() => 1991-02-16
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
trigger(1991-11-07) => "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
today() => 1991-02-16
Entering UserFN _i(30, "Heshvan", 1991-02-16, 5761)
@@ -187,7 +194,7 @@ x => 30
y => "Heshvan"
z => 1991-02-16
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
Leaving UserFN _i() => Invalid Hebrew date
@@ -201,7 +208,7 @@ 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"
../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
today() => 1991-02-16
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
trigger(1991-12-07) => "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
today() => 1991-02-16
Entering UserFN _i(30, "Kislev", 1991-02-16, 5761)
@@ -220,7 +227,7 @@ x => 30
y => "Kislev"
z => 1991-02-16
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
Leaving UserFN _i() => Invalid Hebrew date
@@ -234,7 +241,7 @@ 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"
../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
today() => 1991-02-16
Entering UserFN _i(30, "Adar A", 1991-02-16, 5756)
@@ -242,7 +249,7 @@ x => 30
y => "Adar A"
z => 1991-02-16
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
Leaving UserFN _i() => Invalid Hebrew date
[_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
trigger(1991-03-15) => "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
today() => 1991-02-16
Entering UserFN _i(29, "Adar A", 1991-02-16, 5756)
@@ -263,221 +270,221 @@ x => 29
y => "Adar A"
z => 1991-02-16
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
Leaving UserFN _i() => Invalid Hebrew date
# Test each possible case of the basic reminders.
REM MSG Every Day
../tests/test.rem(46): Trig = Saturday, 16 February, 1991
../tests/test.rem(50): Trig = Saturday, 16 February, 1991
Every Day
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
../tests/test.rem(49): Trig = Friday, 15 March, 1991
../tests/test.rem(53): Trig = Friday, 15 March, 1991
REM Feb MSG February
../tests/test.rem(51): Trig = Saturday, 16 February, 1991
../tests/test.rem(55): Trig = Saturday, 16 February, 1991
February
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
../tests/test.rem(53): Trig = Friday, 1 March, 1991
../tests/test.rem(57): Trig = Friday, 1 March, 1991
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
../tests/test.rem(56): Trig = Saturday, 15 February, 1992
../tests/test.rem(60): Trig = Saturday, 15 February, 1992
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
../tests/test.rem(58): Trig = Saturday, 29 February, 1992
../tests/test.rem(62): Trig = Saturday, 29 February, 1992
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
../tests/test.rem(61): Expired
../tests/test.rem(65): Expired
REM 1991 MSG 1991
../tests/test.rem(62): Trig = Saturday, 16 February, 1991
../tests/test.rem(66): Trig = Saturday, 16 February, 1991
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
../tests/test.rem(65): Expired
../tests/test.rem(69): Expired
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
../tests/test.rem(67): Trig = Wednesday, 29 January, 1992
../tests/test.rem(71): Trig = Wednesday, 29 January, 1992
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
REM Jan 1990 MSG Jan 1990
../tests/test.rem(70): Expired
../tests/test.rem(74): Expired
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
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
../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
../tests/test.rem(75): Expired
../tests/test.rem(79): Expired
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
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
../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
../tests/test.rem(80): Trig = Saturday, 16 February, 1991
../tests/test.rem(84): Trig = Saturday, 16 February, 1991
Fri Sat Tue
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
../tests/test.rem(83): Trig = Friday, 1 March, 1991
../tests/test.rem(87): Trig = Friday, 1 March, 1991
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
../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
../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
../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
../tests/test.rem(91): Trig = Saturday, 16 February, 1991
../tests/test.rem(95): Trig = Saturday, 16 February, 1991
Sat Sun 1991
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
../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
../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
../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
../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
../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
../tests/test.rem(101): Trig = Tuesday, 28 January, 1992
../tests/test.rem(105): Trig = Tuesday, 28 January, 1992
# Try some Backs
CLEAR-OMIT-CONTEXT
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
../tests/test.rem(106): Trig = Thursday, 28 February, 1991
../tests/test.rem(110): Trig = Thursday, 28 February, 1991
OMIT 28 Feb
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)
../tests/test.rem(110): Trig = Thursday, 28 February, 1991
../tests/test.rem(114): Trig = Thursday, 28 February, 1991
CLEAR-OMIT-CONTEXT
# Try out UNTIL
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
OMIT 28 Feb 1991
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)
../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)
../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)
../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)
../tests/test.rem(124): Trig = Friday, 1 March, 1991
../tests/test.rem(128): Trig = Friday, 1 March, 1991
PUSH-OMIT-CONTEXT
CLEAR-OMIT-CONTEXT
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
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
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)
../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)
../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)
../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)
../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
../tests/test.rem(142): Trig = Wednesday, 13 March, 1991
../tests/test.rem(146): Trig = Wednesday, 13 March, 1991
# Test BACK
CLEAR-OMIT-CONTEXT
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
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)
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
# Test the scanfrom clause
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())]
trigdate() => 1991-02-22
trigger(1991-02-22) => "22 February 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
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"
../tests/test.rem(158): Trig = Friday, 15 February, 1991
../tests/test.rem(162): 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
../tests/test.rem(160): Trig = Saturday, 16 February, 1991
../tests/test.rem(164): Trig = Saturday, 16 February, 1991
16 Feb 1991
CLEAR-OMIT-CONTEXT
@@ -503,7 +510,7 @@ set a008 coerce("string", 11:44)
coerce("string", 11:44) => "11:44"
set a009 coerce("int", "badnews")
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")
coerce("int", "12") => 12
set a011 coerce("int", 11:44)
@@ -515,7 +522,7 @@ 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
../tests/test.rem(176): Bad date specification
../tests/test.rem(180): Bad date specification
set a015 day(today())
today() => 1991-02-16
day(1991-02-16) => 16
@@ -610,15 +617,15 @@ strlen("sadjflkhsldkfhsdlfjhk") => 21
set a050 substr(a049, 2)
a049 => 21
substr(21, 2) => Type mismatch
../tests/test.rem(214): Type mismatch
../tests/test.rem(218): Type mismatch
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)
1 + 2 => 3
3 + 4 => 7
time(3, 7) => 03:07
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()
trigdate() => 1992-01-10
set a054 trigtime()
@@ -631,7 +638,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
version() => "03.01.01"
version() => "03.01.03"
set a059 wkday(today())
today() => 1991-02-16
wkday(1991-02-16) => "Saturday"
@@ -710,31 +717,31 @@ y => 11:33
x => "foo"
y => 11:33
"foo" * 11:33 => Type mismatch
../tests/test.rem(240): `*': Type mismatch
../tests/test.rem(244): `*': 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]%
../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"...
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]%
../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"...
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]%
../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"...
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]%
../tests/test.rem(248): Trig = Saturday, 16 February, 1991
../tests/test.rem(252): Trig = Saturday, 16 February, 1991
a077 => "1992 92
"
1992 92
@@ -772,7 +779,7 @@ dump
a048 "foo"
a067 "INT"
a039 "February"
a058 "03.01.01"
a058 "03.01.03"
a077 "1992 92
"
a049 21
@@ -828,3 +835,343 @@ dump
a045 "iess"
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/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/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/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/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/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/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/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/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/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!
# 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())]
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

40
tests/test2.rem Normal file
View File

@@ -0,0 +1,40 @@
# 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

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,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 is a Perl script which transforms the output of
`remind -p ...' to an HTML table. Type `perl rem2html --help' for
usage information.
Rem2HTML is a Perl script that transforms the output of `remind -p
...' to HTML. Type `perl rem2html --help' for usage information.
Typical usage: remind -p ~/.reminders | rem2html > file.html
You may have to edit the "#!/bin/perl" line to reflect the location
of your Perl interpreter.
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.)
You may have to edit the "#!/usr/bin/perl" line to reflect the
location of your Perl interpreter.
--
David F. Skoll

View File

@@ -6,10 +6,6 @@
# CAL_DISPATCH -- Shell script for CGI directory to dispatch calendar
# 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>
<!-- Sample HTML file with links to the calendar stuff -->
<HEAD>
<TITLE>David Skoll's Calendar Server</TITLE>
<TITLE>Remind Calendar Server</TITLE>
</HEAD>
<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>
<a HREF="http://your.machine/your.dir/cal_dispatch?sunset">
<a HREF="%CGIDIR%/cal_dispatch?sunset">
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>
<a HREF="http://your.machine/your.dir/cal_dispatch?calps">
<a HREF="%CGIDIR%/cal_dispatch?calps">
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>
<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>
<a HREF="http://your.machine/your.dir/cal_dispatch?hebhtml">
HTML Calendar with Jewish Holidays</a> (Your browser must support tables.)<P>
<a HREF="%CGIDIR%/cal_dispatch?hebhtml">
HTML Calendar with Jewish Holidays</a>
<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>
</BODY>

View File

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

View File

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

View File

@@ -12,7 +12,7 @@ echo ""
$REMIND - <<EOR
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
exit 0

View File

@@ -9,11 +9,11 @@ set now now()
banner %
MSG <HEAD>%
MSG <TITLE>Moon over Ottawa</TITLE>%
MSG <TITLE>Moon over [$Location]</TITLE>%
MSG </HEAD>%
MSG <BODY>
MSG <H1>Moon over Ottawa</H1>
MSG <H1>Moon over [$Location]</H1>
set ndate moondate(0)
set ntime moontime(0)
@@ -22,12 +22,12 @@ set ftime moontime(2)
fset t(x) wkday(x)+", "+day(x)+" "+mon(x)+", "+year(x)
msg Today is %w, %d %m, %y.<P>
msg The local time in Ottawa is [now].<P>
msg The local time in [$Location] is [now].<P>
if ndate < fdate
msg The next new moon is on [t(ndate)] at [ntime], Ottawa time.<P>
msg The next full moon is on [t(fdate)] at [ftime], Ottawa time.<P>
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], [$Location] time.<P>
else
msg The next full moon is on [t(fdate)] at [ftime], Ottawa time.<P>
msg The next new moon is on [t(ndate)] at [ntime], Ottawa time.<P>
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], [$Location] time.<P>
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,533 @@
#!/usr/bin/perl
# rem2html
#
# 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 strict;
use warnings;
use Getopt::Long;
@months = (January,February,March,April,May,June,July,August,September,October,November,December);
my %Options;
$DefaultImageDir = "%IMAGEBASE%";
if ($DefaultImageDir =~ m@/$@) {
chop $DefaultImageDir;
}
my $rem2html_version = '2.0';
$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)
# do not correctly handle transparency in PNG images, so I had to make the
# moon image background white.
$Options{'bgcolor'} ||= "BGCOLOR=\"#FFFFFF\"";
# rem2html -- convert the output of "remind -p" to HTML
if (-t STDIN) {
print STDERR "(Rem2HTML: Input should not come from a terminal.)\n";
$Options{'help'} = 1;
}
=head1 NAME
if ($Options{'help'}) {
&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);
}
rem2html - Convert the output of "remind -p" to HTML
exit(0);
=head1 SYNOPSIS
sub show_usage {
print STDERR <<EndOfUsage;
Rem2HTML: Produce a HTML calendar from the output of Remind.
remind -p ... | rem2html [options]
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:
--help, -h Print this information
--version Version information
-p file Prepend the specified HTML file to the beginning of the
output
-a file Append the specified HTML file to the end of the output
-f[shted] font Set font for small cal, hdr, title, cal entries,day numbers
-s[hted] size Set size for header, title, calendar entries and/or day
numbers
--backurl url Make the title on the previous month's small calendar entry
a hyperlink to <url>
--forwurl url Same as --backurl, but with the next month's small calendar
--tableonly Output the results as a <TABLE> block only, no <HTML>, etc.
--border,-b size Set the border thickness of the table
--cellspace,-t size Set the line thickness of the table
--bgcolor,-g color Set the background color for the day entries
EndOfUsage
--help, -h Print usage information
--man Show man page (requires "perldoc")
--version Print version
--backurl url Make the title on the previous month's small calendar
entry a link to <url>
--forwurl url Same as --backurl, but for the next month's small calendar
--imgbase url Base URL of images and default stylesheet file
--stylesheet url.css URL of CSS stylesheet. If specified, imgbase is NOT
prepended to url.css
--nostyle Produce basic HTML that does not use a CSS stylesheet
--tableonly Output results as a <table> only, no <html>, <body>, etc.
--title string What to put in <title>...</title> tags
--prologue html_text Text to insert at the top of the body
--epilogue html_text Text to insert at the end of the body
EOM
exit($exit_status);
}
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) {
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";
}
# 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<p>";
} else {
print "<td valign=\"top\" $shade>\n<p>";
}
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></p>\n";
print "<p>&nbsp;</p>\n";
} else {
print "<div class=\"rem-daynumber\">$day</div></p>\n";
print "<p class=\"rem-entry\">&nbsp;</p>\n";
}
if ($days->[$day]) {
print(join("\n", @{$days->[$day]}));
}
print "</td>\n";
}
sub escape_html
{
my($in) = @_;
$in =~ s/\&/\&amp;/g;
$in =~ s/\</\&lt;/g;
@@ -104,313 +535,35 @@ sub escape_html {
return $in;
}
sub parse_options {
%Options = ();
GetOptions (\%Options, "help|h",
"version",
"border|b=i",
"cellspace|t=i",
"backurl|bu:s", "forwurl|fu:s",
"tableonly|to",
"prologue|p=s",
"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'}";
parse_options();
if ($Options{'help'}) {
usage(0);
exit(0);
} elsif ($Options{'man'}) {
system("perldoc $0");
exit(0);
} elsif ($Options{'version'}) {
print "rem2html version $rem2html_version.\n";
exit(0);
}
sub parse_input {
local $where = 0;
local $msg;
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;
if (-t STDIN) {
print STDERR "$TIDY_PROGNAME: Input should not come from a terminal.\n\n";
usage(1);
}
sub output_header {
local ($title, $dayheader);
if (!$Options{'tableonly'}) {
print <<EndOfHTML;
<HTML>
<HEAD><TITLE>Reminders for $caption</TITLE></HEAD>
<BODY>
EndOfHTML
}
print <<EndOfHTML;
<!-- This output was produced by Rem2HTML $rem2html_version (written by
Don Schwarz <darkowl\@mcs.net>) and Remind (written by David F. Skoll). -->
EndOfHTML
if ($Options{'prologue'}) {
open(PROLOGUE, "< $Options{'prologue'}");
print while ( <PROLOGUE> );
close(PROLOGUE);
}
$caption = &format_font($caption, $Options{'ft'}, $Options{'st'} || "+1");
print <<EndOfHTML;
<TABLE $Options{'border'} $Options{'cellspace'} $Options{'bgcolor'} WIDTH=100%>
<CAPTION><STRONG>$caption</STRONG></CAPTION>
<TR>
EndOfHTML
$mfirst || &print_day_header($DayNames[0]);
for($i=1; $i<7; $i++) {
&print_day_header($DayNames[$i]);
}
$mfirst && &print_day_header($DayNames[0]);
print " </TR>\n";
my $found_something = 0;
while(1) {
last if (!parse_input());
start_output() unless $found_something;
$found_something = 1;
output_calendar();
}
if ($found_something) {
end_output();
exit(1);
} else {
print STDERR "$TIDY_PROGNAME: Could not find any calendar data on STDIN.\n";
exit(1);
}
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 %
MSG <HEAD>%
MSG <TITLE>Sunrise in Ottawa</TITLE>%
MSG <TITLE>Sunrise in [$Location]</TITLE>%
MSG </HEAD>%
MSG <BODY>
MSG <H1>Sunrise in Ottawa</H1>
MSG <H1>Sunrise in [$Location]</H1>
set tod sunrise(today())
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 aw iif(tod==tom, " as well.", ".")
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 tomorrow is at [tom][aw]<P>
msg The daylight portion of tomorrow will be [slen] today.<P>

View File

@@ -9,11 +9,11 @@ set now now()
banner %
MSG <HEAD>%
MSG <TITLE>Sunset in Ottawa</TITLE>%
MSG <TITLE>Sunset in [$Location]</TITLE>%
MSG </HEAD>%
MSG <BODY>
MSG <H1>Sunset in Ottawa</H1>
MSG <H1>Sunset in [$Location]</H1>
set tod sunset(today())
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 aw iif(tod==tom, " as well.", ".")
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 tomorrow is at [tom][aw]<P>
msg The daylight portion of tomorrow will be [slen] today.<P>