Compare commits

..

92 Commits

Author SHA1 Message Date
David F. Skoll
f678dc96b8 Write man page for rem2html 2007-10-07 22:24:35 -04:00
David F. Skoll
c2e371904e Update distclean target. 2007-10-07 22:10:25 -04:00
David F. Skoll
2a1cbff22e Add www/Makfile to gitignore. 2007-10-07 22:09:47 -04:00
David F. Skoll
a2d9f277c4 Minor tweaks to Makefile.in 2007-10-07 22:09:37 -04:00
David F. Skoll
d939059417 Improve www/Makefile stuff. 2007-10-07 22:05:35 -04:00
David F. Skoll
740cd4cfed Update README. 2007-10-06 11:41:40 -04:00
David F. Skoll
91a5306a67 Fix typo. 2007-10-06 11:38:23 -04:00
David F. Skoll
b78ffcbffd Tidy up option processing. 2007-10-06 11:35:57 -04:00
David F. Skoll
4f72f557b7 Minor fix to --nostyle output. 2007-10-05 11:52:16 -04:00
David F. Skoll
e3b21d6d0d More tweaks. 2007-10-04 22:02:27 -04:00
David F. Skoll
af28c49d8d Fixed up the www stuff. 2007-10-04 22:01:09 -04:00
David F. Skoll
67f4635573 Fix DST rules. 2007-10-04 13:41:42 -04:00
David F. Skoll
5f8d10908d Minor cleanups. 2007-10-03 12:32:41 -04:00
David F. Skoll
7307421812 Add --nostyle option to rem2html so it can produce basic HTML that does
not rely on an external stylesheet.
2007-10-02 18:47:38 -04:00
David F. Skoll
5cd3b628c5 Minor tweaks. 2007-10-02 14:03:19 -04:00
David F. Skoll
29e483ab64 Updated Makefile and rem2html to use IMGBASE for stylesheet also. 2007-10-02 11:31:06 -04:00
David F. Skoll
66ddba45af Add support for HTMLCLASS special. Add CSS code for rem-today class to
highlight "today".
2007-10-02 11:21:40 -04:00
David F. Skoll
9325b3f035 Minor tweaks to CSS. 2007-10-01 18:03:21 -04:00
David F. Skoll
522c4c94e1 Add --imgbase option. 2007-10-01 17:59:33 -04:00
David F. Skoll
730505cff3 Less verbose. 2007-10-01 17:27:58 -04:00
David F. Skoll
019783e1fa Redo rem2html. Uses CSS instead of hard-coded stuff. 2007-10-01 17:21:59 -04:00
David F. Skoll
8612bb6480 Do not evaluate SATISFY expression if reminder has expired. 2007-09-26 08:41:34 -04:00
David F. Skoll
7f1e6d21d9 Update version number and copyright year. 2007-09-24 10:32:06 -04:00
David F. Skoll
e6c0371be1 Make calendar times show duration. 2007-09-16 17:44:33 -04:00
David F. Skoll
58feaa7e0c Update version in test.cmp 2007-09-12 10:08:04 -04:00
David F. Skoll
a828378466 Update version. 2007-09-12 09:55:40 -04:00
David F. Skoll
53316e8b06 Update WHATSNEW for 3.1.2 release. 2007-09-11 21:41:00 -04:00
David F. Skoll
6127e390a1 Make tkremind notify when firing up editor. 2007-09-10 16:56:10 -04:00
David F. Skoll
4caa77f6b1 Make PgUp and PgDn work like Left and Right, respectively. 2007-09-06 14:25:52 -04:00
David F. Skoll
70419e8757 Found dates for almost all releases. 2007-09-05 17:25:50 -04:00
David F. Skoll
21d8bd1406 Add dates (where known) to releases. 2007-09-05 17:07:48 -04:00
David F. Skoll
25abee3259 Ensure that tkremind draws moons before anything else. 2007-09-05 16:20:33 -04:00
David F. Skoll
2d490c2b7a Clarify WHATSNEW 2007-09-05 15:52:57 -04:00
David F. Skoll
902b7895b7 Merge branch 'master' of ssh://magnesium.roaringpenguin.com/home/dfs/personal-git-repos/Remind 2007-09-05 07:04:36 -04:00
David F. Skoll
1c80bb649f Trigger queued reminders at least once even if we hibernate past trigger time. 2007-09-05 07:04:11 -04:00
David F. Skoll
4508215617 Merge branch 'master' of ssh://magnesium.roaringpenguin.com/home/dfs/personal-git-repos/Remind 2007-09-04 21:58:37 -04:00
David F. Skoll
739b68347a Update WHATSNEW 2007-09-04 21:53:33 -04:00
David F. Skoll
d834760cda Merge branch 'master' of ssh://magnesium.roaringpenguin.com/home/dfs/personal-git-repos/Remind 2007-09-04 21:46:16 -04:00
David F. Skoll
1bc78650bf Exit in queue mode if date rolls over. 2007-09-04 21:44:59 -04:00
David F. Skoll
ec4e203099 Fix typo that caused SEGV. 2007-09-04 14:38:46 -04:00
David F. Skoll
d23528da82 Don't trigger reminders if they are more than 60 seconds in the past.
We want to avoid a huge flurry of triggering up emerging from suspend
or hibernation on a laptop.
2007-09-04 14:24:32 -04:00
David F. Skoll
7401a0ba23 In queue mode, wake up once a minute to recalibrate sleep time. Required
for laptops that hibernate or suspend.
2007-09-04 14:16:12 -04:00
David F. Skoll
b14b4f08b1 build.tk tries to reuse existing settings if an installed version of Remind
is found.
2007-09-03 21:37:58 -04:00
David F. Skoll
70ece81340 Flash buttons before invoking. 2007-09-03 10:23:15 -04:00
David F. Skoll
19ac350527 Silence gcc warning on Ubuntu Feisty. 2007-09-03 10:09:07 -04:00
David F. Skoll
a9b08d7db8 Updated docs. 2007-09-03 07:06:53 -04:00
David F. Skoll
df8fa05632 Note that psmoon and psshade are deprecated. 2007-09-03 06:48:38 -04:00
David F. Skoll
6556137aad Warn about deprecated psmoon and psshade functions. 2007-09-03 06:46:58 -04:00
David F. Skoll
aa1ab2bbb4 Don't sort SPECIALs ahead of normal reminders. Allow all SPECIALs to include
times; back-ends can use or ignore them as they see fit.
2007-09-03 06:28:34 -04:00
David F. Skoll
be38d86521 Make non-PSFile and non-PostScript SPECIALs preserve time
in -p field.
2007-09-02 23:02:25 -04:00
David F. Skoll
3931afb6b1 Remove all mention of remind-all. 2007-08-31 23:37:19 -04:00
David F. Skoll
7d2df86b75 Remove mention of remind-all 2007-08-31 23:36:06 -04:00
David F. Skoll
5a3bd5839b Tweak "make distro" 2007-08-31 23:29:39 -04:00
David F. Skoll
b91ce9a3f7 Incorporate rem's functionality directly into Remind. 2007-08-31 23:10:40 -04:00
David F. Skoll
ac889dd329 Corrections to Jewish Holidays from Art Werschulz. 2007-08-31 11:37:40 -04:00
David F. Skoll
420df9b6ed Bump version to 03.01.02. 2007-08-31 11:06:19 -04:00
David F. Skoll
f862b6811d Add test for REM AT ... SPECIAL COLOR ... 2007-08-31 11:02:26 -04:00
David F. Skoll
c072698927 Handle queued SPECIAL COLOR reminders properly. 2007-08-31 11:00:49 -04:00
David F. Skoll
d22895831b Fix enter/leave events. 2007-08-31 10:32:01 -04:00
David F. Skoll
3c41f4ade4 add rem2ps to gitignore. 2007-08-30 23:31:42 -04:00
David F. Skoll
335d5fb984 Don't include .gitignore when making distro. 2007-08-30 23:30:51 -04:00
David F. Skoll
66bd2b8fac Add a .gitignore file. 2007-08-30 23:29:20 -04:00
David F. Skoll
fed3cad3b8 Fix regression that broke non-COLOR specials. 2007-08-30 23:23:45 -04:00
David F. Skoll
b20578f24f Add and document keyboard shortcuts to tkremind. 2007-08-30 22:31:11 -04:00
David F. Skoll
7a86e7f777 Use spacing rather than "....." to separate reminders in TkRemind. 2007-08-30 22:19:50 -04:00
David F. Skoll
16c93fcad6 Add rem.1 man page to install target. 2007-08-30 21:58:28 -04:00
David F. Skoll
edd66d8d89 Added man page for rem script.
Added more tests.
2007-08-30 21:57:30 -04:00
David F. Skoll
3ba39b6efe Add "rem" Perl script. 2007-08-30 17:33:26 -04:00
David F. Skoll
c656a1a169 Make SPECIAL COLOR always output color triplet in calendar mode even with %"%" escapes. 2007-08-30 15:40:25 -04:00
David F. Skoll
19f03e419a Fix test.cmp for new version. 2007-08-22 20:32:49 -04:00
David F. Skoll
5a281d5999 Updated changelog. 2007-08-22 20:29:35 -04:00
David F. Skoll
d80d14f585 Better placement of moons 2007-08-22 16:34:35 -04:00
David F. Skoll
520b8511bd Make moon images transparent. 2007-08-22 16:31:04 -04:00
David F. Skoll
91627d4f22 Fix typo 2007-08-22 15:57:27 -04:00
David F. Skoll
a21147c7a5 Prune a whole bunch of obsolete files. 2007-08-22 15:54:41 -04:00
David F. Skoll
d22c1dee49 Fix README to reflect reality. 2007-08-22 15:50:58 -04:00
David F. Skoll
95b0fc7480 Update version to 03.01.01; document changes in WHATSNEW 2007-08-22 15:31:17 -04:00
David F. Skoll
b40d5d7984 Performance improvements. 2007-08-22 12:00:12 -04:00
David F. Skoll
2df93c9df3 Fixed wording of man page. 2007-08-22 11:29:35 -04:00
David F. Skoll
51cdea4b17 better definition of prev_monday 2007-08-21 22:03:31 -04:00
David F. Skoll
f229e64744 Fix typo 2007-08-21 18:58:00 -04:00
David F. Skoll
0f15955a41 Better definition of prev_monday in man page. 2007-08-21 18:54:53 -04:00
David F. Skoll
390e6c2eed Fixed typo 2007-08-21 18:49:49 -04:00
David F. Skoll
877eaccd6d Documented nonomitted() 2007-08-21 18:47:51 -04:00
David F. Skoll
6424e655a1 Allow cycle modulus to be zero. 2007-08-21 17:34:46 -04:00
David F. Skoll
176037082b Add cycle function to handle Elizabeth's school schedule. 2007-08-21 17:10:04 -04:00
David F. Skoll
a361c7e426 Note that we always use "/" in rem2ps input. 2007-08-17 09:07:32 -04:00
David F. Skoll
caba0c1695 Make "-n" mode use / (always) in dates to match Simple Calendar output. 2007-08-15 23:26:41 -04:00
David F. Skoll
71b3f9fefc Remove kall, rem from install target. 2007-08-15 23:20:57 -04:00
David F. Skoll
91f8507e51 Remove obsolete scripts. Apply some Debian-maintainer patches. 2007-08-15 23:18:48 -04:00
David F. Skoll
b68e81a126 Fix trailing "s" bug (Debian patch) 2007-08-15 23:06:21 -04:00
David F. Skoll
72658025f1 Prevent warning with fcc 2.95 2007-08-15 15:14:18 -04:00
78 changed files with 5055 additions and 6019 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 +0,0 @@
Remind no longer works on AmigaDOS.

View File

@@ -1 +0,0 @@
Remind no longer works with Borland C Compiler.

View File

@@ -1 +0,0 @@
Remind no longer works on MS-DOS.

View File

@@ -1 +0,0 @@
Remind no longer works on OS/2.

View File

@@ -28,30 +28,6 @@ If you do NOT have Tcl/Tk or are NOT running X Windows:
The subdirectory "www" contains scripts for making a nice calendar
web server. See the files README and Makefile in that directory.
Two shell scripts, "scripts/remind-all.csh" and
"scripts/remind-all.sh" are provided. These allow automatic mailing of
reminders to all users who create a $HOME/.reminders file. These two
scripts are equivalent; one is a "sh" script and the other is a "csh"
script. Pick the one you want to use, and follow the instructions in
the opening comments of the script.
A shell script called "scripts/rem" is provided for those who like to have
'remind' assume a default reminders file. A man page for this script
is provided. You should examine the script to ensure that the defaults
are correct.
Many people have asked me why I supply the "rem" script instead of
having Remind assume a default file. The answer is: That's how I like
it! My personal preference is for a program which normally takes
parameters to display usage information when invoked with no
parameters. I like that behaviour so I can quickly get an idea of
what a program does without poring through the man page. And I think
I'll keep Remind that way. Sorry to all who dislike it. :-)
A shell script called "scripts/kall" is provided so you can kill your
background remind processes when you log out. See the man page. Note
that kall depends on the output of "ps", and may not be portable.
The file "examples/defs.rem" has some sample Remind definitions and
commands, as well as U.S. and Jewish holidays.

View File

@@ -1 +0,0 @@
Remind no longer works on QDOS.

View File

@@ -1,6 +1,90 @@
CHANGES TO REMIND
* Version 3.1 Patch 0 - 14 August 2007
* 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
- Added the "nonomitted" function that solves a number of
moving-reminder-in-response-to-holiday problems. The real-world
problems solved are the "moving-garbage-day" problem and the
"six-day-school-cycle" problem.
+ MINOR ENHANCEMENTS
- A few minor performance improvements in response to profiling runs.
+ BUG FIXES
- Prevent compilation failure with gcc 2.95.
- Fix trailing "s" bug with -k option. This was fixed in Debian's release,
but the Debian maintainer never bothered to let me know.
- Removed obsolete scripts: kall, rem, remind-all.sh, remind-all.csh
- Made "-n" output always use "/" as date separator for consistency with
"-p" and "-s".
- Moon PNG images are transparent. Output of moon phases in rem2html
improved slightly.
- Various man-page fixes.
* Version 3.1 Patch 0 - 2007-07-14
+ MAJOR ENHANCEMENTS
@@ -63,7 +147,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
@@ -86,7 +170,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
@@ -110,7 +194,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
@@ -132,7 +216,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
@@ -163,7 +247,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
@@ -192,7 +276,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
@@ -234,7 +318,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
@@ -298,7 +382,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
@@ -339,7 +423,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
@@ -367,7 +451,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
@@ -397,7 +481,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
@@ -456,7 +540,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
@@ -491,7 +575,7 @@ CHANGES TO REMIND
- Updated the copyright notices everywhere.
* Version 3.0 Patch 12
* Version 3.0 Patch 12 - 1994-02-01
+ MINOR ENHANCEMENTS
@@ -510,7 +594,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
@@ -590,7 +674,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
@@ -647,7 +731,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
@@ -699,7 +783,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
@@ -742,7 +826,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
@@ -765,7 +849,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:
@@ -800,7 +884,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
@@ -859,13 +943,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.
@@ -905,7 +989,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
@@ -945,7 +1029,7 @@ CHANGES TO REMIND
- Re-formatted the WHATSNEW.30 file.
* Version 3.0
* Version 3.0 - 1992-11-09
- Total rewrite from previous versions
@@ -966,23 +1050,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.
@@ -999,7 +1083,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.
@@ -1013,7 +1097,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.
@@ -1035,28 +1119,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

View File

@@ -1,27 +0,0 @@
.TH KALL 1 "15 February 1998"
.UC 4
.SH NAME
kall \- kill processes by command name
.SH SYNOPSIS
.B kall
[\-\fIsignal\fR] prog1 [prog2...]
.SH DESCRIPTION
.B Kall
sends the specified \fIsignal\fR (defaults to \fB-TERM\fR) to all processes
whose command name is specified on the command line. For example:
.PP
.nf
kall -HUP remind foobar
.fi
.PP
sends a \fBHUP\fR signal to all \fIremind\fR and \fIfoobar\fR programs.
Note that \fBkall\fR sends signals only to those processes owned by the
user invoking \fBkall\fR.
.SH AUTHOR
David F. Skoll
.SH BUGS
.B Kall
is a sh(1) script and depends on the behaviour of ps(1); thus, it is
not especially portable.
.SH SEE ALSO
remind, rem

View File

@@ -1,34 +1,20 @@
.TH REM 1 "15 February 1998"
.UC 4
.TH REM 1 "30 August 2007"
.UC4
.SH NAME
rem \- run 'remind' with a default reminder file
rem \- Invoke Remind with a default filename
.SH SYNOPSIS
.B rem
[\-F \fIfilename\fR] [\fIremind_options\fR] [\fIremind_params\fR]
.B rem [\fIoptions\fR] [\fIdate\fR] [\fI*rep\fR] [\fItime\fR]
.SH DESCRIPTION
.B Rem
runs the \fBremind\fR program with a default reminder file of
"$HOME/.reminders". You can supply remind options on the command line,
as well as a date specification, just as with \fBremind\fR.
If you don't want to use the default filename, you can override it with
the "-F" option, followed by a space and a filename. (This, however,
defeats the purpose of \fBrem\fR)
\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
For example, typing:
.PP
.nf
rem -c 1 jan 1992
.fi
.PP
has the same effect as typing:
.PP
.nf
remind -c $HOME/.reminders 1 jan 1992
.fi
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
David F. Skoll
Remind was written by David F. Skoll <dfs@roaringpenguin.com>
.SH SEE ALSO
remind, kall
\fBremind\fR

View File

@@ -121,10 +121,10 @@ numbers.
numbers.
.PP
Type "rem2ps -m help" for a list of available media. Note that the media
Type "rem2ps \-m help" for a list of available media. Note that the media
type (and all \fBRem2ps\fR options) are case-sensitive. If you don't use
the \fB\-m\fR option, the media defaults to a compiled-in default - this
is usually Letter for North America and A4 for Europe. The "-m help"
is usually Letter for North America and A4 for Europe. The "\-m help"
option will display the compiled-in default.
.RE
.TP
@@ -137,7 +137,7 @@ specifying:
.RS
.PP
.nf
-ftshe Helvetica -fd Helvetica-BoldOblique
\-ftshe Helvetica \-fd Helvetica-BoldOblique
.fi
.PP
In other words, the heading, entry and small-calendar fonts are set
@@ -153,7 +153,7 @@ are equivalent to specifying:
.RS
.PP
.nf
-sthd 14 -se 8
\-sthd 14 \-se 8
.fi
.PP
In other words, the heading and day numbers are 14-point fonts, and the
@@ -179,7 +179,7 @@ for good output:
.PP
.nf
# This gives good results for putting into a binder
rem2ps -ol 72 -sh 12
rem2ps \-ol 72 \-sh 12
.fi
.SH USAGE
To use \fBRem2ps\fR, you should pipe the output of \fBRemind\fR with the \fB\-p\fR
@@ -187,14 +187,14 @@ option to \fBRem2ps\fR, and then send the result to a printer. This is most eas
illustrated with examples:
.PP
.nf
remind -p12 /dev/null 1 jan 1994 | rem2ps | lpr -Plaser
remind \-p12 /dev/null 1 jan 1994 | rem2ps | lpr \-Plaser
.fi
.PP
That example creates a blank calendar for the entire year of 1994, and
sends it the the printer named "laser."
.PP
.nf
remind -p ~/.reminders | rem2ps -l -sd 18 > cal.ps
remind \-p ~/.reminders | rem2ps \-l \-sd 18 > cal.ps
.fi
.PP
This reminder creates a calendar for the current month, filling in
@@ -350,7 +350,9 @@ The remaining data consists of calendar entries, in the following format:
\fIyyyy/mm/dd special tag dur time body\fR
.PP
Here, \fIyyyy\fR is the year, \fImm\fR is the month (01-12) and
\fIdd\fR is the day of the month.
\fIdd\fR is the day of the month. Note that the date components are
always separated by "/" even if the date separator in \fBRemind\fR has
been set to "-". The consistent use of "/" is designed to ease parsing.
.PP
\fIspecial\fR is a string used
for "out-of-band" communication with back-ends. If the reminder
@@ -405,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

@@ -1392,7 +1392,7 @@ as being the combination of \fBDATE\fR and \fBTIME\fR parts.
The following examples illustrate constants in \fBRemind\fR expressions:
.TP
.B INT constants
12, 36, -10, 0, 1209
12, 36, \-10, 0, 1209
.TP
.B STRING constants
"Hello there", "This is a test", "\\n\\gosd\\w", ""
@@ -1568,7 +1568,7 @@ otherwise.
.PP
Operators of equal precedence are \fIalways\fR evaluated from left
to right, except where parentheses dictate otherwise. This is important,
because the enhanced "+" and "\-" operators are not necessarily associative.
because the enhanced "+" operator is not necessarily associative.
For example:
.PP
.nf
@@ -2228,6 +2228,70 @@ which default to \fBtoday()\fR and midnight, respectively. The returned
value is an integer from 0 to 359, representing the phase of the moon
in degrees. 0 is a new moon, 180 is a full moon, 90 is first-quarter, etc.
.TP
.B nonomitted(dq_start, dq_end [,s_wkday...])
This function returns the number of \fInon-\fRomitted days between
\fIstart\fR and \fIend\fR. If \fIstart\fR is non-omitted, then it is
counted. \fIend\fR is never counted.
.RS
.PP
Note that \fIend\fR must be greater than or
equal to \fIstart\fR or an error is reported. In addition to using
the global OMIT context, you can supply additional arguments that are
names of weekdays to be omitted.
.PP
For example, the following line sets a to 11 (assuming no global OMITs):
.PP
.nf
set a nonomitted('2007-08-01', '2007-08-16', "Sat", "Sun")
.fi
.PP
because Thursday, 16 August 2007 is the 11th working day (not counting
Saturday and Sunday) after Wednesday, 1 August 2007.
.PP
\fBnonomitted\fR has various uses. For example, many schools
run on a six-day cycle and the day number is not incremented on holidays.
Suppose the school year starts with Day 1 on 4 September 2007. The following
reminder will label day numbers in a calendar:
.PP
.nf
IF today() >= '2007-09-04'
set daynum nonomitted('2007-09-04', today(), "Sat", "Sun")
REM OMIT SAT SUN SKIP CAL Day [(daynum % 6) + 1]
ENDIF
.fi
.PP
Here's a more complex example: Suppose your normal garbage-collection
day is Thursday, but if any of Monday through Thursday of a week is a holiday,
the collection day moves to Friday. Here's one way to solve it:
.PP
.nf
FSET prev_monday(x) x - wkdaynum(x-1)
REM Thu Fri SATISFY [wkdaynum(trigdate()) == 4 && \\
nonomitted(prev_monday(today()), today()+1) == 4 || \\
wkdaynum(trigdate()) == 5 && \\
nonomitted(prev_monday(today()), today()+1) <= 4] \\
MSG Garbage Day
.fi
.PP
Whew! (You'll need to see "THE SATISFY CLAUSE" later on.) We'd
better explain that one: The prev_monday helper function takes a date
and returns the date of the previous Monday. The REM command will
trigger on the first Thursday or Friday that satisfies one of the
following conditions:
.PP
1) Either it's a Thursday and there are exactly four non-omitted days between
the previous Monday and tomorrow, or
.PP
2) It's a Friday and there are four or fewer non-omitted days between the
previous Monday and tomorrow. We need the "or fewer" condition to handle
the case of more than one holiday in a given week. If that happens,
garbage day still only moves by one day.
.PP
Obviously, the answer you get from \fBnonomitted\fR depends on the global
OMIT context. If you use moveable OMITs, you may get inconsistent results.
.RE
.TP
.B now()
Returns the current system time, as a \fBTIME\fR type. This may be
the actual time, or a time supplied on the command line.
@@ -2253,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
@@ -2289,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.
@@ -2351,13 +2416,13 @@ of \fIstr\fR.
.TP
.B sunrise([dq_date])
Returns a \fBTIME\fR indicating the time of sunrise on the specified
\fIdate\fR (default \fBtoday()\fR.) In high lattitudes, there
\fIdate\fR (default \fBtoday()\fR.) In high latitudes, there
may be no sunrise on a particular day, in which case \fBsunrise()\fR
returns the \fBINT\fR 0 if the sun never sets, or 1440 if it never rises.
.TP
.B sunset([dq_date])
Returns a \fBTIME\fR indicating the time of sunset on the specified
\fIdate\fR (default \fBtoday()\fR.) In high lattitudes, there
\fIdate\fR (default \fBtoday()\fR.) In high latitudes, there
may be no sunset on a particular day, in which case \fBsunset()\fR
returns the \fBINT\fR 0 if the sun never rises, or 1440 if it never
sets.
@@ -3179,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
@@ -3406,7 +3465,7 @@ be preceded by "(not important)".
.fi
.PP
In Calendar Mode (with the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR options),
an analagous pair of functions named \fBcalprefix()\fR and
an analogous pair of functions named \fBcalprefix()\fR and
\fBcalsuffix()\fR can be defined. They work with all reminders that
produce an entry in the calendar (i.e., \fBCAL\fR- and possibly
\fBRUN\fR-type reminders as well as \fBMSG\fR-type reminders.)
@@ -3951,7 +4010,7 @@ Liviu Daia
Rafa Couto
.PP
\fBIcelandic\fR --
Björn Davíðsson
Bj\(:orn Dav\('i\[Sd]sson
.SH BUGS
.PP
There's no good reason why read-only system variables are not
@@ -3979,4 +4038,4 @@ Catalog\fR, Jewish Publication Society of America.
.PP
.SH SEE ALSO
.PP
rem, elm, kall, 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,23 +0,0 @@
Begin3
Title: Remind
Version: 03.00.22
Entered-date: 12 Apr 1999
Description: Full-featured calendar/reminder program featuring
sophisticated date calculation, moon phases, sunrise/sunset,
Hebrew calendar, alarms, PostScript output, X-Windows
front-end, multilingual messages, and proper handling of
holidays. Available for UNIX, MS-DOS, OS/2, and other
platforms. Includes scripts for making a nice WWW
calendar server.
Keywords: calendar reminder alarm datebook PostScript www
Author: dskoll@iname.com (David F. Skoll)
Maintained-by: dskoll@iname.com (David F. Skoll)
Primary-site: http://www.roaringpenguin.com/remind.html
304kB remind-3.0.22.tgz
Alternate-site:
Original-site:
Platform: Linux, Solaris, SunOS, HP-UX -- virtually any UN*X-like
system. Wish 8.x required for TCL/Tk front-end, but
this is not essential to use the software.
Copying-policy: GPL
End

View File

@@ -1,7 +1,4 @@
Files in this directory:
kall -- Kills a program by command name, as in "kall remind"
rem -- Starts Remind with a default file of $HOME/.reminders
remind-all.csh -- Mails reminders to all users (C-Shell version)
remind-all.sh -- Mails reminders to all users (Bourne Shell version)
tkremind* -- Tcl/Tk graphical calendar using Remind as engine
tkremind -- Tcl/Tk graphical calendar using Remind as engine
cm2rem.tcl -- Convert Sun's "cm" calendar manager files to Remind.

View File

@@ -1,40 +0,0 @@
#!/bin/sh
#
# kall - kill all processes belonging to this user that match
# specified string.
signal=`echo $1 | grep '^\-.*'`
me=`basename $0`
if [ "$signal" != "" ]; then
shift
else
signal="-TERM"
fi
if [ "$1" = "" ]; then
echo "usage: $me [-signal] string [string...]"
echo " kills all of your processes where command name matches"
echo " any of the given strings."
exit
fi
msg="0"
while [ "$1" != "" ]; do
# NOTE: You may have to modify the next line, since PS is non-portable.
# The 'awk' command picks out the process IDs to pass them on to kill.
rprocs=`ps cx | awk '{if(prog == $NF && $1 != mypid) print $1}' prog=$1 mypid=$$ -`
if [ "$rprocs" != "" ]; then
msg="1"
echo -n "${me}: Sending $signal signal to $1 process(es)"
echo '...'
kill $signal $rprocs
fi
shift
done
if [ $msg = "1" ]; then
echo "${me}: Done."
fi

View File

@@ -1,43 +0,0 @@
#!/bin/sh
#
# rem - by David Skoll - 26 February 1991
#
# This script runs 'remind' with a default reminder file assumed. You
# can override the default by using "rem -F newfile ..." (But why would
# you use rem unless you wanted to accept the default??)
# ------ You may wish to change the defaults below this line ------
# The default reminder file
DEFAULT=$HOME/.reminders
# The executable file (you may wish to change this to /usr/local/bin/remind
# or whatever.
EXECUTABLE=remind
# No options yet
OPTIONS=""
# No parameters yet
PARAMETERS=""
# ------ You shouldn't change anything below this line -----
# Scan for options
while test "$1" != ""
do
case $1 in
-F) DEFAULT=$2
shift
shift ;;
-*) OPTIONS="$OPTIONS $1"
shift ;;
*) PARAMETERS=$*
break ;;
esac
done
$EXECUTABLE $OPTIONS $DEFAULT $PARAMETERS

View File

@@ -1,44 +0,0 @@
#!/bin/csh -f
# Shell script to mail all users reminders.
# Run it AFTER MIDNIGHT so that date is correct!
# On our system, we have the following in our crontab:
# 05 5 * * * /usr/share/lib/remind/remind-all > /dev/null 2>&1
# This script must be run by root. The -u option MUST be supplied
# to Remind, or a severe security hole will exist. Note that Remind
# must be compiled to support the -u option for this script to work.
# Also, the -r and -q options must be used.
# The following line gets a list of users for systems using SUN's
# NIS service:
set USERS = `ypcat passwd | awk -F: '{print $1}'`
# The following line gets a list of users by examining /etc/passwd:
# set USERS = `awk -F: '{print $1}' /etc/passwd`
# If neither of the above methods works, you must come up with some
# way of getting a list of users on the system
# Set the following variables as appropriate for your system
set REMIND = /usr/local/bin/remind
set MAIL = /usr/ucb/mail
set RM = "/usr/bin/rm -f"
set REMFILE = /tmp/RemFile.$$
# Scan each user's directory for a .reminders file
foreach i ($USERS)
if (-r ~$i/.reminders) then
# echo "$i has a .reminders file." DEBUGGING PURPOSES ONLY
$REMIND -u$i -h -r -q -iremind_all=1 ~$i/.reminders < /dev/null > $REMFILE
if (! -z $REMFILE) then
# echo "Sending mail to $i" DEBUGGING PURPOSES ONLY
$MAIL -s "Reminders" $i < $REMFILE
endif
$RM $REMFILE
endif
end

View File

@@ -1,53 +0,0 @@
#!/bin/sh
# Shell script to mail all users reminders.
# This file is part of REMIND
#
# REMIND is Copyright (C) 1992-1998 by David F. Skoll
# Copyright (C) 1999-2007 Roaring Penguin Software Inc.
# This file is Copyright (C) 1990 by Bill Aten
# Thanks to Bill Aten for this script.
# Run it AFTER MIDNIGHT so that date is correct!
# On our system, we have the following in our crontab:
# 02 00 * * * /usr/local/adm/remind-all >/dev/null 2>&1
# This script must be run by root. The -u option MUST be supplied
# to Remind, or a severe security hole will exist. Note that Remind
# must be compiled to support the -u option for this script to work.
# Also, the -r and -q options must be used.
# The following line gets a list of users for systems using SUN's
# NIS service:
# USERS=`ypcat passwd | awk -F: '{print $1}'`
# The following line gets a list of users by examining /etc/passwd:
USERS=`awk -F: '{print $1}' /etc/passwd`
# If neither of the above methods works, you must come up with some
# way of getting a list of users on the system
# Set the following variables as appropriate for your system
REMIND=/usr/local/bin/remind
MAIL=/usr/bin/mail
RM="/bin/rm -f"
REMFILE=/tmp/RemFile.$$
# Scan each user's directory for a .reminders file
for i in $USERS
do
HOME=`grep \^$i: /etc/passwd | awk -F: '{print $6}'`
if [ -r $HOME/.reminders ]; then
# echo "$i has a .reminders file." DEBUGGING PURPOSES ONLY
$REMIND -u$i -h -r -q -iremind_all=1 $HOME/.reminders < /dev/null > $REMFILE
if [ -s $REMFILE ]; then
# echo "Sending mail to $i" DEBUGGING PURPOSES ONLY
$MAIL -s "Reminders" $i < $REMFILE
fi
$RM $REMFILE
fi
done

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
@@ -1280,7 +1276,7 @@ proc RemindDialogToOptions { w } {
lappend ans "-global-$winstem" [eval set $winstem]
}
"Entry" {
lappend ans "-entry-$winstem" [$win get]
lappend ans "-entry-$winstem" [string map -nocase {"\n" " "} [$win get]]
}
}
}
@@ -1559,7 +1555,7 @@ proc CreateReminder {w} {
regsub -- {^-stdin-\([0-9]*\): } $err {} err
error "Error from Remind: $err"
}
append rem " MSG $body"
append rem " MSG " [string map -nocase {"\n" " "} $body]
return $rem
}
@@ -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.00
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@
@@ -17,12 +18,11 @@ INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
PROGS= remind rem2ps
SCRIPTS= $(srcdir)/../scripts/kall $(srcdir)/../scripts/rem \
$(srcdir)/../scripts/tkremind $(srcdir)/../scripts/cm2rem.tcl
SCRIPTS= $(srcdir)/../scripts/tkremind $(srcdir)/../scripts/cm2rem.tcl
MANS= $(srcdir)/../man/kall.1 $(srcdir)/../man/rem.1 \
$(srcdir)/../man/rem2ps.1 $(srcdir)/../man/remind.1 \
$(srcdir)/../man/tkremind.1 $(srcdir)/../man/cm2rem.1
MANS= $(srcdir)/../man/rem2ps.1 $(srcdir)/../man/remind.1 \
$(srcdir)/../man/tkremind.1 $(srcdir)/../man/cm2rem.1 \
$(srcdir)/../man/rem.1
.SUFFIXES:
.SUFFIXES: .c .o
@@ -44,23 +44,27 @@ test: remind
@CC@ -c @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -I. -I$(srcdir) $<
rem2ps: rem2ps.o dynbuf.o
@CC@ @LDFLAGS@ -o rem2ps rem2ps.o dynbuf.o
@CC@ @LDFLAGS@ $(LDEXTRA) -o rem2ps rem2ps.o dynbuf.o
remind: $(REMINDOBJS)
@CC@ @LDFLAGS@ -o remind $(REMINDOBJS) @LIBS@
@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)
@@ -76,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

@@ -1,84 +0,0 @@
# Makefile for REMIND for QDOS / SMSQ
#-----------------------------------------------------------------------------
# THINGS FOR YOU TO EDIT START BELOW
#-----------------------------------------------------------------------------
# Uncomment the next lines if you want to use gcc instead of default compiler
# NOTE: Tempting as it may be, if you use 'cc' for the C compiler, do not
# use 'ld' for the linker. It will probably work much better if you use
# LD= cc rather than LD= ld.
# QDOS remark: I made it work the following way, and I found it to be working.
CC= cc
LD= ld
# Put any additional flags for the C compiler or linker here - if you
# are not using gcc, you probably want to remove '-ansi'.
# QDOS remark: no -ansi option and no gcc on QDOS / SMSQ
CFLAGS= -V -O -DQDOS
CDEFS=
LDFLAGS= -bufp200K
#-----------------------------------------------------------------------------
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
# in config_h; then, you should be able to type 'make'.
#-----------------------------------------------------------------------------
MATHLIB= -lm
HDRS= config_h err_h expr_h globals_h protos_h types_h version_h \
lang_h english_h german_h dutch_h finnish_h french_h norwgian_h \
danish_h polish_h
STDHDRS= config_h types_h protos_h globals_h err_h lang_h
LANGHDRS= english_h german_h dutch_h finnish_h french_h norwgian_h danish_h \
polish_h
SRCS= calendar_c dorem_c dosubst_c expr_c files_c funcs_c globals_c hbcal_c \
init_c main_c moon_c omit_c sort_c queue_c token_c trigger_c userfns_c \
utils_c var_c
OBJS= calendar_o dorem_o dosubst_o expr_o files_o funcs_o globals_o hbcal_o \
init_o main_o moon_o omit_o sort_o queue_o token_o trigger_o userfns_o \
utils_o var_o
all: remind rem2ps
# _c_o:
# $(CC) $(UNIX) $(SYSV) -c $(CFLAGS) $(CDEFS) $*_c
rem2ps: rem2ps_o
# $(CC) $(CFLAGS) rem2ps_c
$(LD) $(LDFLAGS) -orem2ps rem2ps_o
remind: $(OBJS)
# $(CC) $(CFLAGS) $(SRCS)
$(LD) $(LDFLAGS) -oremind $(OBJS) $(MATHLIB)
rem2ps_o: rem2ps_c rem2ps_h lang_h config_h
calendar_o: calendar_c $(STDHDRS) expr_h
dorem_o: dorem_c $(STDHDRS) expr_h
dosubst_o: dosubst_c $(STDHDRS) $(LANGHDRS)
expr_o: expr_c $(STDHDRS) expr_h
files_o: files_c $(STDHDRS)
funcs_o: funcs_c $(STDHDRS) expr_h version_h
globals_o: globals_c config_h types_h globals_h err_h lang_h $(LANGHDRS)
hbcal_o: hbcal_c $(STDHDRS)
init_o: init_c $(STDHDRS) expr_h version_h lang_h $(LANGHDRS)
main_o: main_c $(STDHDRS) expr_h
moon_o: moon_c $(STDHDRS)
omit_o: omit_c $(STDHDRS)
sort_o: sort_c $(STDHDRS)
queue_o: queue_c $(STDHDRS)
token_o: token_c $(STDHDRS)
trigger_o: trigger_c $(STDHDRS) expr_h
userfns_o: userfns_c $(STDHDRS) expr_h
utils_o: utils_c $(STDHDRS)
var_o: var_c $(STDHDRS) expr_h
clean:
rm -f *_o *_bak
clobber:
rm -f *_o remind rem2ps test_out *_bak

View File

@@ -1,7 +0,0 @@
IGNORE=154
IGNORE=161
IGNORE=100
IGNORE=85
LINKOPT SC
LINKOPT SD
LINKOPT NOICONS

View File

@@ -1,64 +0,0 @@
/***************************************************************/
/* */
/* AMIGA.C */
/* */
/* Support functions for AmigaDOS */
/* */
/* This file is Copyright (C) 1995 by Martin Hohl */
/* */
/* This file is part of REMIND. */
/* Remind is Copyright (C) 1992-1998 by David F. Skoll */
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
/* */
/***************************************************************/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <exec/types.h>
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <proto/dos.h>
#include "version.h" /* Hopefully this will define VERSION as a string */
#ifdef __SASC_60
/* AmigaDOS 2.04 compatible version string for "version" utility */
const static char ver_string[] = "$VER: remind "VERSION" "__AMIGADATE__;
#endif
void sleep(int dt)
{
register long Ticks;
if (dt != 0) {
Ticks = 50L * dt;
Delay(Ticks);
}
}
void execvp(char *name, char **argvec)
{
char *cmdline;
int i,l;
l = strlen(name)+2;
i=1;
while (argvec[i] != 0L) {
l += strlen(argvec[i])+1;
i++;
};
cmdline = malloc(l+1);
if (cmdline == 0L) return;
strcpy(cmdline,name);
i=1;
while (argvec[i] != 0L) {
strcat(cmdline," ");
strcat(cmdline,argvec[i]);
i++;
};
system(cmdline);
free(cmdline);
}

View File

@@ -1,20 +0,0 @@
calendar.obj
dorem.obj
dosubst.obj
expr.obj
files.obj
funcs.obj
globals.obj
hbcal.obj
init.obj
main.obj
moon.obj
omit.obj
os2func.obj
queue.obj
sort.obj
token.obj
trigger.obj
userfns.obj
utils.obj
var.obj

View File

@@ -1,23 +0,0 @@
calendar.obj +
dorem.obj +
dosubst.obj +
expr.obj +
files.obj +
funcs.obj +
globals.obj +
hbcal.obj +
init.obj +
main.obj +
moon.obj +
omit.obj +
sort.obj +
token.obj +
trigger.obj +
userfns.obj +
utils.obj +
var.obj
remind.exe
nul

View File

@@ -1,19 +0,0 @@
-eremind.exe
calendar.obj
dorem.obj
dosubst.obj
expr.obj
files.obj
funcs.obj
globals.obj
hbcal.obj
init.obj
main.obj
moon.obj
omit.obj
sort.obj
token.obj
trigger.obj
userfns.obj
utils.obj
var.obj

View File

@@ -1,94 +0,0 @@
# Makefile for REMIND for Borland C++
MODEL=l
!if $d(__OS2__)
CFLAGS= -DOS2_POPUP -w-pia -O2
BINDIR= ..\OS2-EX
DELFLAG= /f
!else
CFLAGS= -w-pia -O2 -m$(MODEL)
BINDIR= ..\MSDOS-EX
DELFLAG=
!endif
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \
danish.h polish.h
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h danish.h \
polish.h
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c \
queue.c moon.c os2func.c
OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
utils.obj userfns.obj var.obj hbcal.obj queue.obj moon.obj os2func.obj
all: exes test-rem.cmd test-rem.bat
test-rem
clean:
-del $(DELFLAG) *.obj
-del $(DELFLAG) $(BINDIR)\*.exe
exes: $(BINDIR)\remind.exe $(BINDIR)\rem2ps.exe
..\os2-ex\remind.exe: $(OBJS)
bcc -e..\os2-ex\remind @lnk.bcc -lap;Toe
..\msdos-ex\remind.exe: $(OBJS)
bcc -e..\msdos-ex\remind -m$(MODEL) @lnk.bcc
..\os2-ex\rem2ps.exe: rem2ps.obj
bcc -e..\os2-ex\rem2ps rem2ps.obj -lap;Toe
..\msdos-ex\rem2ps.exe: rem2ps.obj
bcc -e..\msdos-ex\rem2ps -m$(MODEL) rem2ps.obj
.c.obj:
bcc $(CFLAGS) -c {$< }
rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
calendar.obj: calendar.c $(STDHDRS) expr.h
dorem.obj: dorem.c $(STDHDRS) expr.h
dosubst.obj: dosubst.c $(STDHDRS) $(LANGHDRS)
expr.obj: expr.c $(STDHDRS) expr.h
files.obj: files.c $(STDHDRS)
funcs.obj: funcs.c $(STDHDRS) expr.h version.h
globals.obj: globals.c config.h types.h globals.h err.h lang.h
init.obj: init.c $(STDHDRS) expr.h version.h
main.obj: main.c $(STDHDRS) expr.h
moon.obj: moon.c $(STDHDRS) expr.h
omit.obj: omit.c $(STDHDRS)
os2func.obj: os2func.c $(STDHDRS)
queue.obj: queue.c $(STDHDRS)
sort.obj: sort.c $(STDHDRS)
token.obj: token.c $(STDHDRS)
trigger.obj: trigger.c $(STDHDRS) expr.h
userfns.obj: userfns.c $(STDHDRS) expr.h
utils.obj: utils.c $(STDHDRS)
var.obj: var.c $(STDHDRS) expr.h

View File

@@ -1,73 +0,0 @@
# Makefile for REMIND for Microsoft C for MSDOS
OBJS= calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
globals.obj init.obj main.obj omit.obj token.obj trigger.obj userfns.obj \
utils.obj var.obj sort.obj hbcal.obj moon.obj
DEFINES= /D__MSDOS__ /D__MSC__
MODEL= /AM
calendar.obj: calendar.c
cl /c $(DEFINES) $(MODEL) /Focalendar.obj calendar.c
dorem.obj: dorem.c
cl /c $(DEFINES) $(MODEL) /Fodorem.obj dorem.c
dosubst.obj: dosubst.c
cl /c $(DEFINES) $(MODEL) /Fodosubst.obj dosubst.c
expr.obj: expr.c
cl /c $(DEFINES) $(MODEL) /Foexpr.obj expr.c
hbcal.obj: hbcal.c
cl /c $(DEFINES) $(MODEL) /Fohbcal.obj hbcal.c
sort.obj: sort.c
cl /c $(DEFINES) $(MODEL) /Fosort.obj sort.c
files.obj: files.c
cl /c $(DEFINES) $(MODEL) /Fofiles.obj files.c
funcs.obj: funcs.c
cl /c $(DEFINES) $(MODEL) /Fofuncs.obj funcs.c
globals.obj: globals.c
cl /c $(DEFINES) $(MODEL) /Foglobals.obj globals.c
init.obj: init.c
cl /c $(DEFINES) $(MODEL) /Foinit.obj init.c
main.obj: main.c
cl /c $(DEFINES) $(MODEL) /Fomain.obj main.c
moon.obj: moon.c
cl /c $(DEFINES) $(MODEL) /Fomoon.obj moon.c
omit.obj: omit.c
cl /c $(DEFINES) $(MODEL) /Foomit.obj omit.c
token.obj: token.c
cl /c $(DEFINES) $(MODEL) /Fotoken.obj token.c
trigger.obj: trigger.c
cl /c $(DEFINES) $(MODEL) /Fotrigger.obj trigger.c
userfns.obj: userfns.c
cl /c $(DEFINES) $(MODEL) /Fouserfns.obj userfns.c
utils.obj: utils.c
cl /c $(DEFINES) $(MODEL) /Foutils.obj utils.c
var.obj: var.c
cl /c $(DEFINES) $(MODEL) /Fovar.obj var.c
remind.exe: $(OBJS)
link /NOI @lnk.msc
rem2ps.obj: rem2ps.c
cl /c $(DEFINES) $(MODEL) /Forem2ps.obj rem2ps.c
rem2ps.exe: rem2ps.obj
link /NOI rem2ps,rem2ps.exe,,,

View File

@@ -1,120 +0,0 @@
# Makefile for REMIND
#
# THIS IS OUT OF DATE!
#
# - for GNU gcc (emx 0.8g kit) [executables for OS/2 2.x or DOS (32-bit)]
# - for Microsoft C 6.00A [executables for OS/2 or MSDOS (16-bit)]
# To use, enter "make -f Makefile.os2" (this makefile depends on its
# name being "Makefile.os2").
#
# Tested with dmake 3.8 and GNU make 3.68 under OS/2
default:
@echo "Enter $(MAKE) -f Makefile.os2 target "
@echo " where 'target' is chosen from "
@echo " msc OS/2 exe [Microsoft C 6.00a] "
@echo " mscbnd OS/2 and DOS exe [Microsoft C 6.00a] "
@echo " emx OS/2 and DOS 32-bit exe [EMX/gcc] "
@echo " emxomf OS/2 32-bit exe w/DLL C library [EMX/gcc] "
msc:
$(MAKE) -f Makefile.os2 all \
CC="cl -nologo -AM" O=".obj" \
CFLAGS="-D__STDC__ -D__OS2__" \
LFLAGS="-Lp" \
LFLAGS2="setargv.obj remind.def -link /NOE"
mscbnd:
$(MAKE) -f Makefile.os2 all \
CC="cl -nologo -AM" O=".obj" \
CFLAGS="-D__STDC__ -D__OS2__ -D__MSDOS__" \
LFLAGS="-Lp" LBIND="-Fb" \
LFLAGS2="setargv.obj remind.def -link /NOE" \
BIND="bind remind /n DOSMAKEPIPE DOSCWAIT VIOENDPOPUP VIOPOPUP"
emx:
$(MAKE) -f Makefile.os2 all \
CC="gcc -O -s" O=".o" \
CFLAGS="-D__OS2__ -D__MSDOS__" \
LFLAGS=""
emxomf:
$(MAKE) -f Makefile.os2 all \
CC="gcc -Zomf -O -s" O=".obj" \
CFLAGS="-D__OS2__" \
LFLAGS="-Zcrtdll -Zstack 32" \
LFLAGS2="remind.def"
# OS2_POPUP enables Russ Herman's popup reminders
#OS2_POPUP =
OS2_POPUP = -DOS2_POPUP
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \
danish.h polish.h
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h danish.h \
polish.h
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c hbcal.c \
init.c main.c moon.c omit.c sort.c queue.c token.c trigger.c userfns.c \
utils.c var.c os2func.c
MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
tstlang.rem README.BCC lnk.bcc makefile.bcc os2func.c \
test-rem.bat test-rem.cmd test1.cmp test2.cmp
OBJS= $(SRCS:.c=$O)
all: remind.exe rem2ps.exe
.SUFFIXES: $O
.c$O:
$(CC) -c $(CFLAGS) $(OS2_POPUP) $*.c
rem2ps.exe: rem2ps$O
$(CC) $(LFLAGS) $(LBIND) -o $@ rem2ps$O $(LFLAGS2)
remind.exe: $(OBJS)
$(CC) $(LFLAGS) -o $@ $(OBJS) $(LFLAGS2)
$(BIND)
clean:
rm -f *.o *.obj *~ core *.bak
clobber:
rm -f *.o *.obj *~ remind.exe rem2ps.exe test.out core *.bak
test:
test-rem.cmd
rem2ps$O: rem2ps.c rem2ps.h lang.h config.h
calendar$O: calendar.c $(STDHDRS) expr.h
dorem$O: dorem.c $(STDHDRS) expr.h
dosubst$O: dosubst.c $(STDHDRS) $(LANGHDRS)
expr$O: expr.c $(STDHDRS) expr.h
files$O: files.c $(STDHDRS)
funcs$O: funcs.c $(STDHDRS) expr.h version.h
globals$O: globals.c config.h types.h globals.h err.h lang.h $(LANGHDRS)
hbcal$O: hbcal.c $(STDHDRS)
init$O: init.c $(STDHDRS) expr.h version.h $(LANGHDRS)
main$O: main.c $(STDHDRS) expr.h
moon$O: moon.c $(STDHDRS)
omit$O: omit.c $(STDHDRS)
sort$O: sort.c $(STDHDRS)
queue$O: queue.c $(STDHDRS)
token$O: token.c $(STDHDRS)
trigger$O: trigger.c $(STDHDRS) expr.h
userfns$O: userfns.c $(STDHDRS) expr.h
utils$O: utils.c $(STDHDRS)
var$O: var.c $(STDHDRS) expr.h

View File

@@ -1,66 +0,0 @@
# Makefile for REMIND for Turbo C for MSDOS
CC= tcc
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \
danish.h polish.h
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h danish.h \
polish.h
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
moon.c main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
utils.obj userfns.obj var.obj hbcal.obj
all: remind.exe rem2ps.exe
remind.exe: $(OBJS)
$(CC) @lnk.tc
rem2ps.exe: rem2ps.obj
$(CC) -erem2ps.exe rem2ps.obj
.c.obj:
$(CC) -w-pia -c -O -mm {$< }
rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
calendar.obj: calendar.c $(STDHDRS) expr.h
dorem.obj: dorem.c $(STDHDRS) expr.h
dosubst.obj: dosubst.c $(STDHDRS) $(LANGHDRS)
expr.obj: expr.c $(STDHDRS) expr.h
files.obj: files.c $(STDHDRS)
funcs.obj: funcs.c $(STDHDRS) expr.h version.h
globals.obj: globals.c config.h types.h globals.h err.h lang.h
init.obj: init.c $(STDHDRS) expr.h version.h
main.obj: main.c $(STDHDRS) expr.h
moon.obj: moon.c $(STDHDRS) expr.h
omit.obj: omit.c $(STDHDRS)
sort.obj: sort.c $(STDHDRS)
token.obj: token.c $(STDHDRS)
trigger.obj: trigger.c $(STDHDRS) expr.h
userfns.obj: userfns.c $(STDHDRS) expr.h
utils.obj: utils.c $(STDHDRS)
var.obj: var.c $(STDHDRS) expr.h

View File

@@ -1,158 +0,0 @@
/***************************************************************/
/* */
/* OS2FUNC.C */
/* */
/* Functions to support OS/2. */
/* */
/* This file is part of REMIND. */
/* */
/* This file is Copyright (C) 1993 by Russ Herman. */
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
/* Copyright (C) 1999-2000 by Roaring Penguin Software Inc. */
/* */
/***************************************************************/
#include "config.h"
#ifdef OS2_POPUP
#define INCL_VIO
#define INCL_KBD
#endif
#ifdef _MSC_VER
#define INCL_DOSPROCESS
#endif
#if defined(OS2_POPUP) || defined(_MSC_VER)
#include <os2.h>
#endif
#ifdef OS2_POPUP
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef OS2DBG
#include <dos.h>
#include <stdlib.h>
#endif
#include "globals.h"
/* EMX defines PS_TYPE, so we undefine it here to avoid
a redefinition warning when we include "types.h" */
#ifdef PS_TYPE
#undef PS_TYPE
#endif
#include "types.h"
#include "protos.h"
#ifdef _MSC_VER
typedef USHORT APIRET;
#endif
static APIRET apiret = 0;
static KBDKEYINFO kbci;
static char *pszPressAny = "\r\nPress any key to continue";
static USHORT pflags = VP_WAIT; /* | VP_TRANSPARENT; */
static HKBD hkbd = 0;
static char VioSubstBuffer[SHELLSIZE + 1];
void StartPopUp()
{
if (OS2MODE)
if (!(DebugFlag & DB_ECHO_LINE))
VioPopUp(&pflags, 0);
}
void EndPopUp()
{
if (DebugFlag & DB_ECHO_LINE)
return;
if (OS2MODE) {
VioWrtTTY(pszPressAny, strlen(pszPressAny), 0);
KbdCharIn(&kbci, IO_WAIT, hkbd);
VioEndPopUp(0);
}
}
int PutsPopUp(char *s)
{
char c, *os = VioSubstBuffer;
if (DebugFlag & DB_ECHO_LINE)
printf("%s", s);
else {
do {
/* Convert \n to \r\n in auxiliary buffer for VIO */
if ((c= *s++) == '\n')
*os++ = '\r';
*os++ = c;
} while (c > 0);
VioWrtTTY(VioSubstBuffer, strlen(VioSubstBuffer), 0);
}
return(0);
}
int PutlPopUp(char *s)
{
StartPopUp();
PutsPopUp(s);
if (DebugFlag & DB_ECHO_LINE)
fputc('\n', stdout);
else
VioWrtTTY("\r\n", 2, 0);
EndPopUp();
return(0);
}
int PutcPopUp(int c)
{
char *s = " ";
if (DebugFlag & DB_ECHO_LINE)
fputc(c, stdout);
else {
switch (c) {
case '\n':
VioWrtTTY("\r\n", 2, 0);
break;
default:
s[0] = c;
VioWrtTTY(s, 1, 0);
break;
}
}
return(0);
}
#ifdef OS2DBG
#define DB_ECHO_LINE 16
int DebugFlag = 0;
void main(/* int argc, char **argv */)
{
int ret;
ret = os2fputs("Test VIO PopUp Writing");
if (ret)
fprintf(stderr, "Test VIO PopUP Writing returned %d %ld",
ret, apiret);
exit(ret);
}
#endif
#endif
#ifdef _MSC_VER
unsigned sleep(unsigned sec)
{
return DosSleep(sec * 1000L);
}
#endif
#ifndef __EMX__
int fork()
{
return(-1);
}
#endif

View File

@@ -1 +0,0 @@
NAME WINDOWCOMPAT NEWFILES

View File

@@ -1,93 +0,0 @@
# Makefile for REMIND, suitable for SAS/C 6.50 under AmigaDOS
# English version
# THIS IS OUT OF DATE!
#-----------------------------------------------------------------------------
# THINGS FOR YOU TO EDIT START BELOW
#-----------------------------------------------------------------------------
# Uncomment the next line if you are running on a SYSV system
# SYSV= -DSYSV
# Uncomment the next line if you are running under UNIX (including SYSV!)
#UNIX= -DUNIX
# Uncomment the next lines if you want to use gcc instead of default compiler
# NOTE: Tempting as it may be, if you use 'cc' for the C compiler, do not
# use 'ld' for the linker. It will probably work much better if you use
# LD= cc rather than LD= ld.
CC= SC
LD= SC
# Put any additional flags for the C compiler or linker here - if you
# are not using gcc, you probably want to remove '-ansi'.
CFLAGS= OPT NOSTKCHK NOSINT MATH=IEEE
CDEFS=
LDFLAGS= LINK
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c hbcal.c \
init.c main.c moon.c omit.c sort.c queue.c token.c trigger.c userfns.c \
utils.c var.c amiga.c
OBJS= calendar.o dorem.o dosubst.o expr.o files.o funcs.o globals.o hbcal.o \
init.o main.o moon.o omit.o sort.o queue.o token.o trigger.o userfns.o \
utils.o var.o amiga.o
MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
tstlang.rem README.BCC lnk.bcc makefile.bcc os2func.c \
test-rem.bat test-rem.cmd test1.cmp test2.cmp
all: remind rem2ps
.c.o:
$(CC) $(UNIX) $(SYSV) $(CFLAGS) $(CDEFS) $*.c
rem2ps: rem2ps.o
$(LD) MATH=IEEE $(LDFLAGS) PNAME=rem2ps rem2ps.o
remind: $(OBJS)
$(LD) MATH=IEEE $(LDFLAGS) PNAME=remind $(OBJS)
clean:
rm -f *.o *~ core *.bak
clobber:
rm -f *.o *~ remind rem2ps test.out core *.bak
test: remind
sh test-rem
rem2ps.o: rem2ps.c rem2ps.h lang.h config.h
calendar.o: calendar.c $(STDHDRS) expr.h
dorem.o: dorem.c $(STDHDRS) expr.h
dosubst.o: dosubst.c $(STDHDRS) $(LANGHDRS)
expr.o: expr.c $(STDHDRS) expr.h
files.o: files.c $(STDHDRS)
funcs.o: funcs.c $(STDHDRS) expr.h version.h
globals.o: globals.c config.h types.h globals.h err.h lang.h $(LANGHDRS)
hbcal.o: hbcal.c $(STDHDRS)
init.o: init.c $(STDHDRS) expr.h version.h lang.h $(LANGHDRS)
main.o: main.c $(STDHDRS) expr.h
moon.o: moon.c $(STDHDRS)
omit.o: omit.c $(STDHDRS)
sort.o: sort.c $(STDHDRS)
queue.o: queue.c $(STDHDRS)
token.o: token.c $(STDHDRS)
trigger.o: trigger.c $(STDHDRS) expr.h
userfns.o: userfns.c $(STDHDRS) expr.h
utils.o: utils.c $(STDHDRS)
var.o: var.c $(STDHDRS) expr.h
amiga.o: amiga.c
$(CC) OBJNAME=amiga.o $(CFLAGS) amiga.c

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;
@@ -473,8 +475,9 @@ static int ParseScanFrom(ParsePtr s, Trigger *t, int type)
Token tok;
int r;
DynamicBuffer buf;
DBufInit(&buf);
char const *word;
DBufInit(&buf);
if (type == SCANFROM_TYPE) {
word = "SCANFROM";
} else {
@@ -551,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 ||
@@ -567,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;
@@ -594,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%c%02d%c%02d ", y, DateSep, m+1, DateSep, 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 */
@@ -607,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]) {
@@ -616,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) {
@@ -625,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) {
@@ -634,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;
}
@@ -803,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;
@@ -892,7 +914,7 @@ int DoMsgCommand(char *cmd, char *msg)
msg = DBufValue(&buf);
/* Do "%s" substitution */
l = strlen(cmd)-1;
l = strlen(cmd);
for (i=0; i<l; i++) {
if (cmd[i] == '%' && cmd[i+1] == 's') {
++i;
@@ -907,11 +929,6 @@ int DoMsgCommand(char *cmd, char *msg)
}
}
}
if (l >= 0 && DBufPutc(&execBuffer, cmd[l]) != OK) {
r = E_NO_MEM;
goto finished;
}
r = OK;
system(DBufValue(&execBuffer));

View File

@@ -73,7 +73,7 @@ void DBufInit(DynamicBuffer *dbuf)
}
/**********************************************************************
%FUNCTION: DBufPutc
%FUNCTION: DBufPutcFN
%ARGUMENTS:
dbuf -- pointer to a dynamic buffer
c -- character to append to buffer
@@ -82,7 +82,7 @@ void DBufInit(DynamicBuffer *dbuf)
%DESCRIPTION:
Appends a character to the buffer.
**********************************************************************/
int DBufPutc(DynamicBuffer *dbuf, char c)
int DBufPutcFN(DynamicBuffer *dbuf, char c)
{
if (dbuf->allocatedLen == dbuf->len+1) {
if (DBufMakeRoom(dbuf, dbuf->len+1) != OK) return E_NO_MEM;

View File

@@ -24,7 +24,7 @@ typedef struct {
} DynamicBuffer;
void DBufInit(DynamicBuffer *dbuf);
int DBufPutc(DynamicBuffer *dbuf, char c);
int DBufPutcFN(DynamicBuffer *dbuf, char c);
int DBufPuts(DynamicBuffer *dbuf, char *str);
void DBufFree(DynamicBuffer *dbuf);
int DBufGets(DynamicBuffer *dbuf, FILE *fp);
@@ -32,4 +32,6 @@ int DBufGets(DynamicBuffer *dbuf, FILE *fp);
#define DBufValue(bufPtr) ((bufPtr)->buffer)
#define DBufLen(bufPtr) ((bufPtr)->len)
#define DBufPutc(dbuf, c) ( (dbuf)->allocatedLen < (dbuf)->len+1 ) ? (dbuf)->buffer[(dbuf)->len++] = c, (dbuf)->buffer[(dbuf)->len] = 0, OK : DBufPutcFN((dbuf), c)
#endif /* DYNBUF_H */

View File

@@ -51,6 +51,7 @@
/* Function prototypes */
static int FCurrent (void);
static int FNonomitted (void);
static int FTimepart(void);
static int FDatepart(void);
static int FRealCurrent(void);
@@ -228,6 +229,7 @@ Operator Func[] = {
{ "moondatetime", 1, 3, FMoondatetime },
{ "moonphase", 0, 2, FMoonphase },
{ "moontime", 1, 3, FMoontime },
{ "nonomitted", 2, NO_MAX, FNonomitted },
{ "now", 0, 0, FNow },
{ "ord", 1, 1, FOrd },
{ "ostype", 0, 0, FOstype },
@@ -2044,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];
@@ -2059,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 ");
@@ -2080,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];
@@ -2107,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 {
@@ -2438,3 +2452,36 @@ static int FTzconvert(void)
RetVal.v.val = jul * MINUTES_PER_DAY + tim;
return OK;
}
static int
FNonomitted(void)
{
int d1, d2, ans, localomit, i;
Token tok;
if (!HASDATE(ARG(0)) ||
!HASDATE(ARG(1))) {
}
d1 = DATEPART(ARG(0));
d2 = DATEPART(ARG(1));
if (d2 < d1) return E_2LOW;
localomit = 0;
for (i=2; i<Nargs; i++) {
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
FindToken(ARG(i).v.str, &tok);
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
localomit |= (1 << tok.val);
}
ans = 0;
while (d1 < d2) {
if (!IsOmitted(d1++, localomit)) {
ans++;
}
}
RetVal.type = INT_TYPE;
RetVal.v.val = ans;
return OK;
}

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

@@ -34,8 +34,6 @@ while (isdigit(*(string))) { \
string++; \
}
#define UPPER(c) (islower(c) ? toupper(c) : c)
/* The big array holding all recognized (literal) tokens in reminder file.
Keep this array sorted, or software will not work. */
Token TokArray[] = {
@@ -342,7 +340,7 @@ static int TokStrCmp(const Token *t, const char *s)
register int r;
char *tk = t->name;
while(*tk && *s && !(*s == ',' && *(s+1) == 0)) {
r = UPPER(*tk) - UPPER(*s);
r = *tk - tolower(*s);
tk++;
s++;
if (r) return r;

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

@@ -21,7 +21,7 @@
#include "globals.h"
#include "protos.h"
#define UPPER(c) (islower(c) ? toupper(c) : c)
#define UPPER(c) toupper(c)
/***************************************************************/
/* */

View File

@@ -10,4 +10,4 @@
/* */
/***************************************************************/
#define VERSION "03.01.00"
#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.00"
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.00"
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 = localhost
# WWWHOST = www.mycompany.com
# The complete path to where the scripts actually live, as seen by
# the UNIX operating system.
SCRIPTDIR = /home/httpd/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 = /home/httpd/html/remind
# Where you stick images, as seen by UNIX
IMAGEDIR = /home/httpd/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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 220 B

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

After

Width:  |  Height:  |  Size: 212 B

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

After

Width:  |  Height:  |  Size: 200 B

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 = "<P ALIGN=RIGHT><IMAGE SRC=\"$DefaultImageDir/newmoon.png\" ALT=\"New Moon\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
} elsif ($phase == 1) {
$text = "<P ALIGN=RIGHT><IMAGE SRC=\"$DefaultImageDir/firstquarter.png\" ALT=\"First Quarter\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
} elsif ($phase == 2) {
$text = "<P ALIGN=RIGHT><IMAGE SRC=\"$DefaultImageDir/fullmoon.png\" ALT=\"Full Moon\"" .
"WIDTH=16 HEIGHT=16> <FONT SIZE=\"-2\">" . escape_html($text);
} else {
$text = "<P ALIGN=RIGHT><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>