mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Compare commits
207 Commits
03.04.00-B
...
04.00.01
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80e30638a5 | ||
|
|
dd2fc30364 | ||
|
|
a5865fb5fe | ||
|
|
aca2f28341 | ||
|
|
7a3f5f7ac9 | ||
|
|
1731710ef2 | ||
|
|
dc2a8f48bf | ||
|
|
5e16179bfa | ||
|
|
a7c1bc81b2 | ||
|
|
5f5ec8ef19 | ||
|
|
712ff56792 | ||
|
|
99af1f964c | ||
|
|
de5d1347e5 | ||
|
|
5e07fbde6d | ||
|
|
c523c7f3b3 | ||
|
|
6b3c6b0ec7 | ||
|
|
62b94ab065 | ||
|
|
49c7399599 | ||
|
|
5fa9297aba | ||
|
|
4ada31798b | ||
|
|
e78f953e90 | ||
|
|
af7a9ad8b5 | ||
|
|
35eae045a6 | ||
|
|
98a20ae058 | ||
|
|
df9ef6e13a | ||
|
|
10f5802069 | ||
|
|
780044219f | ||
|
|
d015c061e7 | ||
|
|
6f6326d433 | ||
|
|
9488e7ca13 | ||
|
|
71c11672c2 | ||
|
|
0acefa800e | ||
|
|
d45cee4712 | ||
|
|
c026aa05e2 | ||
|
|
50076c74fa | ||
|
|
1563d77c06 | ||
|
|
ed72ef8629 | ||
|
|
06c5996086 | ||
|
|
570ca857a0 | ||
|
|
f8f20b7afc | ||
|
|
f55ef7ff20 | ||
|
|
79220a74cf | ||
|
|
77111ef628 | ||
|
|
bf96063311 | ||
|
|
58a201fceb | ||
|
|
47cecb210b | ||
|
|
bfbf744b0a | ||
|
|
0cf56ac1de | ||
|
|
2880a718f4 | ||
|
|
da0dd0f7c6 | ||
|
|
c456d3e0ff | ||
|
|
59059736e6 | ||
|
|
f5cf2ab832 | ||
|
|
cc4ff2582d | ||
|
|
90f5fde3bb | ||
|
|
9fbe9f5132 | ||
|
|
f05661fa6c | ||
|
|
d6882c3378 | ||
|
|
e32cab937e | ||
|
|
14bb939977 | ||
|
|
13e830782d | ||
|
|
f39bb5e2d9 | ||
|
|
8b795e81b7 | ||
|
|
aef7eeda5a | ||
|
|
0641a6f8f1 | ||
|
|
4fdf7b706b | ||
|
|
0653b9420a | ||
|
|
27ede1ce37 | ||
|
|
a303fb9cba | ||
|
|
92af4e9c3e | ||
|
|
abc4f45fed | ||
|
|
e651f92bd9 | ||
|
|
b2d3d98d72 | ||
|
|
cb8b7f85af | ||
|
|
d30f347a0b | ||
|
|
5e9b1e7464 | ||
|
|
58085470c5 | ||
|
|
8f0de805d5 | ||
|
|
3f879a1b97 | ||
|
|
94270c3d98 | ||
|
|
bb8a689186 | ||
|
|
a7e73cdac8 | ||
|
|
d38c324340 | ||
|
|
fade38d522 | ||
|
|
858a7601aa | ||
|
|
37e3d3d1d1 | ||
|
|
ff67ab3c86 | ||
|
|
ad7faa8ad9 | ||
|
|
c927166a8a | ||
|
|
9d22fba842 | ||
|
|
3d5adf6c42 | ||
|
|
5ba862cbd7 | ||
|
|
6f20e056c9 | ||
|
|
878ab1a8bc | ||
|
|
4d17494371 | ||
|
|
65763b9522 | ||
|
|
52840d40de | ||
|
|
6892e7a805 | ||
|
|
24d0264f92 | ||
|
|
56c37e4e05 | ||
|
|
86c99102b5 | ||
|
|
de4a23ee1e | ||
|
|
6a9f7c186a | ||
|
|
eaed22a42b | ||
|
|
f47cf2320e | ||
|
|
eb100e57e2 | ||
|
|
948548c73f | ||
|
|
7495ae1e05 | ||
|
|
51ae17bd0a | ||
|
|
61d665ef7d | ||
|
|
5aaf19ffdb | ||
|
|
2eb672e380 | ||
|
|
4a59bf686b | ||
|
|
f98ab6f686 | ||
|
|
3600cd95cd | ||
|
|
f8bd79fbb2 | ||
|
|
4c403047eb | ||
|
|
25009de417 | ||
|
|
c4588654ec | ||
|
|
c1e5279272 | ||
|
|
cda8396690 | ||
|
|
c0f79d1e69 | ||
|
|
375a0fb7a2 | ||
|
|
2069114ef1 | ||
|
|
f6d9e8724d | ||
|
|
8e55438200 | ||
|
|
1ca6feb112 | ||
|
|
732ce8283f | ||
|
|
122bd3e07e | ||
|
|
0ac5cbb837 | ||
|
|
7f3d4812a8 | ||
|
|
e1fa11c94c | ||
|
|
c06c65acf1 | ||
|
|
a84fa0bc8f | ||
|
|
054648e02b | ||
|
|
9548041334 | ||
|
|
da306f2900 | ||
|
|
26587aea02 | ||
|
|
adc86e0f00 | ||
|
|
a9ed5f075e | ||
|
|
21e30c980e | ||
|
|
a657b2e55a | ||
|
|
ff8c55b8b6 | ||
|
|
eb36c5bca0 | ||
|
|
89173ce1ee | ||
|
|
5d115ba3e3 | ||
|
|
7e3adeb9c9 | ||
|
|
080cda86fa | ||
|
|
6274cbad52 | ||
|
|
85c4ad821d | ||
|
|
b758a2fea8 | ||
|
|
6619cc7ca4 | ||
|
|
961f7a8a62 | ||
|
|
905287901f | ||
|
|
669be7bf57 | ||
|
|
9b8eb2dc4c | ||
|
|
00ab7b196d | ||
|
|
f616be4bdd | ||
|
|
8ae9ce8523 | ||
|
|
6d2bbbd7e2 | ||
|
|
1453be83b2 | ||
|
|
8659131be2 | ||
|
|
0276ce322d | ||
|
|
b36c99a34b | ||
|
|
ad575f1485 | ||
|
|
a9162f1472 | ||
|
|
221e2554a9 | ||
|
|
04ec6c3695 | ||
|
|
b1594980fc | ||
|
|
024a8ef38d | ||
|
|
b281051421 | ||
|
|
aa1b275b51 | ||
|
|
c22ca68857 | ||
|
|
3804ce3fe3 | ||
|
|
0977f1db04 | ||
|
|
83c97934c9 | ||
|
|
44c9d74caa | ||
|
|
172f56754a | ||
|
|
dc184cc713 | ||
|
|
2c30088553 | ||
|
|
6f0c189afb | ||
|
|
0e2996c3e1 | ||
|
|
ce8040dd1f | ||
|
|
a8fd2d463d | ||
|
|
237813127c | ||
|
|
3e6259532f | ||
|
|
c015441130 | ||
|
|
9661455fee | ||
|
|
df983b4123 | ||
|
|
068d5429eb | ||
|
|
6c593fe849 | ||
|
|
6a7bdb2ec7 | ||
|
|
a4aead18dd | ||
|
|
d277154d9f | ||
|
|
d2662fb026 | ||
|
|
2f522ea705 | ||
|
|
cd68041312 | ||
|
|
9c2556f16d | ||
|
|
b80b938d3d | ||
|
|
0bd6278050 | ||
|
|
b2746f28db | ||
|
|
cfd3698b53 | ||
|
|
6b5150d30e | ||
|
|
b011adf94e | ||
|
|
d09b725710 | ||
|
|
2f1e3524df | ||
|
|
2de47cfa51 |
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,4 +1,5 @@
|
||||
.gitignore export-ignore
|
||||
.gitattributes export-ignore
|
||||
remind.php export-ignore
|
||||
sync-to-dianne-git export-ignore
|
||||
sync-to-dianne-git export-ignore
|
||||
php export-ignore
|
||||
|
||||
2
.github/FUNDING.yml
vendored
Normal file
2
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
liberapay: dskoll
|
||||
29
.github/workflows/github-action.yml
vendored
Normal file
29
.github/workflows/github-action.yml
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# language: bash
|
||||
---
|
||||
|
||||
name: Remind unit tests
|
||||
|
||||
on:
|
||||
push
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Remind
|
||||
uses: actions/checkout@v2
|
||||
- name: Add test user
|
||||
run: |
|
||||
sudo adduser --home /home/testuser --gecos 'Test User' --disabled-password testuser
|
||||
- name: Fix ownership
|
||||
run: |
|
||||
sudo chown -R testuser .
|
||||
- name: Build
|
||||
run: |
|
||||
sudo su -c './configure && make' testuser
|
||||
- name: Run Tests
|
||||
run: |
|
||||
sudo su -c 'make test' testuser
|
||||
- name: Fix up permissions so GitHub does not complain
|
||||
run: |
|
||||
sudo chmod -R a+rwX .
|
||||
20
.gitignore
vendored
20
.gitignore
vendored
@@ -1,26 +1,28 @@
|
||||
rem2pdf/Makefile.old
|
||||
*.bak
|
||||
*.o
|
||||
*~
|
||||
.gitignore
|
||||
MYMETA.json
|
||||
MYMETA.yml
|
||||
Makefile
|
||||
TAGS
|
||||
autom4te.cache
|
||||
blib/
|
||||
config.log
|
||||
config.status
|
||||
pm_to_blib
|
||||
rem2html/Makefile
|
||||
rem2html/rem2html.1
|
||||
rem2pdf/Makefile.PL
|
||||
rem2pdf/Makefile.old
|
||||
rem2pdf/Makefile.top
|
||||
rem2pdf/bin/rem2pdf
|
||||
src/*.tar.gz*
|
||||
src/Makefile
|
||||
src/config.h
|
||||
src/rem2ps
|
||||
src/remind
|
||||
src/test-*.out
|
||||
src/version.h
|
||||
tests/test.out
|
||||
www/Makefile
|
||||
rem2pdf/Makefile.PL
|
||||
MYMETA.json
|
||||
MYMETA.yml
|
||||
Makefile
|
||||
blib/
|
||||
pm_to_blib
|
||||
rem2pdf/Makefile.top
|
||||
rem2pdf/bin/rem2pdf
|
||||
|
||||
@@ -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 1992-2021 Dianne Skoll, except where noted in
|
||||
2. REMIND is Copyright 1992-2022 Dianne Skoll, except where noted in
|
||||
individual files.
|
||||
|
||||
3. DISTRIBUTION AND USE
|
||||
|
||||
4
Makefile
4
Makefile
@@ -20,10 +20,10 @@ install:
|
||||
@echo ""
|
||||
@$(MAKE) -C src install
|
||||
@$(MAKE) -C rem2html install
|
||||
@$(MAKE) -C rem2pdf -f Makefile.top install
|
||||
@$(MAKE) -C rem2pdf -f Makefile.top install INSTALL_BASE=$(INSTALL_BASE)
|
||||
clean:
|
||||
find . -name '*~' -exec rm {} \;
|
||||
$(MAKE) -C src clean
|
||||
-$(MAKE) -C src clean
|
||||
-$(MAKE) -C rem2pdf clean
|
||||
|
||||
test:
|
||||
|
||||
40
build.tk
40
build.tk
@@ -27,8 +27,10 @@ proc SetConfigDefaults {} {
|
||||
global Config
|
||||
set Config(LAT_DEG) 45
|
||||
set Config(LAT_MIN) 24
|
||||
set Config(LAT_SEC) 14
|
||||
set Config(LON_DEG) 75
|
||||
set Config(LON_MIN) 39
|
||||
set Config(LON_SEC) 23
|
||||
set Config(LOCATION) "Ottawa"
|
||||
set Config(DEFAULT_PAGE) "Letter"
|
||||
set Config(DATESEP) "-"
|
||||
@@ -157,10 +159,14 @@ proc CreateLocationDialog { w } {
|
||||
-from 0 -to 89 -length 300 -variable Config(LAT_DEG)
|
||||
scale $w.latmin -label "Latitude (minutes)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LAT_MIN)
|
||||
scale $w.latsec -label "Latitude (seconds)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LAT_SEC)
|
||||
scale $w.londeg -label "Longitude (degrees)" -orient horizontal \
|
||||
-from 0 -to 179 -length 300 -variable Config(LON_DEG)
|
||||
scale $w.lonmin -label "Longtude (minutes)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LON_MIN)
|
||||
scale $w.lonsec -label "Longitude (seconds)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LON_SEC)
|
||||
|
||||
radiobutton $w.north -text "Northern Hemisphere" \
|
||||
-variable Config(NORTHERN_HEMISPHERE) -value 1
|
||||
@@ -176,8 +182,10 @@ proc CreateLocationDialog { w } {
|
||||
$w.location insert end $Config(LOCATION)
|
||||
grid $w.latdeg -
|
||||
grid $w.latmin -
|
||||
grid $w.latsec -
|
||||
grid $w.londeg -
|
||||
grid $w.lonmin -
|
||||
grid $w.lonsec -
|
||||
|
||||
grid $w.north $w.west
|
||||
grid $w.south $w.east
|
||||
@@ -347,7 +355,7 @@ proc RunCommand { cmd } {
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Reads characters from command pipelin and appends them to .msg.
|
||||
# Reads characters from command pipeline and appends them to .msg.
|
||||
#***********************************************************************
|
||||
proc CommandReadable { f } {
|
||||
global CmdDone
|
||||
@@ -406,15 +414,19 @@ proc CreateCustomH {} {
|
||||
# modify them willy-nilly
|
||||
set LAT_DEG $Config(LAT_DEG)
|
||||
set LAT_MIN $Config(LAT_MIN)
|
||||
set LAT_SEC $Config(LAT_SEC)
|
||||
set LON_DEG $Config(LON_DEG)
|
||||
set LON_MIN $Config(LON_MIN)
|
||||
set LON_SEC $Config(LON_SEC)
|
||||
if {!$Config(NORTHERN_HEMISPHERE)} {
|
||||
set LAT_DEG "-$LAT_DEG"
|
||||
set LAT_MIN "-$LAT_MIN"
|
||||
set LAT_SEC "-$LAT_SEC"
|
||||
}
|
||||
if {!$Config(WESTERN_HEMISPHERE)} {
|
||||
set LON_DEG "-$LON_DEG"
|
||||
set LON_MIN "-$LON_MIN"
|
||||
set LON_SEC "-$LON_SEC"
|
||||
}
|
||||
set Config(LOCATION) [$Loc.location get]
|
||||
|
||||
@@ -431,21 +443,15 @@ proc CreateCustomH {} {
|
||||
|
||||
while {[gets $in line] != -1} {
|
||||
switch -glob -- $line {
|
||||
"#define LAT_DEG *" {
|
||||
puts $out "#define LAT_DEG $LAT_DEG"
|
||||
.msgs insert end "#define LAT_DEG $LAT_DEG\n"
|
||||
"#define DEFAULT_LATITUDE *" {
|
||||
set lat [expr $LAT_DEG + ($LAT_MIN/60.0) + ($LAT_SEC/3600.0)];
|
||||
puts $out "#define DEFAULT_LATITUDE $lat"
|
||||
.msgs insert end "#define DEFAULT_LATITUDE $lat"
|
||||
}
|
||||
"#define LAT_MIN *" {
|
||||
puts $out "#define LAT_MIN $LAT_MIN"
|
||||
.msgs insert end "#define LAT_MIN $LAT_MIN\n"
|
||||
}
|
||||
"#define LON_DEG *" {
|
||||
puts $out "#define LON_DEG $LON_DEG"
|
||||
.msgs insert end "#define LON_DEG $LON_DEG\n"
|
||||
}
|
||||
"#define LON_MIN *" {
|
||||
puts $out "#define LON_MIN $LON_MIN"
|
||||
.msgs insert end "#define LON_MIN $LON_MIN\n"
|
||||
"#define DEFAULT_LONGITUDE *" {
|
||||
set lon [expr -1.0 * ($LON_DEG + ($LON_MIN/60.0) + ($LON_SEC/3600.0))]
|
||||
puts $out "#define DEFAULT_LONGITUDE $lon"
|
||||
.msgs insert end "#define DEFAULT_LONGITUDE $lon"
|
||||
}
|
||||
"#define LOCATION *" {
|
||||
puts $out "#define LOCATION \"$Config(LOCATION)\""
|
||||
@@ -758,14 +764,17 @@ proc SetConfigFromRemind {} {
|
||||
# Query Remind for the rest
|
||||
QueryRemind $rem LAT_DEG {$LatDeg}
|
||||
QueryRemind $rem LAT_MIN {$LatMin}
|
||||
QueryRemind $rem LAT_SEC {$LatSec}
|
||||
QueryRemind $rem LON_DEG {$LongDeg}
|
||||
QueryRemind $rem LON_MIN {$LongMin}
|
||||
QueryRemind $rem LON_SEC {$LongSec}
|
||||
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))]
|
||||
set $Config(LAT_SEC) [expr abs($Config(LAT_SEC))]
|
||||
if {$Config(LAT_DEG) >= 0} {
|
||||
set Config(NORTHERN_HEMISPHERE) 1
|
||||
} else {
|
||||
@@ -774,6 +783,7 @@ proc SetConfigFromRemind {} {
|
||||
}
|
||||
|
||||
set $Config(LON_MIN) [expr abs($Config(LON_MIN))]
|
||||
set $Config(LON_SEC) [expr abs($Config(LON_SEC))]
|
||||
if {$Config(LON_DEG) >= 0} {
|
||||
set Config(WESTERN_HEMISPHERE) 1
|
||||
} else {
|
||||
|
||||
77
configure
vendored
77
configure
vendored
@@ -622,6 +622,7 @@ ac_includes_default="\
|
||||
ac_header_list=
|
||||
ac_subst_vars='LTLIBOBJS
|
||||
LIBOBJS
|
||||
PERLARTIFACTS
|
||||
VERSION
|
||||
EGREP
|
||||
GREP
|
||||
@@ -681,6 +682,7 @@ SHELL'
|
||||
ac_subst_files=''
|
||||
ac_user_opts='
|
||||
enable_option_checking
|
||||
enable_perl_build_artifacts
|
||||
'
|
||||
ac_precious_vars='build_alias
|
||||
host_alias
|
||||
@@ -1305,6 +1307,13 @@ if test -n "$ac_init_help"; then
|
||||
|
||||
cat <<\_ACEOF
|
||||
|
||||
Optional Features:
|
||||
--disable-option-checking ignore unrecognized --enable/--with options
|
||||
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
|
||||
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
|
||||
--disable-perl-build-artifacts
|
||||
Disable perllocal.pod and .packlist generation
|
||||
|
||||
Some influential environment variables:
|
||||
CC C compiler command
|
||||
CFLAGS C compiler flags
|
||||
@@ -2292,6 +2301,16 @@ EOF
|
||||
ac_config_headers="$ac_config_headers src/config.h"
|
||||
|
||||
|
||||
# Check whether --enable-perl-build-artifacts was given.
|
||||
if test "${enable_perl_build_artifacts+set}" = set; then :
|
||||
enableval=$enable_perl_build_artifacts; ac_cv_perlartifacts=$enableval
|
||||
else
|
||||
ac_cv_perlartifacts=yes
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
@@ -3287,7 +3306,6 @@ fi
|
||||
|
||||
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
|
||||
$as_echo_n "checking for sqrt in -lm... " >&6; }
|
||||
if ${ac_cv_lib_m_sqrt+:} false; then :
|
||||
@@ -3731,39 +3749,6 @@ fi
|
||||
done
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
# This bug is HP SR number 8606223364.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short" >&5
|
||||
$as_echo_n "checking size of unsigned short... " >&6; }
|
||||
if ${ac_cv_sizeof_unsigned_short+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short))" "ac_cv_sizeof_unsigned_short" "$ac_includes_default"; then :
|
||||
|
||||
else
|
||||
if test "$ac_cv_type_unsigned_short" = yes; then
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error 77 "cannot compute sizeof (unsigned short)
|
||||
See \`config.log' for more details" "$LINENO" 5; }
|
||||
else
|
||||
ac_cv_sizeof_unsigned_short=0
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short" >&5
|
||||
$as_echo "$ac_cv_sizeof_unsigned_short" >&6; }
|
||||
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short
|
||||
_ACEOF
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
@@ -3831,7 +3816,7 @@ _ACEOF
|
||||
|
||||
|
||||
|
||||
for ac_header in sys/types.h sys/file.h glob.h wctype.h locale.h
|
||||
for ac_header in sys/types.h sys/file.h glob.h wctype.h locale.h langinfo.h
|
||||
do :
|
||||
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
|
||||
@@ -3988,6 +3973,25 @@ fi
|
||||
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
|
||||
# Check for link-time optimization support
|
||||
for f in -flto=auto -ffat-lto-objects; do
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $f" >&5
|
||||
$as_echo_n "checking whether $CC supports $f... " >&6; }
|
||||
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
CFLAGS="$CFLAGS $f"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test "$ac_cv_perlartifacts" = "yes" ; then
|
||||
PERLARTIFACTS=
|
||||
else
|
||||
PERLARTIFACTS='NO_PACKLIST=1 NO_PERLLOCAL=1'
|
||||
fi
|
||||
|
||||
for ac_func in setenv unsetenv glob mbstowcs setlocale initgroups
|
||||
@@ -4002,7 +4006,8 @@ _ACEOF
|
||||
fi
|
||||
done
|
||||
|
||||
VERSION=03.04.00
|
||||
VERSION=04.00.01
|
||||
|
||||
|
||||
|
||||
ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf"
|
||||
|
||||
30
configure.in
30
configure.in
@@ -14,6 +14,12 @@ EOF
|
||||
|
||||
AC_CONFIG_HEADER(src/config.h)
|
||||
|
||||
AC_ARG_ENABLE(perl-build-artifacts,
|
||||
[ --disable-perl-build-artifacts
|
||||
Disable perllocal.pod and .packlist generation], ac_cv_perlartifacts=$enableval, ac_cv_perlartifacts=yes)
|
||||
|
||||
AH_BOTTOM([#include <custom.h>])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
@@ -22,17 +28,14 @@ AC_PROG_MAKE_SET
|
||||
AC_PATH_PROG([PERL], [perl])
|
||||
|
||||
dnl Checks for libraries.
|
||||
dnl Replace `main' with a function in -lm:
|
||||
|
||||
AC_CHECK_LIB(m, sqrt)
|
||||
|
||||
dnl Integer sizes
|
||||
AC_CHECK_SIZEOF(unsigned short)
|
||||
AC_CHECK_SIZEOF(unsigned int)
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_CHECK_HEADERS(sys/types.h sys/file.h glob.h wctype.h locale.h)
|
||||
AC_CHECK_HEADERS(sys/types.h sys/file.h glob.h wctype.h locale.h langinfo.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_STRUCT_TM
|
||||
@@ -43,11 +46,28 @@ AC_HEADER_TIME
|
||||
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
|
||||
# Check for link-time optimization support
|
||||
for f in -flto=auto -ffat-lto-objects; do
|
||||
AC_MSG_CHECKING([whether $CC supports $f])
|
||||
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
CFLAGS="$CFLAGS $f"
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test "$ac_cv_perlartifacts" = "yes" ; then
|
||||
PERLARTIFACTS=
|
||||
else
|
||||
PERLARTIFACTS='NO_PACKLIST=1 NO_PERLLOCAL=1'
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
||||
VERSION=03.04.00
|
||||
VERSION=04.00.01
|
||||
AC_SUBST(VERSION)
|
||||
AC_SUBST(PERL)
|
||||
AC_SUBST(PERLARTIFACTS)
|
||||
AC_OUTPUT(src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf)
|
||||
chmod a+x rem2pdf/bin/rem2pdf
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
# version 0.5 2007-03-21
|
||||
# - Add more help options
|
||||
# - --project-lead-time option
|
||||
# - Supress printing of heading if there are no todos to print
|
||||
# - Suppress printing of heading if there are no todos to print
|
||||
# version 0.4
|
||||
# - Version 0.4 changes all written or inspired by, and thanks to Mark Stosberg
|
||||
# - Change to GetOptions
|
||||
@@ -84,7 +84,7 @@ How may days in advance to start getting reminders about the events. Defaults to
|
||||
|
||||
ical2rem.pl --no-todos
|
||||
|
||||
If you don't care about the ToDos the calendar, this will surpress
|
||||
If you don't care about the ToDos the calendar, this will suppress
|
||||
printing of the ToDo heading, as well as skipping ToDo processing.
|
||||
|
||||
=head2 --heading
|
||||
|
||||
@@ -141,7 +141,7 @@ appear with exactly the text and exactly the same duration (including
|
||||
one VEVENT object, that will have a RFC2445 C<RDATE> property.
|
||||
|
||||
B<rem2ics> is not yet smart enough to derive an C<RRULE> based
|
||||
recurrance. If you really want that feature, either implement it and
|
||||
recurrence. If you really want that feature, either implement it and
|
||||
send in a patch, or contact the author and convince him to do it.
|
||||
|
||||
=head2 Other iCalendar Properties
|
||||
@@ -164,7 +164,7 @@ runs.
|
||||
|
||||
=head2 Other iCalendar Perl objects
|
||||
|
||||
Why does't B<rem2ics> use any of the iCalendar Perl stuff in CPAN?
|
||||
Why doesn't B<rem2ics> use any of the iCalendar Perl stuff in CPAN?
|
||||
Because I don't trust them, and they are too big for this app. One
|
||||
links to a binary library. Another hasn't been maintained since 1991,
|
||||
and is full of notes as to how buggy and incomplete it is. And so
|
||||
@@ -218,7 +218,7 @@ Bug fix, error message for non-recurring events
|
||||
Bug fix,
|
||||
rem2ics 0.91 chokes on timed reminders with
|
||||
duration using `remind -s` as it functions in remind-03.01.03.
|
||||
Remind 3.01 changed how the -s data is formated for events that have a duration
|
||||
Remind 3.01 changed how the -s data is formatted for events that have a duration
|
||||
Patch by Paul Hinze E<lt>paul dot t dot hinze at gmail dot comE<gt>
|
||||
and Michael Schultz E<lt>mjschultz at gmail dot comE<gt>
|
||||
|
||||
@@ -376,7 +376,7 @@ foreach $v (@events) {
|
||||
|
||||
my(%grovel);
|
||||
|
||||
# if the user doesnt want recurrance detection
|
||||
# if the user doesn't want recurrence detection
|
||||
unless ($options{norecurr}) {
|
||||
|
||||
# then dont put events in the grovel hash
|
||||
@@ -393,7 +393,7 @@ unless ($options{norecurr}) {
|
||||
$v = ${$grovel{$k}}[0];
|
||||
$v->{recurlist} = \@{$grovel{$k}};
|
||||
foreach my $v0 (@{$grovel{$k}}) {
|
||||
$v0->{is_recurrance} = $v;
|
||||
$v0->{is_recurrence} = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -409,12 +409,12 @@ unless ($options{norecurr}) {
|
||||
# might have a problem if a recurring event has two instances both on
|
||||
# the first day.
|
||||
|
||||
# Every event that is recurring has a "is_recurrance" property.
|
||||
# Every event that is recurring has a "is_recurrence" property.
|
||||
# Additionally, (hopefully) the first/earliest event in a set of
|
||||
# recurrances has a "recurlist" property. The "recurlist" is a
|
||||
# recurrences has a "recurlist" property. The "recurlist" is a
|
||||
# reference to a list of references to each of the events. The first
|
||||
# one on that list will be the same event that has the "recurlist"
|
||||
# property. The "is_recurrance" property is a reference back to the
|
||||
# property. The "is_recurrence" property is a reference back to the
|
||||
# event that has the "recurlist" property.
|
||||
|
||||
foreach my $k (keys %grovel) {
|
||||
@@ -466,8 +466,8 @@ foreach my $k (keys %grovel) {
|
||||
}
|
||||
|
||||
foreach $v (@events) {
|
||||
# for recurrant events, skip those that arnt the "head"
|
||||
next if ($v->{is_recurrance} and (not $v->{recurlist}));
|
||||
# for recurrent events, skip those that arnt the "head"
|
||||
next if ($v->{is_recurrence} and (not $v->{recurlist}));
|
||||
|
||||
if (${$v->{sf}}[4] eq "*") { # no time was given
|
||||
$v->{i_dtstart} = sprintf("DTSTART:%s", $v->{dts});
|
||||
@@ -485,7 +485,7 @@ foreach $v (@events) {
|
||||
}
|
||||
|
||||
if (${$v->{sf}}[3] ne "*") { # a duration was given
|
||||
# It's convienient that RFC2445 defines DURATION, thus we
|
||||
# It's convenient that RFC2445 defines DURATION, thus we
|
||||
# don't need to calculate DTEND, with awkward figuring out
|
||||
# crossing hours, days, months, year, etc. Instead we
|
||||
# will let the iCalendar consuming application worry about it.
|
||||
@@ -501,8 +501,8 @@ print "BEGIN:VCALENDAR\015\012"
|
||||
|
||||
# output each vevent
|
||||
foreach $v (@events) {
|
||||
# for recurrant events, only output the "head", skip the others
|
||||
next if ($v->{is_recurrance} and (not $v->{recurlist}));
|
||||
# for recurrent events, only output the "head", skip the others
|
||||
next if ($v->{is_recurrence} and (not $v->{recurlist}));
|
||||
|
||||
print "BEGIN:VEVENT\015\012";
|
||||
my $tag = ${$v->{sf}}[2];
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
;; Author: Shelagh Manton <shelagh.manton@gmail.com> with help from
|
||||
;; Dianne Skoll
|
||||
;; Keywords: remind configure convenience
|
||||
;; Version: 0.14
|
||||
;; Version: 0.15-dfs2
|
||||
|
||||
;; This program is free software; you can redistribute it and/or
|
||||
;; modify it under the terms of the GNU General Public License
|
||||
@@ -91,7 +91,6 @@
|
||||
(define-key remind-conf-mode-map "\C-c\C-x" 'rem-tomorrow)
|
||||
(define-key remind-conf-mode-map "\C-c\C-a" 'rem-days-away)
|
||||
(define-key remind-conf-mode-map "\M-j" 'remind-indent-line)
|
||||
(define-key remind-conf-mode-map (kbd "RET") 'remind-indent-line)
|
||||
(define-key remind-conf-mode-map "\C-c\C-c" 'rem-save-file)
|
||||
|
||||
;; syntax-table
|
||||
@@ -111,12 +110,18 @@
|
||||
|
||||
(defconst remind-keywords
|
||||
(sort
|
||||
(list "RUN" "REM" "ONCE" "SATISFY" "BEFORE" "UNSET" "OMIT" "FIRST" "SATISFY"
|
||||
"OMIT" "DATE" "SKIP" "ONCE" "AFTER" "WARN" "PRIORITY" "AT" "SCHED" "IF" "ELSE" "ENDIF"
|
||||
"WARN" "UNTIL" "THROUGH" "SCANFROM" "DURATION" "TAG" "MSG" "MSF" "CAL" "SPECIAL" "IFTRIG"
|
||||
"PS" "PSFILE" "BANNER" "INCLUDE" "PUSH-OMIT-CONTEXT" "DEBUG" "DUMPVARS" "PUSH" "CLEAR" "POP"
|
||||
"CLEAR-OMIT-CONTEXT" "POP-OMIT-CONTEXT" "SET" "ERRMSG" "FSET" "DUMP" "BAN" "INC" "SCAN"
|
||||
"EXIT" "FLUSH" "PRESERVE" "MOON" "COLOR" "UNSET")
|
||||
(list "ADDOMIT" "AFTER" "AT" "BANNER" "BEFORE"
|
||||
"CAL" "CLEAR-OMIT-CONTEXT" "DEBUG" "DO" "DUMPVARS"
|
||||
"DURATION" "ELSE" "ENDIF" "ERRMSG" "EXIT" "FIRST"
|
||||
"FLUSH" "FOURTH" "FROM" "FSET" "IF" "IFTRIG" "IN"
|
||||
"INCLUDE" "INCLUDECMD" "LAST" "LASTDAY"
|
||||
"LASTWORKDAY" "MAYBE-UNCOMPUTABLE" "MSF"
|
||||
"MSG" "OMIT" "OMITFUNC" "ONCE"
|
||||
"POP-OMIT-CONTEXT" "PRESERVE" "PRIORITY" "PS" "PSFILE"
|
||||
"PUSH-OMIT-CONTEXT" "REM" "RUN" "SATISFY" "SCANFROM"
|
||||
"SCHED" "SECOND" "SET" "SKIP" "SPECIAL"
|
||||
"TAG" "THIRD" "THROUGH" "UNSET" "UNTIL"
|
||||
"WARN")
|
||||
#'(lambda (a b) (> (length a) (length b)))))
|
||||
|
||||
|
||||
@@ -127,12 +132,20 @@
|
||||
|
||||
(defconst remind-builtin-variables
|
||||
(sort
|
||||
(list "$CalcUTC" "$CalMode" "$Daemon" "$DateSep" "$DefaultPrio" "$DontFork" "$DontTrigAts" "$DontQueue"
|
||||
"$EndSent" "$EndSentIg" "$NumTrig" "$FirstIndent" "$FoldYear" "$FormWidth" "$HushMode"
|
||||
"$IgnoreOnce" "$InfDelta" "$NextMode" "$NumQueued" "$NumTrig" "$PrefixLineNo" "$PSCal" "$RunOff"
|
||||
"$SimpleCal" "$SortByDate" "$SortByPrio" "$MinsFromUTC" "$LatDeg" "$LatMin" "$LatSec" "$EndSent"
|
||||
"$EndSentIg" "$Location" "$LongDeg" "$LongMin" "$LongSec" "$MaxSatIter" "$SubsIndent" "$T" "$Td"
|
||||
"$Tm" "$Tw" "$Ty" "$TimeSep" "$UntimedFirst" "$U" "$Ud" "$Um" "$Uw" "$Uy")
|
||||
(list "$Ago" "$Am" "$And" "$April" "$At" "$August" "$CalcUTC" "$CalMode" "$Daemon" "$DateSep"
|
||||
"$DateTimeSep" "$December" "$DefaultColor" "$DefaultPrio"
|
||||
"$DefaultTDelta" "$DeltaOffset" "$DontFork" "$DontQueue"
|
||||
"$DontTrigAts" "$EndSent" "$EndSentIg" "$February" "$FirstIndent"
|
||||
"$FoldYear" "$FormWidth" "$Friday" "$Fromnow" "$Hour" "$Hplu" "$HushMode" "$IgnoreOnce"
|
||||
"$InfDelta" "$IntMax" "$IntMin" "$Is" "$January" "$July" "$June" "$LatDeg"
|
||||
"$Latitude" "$LatMin" "$LatSec" "$Location" "$LongDeg" "$Longitude"
|
||||
"$LongMin" "$LongSec" "$March" "$MaxSatIter" "$MaxStringLen" "$May"
|
||||
"$MinsFromUTC" "$Minute" "$Monday" "$Mplu" "$NextMode" "$November" "$Now" "$NumQueued"
|
||||
"$NumTrig" "$October" "$On" "$Pm" "$PrefixLineNo" "$PSCal" "$RunOff" "$Saturday"
|
||||
"$September" "$SimpleCal" "$SortByDate" "$SortByPrio" "$SortByTime"
|
||||
"$SubsIndent" "$Sunday" "$SysInclude" "$T" "$Td" "$Thursday" "$TimeSep" "$Tm"
|
||||
"$Today" "$Tomorrow" "$Tuesday" "$Tw" "$Ty" "$U" "$Ud" "$Um" "$UntimedFirst" "$Uw" "$Uy"
|
||||
"$Was" "$Wednesday")
|
||||
#'(lambda (a b) (> (length a) (length b)))))
|
||||
|
||||
|
||||
@@ -147,15 +160,22 @@
|
||||
|
||||
(defconst remind-builtin-functions
|
||||
(sort
|
||||
(list "abs" "access" "args" "asc" "baseyr" "char" "choose" "coerce" "current" "date" "datetime" "datepart"
|
||||
"dawn" "day" "daysinmon" "defined" "dosubst" "dusk" "easter" "easterdate" "evaltrig" "filedate"
|
||||
"filedatetime" "filedir" "filename" "getenv" "hebdate" "hebday" "hebmon" "hebyear" "hour" "iif" "index" "isdst"
|
||||
"isleap" "isomitted" "language" "lower" "max" "min" "minute" "minsfromutc" "mon" "monnum" "moondate" "moondatetime"
|
||||
"moonphase" "moontime" "msgprefix" "msgsuffix" "nonomitted" "now" "ord" "ostype" "plural"
|
||||
"psmoon" "psshade" "realcurrent" "realnow" "realtoday" "sgn" "shell" "slide" "strlen" "substr" "sunrise" "sunset" "time" "timepart"
|
||||
"thisyear" "today" "trigdate" "trigdatetime" "trigger" "trigger" "trigtime" "trigvalid" "typeof" "tzconvert" "upper" "value"
|
||||
"version" "weekno" "wkday" "wkdaynum" "year"
|
||||
)
|
||||
(list "abs" "access" "adawn" "adusk" "ampm" "args" "asc" "baseyr" "char"
|
||||
"choose" "coerce" "current" "date" "datepart" "datetime" "dawn" "day"
|
||||
"daysinmon" "defined" "dosubst" "dusk" "easterdate" "evaltrig"
|
||||
"filedate" "filedatetime" "filedir" "filename" "getenv" "hebdate"
|
||||
"hebday" "hebmon" "hebyear" "hour" "iif" "index" "isany" "isdst"
|
||||
"isleap" "isomitted" "language" "lower" "max" "min" "minsfromutc"
|
||||
"minute" "mon" "monnum" "moondate" "moondatetime" "moonphase"
|
||||
"moontime" "ndawn" "ndusk" "nonomitted" "now" "ord" "ostype" "pad" "plural"
|
||||
"psmoon" "psshade" "realcurrent" "realnow" "realtoday" "sgn" "shell"
|
||||
"shellescape" "slide" "strlen" "substr" "sunrise" "sunset" "time"
|
||||
"timepart" "today" "trig" "trigback" "trigdate" "trigdatetime"
|
||||
"trigdelta" "trigduration" "trigeventduration" "trigeventstart"
|
||||
"trigfrom" "trigger" "trigpriority" "trigrep" "trigscanfrom"
|
||||
"trigtime" "trigtimedelta" "trigtimerep" "triguntil" "trigvalid"
|
||||
"typeof" "tzconvert" "upper" "value" "version" "weekno" "wkday"
|
||||
"wkdaynum" "year")
|
||||
#'(lambda (a b) (> (length a) (length b)))))
|
||||
|
||||
;;; faces
|
||||
@@ -244,12 +264,35 @@
|
||||
:group 'remind-conf
|
||||
)
|
||||
|
||||
(defconst remind-keywords-regex (regexp-opt remind-keywords 'words))
|
||||
(defconst remind-type-keywords-regex (regexp-opt remind-type-keywords 'words))
|
||||
(defconst remind-builtin-variables-regex (regexp-opt remind-builtin-variables 'words))
|
||||
(defconst remind-builtin-functions-regex (regexp-opt remind-builtin-functions 'words))
|
||||
(defconst remind-time-words-regex (regexp-opt remind-time-words 'words))
|
||||
|
||||
;; Case-insensitive matching functions
|
||||
(defun remind-keywords-matcher (limit)
|
||||
(let ((case-fold-search t))
|
||||
(re-search-forward remind-keywords-regex limit 'no-error)))
|
||||
(defun remind-type-keywords-matcher (limit)
|
||||
(let ((case-fold-search t))
|
||||
(re-search-forward remind-type-keywords-regex limit 'no-error)))
|
||||
(defun remind-builtin-variables-matcher (limit)
|
||||
(let ((case-fold-search t))
|
||||
(re-search-forward remind-builtin-variables-regex limit 'no-error)))
|
||||
(defun remind-builtin-functions-matcher (limit)
|
||||
(let ((case-fold-search t))
|
||||
(re-search-forward remind-builtin-functions-regex limit 'no-error)))
|
||||
(defun remind-time-words-matcher (limit)
|
||||
(let ((case-fold-search t))
|
||||
(re-search-forward remind-time-words-regex limit 'no-error)))
|
||||
|
||||
;; keywords
|
||||
|
||||
(defconst remind-conf-font-lock-keywords-1
|
||||
(list
|
||||
'("^[\;\#]\\s-+.*$" . remind-comment-face)
|
||||
(cons (regexp-opt remind-keywords 'words) remind-conf-keyword-face)
|
||||
'(remind-keywords-matcher . remind-conf-keyword-face)
|
||||
'("%[\"_]" . font-lock-warning-face)
|
||||
'("\\(%[a-mops-w]\\)" . remind-conf-substitutes-face)
|
||||
'("\"[^\"]*\"" . remind-string-face))
|
||||
@@ -258,15 +301,15 @@
|
||||
(defconst remind-conf-font-lock-keywords-2
|
||||
(append remind-conf-font-lock-keywords-1
|
||||
(list
|
||||
(cons (regexp-opt remind-time-words 'words) remind-time-face)
|
||||
(cons (regexp-opt remind-builtin-functions 'words) remind-conf-command-face)
|
||||
'(remind-time-words-matcher . remind-time-face)
|
||||
'(remind-builtin-functions-matcher . remind-conf-command-face)
|
||||
'("%$" . remind-conf-endline-face)))
|
||||
"Additional commands to highlight in `remind-conf-mode'.")
|
||||
|
||||
(defconst remind-conf-font-lock-keywords-3
|
||||
(append remind-conf-font-lock-keywords-2
|
||||
(list
|
||||
(cons (regexp-opt remind-type-keywords 'words) remind-conf-type-face)
|
||||
'(remind-type-keywords-matcher . remind-conf-type-face)
|
||||
'("\[[a-zA-Z]\\{3,6\\}\]" . remind-conf-color-face)
|
||||
'("\\s-+\\([12][0-9]\\|3[01]\\|0?[0-9]\\)\\s-+" . remind-conf-substitutes-face);better date regexp
|
||||
'("\\s-+\\([12][09][0-9][0-9][-/]\\(0[1-9]\\|1[0-2]\\)[-/]\\([12][0-9]\\|0[1-9]\\|3[01]\\)\\)\\s-+" . remind-time-face) ;; pseudo ISO 8601 date format.
|
||||
@@ -274,7 +317,7 @@
|
||||
'("\\s-+\\(\\(?:20\\|19\\)[0-9][0-9]\\)\\s-+" . remind-conf-substitutes-face);years
|
||||
'("\\s-+\\(2[0-4]\\|[01]?[0-9][.:][0-5][0-9]\\)\\s-+" . remind-conf-substitutes-face);24hour clock, more precise
|
||||
'("\\s-+\\([+-][+-]?[1-9][0-9]*\\)\\s-+" 1 remind-conf-delta-face prepend)
|
||||
(cons (regexp-opt remind-builtin-variables 'words) remind-conf-variable-face)))
|
||||
'(remind-builtin-variables-matcher . remind-conf-variable-face)))
|
||||
"The ultimate in highlighting experiences for `remind-conf-mode'.")
|
||||
|
||||
;;YYYY-MM-DD@hh:mm, YYYY-MM-DD@hh.mm, YYYY/MM/DD@hh:mm and YYYY/MM/DD@hh.mm
|
||||
@@ -462,12 +505,11 @@ Acts on the region or places point where it needs to be."
|
||||
;; finally the derived mode.
|
||||
|
||||
;;;###autoload
|
||||
(define-derived-mode remind-conf-mode text-mode "REM"
|
||||
(define-derived-mode remind-conf-mode text-mode "Remind Conf Mode"
|
||||
"Major mode for editing remind calendar configuration files.
|
||||
|
||||
\\{remind-conf-mode-map}"
|
||||
:syntax-table remind-conf-syntax-table
|
||||
(set (make-local-variable 'font-lock-keywords-case-fold-search) t) ;this is not working atm 2009-04-13
|
||||
(set (make-local-variable 'font-lock-defaults) '(remind-conf-font-lock-keywords))
|
||||
(set (make-local-variable 'comment-start) ";")
|
||||
(set (make-local-variable 'comment-start) "#")
|
||||
|
||||
193
docs/WHATSNEW
193
docs/WHATSNEW
@@ -1,6 +1,164 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* VERSION 3.4 Patch 0 - 2022-??-??
|
||||
* VERSION 4.0 Patch 1 - 2022-06-03
|
||||
|
||||
- IMPROVEMENT: Add $SuppressLRM system variable to suppress the UTF-8
|
||||
Left-to-Right mark in "remind -c" output.
|
||||
|
||||
- DOCUMENTATION FIX: Document the "q" sub-option to the "-p" option.
|
||||
|
||||
* VERSION 4.0 Patch 0 - 2022-04-04
|
||||
|
||||
- MAJOR NEW FEATURE: remind: Remind output can effectively be
|
||||
translated into other languages at run-time. A number of system
|
||||
variables let you translate English words to another language, and a
|
||||
mechanism for altering the substitution filter at run-time lets you
|
||||
translate its output so the results are idiomatic. See the man page
|
||||
sections "RUN-TIME SUPPORT FOR OTHER LANGUAGES", "RUN-TIME
|
||||
MODIFICATION OF THE SUBSTITUTION FILTER" and "LANGUAGE PACKS".
|
||||
|
||||
- NEW FEATURE: remind: Add the pad() built-in function
|
||||
|
||||
- NEW FEATURE: tkremind: Day numbers can be displayed left-aligned,
|
||||
centered or right-aligned.
|
||||
|
||||
- IMPROVEMENT: contrib/remind-conf-mode: The Emacs syntax-highlighter
|
||||
has been updated with the latest system variables and functions
|
||||
and has been made case-insensitive.
|
||||
|
||||
- IMPROVEMENT: remind, rem2ps: Use link-time optimization with gcc if
|
||||
possible.
|
||||
|
||||
- IMPROVEMENT: remind: Print better diagnostics when errors occur inside
|
||||
a user-defined function. We now show the stack trace to make it easier
|
||||
to figure out where the error actually is.
|
||||
|
||||
- CHANGE: Add a "q" sub-option to the "-p", "-pp", and "-ppp" options.
|
||||
This causes Remind *not* to remove the %"...%" marker sequence from
|
||||
remind bodies.
|
||||
|
||||
- BUG FIX: rem2pdf: Make rem2pdf respect the --prefix ./configure flag.
|
||||
Loosely based on patch by Jonathan Kamens.
|
||||
|
||||
- BUG FIX: tkremind: Fix the "-m" flag, which was broken in 03.04.00.
|
||||
|
||||
- BUG FIX: Fix the overflow-detection functions so they work with link-time
|
||||
optimization. The previous versions would be optimized away.
|
||||
|
||||
- BUG FIX: Warn if the arguments to the "-@" option are out of range.
|
||||
Problem noted by Ian! D. Allen.
|
||||
|
||||
- BUG FIX: Always interpret $Latitude and $Longitude input values in the
|
||||
"C" locale. (We do accept localized input, but warn.)
|
||||
|
||||
- BUG FIX: Fix many spelling mistakes caught by Jens Schleusener
|
||||
|
||||
* VERSION 3.4 Patch 2 - 2022-03-14
|
||||
|
||||
- NEW FEATURE: remind: Add syntactic sugar to simplify some common
|
||||
types of reminders. See "SYNTACTIC SUGAR FOR REM" in the remind
|
||||
man page. Based on suggestions from Ian! D. Allen.
|
||||
|
||||
- CHANGE: examples/defs.rem: The examples file has been updated to use
|
||||
the newer syntactic sugar.
|
||||
|
||||
- CHANGE: remind: Always parse the body of REM statements to catch
|
||||
expression errors. In the past, something like:
|
||||
|
||||
REM 2025-01-02 MSG [1/0]
|
||||
|
||||
would not cause a division-by-zero error except on 2025-01-02. Now,
|
||||
the error is always caught. NOTE POTENTIAL INCOMPATIBILITY: There may
|
||||
be edge-cases when formerly-valid remind scripts now trigger errors.
|
||||
However, this is pretty unlikely.
|
||||
|
||||
- NEW FEATURE: remind: Add the "trig" function to allow more
|
||||
expressiveness when creating triggers. See man page for details.
|
||||
|
||||
- IMPROVEMENT: tkremind: Tweak the calendar display; improve ability to
|
||||
customize colors, including supplying two built-in themes. Based on
|
||||
patch and suggestion from Paulo (last name unknown).
|
||||
|
||||
- IMPROVEMENT: tkremind: TkRemind handles errors in reminders scripts
|
||||
much more unobtrusively. Instead of popping up a modal dialog box
|
||||
with almost-unreadable error output, it discreetly notifies you of
|
||||
errors with a button that lets you view the specific error messages
|
||||
in a more readable format.
|
||||
|
||||
- IMPROVEMENT: examples/remind.vim: Update list of keywords in vim syntax
|
||||
highlighting file.
|
||||
|
||||
- IMPROVEMENT: contrib/remind-conf-mode: Update the list of keywords,
|
||||
functions and variables in the Emacs syntax-highlighting file. Also make
|
||||
it match them case-insensitively.
|
||||
|
||||
- CHANGE: remind: Increase $MaxSatIter default to 1000 instead of 150.
|
||||
Computers are much faster than when I first wrote remind and they
|
||||
can handle this higher limit easily. The higher limit also enables
|
||||
certain reasonable reminders that failed in the past because of the
|
||||
low SATISFY iteration limit.
|
||||
|
||||
- CHANGE: remind: The "||" operator now returns the value of the first
|
||||
non-zero operand rather than just returning 1 or 0. Similarly, "&&"
|
||||
returns 0 if either operand is false or the value of the last
|
||||
operand if both operands are true.
|
||||
|
||||
NOTE POTENTIAL INCOMPATIBILITY: Remind scripts that depend on ||
|
||||
and && always returning exactly one of 1 or 0 may need
|
||||
adjustment.
|
||||
|
||||
- CHANGE: The || and && operators can accept any non-STRING type as long
|
||||
as both operands have the same type. The "false" values are defined
|
||||
as follows; true values are any other value:
|
||||
|
||||
INT: 0
|
||||
TIME: 00:00
|
||||
DATE: '1990-01-01' (the Remind epoch)
|
||||
DATETIME: '1990-01-01@00:00' (the Remind epoch)
|
||||
|
||||
- IMPROVEMENT: remind: Issue diagnostics if an UNTIL or THROUGH date
|
||||
is earlier than any possible trigger date, as well as an UNTIL date
|
||||
with a fully-specified date and no repeat ("*N"). Suggestion from
|
||||
Ian! D. Allen.
|
||||
|
||||
- BUG FIX: tkremind: If the same moon phase appeared twice in a month,
|
||||
TkRemind would not display the first occurrence correctly. This has
|
||||
been fixed.
|
||||
|
||||
- BUG FIX: rem2pdf: Fix typos in the man page.
|
||||
|
||||
- BUG FIX: remind: The IF command documentation didn't reflect how it
|
||||
actually worked; now it does.
|
||||
|
||||
- BUG FIX: remind: Use correct UNTIL/THROUGH keyword in error message.
|
||||
|
||||
- BUG FIX: rem2pdf: Correct the calculation that warns about an over-full
|
||||
calendar box. Problem noted by Jonathan Kamens.
|
||||
|
||||
- BUG FIX: remind: The "remind -c" output would sometimes be incorrect if
|
||||
scripts with double-wide characters were used. This has been fixed.
|
||||
|
||||
- BUG FIX: remind: The "remind -c" output would sometimes be incorrect
|
||||
if right-to-left scripts were used in reminders. This has been fixed.
|
||||
|
||||
* VERSION 3.4 Patch 1 - 2022-02-23
|
||||
|
||||
- MINOR IMPROVEMENT: Support the INSTALL_BASE environment variable for
|
||||
installing rem2pdf in a non-standard location like your home directory.
|
||||
This is passed in to rem2pdf's Makefile at build and install time.
|
||||
|
||||
- MINOR IMPROVEMENT: ./configure: Add --disable-perl-build-artifacts flag
|
||||
to avoid installation of perllocal.pod and .packlist files.
|
||||
|
||||
- BUG FIX: tkremind: If the system date rolls over, update the display
|
||||
to correctly highlight the current date. This worked in older versions
|
||||
of Remind, but was broken by 03.04.00.
|
||||
|
||||
- BUG FIX: rem2pdf: The small calendar font would sometimes be scaled
|
||||
incorrectly so the small calendar overflowed the box. This has been
|
||||
fixed.
|
||||
|
||||
* VERSION 3.4 Patch 0 - 2022-02-10
|
||||
|
||||
- MAJOR CHANGE: Remind and its helpers (except for rem2ps) fully support
|
||||
UTF-8. If your system locale is a UTF-8 locale and your terminal
|
||||
@@ -11,7 +169,13 @@ CHANGES TO REMIND
|
||||
type that lets you format the text in the PDF calendar (by changing the
|
||||
font size, color, underlining, etc.)
|
||||
|
||||
rem2pdf requires the Pango and Cairo Perl modules.
|
||||
rem2pdf requires the Pango and Cairo Perl modules. On Debian or
|
||||
Debian-derived systems, these may be installed with:
|
||||
|
||||
apt install libpango-perl libcairo-perl
|
||||
|
||||
Unlike rem2ps, the default font in rem2pdf is "Sans" rather than
|
||||
"Helvetica", as Sans seems to be typeset better by the Pango library.
|
||||
|
||||
- NEW FEATURE: remind: New system variables $Sunday through $Saturday
|
||||
and $January through $December let you set weekday and month names
|
||||
@@ -22,9 +186,34 @@ CHANGES TO REMIND
|
||||
- NEW FEATURE: tkremind: If rem2pdf installed, TkRemind offers you the
|
||||
choice of PDF or PostScript output in the Print dialog.
|
||||
|
||||
- CHANGE: remind: Increase the number of allowed "full OMITs" from 500
|
||||
to 1000.
|
||||
|
||||
- CHANGE: Remove the annoying code that slowed compilation and running
|
||||
on Windows and Mac OS X. I believe the point has been made and free
|
||||
OSes have enough of a critical mass that the annoyances are
|
||||
counter-productive.
|
||||
|
||||
- CLEANUP: remind: C source code: Replace the LAT_DEG, LAT_MIN,
|
||||
LAT_SEC and LON_DEG, LON_MIN, LON_SEC macros with DEFAULT_LATITUDE
|
||||
and DEFAULT_LONGITUDE.
|
||||
|
||||
- CLEANUP: remind: C source code: Remove various unused or obsolete macros.
|
||||
|
||||
- BUG FIXES: Minor fixups to groff source and Makefiles courtesy of
|
||||
Jochen Sprickerhof.
|
||||
|
||||
- BUG FIX: Properly support formatting of double-wide characters in the
|
||||
terminal mode "remind -c" calendar.
|
||||
|
||||
- BUG FIX: rem2html: Document how to highlight today with a red border
|
||||
|
||||
- BUG FIX: rem2html: Generate and install a man page for rem2html
|
||||
|
||||
- BUG FIX: remind: Get rid of LAT_DEG/LAT_MIN/LAT_SEC and
|
||||
LON_DEG/LON_MIN/LON_SEC macros in favour of DEFAULT_LATITUDE and
|
||||
DEFAULT_LONGITUDE.
|
||||
|
||||
- IMPROVEMENT: All localized languages now use UTF-8 exclusively.
|
||||
Support for old character encodings like ISO-8859-1 and ISO-8859-2
|
||||
has been dropped since modern UNIXes have pretty much standardized
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
# "#PSSTUFF" for nifty PostScript examples #
|
||||
# #
|
||||
# This file is part of REMIND. #
|
||||
# Copyright (C) 1992-2018 Dianne Skoll #
|
||||
# Copyright (C) 1992-2022 Dianne Skoll #
|
||||
# #
|
||||
#############################################################################
|
||||
|
||||
@@ -25,67 +25,18 @@ RUN OFF
|
||||
################################################
|
||||
# Ensure required version of remind is used... #
|
||||
################################################
|
||||
IF version() < "03.01.10"
|
||||
IF version() < "03.04.02"
|
||||
ERRMSG This file requires at least version 03.01.10 of Remind.%
|
||||
ERRMSG This version is version [version()].
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
######################################
|
||||
# Symbolic constants for weekdays... #
|
||||
######################################
|
||||
SET Sunday 0
|
||||
SET Monday 1
|
||||
SET Tuesday 2
|
||||
SET Wednesday 3
|
||||
SET Thursday 4
|
||||
SET Friday 5
|
||||
SET Saturday 6
|
||||
|
||||
SET Sun 0
|
||||
SET Mon 1
|
||||
SET Tue 2
|
||||
SET Wed 3
|
||||
SET Thu 4
|
||||
SET Fri 5
|
||||
SET Sat 6
|
||||
|
||||
#########################################
|
||||
# Symbolic constants for month names... #
|
||||
#########################################
|
||||
|
||||
SET Jan 1
|
||||
SET Feb 2
|
||||
SET Mar 3
|
||||
SET Apr 4
|
||||
SET May 5
|
||||
SET Jun 6
|
||||
SET Jul 7
|
||||
SET Aug 8
|
||||
SET Sep 9
|
||||
SET Oct 10
|
||||
SET Nov 11
|
||||
SET Dec 12
|
||||
|
||||
SET January 1
|
||||
SET February 2
|
||||
SET March 3
|
||||
SET April 4
|
||||
SET May 5
|
||||
SET June 6
|
||||
SET July 7
|
||||
SET August 8
|
||||
SET September 9
|
||||
SET October 10
|
||||
SET November 11
|
||||
SET December 12
|
||||
|
||||
###########################################################
|
||||
# Other symbolic constants and functions for "pasting"... #
|
||||
# Symbolic constants and functions for "pasting"... #
|
||||
###########################################################
|
||||
SET Quote CHAR(34)
|
||||
|
||||
# Handy constants/function for specifing week of month...
|
||||
# Handy constants/function for specifying week of month...
|
||||
SET Week_1 1
|
||||
SET Week_2 8
|
||||
SET Week_3 15
|
||||
@@ -119,50 +70,23 @@ REM 1 MSG John's [_mo_num(11, 1984)] 'monthly' anniversary
|
||||
# Here's a tricky problem: The 4th of July is a holiday in the U.S.
|
||||
# However, if it falls on a Saturday, the previous Friday is a holiday.
|
||||
# If it falls on a Sunday, the next Monday is a holiday. Here's how
|
||||
# to do it. NOTE that the following procedure makes the OMIT context
|
||||
# dependent upon the current date. SInce it only depends on the current
|
||||
# year, which is not likely to change while producing a calendar, we
|
||||
# are fairly safe. However, reminders with huge DELTA or BACK components
|
||||
# may not operate as expected. In general, any time you make OMIT
|
||||
# dependent upon the current date, it's tricky and results may not be
|
||||
# what you expect. You should try to make sure that the OMIT context
|
||||
# "near" any current reminders will not change during a calendar run.
|
||||
# The SCANFROM clause will make these OMITs safe.
|
||||
# to do it.
|
||||
#
|
||||
# For those reminders that update the OMIT context with ADDOMIT, we use
|
||||
# SCANFROM -7 for safety; see the man page about moveable OMITs.
|
||||
############################################################################
|
||||
|
||||
# Calculate the weekday of the holiday.
|
||||
REM 4 July SCANFROM -7 SATISFY 1
|
||||
# If it falls on a Saturday, bump to previous Friday
|
||||
REM 4 July OMIT SAT SCANFROM -1 BEFORE ADDOMIT SATISFY [$Td != 4] MSG Independence day (observed)
|
||||
|
||||
SET iday $T
|
||||
IF WKDAYNUM(iday) == Sat
|
||||
REM [iday] MSG Independence day (actual)
|
||||
OMIT [iday-1] MSG Independence day (observed)
|
||||
ELSE
|
||||
IF WKDAYNUM(iday) == Sun
|
||||
REM [iday] MSG Independence day (actual)
|
||||
OMIT [iday+1] MSG Independence day (observed)
|
||||
ELSE
|
||||
OMIT [iday] MSG Independence day
|
||||
ENDIF
|
||||
ENDIF
|
||||
# If it falls on a Sunday, bump to following Monday
|
||||
REM 4 July OMIT SUN SCANFROM -7 AFTER ADDOMIT SATISFY [$Td != 4] MSG Independence day (observed)
|
||||
|
||||
############################################################################
|
||||
# A meeting on the first Monday of every month which is moved to the #
|
||||
# second Monday in the event of a holiday. #
|
||||
############################################################################
|
||||
# If it falls on Sat or Sun, note the actual day
|
||||
REM 4 July SATISFY [$Tw == 0 || $Tw == 6] MSG Independence day (actual)
|
||||
|
||||
# First, the normal meeting. However, the SKIP keyword means this
|
||||
# one won't be triggered if the first Monday is a holiday
|
||||
REM Mon 1 SKIP MSG Meeting
|
||||
|
||||
# Now, calculate the "potential" delayed meeting
|
||||
REM Mon 8 SATISFY 1
|
||||
|
||||
# But only actually trigger the delayed meeting if the previous
|
||||
# Monday was a holiday
|
||||
IF ISOMITTED($T-7)
|
||||
REM [$T] MSG Delayed meeting
|
||||
ENDIF
|
||||
# Otherwise observed and actual is on the 4th
|
||||
REM 4 July OMIT SAT SUN SKIP SCANFROM -7 ADDOMIT MSG Independence Day
|
||||
|
||||
##########################################################################
|
||||
# #
|
||||
@@ -216,38 +140,38 @@ REM [easter+49] MSG %"Pentecost%"
|
||||
# which ones are omitted - use the general forms shown below. You'll
|
||||
# need the Week_n variables defined way up in the file.
|
||||
|
||||
OMIT Jan 1 MSG %"New Year's%" Day
|
||||
REM Mon Jan [Week_3] MSG Martin Luther King - %"MLK Day%"
|
||||
OMIT Jan 1 MSG %"New Year's Day%"
|
||||
REM Third Monday in Jan MSG Martin Luther King - %"MLK Day%"
|
||||
REM Feb 2 MSG %"Ground Hog Day%"
|
||||
REM Feb 14 MSG %"Valentine's%" Day
|
||||
REM Mon Feb [Week_3] SCANFROM -7 ADDOMIT MSG %"President's Day%"
|
||||
REM Mar 17 MSG %"St. Patrick's%" Day
|
||||
REM Feb 14 MSG %"Valentine's Day%"
|
||||
REM Third Monday in Feb SCANFROM -7 ADDOMIT MSG %"President's Day%"
|
||||
REM Mar 17 MSG %"St. Patrick's Day%"
|
||||
|
||||
# The DST rules are accurate for most locations in
|
||||
# North America
|
||||
REM Sun Apr 1 ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
|
||||
REM Sun Mar 8 ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
|
||||
|
||||
REM Sun [_last(Oct)] ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
|
||||
REM Sun 1 Nov ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
|
||||
REM Last Sunday in October ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
|
||||
REM First Sunday in November ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %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%"
|
||||
REM Sat May [Week_1] MSG %"Kentucky Derby%"
|
||||
REM Sun May [Week_2] MSG %"Mother's Day%"
|
||||
REM Sat May [Week_3] MSG %"Armed Forces Day%"
|
||||
REM Mon [_last(May)] SCANFROM -7 ADDOMIT MSG %"Memorial Day%"
|
||||
REM First Sat in May MSG %"Kentucky Derby%"
|
||||
REM Second Sun in May MSG %"Mother's Day%"
|
||||
REM Third Sat in May MSG %"Armed Forces Day%"
|
||||
REM Last Monday in May SCANFROM -7 ADDOMIT MSG %"Memorial Day%"
|
||||
REM Jun 14 MSG %"Flag Day%"
|
||||
REM Sun Jun [Week_3] MSG %"Father's Day%"
|
||||
REM Mon Sep [Week_1] SCANFROM -7 ADDOMIT MSG %"Labor Day%"
|
||||
REM Mon Oct [Week_2] MSG %"Columbus Day%"
|
||||
REM Third Sun in June MSG %"Father's Day%"
|
||||
REM First Mon in Sep SCANFROM -7 ADDOMIT MSG %"Labor Day%"
|
||||
REM Second Mon in Oct MSG %"Columbus Day%"
|
||||
REM Nov 11 MSG %"Veterans Day%"
|
||||
|
||||
REM Oct 30 MSG %"Mischief Night%"
|
||||
REM Oct 31 MSG %"Halloween%"
|
||||
REM Tue Nov 2 SCANFROM -7 SATISFY [($Ty % 4) == 0] MSG %"Election Day%"
|
||||
REM Thu Nov [Week_4] SCANFROM -7 ADDOMIT MSG %"Thanksgiving Day%"
|
||||
REM Last Thu in Nov SCANFROM -7 ADDOMIT MSG %"Thanksgiving Day%"
|
||||
REM Fri Nov [Week_4+1] SCANFROM -7 ADDOMIT MSG %"Thanksgiving (cont.)%"
|
||||
OMIT Dec 24 MSG %"Christmas Eve%"
|
||||
OMIT Dec 25 MSG %"Christmas%" Day
|
||||
@@ -262,6 +186,24 @@ if $NumTrig > SaveTrig
|
||||
REM SPECIAL SHADE 220
|
||||
endif
|
||||
|
||||
############################################################################
|
||||
# A meeting on the first Monday of every month which is moved to the #
|
||||
# second Monday in the event of a holiday. #
|
||||
############################################################################
|
||||
|
||||
# First, the normal meeting. However, the SKIP keyword means this
|
||||
# one won't be triggered if the first Monday is a holiday
|
||||
REM First Monday SKIP MSG Meeting
|
||||
|
||||
# Now, calculate the "potential" delayed meeting
|
||||
REM Second Monday SATISFY 1
|
||||
|
||||
# But only actually trigger the delayed meeting if the previous
|
||||
# Monday was a holiday
|
||||
IF ISOMITTED($T-7)
|
||||
REM [$T] MSG Delayed meeting
|
||||
ENDIF
|
||||
|
||||
#PSSTUFF2
|
||||
##########################################################################
|
||||
# #
|
||||
@@ -278,10 +220,10 @@ REM PS Border Border moveto \
|
||||
([hebday($U)] [hebmon($U)]) show
|
||||
|
||||
# Fill in the phases of the moon on the PostScript calendar
|
||||
[moondate(0)] SPECIAL MOON 0
|
||||
[moondate(1)] SPECIAL MOON 1
|
||||
[moondate(2)] SPECIAL MOON 2
|
||||
[moondate(3)] SPECIAL MOON 3
|
||||
REM [moondate(0)] SPECIAL MOON 0
|
||||
REM [moondate(1)] SPECIAL MOON 1
|
||||
REM [moondate(2)] SPECIAL MOON 2
|
||||
REM [moondate(3)] SPECIAL MOON 3
|
||||
|
||||
# The following example puts sunrise and sunset times in PostScript in the
|
||||
# calendar - the sizes are hard-coded, however, and work best in landscape.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: Remind
|
||||
" Maintainer: Davide Alberani <alberanid@libero.it>
|
||||
" Last Change: 18 Sep 2009
|
||||
" Version: 0.5
|
||||
" URL: http://erlug.linux.it/~da/vim/syntax/remind.vim
|
||||
" Maintainer: Davide Alberani <da@erlug.linux.it>
|
||||
" Last Change: 02 Nov 2015 + 13 Mar 2022 by Dianne Skoll <dianne@skoll.ca>
|
||||
" Version: 0.7+dianne1
|
||||
" URL: http://ismito.it/vim/syntax/remind.vim
|
||||
"
|
||||
" remind is a sophisticated reminder service
|
||||
" you can download remind from:
|
||||
@@ -23,7 +23,7 @@ syn keyword remindExpiry UNTIL FROM SCANFROM SCAN WARN SCHED THROUGH
|
||||
syn keyword remindTag PRIORITY TAG
|
||||
syn keyword remindTimed AT DURATION
|
||||
syn keyword remindMove ONCE SKIP BEFORE AFTER
|
||||
syn keyword remindSpecial INCLUDE INC BANNER PUSH-OMIT-CONTEXT PUSH CLEAR-OMIT-CONTEXT CLEAR POP-OMIT-CONTEXT POP COLOR COLOUR
|
||||
syn keyword remindSpecial INCLUDE INC BANNER PUSH-OMIT-CONTEXT PUSH CLEAR-OMIT-CONTEXT CLEAR POP-OMIT-CONTEXT POP COLOR COLOUR DO
|
||||
syn keyword remindRun MSG MSF RUN CAL SATISFY SPECIAL PS PSFILE SHADE MOON
|
||||
syn keyword remindConditional IF ELSE ENDIF IFTRIG
|
||||
syn keyword remindDebug DEBUG DUMPVARS DUMP ERRMSG FLUSH PRESERVE
|
||||
|
||||
29
include/holidays/ca.rem
Normal file
29
include/holidays/ca.rem
Normal file
@@ -0,0 +1,29 @@
|
||||
# Canadian holidays
|
||||
|
||||
OMIT 1 Jan MSG New Year's Day
|
||||
|
||||
# This varies by province
|
||||
REM Third Monday in Feb SCANFROM -7 ADDOMIT MSG Family Day
|
||||
|
||||
# This varies by province
|
||||
OMIT [easterdate($Uy) - 2] MSG Good Friday
|
||||
|
||||
# This varies by province
|
||||
OMIT [easterdate($Uy) + 1] MSG Easter Monday
|
||||
|
||||
REM Mon 18 May SCANFROM -7 ADDOMIT MSG Victoria Day
|
||||
OMIT 1 July MSG Canada Day
|
||||
|
||||
# This varies by province
|
||||
REM First Monday in Aug SCANFROM -7 ADDOMIT MSG Civic Holiday
|
||||
|
||||
REM First Monday in Sep SCANFROM -7 ADDOMIT MSG Labour Day
|
||||
|
||||
REM Second Monday in Oct SCANFROM -7 ADDOMIT MSG Thanksgiving Day
|
||||
|
||||
REM 11 November MSG Remembrance Day
|
||||
|
||||
OMIT 25 Dec MSG Christmas
|
||||
|
||||
OMIT 26 Dec MSG Boxing Day
|
||||
|
||||
49
include/holidays/us.rem
Normal file
49
include/holidays/us.rem
Normal file
@@ -0,0 +1,49 @@
|
||||
# US holidays
|
||||
# This file is part of REMIND.
|
||||
# Copyright (C) 1992-2022 Dianne Skoll
|
||||
|
||||
REM [easterdate($Uy)-46] MSG %"Ash Wednesday%"
|
||||
REM [easterdate($Uy)-7] MSG %"Palm Sunday%"
|
||||
OMIT [easterdate($Uy)-2] MSG %"Good Friday%"
|
||||
OMIT [easterdate($Uy)] MSG %"Easter%" Sunday
|
||||
REM [easterdate($Uy)+39] MSG %"Ascension Day%"
|
||||
REM [easterdate($Uy)+49] MSG %"Pentecost%"
|
||||
|
||||
# Some holidays are omitted, some are not. You may want to change
|
||||
# which ones are omitted.
|
||||
|
||||
OMIT Jan 1 MSG %"New Year's Day%"
|
||||
REM Third Monday in Jan MSG Martin Luther King - %"MLK Day%"
|
||||
REM Feb 2 MSG %"Ground Hog Day%"
|
||||
REM Feb 14 MSG %"Valentine's Day%"
|
||||
REM Third Monday in Feb SCANFROM -7 ADDOMIT MSG %"President's Day%"
|
||||
REM Mar 17 MSG %"St. Patrick's Day%"
|
||||
|
||||
# The DST rules are accurate for most locations in
|
||||
# North America
|
||||
REM Sun Apr 1 ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
|
||||
REM Sun Mar 8 ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
|
||||
|
||||
REM Last Sunday in October ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
|
||||
REM First Sunday in November ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %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%"
|
||||
REM First Sat in May MSG %"Kentucky Derby%"
|
||||
REM Second Sun in May MSG %"Mother's Day%"
|
||||
REM Third Sat in May MSG %"Armed Forces Day%"
|
||||
REM Last Monday in May SCANFROM -7 ADDOMIT MSG %"Memorial Day%"
|
||||
REM Jun 14 MSG %"Flag Day%"
|
||||
REM Third Sun in June MSG %"Father's Day%"
|
||||
REM First Mon in Sep SCANFROM -7 ADDOMIT MSG %"Labor Day%"
|
||||
REM Second Mon in Oct MSG %"Columbus Day%"
|
||||
REM Nov 11 MSG %"Veterans Day%"
|
||||
|
||||
REM Oct 30 MSG %"Mischief Night%"
|
||||
REM Oct 31 MSG %"Halloween%"
|
||||
REM Tue Nov 2 SCANFROM -7 SATISFY [($Ty % 4) == 0] MSG %"Election Day%"
|
||||
REM Last Thu in Nov SCANFROM -7 ADDOMIT MSG %"Thanksgiving Day%"
|
||||
REM Fri Nov [Week_4+1] SCANFROM -7 ADDOMIT MSG %"Thanksgiving (cont.)%"
|
||||
REM Dec 24 MSG %"Christmas Eve%"
|
||||
OMIT Dec 25 MSG %"Christmas%" Day
|
||||
19
include/lang/auto.rem
Normal file
19
include/lang/auto.rem
Normal file
@@ -0,0 +1,19 @@
|
||||
SET autolang getenv("LC_ALL")
|
||||
IF autolang == ""
|
||||
SET autolang getenv("LANGUAGE")
|
||||
ENDIF
|
||||
IF autolang == ""
|
||||
SET autolang getenv("LANG")
|
||||
ENDIF
|
||||
|
||||
IF autolang != ""
|
||||
IF access($SysInclude + "/lang/" + lower(substr(autolang, 1, 5)) + ".rem", "r") == 0
|
||||
INCLUDE [$SysInclude]/lang/[lower(substr(autolang, 1, 5))].rem
|
||||
ELSE
|
||||
IF access($SysInclude + "/lang/" + lower(substr(autolang, 1, 2)) + ".rem", "r") == 0
|
||||
INCLUDE [$SysInclude]/lang/[lower(substr(autolang, 1, 2))].rem
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
UNSET autolang
|
||||
69
include/lang/da.rem
Normal file
69
include/lang/da.rem
Normal file
@@ -0,0 +1,69 @@
|
||||
# Support for the Danish language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Mogens Lynnerup.
|
||||
|
||||
SET $Sunday "Søndag"
|
||||
SET $Monday "Mandag"
|
||||
SET $Tuesday "Tirsdag"
|
||||
SET $Wednesday "Onsdag"
|
||||
SET $Thursday "Torsdag"
|
||||
SET $Friday "Fredag"
|
||||
SET $Saturday "Lørdag"
|
||||
|
||||
SET $January "Januar"
|
||||
SET $February "Februar"
|
||||
SET $March "Marts"
|
||||
SET $April "April"
|
||||
SET $May "Maj"
|
||||
SET $June "Juni"
|
||||
SET $July "Juli"
|
||||
SET $August "August"
|
||||
SET $September "September"
|
||||
SET $October "Oktober"
|
||||
SET $November "November"
|
||||
SET $December "December"
|
||||
|
||||
SET $Today "i dag"
|
||||
SET $Tomorrow "i morgen"
|
||||
|
||||
BANNER Påmindelse for %w, %d. %m, %y%o:
|
||||
|
||||
SET $Am "am"
|
||||
SET $Pm "pm"
|
||||
|
||||
SET $Ago "siden"
|
||||
SET $Fromnow "fra nu"
|
||||
|
||||
SET $On "på"
|
||||
|
||||
SET $Now "nu"
|
||||
SET $At "kl."
|
||||
SET $Minute "minut"
|
||||
SET $Hour "time"
|
||||
SET $Is "er"
|
||||
SET $Was "var"
|
||||
SET $And "og"
|
||||
SET $Hplu "r"
|
||||
SET $Mplu "ter"
|
||||
|
||||
FSET subst_ampm(h) iif(h<5, " om natten", h < 12, " om formiddagen", h < 18, " om eftermiddagen", " om aftenen")
|
||||
FSET subst_ordinal(d) "."
|
||||
|
||||
FSET subst_p(alt, d, t) iif(d==today()+1, "", "e")
|
||||
FSET zeropad(s, len) pad(s, "0", len)
|
||||
FSET subst_a_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d) + " " + year(d)
|
||||
FSET subst_ax(alt, d, t) iif(alt, subst_a_alt(d), $On + " " + subst_a_alt(d))
|
||||
|
||||
FSET subst_bx(a, d, t) "om " + (d-today()) + " dage"
|
||||
|
||||
FSET subst_ex(alt, d, t) "den " + zeropad(day(d), 2) + $DateSep + zeropad(monnum(d), 2) + $DateSep + zeropad(year(d), 4)
|
||||
FSET subst_fx(alt, d, t) "den " + zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2) + $DateSep + zeropad(year(d), 4)
|
||||
|
||||
FSET subst_g_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d)
|
||||
FSET subst_gx(alt, d, t) iif(alt, subst_g_alt(d), $On + " " + subst_g_alt(d))
|
||||
|
||||
FSET subst_hx(alt, d, t) "den " + zeropad(day(d), 2) + $DateSep + zeropad(monnum(d), 2)
|
||||
FSET subst_ix(alt, d, t) "den " + zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2)
|
||||
FSET subst_ux(alt, d, t) subst_ax(alt, d, t)
|
||||
FSET subst_vx(alt, d, t) subst_gx(alt, d, t)
|
||||
63
include/lang/de.rem
Normal file
63
include/lang/de.rem
Normal file
@@ -0,0 +1,63 @@
|
||||
# Support for the German language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Wolfgang Thronicke
|
||||
|
||||
# Day names
|
||||
SET $Sunday "Sonntag"
|
||||
SET $Monday "Montag"
|
||||
SET $Tuesday "Dienstag"
|
||||
SET $Wednesday "Mittwoch"
|
||||
SET $Thursday "Donnerstag"
|
||||
SET $Friday "Freitag"
|
||||
SET $Saturday "Samstag"
|
||||
|
||||
# Month names
|
||||
SET $January "Januar"
|
||||
SET $February "Februar"
|
||||
SET $March "März"
|
||||
SET $April "April"
|
||||
SET $May "Mai"
|
||||
SET $June "Juni"
|
||||
SET $July "Juli"
|
||||
SET $August "August"
|
||||
SET $September "September"
|
||||
SET $October "Oktober"
|
||||
SET $November "November"
|
||||
SET $December "Dezember"
|
||||
|
||||
SET $Today "heute"
|
||||
SET $Tomorrow "morgen"
|
||||
|
||||
# Banner
|
||||
BANNER Termine für %w, den %d. %m %y%o:
|
||||
|
||||
SET $Am "am"
|
||||
SET $Pm "pm"
|
||||
SET $On "am"
|
||||
SET $Hplu "n"
|
||||
SET $Mplu "n"
|
||||
SET $Now "jetzt"
|
||||
SET $At "um"
|
||||
SET $Minute "Minute"
|
||||
SET $Hour "Stunde"
|
||||
SET $Is "ist"
|
||||
SET $Was "war"
|
||||
SET $And "und"
|
||||
SET $Ago "vorher"
|
||||
SET $Fromnow "von heute"
|
||||
|
||||
FSET subst_ampm(h) iif(h<5, " nachts", h<12, " vormittags", h<=17, " nachmittags", " abends")
|
||||
FSET subst_ordinal(d) "."
|
||||
|
||||
FSET subst_a_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d) + " " + year(d)
|
||||
FSET subst_ax(alt, d, t) iif(alt, subst_a_alt(d), $On + " " + subst_a_alt(d))
|
||||
|
||||
FSET subst_bx(a, d, t) "in " + (d-today()) + " Tagen"
|
||||
|
||||
FSET subst_g_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d)
|
||||
FSET subst_gx(alt, d, t) iif(alt, subst_g_alt(d), $On + " " + subst_g_alt(d))
|
||||
|
||||
FSET subst_ux(alt, d, t) subst_ax(alt, d, t)
|
||||
FSET subst_vx(alt, d, t) subst_gx(alt, d, t)
|
||||
FSET subst_p(alt, d, t) iif(d == today()+1, "", "en")
|
||||
4
include/lang/en.rem
Normal file
4
include/lang/en.rem
Normal file
@@ -0,0 +1,4 @@
|
||||
# Support for the English language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# Nothing to do for English since it is the default.
|
||||
48
include/lang/es.rem
Normal file
48
include/lang/es.rem
Normal file
@@ -0,0 +1,48 @@
|
||||
# Support for the Spanish language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Rafa Couto <rafacouto@biogate.com>
|
||||
|
||||
SET $Sunday "Domingo"
|
||||
SET $Monday "Lunes"
|
||||
SET $Tuesday "Martes"
|
||||
SET $Wednesday "Miércoles"
|
||||
SET $Thursday "Jueves"
|
||||
SET $Friday "Viernes"
|
||||
SET $Saturday "Sábado"
|
||||
|
||||
SET $January "Enero"
|
||||
SET $February "Febrero"
|
||||
SET $March "Marzo"
|
||||
SET $April "Abril"
|
||||
SET $May "Mayo"
|
||||
SET $June "Junio"
|
||||
SET $July "Julio"
|
||||
SET $August "Agosto"
|
||||
SET $September "Septiembre"
|
||||
SET $October "Octubre"
|
||||
SET $November "Noviembre"
|
||||
SET $December "Diciembre"
|
||||
|
||||
SET $Today "hoy"
|
||||
SET $Tomorrow "mañana"
|
||||
|
||||
BANNER Agenda para el %w, %d%s %m, %y%o:
|
||||
|
||||
SET $Am "am"
|
||||
SET $Pm "pm"
|
||||
|
||||
SET $Ago "hace"
|
||||
SET $Fromnow "desde hoy"
|
||||
SET $On "el día"
|
||||
SET $Now "ahora"
|
||||
SET $At "a las"
|
||||
SET $Minute "minuto"
|
||||
SET $Hour "hora"
|
||||
SET $Is "es"
|
||||
SET $Was "fue"
|
||||
SET $And "y"
|
||||
SET $Hplu "s"
|
||||
SET $Mplu "s"
|
||||
|
||||
FSET subst_bx(a, d, t) "dentro de " + (d-today()) + " días"
|
||||
94
include/lang/fi.rem
Normal file
94
include/lang/fi.rem
Normal file
@@ -0,0 +1,94 @@
|
||||
# Support for the Finnish language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Mikko Silvonen
|
||||
|
||||
SET $Sunday "sunnuntai"
|
||||
SET $Monday "maanantai"
|
||||
SET $Tuesday "tiistai"
|
||||
SET $Wednesday "keskiviikko"
|
||||
SET $Thursday "torstai"
|
||||
SET $Friday "perjantai"
|
||||
SET $Saturday "lauantai"
|
||||
|
||||
SET $January "tammikuu"
|
||||
SET $February "helmikuu"
|
||||
SET $March "maaliskuu"
|
||||
SET $April "huhtikuu"
|
||||
SET $May "toukokuu"
|
||||
SET $June "kesäkuu"
|
||||
SET $July "heinäkuu"
|
||||
SET $August "elokuu"
|
||||
SET $September "syyskuu"
|
||||
SET $October "lokakuu"
|
||||
SET $November "marraskuu"
|
||||
SET $December "joulukuu"
|
||||
|
||||
SET $Today "tänään"
|
||||
SET $Tomorrow "huomenna"
|
||||
|
||||
BANNER Viestit %wna %d. %mta %y%o:
|
||||
|
||||
SET $Am " ap."
|
||||
SET $Pm " ip."
|
||||
|
||||
SET $ago "sitten"
|
||||
SET $Fromnow "kuluttua"
|
||||
|
||||
SET $On "na"
|
||||
|
||||
SET $Now "nyt"
|
||||
SET $At "klo"
|
||||
SET $Minute "minuutti"
|
||||
SET $Hour "tunti"
|
||||
SET $Is "on"
|
||||
SET $Was "oli"
|
||||
SET $And "ja"
|
||||
SET $Hplu "a"
|
||||
SET $Mplu "a"
|
||||
|
||||
FSET zeropad(s, len) pad(s, "0", len)
|
||||
|
||||
FSET subst_ordinal(d) iif(d==1, ":senä", d==2, ":sena", (d%10)==2||(d%10)==3||(d%10)==6||(d%10)==8, ":ntena", ":ntenä")
|
||||
|
||||
FSET subst_a_alt(d, o, p) wkday(d) + o + " " + day(d) + ". " + mon(d) + p + " " + year(d)
|
||||
FSET subst_ax(a, d, t) iif(a, subst_a_alt(d, "", ""), subst_a_alt(d, $On, "ta"))
|
||||
|
||||
FSET subst_bx(a, d, t) (d-today()) + " päivän kuluttua"
|
||||
FSET subst_cx(a, d, t) iif(a, wkday(d), wkday(d) + $On)
|
||||
|
||||
FSET subst_ex(a, d, t) zeropad(day(d), 2) + $DateSep + zeropad(monnum(d), 2) + $DateSep + zeropad(year(d), 4)
|
||||
FSET subst_fx(a, d, t) zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2) + $DateSep + zeropad(year(d), 4)
|
||||
|
||||
FSET subst_g_alt(d, o, p) wkday(d) + o + " " + day(d) + ". " + mon(d) + p
|
||||
FSET subst_gx(a, d, t) iif(a, subst_g_alt(d, "", ""), subst_g_alt(d, $On, "ta"))
|
||||
|
||||
FSET subst_hx(a, d, t) zeropad(day(d), 2) + $DateSep + zeropad(monnum(d), 2)
|
||||
FSET subst_ix(a, d, t) zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2)
|
||||
|
||||
FSET subst_j_alt(d, o) wkday(d) + o + " " + mon(d) + "n " + day(d) + subst_ordinal(day(d)) + " " + year(d)
|
||||
FSET subst_jx(a, d, t) iif(a, subst_j_alt(d, ""), subst_j_alt(d, $On))
|
||||
|
||||
FSET subst_k_alt(d, o) wkday(d) + o + " " + mon(d) + "n " + day(d) + subst_ordinal(day(d))
|
||||
FSET subst_kx(a, d, t) iif(a, subst_k_alt(d, ""), subst_k_alt(d, $On))
|
||||
|
||||
FSET subst_lx(a, d, t) zeropad(year(d), 4) + $DateSep + zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2)
|
||||
FSET subst_p(a, d, t) iif(d==today()+1, "", "ä")
|
||||
FSET subst_qx(a, d, t) "n"
|
||||
|
||||
FSET subst_u_alt(d, o, p) wkday(d) + o + " " + day(d) + subst_ordinal(day(d)) + " " + mon(d) + p + " " + year(d)
|
||||
FSET subst_ux(a, d, t) iif(a, subst_u_alt(d, "", ""), subst_u_alt(d, $On, "ta"))
|
||||
|
||||
FSET subst_v_alt(d, o, p) wkday(d) + o + " " + day(d) + subst_ordinal(day(d)) + " " + mon(d) + p
|
||||
FSET subst_vx(a, d, t) iif(a, subst_v_alt(d, "", ""), subst_v_alt(d, $On, "ta"))
|
||||
|
||||
|
||||
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst1_past(now()-t), subst1_future(t-now()))
|
||||
|
||||
FSET subst1_past(mins) subst_hour_past(mins/60) + subst_min_past(mins%60) + $Ago
|
||||
FSET subst1_future(mins) subst_hour_future(mins/60) + subst_min_future(mins%60) + $Fromnow
|
||||
|
||||
FSET subst_hour_past(h) iif(h==0, "", h + " " + $Hour + iif(h==1, " ", $Hplu + " "))
|
||||
FSET subst_min_past(m) iif(m==0, "", m + " " + $Minute + iif(m==1, " ", $Mplu + " "))
|
||||
FSET subst_hour_future(h) iif(h==0, "", h + " tunnin ")
|
||||
FSET subst_min_future(m) iif(m==0, "", m + " minuutin ")
|
||||
62
include/lang/fr.rem
Normal file
62
include/lang/fr.rem
Normal file
@@ -0,0 +1,62 @@
|
||||
# Support for the French language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Laurent Duperval
|
||||
|
||||
SET $Sunday "dimanche"
|
||||
SET $Monday "lundi"
|
||||
SET $Tuesday "mardi"
|
||||
SET $Wednesday "mercredi"
|
||||
SET $Thursday "jeudi"
|
||||
SET $Friday "vendredi"
|
||||
SET $Saturday "samedi"
|
||||
|
||||
SET $January "janvier"
|
||||
SET $February "février"
|
||||
SET $March "mars"
|
||||
SET $April "avril"
|
||||
SET $May "mai"
|
||||
SET $June "juin"
|
||||
SET $July "juillet"
|
||||
SET $August "août"
|
||||
SET $September "septembre"
|
||||
SET $October "octobre"
|
||||
SET $November "novembre"
|
||||
SET $December "décembre"
|
||||
|
||||
SET $Today "aujourd'hui"
|
||||
SET $Tomorrow "demain"
|
||||
SET $On "le"
|
||||
SET $At "à"
|
||||
SET $Now "maintenant"
|
||||
SET $Minute "minute"
|
||||
SET $Hour "heure"
|
||||
SET $Is "est"
|
||||
SET $Was "était"
|
||||
SET $And "et"
|
||||
SET $Hplu "s"
|
||||
SET $Mplu "s"
|
||||
SET $Ago "il y a"
|
||||
SET $Fromnow "dans"
|
||||
|
||||
# Banner
|
||||
BANNER Rappels pour %w, %d%s %m, %y%o:
|
||||
|
||||
# Ordinal for a day (English would be "st", "nd", "rd", "th")
|
||||
FSET subst_ordinal(d) iif(d == 1, "er", "")
|
||||
|
||||
# "%d hours", "%d minutes", or "%d hours and %d minutes"
|
||||
FSET subst_tdiff(hdiff, mdiff) iif(hdiff==0&&mdiff==0, $Now, \
|
||||
hdiff==0, mdiff + plural(mdiff, " minute"), \
|
||||
mdiff==0, hdiff + plural(hdiff, " heure"), \
|
||||
hdiff + plural(hdiff, " heure") + " et " + mdiff + plural(mdiff, " minute"))
|
||||
FSET subst_1(alt, date, time) iif(time == now(), "maintenant", \
|
||||
time > now(), "dans " + subst_tdiff((time-now())/60, (time-now())%60), \
|
||||
"il y a " + subst_tdiff ((now()-time)/60, (now()-time)%60))
|
||||
|
||||
FSET subst_bx(alt, date, time) "dans " + (date-today()) + " jours"
|
||||
FSET subst_j_alt(date) wkday(date) + ", " + day(date) + subst_ordinal(day(date)) + " " + mon(date) + ", " + year(date)
|
||||
FSET subst_jx(alt, date, time) iif(alt, subst_j_alt(date), $On + " " + subst_j_alt(date))
|
||||
|
||||
FSET subst_k_alt(date) wkday(date) + ", " + day(date) + subst_ordinal(day(date)) + " " + mon(date)
|
||||
FSET subst_kx(alt, date, time) iif(alt, subst_k_alt(date), $On + " " + subst_k_alt(date))
|
||||
51
include/lang/is.rem
Normal file
51
include/lang/is.rem
Normal file
@@ -0,0 +1,51 @@
|
||||
# Support for the Icelanding language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Björn Davíðsson (bjossi@snerpa.is)
|
||||
|
||||
SET $Sunday "sunnudagur"
|
||||
SET $Monday "mánudagur"
|
||||
SET $Tuesday "þriðjudagur"
|
||||
SET $Wednesday "miðvikudagur"
|
||||
SET $Thursday "fimmtudagur"
|
||||
SET $Friday "föstudagur"
|
||||
SET $Saturday "laugardagur"
|
||||
|
||||
SET $January "janúar"
|
||||
SET $February "febrúar"
|
||||
SET $March "mars"
|
||||
SET $April "apríl"
|
||||
SET $May "maí"
|
||||
SET $June "júní"
|
||||
SET $July "júlí"
|
||||
SET $August "ágúst"
|
||||
SET $September "september"
|
||||
SET $October "október"
|
||||
SET $November "nóvember"
|
||||
SET $December "desember"
|
||||
|
||||
SET $Today "í dag"
|
||||
SET $Tomorrow "á morgun"
|
||||
|
||||
BANNER Minnisatriði: %w, %d%s %m, %y%o:
|
||||
|
||||
SET $Am "fh"
|
||||
SET $Pm "eh"
|
||||
|
||||
SET $Ago "síðan"
|
||||
SET $Fromnow "frá því nú"
|
||||
|
||||
SET $On "þann"
|
||||
|
||||
SET $Now "núna"
|
||||
SET $At "kl."
|
||||
SET $Minute "mínútu"
|
||||
SET $Hour "klukkustund"
|
||||
SET $Is "er"
|
||||
SET $Was "var"
|
||||
SET $And "og"
|
||||
SET $Hplu "ir"
|
||||
SET $Mplu "r"
|
||||
|
||||
FSET subst_bx(a, d, t) "eftir " + (d - today()) + " daga"
|
||||
fset subst_p(a, d, t) iif(d == today()+1, "", "a")
|
||||
67
include/lang/it.rem
Normal file
67
include/lang/it.rem
Normal file
@@ -0,0 +1,67 @@
|
||||
# Support for the Italian language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Valerio Aimale
|
||||
|
||||
SET $Sunday "Domenica"
|
||||
SET $Monday "Lunedí"
|
||||
SET $Tuesday "Martedí"
|
||||
SET $Wednesday "Mercoledí"
|
||||
SET $Thursday "Giovedí"
|
||||
SET $Friday "Venerdí"
|
||||
SET $Saturday "Sabato"
|
||||
|
||||
SET $January "Gennaio"
|
||||
SET $February "Febbraio"
|
||||
SET $March "Marzo"
|
||||
SET $April "Aprile"
|
||||
SET $May "Maggio"
|
||||
SET $June "Giugno"
|
||||
SET $July "Luglio"
|
||||
SET $August "Agosto"
|
||||
SET $September "Settembre"
|
||||
SET $October "Ottobre"
|
||||
SET $November "Novembre"
|
||||
SET $December "Dicembre"
|
||||
|
||||
SET $Today "oggi"
|
||||
SET $Tomorrow "domani"
|
||||
|
||||
BANNER Promemoria per %w, %d %m %y%o:
|
||||
|
||||
SET $Am "am"
|
||||
SET $Pm "pm"
|
||||
|
||||
SET $Ago "fa"
|
||||
SET $Fromnow "da oggi"
|
||||
|
||||
SET $On ""
|
||||
SET $Now "ora"
|
||||
SET $At "alle"
|
||||
SET $Minute "minuto"
|
||||
SET $Hour "ora"
|
||||
SET $Is "é"
|
||||
SET $Was "era"
|
||||
SET $And "e"
|
||||
SET $Hplu "a"
|
||||
SET $Mplu "i"
|
||||
|
||||
FSET subst_bx(a, d, t) "fra " + (d-today()) + " giorni"
|
||||
FSET subst_p(a, d, t) iif(d==today()+1, "o", "i")
|
||||
FSET subst_q(a, d, t) iif(d==today()+1, "a", "e")
|
||||
|
||||
FSET subst_ax(a, d, t) wkday(d) + ", " + day(d) + " " + mon(d) + " " + year(d)
|
||||
FSET subst_jx(a, d, t) subst_ax(a, d, t)
|
||||
FSET subst_kx(a, d, t) wkday(d) + ", " + day(d) + " " + mon(d)
|
||||
FSET subst_ux(a, d, t) subst_ax(a, d, t)
|
||||
FSET subst_vx(a, d, t) subst_kx(a, d, t)
|
||||
|
||||
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst_1a(now()-t, $Ago), subst_1a(t-now(), $Fromnow))
|
||||
FSET subst_1a(diff, when) subst_1b(diff/60, diff%60) + " " + when
|
||||
|
||||
FSET subst_1b(hdiff, mdiff) iif(hdiff==0, subst_minutes(mdiff), mdiff==0, subst_hours(hdiff), subst_hours(hdiff) + " " + $And + " " + subst_minutes(mdiff))
|
||||
FSET subst_minutes(m) iif(m==1, "1 minuto", m + " minuti")
|
||||
FSET subst_hours(h) iif(h==1, "1 ora", h + " ore")
|
||||
|
||||
FSET subst_0(a, d, t) iif(abs(now()-t)/60==1, "a", "e")
|
||||
FSET subst_9(a, d, t) iif(abs(now()-t)%60==1, "o", "i")
|
||||
56
include/lang/nl.rem
Normal file
56
include/lang/nl.rem
Normal file
@@ -0,0 +1,56 @@
|
||||
# Support for the Dutch language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Willem Kasdorp and Erik-Jan Vens
|
||||
|
||||
SET $Sunday "zondag"
|
||||
SET $Monday "maandag"
|
||||
SET $Tuesday "dinsdag"
|
||||
SET $Wednesday "woensdag"
|
||||
SET $Thursday "donderdag"
|
||||
SET $Friday "vrijdag"
|
||||
SET $Saturday "zaterdag"
|
||||
|
||||
SET $January "januari"
|
||||
SET $February "februari"
|
||||
SET $March "maart"
|
||||
SET $April "april"
|
||||
SET $May "mei"
|
||||
SET $June "juni"
|
||||
SET $July "juli"
|
||||
SET $August "augustus"
|
||||
SET $September "september"
|
||||
SET $October "oktober"
|
||||
SET $November "november"
|
||||
SET $December "december"
|
||||
|
||||
SET $Today "vandaag"
|
||||
SET $Tomorrow "morgen"
|
||||
|
||||
BANNER Herinneringen voor %w, %d%s %m, %y%o:
|
||||
|
||||
SET $Am "am"
|
||||
SET $Pm "pm"
|
||||
|
||||
SET $Ago "geleden"
|
||||
SET $Fromnow "vanaf nu"
|
||||
SET $On "op"
|
||||
|
||||
SET $Now "nu"
|
||||
SET $At "op"
|
||||
SET $Minute "minuut"
|
||||
SET $Hour "uur"
|
||||
SET $Is "is"
|
||||
SET $Was "was"
|
||||
SET $And "en"
|
||||
SET $Hplu "en"
|
||||
SET $Mplu "en"
|
||||
|
||||
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst_1a(now()-t, $Ago), subst_1a(t-now(), $Fromnow))
|
||||
FSET subst_1a(diff, when) subst_1b(diff/60, diff%60) + " " + when
|
||||
|
||||
FSET subst_1b(hdiff, mdiff) iif(hdiff==0, subst_minutes(mdiff), mdiff==0, subst_hours(hdiff), subst_hours(hdiff) + " " + $And + " " + subst_minutes(mdiff))
|
||||
FSET subst_minutes(m) iif(m==1, "1 minuut", m + " minuten")
|
||||
FSET subst_hours(h) iif(h==1, "1 uur", h + " uren")
|
||||
|
||||
FSET subst_bx(a, d, t) "over " + (d-today()) + " dagen"
|
||||
58
include/lang/no.rem
Normal file
58
include/lang/no.rem
Normal file
@@ -0,0 +1,58 @@
|
||||
# Support for the Norwegian language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Trygve Randen
|
||||
|
||||
SET $Sunday "Søndag"
|
||||
SET $Monday "Mandag"
|
||||
SET $Tuesday "Tirsdag"
|
||||
SET $Wednesday "Onsdag"
|
||||
SET $Thursday "Torsdag"
|
||||
SET $Friday "Fredag"
|
||||
SET $Saturday "Lørdag"
|
||||
|
||||
SET $January "Januar"
|
||||
SET $February "Februar"
|
||||
SET $March "Mars"
|
||||
SET $April "April"
|
||||
SET $May "Mai"
|
||||
SET $June "Juni"
|
||||
SET $July "Juli"
|
||||
SET $August "August"
|
||||
SET $September "September"
|
||||
SET $October "Oktober"
|
||||
SET $November "November"
|
||||
SET $December "Desember"
|
||||
|
||||
SET $Today "i dag"
|
||||
SET $Tomorrow "i morgen"
|
||||
|
||||
BANNER Påminnelse for %w, %d. %m, %y%o:
|
||||
|
||||
SET $Am "am"
|
||||
SET $Pm "pm"
|
||||
|
||||
SET $Ago "siden"
|
||||
SET $Fromnow "fra nå"
|
||||
|
||||
SET $On "den"
|
||||
SET $Now "nå"
|
||||
SET $At "kl."
|
||||
SET $Minute "minutt"
|
||||
SET $Hour "time"
|
||||
SET $Is "er"
|
||||
SET $Was "var"
|
||||
SET $And "og"
|
||||
SET $Hplu "r"
|
||||
SET $Mplu "er"
|
||||
|
||||
FSET subst_bx(a, d, t) "om " + (d-today()) + " dager"
|
||||
FSET subst_ordinal(d) "."
|
||||
|
||||
FSET subst_ax(a, d, t) iif(a, subst_a_alt(d), $On + " " + subst_a_alt(d))
|
||||
FSET subst_a_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d) + " " + year(d)
|
||||
FSET subst_gx(a, d, t) iif(a, subst_g_alt(d), $On + " " + subst_g_alt(d))
|
||||
FSET subst_g_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d)
|
||||
FSET subst_ux(a, d, t) subst_ax(a, d, t)
|
||||
FSET subst_vx(a, d, t) subst_gx(a, d, t)
|
||||
FSET subst_p(a, d, t) iif(d==today()+1, "", "er")
|
||||
69
include/lang/pl.rem
Normal file
69
include/lang/pl.rem
Normal file
@@ -0,0 +1,69 @@
|
||||
# Support for the Polish language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Jerzy Sobczyk
|
||||
|
||||
SET $Sunday "Niedziela"
|
||||
SET $Monday "Poniedziałek"
|
||||
SET $Tuesday "Wtorek"
|
||||
SET $Wednesday "Środa"
|
||||
SET $Thursday "Czwartek"
|
||||
SET $Friday "Piątek"
|
||||
SET $Saturday "Sobota"
|
||||
|
||||
SET $January "Styczeń"
|
||||
SET $February "Luty"
|
||||
SET $March "Marzec"
|
||||
SET $April "Kwiecień"
|
||||
SET $May "Maj"
|
||||
SET $June "Czerwiec"
|
||||
SET $July "Lipiec"
|
||||
SET $August "Sierpień"
|
||||
SET $September "Wrzesień"
|
||||
SET $October "Październik"
|
||||
SET $November "Listopad"
|
||||
SET $December "Grudzień"
|
||||
|
||||
SET $Today "dzisiaj"
|
||||
SET $Tomorrow "jutro"
|
||||
|
||||
BANNER Terminarz na %w, %d. %m %y%o:
|
||||
|
||||
SET $Am "am"
|
||||
SET $Pm "pm"
|
||||
|
||||
SET $Ago "temu"
|
||||
SET $Fromnow "od teraz"
|
||||
SET $On "-"
|
||||
SET $Now "teraz"
|
||||
SET $At "o"
|
||||
SET $Minute "minut"
|
||||
SET $Hour "godzin"
|
||||
SET $Is "będzie"
|
||||
SET $Was "było"
|
||||
SET $And "i"
|
||||
SET $Hplu ""
|
||||
SET $Mplu ""
|
||||
|
||||
FSET subst_pl_plu(n) iif(n==1, "ę", (n==12||n==13||n==14), "", (n%10==2||n%10==3||n%10==4), "y", "")
|
||||
FSET subst_ampm(h) iif(h<5, " w nocy", h<10, " rano", h<12, " przed południem", h<18, " po południu", h<22, " wieczorem", " w nocy")
|
||||
FSET subst_ordinal(d) ""
|
||||
|
||||
FSET subst_a_alt(d) wkday(d) + ", " + day(d) + ". " + mon(d) + " " + year(d)
|
||||
FSET subst_ax(a, d, t) iif(a, subst_a_alt(d), $On + " " + subst_a_alt(d))
|
||||
FSET subst_bx(a, d, t) "za " + (d-today()) + " dni"
|
||||
FSET subst_g_alt(d) wkday(d) + ", " + day(d) + ". " + mon(d)
|
||||
FSET subst_gx(a, d, t) iif(a, subst_g_alt(d), $On + " " + subst_g_alt(d))
|
||||
FSET subst_ux(a, d, t) subst_ax(a, d, t)
|
||||
FSET subst_vx(a, d, t) subst_gx(a, d, t)
|
||||
FSET subst_p(a, d, t) ""
|
||||
FSET subst_0(a, d, t) subst_pl_plu(abs(t-now())/60)
|
||||
FSET subst_9(a, d, t) subst_pl_plu(abs(t-now())%60)
|
||||
|
||||
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst_1past(now()-t), subst_1future(t-now()))
|
||||
|
||||
FSET subst_1future(diff) "za " + iif(diff/60==0, subst_1min(diff%60), diff%60==0, subst_1h(diff/60), subst_1h(diff/60) + " " + $And + " " + subst_1min(diff%60))
|
||||
FSET subst_1past(diff) iif(diff/60==0, subst_1min(diff%60), diff%60==0, subst_1h(diff/60), subst_1h(diff/60) + " " + $And + " " + subst_1min(diff%60)) + " temu"
|
||||
|
||||
FSET subst_1min(m) m + " " + $Minute + subst_pl_plu(m)
|
||||
FSET subst_1h(h) h + " " + $Hour + subst_pl_plu(h)
|
||||
69
include/lang/pt.rem
Normal file
69
include/lang/pt.rem
Normal file
@@ -0,0 +1,69 @@
|
||||
# Support for the (Brazilian) Portuguese language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Marco Paganini
|
||||
|
||||
SET $Sunday "domingo"
|
||||
SET $Monday "segunda"
|
||||
SET $Tuesday "terça"
|
||||
SET $Wednesday "quarta"
|
||||
SET $Thursday "quinta"
|
||||
SET $Friday "sexta"
|
||||
SET $Saturday "sábado"
|
||||
|
||||
SET $January "janeiro"
|
||||
SET $February "fevereiro"
|
||||
SET $March "março"
|
||||
SET $April "abril"
|
||||
SET $May "maio"
|
||||
SET $June "junho"
|
||||
SET $July "julho"
|
||||
SET $August "agosto"
|
||||
SET $September "setembro"
|
||||
SET $October "outubro"
|
||||
SET $November "novembro"
|
||||
SET $December "dezembro"
|
||||
|
||||
SET $Today "hoje"
|
||||
SET $Tomorrow "amanhã"
|
||||
|
||||
BANNER Avisos para %w, %d de %m de %y%o:
|
||||
|
||||
SET $Am "am"
|
||||
SET $Pm "pm"
|
||||
|
||||
SET $Ago "atrás"
|
||||
SET $Fromnow "adiante"
|
||||
|
||||
SET $On "em"
|
||||
SET $Now "agora"
|
||||
SET $At "as"
|
||||
SET $Minute "minuto"
|
||||
SET $Hour "hora"
|
||||
SET $Is "é"
|
||||
SET $Was "foi"
|
||||
SET $And "e"
|
||||
|
||||
SET $Hplu "s"
|
||||
SET $Mplu "s"
|
||||
|
||||
FSET subst_ordinal(d) ""
|
||||
FSET subst_on_wd(d) iif(wkdaynum(d) == 1 || wkdaynum(d) == 2, "no", "na")
|
||||
|
||||
FSET subst_a_alt(d) wkday(d) + ", " + day(d) + " de " + mon(d) + " de " + year(d)
|
||||
FSET subst_bx(a, d, t) "em " + (d-today()) + " dias"
|
||||
FSET subst_c_alt(d) wkday(d)
|
||||
FSET subst_g_alt(d) wkday(d) + ", " + day(d) + " " + mon(d)
|
||||
FSET subst_ax(a, d, t) iif(a, subst_a_alt(d), subst_on_wd(d) + " " + subst_a_alt(d))
|
||||
FSET subst_cx(a, d, t) iif(a, subst_c_alt(d), subst_on_wd(d) + " " + subst_c_alt(d))
|
||||
FSET subst_gx(a, d, t) iif(a, subst_g_alt(d), subst_on_wd(d) + " " + subst_g_alt(d))
|
||||
FSET subst_jx(a, d, t) subst_ax(a, d, t)
|
||||
FSET subst_k_alt(d) wkday(d) + ", " + day(d) + " de " + mon(d)
|
||||
FSET subst_kx(a, d, t) iif(a, subst_k_alt(d), subst_on_wd(d) + " " + subst_k_alt(d))
|
||||
FSET subst_ux(a, d, t) subst_ax(a, d, t)
|
||||
FSET subst_vx(a, d, t) subst_kx(a, d, t)
|
||||
|
||||
FSET subst_1(a, d, t) iif(t==now(), $Now, t>now(), "em " + subst_1help(t-now()), subst_1help(now()-t) + " " + $Ago)
|
||||
FSET subst_1help(diff) iif(diff/60==0, subst_mplu(diff%60), diff%60==0, subst_hplu(diff/60), subst_hplu(diff/60) + " " + $And + " " + subst_mplu(diff%60))
|
||||
FSET subst_mplu(m) iif(m==1, "1 " + $Minute, m + " " + $Minute + $Mplu)
|
||||
FSET subst_hplu(h) iif(h==1, "1 " + $Hour, h + " " + $Hour + $Hplu)
|
||||
68
include/lang/ro.rem
Normal file
68
include/lang/ro.rem
Normal file
@@ -0,0 +1,68 @@
|
||||
# Support for the Romanian language.
|
||||
# This file is part of REMIND.
|
||||
# REMIND is Copyright (C) 1992-2022 by Dianne Skoll
|
||||
# This file is derived from a translation by Liviu Daia
|
||||
|
||||
SET $Sunday "Duminică"
|
||||
SET $Monday "Luni"
|
||||
SET $Tuesday "Marți"
|
||||
SET $Wednesday "Miercuri"
|
||||
SET $Thursday "Joi"
|
||||
SET $Friday "Vineri"
|
||||
SET $Saturday "Sâmbătă"
|
||||
|
||||
SET $January "Ianuarie"
|
||||
SET $February "Februarie"
|
||||
SET $March "Martie"
|
||||
SET $April "Aprilie"
|
||||
SET $May "Mai"
|
||||
SET $June "Iunie"
|
||||
SET $July "Iulie"
|
||||
SET $August "August"
|
||||
SET $September "Septembrie"
|
||||
SET $October "Octombrie"
|
||||
SET $November "Noiembrie"
|
||||
SET $December "Decembrie"
|
||||
|
||||
SET $Today "astăzi"
|
||||
SET $Tomorrow "mâine"
|
||||
|
||||
BANNER Reamintiri pentru %w, %d %m %y%o:
|
||||
|
||||
SET $Am "am"
|
||||
SET $Pm "pm"
|
||||
|
||||
SET $Ago "acum"
|
||||
SET $Fromnow "peste"
|
||||
|
||||
SET $On "pe"
|
||||
|
||||
SET $Now "acum"
|
||||
SET $At "la ora"
|
||||
SET $Minute "minut"
|
||||
SET $Hour "or"
|
||||
SET $Is "este"
|
||||
SET $Was "a fost"
|
||||
SET $Mplu "e"
|
||||
SET $Hplu "e"
|
||||
SET $And "şi"
|
||||
|
||||
FSET subst_bx(a, d, t) "peste " + (d-today()) + " zile"
|
||||
|
||||
FSET subst_ampm(h) iif(h<4, " noaptea", h<12, " dimineaţa", h<18, " după-amiaza", " seara")
|
||||
FSET subst_ordinal(d) ""
|
||||
|
||||
FSET subst_ax(a, d, t) wkday(d) + ", " + day(d) + " " + mon(d) + " " + year(d)
|
||||
FSET subst_cx(a, d, t) wkday(d)
|
||||
FSET subst_gx(a, d, t) wkday(d) + ", " + day(d) + " " + mon(d)
|
||||
FSET subst_jx(a, d, t) wkday(d) + ", " + mon(d) + " " + day(d) + ", " + year(d)
|
||||
FSET subst_kx(a, d, t) wkday(d) + ", " + mon(d) + " " + day(d)
|
||||
FSET subst_ux(a, d, t) subst_ax(a, d, t)
|
||||
FSET subst_vx(a, d, t) subst_gx(a, d, t)
|
||||
FSET subst_p(a, d, t) iif(d==today()+1, "", "le")
|
||||
|
||||
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst_1helper(now()-t, "acum "), subst_1helper(t-now(), "peste "))
|
||||
FSET subst_1helper(diff, when) when + iif(diff%60==0, subst_1h(diff/60), diff/60==0, subst_1m(diff%60), subst_1h(diff/60) + " " + $And + " " + subst_1m(diff%60))
|
||||
FSET subst_1h(h) iif(h==1, "1 oră", h + " ore")
|
||||
FSET subst_1m(m) iif(m==1, "1 minut", m + " minute")
|
||||
FSET subst_0(a, d, t) iif(abs(t-now())/60==1, "ă", "e")
|
||||
2
include/site/README
Normal file
2
include/site/README
Normal file
@@ -0,0 +1,2 @@
|
||||
This directory is for system administrators to install site-wide
|
||||
Remind scripts that are useful to their user-base.
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH REM 1 "1 January 2021"
|
||||
.TH REM 1 "14 March 2022"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
rem \- Invoke Remind with a default filename
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH REM2PS 1 "5 January 2021"
|
||||
.TH REM2PS 1 "14 March 2022"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
rem2ps \- draw a PostScript calendar from Remind output
|
||||
@@ -675,4 +675,5 @@ 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, \fBrem2pdf\fR
|
||||
\fBremind\fR, \fBrem2pdf\fR, \fBrem2html\fR, \fBtkremind\fR.
|
||||
|
||||
|
||||
483
man/remind.1
483
man/remind.1
@@ -1,4 +1,4 @@
|
||||
.TH REMIND 1 "1 January 2021"
|
||||
.TH REMIND 1 "14 March 2022"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
remind \- a sophisticated reminder service
|
||||
@@ -70,7 +70,10 @@ on terminals that emulate the VT00 line-drawing character set.
|
||||
.B 'u'
|
||||
is similar to 'l', but causes \fBRemind\fR to use UNICODE line-drawing
|
||||
characters to draw the calendar. The characters are hard-coded and will
|
||||
only work on terminals that are set to UTF-8 character encoding.
|
||||
only work on terminals that are set to UTF-8 character encoding. This
|
||||
flag also enables the use of the UNICODE "left-to-right" mark that
|
||||
can fix up formatting problems with right-to-left languages in the calendar
|
||||
display.
|
||||
.TP
|
||||
.B 'c'
|
||||
causes \fBRemind\fR to use VT100 escape sequences to approximate
|
||||
@@ -138,7 +141,7 @@ If you immediately follow the \fBs\fR with the letter
|
||||
day they actually occur \fIas well as\fR on any preceding days specified
|
||||
by the reminder's \fIdelta\fR.
|
||||
.TP
|
||||
.B \-p\fR[\fBa\fR][\fBp\fR][\fBp\fR]\fIn\fR
|
||||
.B \-p\fR[\fBa\fR][\fBp\fR][\fBp\fR][\fBq\fR]\fIn\fR
|
||||
The \fB\-p\fR option is very similar to the \fB\-s\fR option, except
|
||||
that the output contains additional information for use by the
|
||||
\fBRem2PS\fR program, which creates a PostScript calendar, and various
|
||||
@@ -153,7 +156,9 @@ by the reminder's \fIdelta\fR. If you follow the \fBp\fR with another
|
||||
format rather than the "simple calendar" format. This format is
|
||||
also documented in the \fBrem2ps(1)\fR man page. Finally, if you use
|
||||
three p's, as in \fB\-ppp\fR, then \fBRemind\fR uses a pure JSON
|
||||
format, again documented in \fBrem2ps(1)\fR.
|
||||
format, again documented in \fBrem2ps(1)\fR. If you include a \fBq\fR
|
||||
letter with this option, then the normal calendar-mode substitution filter
|
||||
is disabled and the %"...%" sequences are preserved in the output.
|
||||
.RS
|
||||
.PP
|
||||
Note that the \fB\-pp\fR or \fB\-ppp\fR options also enable the \fB\-l\fR
|
||||
@@ -267,7 +272,7 @@ calendar output.
|
||||
.TP
|
||||
\fB\-x\fR[\fIn\fR]
|
||||
Sets the iteration limit for the \fBSATISFY\fR clause of a \fBREM\fR
|
||||
command. Defaults to 150.
|
||||
command. Defaults to 1000.
|
||||
.TP
|
||||
\fB\-k\fR\fIcmd\fR
|
||||
Instead of simply printing \fBMSG\fR-type
|
||||
@@ -560,6 +565,7 @@ The trigger date for a specific run is simply the current system date.
|
||||
present. The reminder is triggered on the specified day of each month.
|
||||
The trigger date for a particular run is the closest such day to the
|
||||
current system date. For example:
|
||||
.PP
|
||||
.nf
|
||||
REM 1 MSG First of every month.
|
||||
REM 31 MSG 31st of every month that has 31 days.
|
||||
@@ -569,6 +575,7 @@ current system date. For example:
|
||||
.I month
|
||||
present. The reminder is triggered every day of the specified month.
|
||||
Example:
|
||||
.PP
|
||||
.nf
|
||||
REM Feb MSG Every day in February
|
||||
.fi
|
||||
@@ -578,6 +585,7 @@ Example:
|
||||
and
|
||||
.I month
|
||||
present. Examples:
|
||||
.PP
|
||||
.nf
|
||||
REM 6 Jan MSG Every 6th of January
|
||||
REM Feb 29 MSG Every 29th of February
|
||||
@@ -586,6 +594,7 @@ present. Examples:
|
||||
5. Only
|
||||
.I year
|
||||
present. Example:
|
||||
.PP
|
||||
.nf
|
||||
REM 1991 MSG Every day in 1991
|
||||
.fi
|
||||
@@ -595,6 +604,7 @@ present. Example:
|
||||
and
|
||||
.I day
|
||||
present. Examples:
|
||||
.PP
|
||||
.nf
|
||||
REM 1 1990 MSG 1st of every month in 1990
|
||||
REM 1992 23 MSG 23rd of every month in 1992
|
||||
@@ -605,6 +615,7 @@ present. Examples:
|
||||
and
|
||||
.I month
|
||||
present. Examples:
|
||||
.PP
|
||||
.nf
|
||||
REM Feb 1991 MSG Every day in Feb 1991
|
||||
REM 1992 September MSG Every day in Sept 1992
|
||||
@@ -615,6 +626,7 @@ present. Examples:
|
||||
and
|
||||
.I day
|
||||
present. Examples:
|
||||
.PP
|
||||
.nf
|
||||
REM 8 Jan 1991 MSG 8th January 1991.
|
||||
REM 1992 March 9 MSG 9th March 1992.
|
||||
@@ -623,6 +635,7 @@ present. Examples:
|
||||
9.
|
||||
.I weekday
|
||||
only. Examples:
|
||||
.PP
|
||||
.nf
|
||||
REM Sat MSG Every Saturday
|
||||
REM Mon Tue Wed Thu Fri MSG Every working day
|
||||
@@ -634,6 +647,7 @@ only. Examples:
|
||||
and
|
||||
.I day
|
||||
present. Examples:
|
||||
.PP
|
||||
.nf
|
||||
REM Sat 1 MSG First Saturday of every month
|
||||
REM Mon Tue Wed Thu Fri 15 \\
|
||||
@@ -645,6 +659,7 @@ present. Examples:
|
||||
and
|
||||
.I month
|
||||
present. Examples:
|
||||
.PP
|
||||
.nf
|
||||
REM Mon March MSG Every Monday in March
|
||||
REM Mon Tue Wed Thu Fri Feb MSG Every working day in February
|
||||
@@ -655,6 +670,7 @@ present. Examples:
|
||||
and
|
||||
.I day
|
||||
present. Examples:
|
||||
.PP
|
||||
.nf
|
||||
REM Mon 1 March MSG First Monday in March
|
||||
REM Sat Sun 15 July MSG First Sat or Sun on or after 15 July
|
||||
@@ -665,6 +681,7 @@ present. Examples:
|
||||
and
|
||||
.I year
|
||||
present. Example:
|
||||
.PP
|
||||
.nf
|
||||
REM Sat Sun 1991 MSG Every Saturday and Sunday in 1991
|
||||
.fi
|
||||
@@ -674,6 +691,7 @@ present. Example:
|
||||
and
|
||||
.I year
|
||||
present. Examples:
|
||||
.PP
|
||||
.nf
|
||||
REM Mon 15 1990 MSG 1st Mon after 15th of every month in 1990
|
||||
REM Mon Tue Wed Thu Fri 1 1990 \\
|
||||
@@ -685,6 +703,7 @@ present. Examples:
|
||||
and
|
||||
.I year
|
||||
present. Example:
|
||||
.PP
|
||||
.nf
|
||||
REM Mon Wed 1991 Feb MSG Every Mon and Wed in Feb 1991.
|
||||
.fi
|
||||
@@ -694,6 +713,7 @@ present. Example:
|
||||
and
|
||||
.I year
|
||||
present. Example:
|
||||
.PP
|
||||
.nf
|
||||
REM Mon Tue Wed Thu Fri 28 Oct 1990 \\
|
||||
MSG 1st working day on or after 28 October 1990.
|
||||
@@ -814,7 +834,8 @@ could be specified as:
|
||||
However, events that do not repeat daily, weekly, monthly or yearly require
|
||||
another approach. The \fIrepeat\fR component of the \fBREM\fR command
|
||||
fills this need. To use it, you must completely specify a date (year, month
|
||||
and day, and optionally weekday.) The \fIrepeat\fR component is an asterisk
|
||||
and day, and optionally weekday); this is the start date of the
|
||||
repetition period. The \fIrepeat\fR component is an asterisk
|
||||
followed by a number specifying the repetition period in days.
|
||||
.PP
|
||||
For example, suppose you get paid every second Wednesday, and your
|
||||
@@ -824,12 +845,12 @@ last payday was Wednesday, 28 October, 1992. You can use:
|
||||
REM 28 Oct 1992 *14 MSG Payday
|
||||
.fi
|
||||
.PP
|
||||
This issues the reminder every 14 days, starting from the calculated trigger
|
||||
date. You can use \fIdelta\fR and \fIback\fR with \fIrepeat.\fR Note,
|
||||
however, that the \fIback\fR is used only to compute the initial
|
||||
trigger date; thereafter, the reminder repeats with the specified
|
||||
This issues the reminder every 14 days, starting from 28 Oct 1992.
|
||||
You can use \fIdelta\fR and \fIback\fR with \fIrepeat.\fR Note,
|
||||
however, that the \fIback\fR is used only to compute the starting
|
||||
date; thereafter, the reminder repeats with the specified
|
||||
period. Similarly, if you specify a weekday, it is used only to calculate
|
||||
the initial date, and does not affect the repetition period.
|
||||
the starting date, and does not affect the repetition period.
|
||||
.PP
|
||||
.B SCANFROM \fRand\fB FROM
|
||||
.PP
|
||||
@@ -1152,6 +1173,84 @@ Note that \fIduration\fR is specified either in hours and minutes as a
|
||||
duration of 00:00 or 0, then \fBRemind\fR behaves exactly as if no
|
||||
\fBDURATION\fR at all had been present.
|
||||
|
||||
.PP
|
||||
.SH SYNTACTIC SUGAR FOR REM
|
||||
.PP
|
||||
The REM command has syntactic sugar to let you express common
|
||||
reminders. The following pairs of reminders are equivalent:
|
||||
.PP
|
||||
.nf
|
||||
REM First Monday April MSG Foo
|
||||
REM Mon 1 April MSG Foo
|
||||
|
||||
REM Second Monday May MSG Bar
|
||||
REM Mon 8 May MSG Bar
|
||||
|
||||
REM Third Monday MSG Third Monday of every month
|
||||
REM Mon 15 MSG Third Monday of every month
|
||||
|
||||
REM Fourth Sunday June 2025 MSG Fourth Sunday in June 2025
|
||||
REM Sun 22 June 2025 MSG Fourth Sunday in June 2025
|
||||
|
||||
REM Last Monday MSG Last Monday of every month
|
||||
REM Mon 1 --7 MSG Last Monday of every month
|
||||
|
||||
REM Last Monday April MSG Last Monday of every April
|
||||
REM Mon 1 May --7 MSG Last Monday of every April
|
||||
|
||||
REM Last Monday December 2025 MSG Last Monday of Dec 2025
|
||||
REM Monday 1 Jan 2026 --7 MSG Last Monday of Dec 2025
|
||||
.fi
|
||||
.PP
|
||||
Note that \fBLast\fR effectively adjusts the month and year, if necessary, to
|
||||
make the reminder trigger on the correct date.
|
||||
.PP
|
||||
The keyword \fBIN\fR is completely ignored, so you can write (for example):
|
||||
.PP
|
||||
.nf
|
||||
REM Second Monday in May MSG foo
|
||||
REM Last Monday in December 2025 MSG Bar
|
||||
.fi
|
||||
.PP
|
||||
An alternate form of \fIback\fR makes writing reminders easier.
|
||||
The following groups of reminders are equivalent:
|
||||
.PP
|
||||
.nf
|
||||
REM ~~1 MSG Last day of every month
|
||||
REM Lastday MSG Last day of every month
|
||||
REM 1 --1 MSG Last day of every month
|
||||
|
||||
REM May ~~1 MSG Last day of May
|
||||
REM Lastday May MSG Last day of May
|
||||
REM 1 June --1 MSG Last day of May
|
||||
|
||||
REM Dec 2025 ~~1 MSG Last day of December 2025
|
||||
REM Lastday Dec 2025 MSG Last day of December 2025
|
||||
REM 1 Jan 2026 --1 MSG Last day of December 2025
|
||||
|
||||
REM Apr ~1 OMIT SAT SUN MSG Last workday of April
|
||||
REM Lastworkday April OMIT SAT SUN MSG Last workday of April
|
||||
REM 1 May -1 OMIT SAT SUN MSG Last workday of April
|
||||
|
||||
REM Apr ~~7 MSG Seventh-last day of April
|
||||
REM 1 May --7 MSG Seventh-last day of April
|
||||
|
||||
REM Apr ~2 OMIT SAT SUN MSG Second-last workday of April
|
||||
REM 1 May -2 OMIT SAT SUN MSG Second-last workday of April
|
||||
.fi
|
||||
.PP
|
||||
As we see, "Lastday" is equivalent to ~~1 and "Lastworkday" to ~1.
|
||||
.PP
|
||||
Note that the First/Second/Third/Fourth/Last keywords and the ~ and ~~ form
|
||||
of \fIback\fR imply a value for the day of the month; as such, they cannot
|
||||
be combined with a day. Additionally, First/Second/Third/Fourth/Last
|
||||
must have at least one weekday name. The following are illegal:
|
||||
.PP
|
||||
.nf
|
||||
REM First Monday 3 June MSG Huh?
|
||||
REM April 3 ~~1 MSG What?
|
||||
REM Second June MSG Where's the weekday???
|
||||
.fi
|
||||
.PP
|
||||
.SH THE SUBSTITUTION FILTER
|
||||
.PP
|
||||
@@ -1828,7 +1927,7 @@ quotes \fImust\fR be supplied. This distinguishes date constants
|
||||
from division or subtraction of integers. Examples:
|
||||
.PP
|
||||
.RS
|
||||
\'1993/02/22', '1992-12-25', '1999/01/01'
|
||||
\(aq1993/02/22', '1992-12-25', '1999/01/01'
|
||||
.PP
|
||||
Note that \fBDATE\fR values are \fIprinted\fR
|
||||
without the quotes. Although either '-' or '/' is accepted as a date
|
||||
@@ -1846,13 +1945,33 @@ constants with the addition of an "@HH:MM" part, optionally followed
|
||||
by "am" or "pm". For example:
|
||||
.PP
|
||||
.RS
|
||||
\'2008-04-05@23:11', '1999/02/03@14:06', '2001-04-07@08:30', '2020-01-01@3:20pm'
|
||||
\(aq2008-04-05@23:11', '1999/02/03@14:06', '2001-04-07@08:30', '2020-01-01@3:20pm'
|
||||
.PP
|
||||
\fBDATETIME\fR values are printed without the quotes. Notes about date
|
||||
and time separator characters for \fBDATE\fR and \fBTIME\fR constants apply
|
||||
also to \fBDATETIME\fR constants.
|
||||
.RE
|
||||
.PP
|
||||
.B ZERO VALUES
|
||||
.PP
|
||||
The non-string types all have an associated \fIzero\fR value, which is
|
||||
treated as "false" by the IF command and the logical operators. The
|
||||
zero values are:
|
||||
.PP
|
||||
.RS
|
||||
.PP
|
||||
\fBINT\fR - 0
|
||||
.PP
|
||||
\fBDATE\fR - '1990-01-01'
|
||||
.PP
|
||||
\fBTIME\fR - 00:00
|
||||
.PP
|
||||
\fBDATETIME\fR - '1990-01-01@00:00'
|
||||
.RE
|
||||
.PP
|
||||
Additionally, for the purpose of the IF command (but \fInot\fR the
|
||||
logical operators) the empty string "" is considered a false value.
|
||||
.PP
|
||||
.B OPERATORS
|
||||
.PP
|
||||
\fBRemind\fR has the following operators. Operators on the same line
|
||||
@@ -1976,14 +2095,16 @@ If the operands are not of the same type, == returns 0 and != returns
|
||||
.RE
|
||||
.TP
|
||||
.B &&
|
||||
This is the logical AND operator. Both of its operands must be of
|
||||
type \fBINT\fR. It returns 1 if both operands are non-zero, and 0
|
||||
otherwise.
|
||||
This is the logical AND operator. Both of its operands must be of the
|
||||
same type and must not be \fBSTRING\fR type. Returns the second
|
||||
operand if both operands are non-zero. Otherwise, returns a zero
|
||||
of the same type as the operands.
|
||||
.TP
|
||||
.B ||
|
||||
This is the logical OR operator. Both of its operands must be of
|
||||
type \fBINT\fR. It returns 1 if either operand is non-zero, and 0
|
||||
otherwise.
|
||||
the same type and must not be of \fBSTRING\fR type. It returns
|
||||
the first operand that is non-zero; if both operands are zero, then
|
||||
returns a zero of the same type as the operands.
|
||||
.PP
|
||||
.B NOTES
|
||||
.PP
|
||||
@@ -2203,18 +2324,23 @@ The latitude of your location, expressed as a string that is a floating-point
|
||||
number. Because \fBRemind\fR does not have a native floating-point type,
|
||||
we need to express it as a string. $Latitude can range from "-90.0" to
|
||||
"90.0", with positive numbers representing points north of the equator
|
||||
and negative numbers representing south.
|
||||
and negative numbers representing south. Note that regardless of your
|
||||
locale, $Latitude is always interpreted in the "C" locale and as such,
|
||||
the decimal point must be a period (".").
|
||||
.TP
|
||||
.B $Longitude (STRING type)
|
||||
The longitude of your location, expressed as a string that is a floating-point
|
||||
number. Because \fBRemind\fR does not have a native floating-point type,
|
||||
we need to express it as a string. $Longitude can range from "-180.0" to
|
||||
"180.0", with positive numbers representing points east of the Greenwich
|
||||
Meridian and negative numbers representing west.
|
||||
Meridian and negative numbers representing west. Note that regardless of your
|
||||
locale, $Longitude is always interpreted in the "C" locale and as such,
|
||||
the decimal point must be a period (".").
|
||||
.RS
|
||||
.PP
|
||||
For example, the coordinates of the Statue of Liberty in New York City
|
||||
are approximately set by:
|
||||
.PP
|
||||
.nf
|
||||
SET $Latitude "40.68933"
|
||||
SET $Longitude "-74.04454"
|
||||
@@ -2333,6 +2459,26 @@ order, or 2 if sorting by time in descending order.
|
||||
The number of spaces by which all lines (except the first) of an
|
||||
\fBMSF\fR-type reminder should be indented. The default is 0.
|
||||
.TP
|
||||
.B $SuppressLRM
|
||||
Normally, when Remind is run with the \fB\-c\fR option in a UTF-8 locale,
|
||||
it emits a left-to-right mark sequence after printing day names or
|
||||
reminders. Some terminals render this incorrectly, so you can use:
|
||||
.RS
|
||||
.PP
|
||||
.nf
|
||||
SET $SuppressLRM 1
|
||||
.fi
|
||||
.PP
|
||||
at the top of your reminder file to suppress the LRM sequences, or you
|
||||
can invoke Remind with the option \fB'\-i$SuppressLRM=1'\fR.
|
||||
.RE
|
||||
.TP
|
||||
.B $SysInclude (read-only, STRING type)
|
||||
A directory path containing standard reminder scripts. Currently,
|
||||
Remind ships with some standard holiday files and language packs.
|
||||
The value of \fB$SysInclude\fR is likely to be something like
|
||||
"/usr/share/remind" or "/usr/local/share/remind"
|
||||
.TP
|
||||
.B $T (read-only, DATE type)
|
||||
Exactly equivalent to \fBtrigdate()\fR. (See BUILT-IN FUNCTIONS.)
|
||||
.TP
|
||||
@@ -2418,7 +2564,7 @@ Returns the time of "astronomical twilight" on the specified \fIdate\fR. If
|
||||
.TP
|
||||
.B ampm(tq_time [,s_am [,s_pm]])
|
||||
Returns a \fBSTRING\fR that is the result of converting \fItime\fR
|
||||
(which is either a \fBTIME\R or a \fBDATETIME\fR object) to "AM/PM"
|
||||
(which is either a \fBTIME\fR or a \fBDATETIME\fR object) to "AM/PM"
|
||||
format. The optional arguments \fIam\fR and \fIpm\fR are the strings
|
||||
to append in the AM and PM case, respectively; they default to "AM"
|
||||
and "PM". The function obeys the system variables $DateSep,
|
||||
@@ -2923,6 +3069,27 @@ Returns a string that is the ordinal number \fInum\fR. For example,
|
||||
.B ostype()
|
||||
Returns "UNIX". Remind used to run on OS/2 and MS-DOS, but does not
|
||||
any longer.
|
||||
.TP
|
||||
.B pad(x_arg, s_padstr, i_len [, i_right])
|
||||
Converts the first argument \fIarg\fR to a string if necessary, and
|
||||
then if it is shorter than \fIlen\fR characters, pads to to
|
||||
\fIlen\fR characters using as many copies (including partial copies)
|
||||
of \fIpadstr\fR as necessary. By default, the string is left-padded,
|
||||
but if \fIright\fR is supplied and non-zero, the string will
|
||||
be right-padded.
|
||||
.RS
|
||||
.PP
|
||||
Here are some examples:
|
||||
.PP
|
||||
.nf
|
||||
pad(3, "0", 2) --> "03"
|
||||
pad(465, "0", 2) --> "465"
|
||||
pad("foo", " ", 5) --> " foo"
|
||||
pad("foo", " ", 5, 1) --> "foo "
|
||||
pad("foo", "bar", 11) --> "barbarbafoo"
|
||||
.fi
|
||||
.RE
|
||||
|
||||
.TP
|
||||
.B plural(i_num [,s_str1 [,s_str2]])
|
||||
Can take from one to three arguments. If one argument is supplied, returns
|
||||
@@ -3116,6 +3283,115 @@ Returns \fBRemind\fR's notion of "today." This may be the actual system
|
||||
date, or a date supplied on the command line, or the date of the
|
||||
calendar entry currently being computed.
|
||||
.TP
|
||||
.B trig(s_1 [,s_2, ...])
|
||||
For each string argument s_\fIn\fR, \fBtrig\fR evaluates s_\fIn\fR
|
||||
as if it were a REM or IFTRIG trigger
|
||||
specification. If the trigger would trigger today, then the trigger
|
||||
date is returned and no further triggers are evaluated. If none
|
||||
of the triggers would trigger today, then the zero date
|
||||
1990-01-01 is returned.
|
||||
.RS
|
||||
\fBtrig\fR also has a zero-argument form; this returns the trigger
|
||||
date of the \fImost recent\fR \fBtrig\fR function that returned a
|
||||
non-zero trigger date.
|
||||
.PP
|
||||
\fBtrig\fR can be used to make more sophisticated versions of
|
||||
\fBIFTRIG\fR. For example, if you have meetings every Monday in
|
||||
June and July, and you want warnings 3 days in advance, you
|
||||
could use:
|
||||
.PP
|
||||
.nf
|
||||
REM [trig("Mon Jun +3", "Mon July +3")] +3 MSG Meeting %b
|
||||
.fi
|
||||
.PP
|
||||
NOTE: We need to repeat the +3 delta outside of the \fBtrig\fR
|
||||
function for advance warning to work properly. This is because
|
||||
\fBtrig\fR returns a date constant (the trigger date) and the
|
||||
REM command does not know the details of \fBtrig\fR's arguments.
|
||||
.PP
|
||||
Note that because \fBRemind\fR does not have short-circuit logical
|
||||
operators, something like:
|
||||
.PP
|
||||
.nf
|
||||
SET a trig("Mon +7") || trig("Fri +7")
|
||||
.fi
|
||||
|
||||
would set the value of trig() to the date of the following
|
||||
Thursday. Even though trig("Mon +7") always returns true,
|
||||
the logical-OR operator still evaluates trig("Fri +7") which
|
||||
\fIalso\fR returns true and sets \fBtrig()\fR.
|
||||
.PP
|
||||
You can work around the lack of a short-circuit logical-OR as follows:
|
||||
If \fBtrig\fR returns a true value, the specific value it returns
|
||||
can be coerced to a DATE which is the trigger date. So the following code:
|
||||
.PP
|
||||
.nf
|
||||
SET a trig("Mon +4") || trig("Fri +4")
|
||||
IF a
|
||||
REM [a] +4 MSG [wkday($T)] %b.
|
||||
ENDIF
|
||||
.fi
|
||||
.PP
|
||||
would operate as follows:
|
||||
.PP
|
||||
.nf
|
||||
On Monday: Monday today.
|
||||
On Tuesday: Friday in 3 days' time.
|
||||
On Wednesday: Friday in 2 days' time.
|
||||
On Thursday: Monday in 4 days' time.
|
||||
On Friday: Monday in 3 days' time.
|
||||
On Saturday: Monday in 2 days' time.
|
||||
On Sunday: Monday tomorrow.
|
||||
.fi
|
||||
.PP
|
||||
Compare with the following:
|
||||
.PP
|
||||
.nf
|
||||
SET a trig("Mon +4") || trig("Fri +4")
|
||||
IF a
|
||||
REM [trig()] +4 MSG [wkday($T)] %b.
|
||||
ENDIF
|
||||
.fi
|
||||
.PP
|
||||
which yields:
|
||||
.PP
|
||||
.nf
|
||||
On Monday: Friday in 4 days' time.
|
||||
On Tuesday: Friday in 3 days' time.
|
||||
On Wednesday: Friday in 2 days' time.
|
||||
On Thursday: Friday tomorrow.
|
||||
On Friday: Friday today.
|
||||
On Saturday: Monday in 2 days' time.
|
||||
On Sunday: Monday tomorrow.
|
||||
.fi
|
||||
.PP
|
||||
That is because \fBtrig()\fR returns the trigger date of
|
||||
the \fIlast\fR trig function that returns true,
|
||||
whereas the value of \fBa\fR is the trigger date of the \fIfirst\fR
|
||||
trig function that returns true.
|
||||
.PP
|
||||
\fBImportant Note\fR: Because \fBtrig()\fR always returns an absolute
|
||||
date, it will \fBnot\fR work properly with a \fBSATISFY\fR clause.
|
||||
Consider this reminder:
|
||||
.PP
|
||||
.nf
|
||||
REM [trig("Mar", "Apr")] SATISFY [$Td == 15] MSG 15 Mar or April
|
||||
.fi
|
||||
.PP
|
||||
If we run \fBRemind\fR on 5 March 2022, we might expect the trigger
|
||||
date to be calculated as 15 March 2022... but that's not what happens.
|
||||
Instead, the \fBtrig\fR function is evaluated first, and it returns
|
||||
2022-03-05. So as far as \fBRemind\fR is concerned, the REM statement
|
||||
becomes:
|
||||
.PP
|
||||
.nf
|
||||
REM 2022-03-05 SATISFY [$Td == 15] MSG 15 Mar or April
|
||||
.fi
|
||||
.PP
|
||||
and the SATISFY expression is never true. So: \fIDo not mix
|
||||
trig() and SATISFY\fR.
|
||||
.RE
|
||||
.TP
|
||||
.B trigdate()
|
||||
Returns the calculated trigger date of the last \fBREM\fR
|
||||
or \fBIFTRIG\fR command. If used
|
||||
@@ -3532,12 +3808,12 @@ Note that the commands are shown indented for clarity. Also, the \fBELSE\fR
|
||||
portion can be omitted. \fBIF\fR commands can be nested up to a small limit,
|
||||
probably around 8 or 16 levels of nesting, depending on your system.
|
||||
.PP
|
||||
If the \fIexpr\fR evaluates to a non-zero \fBINT\fR, or a non-null
|
||||
\fBSTRING\fR, then the \fBIF\fR portion is considered true, and the
|
||||
\fIt-commands\fR are executed. If \fIexpr\fR evaluates to zero or
|
||||
null, then the \fIf-commands\fR (if the \fBELSE\fR portion is present)
|
||||
are executed. If \fIexpr\fR is not of type \fBINT\fR or \fBSTRING\fR,
|
||||
then it is an error.
|
||||
If the \fIexpr\fR evaluates to a non-zero \fBINT\fR, a \fBDATE\fR that
|
||||
is not 1990-01-01, a \fBTIME\fR that is not 00:00, a \fBDATETIME\fR
|
||||
that is not 1990-01-01@00:00, or a non-null \fBSTRING\fR, then the
|
||||
\fBIF\fR portion is considered true, and the \fIt-commands\fR are
|
||||
executed. If \fIexpr\fR evaluates to zero or null, then the
|
||||
\fIf-commands\fR (if the \fBELSE\fR portion is present) are executed.
|
||||
.PP
|
||||
Examples:
|
||||
.PP
|
||||
@@ -4456,7 +4732,7 @@ error messages. For an example of this, define the following:
|
||||
fset msgprefix(x) x/0
|
||||
.fi
|
||||
.PP
|
||||
.SH SUPPORT FOR OTHER LANGUAGES
|
||||
.SH COMPILE-TIME SUPPORT FOR OTHER LANGUAGES
|
||||
.PP
|
||||
Your version of \fBRemind\fR may have been compiled to support a
|
||||
language other than English. This support may or may not be complete -
|
||||
@@ -4469,10 +4745,14 @@ selected language rather than for English.
|
||||
Note that a non-English version of \fBRemind\fR will accept \fIonly\fR
|
||||
English names of weekdays and months in a reminder script.
|
||||
.PP
|
||||
If there is no support for your particular language, you can set
|
||||
\fBRemind\fR system variables so that calendars are printed using
|
||||
your language's day and month names. The system variables that you
|
||||
can set are:
|
||||
.SH RUN-TIME SUPPORT FOR OTHER LANGUAGES
|
||||
.PP
|
||||
\fBRemind\fR has run-time support for other languages, and it is
|
||||
expected that compile-time support will be deprecated in favour of
|
||||
run-time support.
|
||||
.PP
|
||||
A number of system variables let you translate various phrases
|
||||
to other languages. These system variables are:
|
||||
.PP
|
||||
.TP
|
||||
.B $Monday, $Tuesday, $Wednesday, $Thursday, $Friday, $Saturday
|
||||
@@ -4482,16 +4762,126 @@ day's name in your language. Strings must be valid UTF-8 strings.
|
||||
.B $January, $February, $March, $April, $May, $June, $July, $August, $September, $October, $November, $December
|
||||
Set each of these system variables to a string representing the corresponding
|
||||
month's name in your language. Strings must be valid UTF-8 strings.
|
||||
.TP
|
||||
.B $Ago, $Am, $And, $At, $Hour, $Is, $Minute, $Now, $On, $Pm, $Was
|
||||
Set each of these system variables to the translation of the corresponding
|
||||
English word into your language. Note that \fB$Am\fR and \fB$Pm\fR should
|
||||
be the translations of "AM" and "PM" (morning and afternoon time indicators)
|
||||
respectively.
|
||||
.TP
|
||||
.B $Hplu, $Mplu
|
||||
Set these to the suffix to add to the word for "hour" and "minute" to
|
||||
make them plural. In English, both would be set to "s".
|
||||
.TP
|
||||
.B $Fromnow
|
||||
Set this to the translation of the English phrase "from now"
|
||||
.PP
|
||||
Note that if you set the day- or month-name system variables, they
|
||||
should be set in a section of your script that always is evaluated.
|
||||
If you set them inside an \fBIF\fR statement, for example, results
|
||||
are unpredictable.
|
||||
Note that if you set any of the language-related system variables,
|
||||
they should be set in a section of your script that always is
|
||||
evaluated. If you set them inside an \fBIF\fR statement, for example,
|
||||
results are unpredictable.
|
||||
.PP
|
||||
Note also that the \fBRem2PS\fR back-end does not support the full
|
||||
range of UTF-8 characters. The \fBTkRemind\fR, \fBrem2html\fR and
|
||||
\fBrem2pdf\fR back-ends all do support the full UTF-8 range.
|
||||
|
||||
.PP
|
||||
.SH RUN-TIME MODIFICATION OF THE SUBSTITUTION FILTER
|
||||
.PP
|
||||
The system variables mentioned in the previous section are not typically
|
||||
sufficient to properly translate Remind's output to another language.
|
||||
Some languages have complicated rules for AM vs PM times and others have
|
||||
complex rules for making words plural. \fBRemind\fR therefore allows
|
||||
you to define a number of functions that modify the behavior of
|
||||
the substitution filter at run-time. The functions are:
|
||||
.PP
|
||||
.TP
|
||||
.B subst_ampm(h)
|
||||
This function is passed a single integer, namely an hour from 0 to 23.
|
||||
It should return a string that indicates "AM" or "PM" or even finer
|
||||
gradations in some languages.
|
||||
.TP
|
||||
.B subst_ordinal(d)
|
||||
This function is passed a single integer, namely a day of the month from
|
||||
1 to 31. It should return a string that is suffixed to the day number to
|
||||
turn it into an ordinal number. In English, for example, the function
|
||||
might return "st", "nd", "rd" or "th", depending on \fId\fR.
|
||||
.TP
|
||||
.B subst_N(alt, date, time)
|
||||
This is actually a \fIfamily\fR of functions, where \fIN\fR is a letter
|
||||
or number. This function \fIcompletely overrides\fR the substitution
|
||||
sequence "%X". The three arguments are an integer \fIalt\fR which,
|
||||
if non-zero, indicates that the alternate-mode substitution sequence
|
||||
"%*X" was encountered; \fIdate\fR which is the trigger date of the
|
||||
reminder and \fItime\fR which is the trigger time.
|
||||
.TP
|
||||
.B subst_Nx(alt, date, time)
|
||||
Again, this is a \fIfamily\fR of functions. It is similar to the
|
||||
\fBsubst_N\fR family except it is only called if \fIdate\fR is two or
|
||||
more days away from \fItoday()\fR. This is useful if you don't want to
|
||||
override the "today" or "tomorrow" output for most substitution sequences.
|
||||
.PP
|
||||
Here's an example of how you might customize your substitution filter.
|
||||
Suppose you want to change the "%b" sequence to substitute "the day
|
||||
after tomorrow" for an event two days from now. You could do this:
|
||||
.PP
|
||||
.nf
|
||||
FSET subst_bx(a,d,t) iif(d==today()+2, "the day after tomorrow", \
|
||||
"in " + (d-today()) + " days' time")
|
||||
REM [today()+3] ++3 MSG Event 1 is %b%
|
||||
REM [today()+2] ++3 MSG Event 2 is %b%
|
||||
REM [today()+1] ++3 MSG Event 3 is %b%
|
||||
REM [today()] ++3 MSG Event 4 is %b%
|
||||
.fi
|
||||
.PP
|
||||
The output of this script is:
|
||||
.PP
|
||||
.nf
|
||||
Event 1 is in 3 days' time
|
||||
Event 2 is the day after tomorrow
|
||||
Event 3 is tomorrow
|
||||
Event 4 is today
|
||||
.fi
|
||||
.PP
|
||||
Note how Event 2's wording was changed from the normal "in 2 days'
|
||||
time", and note also that the "tomorrow" and "today" events used the
|
||||
normal substitution---\fBsubst_bx\fR is not called for trigger days of
|
||||
today or tomorrow.
|
||||
.PP
|
||||
As a special case, if a \fBsubst_Nx\fB or \fBsubst_N\fR function
|
||||
returns the integer zero, then the normal substitution mechanism is
|
||||
used. Therefore, the previous example could have been written more simply
|
||||
as:
|
||||
.PP
|
||||
.nf
|
||||
FSET subst_bx(a,d,t) iif(d==today()+2, "the day after tomorrow", 0)
|
||||
.fi
|
||||
.PP
|
||||
.SH LANGUAGE PACKS
|
||||
.PP
|
||||
\fBRemind\fR ships with a number of language packs, which are simply reminder
|
||||
scripts located in \fB[$SysInclude]/lang\fR. The currently-shipping
|
||||
language packs are:
|
||||
.PP
|
||||
da.rem (Danish), de.rem (German), es.rem (Spanish), fr.rem (French),
|
||||
is.rem (Icelandic), it.rem (Italian), nl.rem (Dutch), no.rem (Norwegian),
|
||||
pl.rem (Polish), pt.rem (Portuguese) and ro.rem (Romanian).
|
||||
.PP
|
||||
To use a language pack (in this example, de.rem), simply place this at
|
||||
the top of your reminders file:
|
||||
.PP
|
||||
.nf
|
||||
INCLUDE [$SysInclude]/lang/de.rem
|
||||
.fi
|
||||
.PP
|
||||
If you want \fBRemind\fR to try to find the language pack appropriate
|
||||
for your locale settings, use:
|
||||
.PP
|
||||
.nf
|
||||
INCLUDE [$SysInclude]/lang/auto.rem
|
||||
.fi
|
||||
.PP
|
||||
You are encouraged to study the language packs to see how to translate
|
||||
Remind into additional languages.
|
||||
.PP
|
||||
.SH THE HEBREW CALENDAR
|
||||
.PP
|
||||
@@ -4700,10 +5090,12 @@ should attempt to support. They are currently supported by
|
||||
.PP
|
||||
The \fBSHADE\fR special replaces the \fBpsshade()\fR function.
|
||||
Use it like this:
|
||||
.PP
|
||||
.nf
|
||||
REM Sat Sun SPECIAL SHADE 128
|
||||
REM Mon SPECIAL SHADE 255 0 0
|
||||
.fi
|
||||
.PP
|
||||
The \fBSHADE\fR keyword is followed by either one or three numbers,
|
||||
from 0 to 255. If one number is supplied, it is interpreted as
|
||||
a grey-scale value from black (0) to white (255). If three numbers
|
||||
@@ -4714,14 +5106,17 @@ in calendars produced by \fBRem2PS\fR, \fBtkremind\fR and \fBrem2html\fR.)
|
||||
.PP
|
||||
The \fBMOON\fR special replaces the \fBpsmoon()\fR function. Use it
|
||||
like this:
|
||||
.PP
|
||||
.nf
|
||||
REM [moondate(0)] SPECIAL MOON 0
|
||||
REM [moondate(1)] SPECIAL MOON 1
|
||||
REM [moondate(2)] SPECIAL MOON 2
|
||||
REM [moondate(3)] SPECIAL MOON 3
|
||||
.fi
|
||||
.PP
|
||||
These draw little moons on the various calendars. The complete syntax
|
||||
of the \fBMOON\fR special is as follows:
|
||||
.PP
|
||||
.nf
|
||||
... SPECIAL MOON phase moonsize fontsize msg
|
||||
.fi
|
||||
@@ -4742,12 +5137,12 @@ and \fIfontsize\fR; the other backends use fixed sizes.
|
||||
.PP
|
||||
The \fBCOLOR\fR special lets you place colored reminders in the
|
||||
calendar. Use it like this:
|
||||
|
||||
.PP
|
||||
.nf
|
||||
REM ... SPECIAL COLOR 255 0 0 This is a bright red reminder
|
||||
REM ... SPECIAL COLOR 0 128 0 This is a dark green reminder
|
||||
.fi
|
||||
|
||||
.PP
|
||||
You can spell COLOR either the American way ("COLOR") or the British
|
||||
way ("COLOUR"). This manual will use the American way.
|
||||
|
||||
@@ -4768,11 +5163,11 @@ number in the calendar. For example, this would number each Monday
|
||||
with the ISO 8601 week number. The week number is shown like this:
|
||||
"(W\fIn\fR)" in this example, but you can put whatever text you like
|
||||
after the WEEK keyword.
|
||||
|
||||
.PP
|
||||
.nf
|
||||
REM Monday SPECIAL WEEK (W[weekno()])
|
||||
.fi
|
||||
|
||||
.PP
|
||||
.SH MISCELLANEOUS
|
||||
.PP
|
||||
.B COMMAND ABBREVIATIONS
|
||||
@@ -5030,9 +5425,6 @@ are not implemented as read-only system variables.
|
||||
.PP
|
||||
Hebrew dates in \fBRemind\fR change at midnight instead of sunset.
|
||||
.PP
|
||||
Language should be selectable at run-time, not compile-time. Don't
|
||||
expect this to happen soon!
|
||||
.PP
|
||||
\fBRemind\fR has some built-in limits (for example, number of global
|
||||
\fBOMIT\fRs.)
|
||||
.PP
|
||||
@@ -5050,4 +5442,5 @@ Catalog\fR, Jewish Publication Society of America.
|
||||
.PP
|
||||
.SH SEE ALSO
|
||||
.PP
|
||||
\fBrem\fR(1), \fBrem2ps\fR(1), \fBrem2pdf\fR(1), \fBtkremind\fR(1)
|
||||
\fBrem\fR(1), \fBrem2ps\fR(1), \fBrem2pdf\fR(1), \fBtkremind\fR(1), \fBrem2html\fR(1)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.TH TKREMIND 1 "15 January 2021"
|
||||
.TH TKREMIND 1 "14 March 2022"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
tkremind \- graphical front-end to Remind calendar program
|
||||
@@ -173,6 +173,13 @@ it will be underlined when you move the cursor over it, and
|
||||
you can edit it in a text editor by either left- or right-clicking
|
||||
on the reminder.
|
||||
|
||||
.SH ERRORS
|
||||
|
||||
If there are any errors in your reminder file, the "Queue..." button
|
||||
changes to "Errors...". Click on "Errors..." to see the Remind error
|
||||
output. Click "OK" to close the error window; this makes the button
|
||||
in the main TkRemind window to revert to "Queue..."
|
||||
|
||||
.SH BACKGROUND REMINDERS
|
||||
|
||||
If you create "timed" reminders, \fBTkRemind\fR will queue them in
|
||||
@@ -402,4 +409,5 @@ $HOME/.reminders -- default reminder file.
|
||||
$HOME/.tkremindrc -- \fBTkRemind\fR saved options.
|
||||
|
||||
.SH SEE ALSO
|
||||
remind, rem2ps
|
||||
\fBremind\fR, \fBrem2ps\fR, \fBrem2pdf\fR, \fBrem2html\fR
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ install:
|
||||
$(PERL) -M$$m -e 1 > /dev/null 2>&1; \
|
||||
if test $$? != 0 ; then echo "Not installing rem2html; missing $$m"; exit 0; fi; \
|
||||
done; \
|
||||
pod2man rem2html > rem2html.1 && mkdir -p $(DESTDIR)$(mandir)/man1 && cp rem2html.1 $(DESTDIR)$(mandir)/man1/rem2html.1 || true; \
|
||||
echo "Installing rem2html in $(DESTDIR)$(bindir)"; \
|
||||
mkdir -p $(DESTDIR)$(bindir) && sed -e 's|^#!perl|#!$(PERL)|' < rem2html > $(DESTDIR)$(bindir)/rem2html && chmod 755 $(DESTDIR)$(bindir)/rem2html && exit 0; \
|
||||
exit 1;
|
||||
|
||||
@@ -68,7 +68,7 @@ and newmoon.png, which are expected to live in C<--imgbase>.
|
||||
=item --stylesheet I<url.css>
|
||||
|
||||
Use I<url.css> as the stylesheet. If this option is used,
|
||||
I<url.css> is interpreted relative to B<imgbase> I<unless> it start
|
||||
I<url.css> is interpreted relative to B<imgbase> I<unless> it starts
|
||||
with a "/".
|
||||
|
||||
=item --nostyle
|
||||
@@ -96,11 +96,43 @@ Insert I<html_text> right before the E<lt>/bodyE<gt> tag.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SPECIALS SUPPORTED
|
||||
|
||||
The rem2html back-end supports the following SPECIAL reminders:
|
||||
|
||||
=over
|
||||
|
||||
=item HTML
|
||||
|
||||
Add an HTML reminder to the calendar. All HTML tags are available.
|
||||
|
||||
=item HTMLCLASS
|
||||
|
||||
Add a CSS class to the box representing the trigger date. See
|
||||
"HIGHLIGHTING TODAY" for an example
|
||||
|
||||
=item WEEK, MOON, SHARE, COLOR
|
||||
|
||||
The standard SPECIALs supported by all back-ends
|
||||
|
||||
=back
|
||||
|
||||
=head1 HIGHLIGHTING TODAY
|
||||
|
||||
Older versions of rem2html used to highlight today's date with a red outline.
|
||||
The current version does not do that by default. If you wish to highlight
|
||||
today's date, add the following reminder to your reminders file:
|
||||
|
||||
REM [realtoday()] SPECIAL HTMLCLASS rem-today
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
rem2html was written by Dianne Skoll with much inspiration from an
|
||||
earlier version by Don Schwarz.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
B<remind>, B<rem2ps>, B<rem2pdf>, B<tkremind>
|
||||
=cut
|
||||
|
||||
sub usage
|
||||
@@ -487,7 +519,7 @@ sub output_calendar
|
||||
}
|
||||
|
||||
for (my $day=1; $day<=$Numdays; $day++) {
|
||||
draw_day_cell($day, $number_of_rows);
|
||||
draw_day_cell($day, $number_of_rows);
|
||||
$col++;
|
||||
if ($col == 7) {
|
||||
$col = 0;
|
||||
|
||||
@@ -29,15 +29,20 @@ install:
|
||||
if test $$? != 0 ; then echo "Not installing rem2pdf; missing $$m"; exit 0; fi; \
|
||||
done; \
|
||||
echo "Installing rem2pdf"; \
|
||||
if test "$(prefix)" = "/usr" ; then \
|
||||
if test "$(INSTALL_BASE)" != "" ; then \
|
||||
$(MAKE) install DESTDIR=$(DESTDIR) "INSTALL_BASE=$(INSTALL_BASE)" && exit 0; \
|
||||
elif test "$(prefix)" = "/usr" ; then \
|
||||
$(MAKE) install DESTDIR=$(DESTDIR) INSTALLDIRS=vendor && exit 0; \
|
||||
else \
|
||||
elif test "$(prefix)" = "/usr/local" ; then \
|
||||
$(MAKE) install DESTDIR=$(DESTDIR) && exit 0; \
|
||||
else \
|
||||
$(MAKE) install DESTDIR=$(DESTDIR) "INSTALL_BASE=$(prefix)" && exit 0; \
|
||||
fi; \
|
||||
exit 1;
|
||||
|
||||
|
||||
|
||||
|
||||
Makefile: Makefile.PL
|
||||
$(PERL) Makefile.PL || true
|
||||
if test "$(prefix)" != "/usr" -a "$(prefix)" != "/usr/local" -a "$(INSTALL_BASE)" = "" ; then \
|
||||
$(PERL) Makefile.PL @PERLARTIFACTS@ INSTALL_BASE=$(prefix) || true;\
|
||||
else \
|
||||
$(PERL) Makefile.PL @PERLARTIFACTS@ INSTALL_BASE=$(INSTALL_BASE) || true;\
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!@PERL@
|
||||
use strict;
|
||||
use warnings;
|
||||
use lib '@prefix@/lib/perl5';
|
||||
|
||||
use Encode;
|
||||
use Cairo;
|
||||
@@ -40,14 +41,14 @@ my $settings = {
|
||||
width => 0,
|
||||
height => 0,
|
||||
|
||||
title_font => 'Helvetica',
|
||||
header_font => 'Helvetica',
|
||||
daynum_font => 'Helvetica Bold Oblique',
|
||||
entry_font => 'Helvetica',
|
||||
small_cal_font => 'Helvetica',
|
||||
title_font => 'Sans',
|
||||
header_font => 'Sans',
|
||||
daynum_font => 'Sans Bold Oblique',
|
||||
entry_font => 'Sans',
|
||||
small_cal_font => 'Sans',
|
||||
|
||||
title_size => 14,
|
||||
header_size => 14,
|
||||
header_size => 12,
|
||||
daynum_size => 14,
|
||||
entry_size => 8,
|
||||
|
||||
@@ -186,10 +187,11 @@ my $errored_out = 0;
|
||||
my $surface = Cairo::PdfSurface->create_for_stream(sub { print $_[1] unless $errored_out; }, undef,
|
||||
$settings->{width}, $settings->{height});
|
||||
|
||||
$surface->set_metadata('title', 'Calendar');
|
||||
$surface->set_metadata('author', 'Remind (https://dianne.skoll.ca/projects/remind/)');
|
||||
$surface->set_metadata('creator', 'rem2pdf (https://dianne.skoll.ca/projects/remind/)');
|
||||
$surface->set_metadata('subject', 'Calendar');
|
||||
# set_metadata not available in older versions of Cairo
|
||||
eval { $surface->set_metadata('title', 'Calendar'); };
|
||||
eval { $surface->set_metadata('author', 'Remind (https://dianne.skoll.ca/projects/remind/)'); };
|
||||
eval { $surface->set_metadata('creator', 'rem2pdf (https://dianne.skoll.ca/projects/remind/)'); };
|
||||
eval { $surface->set_metadata('subject', 'Calendar'); };
|
||||
|
||||
my $cr = Cairo::Context->create($surface);
|
||||
$cr->set_line_width($settings->{line_thickness});
|
||||
@@ -355,27 +357,27 @@ width and height for the options to be respected.
|
||||
=item --title-font=I<font>
|
||||
|
||||
Specify the font used for the calendar title. It can be any font that
|
||||
the Pango library on your system can use. The default is Helvetica. If
|
||||
the Pango library on your system can use. The default is Sans. If
|
||||
you choose a font with spaces in its name, you may need to quote this
|
||||
argument.
|
||||
|
||||
=item --header-font=I<font>
|
||||
|
||||
Specify the font used for the weekday names. The default is Helvetica.
|
||||
Specify the font used for the weekday names. The default is Sans.
|
||||
|
||||
=item --daynum-font=I<font>
|
||||
|
||||
Specify the font used for the day numbers. The default is
|
||||
Helvetica Bold Oblique.
|
||||
Sans Bold Oblique.
|
||||
|
||||
=item --entry-font=I<font>
|
||||
|
||||
Specify the font used for calendar entries. The default is Helvetica.
|
||||
Specify the font used for calendar entries. The default is Sans.
|
||||
|
||||
=item --small-cal-font=I<font>
|
||||
|
||||
Specify the font used for the small next- and previous-month
|
||||
calendars. The default is Helvetica.
|
||||
calendars. The default is Sans.
|
||||
|
||||
=item --title-size=I<n>
|
||||
|
||||
@@ -477,14 +479,14 @@ positioned absolutely with respect to the day's box (and is not
|
||||
counted when calculating the box's height.)
|
||||
|
||||
A positive I<x> value positions the left edge of the text I<x> points
|
||||
to the right of the left side of the calender box, while a negative
|
||||
to the right of the left side of the calendar box, while a negative
|
||||
I<x> value positions the right edge of the text I<x> points to the left
|
||||
of the right side of the calender box.
|
||||
of the right side of the calendar box.
|
||||
|
||||
A positive I<y> value positions the top edge of the text I<y> points
|
||||
below the top of the calender box, while a negative I<y> value
|
||||
below the top of the calendar box, while a negative I<y> value
|
||||
positions the bottom edge of the text I<y> points above the bottom of
|
||||
the calender box.
|
||||
the calendar box.
|
||||
|
||||
If you use absolutely-positioned text, it's up to you to make sure it
|
||||
doesn't overlap other text; B<rem2pdf> takes no special precautions to
|
||||
@@ -504,4 +506,5 @@ B<Rem2PDF> was written by Dianne Skoll <dianne@skoll.ca>
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
B<remind>, B<rem2ps>
|
||||
B<remind>, B<rem2ps>, B<rem2html>, B<tkremind>
|
||||
|
||||
|
||||
@@ -231,6 +231,10 @@ sub parse_oldstyle_line
|
||||
$hash->{r} = $1;
|
||||
$hash->{g} = $2;
|
||||
$hash->{b} = $3;
|
||||
} elsif ($hash->{body} =~ /^\s*(\d+)/) {
|
||||
$hash->{r} = $1;
|
||||
$hash->{g} = $1;
|
||||
$hash->{b} = $1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -281,7 +285,7 @@ sub read_one_month_pp
|
||||
Given a hashref C<$hash> consisting of one entry parsed
|
||||
from the "remind -p" stream and a C<$specials_accepted> hash,
|
||||
return 1 if we should include this entry in the calendar or
|
||||
0 if mot.
|
||||
0 if not.
|
||||
|
||||
=cut
|
||||
sub accept_special
|
||||
@@ -633,7 +637,7 @@ sub draw_day
|
||||
$so_far += $h2;
|
||||
}
|
||||
if ($height) {
|
||||
if ($entry_height > $height) {
|
||||
if ($h + $entry_height + 2 * $settings->{border_size} > $height) {
|
||||
print STDERR "WARNING: overfull box at $day " . $self->{monthname} . ' ' . $self->{year} . "\n";
|
||||
$entry_height = $height;
|
||||
}
|
||||
@@ -701,7 +705,8 @@ sub draw_title
|
||||
my ($self, $cr, $settings) = @_;
|
||||
my $title = $self->{monthname} . ' ' . $self->{year};
|
||||
|
||||
$cr->get_target()->set_page_label($title);
|
||||
# set_page_label not available in older versions of Cairo
|
||||
eval { $cr->get_target()->set_page_label($title); };
|
||||
my $layout = Pango::Cairo::create_layout($cr);
|
||||
$layout->set_text(Encode::decode('UTF-8', $title));
|
||||
my $desc = Pango::FontDescription->from_string($settings->{title_font} . ' ' . $settings->{title_size} . 'px');
|
||||
@@ -748,24 +753,13 @@ sub draw_small_calendar
|
||||
$last_day_on_row += 7;
|
||||
$rows++;
|
||||
}
|
||||
my $layout = Pango::Cairo::create_layout($cr);
|
||||
my $desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . '10px');
|
||||
$layout->set_font_description($desc);
|
||||
$layout->set_text('88 88 88 88 88 88 88');
|
||||
my ($wid, $h) = $layout->get_pixel_size();
|
||||
$h += 1;
|
||||
$h *= ($rows + 2); # row for month name; row for day names
|
||||
my $font_size = $self->calculate_small_calendar_font_size($cr, $width, $height, $settings, $rows);
|
||||
|
||||
my $scale = $width / $wid;
|
||||
if (($height / $h) < $scale) {
|
||||
$scale = $height / $h;
|
||||
}
|
||||
my $font_size = int($scale * 10);
|
||||
$layout = Pango::Cairo::create_layout($cr);
|
||||
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
|
||||
my $layout = Pango::Cairo::create_layout($cr);
|
||||
my $desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
|
||||
$layout->set_font_description($desc);
|
||||
$layout->set_text('88 ');
|
||||
($wid, $h) = $layout->get_pixel_size();
|
||||
my ($wid, $h) = $layout->get_pixel_size();
|
||||
$h += 1;
|
||||
|
||||
# Month name
|
||||
@@ -819,6 +813,43 @@ sub draw_small_calendar
|
||||
}
|
||||
}
|
||||
|
||||
sub calculate_small_calendar_font_size
|
||||
{
|
||||
my ($self, $cr, $width, $height, $settings, $rows) = @_;
|
||||
|
||||
my $layout = Pango::Cairo::create_layout($cr);
|
||||
my $desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . '10px');
|
||||
$layout->set_font_description($desc);
|
||||
$layout->set_text('88 88 88 88 88 88 88');
|
||||
my ($wid, $h) = $layout->get_pixel_size();
|
||||
$h += 1;
|
||||
$h *= ($rows + 2); # row for month name; row for day names
|
||||
|
||||
my $scale = $width / $wid;
|
||||
if (($height / $h) < $scale) {
|
||||
$scale = $height / $h;
|
||||
}
|
||||
my $font_size = int($scale * 10);
|
||||
|
||||
# Check
|
||||
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
|
||||
$layout->set_font_description($desc);
|
||||
$layout->set_text('88 88 88 88 88 88 88');
|
||||
($wid, $h) = $layout->get_pixel_size();
|
||||
$h += 1;
|
||||
$h *= ($rows + 2); # row for month name; row for day names
|
||||
|
||||
$scale = $width / $wid;
|
||||
if (($height / $h) < $scale) {
|
||||
$scale = $height / $h;
|
||||
}
|
||||
|
||||
if ($scale < 1) { # Font size is too big
|
||||
$font_size--;
|
||||
}
|
||||
return $font_size;
|
||||
}
|
||||
|
||||
package Remind::PDF::Multi;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
368
scripts/tkremind
368
scripts/tkremind
@@ -7,7 +7,7 @@
|
||||
# A cheesy graphical front/back end for Remind using Tcl/Tk
|
||||
#
|
||||
# This file is part of REMIND.
|
||||
# Copyright (C) 1992-2021 Dianne Skoll
|
||||
# Copyright (C) 1992-2022 Dianne Skoll
|
||||
#
|
||||
#--------------------------------------------------------------
|
||||
|
||||
@@ -103,6 +103,9 @@ set OptDescr(RunCmd) "(String) If non-blank, run specified command when a pop-up
|
||||
set Option(FeedReminder) 0
|
||||
set OptDescr(FeedReminder) "(0/1) If 1, feed the reminder to RunCmd on standard input (see RunCmd option)"
|
||||
|
||||
set Option(DayAnchor) "center"
|
||||
set OptDescr(DayAnchor) "(w/center/e) Anchor the day number to the left (w), center or right (e) of its container"
|
||||
|
||||
set Option(Editor) "emacs +%d %s"
|
||||
set OptDescr(Editor) "(String) Specify command to edit a file. %d is replaced with line number and %s with filename"
|
||||
|
||||
@@ -127,6 +130,12 @@ set OptDescr(BackgroundColor) "Default background color of calendar boxes"
|
||||
set Option(TextColor) "#000000"
|
||||
set OptDescr(TextColor) "Default text color in calendar boxes"
|
||||
|
||||
set Option(TodayColor) "#00C0C0"
|
||||
set OptDescr(TodayColor) "Background color for today heading"
|
||||
|
||||
set Option(LineColor) "#000000"
|
||||
set OptDescr(LineColor) "Color of gridlines on calendar"
|
||||
|
||||
set Option(LabelColor) "#000000"
|
||||
set OptDescr(LabelColor) "Default label color for headings"
|
||||
|
||||
@@ -165,6 +174,9 @@ set EditorPid -1
|
||||
# Inotify file
|
||||
set InotifyFP ""
|
||||
|
||||
# Errors from last remind run
|
||||
set RemindErrors ""
|
||||
|
||||
# Reminder file to append to -- default
|
||||
set AppendFile {NOSUCHFILE}
|
||||
catch {set AppendFile $ReminderFile}
|
||||
@@ -282,7 +294,17 @@ proc is_warning_header { line } {
|
||||
proc Initialize {} {
|
||||
global DayNames argc argv CommandLine ReminderFile AppendFile Remind PSCmd
|
||||
global MondayFirst TwentyFourHourMode ReminderFileModTime
|
||||
global TodayDay TodayMonth TodayYear
|
||||
|
||||
global Option ConfigFile
|
||||
|
||||
# In case date has rolled over, recalculate Today* values
|
||||
set now [clock seconds]
|
||||
|
||||
set TodayMonth [expr [string trim [clock format $now -format %N]] - 1]
|
||||
set TodayYear [clock format $now -format %Y]
|
||||
set TodayDay [string trim [clock format $now -format %e]]
|
||||
|
||||
set CommandLine "|$Remind -itkremind=1 -pp -y -l EXTRA"
|
||||
set PSCmd "$Remind -itkremind=1 -itkprint=1 -pp -l EXTRA"
|
||||
set i 0
|
||||
@@ -435,6 +457,7 @@ proc CreateCalFrame { w dayNames } {
|
||||
# Figure out reasonable height for text frames
|
||||
global SetFontsWorked
|
||||
global Option
|
||||
global MondayFirst
|
||||
set h [winfo screenheight .]
|
||||
if {$h <= 480} {
|
||||
if {$SetFontsWorked} {
|
||||
@@ -448,8 +471,7 @@ proc CreateCalFrame { w dayNames } {
|
||||
set h 5
|
||||
}
|
||||
|
||||
global MondayFirst
|
||||
frame $w -background $Option(WinBackground)
|
||||
frame $w -background $Option(LineColor)
|
||||
for {set i 0} {$i < 7} {incr i} {
|
||||
if {$MondayFirst} {
|
||||
set index [expr ($i+1)%7]
|
||||
@@ -457,28 +479,31 @@ proc CreateCalFrame { w dayNames } {
|
||||
set index $i
|
||||
}
|
||||
|
||||
label $w.day$i -border 1 -text [lindex $dayNames $index] -justify center -font HeadingFont -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
grid configure $w.day$i -row 0 -column $i -sticky ew
|
||||
label $w.day$i -bd 0 -text [lindex $dayNames $index] -justify center -font HeadingFont -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 0
|
||||
grid configure $w.day$i -row 0 -column $i -sticky ew -padx 1 -pady 1
|
||||
}
|
||||
for {set i 0} {$i < 6} {incr i} {
|
||||
set n [expr $i*7]
|
||||
for {set j 0} {$j < 7} {incr j} {
|
||||
set f [expr $n+$j]
|
||||
button $w.l$f -text "" -justify center -command "" \
|
||||
-state disabled -relief flat -border 0 -padx 0 -pady 0 -font HeadingFont
|
||||
text $w.t$f -width 12 -height $h -border 1 -spacing3 3 -wrap word -relief flat \
|
||||
-state disabled -takefocus 0 -cursor {} -font CalboxFont -foreground $Option(TextColor) -background $Option(BackgroundColor)
|
||||
button $w.l$f -text "" -justify center -command "" -anchor $Option(DayAnchor) \
|
||||
-state disabled -relief flat -bd 0 -padx 0 -pady 0 -font HeadingFont -highlightthickness 1
|
||||
text $w.t$f -width 12 -height $h -bd 0 -spacing3 3 -wrap word -relief flat \
|
||||
-state disabled -takefocus 0 -cursor {} -font CalboxFont -foreground $Option(TextColor) -background $Option(BackgroundColor) \
|
||||
-highlightthickness 0
|
||||
frame $w.f$f -padx 0 -pady 0 -highlightthickness 0 -relief flat -bd 0
|
||||
$w.t$f tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$f"
|
||||
$w.t$f tag bind REM <ButtonPress-3> "FireEditor $w.t$f"
|
||||
grid configure $w.l$f -row [expr $i*2+1] -column $j -sticky ew
|
||||
grid configure $w.t$f -row [expr $i*2+2] -column $j -sticky nsew
|
||||
pack $w.l$f -in $w.f$f -side top -expand 0 -fill x
|
||||
pack $w.t$f -in $w.f$f -side top -expand 1 -fill both
|
||||
grid configure $w.f$f -row [expr $i+1] -column $j -sticky nsew -padx 1 -pady 1
|
||||
}
|
||||
}
|
||||
|
||||
for {set i 0} {$i < 7} {incr i} {
|
||||
grid columnconfigure $w $i -weight 1
|
||||
}
|
||||
for {set i 2} {$i < 14} {incr i 2} {
|
||||
for {set i 1} {$i < 7} {incr i} {
|
||||
grid rowconfigure $w $i -weight 1
|
||||
}
|
||||
}
|
||||
@@ -504,8 +529,12 @@ proc ConfigureCalFrame { w firstDay numDays } {
|
||||
set last [expr $offset+$numDays]
|
||||
|
||||
for {set i 0} {$i < $first} {incr i} {
|
||||
grid $w.l$i $w.t$i
|
||||
$w.l$i configure -text "" -command "" -state normal -relief flat -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
grid $w.f$i
|
||||
pack $w.l$i -in $w.f$i -side top -expand 0 -fill x
|
||||
pack $w.t$i -in $w.f$i -side top -expand 1 -fill both
|
||||
raise $w.l$i
|
||||
raise $w.t$i
|
||||
$w.l$i configure -text "" -command "" -state normal -relief flat -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
$w.l$i configure -state disabled
|
||||
balloon_add_help $w.l$i ""
|
||||
$w.t$i configure -relief flat -takefocus 0 -state normal -background $Option(WinBackground)
|
||||
@@ -515,13 +544,17 @@ proc ConfigureCalFrame { w firstDay numDays } {
|
||||
}
|
||||
$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
|
||||
$w.t$i configure -state disabled -takefocus 0
|
||||
}
|
||||
for {set i $first} {$i <= $last} {incr i} {
|
||||
grid $w.l$i $w.t$i
|
||||
grid $w.f$i
|
||||
pack $w.l$i -in $w.f$i -side top -expand 0 -fill x
|
||||
pack $w.t$i -in $w.f$i -side top -expand 1 -fill both
|
||||
raise $w.l$i
|
||||
raise $w.t$i
|
||||
set d [expr $i-$first+1]
|
||||
$w.l$i configure -text $d -state normal -relief flat \
|
||||
-command "ModifyDay $d $firstDay" -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
-command "ModifyDay $d $firstDay" -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
balloon_add_help $w.l$i "Add a reminder..."
|
||||
$w.t$i configure -relief sunken -takefocus 1 -state normal -foreground $Option(TextColor) -background $Option(BackgroundColor)
|
||||
$w.t$i delete 1.0 end
|
||||
@@ -530,23 +563,27 @@ proc ConfigureCalFrame { w firstDay numDays } {
|
||||
}
|
||||
$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
|
||||
$w.t$i configure -state disabled -takefocus 0
|
||||
}
|
||||
set forgetIt 0
|
||||
for {set i [expr $last+1]} {$i < 42} {incr i} {
|
||||
if {$i%7 == 0} {
|
||||
set forgetIt 1
|
||||
}
|
||||
set row [expr ($i/7)*2+1]
|
||||
set row [expr ($i/7)+1]
|
||||
if {$forgetIt} {
|
||||
grid remove $w.l$i $w.t$i
|
||||
grid remove $w.f$i
|
||||
grid rowconfigure $w $row -weight 0
|
||||
grid rowconfigure $w [expr $row+1] -weight 0
|
||||
} else {
|
||||
grid $w.l$i $w.t$i
|
||||
grid $w.f$i
|
||||
pack $w.l$i -in $w.f$i -side top -expand 0 -fill x
|
||||
pack $w.t$i -in $w.f$i -side top -expand 1 -fill both
|
||||
raise $w.l$i
|
||||
raise $w.t$i
|
||||
grid rowconfigure $w [expr $row+1] -weight 1
|
||||
}
|
||||
$w.l$i configure -text "" -command "" -state normal -relief flat -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
$w.l$i configure -text "" -command "" -state normal -relief flat -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
$w.l$i configure -state disabled
|
||||
balloon_add_help $w.l$i ""
|
||||
$w.t$i configure -relief flat -takefocus 0 -state normal -background $Option(WinBackground)
|
||||
@@ -556,11 +593,11 @@ proc ConfigureCalFrame { w firstDay numDays } {
|
||||
}
|
||||
$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
|
||||
$w.t$i configure -state disabled -takefocus 0
|
||||
}
|
||||
if { $CurMonth == $TodayMonth && $CurYear == $TodayYear } {
|
||||
set n [expr $TodayDay + $offset]
|
||||
$w.l$n configure -background "#00c0c0"
|
||||
$w.l$n configure -background $Option(TodayColor)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,36 +614,36 @@ proc DoQueue {} {
|
||||
#---------------------------------------------------------------------------
|
||||
proc CreateCalWindow { dayNames } {
|
||||
global Option
|
||||
frame .h -background $Option(WinBackground);
|
||||
label .h.title -text "" -justify center -pady 1 -border 1 -relief raised -font HeadingFont -background $Option(WinBackground) -foreground $Option(LabelColor)
|
||||
pack .h.title -side top -fill x
|
||||
frame .h -background $Option(LineColor)
|
||||
label .h.title -text "" -justify center -pady 2 -bd 0 -relief flat -font HeadingFont -background $Option(WinBackground) -foreground $Option(LabelColor)
|
||||
pack .h.title -side top -fill x -pady 1 -padx 1
|
||||
pack .h -side top -expand 0 -fill x
|
||||
|
||||
. configure -background $Option(LineColor)
|
||||
CreateCalFrame .cal $dayNames
|
||||
|
||||
frame .b -background $Option(WinBackground);
|
||||
button .b.prev -text "\u2b9c" -command {MoveMonth -1} -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
frame .b -background $Option(LineColor)
|
||||
button .b.prev -text "\u2b9c" -command {MoveMonth -1} -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 1 -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
balloon_add_help .b.prev "Go to previous month"
|
||||
button .b.this -text {Today} -command {ThisMonth} -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
button .b.this -text {Today} -command {ThisMonth} -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 1 -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
balloon_add_help .b.this "Go to this month"
|
||||
button .b.next -text "\u2b9e" -command {MoveMonth 1} -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
button .b.next -text "\u2b9e" -command {MoveMonth 1} -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 1 -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
balloon_add_help .b.next "Go to next month"
|
||||
button .b.goto -text {Go To Date...} -command {GotoDialog} -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
button .b.goto -text {Go To Date...} -command {GotoDialog} -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 1 -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
balloon_add_help .b.goto "Go to a specific date"
|
||||
button .b.print -text {Print...} -command {DoPrint} -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
balloon_add_help .b.print "Print a PostScript calendar"
|
||||
button .b.queue -text {Queue...} -command {DoQueue} -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
balloon_add_help .b.queue "See the queue of pending reminders (debugging purposes only)"
|
||||
button .b.quit -text {Quit} -command {Quit} -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
balloon_add_help .b.quit "Quit TkRemind"
|
||||
button .b.options -text {Options...} -command EditOptions -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
button .b.print -text {Print...} -command {DoPrint} -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 1 -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
balloon_add_help .b.print "Print a PostScript or PDF calendar"
|
||||
button .b.options -text {Options...} -command EditOptions -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 1 -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
balloon_add_help .b.options "Set TkRemind options"
|
||||
label .b.status -text "" -width 25 -relief sunken -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
label .b.nqueued -text "" -width 20 -relief sunken -border 1 -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
pack .b.prev .b.this .b.next .b.goto .b.print .b.options .b.queue .b.quit -side left -fill both
|
||||
pack .b.status -side left -fill both -expand 1
|
||||
pack .b.nqueued -side left -fill both
|
||||
pack .b -side bottom -fill x -expand 0
|
||||
button .b.queue -text {Queue...} -command {DoQueue} -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 1 -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
balloon_add_help .b.queue "See the queue of pending reminders (debugging purposes only)"
|
||||
button .b.quit -text {Quit} -command {Quit} -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 1 -highlightcolor $Option(LineColor) -highlightbackground $Option(WinBackground)
|
||||
balloon_add_help .b.quit "Quit TkRemind"
|
||||
label .b.status -text "" -width 25 -relief flat -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 0
|
||||
label .b.nqueued -text "" -width 20 -relief flat -bd 0 -foreground $Option(LabelColor) -background $Option(WinBackground) -highlightthickness 0
|
||||
pack .b.prev .b.this .b.next .b.goto .b.print .b.options .b.queue .b.quit -side left -fill both -padx 1
|
||||
pack .b.status -side left -fill both -expand 1 -padx 1
|
||||
pack .b.nqueued -side left -fill both -padx 1
|
||||
pack .b -side bottom -fill x -expand 0 -pady 1
|
||||
pack .cal -side top -fill both -expand 1
|
||||
wm title . "TkRemind"
|
||||
wm iconname . ""
|
||||
@@ -689,7 +726,7 @@ proc EditOptions {} {
|
||||
pack $w.cmd -in $w.rf -side left -expand 1 -fill x
|
||||
$w.cmd insert 0 $tmpOpt(RunCmd)
|
||||
|
||||
frame $w.sep3 -border 1 -relief sunken
|
||||
frame $w.sep3 -bd 1 -relief sunken
|
||||
# E-mail reminder if popup not dismissed
|
||||
frame $w.eml
|
||||
label $w.lab_email_address -text "E-mail reminders here if popup not dismissed:" -anchor w -justify left
|
||||
@@ -734,6 +771,12 @@ proc EditOptions {} {
|
||||
label $w.bgcolor -text " Background color:"
|
||||
button $w.bbgcolor -background $Option(BackgroundColor) -command [list PickColor BackgroundColor $w.bbgcolor] -text ...
|
||||
|
||||
label $w.tbgcolor -text "Color for highlighting \"today\":"
|
||||
button $w.tbbgcolor -background $Option(TodayColor) -command [list PickColor TodayColor $w.tbbgcolor] -text ...
|
||||
|
||||
label $w.gridcolor -text " Gridline color:"
|
||||
button $w.gridbcolor -background $Option(LineColor) -command [list PickColor LineColor $w.gridbcolor] -text ...
|
||||
|
||||
grid $w.textcolor $w.btextcolor $w.bgcolor $w.bbgcolor -in $w.colors1
|
||||
grid $w.bgcolor $w.bbgcolor -in $w.colors1
|
||||
|
||||
@@ -742,22 +785,37 @@ proc EditOptions {} {
|
||||
label $w.wincolor -text " Window color:"
|
||||
button $w.bwincolor -background $Option(WinBackground) -command [list PickColor WinBackground $w.bwincolor] -text ...
|
||||
grid $w.headcolor $w.bheadcolor $w.wincolor $w.bwincolor -in $w.colors1
|
||||
|
||||
grid $w.tbgcolor $w.tbbgcolor $w.gridcolor $w.gridbcolor -in $w.colors1
|
||||
|
||||
grid columnconfigure $w.colors1 0 -weight 1
|
||||
grid columnconfigure $w.colors1 2 -weight 1
|
||||
frame $w.sep1 -border 1 -relief sunken
|
||||
frame $w.sep2 -border 1 -relief sunken
|
||||
frame $w.sep1 -bd 1 -relief sunken
|
||||
frame $w.sep2 -bd 1 -relief sunken
|
||||
|
||||
checkbutton $w.feed \
|
||||
-text "Feed popped-up reminder to command's standard input" \
|
||||
-variable tmpOpt(FeedReminder) -anchor w -justify left
|
||||
|
||||
frame $w.ancFrame
|
||||
label $w.ancLabel -text "Anchor day numbers to:"
|
||||
radiobutton $w.ancLeft \
|
||||
-text "Left" \
|
||||
-variable tmpOpt(DayAnchor) -value "w" -anchor w -justify left
|
||||
radiobutton $w.ancCenter \
|
||||
-text "Center" \
|
||||
-variable tmpOpt(DayAnchor) -value "center" -anchor w -justify left
|
||||
radiobutton $w.ancRight \
|
||||
-text "Right" \
|
||||
-variable tmpOpt(DayAnchor) -value "e" -anchor w -justify left
|
||||
pack $w.ancLabel $w.ancLeft $w.ancCenter $w.ancRight -in $w.ancFrame -side left
|
||||
|
||||
pack $w.startIconified -in $w.f -side top -expand 0 -fill x
|
||||
pack $w.showTodays -in $w.f -side top -expand 0 -fill x
|
||||
pack $w.confirmQuit -in $w.f -side top -expand 0 -fill x
|
||||
pack $w.bringDown -in $w.f -side top -expand 0 -fill x
|
||||
pack $w.ring -in $w.f -side top -expand 0 -fill x
|
||||
pack $w.deic -in $w.f -side top -expand 0 -fill x
|
||||
pack $w.ancFrame -in $w.f -side top -expand 0 -fill x
|
||||
pack $w.sep1 -in $w.f -side top -expand 0 -fill x -ipady 1
|
||||
pack $w.rf -in $w.f -side top -expand 0 -fill x
|
||||
pack $w.feed -in $w.f -side top -expand 0 -fill x
|
||||
@@ -770,10 +828,12 @@ proc EditOptions {} {
|
||||
pack $w.colors1 -in $w.f -side top -expand 0 -fill x
|
||||
pack $w.sep2 -in $w.f -side top -expand 0 -fill x -ipady 1
|
||||
|
||||
button $w.default -text "Light Theme" -command [list set_default_colors $w]
|
||||
button $w.dark -text "Dark Theme" -command [list set_dark_colors $w]
|
||||
button $w.save -text "Save Options" -command "SaveOptions $w; destroy $w"
|
||||
button $w.cancel -text "Cancel" -command "CancelOptions; destroy $w"
|
||||
wm protocol $w WM_DELETE_WINDOW "CancelOptions; destroy $w"
|
||||
pack $w.save $w.cancel -in $w.b -side left -expand 0 -fill x
|
||||
pack $w.default $w.dark $w.save $w.cancel -in $w.b -side left -expand 0 -fill x
|
||||
CenterWindow $w .
|
||||
}
|
||||
|
||||
@@ -834,6 +894,13 @@ proc SaveOptions { w } {
|
||||
for {set i 0} {$i < 7} {incr i} {
|
||||
.cal.day$i configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
}
|
||||
for {set i 0} {$i < 6} {incr i} {
|
||||
set n [expr $i*7]
|
||||
for {set j 0} {$j < 7} {incr j} {
|
||||
set f [expr $n+$j]
|
||||
.cal.l$f configure -anchor $Option(DayAnchor);
|
||||
}
|
||||
}
|
||||
.b.status configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
.b.nqueued configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
.b configure -background $Option(WinBackground)
|
||||
@@ -845,6 +912,10 @@ proc SaveOptions { w } {
|
||||
.b.queue configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
.b.quit configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
.b.options configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||
. configure -background $Option(LineColor);
|
||||
.h configure -background $Option(LineColor);
|
||||
.cal configure -background $Option(LineColor)
|
||||
.b configure -background $Option(LineColor)
|
||||
}
|
||||
|
||||
proc WriteOptionsToFile {} {
|
||||
@@ -939,11 +1010,12 @@ proc ConfigureCalWindow { month year firstDay numDays } {
|
||||
proc FillCalWindow {} {
|
||||
set FileName ""
|
||||
set LineNo 0
|
||||
global DayNames CurYear CurMonth MonthNames CommandLine Option TagToObj
|
||||
global DayNames CurYear CurMonth MonthNames CommandLine Option TagToObj RemindErrors MondayFirst
|
||||
|
||||
array unset TagToObj
|
||||
|
||||
Status "Firing off Remind..."
|
||||
set_button_to_queue
|
||||
set month [lindex $MonthNames $CurMonth]
|
||||
|
||||
set cmd [regsub EXTRA $CommandLine $Option(ExtraRemindArgs)]
|
||||
@@ -977,7 +1049,12 @@ proc FillCalWindow {} {
|
||||
|
||||
# Update the day names in the calendar window
|
||||
for {set i 0} {$i < 7} {incr i} {
|
||||
.cal.day$i configure -text [lindex $DayNames $i]
|
||||
if {$MondayFirst} {
|
||||
set index [expr ($i+1)%7]
|
||||
} else {
|
||||
set index $i
|
||||
}
|
||||
.cal.day$i configure -text [lindex $DayNames $index]
|
||||
}
|
||||
set offset [CalEntryOffset $firstWkday]
|
||||
|
||||
@@ -1032,7 +1109,7 @@ proc FillCalWindow {} {
|
||||
continue
|
||||
}
|
||||
"MOON" {
|
||||
DoMoonSpecial $n $stuff $fntag
|
||||
DoMoonSpecial $n $stuff $fntag $day
|
||||
continue
|
||||
}
|
||||
"COLOUR" -
|
||||
@@ -1057,7 +1134,7 @@ proc FillCalWindow {} {
|
||||
set extratags "clr$color"
|
||||
.cal.t$n configure -state normal
|
||||
.cal.t$n tag configure $extratags -foreground "#$color"
|
||||
.cal.t$n configure -state disabled
|
||||
.cal.t$n configure -state disabled -takefocus 0
|
||||
set stuff $rest
|
||||
set type "COLOR"
|
||||
}
|
||||
@@ -1083,16 +1160,27 @@ proc FillCalWindow {} {
|
||||
}
|
||||
}
|
||||
.cal.t$n insert end "\n"
|
||||
.cal.t$n configure -state disabled
|
||||
.cal.t$n configure -state disabled -takefocus 0
|
||||
|
||||
}
|
||||
set problem [catch { close $file } errmsg]
|
||||
if {$problem} {
|
||||
tk_dialog .error Error "There was a problem running Remind: $errmsg" error 0 OK
|
||||
set RemindErrors [unique_lines $errmsg]
|
||||
set_button_to_errors
|
||||
}
|
||||
DisplayTime
|
||||
}
|
||||
|
||||
proc unique_lines { s } {
|
||||
set l [split $s "\n"]
|
||||
foreach line $l {
|
||||
if {"$line" != ""} {
|
||||
dict set d $line 1
|
||||
}
|
||||
}
|
||||
return [join [dict keys $d] "\n"]
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# MoveMonth -- move by +1 or -1 months
|
||||
# Arguments:
|
||||
@@ -1152,13 +1240,13 @@ proc DoPrint {} {
|
||||
toplevel .p
|
||||
wm title .p "TkRemind Print..."
|
||||
wm iconname .p "Print..."
|
||||
frame .p.f1 -relief sunken -border 2
|
||||
frame .p.f1 -relief sunken -bd 2
|
||||
frame .p.f11
|
||||
frame .p.f12
|
||||
frame .p.f2 -relief sunken -border 2
|
||||
frame .p.f2a -relief sunken -border 2
|
||||
frame .p.f3 -relief sunken -border 2
|
||||
frame .p.f3a -relief sunken -border 2
|
||||
frame .p.f2 -relief sunken -bd 2
|
||||
frame .p.f2a -relief sunken -bd 2
|
||||
frame .p.f3 -relief sunken -bd 2
|
||||
frame .p.f3a -relief sunken -bd 2
|
||||
frame .p.f4
|
||||
|
||||
radiobutton .p.tofile -text "To file: " -variable Option(PrintDest) -value file
|
||||
@@ -1169,7 +1257,7 @@ proc DoPrint {} {
|
||||
.p.command insert end "lpr"
|
||||
|
||||
if { $HaveRem2PDF } {
|
||||
frame .p.ff -relief sunken -border 2
|
||||
frame .p.ff -relief sunken -bd 2
|
||||
label .p.format -text "Output Format:"
|
||||
radiobutton .p.pdf -text "PDF" -variable Option(PrintFormat) -value pdf
|
||||
radiobutton .p.ps -text "PostScript" -variable Option(PrintFormat) -value ps
|
||||
@@ -1451,16 +1539,16 @@ proc CreateModifyDialog {w day firstDay args} {
|
||||
set month [lindex $MonthNames $CurMonth]
|
||||
set wkday [lindex $EnglishDayNames [expr ($day+$firstDay-1) % 7]]
|
||||
|
||||
frame $w.o -border 4 -relief ridge
|
||||
frame $w.o1 -border 4
|
||||
frame $w.o2 -border 4
|
||||
frame $w.o3 -border 4
|
||||
frame $w.exp -border 4
|
||||
frame $w.adv -border 4
|
||||
frame $w.weekend -border 4
|
||||
frame $w.durationbox -border 4
|
||||
frame $w.time -border 4
|
||||
frame $w.hol -border 4
|
||||
frame $w.o -bd 4 -relief ridge
|
||||
frame $w.o1 -bd 4
|
||||
frame $w.o2 -bd 4
|
||||
frame $w.o3 -bd 4
|
||||
frame $w.exp -bd 4
|
||||
frame $w.adv -bd 4
|
||||
frame $w.weekend -bd 4
|
||||
frame $w.durationbox -bd 4
|
||||
frame $w.time -bd 4
|
||||
frame $w.hol -bd 4
|
||||
frame $w.msg
|
||||
frame $w.buttons
|
||||
pack $w.o1 $w.o2 $w.o3 -side top -anchor w -in $w.o
|
||||
@@ -3530,7 +3618,7 @@ proc DoShadeSpecial { n r g b } {
|
||||
# %DESCRIPTION:
|
||||
# Handles the "MOON" special -- draws a moon symbol
|
||||
#***********************************************************************
|
||||
proc DoMoonSpecial { n stuff fntag } {
|
||||
proc DoMoonSpecial { n stuff fntag day } {
|
||||
set msg ""
|
||||
set num [scan $stuff "%d %d %d %s" phase junk1 junk2 msg]
|
||||
if {$num < 1} {
|
||||
@@ -3539,12 +3627,24 @@ proc DoMoonSpecial { n stuff fntag } {
|
||||
if {$phase < 0 || $phase > 3} {
|
||||
return
|
||||
}
|
||||
|
||||
switch -exact -- $phase {
|
||||
0 { set win .moon_new }
|
||||
1 { set win .moon_first }
|
||||
2 { set win .moon_full }
|
||||
3 { set win .moon_last }
|
||||
0 { set win .moon_new }
|
||||
1 { set win .moon_first }
|
||||
2 { set win .moon_full }
|
||||
3 { set win .moon_last }
|
||||
}
|
||||
|
||||
# We need two sets of moon phase windows. There can be
|
||||
# two of a given phase in the same month, but Tk does
|
||||
# not allow the same embedded window in two separate
|
||||
# text boxes. So we use this hack to make sure
|
||||
# we use a different window if the same moon phase
|
||||
# happens twice in a month.
|
||||
if {$day > 16} {
|
||||
append win "2"
|
||||
}
|
||||
|
||||
.cal.t$n configure -state normal
|
||||
.cal.t$n window create 1.0 -window $win
|
||||
|
||||
@@ -3569,7 +3669,7 @@ proc DoMoonSpecial { n stuff fntag } {
|
||||
.cal.t$n tag bind $fntag <ButtonPress-1> "FireEditor .cal.t$n $fntag"
|
||||
}
|
||||
}
|
||||
.cal.t$n configure -state disabled
|
||||
.cal.t$n configure -state disabled -takefocus 0
|
||||
}
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: DisplayTime
|
||||
@@ -3607,8 +3707,12 @@ proc CreateMoonWindows {} {
|
||||
catch { destroy .moon_full }
|
||||
catch { destroy .moon_last }
|
||||
|
||||
catch { destroy .moon_new2 }
|
||||
catch { destroy .moon_first2}
|
||||
catch { destroy .moon_full2 }
|
||||
catch { destroy .moon_last2 }
|
||||
|
||||
set extra 1
|
||||
#set wid [font measure CalboxFont 0]
|
||||
set wid [font metrics CalboxFont -ascent]
|
||||
set orig_wid $wid
|
||||
incr wid $extra
|
||||
@@ -3619,24 +3723,32 @@ proc CreateMoonWindows {} {
|
||||
incr orig_wid $extra
|
||||
|
||||
set w [expr $extra+$orig_wid]
|
||||
canvas .moon_new -background $Option(BackgroundColor) -width $wid -height $wid -borderwidth 0 -highlightthickness 0
|
||||
.moon_new create oval $extra $extra $w $w -outline $Option(TextColor) -width 1
|
||||
|
||||
canvas .moon_first -background $Option(BackgroundColor) -width $wid -height $wid -borderwidth 0 -highlightthickness 0
|
||||
.moon_first create oval $extra $extra $w $w -outline $Option(TextColor) -width 1
|
||||
.moon_first create arc $extra $extra $w $w -outline $Option(TextColor) -fill $Option(TextColor) -start 90 -extent 180 -outline {}
|
||||
foreach win {.moon_new .moon_new2 } {
|
||||
canvas $win -background $Option(BackgroundColor) -width $wid -height $wid -borderwidth 0 -highlightthickness 0
|
||||
$win create oval $extra $extra $w $w -outline $Option(TextColor) -width 1
|
||||
balloon_add_help $win "New Moon"
|
||||
}
|
||||
|
||||
canvas .moon_full -background $Option(BackgroundColor) -width $wid -height $wid -borderwidth 0 -highlightthickness 0
|
||||
.moon_full create oval $extra $extra $w $w -outline $Option(TextColor) -fill $Option(TextColor) -width 1
|
||||
foreach win {.moon_first .moon_first2 } {
|
||||
canvas $win -background $Option(BackgroundColor) -width $wid -height $wid -borderwidth 0 -highlightthickness 0
|
||||
$win create oval $extra $extra $w $w -outline $Option(TextColor) -width 1
|
||||
$win create arc $extra $extra $w $w -outline $Option(TextColor) -fill $Option(TextColor) -start 90 -extent 180 -outline {}
|
||||
balloon_add_help $win "First Quarter"
|
||||
}
|
||||
|
||||
canvas .moon_last -background $Option(BackgroundColor) -width $wid -height $wid -borderwidth 0 -highlightthickness 0
|
||||
.moon_last create oval $extra $extra $w $w -outline $Option(TextColor) -width 1
|
||||
.moon_last create arc $extra $extra $w $w -outline $Option(TextColor) -fill $Option(TextColor) -start 270 -extent 180 -outline {}
|
||||
foreach win {.moon_full .moon_full2 } {
|
||||
canvas $win -background $Option(BackgroundColor) -width $wid -height $wid -borderwidth 0 -highlightthickness 0
|
||||
$win create oval $extra $extra $w $w -outline $Option(TextColor) -fill $Option(TextColor) -width 1
|
||||
balloon_add_help $win "Full Moon"
|
||||
}
|
||||
|
||||
balloon_add_help .moon_new "New Moon"
|
||||
balloon_add_help .moon_first "First Quarter"
|
||||
balloon_add_help .moon_full "Full Moon"
|
||||
balloon_add_help .moon_last "Last Quarter"
|
||||
foreach win {.moon_last .moon_last2 } {
|
||||
canvas $win -background $Option(BackgroundColor) -width $wid -height $wid -borderwidth 0 -highlightthickness 0
|
||||
$win create oval $extra $extra $w $w -outline $Option(TextColor) -width 1
|
||||
$win create arc $extra $extra $w $w -outline $Option(TextColor) -fill $Option(TextColor) -start 270 -extent 180 -outline {}
|
||||
balloon_add_help $win "Last Quarter"
|
||||
}
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
@@ -3996,4 +4108,72 @@ proc FindConfigFile {} {
|
||||
set ConfigFile "~/.tkremindrc"
|
||||
}
|
||||
|
||||
proc set_default_colors { w } {
|
||||
global tmpOpt
|
||||
set tmpOpt(BackgroundColor) "#d9d9d9"
|
||||
set tmpOpt(LabelColor) "#000000"
|
||||
set tmpOpt(LineColor) "#000000"
|
||||
set tmpOpt(TextColor) "#000000"
|
||||
set tmpOpt(TodayColor) "#00C0C0"
|
||||
set tmpOpt(WinBackground) "#d9d9d9"
|
||||
update_color_buttons $w
|
||||
}
|
||||
|
||||
proc set_dark_colors { w } {
|
||||
global tmpOpt
|
||||
set tmpOpt(BackgroundColor) "#000000"
|
||||
set tmpOpt(LabelColor) "#00ffff"
|
||||
set tmpOpt(LineColor) "#0080fc"
|
||||
set tmpOpt(TextColor) "#ffffff"
|
||||
set tmpOpt(TodayColor) "#b000b6"
|
||||
set tmpOpt(WinBackground) "#000000"
|
||||
update_color_buttons $w
|
||||
}
|
||||
|
||||
proc update_color_buttons { w } {
|
||||
global tmpOpt
|
||||
$w.bbgcolor configure -background $tmpOpt(BackgroundColor)
|
||||
$w.bheadcolor configure -background $tmpOpt(LabelColor)
|
||||
$w.gridbcolor configure -background $tmpOpt(LineColor)
|
||||
$w.btextcolor configure -background $tmpOpt(TextColor)
|
||||
$w.tbbgcolor configure -background $tmpOpt(TodayColor)
|
||||
$w.bwincolor configure -background $tmpOpt(WinBackground)
|
||||
}
|
||||
|
||||
proc set_button_to_queue {} {
|
||||
.b.queue configure -text {Queue...} -command {DoQueue}
|
||||
}
|
||||
proc set_button_to_errors {} {
|
||||
.b.queue configure -text {Errors...} -command {ShowErrors}
|
||||
}
|
||||
|
||||
proc ShowErrors {} {
|
||||
global RemindErrors
|
||||
set w ".errors"
|
||||
catch { destroy $w }
|
||||
toplevel $w
|
||||
text $w.t -width 80 -height 30 -wrap word -yscrollcommand "$w.sb set"
|
||||
scrollbar $w.sb -orient vertical -command "$w.t yview"
|
||||
button $w.ok -text OK -command DoneShowingErrors
|
||||
grid $w.t -row 0 -column 0 -sticky nsew
|
||||
grid $w.sb -row 0 -column 1 -sticky ns
|
||||
grid $w.ok -row 1 -column 0 -stick w
|
||||
grid columnconfigure $w 0 -weight 1
|
||||
grid columnconfigure $w 1 -weight 0
|
||||
grid rowconfigure $w 0 -weight 1
|
||||
grid rowconfigure $w 1 -weight 0
|
||||
$w.t insert end $RemindErrors
|
||||
$w.t configure -state disabled
|
||||
CenterWindow $w .
|
||||
}
|
||||
|
||||
proc DoneShowingErrors {} {
|
||||
global RemindErrors
|
||||
set RemindErrors {}
|
||||
set_button_to_queue
|
||||
destroy .errors
|
||||
}
|
||||
|
||||
# Rem2PS program to execute -- supply full path if you want
|
||||
|
||||
main
|
||||
|
||||
@@ -40,7 +40,7 @@ test: remind
|
||||
@sh ../tests/test-rem
|
||||
|
||||
.c.o:
|
||||
@CC@ -c @CPPFLAGS@ @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -I. -I$(srcdir) $<
|
||||
@CC@ -c @CPPFLAGS@ @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -DSYSDIR=$(datarootdir)/remind -I. -I$(srcdir) $<
|
||||
|
||||
$(REMINDOBJS): $(REMINDHDRS)
|
||||
|
||||
@@ -61,6 +61,8 @@ install-nostripped: all
|
||||
for man in $(MANS) ; do \
|
||||
$(INSTALL_DATA) $$man $(DESTDIR)$(mandir)/man1 || exit 1; \
|
||||
done
|
||||
-mkdir -p $(DESTDIR)$(datarootdir)/remind || true
|
||||
cp -R ../include/* $(DESTDIR)$(datarootdir)/remind
|
||||
|
||||
install: install-nostripped
|
||||
strip $(DESTDIR)$(bindir)/remind || true
|
||||
|
||||
129
src/calendar.c
129
src/calendar.c
@@ -5,7 +5,7 @@
|
||||
/* The code for generating a calendar. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -26,6 +27,11 @@
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
#include <langinfo.h>
|
||||
#endif
|
||||
|
||||
#include "lang.h"
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
@@ -75,6 +81,8 @@ static struct line_drawing VT100Drawing = {
|
||||
"\x6c", "\x74", "\x6a", "\x71"
|
||||
};
|
||||
|
||||
static int encoding_is_utf8 = 0;
|
||||
|
||||
static struct line_drawing UTF8Drawing = {
|
||||
"", "",
|
||||
"\xe2\x94\xb4",
|
||||
@@ -248,6 +256,21 @@ static void WriteBottomCalLine (void);
|
||||
static void WriteIntermediateCalLine (void);
|
||||
static void WriteCalDays (void);
|
||||
|
||||
static void
|
||||
send_lrm(void)
|
||||
{
|
||||
/* Don't send LRM if SuppressLRM is set */
|
||||
if (SuppressLRM) {
|
||||
return;
|
||||
}
|
||||
/* Send a lrm control sequence if UseUTF8Chars is enabled
|
||||
or char encoding is UTF-8
|
||||
*/
|
||||
if (UseUTF8Chars || encoding_is_utf8) {
|
||||
printf("\xE2\x80\x8E");
|
||||
}
|
||||
}
|
||||
|
||||
static char const *
|
||||
despace(char const *s)
|
||||
{
|
||||
@@ -587,6 +610,14 @@ void ProduceCalendar(void)
|
||||
{
|
||||
int y, m, d;
|
||||
|
||||
/* Check if current locale is UTF-8, if we have langinfo.h */
|
||||
#ifdef HAVE_LANGINFO_H
|
||||
char const *encoding = nl_langinfo(CODESET);
|
||||
if (!strcasecmp(encoding, "utf-8")) {
|
||||
encoding_is_utf8 = 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
if (UseUTF8Chars) {
|
||||
linestruct = &UTF8Drawing;
|
||||
} else if (UseVTChars) {
|
||||
@@ -684,7 +715,7 @@ static void DoCalendarOneWeek(int nleft)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
for (l=0; l<CalPad; l++) {
|
||||
gon();
|
||||
DRAW(tb);
|
||||
@@ -695,7 +726,7 @@ static void DoCalendarOneWeek(int nleft)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
/* Write the body lines */
|
||||
@@ -716,7 +747,7 @@ static void DoCalendarOneWeek(int nleft)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
/* Write the final line */
|
||||
@@ -867,7 +898,7 @@ static int WriteCalendarRow(void)
|
||||
sprintf(buf, "%d ", d+i-wd);
|
||||
if (Julian(y, m, d+i-wd) == RealToday) {
|
||||
PrintLeft(buf, ColSpaces-1, '*');
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
} else {
|
||||
PrintLeft(buf, ColSpaces, ' ');
|
||||
}
|
||||
@@ -876,7 +907,7 @@ static int WriteCalendarRow(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
for (l=0; l<CalPad; l++) {
|
||||
gon();
|
||||
DRAW(tb);
|
||||
@@ -887,7 +918,7 @@ static int WriteCalendarRow(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
/* Write the body lines */
|
||||
@@ -908,7 +939,7 @@ static int WriteCalendarRow(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
moreleft = (d+7-wd <= DaysInMonth(m, y));
|
||||
@@ -934,7 +965,7 @@ static void PrintLeft(char const *s, int width, char pad)
|
||||
#ifndef REM_USE_WCHAR
|
||||
int len = strlen(s);
|
||||
printf("%s", s);
|
||||
while (len++ < width) PutChar(pad);
|
||||
while (len++ < width) putchar(pad);
|
||||
#else
|
||||
size_t len = mbstowcs(NULL, s, 0);
|
||||
int i;
|
||||
@@ -975,6 +1006,10 @@ static void PrintLeft(char const *s, int width, char pad)
|
||||
while (*ws && wcwidth(*ws) == 0) {
|
||||
PutWideChar(*ws++);
|
||||
}
|
||||
|
||||
/* Possibly send lrm control sequence */
|
||||
send_lrm();
|
||||
|
||||
for (i=display_len; i<width; i++) fputc(pad, stdout);
|
||||
if (buf != static_buf) free(buf);
|
||||
#endif
|
||||
@@ -999,10 +1034,10 @@ static void PrintCentered(char const *s, int width, char *pad)
|
||||
for (i=0; i<width; i++) {
|
||||
if (*s) {
|
||||
if (isspace(*s)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
s++;
|
||||
} else {
|
||||
PutChar(*s++);
|
||||
putchar(*s++);
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
@@ -1055,6 +1090,9 @@ static void PrintCentered(char const *s, int width, char *pad)
|
||||
while (*ws && wcwidth(*ws) == 0) {
|
||||
PutWideChar(*ws++);
|
||||
}
|
||||
/* Possibly send lrm control sequence */
|
||||
send_lrm();
|
||||
|
||||
for (i=d+display_len; i<width; i++) fputs(pad, stdout);
|
||||
if (buf != static_buf) free(buf);
|
||||
#endif
|
||||
@@ -1084,12 +1122,11 @@ static int WriteOneCalLine(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* WriteOneColLine */
|
||||
@@ -1140,9 +1177,14 @@ static int WriteOneColLine(int col)
|
||||
}
|
||||
if (iswspace(*ws)) {
|
||||
wspace = ws;
|
||||
}
|
||||
if (wcwidth(*ws)) {
|
||||
width++;
|
||||
} else {
|
||||
if (wcwidth(*ws)) {
|
||||
width += wcwidth(*ws);
|
||||
if (width > ColSpaces) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
ws++;
|
||||
}
|
||||
@@ -1154,13 +1196,16 @@ static int WriteOneColLine(int col)
|
||||
|
||||
/* If we couldn't find a space char, print what we have. */
|
||||
if (!wspace) {
|
||||
for (ws = e->wc_pos; ws - e->wc_pos < ColSpaces; ws++) {
|
||||
for (ws = e->wc_pos; numwritten < ColSpaces; ws++) {
|
||||
if (!*ws) break;
|
||||
if (iswspace(*ws)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
numwritten++;
|
||||
} else {
|
||||
if (wcwidth(*ws) > 0) {
|
||||
if (numwritten + wcwidth(*ws) > ColSpaces) {
|
||||
break;
|
||||
}
|
||||
numwritten += wcwidth(*ws);
|
||||
}
|
||||
PutWideChar(*ws);
|
||||
@@ -1172,7 +1217,7 @@ static int WriteOneColLine(int col)
|
||||
for (ws = e->wc_pos; ws<wspace; ws++) {
|
||||
if (!*ws) break;
|
||||
if (iswspace(*ws)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
numwritten++;
|
||||
} else {
|
||||
if (wcwidth(*ws) > 0) {
|
||||
@@ -1188,8 +1233,11 @@ static int WriteOneColLine(int col)
|
||||
printf("%s", Decolorize(e->r, e->g, e->b));
|
||||
}
|
||||
|
||||
/* Possibly send lrm control sequence */
|
||||
send_lrm();
|
||||
|
||||
/* Flesh out the rest of the column */
|
||||
while(numwritten++ < ColSpaces) PutChar(' ');
|
||||
while(numwritten++ < ColSpaces) putchar(' ');
|
||||
|
||||
/* Skip any spaces before next word */
|
||||
while (iswspace(*ws)) ws++;
|
||||
@@ -1244,9 +1292,9 @@ static int WriteOneColLine(int col)
|
||||
if (!*s) break;
|
||||
numwritten++;
|
||||
if (isspace(*s)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
} else {
|
||||
PutChar(*s);
|
||||
putchar(*s);
|
||||
}
|
||||
}
|
||||
e->pos = s;
|
||||
@@ -1256,9 +1304,9 @@ static int WriteOneColLine(int col)
|
||||
if (!*s) break;
|
||||
numwritten++;
|
||||
if (isspace(*s)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
} else {
|
||||
PutChar(*s);
|
||||
putchar(*s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1269,7 +1317,7 @@ static int WriteOneColLine(int col)
|
||||
}
|
||||
|
||||
/* Flesh out the rest of the column */
|
||||
while(numwritten++ < ColSpaces) PutChar(' ');
|
||||
while(numwritten++ < ColSpaces) putchar(' ');
|
||||
|
||||
/* Skip any spaces before next word */
|
||||
while (isspace(*s)) s++;
|
||||
@@ -1423,7 +1471,7 @@ static void WriteCalHeader(void)
|
||||
gon();
|
||||
DRAW(tb);
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
|
||||
WritePostHeaderLine();
|
||||
WriteCalDays();
|
||||
@@ -1437,7 +1485,7 @@ static void WriteCalHeader(void)
|
||||
/***************************************************************/
|
||||
static void WriteCalTrailer(void)
|
||||
{
|
||||
PutChar('\f');
|
||||
putchar('\f');
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -1824,6 +1872,13 @@ static int DoCalRem(ParsePtr p, int col)
|
||||
e->next = CurCol;
|
||||
CalColumn[col] = e;
|
||||
SortCol(&CalColumn[col]);
|
||||
} else {
|
||||
/* Parse the rest of the line to catch expression-pasting errors */
|
||||
while (ParseChar(p, &r, 0)) {
|
||||
if (r != 0) {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
@@ -2051,7 +2106,7 @@ static void WriteTopCalLine(void)
|
||||
PrintCentered("", CalWidth-2, linestruct->lr);
|
||||
DRAW(bl);
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WriteBottomCalLine(void)
|
||||
@@ -2068,7 +2123,7 @@ static void WriteBottomCalLine(void)
|
||||
}
|
||||
}
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WritePostHeaderLine(void)
|
||||
@@ -2085,7 +2140,7 @@ static void WritePostHeaderLine(void)
|
||||
}
|
||||
}
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WriteWeekHeaderLine(void)
|
||||
@@ -2102,7 +2157,7 @@ static void WriteWeekHeaderLine(void)
|
||||
}
|
||||
}
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WriteIntermediateCalLine(void)
|
||||
@@ -2120,7 +2175,7 @@ static void WriteIntermediateCalLine(void)
|
||||
}
|
||||
}
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WriteCalDays(void)
|
||||
@@ -2138,7 +2193,7 @@ static void WriteCalDays(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -2195,14 +2250,14 @@ CalendarTime(int tim, int duration)
|
||||
}
|
||||
|
||||
if (h >= 12) {
|
||||
ampm1 = L_PM;
|
||||
ampm1 = DynamicPm;
|
||||
} else {
|
||||
ampm1 = L_AM;
|
||||
ampm1 = DynamicAm;
|
||||
}
|
||||
if (h2 >= 12) {
|
||||
ampm2 = L_PM;
|
||||
ampm2 = DynamicPm;
|
||||
} else {
|
||||
ampm2 = L_AM;
|
||||
ampm2 = DynamicAm;
|
||||
}
|
||||
if (!days) {
|
||||
if (!strcmp(ampm1, ampm2)) {
|
||||
@@ -2249,7 +2304,7 @@ char const *SimpleTime(int tim)
|
||||
if (h == 0) hh=12;
|
||||
else if (h > 12) hh=h-12;
|
||||
else hh=h;
|
||||
sprintf(buf, "%d%c%02d%s ", hh, TimeSep, min, (h>=12) ? L_PM : L_AM);
|
||||
sprintf(buf, "%d%c%02d%s ", hh, TimeSep, min, (h>=12) ? DynamicPm : DynamicAm);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
54
src/compare-language-mods.pl
Executable file
54
src/compare-language-mods.pl
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $language_map = {
|
||||
en => 'ENGLISH',
|
||||
de => 'GERMAN',
|
||||
nl => 'DUTCH',
|
||||
fi => 'FINNISH',
|
||||
fr => 'FRENCH',
|
||||
'no' => 'NORWEGIAN',
|
||||
da => 'DANISH',
|
||||
pl => 'POLISH',
|
||||
is => 'ICELANDIC',
|
||||
pt => 'BRAZPORT',
|
||||
it => 'ITALIAN',
|
||||
ro => 'ROMANIAN',
|
||||
es => 'SPANISH',
|
||||
};
|
||||
|
||||
if (!$ARGV[0]) {
|
||||
print STDERR "Usage: $0 lang_code\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
my $lang = $ARGV[0];
|
||||
if (!exists($language_map->{$lang})) {
|
||||
print STDERR "$lang is not a valid language.\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
my $flag = $language_map->{$lang};
|
||||
print STDERR "Testing for: $lang - $flag.\n";
|
||||
my_sys("make clean > /dev/null 2>&1") && die("make clean failed");
|
||||
my_sys("make -j6 all LANGDEF=-DLANG=$flag > /dev/null 2>&1") && die("make all failed");
|
||||
my_sys("./remind -q -r ../tests/tstlang.rem 2022-03-23 11:44 > test-$lang-compiled.out 2>&1");
|
||||
|
||||
my_sys("make clean > /dev/null 2>&1") && die("make clean failed");
|
||||
my_sys("make -j6 all > /dev/null 2>&1") && die("make all failed");
|
||||
my_sys("./remind -q -r -ii=\\\"../include/lang/$lang.rem\\\" ../tests/tstlang.rem 2022-03-23 11:44 > test-$lang-runtime.out 2>&1");
|
||||
|
||||
my $rc = my_sys("cmp test-$lang-compiled.out test-$lang-runtime.out > /dev/null 2>&1");
|
||||
if ($rc == 0) {
|
||||
print STDERR "Congrats! Compiled and runtime language output matches for $lang.\n";
|
||||
} else {
|
||||
print STDERR "Whoops. Compiled and runtime language output differs for $lang.\n"
|
||||
}
|
||||
exit(0);
|
||||
|
||||
sub my_sys
|
||||
{
|
||||
#print STDERR "Running: " . join(' ', @_) . "\n";
|
||||
return system(@_);
|
||||
}
|
||||
@@ -20,6 +20,8 @@
|
||||
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
#undef HAVE_LANGINFO_H
|
||||
|
||||
#undef HAVE_GLOB
|
||||
|
||||
#undef HAVE_SETENV
|
||||
@@ -38,7 +40,4 @@
|
||||
/* The number of bytes in a unsigned long. */
|
||||
#undef SIZEOF_UNSIGNED_LONG
|
||||
|
||||
/* The number of bytes in a unsigned short. */
|
||||
#undef SIZEOF_UNSIGNED_SHORT
|
||||
|
||||
#include "custom.h"
|
||||
|
||||
51
src/custom.h
51
src/custom.h
@@ -6,27 +6,23 @@
|
||||
/* which you can customize. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
||||
/* DEFAULT_LATITUDE: Latitude of your location */
|
||||
/* DEFAULT_LONGITUDE: Longitude of your location */
|
||||
/* LOCATION: A string identifying your location. */
|
||||
/* All latitude and longitude numbers should be positive for the */
|
||||
/* northern and western hemisphere. If you live in the southern */
|
||||
/* hemisphere, ALL latitude values should be negative. If you live */
|
||||
/* in the eastern hemisphere, ALL longitude values should be negative. */
|
||||
/* Latitude and longitude should be positive for the */
|
||||
/* northern and eastern hemisphere and negative for the southern and */
|
||||
/* western hemisphere. */
|
||||
/* */
|
||||
/* The default values are initially set to Ottawa, Ontario, Canada. */
|
||||
/* The default values are initially set to the city hall in Ottawa, */
|
||||
/* Ontario, Canada. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define LAT_DEG 45
|
||||
#define LAT_MIN 25
|
||||
#define LAT_SEC 30
|
||||
#define LON_DEG 75
|
||||
#define LON_MIN 41
|
||||
#define LON_SEC 59
|
||||
#define DEFAULT_LATITUDE 45.420556
|
||||
#define DEFAULT_LONGITUDE -75.689722
|
||||
#define LOCATION "Ottawa"
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -58,12 +54,6 @@
|
||||
#define DATETIMESEP '@'
|
||||
/* #define DATETIMESEP '/' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
||||
/* the -u option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define WANT_U_OPTION 1
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
@@ -81,16 +71,7 @@
|
||||
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
||||
/* characters to be escaped with a backslash for the -k option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(UNIX)
|
||||
#define WANT_SHELL_ESCAPING 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Some implementations have a broken 'putc' and 'putchar'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#ifdef __SASC_60
|
||||
#define BROKEN_PUTC
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
||||
@@ -135,7 +116,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* VAL_STACK_SIZE: The size of the operand stack for expr. parsing */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define VAL_STACK_SIZE 500
|
||||
#define VAL_STACK_SIZE 1000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* INCLUDE_NEST: How many nested INCLUDES do we handle? */
|
||||
@@ -156,7 +137,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_FULL_OMITS 500
|
||||
#define MAX_FULL_OMITS 1000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form MM DD do we handle? */
|
||||
@@ -190,14 +171,6 @@
|
||||
#define PSBEGIN2 "# rem2ps2 begin"
|
||||
#define PSEND2 "# rem2ps2 end"
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
#define Putc SafePutc
|
||||
#define PutChar SafePutChar
|
||||
#else
|
||||
#define Putc putc
|
||||
#define PutChar putchar
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
|
||||
#define REM_USE_WCHAR 1
|
||||
#else
|
||||
|
||||
@@ -6,27 +6,23 @@
|
||||
/* which you can customize. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
||||
/* DEFAULT_LATITUDE: Latitude of your location */
|
||||
/* DEFAULT_LONGITUDE: Longitude of your location */
|
||||
/* LOCATION: A string identifying your location. */
|
||||
/* All latitude and longitude numbers should be positive for the */
|
||||
/* northern and western hemisphere. If you live in the southern */
|
||||
/* hemisphere, ALL latitude values should be negative. If you live */
|
||||
/* in the eastern hemisphere, ALL longitude values should be negative. */
|
||||
/* Latitude and longitude should be positive for the */
|
||||
/* northern and eastern hemisphere and negative for the southern and */
|
||||
/* western hemisphere. */
|
||||
/* */
|
||||
/* The default values are initially set to Ottawa, Ontario, Canada. */
|
||||
/* The default values are initially set to the city hall in Ottawa, */
|
||||
/* Ontario, Canada. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define LAT_DEG 45
|
||||
#define LAT_MIN 25
|
||||
#define LAT_SEC 30
|
||||
#define LON_DEG 75
|
||||
#define LON_MIN 41
|
||||
#define LON_SEC 59
|
||||
#define DEFAULT_LATITUDE 45.420556
|
||||
#define DEFAULT_LONGITUDE -75.689722
|
||||
#define LOCATION "Ottawa"
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -58,12 +54,6 @@
|
||||
#define DATETIMESEP '@'
|
||||
/* #define DATETIMESEP '/' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
||||
/* the -u option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define WANT_U_OPTION 1
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
@@ -81,16 +71,7 @@
|
||||
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
||||
/* characters to be escaped with a backslash for the -k option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(UNIX)
|
||||
#define WANT_SHELL_ESCAPING 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Some implementations have a broken 'putc' and 'putchar'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#ifdef __SASC_60
|
||||
#define BROKEN_PUTC
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
||||
@@ -135,7 +116,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* VAL_STACK_SIZE: The size of the operand stack for expr. parsing */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define VAL_STACK_SIZE 500
|
||||
#define VAL_STACK_SIZE 1000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* INCLUDE_NEST: How many nested INCLUDES do we handle? */
|
||||
@@ -156,7 +137,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_FULL_OMITS 500
|
||||
#define MAX_FULL_OMITS 1000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form MM DD do we handle? */
|
||||
@@ -190,14 +171,6 @@
|
||||
#define PSBEGIN2 "# rem2ps2 begin"
|
||||
#define PSEND2 "# rem2ps2 end"
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
#define Putc SafePutc
|
||||
#define PutChar SafePutChar
|
||||
#else
|
||||
#define Putc putc
|
||||
#define PutChar putchar
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
|
||||
#define REM_USE_WCHAR 1
|
||||
#else
|
||||
|
||||
144
src/dorem.c
144
src/dorem.c
@@ -7,7 +7,7 @@
|
||||
/* commands. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -28,7 +28,7 @@ static int ParseTimeTrig (ParsePtr s, TimeTrig *tim, int save_in_globals);
|
||||
static int ParseLocalOmit (ParsePtr s, Trigger *t);
|
||||
static int ParseScanFrom (ParsePtr s, Trigger *t, int type);
|
||||
static int ParsePriority (ParsePtr s, Trigger *t);
|
||||
static int ParseUntil (ParsePtr s, Trigger *t);
|
||||
static int ParseUntil (ParsePtr s, Trigger *t, int type);
|
||||
static int ShouldTriggerBasedOnWarn (Trigger *t, int jul, int *err);
|
||||
static int ComputeTrigDuration(TimeTrig *t);
|
||||
|
||||
@@ -168,27 +168,37 @@ int DoRem(ParsePtr p)
|
||||
FreeTrig(&trig);
|
||||
return OK;
|
||||
}
|
||||
/* Queue the reminder, if necessary */
|
||||
|
||||
/* Queue the reminder, if necessary */
|
||||
if (jul == JulianToday &&
|
||||
!(!IgnoreOnce &&
|
||||
trig.once != NO_ONCE &&
|
||||
FileAccessDate == JulianToday))
|
||||
QueueReminder(p, &trig, &tim, trig.sched);
|
||||
/* If we're in daemon mode, do nothing over here */
|
||||
/* If we're in daemon mode, do nothing over here */
|
||||
if (Daemon) {
|
||||
FreeTrig(&trig);
|
||||
return OK;
|
||||
}
|
||||
|
||||
r = OK;
|
||||
if (ShouldTriggerReminder(&trig, &tim, jul, &err)) {
|
||||
if ( (r=TriggerReminder(p, &trig, &tim, jul)) ) {
|
||||
FreeTrig(&trig);
|
||||
return r;
|
||||
}
|
||||
} else {
|
||||
/* Parse the rest of the line to catch any potential
|
||||
expression-pasting errors */
|
||||
while (ParseChar(p, &r, 0)) {
|
||||
if (r != 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FreeTrig(&trig);
|
||||
return OK;
|
||||
return r;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -237,11 +247,15 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
||||
tim->delta = DefaultTDelta;
|
||||
tim->rep = NO_REP;
|
||||
tim->duration = NO_TIME;
|
||||
trig->need_wkday = 0;
|
||||
trig->adj_for_last = 0;
|
||||
|
||||
if (save_in_globals) {
|
||||
LastTriggerTime = NO_TIME;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
int parsing = 1;
|
||||
while(parsing) {
|
||||
/* Read space-delimited string */
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
@@ -249,6 +263,25 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
||||
/* Figure out what we've got */
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
switch(tok.type) {
|
||||
case T_In:
|
||||
/* Completely ignored */
|
||||
DBufFree(&buf);
|
||||
break;
|
||||
|
||||
case T_Ordinal:
|
||||
DBufFree(&buf);
|
||||
if (trig->d != NO_DAY) return E_DAY_TWICE;
|
||||
if (tok.val < 0) {
|
||||
if (trig->back != NO_BACK) return E_BACK_TWICE;
|
||||
trig->back = -7;
|
||||
trig->d = 1;
|
||||
trig->adj_for_last = 1;
|
||||
} else {
|
||||
trig->d = 1 + 7 * tok.val;
|
||||
}
|
||||
trig->need_wkday = 1;
|
||||
break;
|
||||
|
||||
case T_Date:
|
||||
DBufFree(&buf);
|
||||
if (trig->d != NO_DAY) return E_DAY_TWICE;
|
||||
@@ -322,7 +355,6 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
||||
DBufFree(&buf);
|
||||
trig->typ = tok.val;
|
||||
if (s->isnested) return E_CANT_NEST_RTYPE;
|
||||
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
|
||||
if (trig->typ == PASSTHRU_TYPE) {
|
||||
r = ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
@@ -332,19 +364,20 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
||||
}
|
||||
StrnCpy(trig->passthru, DBufValue(&buf), PASSTHRU_LEN);
|
||||
}
|
||||
return OK;
|
||||
parsing = 0;
|
||||
break;
|
||||
|
||||
case T_Through:
|
||||
DBufFree(&buf);
|
||||
if (trig->rep != NO_REP) return E_REP_TWICE;
|
||||
trig->rep = 1;
|
||||
r = ParseUntil(s, trig);
|
||||
r = ParseUntil(s, trig, tok.type);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
case T_Until:
|
||||
DBufFree(&buf);
|
||||
r=ParseUntil(s, trig);
|
||||
r=ParseUntil(s, trig, tok.type);
|
||||
if (r) return r;
|
||||
break;
|
||||
|
||||
@@ -378,6 +411,15 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
||||
trig->back = tok.val;
|
||||
break;
|
||||
|
||||
case T_BackAdj:
|
||||
DBufFree(&buf);
|
||||
if (trig->back != NO_BACK) return E_BACK_TWICE;
|
||||
if (trig->d != NO_DAY) return E_DAY_TWICE;
|
||||
trig->back = tok.val;
|
||||
trig->d = 1;
|
||||
trig->adj_for_last = 1;
|
||||
break;
|
||||
|
||||
case T_Once:
|
||||
DBufFree(&buf);
|
||||
if (trig->once != NO_ONCE) return E_ONCE_TWICE;
|
||||
@@ -392,7 +434,7 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
||||
case T_Omit:
|
||||
DBufFree(&buf);
|
||||
if (trig->omitfunc[0]) {
|
||||
Eprint("Warning: OMIT is ignored if you use OMITFUNC");
|
||||
Wprint("Warning: OMIT is ignored if you use OMITFUNC");
|
||||
}
|
||||
|
||||
r = ParseLocalOmit(s, trig);
|
||||
@@ -401,12 +443,12 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
||||
|
||||
case T_Empty:
|
||||
DBufFree(&buf);
|
||||
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
|
||||
return OK;
|
||||
parsing = 0;
|
||||
break;
|
||||
|
||||
case T_OmitFunc:
|
||||
if (trig->localomit) {
|
||||
Eprint("Warning: OMIT is ignored if you use OMITFUNC");
|
||||
Wprint("Warning: OMIT is ignored if you use OMITFUNC");
|
||||
}
|
||||
r=ParseToken(s, &buf);
|
||||
if (r) return r;
|
||||
@@ -474,10 +516,58 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
||||
DBufFree(&buf);
|
||||
trig->typ = MSG_TYPE;
|
||||
if (s->isnested) return E_CANT_NEST_RTYPE;
|
||||
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
|
||||
return OK;
|
||||
parsing = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (trig->need_wkday && trig->wd == NO_WD) {
|
||||
Eprint("Weekday name(s) required");
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
|
||||
/* Adjust month and possibly year */
|
||||
if (trig->adj_for_last) {
|
||||
if (trig->m != NO_MON) {
|
||||
trig->m++;
|
||||
if (trig->m >= 12) {
|
||||
trig->m = 0;
|
||||
if (trig->y != NO_YR) {
|
||||
trig->y++;
|
||||
}
|
||||
}
|
||||
}
|
||||
trig->adj_for_last = 0;
|
||||
}
|
||||
|
||||
/* Check for some warning conditions */
|
||||
if (!s->nonconst_expr) {
|
||||
if (trig->y != NO_YR && trig->m != NO_MON && trig->d != NO_DAY && trig->until != NO_UNTIL) {
|
||||
if (Julian(trig->y, trig->m, trig->d) > trig->until) {
|
||||
Wprint("Warning: UNTIL/THROUGH date earlier than start date");
|
||||
}
|
||||
}
|
||||
if (trig->from != NO_DATE) {
|
||||
if (trig->until != NO_UNTIL && trig->until < trig->from) {
|
||||
Wprint("Warning: UNTIL/THROUGH date earlier than FROM date");
|
||||
}
|
||||
} else if (trig->scanfrom != NO_DATE) {
|
||||
if (trig->until != NO_UNTIL && trig->until < trig->scanfrom) {
|
||||
Wprint("Warning: UNTIL/THROUGH date earlier than SCANFROM date");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (trig->y != NO_YR && trig->m != NO_MON && trig->d != NO_DAY && trig->until != NO_UNTIL && trig->rep == NO_REP) {
|
||||
Wprint("Warning: Useless use of UNTIL with fully-specified date and no *rep");
|
||||
}
|
||||
|
||||
/* Set scanfrom to default if not set explicitly */
|
||||
if (trig->scanfrom == NO_DATE) {
|
||||
trig->scanfrom = JulianToday;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -568,12 +658,18 @@ static int ParseLocalOmit(ParsePtr s, Trigger *t)
|
||||
/* ParseUntil - parse the UNTIL portion of a reminder */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static int ParseUntil(ParsePtr s, Trigger *t)
|
||||
static int ParseUntil(ParsePtr s, Trigger *t, int type)
|
||||
{
|
||||
int y = NO_YR,
|
||||
m = NO_MON,
|
||||
d = NO_DAY;
|
||||
|
||||
char const *which;
|
||||
if (type == T_Until) {
|
||||
which = "UNTIL";
|
||||
} else {
|
||||
which = "THROUGH";
|
||||
}
|
||||
Token tok;
|
||||
int r;
|
||||
DynamicBuffer buf;
|
||||
@@ -589,7 +685,7 @@ static int ParseUntil(ParsePtr s, Trigger *t)
|
||||
case T_Year:
|
||||
DBufFree(&buf);
|
||||
if (y != NO_YR) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_YR_TWICE]);
|
||||
Eprint("%s: %s", which, ErrMsg[E_YR_TWICE]);
|
||||
return E_YR_TWICE;
|
||||
}
|
||||
y = tok.val;
|
||||
@@ -598,7 +694,7 @@ static int ParseUntil(ParsePtr s, Trigger *t)
|
||||
case T_Month:
|
||||
DBufFree(&buf);
|
||||
if (m != NO_MON) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_MON_TWICE]);
|
||||
Eprint("%s: %s", which, ErrMsg[E_MON_TWICE]);
|
||||
return E_MON_TWICE;
|
||||
}
|
||||
m = tok.val;
|
||||
@@ -607,7 +703,7 @@ static int ParseUntil(ParsePtr s, Trigger *t)
|
||||
case T_Day:
|
||||
DBufFree(&buf);
|
||||
if (d != NO_DAY) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_DAY_TWICE]);
|
||||
Eprint("%s: %s", which, ErrMsg[E_DAY_TWICE]);
|
||||
return E_DAY_TWICE;
|
||||
}
|
||||
d = tok.val;
|
||||
@@ -616,15 +712,15 @@ static int ParseUntil(ParsePtr s, Trigger *t)
|
||||
case T_Date:
|
||||
DBufFree(&buf);
|
||||
if (y != NO_YR) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_YR_TWICE]);
|
||||
Eprint("%s: %s", which, ErrMsg[E_YR_TWICE]);
|
||||
return E_YR_TWICE;
|
||||
}
|
||||
if (m != NO_MON) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_MON_TWICE]);
|
||||
Eprint("%s: %s", which, ErrMsg[E_MON_TWICE]);
|
||||
return E_MON_TWICE;
|
||||
}
|
||||
if (d != NO_DAY) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_DAY_TWICE]);
|
||||
Eprint("%s: %s", which, ErrMsg[E_DAY_TWICE]);
|
||||
return E_DAY_TWICE;
|
||||
}
|
||||
FromJulian(tok.val, &y, &m, &d);
|
||||
@@ -632,7 +728,7 @@ static int ParseUntil(ParsePtr s, Trigger *t)
|
||||
|
||||
default:
|
||||
if (y == NO_YR || m == NO_MON || d == NO_DAY) {
|
||||
Eprint("UNTIL: %s", ErrMsg[E_INCOMPLETE]);
|
||||
Eprint("%s: %s", which, ErrMsg[E_INCOMPLETE]);
|
||||
DBufFree(&buf);
|
||||
return E_INCOMPLETE;
|
||||
}
|
||||
|
||||
299
src/dosubst.c
299
src/dosubst.c
@@ -6,11 +6,12 @@
|
||||
/* reminders are triggered. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
#include "expr.h"
|
||||
#define L_IN_DOSUBST
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -29,9 +30,6 @@
|
||||
#define NL "\n"
|
||||
#endif
|
||||
|
||||
static char TODAY[] = L_TODAY;
|
||||
static char TOMORROW[] = L_TOMORROW;
|
||||
|
||||
#define SHIP_OUT(s) if(DBufPuts(dbuf, s) != OK) return E_NO_MEM
|
||||
|
||||
/***************************************************************/
|
||||
@@ -58,10 +56,17 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
char const *mplu, *hplu, *when, *plu;
|
||||
int has_quote = 0;
|
||||
char *ss;
|
||||
char const *expr;
|
||||
char *os;
|
||||
char s[256];
|
||||
char uf[32];
|
||||
char mypm[64];
|
||||
char mycpm[64];
|
||||
char myplu[64];
|
||||
int origLen = DBufLen(dbuf);
|
||||
int altmode;
|
||||
int r;
|
||||
Value v;
|
||||
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
|
||||
@@ -74,16 +79,16 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_MPLU_OVER
|
||||
L_MPLU_OVER
|
||||
#else /* L_MPLU_OVER */
|
||||
mplu = (mdiff == 1 ? "" : L_MPLU);
|
||||
mplu = (mdiff == 1 ? "" : DynamicMplu);
|
||||
#endif /* L_MPLU_OVER */
|
||||
|
||||
#ifdef L_HPLU_OVER
|
||||
L_HPLU_OVER
|
||||
#else /* L_HPLU_OVER */
|
||||
hplu = (hdiff == 1 ? "" : L_HPLU);
|
||||
hplu = (hdiff == 1 ? "" : DynamicHplu);
|
||||
#endif /* L_HPLU_OVER */
|
||||
|
||||
when = (tdiff < 0 ? L_AGO : L_FROMNOW);
|
||||
when = (tdiff < 0) ? DynamicAgo : DynamicFromnow;
|
||||
|
||||
h = tim / 60;
|
||||
min = tim % 60;
|
||||
@@ -91,7 +96,26 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_AMPM_OVERRIDE
|
||||
L_AMPM_OVERRIDE (pm, h)
|
||||
#else
|
||||
pm = (h < 12) ? L_AM : L_PM;
|
||||
r = -1;
|
||||
if (UserFuncExists("subst_ampm") == 1) {
|
||||
snprintf(s, sizeof(s), "subst_ampm(%d)", h);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
snprintf(mypm, sizeof(mypm), "%s", v.v.str);
|
||||
pm = mypm;
|
||||
} else {
|
||||
r = -1;
|
||||
}
|
||||
DestroyValue(v);
|
||||
} else {
|
||||
Eprint("%s", ErrMsg[r]);
|
||||
}
|
||||
}
|
||||
if (r != OK) {
|
||||
pm = (h < 12) ? DynamicAm : DynamicPm;
|
||||
}
|
||||
#endif
|
||||
hh = (h == 12) ? 12 : h % 12;
|
||||
|
||||
@@ -101,25 +125,60 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_AMPM_OVERRIDE
|
||||
L_AMPM_OVERRIDE (cpm, ch)
|
||||
#else
|
||||
cpm = (ch < 12) ? L_AM : L_PM;
|
||||
r = -1;
|
||||
if (UserFuncExists("subst_ampm") == 1) {
|
||||
snprintf(s, sizeof(s), "subst_ampm(%d)", ch);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
snprintf(mycpm, sizeof(mycpm), "%s", v.v.str);
|
||||
cpm = mycpm;
|
||||
} else {
|
||||
r = -1;
|
||||
}
|
||||
} else {
|
||||
Eprint("%s", ErrMsg[r]);
|
||||
}
|
||||
}
|
||||
if (r != OK) {
|
||||
cpm = (h < 12) ? DynamicAm : DynamicPm;
|
||||
}
|
||||
#endif
|
||||
chh = (ch == 12) ? 12 : ch % 12;
|
||||
|
||||
#ifdef L_ORDINAL_OVERRIDE
|
||||
L_ORDINAL_OVERRIDE
|
||||
L_ORDINAL_OVERRIDE;
|
||||
#else
|
||||
switch(d) {
|
||||
case 1:
|
||||
case 21:
|
||||
case 31: plu = "st"; break;
|
||||
if (UserFuncExists("subst_ordinal") == 1) {
|
||||
snprintf(s, sizeof(s), "subst_ordinal(%d)", d);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
snprintf(myplu, sizeof(myplu), "%s", v.v.str);
|
||||
plu = myplu;
|
||||
} else {
|
||||
r = -1;
|
||||
}
|
||||
} else {
|
||||
Eprint("%s", ErrMsg[r]);
|
||||
}
|
||||
}
|
||||
if (r != OK) {
|
||||
switch(d) {
|
||||
case 1:
|
||||
case 21:
|
||||
case 31: plu = "st"; break;
|
||||
|
||||
case 2:
|
||||
case 22: plu = "nd"; break;
|
||||
case 2:
|
||||
case 22: plu = "nd"; break;
|
||||
|
||||
case 3:
|
||||
case 23: plu = "rd"; break;
|
||||
case 3:
|
||||
case 23: plu = "rd"; break;
|
||||
|
||||
default: plu = "th"; break;
|
||||
default: plu = "th"; break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -163,6 +222,29 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
}
|
||||
}
|
||||
done = 0;
|
||||
snprintf(uf, sizeof(uf), "subst_%c", c);
|
||||
if (UserFuncExists(uf) == 3) {
|
||||
snprintf(s, sizeof(s), "subst_%c(%d,'%04d-%02d-%02d',%02d:%02d)",
|
||||
c, altmode ? 1 : 0, y, m+1, d, h, min);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (v.type != INT_TYPE || v.v.val != 0) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
if (DBufPuts(dbuf, v.v.str) != OK) {
|
||||
DestroyValue(v);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
DestroyValue(v);
|
||||
continue;
|
||||
}
|
||||
DestroyValue(v);
|
||||
} else {
|
||||
Eprint("%s", ErrMsg[r]);
|
||||
}
|
||||
}
|
||||
|
||||
if (diff <= 1) {
|
||||
switch(UPPER(c)) {
|
||||
#ifndef L_NOTOMORROW_A
|
||||
@@ -204,7 +286,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifndef L_NOTOMORROW_V
|
||||
case 'V':
|
||||
#endif
|
||||
sprintf(s, "%s", (diff ? TOMORROW : TODAY));
|
||||
snprintf(s, sizeof(s), "%s", (diff ? DynamicTomorrow: DynamicToday));
|
||||
SHIP_OUT(s);
|
||||
done = 1;
|
||||
break;
|
||||
@@ -213,16 +295,42 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!done) {
|
||||
snprintf(uf, sizeof(uf), "subst_%cx", c);
|
||||
if (UserFuncExists(uf) == 3) {
|
||||
snprintf(s, sizeof(s), "subst_%cx(%d,'%04d-%02d-%02d',%02d:%02d)",
|
||||
c, altmode ? 1 : 0, y, m+1, d, h, min);
|
||||
expr = (char const *) s;
|
||||
r = EvalExpr(&expr, &v, NULL);
|
||||
if (r == OK) {
|
||||
if (v.type != INT_TYPE || v.v.val != 0) {
|
||||
if (!DoCoerce(STR_TYPE, &v)) {
|
||||
if (DBufPuts(dbuf, v.v.str) != OK) {
|
||||
DestroyValue(v);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
DestroyValue(v);
|
||||
continue;
|
||||
}
|
||||
DestroyValue(v);
|
||||
} else {
|
||||
Eprint("%s", ErrMsg[r]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!done) switch(UPPER(c)) {
|
||||
case 'A':
|
||||
#ifdef L_A_OVER
|
||||
L_A_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %d %s, %d", get_day_name(jul%7), d,
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%s, %d %s, %d", get_day_name(jul%7), d,
|
||||
get_month_name(m), y);
|
||||
} else {
|
||||
sprintf(s, "%s %s, %d %s, %d", L_ON, get_day_name(jul%7), d,
|
||||
snprintf(s, sizeof(s), "%s %s, %d %s, %d", DynamicOn, get_day_name(jul%7), d,
|
||||
get_month_name(m), y);
|
||||
}
|
||||
#endif
|
||||
@@ -233,7 +341,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_B_OVER
|
||||
L_B_OVER
|
||||
#else
|
||||
sprintf(s, L_INXDAYS, diff);
|
||||
snprintf(s, sizeof(s), L_INXDAYS, diff);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -242,10 +350,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_C_OVER
|
||||
L_C_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s", get_day_name(jul%7));
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%s", get_day_name(jul%7));
|
||||
} else {
|
||||
sprintf(s, "%s %s", L_ON, get_day_name(jul%7));
|
||||
snprintf(s, sizeof(s), "%s %s", DynamicOn, get_day_name(jul%7));
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -255,7 +363,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_D_OVER
|
||||
L_D_OVER
|
||||
#else
|
||||
sprintf(s, "%d", d);
|
||||
snprintf(s, sizeof(s), "%d", d);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -264,11 +372,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_E_OVER
|
||||
L_E_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d%c%04d", d, DateSep,
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%02d%c%02d%c%04d", d, DateSep,
|
||||
m+1, DateSep, y);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, d, DateSep,
|
||||
snprintf(s, sizeof(s), "%s %02d%c%02d%c%04d", DynamicOn, d, DateSep,
|
||||
m+1, DateSep, y);
|
||||
}
|
||||
#endif
|
||||
@@ -279,10 +387,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_F_OVER
|
||||
L_F_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, m+1, DateSep, d, DateSep, y);
|
||||
snprintf(s, sizeof(s), "%s %02d%c%02d%c%04d", DynamicOn, m+1, DateSep, d, DateSep, y);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -292,10 +400,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_G_OVER
|
||||
L_G_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %d %s", get_day_name(jul%7), d, get_month_name(m));
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%s, %d %s", get_day_name(jul%7), d, get_month_name(m));
|
||||
} else {
|
||||
sprintf(s, "%s %s, %d %s", L_ON, get_day_name(jul%7), d, get_month_name(m));
|
||||
snprintf(s, sizeof(s), "%s %s, %d %s", DynamicOn, get_day_name(jul%7), d, get_month_name(m));
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -305,10 +413,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_H_OVER
|
||||
L_H_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d", d, DateSep, m+1);
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%02d%c%02d", d, DateSep, m+1);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, d, DateSep, m+1);
|
||||
snprintf(s, sizeof(s), "%s %02d%c%02d", DynamicOn, d, DateSep, m+1);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -318,10 +426,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_I_OVER
|
||||
L_I_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d", m+1, DateSep, d);
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%02d%c%02d", m+1, DateSep, d);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, m+1, DateSep, d);
|
||||
snprintf(s, sizeof(s), "%s %02d%c%02d", DynamicOn, m+1, DateSep, d);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -331,11 +439,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_J_OVER
|
||||
L_J_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %s %d%s, %d", get_day_name(jul%7),
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%s, %s %d%s, %d", get_day_name(jul%7),
|
||||
get_month_name(m), d, plu, y);
|
||||
} else {
|
||||
sprintf(s, "%s %s, %s %d%s, %d", L_ON, get_day_name(jul%7),
|
||||
snprintf(s, sizeof(s), "%s %s, %s %d%s, %d", DynamicOn, get_day_name(jul%7),
|
||||
get_month_name(m), d, plu, y);
|
||||
}
|
||||
#endif
|
||||
@@ -346,11 +454,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_K_OVER
|
||||
L_K_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %s %d%s", get_day_name(jul%7),
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%s, %s %d%s", get_day_name(jul%7),
|
||||
get_month_name(m), d, plu);
|
||||
} else {
|
||||
sprintf(s, "%s %s, %s %d%s", L_ON, get_day_name(jul%7),
|
||||
snprintf(s, sizeof(s), "%s %s, %s %d%s", DynamicOn, get_day_name(jul%7),
|
||||
get_month_name(m), d, plu);
|
||||
}
|
||||
#endif
|
||||
@@ -361,10 +469,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_L_OVER
|
||||
L_L_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
|
||||
} else {
|
||||
sprintf(s, "%s %04d%c%02d%c%02d", L_ON, y, DateSep, m+1, DateSep, d);
|
||||
snprintf(s, sizeof(s), "%s %04d%c%02d%c%02d", DynamicOn, y, DateSep, m+1, DateSep, d);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -374,7 +482,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_M_OVER
|
||||
L_M_OVER
|
||||
#else
|
||||
sprintf(s, "%s", get_month_name(m));
|
||||
snprintf(s, sizeof(s), "%s", get_month_name(m));
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -383,7 +491,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_N_OVER
|
||||
L_N_OVER
|
||||
#else
|
||||
sprintf(s, "%d", m+1);
|
||||
snprintf(s, sizeof(s), "%d", m+1);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -392,7 +500,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_O_OVER
|
||||
L_O_OVER
|
||||
#else
|
||||
if (RealToday == JulianToday) sprintf(s, " (%s)", L_TODAY);
|
||||
if (RealToday == JulianToday) snprintf(s, sizeof(s), " (%s)", DynamicToday);
|
||||
else *s = 0;
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -402,7 +510,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_P_OVER
|
||||
L_P_OVER
|
||||
#else
|
||||
sprintf(s, "%s", (diff == 1 ? "" : L_PLURAL));
|
||||
snprintf(s, sizeof(s), "%s", (diff == 1 ? "" : L_PLURAL));
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -411,7 +519,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_Q_OVER
|
||||
L_Q_OVER
|
||||
#else
|
||||
sprintf(s, "%s", (diff == 1 ? "'s" : "s'"));
|
||||
snprintf(s, sizeof(s), "%s", (diff == 1 ? "'s" : "s'"));
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -420,7 +528,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_R_OVER
|
||||
L_R_OVER
|
||||
#else
|
||||
sprintf(s, "%02d", d);
|
||||
snprintf(s, sizeof(s), "%02d", d);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -429,7 +537,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_S_OVER
|
||||
L_S_OVER
|
||||
#else
|
||||
sprintf(s, "%s", plu);
|
||||
snprintf(s, sizeof(s), "%s", plu);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -438,7 +546,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_T_OVER
|
||||
L_T_OVER
|
||||
#else
|
||||
sprintf(s, "%02d", m+1);
|
||||
snprintf(s, sizeof(s), "%02d", m+1);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -447,11 +555,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_U_OVER
|
||||
L_U_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %d%s %s, %d", get_day_name(jul%7), d,
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%s, %d%s %s, %d", get_day_name(jul%7), d,
|
||||
plu, get_month_name(m), y);
|
||||
} else {
|
||||
sprintf(s, "%s %s, %d%s %s, %d", L_ON, get_day_name(jul%7), d,
|
||||
snprintf(s, sizeof(s), "%s %s, %d%s %s, %d", DynamicOn, get_day_name(jul%7), d,
|
||||
plu, get_month_name(m), y);
|
||||
}
|
||||
#endif
|
||||
@@ -462,11 +570,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_V_OVER
|
||||
L_V_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %d%s %s", get_day_name(jul%7), d, plu,
|
||||
if (altmode == '*' || !strcmp(DynamicOn, "")) {
|
||||
snprintf(s, sizeof(s), "%s, %d%s %s", get_day_name(jul%7), d, plu,
|
||||
get_month_name(m));
|
||||
} else {
|
||||
sprintf(s, "%s %s, %d%s %s", L_ON, get_day_name(jul%7), d, plu,
|
||||
snprintf(s, sizeof(s), "%s %s, %d%s %s", DynamicOn, get_day_name(jul%7), d, plu,
|
||||
get_month_name(m));
|
||||
}
|
||||
#endif
|
||||
@@ -477,7 +585,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_W_OVER
|
||||
L_W_OVER
|
||||
#else
|
||||
sprintf(s, "%s", get_day_name(jul%7));
|
||||
snprintf(s, sizeof(s), "%s", get_day_name(jul%7));
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -486,7 +594,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_X_OVER
|
||||
L_X_OVER
|
||||
#else
|
||||
sprintf(s, "%d", diff);
|
||||
snprintf(s, sizeof(s), "%d", diff);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -495,7 +603,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_Y_OVER
|
||||
L_Y_OVER
|
||||
#else
|
||||
sprintf(s, "%d", y);
|
||||
snprintf(s, sizeof(s), "%d", y);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -504,7 +612,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_Z_OVER
|
||||
L_Z_OVER
|
||||
#else
|
||||
sprintf(s, "%d", y % 100);
|
||||
snprintf(s, sizeof(s), "%d", y % 100);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -514,14 +622,14 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
L_1_OVER
|
||||
#else
|
||||
if (tdiff == 0)
|
||||
sprintf(s, "%s", L_NOW);
|
||||
snprintf(s, sizeof(s), "%s", DynamicNow);
|
||||
else if (hdiff == 0)
|
||||
sprintf(s, "%d %s%s %s", mdiff, L_MINUTE, mplu, when);
|
||||
snprintf(s, sizeof(s), "%d %s%s %s", mdiff, DynamicMinute, mplu, when);
|
||||
else if (mdiff == 0)
|
||||
sprintf(s, "%d %s%s %s", hdiff, L_HOUR, hplu, when);
|
||||
snprintf(s, sizeof(s), "%d %s%s %s", hdiff, DynamicHour, hplu, when);
|
||||
else
|
||||
sprintf(s, "%d %s%s %s %d %s%s %s", hdiff, L_HOUR, hplu,
|
||||
L_AND, mdiff, L_MINUTE, mplu, when);
|
||||
snprintf(s, sizeof(s), "%d %s%s %s %d %s%s %s", hdiff, DynamicHour, hplu,
|
||||
DynamicAnd, mdiff, DynamicMinute, mplu, when);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -531,9 +639,9 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
L_2_OVER
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%d%c%02d%s", hh, TimeSep, min, pm);
|
||||
snprintf(s, sizeof(s), "%d%c%02d%s", hh, TimeSep, min, pm);
|
||||
} else {
|
||||
sprintf(s, "%s %d%c%02d%s", L_AT, hh, TimeSep, min, pm);
|
||||
snprintf(s, sizeof(s), "%s %d%c%02d%s", DynamicAt, hh, TimeSep, min, pm);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -545,9 +653,9 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#else
|
||||
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d", h, TimeSep, min);
|
||||
snprintf(s, sizeof(s), "%02d%c%02d", h, TimeSep, min);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d", L_AT, h, TimeSep, min);
|
||||
snprintf(s, sizeof(s), "%s %02d%c%02d", DynamicAt, h, TimeSep, min);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -557,7 +665,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_4_OVER
|
||||
L_4_OVER
|
||||
#else
|
||||
sprintf(s, "%d", tdiff);
|
||||
snprintf(s, sizeof(s), "%d", tdiff);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -566,7 +674,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_5_OVER
|
||||
L_5_OVER
|
||||
#else
|
||||
sprintf(s, "%d", adiff);
|
||||
snprintf(s, sizeof(s), "%d", adiff);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -575,7 +683,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_6_OVER
|
||||
L_6_OVER
|
||||
#else
|
||||
sprintf(s, "%s", when);
|
||||
snprintf(s, sizeof(s), "%s", when);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -584,7 +692,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_7_OVER
|
||||
L_7_OVER
|
||||
#else
|
||||
sprintf(s, "%d", hdiff);
|
||||
snprintf(s, sizeof(s), "%d", hdiff);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -593,7 +701,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_8_OVER
|
||||
L_8_OVER
|
||||
#else
|
||||
sprintf(s, "%d", mdiff);
|
||||
snprintf(s, sizeof(s), "%d", mdiff);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -602,7 +710,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_9_OVER
|
||||
L_9_OVER
|
||||
#else
|
||||
sprintf(s, "%s", mplu);
|
||||
snprintf(s, sizeof(s), "%s", mplu);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -611,7 +719,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_0_OVER
|
||||
L_0_OVER
|
||||
#else
|
||||
sprintf(s, "%s", hplu);
|
||||
snprintf(s, sizeof(s), "%s", hplu);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -620,7 +728,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_BANG_OVER
|
||||
L_BANG_OVER
|
||||
#else
|
||||
sprintf(s, "%s", (tdiff >= 0 ? L_IS : L_WAS));
|
||||
snprintf(s, sizeof(s), "%s", (tdiff >= 0 ? DynamicIs : DynamicWas));
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -629,7 +737,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_AT_OVER
|
||||
L_AT_OVER
|
||||
#else
|
||||
sprintf(s, "%d%c%02d%s", chh, TimeSep, cmin, cpm);
|
||||
snprintf(s, sizeof(s), "%d%c%02d%s", chh, TimeSep, cmin, cpm);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -638,16 +746,16 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
#ifdef L_HASH_OVER
|
||||
L_HASH_OVER
|
||||
#else
|
||||
sprintf(s, "%02d%c%02d", ch, TimeSep, cmin);
|
||||
snprintf(s, sizeof(s), "%02d%c%02d", ch, TimeSep, cmin);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '_':
|
||||
if (PsCal == PSCAL_LEVEL2 || PsCal == PSCAL_LEVEL3 || (mode != CAL_MODE && mode != ADVANCE_MODE && !MsgCommand)) {
|
||||
sprintf(s, "%s", NL);
|
||||
snprintf(s, sizeof(s), "%s", NL);
|
||||
} else {
|
||||
sprintf(s, " ");
|
||||
snprintf(s, sizeof(s), " ");
|
||||
}
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -657,8 +765,13 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
||||
break;
|
||||
|
||||
case '"':
|
||||
if (DBufPutc(dbuf, QUOTE_MARKER) != OK) return E_NO_MEM;
|
||||
has_quote = 1;
|
||||
if (DontSuppressQuoteMarkers) {
|
||||
if (DBufPutc(dbuf, '%') != OK) return E_NO_MEM;
|
||||
if (DBufPutc(dbuf, c) != OK) return E_NO_MEM;
|
||||
} else {
|
||||
if (DBufPutc(dbuf, QUOTE_MARKER) != OK) return E_NO_MEM;
|
||||
has_quote = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* buffers. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Declaration of functions for manipulating dynamic buffers */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Error definitions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
136
src/expr.c
136
src/expr.c
@@ -5,7 +5,7 @@
|
||||
/* This file contains routines to parse and evaluate */
|
||||
/* expressions. */
|
||||
/* */
|
||||
/* Copyright 1992-2021 by Dianne Skoll */
|
||||
/* Copyright 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -44,21 +44,32 @@ static int MakeValue (char const *s, Value *v, Var *locals, ParsePtr p);
|
||||
|
||||
/* Binary operators - all left-associative */
|
||||
|
||||
/* Operator precedence:
|
||||
* Highest: Unary - Unary !
|
||||
* / %
|
||||
* + -
|
||||
* < <= > >=
|
||||
* == !=
|
||||
* &&
|
||||
* Lowest: ||
|
||||
*
|
||||
*/
|
||||
|
||||
/* Make SURE they are sorted lexically... this may die on an EBCDIC
|
||||
system... */
|
||||
|
||||
Operator BinOp[] = {
|
||||
{ "!=", 15, BIN_OP, NotEqual },
|
||||
{ "%", 20, BIN_OP, Mod },
|
||||
{ "%", 20, BIN_OP, Mod },
|
||||
{ "&&", 14, BIN_OP, LogAND },
|
||||
{ "*", 20, BIN_OP, Multiply },
|
||||
{ "+", 18, BIN_OP, Add },
|
||||
{ "-", 18, BIN_OP, Subtract },
|
||||
{ "/", 20, BIN_OP, Divide },
|
||||
{ "<", 16, BIN_OP, LessThan },
|
||||
{ "*", 20, BIN_OP, Multiply },
|
||||
{ "+", 18, BIN_OP, Add },
|
||||
{ "-", 18, BIN_OP, Subtract },
|
||||
{ "/", 20, BIN_OP, Divide },
|
||||
{ "<", 16, BIN_OP, LessThan },
|
||||
{ "<=", 16, BIN_OP, LessOrEqual },
|
||||
{ "==", 15, BIN_OP, EqualTo },
|
||||
{ ">", 16, BIN_OP, GreaterThan },
|
||||
{ ">", 16, BIN_OP, GreaterThan },
|
||||
{ ">=", 16, BIN_OP, GreaterOrEqual },
|
||||
{ "||", 12, BIN_OP, LogOR },
|
||||
};
|
||||
@@ -66,16 +77,19 @@ Operator BinOp[] = {
|
||||
|
||||
/* These ones must be sorted too. */
|
||||
Operator UnOp[] = {
|
||||
{ "!", 22, UN_OP, LogNot },
|
||||
{ "-", 22, UN_OP, UnMinus },
|
||||
{ "!", 22, UN_OP, LogNot },
|
||||
{ "-", 22, UN_OP, UnMinus },
|
||||
};
|
||||
#define NUM_UN_OPS (sizeof(UnOp) / sizeof(Operator))
|
||||
|
||||
extern BuiltinFunc Func[];
|
||||
|
||||
Operator OpStack[OP_STACK_SIZE];
|
||||
Value ValStack[VAL_STACK_SIZE];
|
||||
int OpStackPtr, ValStackPtr;
|
||||
static Operator OpStack[OP_STACK_SIZE];
|
||||
static int OpStackPtr = 0;
|
||||
|
||||
/* ValStack can't be static - needed by funcs.c */
|
||||
Value ValStack[VAL_STACK_SIZE];
|
||||
int ValStackPtr = 0;
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -101,7 +115,7 @@ static int DebugPerform(Operator *op)
|
||||
fprintf(ErrFp, " => ");
|
||||
if (!r) {
|
||||
PrintValue(&ValStack[ValStackPtr-1], ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
} else {
|
||||
fprintf(ErrFp, "%s\n", ErrMsg[r]);
|
||||
}
|
||||
@@ -115,12 +129,13 @@ static int DebugPerform(Operator *op)
|
||||
/* Clean the stack after an error occurs. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static void CleanStack(void)
|
||||
static void CleanStack(int old_op_stack_ptr, int old_val_stack_ptr)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<ValStackPtr; i++) DestroyValue(ValStack[i]);
|
||||
ValStackPtr = 0;
|
||||
for (i=old_val_stack_ptr; i<ValStackPtr; i++) DestroyValue(ValStack[i]);
|
||||
ValStackPtr = old_val_stack_ptr;
|
||||
OpStackPtr = old_op_stack_ptr;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -306,8 +321,8 @@ int EvalExpr(char const **e, Value *v, ParsePtr p)
|
||||
{
|
||||
int r;
|
||||
|
||||
OpStackPtr = 0;
|
||||
ValStackPtr = 0;
|
||||
int old_op_stack_ptr = OpStackPtr;
|
||||
int old_val_stack_ptr = ValStackPtr;
|
||||
|
||||
r = Evaluate(e, NULL, p);
|
||||
|
||||
@@ -316,11 +331,15 @@ int EvalExpr(char const **e, Value *v, ParsePtr p)
|
||||
DBufFree(&ExprBuf);
|
||||
|
||||
if (r) {
|
||||
CleanStack();
|
||||
CleanStack(old_op_stack_ptr, old_val_stack_ptr);
|
||||
/* fprintf(stderr, "O=%d V=%d\n", OpStackPtr, ValStackPtr); */
|
||||
return r;
|
||||
}
|
||||
*v = *ValStack;
|
||||
ValStack[0].type = ERR_TYPE;
|
||||
OpStackPtr = old_op_stack_ptr;
|
||||
ValStackPtr = old_val_stack_ptr;
|
||||
*v = ValStack[old_val_stack_ptr];
|
||||
ValStack[old_val_stack_ptr].type = ERR_TYPE;
|
||||
/* fprintf(stderr, "O=%d V=%d\n", OpStackPtr, ValStackPtr); */
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -580,7 +599,7 @@ static int MakeValue(char const *s, Value *v, Var *locals, ParsePtr p)
|
||||
if (! (DebugFlag & DB_PRTEXPR)) return r;
|
||||
if (r == OK) {
|
||||
PrintValue(v, ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
}
|
||||
return r;
|
||||
} else { /* Must be a symbol */
|
||||
@@ -591,7 +610,7 @@ static int MakeValue(char const *s, Value *v, Var *locals, ParsePtr p)
|
||||
if (! (DebugFlag & DB_PRTEXPR)) return r;
|
||||
if (r == OK) {
|
||||
PrintValue(v, ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@@ -766,12 +785,11 @@ static int Add(void)
|
||||
|
||||
/* If both are ints, just add 'em */
|
||||
if (v2.type == INT_TYPE && v1.type == INT_TYPE) {
|
||||
int old = v1.v.val;
|
||||
v1.v.val += v2.v.val;
|
||||
/* Check for overflow */
|
||||
if (_private_add_overflow(v1.v.val, v2.v.val, old)) {
|
||||
if (_private_add_overflow(v1.v.val, v2.v.val)) {
|
||||
return E_2HIGH;
|
||||
}
|
||||
v1.v.val += v2.v.val;
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
}
|
||||
@@ -779,9 +797,8 @@ static int Add(void)
|
||||
/* If it's a date plus an int, add 'em */
|
||||
if ((v1.type == DATE_TYPE && v2.type == INT_TYPE) ||
|
||||
(v1.type == INT_TYPE && v2.type == DATE_TYPE)) {
|
||||
int old = v1.v.val;
|
||||
if (_private_add_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
|
||||
v1.v.val += v2.v.val;
|
||||
if (_private_add_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
|
||||
if (v1.v.val < 0) return E_DATE_OVER;
|
||||
v1.type = DATE_TYPE;
|
||||
PushValStack(v1);
|
||||
@@ -791,9 +808,8 @@ static int Add(void)
|
||||
/* If it's a datetime plus an int or a time, add 'em */
|
||||
if ((v1.type == DATETIME_TYPE && (v2.type == INT_TYPE || v2.type == TIME_TYPE)) ||
|
||||
((v1.type == INT_TYPE || v1.type == TIME_TYPE) && v2.type == DATETIME_TYPE)) {
|
||||
int old = v1.v.val;
|
||||
if (_private_add_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
|
||||
v1.v.val += v2.v.val;
|
||||
if (_private_add_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
|
||||
if (v1.v.val < 0) return E_DATE_OVER;
|
||||
v1.type = DATETIME_TYPE;
|
||||
PushValStack(v1);
|
||||
@@ -805,9 +821,8 @@ static int Add(void)
|
||||
if ((v1.type == TIME_TYPE && v2.type == INT_TYPE) ||
|
||||
(v1.type == INT_TYPE && v2.type == TIME_TYPE) ||
|
||||
(v1.type == TIME_TYPE && v2.type == TIME_TYPE)) {
|
||||
int old = v1.v.val;
|
||||
if (_private_add_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
|
||||
v1.v.val += v2.v.val;
|
||||
if (_private_add_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
|
||||
v1.v.val = v1.v.val % MINUTES_PER_DAY;
|
||||
if (v1.v.val < 0) v1.v.val += MINUTES_PER_DAY;
|
||||
v1.type = TIME_TYPE;
|
||||
@@ -868,18 +883,16 @@ static int Subtract(void)
|
||||
|
||||
/* If they're both INTs, do subtraction */
|
||||
if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
|
||||
int old = v1.v.val;
|
||||
if (_private_sub_overflow(v1.v.val, v2.v.val)) return E_2HIGH;
|
||||
v1.v.val -= v2.v.val;
|
||||
if (_private_sub_overflow(v1.v.val, v2.v.val, old)) return E_2HIGH;
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* If it's a date minus an int, do subtraction, checking for underflow */
|
||||
if (v1.type == DATE_TYPE && v2.type == INT_TYPE) {
|
||||
int old = v1.v.val;
|
||||
if (_private_sub_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
|
||||
v1.v.val -= v2.v.val;
|
||||
if (_private_sub_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
|
||||
if (v1.v.val < 0) return E_DATE_OVER;
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
@@ -888,9 +901,8 @@ static int Subtract(void)
|
||||
/* If it's a datetime minus an int or a time, do subtraction,
|
||||
* checking for underflow */
|
||||
if (v1.type == DATETIME_TYPE && (v2.type == INT_TYPE || v2.type == TIME_TYPE)) {
|
||||
int old = v1.v.val;
|
||||
if (_private_sub_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
|
||||
v1.v.val -= v2.v.val;
|
||||
if (_private_sub_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
|
||||
if (v1.v.val < 0) return E_DATE_OVER;
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
@@ -908,9 +920,8 @@ static int Subtract(void)
|
||||
if ((v1.type == TIME_TYPE && v2.type == TIME_TYPE) ||
|
||||
(v1.type == DATETIME_TYPE && v2.type == DATETIME_TYPE) ||
|
||||
(v1.type == DATE_TYPE && v2.type == DATE_TYPE)) {
|
||||
int old = v1.v.val;
|
||||
if (_private_sub_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
|
||||
v1.v.val -= v2.v.val;
|
||||
if (_private_sub_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
|
||||
v1.type = INT_TYPE;
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
@@ -945,11 +956,8 @@ static int Multiply(void)
|
||||
(v1.v.val == -1 && v2.v.val == INT_MIN)) {
|
||||
return E_2HIGH;
|
||||
}
|
||||
int old = v1.v.val;
|
||||
if (_private_mul_overflow(v1.v.val, v2.v.val)) return E_2HIGH;
|
||||
v1.v.val *= v2.v.val;
|
||||
if (v2.v.val != 0) {
|
||||
if (_private_div(v1.v.val, v2.v.val) != old) return E_2HIGH;
|
||||
}
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
}
|
||||
@@ -1108,13 +1116,16 @@ static int LogOR(void)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
|
||||
v1.v.val = (v1.v.val || v2.v.val) ? 1 : 0;
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
if (v1.type != v2.type || v1.type == STR_TYPE || v2.type == STR_TYPE) {
|
||||
DestroyValue(v1); DestroyValue(v2);
|
||||
return E_BAD_TYPE;
|
||||
}
|
||||
DestroyValue(v1); DestroyValue(v2);
|
||||
return E_BAD_TYPE;
|
||||
|
||||
if (v1.v.val == 0) {
|
||||
v1.v.val = v2.v.val;
|
||||
}
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -1135,13 +1146,15 @@ static int LogAND(void)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
|
||||
v1.v.val = (v1.v.val && v2.v.val) ? 1 : 0;
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
if (v1.type != v2.type || v1.type == STR_TYPE || v2.type == STR_TYPE) {
|
||||
DestroyValue(v1); DestroyValue(v2);
|
||||
return E_BAD_TYPE;
|
||||
}
|
||||
DestroyValue(v1); DestroyValue(v2);
|
||||
return E_BAD_TYPE;
|
||||
if (v1.v.val != 0) {
|
||||
v1.v.val = v2.v.val;
|
||||
}
|
||||
PushValStack(v1);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -1155,9 +1168,8 @@ static int UnMinus(void)
|
||||
{
|
||||
Value *v = &ValStack[ValStackPtr-1];
|
||||
if (v->type != INT_TYPE) return E_BAD_TYPE;
|
||||
int old = v->v.val;
|
||||
if (v->v.val == INT_MIN) return E_2HIGH;
|
||||
v->v.val = -v->v.val;
|
||||
if (_private_unminus_overflow(old, v->v.val)) return E_2HIGH;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1232,9 +1244,9 @@ void PrintValue (Value *v, FILE *fp)
|
||||
|
||||
if (v->type == STR_TYPE) {
|
||||
s=v->v.str;
|
||||
Putc('"', fp);
|
||||
for (y=0; y<MAX_PRT_LEN && *s; y++) Putc(*s++, fp);
|
||||
Putc('"',fp);
|
||||
putc('"', fp);
|
||||
for (y=0; y<MAX_PRT_LEN && *s; y++) putc(*s++, fp);
|
||||
putc('"',fp);
|
||||
if (*s) fprintf(fp, "...");
|
||||
}
|
||||
else if (v->type == INT_TYPE) fprintf(fp, "%d", v->v.val);
|
||||
|
||||
10
src/expr.h
10
src/expr.h
@@ -5,7 +5,7 @@
|
||||
/* Contains a few definitions used by expression evaluator. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -58,7 +58,7 @@ else \
|
||||
in various arithmetic operators. They have to be in separate
|
||||
functions with extern linkage to defeat compiler optimizations
|
||||
that would otherwise break the overflow checks. */
|
||||
extern int _private_div(int a, int b);
|
||||
extern int _private_add_overflow(int result, int b, int old);
|
||||
extern int _private_sub_overflow(int result, int b, int old);
|
||||
extern int _private_unminus_overflow(int a, int b);
|
||||
extern int _private_mul_overflow(int a, int b);
|
||||
extern int _private_add_overflow(int a, int b);
|
||||
extern int _private_sub_overflow(int a, int b);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/* files. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -163,6 +163,7 @@ int ReadLine(void)
|
||||
LineNo = CLine->LineNo;
|
||||
CLine = CLine->next;
|
||||
FreshLine = 1;
|
||||
clear_callstack();
|
||||
if (DebugFlag & DB_ECHO_LINE) OutputLine(ErrFp);
|
||||
return OK;
|
||||
}
|
||||
@@ -263,6 +264,7 @@ static int ReadLineFromFile(int use_pclose)
|
||||
}
|
||||
|
||||
FreshLine = 1;
|
||||
clear_callstack();
|
||||
if (DebugFlag & DB_ECHO_LINE) OutputLine(ErrFp);
|
||||
return OK;
|
||||
}
|
||||
@@ -818,6 +820,7 @@ static int IncludeCmd(char const *cmd)
|
||||
int old_flag;
|
||||
|
||||
FreshLine = 1;
|
||||
clear_callstack();
|
||||
if (IStackPtr+1 >= INCLUDE_NEST) return E_NESTED_INCLUDE;
|
||||
i = &IStack[IStackPtr];
|
||||
|
||||
@@ -935,6 +938,7 @@ int IncludeFile(char const *fname)
|
||||
struct stat statbuf;
|
||||
|
||||
FreshLine = 1;
|
||||
clear_callstack();
|
||||
if (IStackPtr+1 >= INCLUDE_NEST) return E_NESTED_INCLUDE;
|
||||
i = &IStack[IStackPtr];
|
||||
|
||||
|
||||
149
src/funcs.c
149
src/funcs.c
@@ -6,7 +6,7 @@
|
||||
/* expressions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -58,6 +58,7 @@ static int FADusk (func_info *);
|
||||
static int FAbs (func_info *);
|
||||
static int FAccess (func_info *);
|
||||
static int FAmpm (func_info *);
|
||||
static int FTrig (func_info *);
|
||||
static int FIsAny (func_info *);
|
||||
static int FArgs (func_info *);
|
||||
static int FAsc (func_info *);
|
||||
@@ -110,6 +111,7 @@ static int FNonomitted (func_info *);
|
||||
static int FNow (func_info *);
|
||||
static int FOrd (func_info *);
|
||||
static int FOstype (func_info *);
|
||||
static int FPad (func_info *);
|
||||
static int FPlural (func_info *);
|
||||
static int FPsmoon (func_info *);
|
||||
static int FPsshade (func_info *);
|
||||
@@ -126,6 +128,7 @@ static int FSunset (func_info *);
|
||||
static int FTime (func_info *);
|
||||
static int FTimepart (func_info *);
|
||||
static int FToday (func_info *);
|
||||
static int FTrig (func_info *);
|
||||
static int FTrigback (func_info *);
|
||||
static int FTrigdate (func_info *);
|
||||
static int FTrigdatetime (func_info *);
|
||||
@@ -262,6 +265,7 @@ BuiltinFunc Func[] = {
|
||||
{ "now", 0, 0, 0, FNow },
|
||||
{ "ord", 1, 1, 1, FOrd },
|
||||
{ "ostype", 0, 0, 1, FOstype },
|
||||
{ "pad", 3, 4, 1, FPad },
|
||||
{ "plural", 1, 3, 1, FPlural },
|
||||
{ "psmoon", 1, 4, 1, FPsmoon},
|
||||
{ "psshade", 1, 3, 1, FPsshade},
|
||||
@@ -279,6 +283,7 @@ BuiltinFunc Func[] = {
|
||||
{ "time", 2, 2, 1, FTime },
|
||||
{ "timepart", 1, 1, 1, FTimepart },
|
||||
{ "today", 0, 0, 0, FToday },
|
||||
{ "trig", 0, NO_MAX, 0, FTrig },
|
||||
{ "trigback", 0, 0, 0, FTrigback },
|
||||
{ "trigdate", 0, 0, 0, FTrigdate },
|
||||
{ "trigdatetime", 0, 0, 0, FTrigdatetime },
|
||||
@@ -995,6 +1000,73 @@ static int FOrd(func_info *info)
|
||||
return RetStrVal(buf, info);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* FPad - Pad a string to min length */
|
||||
/* */
|
||||
/* pad("1", "0", 4) --> "0004" */
|
||||
/* pad("1", "0", 4, 1) --> "4000" */
|
||||
/* pad("foo", "bar", 7) -> "barbfoo" */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static int FPad(func_info *info)
|
||||
{
|
||||
int r;
|
||||
char *s;
|
||||
DynamicBuffer dbuf;
|
||||
size_t len;
|
||||
size_t wantlen;
|
||||
size_t i;
|
||||
|
||||
ASSERT_TYPE(1, STR_TYPE);
|
||||
ASSERT_TYPE(2, INT_TYPE);
|
||||
if (Nargs == 4) {
|
||||
ASSERT_TYPE(3, INT_TYPE);
|
||||
}
|
||||
|
||||
if (ARG(0).type != STR_TYPE) {
|
||||
r = DoCoerce(STR_TYPE, &ARG(0));
|
||||
if (r != OK) return r;
|
||||
}
|
||||
|
||||
wantlen = ARGV(2);
|
||||
len = strlen(ARGSTR(0));
|
||||
if (len >= wantlen) {
|
||||
DCOPYVAL(RetVal, ARG(0));
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (strlen(ARGSTR(1)) == 0) {
|
||||
return E_BAD_TYPE;
|
||||
}
|
||||
|
||||
if (MaxStringLen > 0 && wantlen > (size_t) MaxStringLen) {
|
||||
return E_STRING_TOO_LONG;
|
||||
}
|
||||
|
||||
DBufInit(&dbuf);
|
||||
s = ARGSTR(1);
|
||||
if (Nargs < 4 || !ARGV(3)) {
|
||||
/* Pad on the LEFT */
|
||||
for (i=0; i<wantlen-len; i++) {
|
||||
DBufPutc(&dbuf, *s++);
|
||||
if (!*s) s = ARGSTR(1);
|
||||
}
|
||||
DBufPuts(&dbuf, ARGSTR(0));
|
||||
} else {
|
||||
/* Pad on the RIGHT */
|
||||
DBufPuts(&dbuf, ARGSTR(0));
|
||||
for (i=0; i<wantlen-len; i++) {
|
||||
DBufPutc(&dbuf, *s++);
|
||||
if (!*s) s = ARGSTR(1);
|
||||
}
|
||||
}
|
||||
r = RetStrVal(DBufValue(&dbuf), info);
|
||||
DBufFree(&dbuf);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* FPlural - pluralization function */
|
||||
@@ -2234,10 +2306,10 @@ static int SunStuff(int rise, double cosz, int jul)
|
||||
/* Sometimes, we get roundoff error. Check for "reasonableness" of
|
||||
answer. */
|
||||
if (rise) {
|
||||
/* Sunrise so close to midnight it wrapped around -- permament light */
|
||||
/* Sunrise so close to midnight it wrapped around -- permanent light */
|
||||
if (hours >= 23) return NO_TIME;
|
||||
} else {
|
||||
/* Sunset so close to midnight it wrapped around -- permament light */
|
||||
/* Sunset so close to midnight it wrapped around -- permanent light */
|
||||
if (hours <= 1) return -NO_TIME;
|
||||
}
|
||||
return hours*60 + mins;
|
||||
@@ -2411,8 +2483,7 @@ static int FPsshade(func_info *info)
|
||||
|
||||
if (!psshade_warned) {
|
||||
psshade_warned = 1;
|
||||
Eprint("psshade() is deprecated; use SPECIAL SHADE instead.");
|
||||
FreshLine = 1;
|
||||
Wprint("psshade() is deprecated; use SPECIAL SHADE instead.");
|
||||
}
|
||||
|
||||
sprintf(s, "/_A LineWidth 2 div def ");
|
||||
@@ -2467,8 +2538,7 @@ static int FPsmoon(func_info *info)
|
||||
}
|
||||
if (!psmoon_warned) {
|
||||
psmoon_warned = 1;
|
||||
Eprint("psmoon() is deprecated; use SPECIAL MOON instead.");
|
||||
FreshLine = 1;
|
||||
Wprint("psmoon() is deprecated; use SPECIAL MOON instead.");
|
||||
}
|
||||
if (size > 0) {
|
||||
sprintf(sizebuf, "%d", size);
|
||||
@@ -2971,8 +3041,12 @@ FEvalTrig(func_info *info)
|
||||
CreateParser(ARGSTR(0), &p);
|
||||
p.allownested = 0;
|
||||
r = ParseRem(&p, &trig, &tim, 0);
|
||||
if (r) return r;
|
||||
if (r) {
|
||||
DestroyParser(&p);
|
||||
return r;
|
||||
}
|
||||
if (trig.typ != NO_TYPE) {
|
||||
DestroyParser(&p);
|
||||
FreeTrig(&trig);
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
@@ -2981,7 +3055,7 @@ FEvalTrig(func_info *info)
|
||||
} else {
|
||||
/* Hokey... */
|
||||
if (trig.scanfrom != JulianToday) {
|
||||
Eprint("Warning: SCANFROM is ignored in two-argument form of evaltrig()");
|
||||
Wprint("Warning: SCANFROM is ignored in two-argument form of evaltrig()");
|
||||
}
|
||||
jul = ComputeTrigger(scanfrom, &trig, &tim, &r, 0);
|
||||
}
|
||||
@@ -2990,6 +3064,7 @@ FEvalTrig(func_info *info)
|
||||
jul = -1;
|
||||
}
|
||||
FreeTrig(&trig);
|
||||
DestroyParser(&p);
|
||||
if (r) return r;
|
||||
if (jul < 0) {
|
||||
RetVal.type = INT_TYPE;
|
||||
@@ -3003,3 +3078,59 @@ FEvalTrig(func_info *info)
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
static int LastTrig = 0;
|
||||
static int
|
||||
FTrig(func_info *info)
|
||||
{
|
||||
Parser p;
|
||||
Trigger trig;
|
||||
TimeTrig tim;
|
||||
int jul;
|
||||
int r;
|
||||
int i;
|
||||
|
||||
RetVal.type = DATE_TYPE;
|
||||
if (Nargs == 0) {
|
||||
RETVAL = LastTrig;
|
||||
return OK;
|
||||
}
|
||||
|
||||
for (i=0; i<Nargs; i++) {
|
||||
ASSERT_TYPE(i, STR_TYPE);
|
||||
}
|
||||
|
||||
RETVAL = 0;
|
||||
|
||||
for (i=0; i<Nargs; i++) {
|
||||
CreateParser(ARGSTR(i), &p);
|
||||
p.allownested = 0;
|
||||
r = ParseRem(&p, &trig, &tim, 0);
|
||||
if (r) {
|
||||
DestroyParser(&p);
|
||||
return r;
|
||||
}
|
||||
if (trig.typ != NO_TYPE) {
|
||||
DestroyParser(&p);
|
||||
FreeTrig(&trig);
|
||||
return E_PARSE_ERR;
|
||||
}
|
||||
jul = ComputeTrigger(trig.scanfrom, &trig, &tim, &r, 0);
|
||||
|
||||
if (r == E_CANT_TRIG) {
|
||||
DestroyParser(&p);
|
||||
FreeTrig(&trig);
|
||||
continue;
|
||||
}
|
||||
if (ShouldTriggerReminder(&trig, &tim, jul, &r)) {
|
||||
LastTrig = jul;
|
||||
RETVAL = jul;
|
||||
DestroyParser(&p);
|
||||
FreeTrig(&trig);
|
||||
return OK;
|
||||
}
|
||||
DestroyParser(&p);
|
||||
FreeTrig(&trig);
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -8,15 +8,16 @@
|
||||
/* globals.h and err.h */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h> /* For defintion of FILE - sigh! */
|
||||
#include <stdio.h> /* For definition of FILE - sigh! */
|
||||
#include "types.h"
|
||||
#include "custom.h"
|
||||
#include "lang.h"
|
||||
#define MK_GLOBALS 1
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
|
||||
125
src/globals.h
125
src/globals.h
@@ -11,6 +11,7 @@
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
#ifdef MK_GLOBALS
|
||||
#undef EXTERN
|
||||
#define EXTERN
|
||||
@@ -24,6 +25,10 @@
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
EXTERN FILE *ErrFp;
|
||||
|
||||
#include "dynbuf.h"
|
||||
#include "lang.h"
|
||||
|
||||
#define MAX_TRUSTED_USERS 20
|
||||
|
||||
@@ -75,6 +80,7 @@ EXTERN INIT( long SysTime, -1L);
|
||||
EXTERN char const *InitialFile;
|
||||
EXTERN int FileAccessDate;
|
||||
|
||||
EXTERN INIT( int DontSuppressQuoteMarkers, 0);
|
||||
EXTERN INIT( int DontFork, 0);
|
||||
EXTERN INIT( int DontQueue, 0);
|
||||
EXTERN INIT( int NumQueued, 0);
|
||||
@@ -88,13 +94,12 @@ EXTERN INIT( int DefaultColorB, -1);
|
||||
EXTERN INIT( int DefaultColorG, -1);
|
||||
EXTERN INIT( int SynthesizeTags, 0);
|
||||
EXTERN INIT( int ScFormat, SC_AMPM);
|
||||
EXTERN INIT( int MaxSatIter, 150);
|
||||
EXTERN INIT( int MaxSatIter, 1000);
|
||||
EXTERN INIT( int MaxStringLen, MAX_STR_LEN);
|
||||
EXTERN INIT( char *FileName, NULL);
|
||||
EXTERN INIT( int UseStdin, 0);
|
||||
EXTERN INIT( int PurgeMode, 0);
|
||||
EXTERN INIT( int PurgeIncludeDepth, 0);
|
||||
EXTERN FILE *ErrFp;
|
||||
EXTERN INIT( FILE *PurgeFP, NULL);
|
||||
EXTERN INIT( int NumIfs, 0);
|
||||
EXTERN INIT( unsigned int IfFlags, 0);
|
||||
@@ -118,14 +123,14 @@ EXTERN INIT( int UseTrueColors, 0);
|
||||
EXTERN INIT( int TerminalBackground, TERMINAL_BACKGROUND_UNKNOWN);
|
||||
|
||||
/* Latitude and longitude */
|
||||
EXTERN INIT( int LatDeg, LAT_DEG);
|
||||
EXTERN INIT( int LatMin, LAT_MIN);
|
||||
EXTERN INIT( int LatSec, LAT_SEC);
|
||||
EXTERN INIT( int LongDeg, LON_DEG);
|
||||
EXTERN INIT( int LongMin, LON_MIN);
|
||||
EXTERN INIT( int LongSec, LON_SEC);
|
||||
EXTERN INIT( double Longitude, -999.0);
|
||||
EXTERN INIT( double Latitude, -999.0);
|
||||
EXTERN INIT( int LatDeg, 0);
|
||||
EXTERN INIT( int LatMin, 0);
|
||||
EXTERN INIT( int LatSec, 0);
|
||||
EXTERN INIT( int LongDeg, 0);
|
||||
EXTERN INIT( int LongMin, 0);
|
||||
EXTERN INIT( int LongSec, 0);
|
||||
EXTERN INIT( double Longitude, DEFAULT_LONGITUDE);
|
||||
EXTERN INIT( double Latitude, DEFAULT_LATITUDE);
|
||||
|
||||
EXTERN INIT( char *Location, LOCATION);
|
||||
|
||||
@@ -141,11 +146,6 @@ EXTERN INIT( int SubsIndent, 0);
|
||||
EXTERN INIT( char *EndSent, ".?!");
|
||||
EXTERN INIT( char *EndSentIg, "\"')]}>");
|
||||
|
||||
/* We need the language stuff here... */
|
||||
|
||||
#include "lang.h"
|
||||
#include "dynbuf.h"
|
||||
|
||||
EXTERN DynamicBuffer Banner;
|
||||
EXTERN DynamicBuffer LineBuffer;
|
||||
EXTERN DynamicBuffer ExprBuf;
|
||||
@@ -227,3 +227,98 @@ EXTERN int MonthIndex[2][12]
|
||||
#endif
|
||||
;
|
||||
|
||||
EXTERN char *DynamicAgo
|
||||
#ifdef MK_GLOBALS
|
||||
= L_AGO
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicAm
|
||||
#ifdef MK_GLOBALS
|
||||
= L_AM
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicAnd
|
||||
#ifdef MK_GLOBALS
|
||||
= L_AND
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicAt
|
||||
#ifdef MK_GLOBALS
|
||||
= L_AT
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicFromnow
|
||||
#ifdef MK_GLOBALS
|
||||
= L_FROMNOW
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicHour
|
||||
#ifdef MK_GLOBALS
|
||||
= L_HOUR
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicHplu
|
||||
#ifdef MK_GLOBALS
|
||||
= L_HPLU
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicIs
|
||||
#ifdef MK_GLOBALS
|
||||
= L_IS
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicMinute
|
||||
#ifdef MK_GLOBALS
|
||||
= L_MINUTE
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicMplu
|
||||
#ifdef MK_GLOBALS
|
||||
= L_MPLU
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicNow
|
||||
#ifdef MK_GLOBALS
|
||||
= L_NOW
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicOn
|
||||
#ifdef MK_GLOBALS
|
||||
= L_ON
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicPm
|
||||
#ifdef MK_GLOBALS
|
||||
= L_PM
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicToday
|
||||
#ifdef MK_GLOBALS
|
||||
= L_TODAY
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicTomorrow
|
||||
#ifdef MK_GLOBALS
|
||||
= L_TOMORROW
|
||||
#endif
|
||||
;
|
||||
EXTERN char *DynamicWas
|
||||
#ifdef MK_GLOBALS
|
||||
= L_WAS
|
||||
#endif
|
||||
;
|
||||
|
||||
#define XSTR(x) #x
|
||||
#define STRSYSDIR(x) XSTR(x)
|
||||
|
||||
EXTERN char *SysDir
|
||||
#ifdef MK_GLOBALS
|
||||
= STRSYSDIR(SYSDIR)
|
||||
#endif
|
||||
;
|
||||
|
||||
EXTERN int SuppressLRM
|
||||
#ifdef MK_GLOBALS
|
||||
= 0
|
||||
#endif
|
||||
;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Support for the Hebrew calendar */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/* Derived from code written by Amos Shapir in 1978; revised */
|
||||
/* 1985. */
|
||||
|
||||
27
src/init.c
27
src/init.c
@@ -7,7 +7,7 @@
|
||||
/* in normal mode. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
#include "err.h"
|
||||
#include "globals.h"
|
||||
|
||||
/***************************************************************
|
||||
*
|
||||
@@ -154,7 +154,7 @@ void InitRemind(int argc, char const *argv[])
|
||||
if (FormWidth > 500) FormWidth = 500;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Initialize global dynamic buffers */
|
||||
DBufInit(&Banner);
|
||||
DBufInit(&LineBuffer);
|
||||
@@ -185,7 +185,7 @@ void InitRemind(int argc, char const *argv[])
|
||||
FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
|
||||
|
||||
/* Initialize Latitude and Longitude */
|
||||
set_lat_and_long_from_components();
|
||||
set_components_from_lat_and_long();
|
||||
|
||||
/* See if we were invoked as "rem" rather than "remind" */
|
||||
if (argv[0]) {
|
||||
@@ -232,7 +232,10 @@ void InitRemind(int argc, char const *argv[])
|
||||
Use256Colors = 1;
|
||||
} else if (x == 2) {
|
||||
UseTrueColors = 1;
|
||||
}
|
||||
} else if (x != 0) {
|
||||
fprintf(ErrFp, "%s: -@n,m: n must be 0, 1 or 2 (assuming 0)\n",
|
||||
argv[0]);
|
||||
}
|
||||
}
|
||||
if (*arg == ',') {
|
||||
arg++;
|
||||
@@ -241,7 +244,10 @@ void InitRemind(int argc, char const *argv[])
|
||||
TerminalBackground = TERMINAL_BACKGROUND_DARK;
|
||||
} else if (x == 1) {
|
||||
TerminalBackground = TERMINAL_BACKGROUND_LIGHT;
|
||||
}
|
||||
} else {
|
||||
fprintf(ErrFp, "%s: -@n,m: m must be 0 or 1\n",
|
||||
argv[0]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -459,6 +465,7 @@ void InitRemind(int argc, char const *argv[])
|
||||
DoSimpleCalendar = 1;
|
||||
PsCal = PSCAL_LEVEL1;
|
||||
while (*arg == 'a' || *arg == 'A' ||
|
||||
*arg == 'q' || *arg == 'Q' ||
|
||||
*arg == 'p' || *arg == 'P') {
|
||||
if (*arg == 'a' || *arg == 'A') {
|
||||
DoSimpleCalDelta = 1;
|
||||
@@ -471,7 +478,9 @@ void InitRemind(int argc, char const *argv[])
|
||||
} else {
|
||||
PsCal = PSCAL_LEVEL3;
|
||||
}
|
||||
}
|
||||
} else if (*arg == 'q' || *arg == 'Q') {
|
||||
DontSuppressQuoteMarkers = 1;
|
||||
}
|
||||
arg++;
|
||||
}
|
||||
PARSENUM(CalMonths, arg);
|
||||
@@ -672,7 +681,7 @@ void InitRemind(int argc, char const *argv[])
|
||||
#ifndef L_USAGE_OVERRIDE
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2022 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
@@ -698,7 +707,7 @@ void Usage(void)
|
||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline f=tracefiles\n");
|
||||
fprintf(ErrFp, " -e Divert messages normally sent to stderr to stdout\n");
|
||||
fprintf(ErrFp, " -b[n] Time format for cal: 0=am/pm, 1=24hr, 2=none\n");
|
||||
fprintf(ErrFp, " -x[n] Iteration limit for SATISFY clause (def=150)\n");
|
||||
fprintf(ErrFp, " -x[n] Iteration limit for SATISFY clause (def=1000)\n");
|
||||
fprintf(ErrFp, " -kcmd Run `cmd' for MSG-type reminders\n");
|
||||
fprintf(ErrFp, " -g[dddd] Sort reminders by date, time, priority, and 'timedness'\n");
|
||||
fprintf(ErrFp, " -ivar=val Initialize var to val and preserve var\n");
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Header file for language support for various languages. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* REMIND is Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* This file is Copyright (C) 1993 by Mogens Lynnerup. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
@@ -48,9 +48,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "siden"
|
||||
#define L_FROMNOW "fra nu"
|
||||
@@ -91,5 +88,3 @@
|
||||
#define L_I_OVER sprintf(s, "den %02d%c%02d", m+1, DateSep, d);
|
||||
#define L_U_OVER L_A_OVER
|
||||
#define L_V_OVER L_G_OVER
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/* Further corrections by Erik-Jan Vens */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -52,9 +52,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "geleden"
|
||||
#define L_FROMNOW "vanaf nu"
|
||||
@@ -91,15 +88,14 @@ if (tdiff == 0) \
|
||||
sprintf(s, L_NOW); \
|
||||
else if (hdiff == 0) \
|
||||
sprintf(s, "%d %s %s", mdiff, \
|
||||
(mdiff == 1 ? "minuut" : "minuten"), when); \
|
||||
((mdiff == 1) ? "minuut" : "minuten"), when); \
|
||||
else if (mdiff == 0) \
|
||||
sprintf(s, "%d %s %s", hdiff, \
|
||||
(mdiff == 1 ? "uur" : "uren"), when); \
|
||||
else sprintf(s, "%d %s %s %d %s %s", hdiff, \
|
||||
(hdiff == 1 ? "uur" : "uren"), \
|
||||
L_AND, mdiff, \
|
||||
(mdiff == 1 ? "minuut" : "minuten"), \
|
||||
when);
|
||||
((hdiff == 1) ? "uur" : "uren"), when); \
|
||||
else sprintf(s, "%d %s %s %d %s %s", hdiff, \
|
||||
(hdiff == 1 ? "uur" : "uren"), \
|
||||
L_AND, mdiff, \
|
||||
(mdiff == 1 ? "minuut" : "minuten"), \
|
||||
when);
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Support for the English language. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -46,9 +46,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "ago"
|
||||
#define L_FROMNOW "from now"
|
||||
@@ -72,11 +69,9 @@
|
||||
#define L_WAS "was"
|
||||
#define L_AND "and"
|
||||
/* What to add to make "hour" plural */
|
||||
#define L_HPLU "s"
|
||||
#define L_HPLU "s"
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU "s"
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* This file is Copyright (C) 1993-1998 by Mikko Silvonen. */
|
||||
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* REMIND is Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -52,9 +52,6 @@
|
||||
#define L_AM " ap."
|
||||
#define L_PM " ip."
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "sitten"
|
||||
#define L_FROMNOW "kuluttua"
|
||||
@@ -138,7 +135,6 @@ else { \
|
||||
} \
|
||||
sprintf(s + strlen(s), when); \
|
||||
}
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
/* The next ones are used only when MK_GLOBALS is set */
|
||||
#ifdef MK_GLOBALS
|
||||
@@ -257,7 +253,7 @@ EXTERN char *ErrMsg[] =
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2022 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETAVERSIO <<<<\n");
|
||||
#endif
|
||||
@@ -283,7 +279,7 @@ void Usage(void)
|
||||
fprintf(ErrFp, " -d... Virheenetsintä: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||
fprintf(ErrFp, " -e Ohjaa virhetulostus stdout-vuohon\n");
|
||||
fprintf(ErrFp, " -b[n] Ajan ilmaisu: 0=ap/ip, 1=24 tuntia, 2=ei aikoja\n");
|
||||
fprintf(ErrFp, " -x[n] SATISFY-lauseen toistoraja (oletus 150)\n");
|
||||
fprintf(ErrFp, " -x[n] SATISFY-lauseen toistoraja (oletus 1000)\n");
|
||||
fprintf(ErrFp, " -kcmd Suorita 'cmd' MSG-tyyppisille viesteille\n");
|
||||
fprintf(ErrFp, " -g[ddd] Lajittele viestit päiväyksen, ajan ja tärkeyden mukaan\n");
|
||||
fprintf(ErrFp, " -ivar=val Alusta muuttuja var arvolla val ja säilytä var\n");
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* REMIND is Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* This file is Copyright (C) 1993 by Laurent Duperval and */
|
||||
/* Dianne Skoll. */
|
||||
/* */
|
||||
@@ -51,9 +51,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "il y a"
|
||||
#define L_FROMNOW "dans"
|
||||
@@ -113,8 +110,6 @@ else if (tdiff < 0) { \
|
||||
|
||||
#define L_K_OVER if (altmode == '*') { sprintf(s, "%s, %d%s %s", DayName[jul%7], d, plu, MonthName[m]); } else { sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu, MonthName[m]); }
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
/* The next ones are used only when MK_GLOBALS is set */
|
||||
#ifdef MK_GLOBALS
|
||||
#define L_ERR_OVERRIDE 1
|
||||
@@ -232,7 +227,7 @@ EXTERN char *ErrMsg[] =
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2022 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
@@ -258,7 +253,7 @@ void Usage(void)
|
||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||
fprintf(ErrFp, " -e Envoyer les messages de stderr à stdout\n");
|
||||
fprintf(ErrFp, " -b[n] Formats de l'heure pour le calendrier: 0=am/pm, 1=24hr, 2=aucun\n");
|
||||
fprintf(ErrFp, " -x[n] Limite d'itérations pour la clause SATISFY (def=150)\n");
|
||||
fprintf(ErrFp, " -x[n] Limite d'itérations pour la clause SATISFY (def=1000)\n");
|
||||
fprintf(ErrFp, " -kcmd Exécuter 'cmd' pour les rappels de type MSG\n");
|
||||
fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorité avant d'émettre\n");
|
||||
fprintf(ErrFp, " -ivar=val Initialiser var à val et conserver var\n");
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/* I don't speak German. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -50,9 +50,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "vorher"
|
||||
#define L_FROMNOW "von heute"
|
||||
@@ -88,5 +85,3 @@
|
||||
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s", DayName[jul%7], d, MonthName[m]); } else { sprintf(s, "%s %s, den %d. %s", L_ON, DayName[jul%7], d, MonthName[m]); }
|
||||
#define L_U_OVER L_A_OVER
|
||||
#define L_V_OVER L_G_OVER
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/* Support for the Icelandic language. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Translated by Björn Davíðsson (bjossi@snerpa.is) */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* Translated by Björn Davíðsson (bjossi@snerpa.is) */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -15,59 +15,56 @@
|
||||
|
||||
/* Day names */
|
||||
#define L_SUNDAY "sunnudagur"
|
||||
#define L_MONDAY "mánudagur"
|
||||
#define L_TUESDAY "þriðjudagur"
|
||||
#define L_WEDNESDAY "miðvikudagur"
|
||||
#define L_MONDAY "mánudagur"
|
||||
#define L_TUESDAY "þriðjudagur"
|
||||
#define L_WEDNESDAY "miðvikudagur"
|
||||
#define L_THURSDAY "fimmtudagur"
|
||||
#define L_FRIDAY "föstudagur"
|
||||
#define L_FRIDAY "föstudagur"
|
||||
#define L_SATURDAY "laugardagur"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "janúar"
|
||||
#define L_FEB "febrúar"
|
||||
#define L_JAN "janúar"
|
||||
#define L_FEB "febrúar"
|
||||
#define L_MAR "mars"
|
||||
#define L_APR "apríl"
|
||||
#define L_MAY "maí"
|
||||
#define L_JUN "júní"
|
||||
#define L_JUL "júlí"
|
||||
#define L_AUG "ágúst"
|
||||
#define L_APR "apríl"
|
||||
#define L_MAY "maí"
|
||||
#define L_JUN "júní"
|
||||
#define L_JUL "júlí"
|
||||
#define L_AUG "ágúst"
|
||||
#define L_SEP "september"
|
||||
#define L_OCT "október"
|
||||
#define L_NOV "nóvember"
|
||||
#define L_OCT "október"
|
||||
#define L_NOV "nóvember"
|
||||
#define L_DEC "desember"
|
||||
|
||||
/* Today and tomorrow */
|
||||
#define L_TODAY "í dag"
|
||||
#define L_TOMORROW "á morgun"
|
||||
#define L_TODAY "í dag"
|
||||
#define L_TOMORROW "á morgun"
|
||||
|
||||
/* The default banner */
|
||||
#define L_BANNER "Minnisatriði: %w, %d%s %m, %y%o:"
|
||||
#define L_BANNER "Minnisatriði: %w, %d%s %m, %y%o:"
|
||||
|
||||
/* "am" and "pm" */
|
||||
#define L_AM "fh"
|
||||
#define L_PM "eh"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "síðan"
|
||||
#define L_FROMNOW "frá því nú"
|
||||
#define L_AGO "síðan"
|
||||
#define L_FROMNOW "frá því nú"
|
||||
|
||||
/* "in %d days' time" */
|
||||
#define L_INXDAYS "eftir %d daga"
|
||||
|
||||
/* "on" as in "on date..." */
|
||||
#define L_ON "þann"
|
||||
#define L_ON "þann"
|
||||
|
||||
/* Pluralizing - this is a problem for many languages and may require
|
||||
a more drastic fix */
|
||||
#define L_PLURAL "a"
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#define L_NOW "núna"
|
||||
#define L_NOW "núna"
|
||||
#define L_AT "kl."
|
||||
#define L_MINUTE "mínútu"
|
||||
#define L_MINUTE "mínútu"
|
||||
#define L_HOUR "klukkustund"
|
||||
#define L_IS "er"
|
||||
#define L_WAS "var"
|
||||
@@ -79,5 +76,3 @@
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/* This file is part of REMIND. */
|
||||
/* It is Copyright (C) 1996 by Valerio Aimale */
|
||||
/* */
|
||||
/* Remind is copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Remind is copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -49,9 +49,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "fa"
|
||||
#define L_FROMNOW "da oggi"
|
||||
@@ -114,6 +111,3 @@
|
||||
|
||||
#define L_V_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
|
||||
MonthName[m]);
|
||||
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* This file is Copyright (C) 1993 by Trygve Randen. */
|
||||
/* Remind is Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Remind is Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -47,9 +47,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "siden"
|
||||
#define L_FROMNOW "fra nå"
|
||||
@@ -84,6 +81,3 @@
|
||||
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s", DayName[jul%7], d, MonthName[m]); } else { sprintf(s, "%s %s, den %d. %s", L_ON, DayName[jul%7], d, MonthName[m]); }
|
||||
#define L_U_OVER L_A_OVER
|
||||
#define L_V_OVER L_G_OVER
|
||||
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
/* Polish. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -50,9 +50,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "temu"
|
||||
#define L_FROMNOW "od teraz"
|
||||
@@ -75,13 +72,17 @@
|
||||
# define L_IS "będzie"
|
||||
# define L_WAS "było"
|
||||
#define L_AND "i"
|
||||
|
||||
#define L_HPLU ""
|
||||
#define L_MPLU ""
|
||||
|
||||
/* What to add to make "hour" or "minute" plural */
|
||||
#define L_NPLU( N ) ((N == 1) ? "ę" : ((N==12) || (N==13) || (N==14)) ? "" : \
|
||||
((N%10==2) || (N%10==3) || (N%10==4)) ? "y" : "" )
|
||||
/* What to add to make "hour" plural */
|
||||
#define L_HPLU L_NPLU( hdiff )
|
||||
#define L_HPLU_OVER hplu = L_NPLU( hdiff );
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU L_NPLU( mdiff )
|
||||
#define L_MPLU_OVER mplu = L_NPLU( mdiff );
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
@@ -99,32 +100,30 @@ ampm = (hour<12) ? \
|
||||
#define L_U_OVER L_A_OVER
|
||||
#define L_V_OVER L_G_OVER
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
#define L_0_OVER sprintf(s, L_HPLU);
|
||||
#define L_9_OVER sprintf(s, L_MPLU);
|
||||
#define L_0_OVER sprintf(s, L_NPLU(hdiff));
|
||||
#define L_9_OVER sprintf(s, L_NPLU(mdiff));
|
||||
#define L_1_OVER \
|
||||
if (tdiff == 0) \
|
||||
sprintf(s, L_NOW); \
|
||||
else if (tdiff > 0) \
|
||||
{ \
|
||||
if (hdiff == 0) \
|
||||
sprintf(s, "za %d %s%s", mdiff, L_MINUTE, L_MPLU); \
|
||||
sprintf(s, "za %d %s%s", mdiff, L_MINUTE, L_NPLU(mdiff)); \
|
||||
else if (mdiff == 0) \
|
||||
sprintf(s, "za %d %s%s", hdiff, L_HOUR, L_HPLU); \
|
||||
sprintf(s, "za %d %s%s", hdiff, L_HOUR, L_NPLU(hdiff)); \
|
||||
else \
|
||||
sprintf(s, "za %d %s%s %s %d %s%s", hdiff, L_HOUR, L_HPLU, \
|
||||
L_AND, mdiff, L_MINUTE, L_MPLU); \
|
||||
sprintf(s, "za %d %s%s %s %d %s%s", hdiff, L_HOUR, L_NPLU(hdiff), \
|
||||
L_AND, mdiff, L_MINUTE, L_NPLU(mdiff)); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (hdiff == 0) \
|
||||
sprintf(s, "%d %s%s temu", mdiff, L_MINUTE, L_MPLU); \
|
||||
sprintf(s, "%d %s%s temu", mdiff, L_MINUTE, L_NPLU(mdiff)); \
|
||||
else if (mdiff == 0) \
|
||||
sprintf(s, "%d %s%s temu", hdiff, L_HOUR, L_HPLU); \
|
||||
sprintf(s, "%d %s%s temu", hdiff, L_HOUR, L_NPLU(hdiff)); \
|
||||
else \
|
||||
sprintf(s, "%d %s%s %s %d %s%s temu", hdiff, L_HOUR, L_HPLU, \
|
||||
L_AND, mdiff, L_MINUTE, L_MPLU); \
|
||||
sprintf(s, "%d %s%s %s %d %s%s temu", hdiff, L_HOUR, L_NPLU(hdiff), \
|
||||
L_AND, mdiff, L_MINUTE, L_NPLU(mdiff)); \
|
||||
}
|
||||
|
||||
/* The next ones are used only when MK_GLOBALS is set */
|
||||
@@ -244,7 +243,7 @@ EXTERN char *ErrMsg[] =
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2022 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
@@ -270,7 +269,7 @@ void Usage(void)
|
||||
fprintf(ErrFp, " -d... Odpluskwianie: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||
fprintf(ErrFp, " -e Komunikaty o błędach skieruj na stdout\n");
|
||||
fprintf(ErrFp, " -b[n] Format czasu: 0=am/pm, 1=24godz., 2=żaden\n");
|
||||
fprintf(ErrFp, " -x[n] Limit powtórzeń klauzuli SATISFY (domyślnie=150)\n");
|
||||
fprintf(ErrFp, " -x[n] Limit powtórzeń klauzuli SATISFY (domyślnie=1000)\n");
|
||||
fprintf(ErrFp, " -kcmd Wywołaj 'cmd' dla przypomnień typu MSG\n");
|
||||
fprintf(ErrFp, " -g[ddd] Sortuj przypomnienia według daty, czasu i priorytetu\n");
|
||||
fprintf(ErrFp, " -ivar=val Zainicjuj zmienną var wartościa val i zachowaj ja\n");
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* REMIND is Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* This file is Copyright (C) 1996 by Marco Paganini and */
|
||||
/* Dianne Skoll. */
|
||||
/* */
|
||||
@@ -51,9 +51,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "atras"
|
||||
#define L_FROMNOW "adiante"
|
||||
@@ -138,8 +135,6 @@
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
/* The next ones are used only when MK_GLOBALS is set */
|
||||
#ifdef MK_GLOBALS
|
||||
#define L_ERR_OVERRIDE 1
|
||||
@@ -257,7 +252,7 @@ EXTERN char *ErrMsg[] =
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-2022 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> VERSAO BETA <<<<\n");
|
||||
#endif
|
||||
@@ -283,7 +278,7 @@ void Usage(void)
|
||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trigger v=dumpvars l=showline\n");
|
||||
fprintf(ErrFp, " -e Desvia mensagens normalmente enviadas a stderr para stdout\n");
|
||||
fprintf(ErrFp, " -b[n] Formato da hora para o cal: 0=am/pm, 1=24hr, 2=nenhum\n");
|
||||
fprintf(ErrFp, " -x[n] Limite de iteracoes para a clausula SATISFY (default=150)\n");
|
||||
fprintf(ErrFp, " -x[n] Limite de iteracoes para a clausula SATISFY (default=1000)\n");
|
||||
fprintf(ErrFp, " -kcmd Executa `cmd' para os compromissos com MSG\n");
|
||||
fprintf(ErrFp, " -g[ddd] Classifica compromissos por data, hora e prioridade antes de exibir\n");
|
||||
fprintf(ErrFp, " -ivar=val Inicializa (e preserva) variavel var com val\n");
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* REMIND is Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* This file is Copyright (C) 1996-1998 by Liviu Daia */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
@@ -50,9 +50,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
#ifdef L_IN_DOSUBST
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "acum"
|
||||
#define L_FROMNOW "peste"
|
||||
@@ -76,6 +73,7 @@
|
||||
#define L_WAS "a fost"
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU "e"
|
||||
#define L_HPLU "e"
|
||||
|
||||
/* What to add to make "hour" plural */
|
||||
#define L_HPLU_OVER hplu = (hdiff == 1 ? "ă" : "e");
|
||||
@@ -104,5 +102,3 @@
|
||||
else \
|
||||
sprintf(s, "%s %d %s%s %s %d %s%s", when, hdiff, \
|
||||
L_HOUR, hplu, L_AND, mdiff, L_MINUTE, mplu);
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
/* Author: Rafa Couto <rafacouto@biogate.com> */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -47,9 +47,6 @@
|
||||
#define L_AM "am"
|
||||
#define L_PM "pm"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Hace y desde hoy */
|
||||
#define L_AGO "hace"
|
||||
#define L_FROMNOW "desde hoy"
|
||||
@@ -74,5 +71,3 @@
|
||||
#define L_HPLU "s"
|
||||
#define L_MPLU "s"
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
|
||||
63
src/main.c
63
src/main.c
@@ -6,7 +6,7 @@
|
||||
/* routines, etc. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -44,10 +44,6 @@
|
||||
|
||||
static void DoReminders(void);
|
||||
|
||||
/* Whooo... the putchar/Putchar/PutChar macros are a mess...
|
||||
my apologies... */
|
||||
#define Putchar(c) PutChar(c)
|
||||
|
||||
/***************************************************************/
|
||||
/***************************************************************/
|
||||
/** **/
|
||||
@@ -572,6 +568,29 @@ int EvaluateExpr(ParsePtr p, Value *v)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* Wprint - print a warning message. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
void Wprint(char const *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
|
||||
|
||||
if (FileName) {
|
||||
if (strcmp(FileName, "-"))
|
||||
(void) fprintf(ErrFp, "%s(%d): ", FileName, LineNo);
|
||||
else
|
||||
(void) fprintf(ErrFp, "-stdin-(%d): ", LineNo);
|
||||
}
|
||||
|
||||
va_start(argptr, fmt);
|
||||
(void) vfprintf(ErrFp, fmt, argptr);
|
||||
(void) fputc('\n', ErrFp);
|
||||
va_end(argptr);
|
||||
return;
|
||||
}
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* Eprint - print an error message. */
|
||||
@@ -586,13 +605,23 @@ void Eprint(char const *fmt, ...)
|
||||
|
||||
if (FreshLine && FileName) {
|
||||
FreshLine = 0;
|
||||
if (strcmp(FileName, "-"))
|
||||
if (strcmp(FileName, "-")) {
|
||||
(void) fprintf(ErrFp, "%s(%d): ", FileName, LineNo);
|
||||
else
|
||||
if (print_callstack(ErrFp)) {
|
||||
(void) fprintf(ErrFp, ": ");
|
||||
}
|
||||
} else {
|
||||
(void) fprintf(ErrFp, "-stdin-(%d): ", LineNo);
|
||||
if (print_callstack(ErrFp)) {
|
||||
(void) fprintf(ErrFp, ": ");
|
||||
}
|
||||
}
|
||||
if (DebugFlag & DB_PRTLINE) OutputLine(ErrFp);
|
||||
} else if (FileName) {
|
||||
fprintf(ErrFp, " ");
|
||||
if (print_callstack(ErrFp)) {
|
||||
(void) fprintf(ErrFp, ": ");
|
||||
}
|
||||
}
|
||||
|
||||
va_start(argptr, fmt);
|
||||
@@ -616,11 +645,11 @@ void OutputLine(FILE *fp)
|
||||
char c = 0;
|
||||
|
||||
while (*s) {
|
||||
if (*s == '\n') Putc('\\', fp);
|
||||
Putc(*s, fp);
|
||||
if (*s == '\n') putc('\\', fp);
|
||||
putc(*s, fp);
|
||||
c = *s++;
|
||||
}
|
||||
if (c != '\n') Putc('\n', fp);
|
||||
if (c != '\n') putc('\n', fp);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -1116,8 +1145,8 @@ int DoErrMsg(ParsePtr p)
|
||||
|
||||
/* The array FoldArray[2][7] contains sample years which begin
|
||||
on the specified weekday. For example, FoldArray[0][2] is a
|
||||
non-leapyear beginning on Wednesday, and FoldArray[1][5] is a
|
||||
leapyear beginning on Saturday. Used to fold back dates which
|
||||
non-leap year beginning on Wednesday, and FoldArray[1][5] is a
|
||||
leap year beginning on Saturday. Used to fold back dates which
|
||||
are too high for the standard Unix representation.
|
||||
NOTE: This implies that you cannot set BASE > 2001!!!!! */
|
||||
static int FoldArray[2][7] = {
|
||||
@@ -1212,7 +1241,7 @@ void FillParagraph(char const *s)
|
||||
|
||||
/* If it's a carriage return, output it and start new paragraph */
|
||||
if (*s == '\n') {
|
||||
Putchar('\n');
|
||||
putchar('\n');
|
||||
s++;
|
||||
line = 0;
|
||||
while(ISBLANK(*s)) s++;
|
||||
@@ -1225,7 +1254,7 @@ void FillParagraph(char const *s)
|
||||
number of spaces */
|
||||
j = line ? SubsIndent : FirstIndent;
|
||||
for (i=0; i<j; i++) {
|
||||
Putchar(' ');
|
||||
putchar(' ');
|
||||
}
|
||||
|
||||
/* Calculate the amount of room left on this line */
|
||||
@@ -1244,17 +1273,17 @@ void FillParagraph(char const *s)
|
||||
}
|
||||
if (!pendspace || len+pendspace <= roomleft) {
|
||||
for (i=0; i<pendspace; i++) {
|
||||
Putchar(' ');
|
||||
putchar(' ');
|
||||
}
|
||||
while(t < s) {
|
||||
Putchar(*t);
|
||||
putchar(*t);
|
||||
if (strchr(EndSent, *t)) doublespace = 2;
|
||||
else if (!strchr(EndSentIg, *t)) doublespace = 1;
|
||||
t++;
|
||||
}
|
||||
} else {
|
||||
s = t;
|
||||
Putchar('\n');
|
||||
putchar('\n');
|
||||
line++;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Calculations for figuring out moon phases. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* the data structures for OMITted dates. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -463,7 +463,7 @@ DoThroughOmit(ParsePtr p, int ystart, int mstart, int dstart)
|
||||
end = Julian(yend, mend, dend);
|
||||
|
||||
if (end < start) {
|
||||
Eprint("Warning: Swapping dates on OMIT ... THROUGH ... line");
|
||||
Wprint("Warning: Swapping dates on OMIT ... THROUGH ... line");
|
||||
tmp = start;
|
||||
start = end;
|
||||
end = tmp;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Function Prototypes. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -62,6 +62,7 @@ int EvaluateExpr (ParsePtr p, Value *v);
|
||||
int Evaluate (char const **s, Var *locals, ParsePtr p);
|
||||
int FnPopValStack (Value *val);
|
||||
void Eprint (char const *fmt, ...);
|
||||
void Wprint (char const *fmt, ...);
|
||||
void OutputLine (FILE *fp);
|
||||
void CreateParser (char const *s, ParsePtr p);
|
||||
void DestroyParser (ParsePtr p);
|
||||
@@ -169,3 +170,9 @@ void set_components_from_lat_and_long(void);
|
||||
|
||||
char const *get_day_name(int wkday);
|
||||
char const *get_month_name(int mon);
|
||||
|
||||
int push_call(char const *filename, char const *func, int lineno);
|
||||
void clear_callstack(void);
|
||||
int have_callstack(void);
|
||||
int print_callstack(FILE *fp);
|
||||
void pop_call(void);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Queue up reminders for subsequent execution. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -184,7 +184,9 @@ void HandleQueuedReminders(void)
|
||||
while (TimeToSleep > 0L) {
|
||||
SleepTime = TimeToSleep;
|
||||
|
||||
if (Daemon > 0 && SleepTime > (unsigned int) 60*Daemon) SleepTime = 60*Daemon;
|
||||
if (Daemon > 0 && SleepTime > (unsigned int) 60*Daemon) {
|
||||
SleepTime = 60*Daemon;
|
||||
}
|
||||
|
||||
/* Wake up once a minute to recalibrate sleep time in
|
||||
case of laptop hibernation */
|
||||
@@ -230,7 +232,7 @@ void HandleQueuedReminders(void)
|
||||
/* 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
|
||||
However, DO trigger if tt.nexttime == tt.ttime so all
|
||||
queued reminders are triggered at least once. */
|
||||
if ((SystemTime(1) - (q->tt.nexttime * 60) <= 60) ||
|
||||
(q->tt.nexttime == q->tt.ttime)) {
|
||||
|
||||
20
src/rem2ps.c
20
src/rem2ps.c
@@ -5,7 +5,7 @@
|
||||
/* Print a PostScript calendar. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -146,9 +146,9 @@ put_escaped_string(char const *s)
|
||||
{
|
||||
while(*s) {
|
||||
if (*s == '\\' || *s == '(' || *s == ')') {
|
||||
PutChar('\\');
|
||||
putchar('\\');
|
||||
}
|
||||
PutChar(*s);
|
||||
putchar(*s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
@@ -349,7 +349,7 @@ int main(int argc, char *argv[])
|
||||
!strcmp(DBufValue(&buf), PSBEGIN2)) {
|
||||
if (!validfile) {
|
||||
if (Verbose) {
|
||||
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-2021 by Dianne Skoll\n\n", VERSION);
|
||||
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-2022 by Dianne Skoll\n\n", VERSION);
|
||||
fprintf(stderr, "Generating PostScript calendar\n");
|
||||
}
|
||||
}
|
||||
@@ -625,7 +625,7 @@ void WriteProlog(void)
|
||||
strcmp(SmallFont, DayFont) &&
|
||||
strcmp(TitleFont, SmallFont) &&
|
||||
strcmp(SmallFont, EntryFont)) printf(" %s", SmallFont);
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
printf("%%%%Creator: Rem2PS\n");
|
||||
printf("%%%%Pages: (atend)\n");
|
||||
printf("%%%%Orientation: %s\n", PortraitMode ? "Portrait" : "Landscape");
|
||||
@@ -805,20 +805,20 @@ void WriteOneEntry(CalEntry *c)
|
||||
}
|
||||
}
|
||||
|
||||
PutChar('(');
|
||||
putchar('(');
|
||||
while(*s) {
|
||||
/* Use the "unsigned char" cast to fix problem on Solaris 2.5 */
|
||||
/* which treated some latin1 characters as white space. */
|
||||
ch = (unsigned char) *s++;
|
||||
if (ch == '\\' || ch == '(' || ch == ')') PutChar('\\');
|
||||
if (!isspace(ch)) PutChar(ch);
|
||||
if (ch == '\\' || ch == '(' || ch == ')') putchar('\\');
|
||||
if (!isspace(ch)) putchar(ch);
|
||||
else {
|
||||
PutChar(')');
|
||||
putchar(')');
|
||||
while(isspace((unsigned char)*s)) s++;
|
||||
if (!*s) {
|
||||
goto finish;
|
||||
}
|
||||
PutChar('(');
|
||||
putchar('(');
|
||||
}
|
||||
}
|
||||
printf(")\n");
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Define the PostScript prologue */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -13,7 +13,7 @@ char *PSProlog1[] =
|
||||
{
|
||||
"% This file was produced by Remind and Rem2PS, written by",
|
||||
"% Dianne Skoll.",
|
||||
"% Remind and Rem2PS are Copyright 1992-2021 Dianne Skoll.",
|
||||
"% Remind and Rem2PS are Copyright 1992-2022 Dianne Skoll.",
|
||||
"/ISOLatin1Encoding where { pop save true }{ false } ifelse",
|
||||
" /ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus",
|
||||
" StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Routines for sorting reminders by trigger date */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
@@ -4,9 +4,23 @@
|
||||
|
||||
ALL=`grep ^#define lang.h | grep -v '#define LANG' | awk '{print $2}'`
|
||||
|
||||
OUTPUT_COMPILED=lang-compiled.out
|
||||
OUTPUT_RUNTIME=lang-runtime.out
|
||||
cat /dev/null > $OUTPUT_COMPILED
|
||||
cat /dev/null > $OUTPUT_RUNTIME
|
||||
for i in $ALL ; do
|
||||
make clean
|
||||
make -j`nproc` all LANGDEF=-DLANG=$i || exit 1
|
||||
./remind -q -r ../tests/tstlang.rem
|
||||
./remind -q -r ../tests/tstlang.rem >> $OUTPUT_COMPILED 2>&1
|
||||
done
|
||||
|
||||
# Rebuild English version
|
||||
make clean
|
||||
make -j`nproc` all || exit 1
|
||||
|
||||
ALL=`ls ../include/lang/*.rem`
|
||||
for i in $ALL; do
|
||||
./remind -q -r "-ii=\"$i\"" ../tests/tstlang.rem >> $OUTPUT_RUNTIME 2>&1
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
32
src/token.c
32
src/token.c
@@ -6,7 +6,7 @@
|
||||
/* classifying the tokens parsed. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -43,30 +43,36 @@ Token TokArray[] = {
|
||||
{ "at", 2, T_At, 0 },
|
||||
{ "august", 3, T_Month, 7 },
|
||||
{ "banner", 3, T_Banner, 0 },
|
||||
{ "before", 3, T_Skip, BEFORE_SKIP },
|
||||
{ "before", 3, T_Skip, BEFORE_SKIP },
|
||||
{ "cal", 3, T_RemType, CAL_TYPE },
|
||||
{ "clear-omit-context", 5, T_Clr, 0 },
|
||||
{ "debug", 5, T_Debug, 0 },
|
||||
{ "debug", 5, T_Debug, 0 },
|
||||
{ "december", 3, T_Month, 11 },
|
||||
{ "do", 2, T_IncludeR, 0 },
|
||||
{ "dumpvars", 4, T_Dumpvars, 0 },
|
||||
{ "dumpvars", 4, T_Dumpvars, 0 },
|
||||
{ "duration", 3, T_Duration, 0 },
|
||||
{ "else", 4, T_Else, 0 },
|
||||
{ "else", 4, T_Else, 0 },
|
||||
{ "endif", 5, T_EndIf, 0 },
|
||||
{ "errmsg", 6, T_ErrMsg, 0 },
|
||||
{ "errmsg", 6, T_ErrMsg, 0 },
|
||||
{ "exit", 4, T_Exit, 0 },
|
||||
{ "february", 3, T_Month, 1 },
|
||||
{ "first", 5, T_Ordinal, 0 },
|
||||
{ "flush", 5, T_Flush, 0 },
|
||||
{ "fourth", 6, T_Ordinal, 3 },
|
||||
{ "friday", 3, T_WkDay, 4 },
|
||||
{ "from", 4, T_Scanfrom, FROM_TYPE },
|
||||
{ "fset", 4, T_Fset, 0 },
|
||||
{ "if", 2, T_If, 0 },
|
||||
{ "iftrig", 6, T_IfTrig, 0 },
|
||||
{ "in", 2, T_In, 0 },
|
||||
{ "include", 3, T_Include, 0 },
|
||||
{ "includecmd", 10, T_IncludeCmd, 0 },
|
||||
{ "january", 3, T_Month, 0 },
|
||||
{ "july", 3, T_Month, 6 },
|
||||
{ "june", 3, T_Month, 5 },
|
||||
{ "last", 4, T_Ordinal, -1 },
|
||||
{ "lastday", 7, T_BackAdj, -1 },
|
||||
{ "lastworkday", 11, T_BackAdj, 1 },
|
||||
{ "march", 3, T_Month, 2 },
|
||||
{ "may", 3, T_Month, 4 },
|
||||
{ "maybe-uncomputable", 5, T_MaybeUncomputable, 0},
|
||||
@@ -90,12 +96,14 @@ Token TokArray[] = {
|
||||
{ "saturday", 3, T_WkDay, 5 },
|
||||
{ "scanfrom", 4, T_Scanfrom, SCANFROM_TYPE },
|
||||
{ "sched", 5, T_Sched, 0 },
|
||||
{ "second", 6, T_Ordinal, 1 },
|
||||
{ "september", 3, T_Month, 8 },
|
||||
{ "set", 3, T_Set, 0 },
|
||||
{ "skip", 3, T_Skip, SKIP_SKIP },
|
||||
{ "special", 7, T_RemType, PASSTHRU_TYPE },
|
||||
{ "sunday", 3, T_WkDay, 6 },
|
||||
{ "tag", 3, T_Tag, 0 },
|
||||
{ "third", 5, T_Ordinal, 2 },
|
||||
{ "through", 7, T_Through, 0 },
|
||||
{ "thursday", 3, T_WkDay, 3 },
|
||||
{ "tuesday", 3, T_WkDay, 1 },
|
||||
@@ -147,10 +155,6 @@ void FindToken(char const *s, Token *tok)
|
||||
int top, bot, mid, r, max;
|
||||
int l;
|
||||
|
||||
#if LANG != ENGLISH
|
||||
size_t i;
|
||||
#endif
|
||||
|
||||
tok->type = T_Illegal;
|
||||
if (! *s) {
|
||||
tok->type = T_Empty;
|
||||
@@ -325,6 +329,14 @@ void FindNumericToken(char const *s, Token *t)
|
||||
t->type = T_Back;
|
||||
t->val *= mult;
|
||||
return;
|
||||
} else if (*s == '~') {
|
||||
s++;
|
||||
if (*s == '~') { mult = -1; s++; }
|
||||
PARSENUM(t->val, s);
|
||||
if (*s) return; /* Illegal token if followed by non-numeric char */
|
||||
t->type = T_BackAdj;
|
||||
t->val *= mult;
|
||||
return;
|
||||
}
|
||||
return; /* Unknown token type */
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* Routines for figuring out the trigger date of a reminder */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
12
src/types.h
12
src/types.h
@@ -5,7 +5,7 @@
|
||||
/* Type definitions all dumped here. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -69,6 +69,8 @@ typedef struct {
|
||||
int once;
|
||||
int scanfrom;
|
||||
int from;
|
||||
int adj_for_last; /* Adjust month/year for use of LAST */
|
||||
int need_wkday; /* Set if we *need* a weekday */
|
||||
int priority;
|
||||
int duration_days; /* Duration converted to days to search */
|
||||
int eventstart; /* Original event start (datetime) */
|
||||
@@ -157,7 +159,8 @@ enum TokTypes
|
||||
T_AddOmit,
|
||||
T_WkDay,
|
||||
T_Month, T_Time, T_Date, T_DateTime,
|
||||
T_Skip, T_At, T_RemType, T_Until, T_Year, T_Day, T_Rep, T_Delta, T_Back,
|
||||
T_Skip, T_At, T_RemType, T_Until, T_Year, T_Day, T_Rep, T_Delta,
|
||||
T_Back, T_BackAdj,
|
||||
T_Once,
|
||||
T_Empty,
|
||||
T_Comment,
|
||||
@@ -175,7 +178,10 @@ enum TokTypes
|
||||
T_LongTime,
|
||||
T_OmitFunc,
|
||||
T_Through,
|
||||
T_MaybeUncomputable
|
||||
T_MaybeUncomputable,
|
||||
T_Ordinal,
|
||||
T_In,
|
||||
T_LastBack
|
||||
};
|
||||
|
||||
/* The structure of a token */
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* functions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -32,6 +32,8 @@ typedef struct udf_struct {
|
||||
Var *locals;
|
||||
char IsActive;
|
||||
int nargs;
|
||||
char const *filename;
|
||||
int lineno;
|
||||
} UserFunc;
|
||||
|
||||
/* The hash table */
|
||||
@@ -93,6 +95,11 @@ int DoFset(ParsePtr p)
|
||||
DBufFree(&buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
func->filename = StrDup(FileName);
|
||||
if (!func->filename) {
|
||||
return E_NO_MEM;
|
||||
}
|
||||
func->lineno = LineNo;
|
||||
StrnCpy(func->name, DBufValue(&buf), VAR_NAME_LEN);
|
||||
DBufFree(&buf);
|
||||
if (!Hush) {
|
||||
@@ -167,7 +174,7 @@ int DoFset(ParsePtr p)
|
||||
/* Add the function definition */
|
||||
FSet(func);
|
||||
if (orig_namelen > VAR_NAME_LEN) {
|
||||
Eprint("Warning: Function name `%s...' truncated to `%s'",
|
||||
Wprint("Warning: Function name `%s...' truncated to `%s'",
|
||||
func->name, func->name);
|
||||
}
|
||||
return OK;
|
||||
@@ -196,6 +203,9 @@ static void DestroyUserFunc(UserFunc *f)
|
||||
/* Free the function definition */
|
||||
if (f->text) free( (char *) f->text);
|
||||
|
||||
/* Free the filename */
|
||||
if (f->filename) free( (char *) f->filename);
|
||||
|
||||
/* Free the data structure itself */
|
||||
free(f);
|
||||
}
|
||||
@@ -306,7 +316,11 @@ int CallUserFunc(char const *name, int nargs, ParsePtr p)
|
||||
/* Skip the opening bracket, if there's one */
|
||||
while (isempty(*s)) s++;
|
||||
if (*s == BEG_OF_EXPR) s++;
|
||||
push_call(f->filename, f->name, f->lineno);
|
||||
h = Evaluate(&s, f->locals, p);
|
||||
if (h == OK) {
|
||||
pop_call();
|
||||
}
|
||||
f->IsActive = 0;
|
||||
DestroyLocalVals(f);
|
||||
if (DebugFlag &DB_PRTEXPR) {
|
||||
|
||||
124
src/utils.c
124
src/utils.c
@@ -5,7 +5,7 @@
|
||||
/* Useful utility functions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -130,24 +130,33 @@ int DateOK(int y, int m, int d)
|
||||
|
||||
/* Functions designed to defeat gcc optimizer */
|
||||
|
||||
int _private_div(int a, int b) { return a/b; }
|
||||
int _private_add_overflow(int result, int b, int old)
|
||||
int _private_mul_overflow(int a, int b)
|
||||
{
|
||||
if (b > 0 && result < old) return 1;
|
||||
if (b < 0 && result > old) return 1;
|
||||
return 0;
|
||||
}
|
||||
int _private_sub_overflow(int result, int b, int old)
|
||||
{
|
||||
if (b < 0 && result < old) return 1;
|
||||
if (b > 0 && result > old) return 1;
|
||||
double aa = (double) a;
|
||||
double bb = (double) b;
|
||||
|
||||
if (aa*bb > (double) INT_MAX || aa*bb < (double) INT_MIN) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int _private_unminus_overflow(int a, int b)
|
||||
int _private_add_overflow(int a, int b)
|
||||
{
|
||||
if (a > 0 && b > 0) return 1;
|
||||
if (a < 0 && b < 0) return 1;
|
||||
double aa = (double) a;
|
||||
double bb = (double) b;
|
||||
|
||||
if (aa+bb < (double) INT_MIN) return 1;
|
||||
if (aa+bb > (double) INT_MAX) return 1;
|
||||
return 0;
|
||||
}
|
||||
int _private_sub_overflow(int a, int b)
|
||||
{
|
||||
double aa = (double) a;
|
||||
double bb = (double) b;
|
||||
|
||||
if (aa-bb < (double) INT_MIN) return 1;
|
||||
if (aa-bb > (double) INT_MAX) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -162,3 +171,90 @@ ShellEscape(char const *in, DynamicBuffer *out)
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Call-stack for printing errors from user-defined functions */
|
||||
typedef struct cs_s {
|
||||
struct cs_s *next;
|
||||
char const *filename;
|
||||
char const *func;
|
||||
int lineno;
|
||||
} cs;
|
||||
|
||||
static cs *callstack = NULL;
|
||||
|
||||
static void
|
||||
destroy_cs(cs *entry)
|
||||
{
|
||||
if (entry->filename) free( (void *) entry->filename);
|
||||
if (entry->func) free( (void *) entry->func);
|
||||
free( (void *) entry);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
push_call(char const *filename, char const *func, int lineno)
|
||||
{
|
||||
cs *entry = NEW(cs);
|
||||
if (!entry) {
|
||||
return E_NO_MEM;
|
||||
}
|
||||
entry->next = NULL;
|
||||
entry->filename = StrDup(filename);
|
||||
entry->func = StrDup(func);
|
||||
entry->lineno = lineno;
|
||||
if (!entry->filename || !entry->func) {
|
||||
destroy_cs(entry);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
entry->next = callstack;
|
||||
callstack = entry;
|
||||
return OK;
|
||||
}
|
||||
|
||||
void
|
||||
clear_callstack(void)
|
||||
{
|
||||
cs *entry = callstack;
|
||||
cs *next;
|
||||
while(entry) {
|
||||
next = entry->next;
|
||||
destroy_cs(entry);
|
||||
entry = next;
|
||||
}
|
||||
callstack = NULL;
|
||||
}
|
||||
|
||||
int
|
||||
have_callstack(void)
|
||||
{
|
||||
if (callstack) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
print_callstack_aux(FILE *fp, cs *entry)
|
||||
{
|
||||
if (entry) {
|
||||
print_callstack_aux(fp, entry->next);
|
||||
fprintf(fp, "\n");
|
||||
(void) fprintf(fp, "%s(%d): In function `%s'", entry->filename, entry->lineno, entry->func);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
print_callstack(FILE *fp)
|
||||
{
|
||||
print_callstack_aux(fp, callstack);
|
||||
if (callstack) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
pop_call(void)
|
||||
{
|
||||
cs *entry = callstack;
|
||||
if (entry) {
|
||||
callstack = entry->next;
|
||||
destroy_cs(entry);
|
||||
}
|
||||
}
|
||||
|
||||
86
src/var.c
86
src/var.c
@@ -6,7 +6,7 @@
|
||||
/* user- and system-defined variables. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* Copyright (C) 1992-2022 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <locale.h>
|
||||
#include "types.h"
|
||||
#include "expr.h"
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
#include "err.h"
|
||||
|
||||
#define UPPER(c) (islower(c) ? toupper(c) : c)
|
||||
|
||||
/* The variable hash table */
|
||||
@@ -40,11 +40,40 @@ static Var *VHashTbl[VAR_HASH_SIZE];
|
||||
|
||||
typedef int (*SysVarFunc)(int, Value *);
|
||||
|
||||
static double
|
||||
strtod_in_c_locale(char const *str, char **endptr)
|
||||
{
|
||||
/* Get current locale */
|
||||
char const *loc = setlocale(LC_NUMERIC, NULL);
|
||||
double x;
|
||||
|
||||
/* If it failed, punt */
|
||||
if (!loc) {
|
||||
return strtod(str, endptr);
|
||||
}
|
||||
|
||||
/* Set locale to C */
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
|
||||
x = strtod(str, endptr);
|
||||
|
||||
/* Back to original locale */
|
||||
setlocale(LC_NUMERIC, loc);
|
||||
|
||||
/* If we got an error, try in original locale, but issue a warning */
|
||||
if (**endptr) {
|
||||
x = strtod(str, endptr);
|
||||
if (!**endptr) {
|
||||
Wprint("Accepting \"%s\" for $Latitude/$Longitude, but you should use the \"C\" locale decimal separator \".\" instead", str);
|
||||
}
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
static void deprecated_var(char const *var, char const *instead)
|
||||
{
|
||||
if (DebugFlag & DB_PRTLINE) {
|
||||
Eprint("%s is deprecated; use %s instead", var, instead);
|
||||
FreshLine = 1;
|
||||
Wprint("%s is deprecated; use %s instead", var, instead);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,9 +126,16 @@ static int latitude_longitude_func(int do_set, Value *val, double *var, double m
|
||||
char buf[64];
|
||||
double x;
|
||||
char *endptr;
|
||||
char const *loc = setlocale(LC_NUMERIC, NULL);
|
||||
|
||||
if (!do_set) {
|
||||
if (loc) {
|
||||
setlocale(LC_NUMERIC, "C");
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "%f", *var);
|
||||
if (loc) {
|
||||
setlocale(LC_NUMERIC, loc);
|
||||
}
|
||||
val->v.str = malloc(strlen(buf)+1);
|
||||
if (!val->v.str) return E_NO_MEM;
|
||||
strcpy(val->v.str, buf);
|
||||
@@ -110,9 +146,7 @@ static int latitude_longitude_func(int do_set, Value *val, double *var, double m
|
||||
x = (double) val->v.val;
|
||||
} else {
|
||||
if (val->type != STR_TYPE) return E_BAD_TYPE;
|
||||
errno = 0;
|
||||
x = strtod(val->v.str, &endptr);
|
||||
if (errno) return E_BAD_TYPE;
|
||||
x = strtod_in_c_locale(val->v.str, &endptr);
|
||||
if (*endptr) return E_BAD_TYPE;
|
||||
}
|
||||
if (x < min) return E_2LOW;
|
||||
@@ -508,7 +542,7 @@ int DoSet (Parser *p)
|
||||
if (*DBufValue(&buf) == '$') r = SetSysVar(DBufValue(&buf)+1, &v);
|
||||
else r = SetVar(DBufValue(&buf), &v);
|
||||
if (buf.len > VAR_NAME_LEN) {
|
||||
Eprint("Warning: Variable name `%.*s...' truncated to `%.*s'",
|
||||
Wprint("Warning: Variable name `%.*s...' truncated to `%.*s'",
|
||||
VAR_NAME_LEN, DBufValue(&buf), VAR_NAME_LEN, DBufValue(&buf));
|
||||
}
|
||||
DBufFree(&buf);
|
||||
@@ -741,10 +775,14 @@ typedef struct {
|
||||
/* All of the system variables sorted alphabetically */
|
||||
static SysVar SysVarArr[] = {
|
||||
/* name mod type value min/mal max validate*/
|
||||
{"Ago", 1, STR_TYPE, &DynamicAgo, 0, 0, NULL },
|
||||
{"Am", 1, STR_TYPE, &DynamicAm, 0, 0, NULL },
|
||||
{"And", 1, STR_TYPE, &DynamicAnd, 0, 0, NULL },
|
||||
{"April", 1, STR_TYPE, &DynamicMonthName[3], 0, 0, NULL },
|
||||
{"At", 1, STR_TYPE, &DynamicAt, 0, 0, NULL },
|
||||
{"August", 1, STR_TYPE, &DynamicMonthName[7], 0, 0, NULL },
|
||||
{"CalMode", 0, INT_TYPE, &DoCalendar, 0, 0, NULL },
|
||||
{"CalcUTC", 1, INT_TYPE, &CalculateUTC, 0, 1, NULL },
|
||||
{"CalMode", 0, INT_TYPE, &DoCalendar, 0, 0, NULL },
|
||||
{"Daemon", 0, INT_TYPE, &Daemon, 0, 0, NULL },
|
||||
{"DateSep", 1, SPECIAL_TYPE, date_sep_func, 0, 0, NULL },
|
||||
{"DateTimeSep", 1, SPECIAL_TYPE, datetime_sep_func, 0, 0, NULL },
|
||||
@@ -763,11 +801,15 @@ static SysVar SysVarArr[] = {
|
||||
{"FoldYear", 1, INT_TYPE, &FoldYear, 0, 1, NULL },
|
||||
{"FormWidth", 1, INT_TYPE, &FormWidth, 20, 500, NULL },
|
||||
{"Friday", 1, STR_TYPE, &DynamicDayName[4], 0, 0, NULL },
|
||||
{"Fromnow", 1, STR_TYPE, &DynamicFromnow, 0, 0, NULL },
|
||||
{"Hour", 1, STR_TYPE, &DynamicHour, 0, 0, NULL },
|
||||
{"Hplu", 1, STR_TYPE, &DynamicHplu, 0, 0, NULL },
|
||||
{"HushMode", 0, INT_TYPE, &Hush, 0, 0, NULL },
|
||||
{"IgnoreOnce", 0, INT_TYPE, &IgnoreOnce, 0, 0, NULL },
|
||||
{"InfDelta", 0, INT_TYPE, &InfiniteDelta, 0, 0, NULL },
|
||||
{"IntMax", 0, INT_TYPE, &IntMax, 0, 0, NULL },
|
||||
{"IntMin", 0, INT_TYPE, &IntMin, 0, 0, NULL },
|
||||
{"Is", 1, STR_TYPE, &DynamicIs, 0, 0, NULL },
|
||||
{"January", 1, STR_TYPE, &DynamicMonthName[0], 0, 0, NULL },
|
||||
{"July", 1, STR_TYPE, &DynamicMonthName[6], 0, 0, NULL },
|
||||
{"June", 1, STR_TYPE, &DynamicMonthName[5], 0, 0, NULL },
|
||||
@@ -785,12 +827,17 @@ static SysVar SysVarArr[] = {
|
||||
{"MaxStringLen", 1, INT_TYPE, &MaxStringLen, -1, ANY, NULL },
|
||||
{"May", 1, STR_TYPE, &DynamicMonthName[4], 0, 0, NULL },
|
||||
{"MinsFromUTC", 1, INT_TYPE, &MinsFromUTC, -780, 780, NULL },
|
||||
{"Minute", 1, STR_TYPE, &DynamicMinute, 0, 0, NULL },
|
||||
{"Monday", 1, STR_TYPE, &DynamicDayName[0], 0, 0, NULL },
|
||||
{"Mplu", 1, STR_TYPE, &DynamicMplu, 0, 0, NULL },
|
||||
{"NextMode", 0, INT_TYPE, &NextMode, 0, 0, NULL },
|
||||
{"November", 1, STR_TYPE, &DynamicMonthName[10],0, 0, NULL },
|
||||
{"Now", 1, STR_TYPE, &DynamicNow, 0, 0, NULL },
|
||||
{"NumQueued", 0, INT_TYPE, &NumQueued, 0, 0, NULL },
|
||||
{"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0, NULL },
|
||||
{"October", 1, STR_TYPE, &DynamicMonthName[9], 0, 0, NULL },
|
||||
{"On", 1, STR_TYPE, &DynamicOn, 0, 0, NULL },
|
||||
{"Pm", 1, STR_TYPE, &DynamicPm, 0, 0, NULL },
|
||||
{"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0, NULL },
|
||||
{"PSCal", 0, INT_TYPE, &PsCal, 0, 0, NULL },
|
||||
{"RunOff", 0, INT_TYPE, &RunDisabled, 0, 0, NULL },
|
||||
@@ -802,11 +849,15 @@ static SysVar SysVarArr[] = {
|
||||
{"SortByTime", 0, INT_TYPE, &SortByTime, 0, 0, NULL },
|
||||
{"SubsIndent", 1, INT_TYPE, &SubsIndent, 0, 132, NULL },
|
||||
{"Sunday", 1, STR_TYPE, &DynamicDayName[6], 0, 0, NULL },
|
||||
{"SuppressLRM", 1, INT_TYPE, &SuppressLRM, 0, 1, NULL },
|
||||
{"SysInclude", 0, STR_TYPE, &SysDir, 0, 0, NULL },
|
||||
{"T", 0, SPECIAL_TYPE, trig_date_func, 0, 0, NULL },
|
||||
{"Td", 0, SPECIAL_TYPE, trig_day_func, 0, 0, NULL },
|
||||
{"Thursday", 1, STR_TYPE, &DynamicDayName[3], 0, 0, NULL },
|
||||
{"TimeSep", 1, SPECIAL_TYPE, time_sep_func, 0, 0, NULL },
|
||||
{"Tm", 0, SPECIAL_TYPE, trig_mon_func, 0, 0, NULL },
|
||||
{"Today", 1, STR_TYPE, &DynamicToday, 0, 0, NULL },
|
||||
{"Tomorrow", 1, STR_TYPE, &DynamicTomorrow, 0, 0, NULL },
|
||||
{"Tuesday", 1, STR_TYPE, &DynamicDayName[1], 0, 0, NULL },
|
||||
{"Tw", 0, SPECIAL_TYPE, trig_wday_func, 0, 0, NULL },
|
||||
{"Ty", 0, SPECIAL_TYPE, trig_year_func, 0, 0, NULL },
|
||||
@@ -816,6 +867,7 @@ static SysVar SysVarArr[] = {
|
||||
{"UntimedFirst", 0, INT_TYPE, &UntimedBeforeTimed, 0, 0, NULL },
|
||||
{"Uw", 0, SPECIAL_TYPE, today_wday_func, 0, 0, NULL },
|
||||
{"Uy", 0, SPECIAL_TYPE, today_year_func, 0, 0, NULL },
|
||||
{"Was", 1, STR_TYPE, &DynamicWas, 0, 0, NULL },
|
||||
{"Wednesday", 1, STR_TYPE, &DynamicDayName[2], 0, 0, NULL }
|
||||
};
|
||||
|
||||
@@ -908,9 +960,7 @@ int GetSysVar(char const *name, Value *val)
|
||||
/* In "verbose" mode, print attempts to test $RunOff */
|
||||
if (DebugFlag & DB_PRTLINE) {
|
||||
if (v->value == (void *) &RunDisabled) {
|
||||
Eprint("(Security note: $RunOff variable tested.)");
|
||||
/* Allow further messages from this line */
|
||||
FreshLine = 1;
|
||||
Wprint("(Security note: $RunOff variable tested.)");
|
||||
}
|
||||
}
|
||||
return OK;
|
||||
@@ -989,29 +1039,29 @@ static void DumpSysVar(char const *name, const SysVar *v)
|
||||
SysVarFunc f = (SysVarFunc) v->value;
|
||||
f(0, &val);
|
||||
PrintValue(&val, ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
DestroyValue(val);
|
||||
} else if (v->type == STR_TYPE) {
|
||||
char const *s = *((char **)v->value);
|
||||
int y;
|
||||
Putc('"', ErrFp);
|
||||
putc('"', ErrFp);
|
||||
for (y=0; y<MAX_PRT_LEN && *s; y++) {
|
||||
if (*s == '"') {
|
||||
fprintf(ErrFp, "\" + char(34) + \"");
|
||||
s++;
|
||||
} else {
|
||||
Putc(*s++, ErrFp);
|
||||
putc(*s++, ErrFp);
|
||||
}
|
||||
}
|
||||
Putc('"', ErrFp);
|
||||
putc('"', ErrFp);
|
||||
if (*s) fprintf(ErrFp, "...");
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
} else if (v->type == DATE_TYPE) {
|
||||
Value val;
|
||||
val.type = DATE_TYPE;
|
||||
val.v.val = * (int *) v->value;
|
||||
PrintValue(&val, ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
} else {
|
||||
if (!v->modifiable) fprintf(ErrFp, "%d\n", *((int *)v->value));
|
||||
else {
|
||||
|
||||
@@ -27,7 +27,7 @@ SET $December "दिसंबर"
|
||||
REM 1 MSG Përkujtues
|
||||
REM 2 SPECIAL SHADE 192 192 255
|
||||
REM 2 MSG تذكير
|
||||
REM 3 MSG 提醒
|
||||
REM 3 MSG 提醒提醒提醒提醒提醒提醒提醒提醒
|
||||
REM 4 MSG રીમાઇન્ડર
|
||||
REM 5 MSG Emlékeztető
|
||||
REM 6 MSG Áminning
|
||||
@@ -57,6 +57,7 @@ REM 24 MSG リマインダー
|
||||
REM 25 MSG Искә төшерү
|
||||
REM 26 MSG Напомняне
|
||||
REM 27 MSG ഓർമ്മപ്പെടുത്തൽ
|
||||
REM 28 MSG リaリaaリaaリaaリaaリaaリaaリaaリaaリaaリa
|
||||
REM 1 SPECIAL SHADE 192 255 192
|
||||
REM 14 SPECIAL SHADE 255 192 192
|
||||
REM 14 SPECIAL PANGO <span face="Zapf Chancery" size="15000">This is so <span foreground="blue">fancy</span></span>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
# in the build directory.
|
||||
#
|
||||
# This file is part of REMIND.
|
||||
# Copyright (C) 1992-2021 Dianne Skoll
|
||||
# Copyright (C) 1992-2022 Dianne Skoll
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
DIR=`dirname $0`
|
||||
@@ -321,12 +321,18 @@ if test -z "$LC_ALL" ; then
|
||||
fi
|
||||
|
||||
if test "$OK" = 0 ; then
|
||||
export LC_ALL=en_US.utf-8
|
||||
export LC_ALL=C.UTF-8
|
||||
export LANG=C.UTF-8
|
||||
fi
|
||||
|
||||
../src/remind -w128 -c ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out
|
||||
../src/remind -c ../tests/test-addomit.rem 1 Sep 2021 >> ../tests/test.out
|
||||
|
||||
../src/remind -cu ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out
|
||||
../src/remind -cu '-i$SuppressLRM=1' ../tests/utf-8.rem 1 Nov 2019 >> ../tests/test.out
|
||||
|
||||
# Remove references to SysInclude, which is build-specific
|
||||
fgrep -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out
|
||||
cmp -s ../tests/test.out ../tests/test.cmp
|
||||
if [ "$?" = "0" ]; then
|
||||
echo "Remind: Acceptance test PASSED"
|
||||
|
||||
1428
tests/test.cmp
1428
tests/test.cmp
File diff suppressed because it is too large
Load Diff
161
tests/test.rem
161
tests/test.rem
@@ -447,6 +447,99 @@ REM MAYBE-UNCOMPUTABLE Mon SATISFY [wkdaynum($T) == 3] MSG Nope nope...
|
||||
|
||||
dump
|
||||
dump $
|
||||
msg [$April]%
|
||||
msg [$August]%
|
||||
msg [$CalcUTC]%
|
||||
msg [$CalMode]%
|
||||
msg [$Daemon]%
|
||||
msg [$DateSep]%
|
||||
msg [$DateTimeSep]%
|
||||
msg [$December]%
|
||||
msg [$DefaultColor]%
|
||||
msg [$DefaultPrio]%
|
||||
msg [$DefaultTDelta]%
|
||||
msg [$DeltaOffset]%
|
||||
msg [$DontFork]%
|
||||
msg [$DontQueue]%
|
||||
msg [$DontTrigAts]%
|
||||
msg [$EndSent]%
|
||||
msg [$EndSentIg]%
|
||||
msg [$February]%
|
||||
msg [$FirstIndent]%
|
||||
msg [$FoldYear]%
|
||||
msg [$FormWidth]%
|
||||
msg [$Friday]%
|
||||
msg [$HushMode]%
|
||||
msg [$IgnoreOnce]%
|
||||
msg [$InfDelta]%
|
||||
msg [$IntMax]%
|
||||
msg [$IntMin]%
|
||||
msg [$January]%
|
||||
msg [$July]%
|
||||
msg [$June]%
|
||||
msg [$LatDeg]%
|
||||
msg [$Latitude]%
|
||||
msg [$LatMin]%
|
||||
msg [$LatSec]%
|
||||
msg [$Location]%
|
||||
msg [$LongDeg]%
|
||||
msg [$Longitude]%
|
||||
msg [$LongMin]%
|
||||
msg [$LongSec]%
|
||||
msg [$March]%
|
||||
msg [$MaxSatIter]%
|
||||
msg [$MaxStringLen]%
|
||||
msg [$May]%
|
||||
msg [$MinsFromUTC]%
|
||||
msg [$Monday]%
|
||||
msg [$NextMode]%
|
||||
msg [$November]%
|
||||
msg [$NumQueued]%
|
||||
msg [$NumTrig]%
|
||||
msg [$October]%
|
||||
msg [$PrefixLineNo]%
|
||||
msg [$PSCal]%
|
||||
msg [$RunOff]%
|
||||
msg [$Saturday]%
|
||||
msg [$September]%
|
||||
msg [$SimpleCal]%
|
||||
msg [$SortByDate]%
|
||||
msg [$SortByPrio]%
|
||||
msg [$SortByTime]%
|
||||
msg [$SubsIndent]%
|
||||
msg [$Sunday]%
|
||||
msg [$T]%
|
||||
msg [$Td]%
|
||||
msg [$Thursday]%
|
||||
msg [$TimeSep]%
|
||||
msg [$Tm]%
|
||||
msg [$Tuesday]%
|
||||
msg [$Tw]%
|
||||
msg [$Ty]%
|
||||
msg [$U]%
|
||||
msg [$Ud]%
|
||||
msg [$Um]%
|
||||
msg [$UntimedFirst]%
|
||||
msg [$Uw]%
|
||||
msg [$Uy]%
|
||||
msg [$Wednesday]%
|
||||
|
||||
# Diagnose until before start date, only for non-constant expressions and
|
||||
# fully-specified start date
|
||||
REM Mon 1992 UNTIL 1991-01-01 MSG Not diagnosed - not fully-specified start
|
||||
REM 1992-01-01 *1 UNTIL 1991-12-31 MSG Diagnosed
|
||||
set x '1992-01-01'
|
||||
REM [x] *1 UNTIL 1991-12-31 MSG Not diagnosed - nonconst expression
|
||||
|
||||
REM MON FROM 1992-01-01 UNTIL 1991-12-31 Diagnosed
|
||||
REM MON SCANFROM 1992-01-01 UNTIL 1991-12-31 Diagnosed
|
||||
|
||||
REM MON FROM [x] UNTIL 1991-12-31 Not diagnosed
|
||||
REM MON SCANFROM [x] UNTIL 1991-12-31 Not diagnosed
|
||||
|
||||
REM 1992-01-01 UNTIL 1992-02-02 MSG Diagnosed
|
||||
REM [x] UNTIL 1992-02-02 MSG Diagnosed
|
||||
|
||||
dump $aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||
OMIT 2010-09-03 THROUGH 2010-09-15
|
||||
OMIT December 25 MSG X
|
||||
@@ -637,6 +730,74 @@ msg [a]
|
||||
set x psshade(50)
|
||||
set x psmoon(0)
|
||||
|
||||
# Trig
|
||||
IF trig("sun +1") || trig("thu +1")
|
||||
REM [trig()] +1 MSG Foo %b
|
||||
ENDIF
|
||||
|
||||
# Trig with a bad warnfunc
|
||||
FSET w(x) x/0
|
||||
IF trig("sun warn w") || trig("thu warn w")
|
||||
REM [trig()] +1 MSG Foo %b
|
||||
ENDIF
|
||||
|
||||
# Trig with a good warnfunc
|
||||
FSET w(x) choose(x, 5, 3, 1, 0)
|
||||
|
||||
# Ugh. This is where short-circuit logical operators
|
||||
# would really come in handy.
|
||||
IF trig("sun warn w") || trig("thu warn w")
|
||||
REM [trig()] +5 MSG Foo %b
|
||||
ENDIF
|
||||
|
||||
REM [trig("Mon", "Tue", "Wed", "Sat")] MSG foo
|
||||
REM [trig("Mon", "Tue", "Wed")] MSG bar
|
||||
|
||||
# The new syntactic sugar
|
||||
REM First Monday January MSG x
|
||||
REM Second Tuesday in April MSG x
|
||||
REM Third Wednesday in October MSG x
|
||||
REM Fourth Friday in July MSG x
|
||||
REM Last Tuesday in August MSG x
|
||||
REM Last Sunday in December MSG x
|
||||
|
||||
REM First Monday January 2000 MSG x
|
||||
REM Second Tuesday in April 2000 MSG x
|
||||
REM Third Wednesday in October 2000 MSG x
|
||||
REM Fourth Friday in July 2000 MSG x
|
||||
REM Last Tuesday in August 2000 MSG x
|
||||
REM Last Sunday in December 2000 MSG x
|
||||
|
||||
REM January ~~1 MSG y
|
||||
REM February ~~1 MSG y
|
||||
REM February ~~2 MSG y
|
||||
REM February ~~3 MSG y
|
||||
REM February ~~8 MSG y
|
||||
REM February ~~20 MSG y
|
||||
PUSH
|
||||
OMIT 31 March
|
||||
REM March ~1 MSG y
|
||||
REM March ~~1 MSG y
|
||||
REM Lastday March MSG y
|
||||
REM Lastworkday March MSG y
|
||||
POP
|
||||
REM Dec 2000 ~~1 MSG y
|
||||
REM Dec 2000 ~~2 MSG y
|
||||
REM Dec 2000 ~~3 MSG y
|
||||
REM Dec 2000 ~~7 MSG y
|
||||
REM Jan 2001 ~~1 MSG y
|
||||
|
||||
REM Lastday April 2022 OMIT SAT SUN MSG foo
|
||||
REM Lastworkday April 2022 OMIT SAT SUN MSG foo
|
||||
|
||||
SET a pad(1, "0", 2)
|
||||
set a pad(1, "0", 2, 1)
|
||||
set a pad("foo", "quux", 14)
|
||||
set a pad("foo", "quux", 14, 1)
|
||||
set a pad(11:33, " ", 12)
|
||||
set a pad(11:33, " ", 12, 1)
|
||||
set a pad("foo", "0", $MaxStringLen+1)
|
||||
|
||||
# Don't want Remind to queue reminders
|
||||
EXIT
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
# Use the output to verify your translations.
|
||||
#
|
||||
# This file is part of REMIND.
|
||||
# Copyright (C) 1992-2018 Dianne Skoll
|
||||
# Copyright (C) 1992-2022 Dianne Skoll
|
||||
#
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -28,18 +28,186 @@ if !$RunOff || !$DontQueue || $DontTrigAts
|
||||
exit
|
||||
endif
|
||||
|
||||
# Include a language file, if that's given as "-ii=/path"
|
||||
|
||||
if defined("i")
|
||||
do [i]
|
||||
# msg INCLUDING [i]
|
||||
endif
|
||||
|
||||
# Set up a few useful definitions
|
||||
fset show(x) "%%" + x + " yields: " + char(34) + "%" + x + char(34) + "% and %%*" + x + " yields: " + char(34) + "%*" + x + char(34) + "%"
|
||||
set a trigger(today()+2) + " ++2"
|
||||
set l language()
|
||||
set tt now()+134
|
||||
set tu now()-134
|
||||
set ut now()+60
|
||||
set uu now()-60
|
||||
set vt now()+120
|
||||
set vu now()-120
|
||||
set wt now()-1
|
||||
set wu now()+1
|
||||
set xt now()-2
|
||||
set xu now()+2
|
||||
|
||||
set d a + " at " + tt
|
||||
set e a + " at " + tu
|
||||
set f a + " at " + ut
|
||||
set g a + " at " + uu
|
||||
set h a + " at " + wt
|
||||
set j a + " at " + wu
|
||||
set k a + " at " + xt
|
||||
set m a + " at " + xu
|
||||
set n a + " at " + vt
|
||||
set p a + " at " + vu
|
||||
|
||||
msg The above is the default banner for the [l] language.
|
||||
set a trigger(today()+7) + " ++7"
|
||||
msg %_%_The following are the 7-day-in-advance substitutions:%
|
||||
[a] msg [show("a")]
|
||||
[a] msg [show("b")]
|
||||
[a] msg [show("c")]
|
||||
[a] msg [show("d")]
|
||||
[a] msg [show("e")]
|
||||
[a] msg [show("f")]
|
||||
[a] msg [show("g")]
|
||||
[a] msg [show("h")]
|
||||
[a] msg [show("i")]
|
||||
[a] msg [show("j")]
|
||||
[a] msg [show("k")]
|
||||
[a] msg [show("l")]
|
||||
[a] msg [show("m")]
|
||||
[a] msg [show("n")]
|
||||
[a] msg [show("o")]
|
||||
[a] msg [show("p")]
|
||||
[a] msg [show("q")]
|
||||
[a] msg [show("r")]
|
||||
[a] msg [show("s")]
|
||||
[a] msg [show("t")]
|
||||
[a] msg [show("u")]
|
||||
[a] msg [show("v")]
|
||||
[a] msg [show("w")]
|
||||
[a] msg [show("x")]
|
||||
[a] msg [show("y")]
|
||||
[a] msg [show("z")]
|
||||
|
||||
msg The following are the two-day-in-advance substitutions:%
|
||||
set a trigger(today()+6) + " ++6"
|
||||
msg %_%_The following are the 6-day-in-advance substitutions:%
|
||||
[a] msg [show("a")]
|
||||
[a] msg [show("b")]
|
||||
[a] msg [show("c")]
|
||||
[a] msg [show("d")]
|
||||
[a] msg [show("e")]
|
||||
[a] msg [show("f")]
|
||||
[a] msg [show("g")]
|
||||
[a] msg [show("h")]
|
||||
[a] msg [show("i")]
|
||||
[a] msg [show("j")]
|
||||
[a] msg [show("k")]
|
||||
[a] msg [show("l")]
|
||||
[a] msg [show("m")]
|
||||
[a] msg [show("n")]
|
||||
[a] msg [show("o")]
|
||||
[a] msg [show("p")]
|
||||
[a] msg [show("q")]
|
||||
[a] msg [show("r")]
|
||||
[a] msg [show("s")]
|
||||
[a] msg [show("t")]
|
||||
[a] msg [show("u")]
|
||||
[a] msg [show("v")]
|
||||
[a] msg [show("w")]
|
||||
[a] msg [show("x")]
|
||||
[a] msg [show("y")]
|
||||
[a] msg [show("z")]
|
||||
|
||||
set a trigger(today()+5) + " ++5"
|
||||
msg %_%_The following are the 5-day-in-advance substitutions:%
|
||||
[a] msg [show("a")]
|
||||
[a] msg [show("b")]
|
||||
[a] msg [show("c")]
|
||||
[a] msg [show("d")]
|
||||
[a] msg [show("e")]
|
||||
[a] msg [show("f")]
|
||||
[a] msg [show("g")]
|
||||
[a] msg [show("h")]
|
||||
[a] msg [show("i")]
|
||||
[a] msg [show("j")]
|
||||
[a] msg [show("k")]
|
||||
[a] msg [show("l")]
|
||||
[a] msg [show("m")]
|
||||
[a] msg [show("n")]
|
||||
[a] msg [show("o")]
|
||||
[a] msg [show("p")]
|
||||
[a] msg [show("q")]
|
||||
[a] msg [show("r")]
|
||||
[a] msg [show("s")]
|
||||
[a] msg [show("t")]
|
||||
[a] msg [show("u")]
|
||||
[a] msg [show("v")]
|
||||
[a] msg [show("w")]
|
||||
[a] msg [show("x")]
|
||||
[a] msg [show("y")]
|
||||
[a] msg [show("z")]
|
||||
|
||||
set a trigger(today()+4) + " ++4"
|
||||
msg %_%_The following are the 4-day-in-advance substitutions:%
|
||||
[a] msg [show("a")]
|
||||
[a] msg [show("b")]
|
||||
[a] msg [show("c")]
|
||||
[a] msg [show("d")]
|
||||
[a] msg [show("e")]
|
||||
[a] msg [show("f")]
|
||||
[a] msg [show("g")]
|
||||
[a] msg [show("h")]
|
||||
[a] msg [show("i")]
|
||||
[a] msg [show("j")]
|
||||
[a] msg [show("k")]
|
||||
[a] msg [show("l")]
|
||||
[a] msg [show("m")]
|
||||
[a] msg [show("n")]
|
||||
[a] msg [show("o")]
|
||||
[a] msg [show("p")]
|
||||
[a] msg [show("q")]
|
||||
[a] msg [show("r")]
|
||||
[a] msg [show("s")]
|
||||
[a] msg [show("t")]
|
||||
[a] msg [show("u")]
|
||||
[a] msg [show("v")]
|
||||
[a] msg [show("w")]
|
||||
[a] msg [show("x")]
|
||||
[a] msg [show("y")]
|
||||
[a] msg [show("z")]
|
||||
|
||||
set a trigger(today()+3) + " ++3"
|
||||
msg %_%_The following are the 3-day-in-advance substitutions:%
|
||||
[a] msg [show("a")]
|
||||
[a] msg [show("b")]
|
||||
[a] msg [show("c")]
|
||||
[a] msg [show("d")]
|
||||
[a] msg [show("e")]
|
||||
[a] msg [show("f")]
|
||||
[a] msg [show("g")]
|
||||
[a] msg [show("h")]
|
||||
[a] msg [show("i")]
|
||||
[a] msg [show("j")]
|
||||
[a] msg [show("k")]
|
||||
[a] msg [show("l")]
|
||||
[a] msg [show("m")]
|
||||
[a] msg [show("n")]
|
||||
[a] msg [show("o")]
|
||||
[a] msg [show("p")]
|
||||
[a] msg [show("q")]
|
||||
[a] msg [show("r")]
|
||||
[a] msg [show("s")]
|
||||
[a] msg [show("t")]
|
||||
[a] msg [show("u")]
|
||||
[a] msg [show("v")]
|
||||
[a] msg [show("w")]
|
||||
[a] msg [show("x")]
|
||||
[a] msg [show("y")]
|
||||
[a] msg [show("z")]
|
||||
|
||||
set a trigger(today()+2) + " ++2"
|
||||
msg %_%_The following are the two-day-in-advance substitutions:%
|
||||
[a] msg [show("a")]
|
||||
[a] msg [show("b")]
|
||||
[a] msg [show("c")]
|
||||
@@ -129,50 +297,539 @@ set e a + " at " + tu
|
||||
[a] msg [show("y")]
|
||||
[a] msg [show("z")]
|
||||
|
||||
msg %_Time substititions for a time in the future:%
|
||||
[d] msg [show("1")]
|
||||
[d] msg [show("2")]
|
||||
[d] msg [show("3")]
|
||||
[d] msg [show("4")]
|
||||
[d] msg [show("5")]
|
||||
[d] msg [show("6")]
|
||||
[d] msg [show("7")]
|
||||
[d] msg [show("8")]
|
||||
[d] msg [show("9")]
|
||||
[d] msg [show("0")]
|
||||
[d] msg [show("!")]
|
||||
[d] msg [show("@")]
|
||||
[d] msg [show("#")]
|
||||
msg %_Time substititions for a time in the past:%
|
||||
[e] msg [show("1")]
|
||||
[e] msg [show("2")]
|
||||
[e] msg [show("3")]
|
||||
[e] msg [show("4")]
|
||||
[e] msg [show("5")]
|
||||
[e] msg [show("6")]
|
||||
[e] msg [show("7")]
|
||||
[e] msg [show("8")]
|
||||
[e] msg [show("9")]
|
||||
[e] msg [show("0")]
|
||||
[e] msg [show("!")]
|
||||
[e] msg [show("@")]
|
||||
[e] msg [show("#")]
|
||||
MSG %_Time substitutions for [now()] where now() = [now()]
|
||||
REM AT [now()] MSG [show("1")]
|
||||
REM AT [now()] MSG [show("2")]
|
||||
REM AT [now()] MSG [show("3")]
|
||||
REM AT [now()] MSG [show("4")]
|
||||
REM AT [now()] MSG [show("5")]
|
||||
REM AT [now()] MSG [show("6")]
|
||||
REM AT [now()] MSG [show("7")]
|
||||
REM AT [now()] MSG [show("8")]
|
||||
REM AT [now()] MSG [show("9")]
|
||||
REM AT [now()] MSG [show("0")]
|
||||
REM AT [now()] MSG [show("!")]
|
||||
REM AT [now()] MSG [show("@")]
|
||||
REM AT [now()] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()+134] where now() = [now()]
|
||||
REM AT [now()+134] MSG [show("1")]
|
||||
REM AT [now()+134] MSG [show("2")]
|
||||
REM AT [now()+134] MSG [show("3")]
|
||||
REM AT [now()+134] MSG [show("4")]
|
||||
REM AT [now()+134] MSG [show("5")]
|
||||
REM AT [now()+134] MSG [show("6")]
|
||||
REM AT [now()+134] MSG [show("7")]
|
||||
REM AT [now()+134] MSG [show("8")]
|
||||
REM AT [now()+134] MSG [show("9")]
|
||||
REM AT [now()+134] MSG [show("0")]
|
||||
REM AT [now()+134] MSG [show("!")]
|
||||
REM AT [now()+134] MSG [show("@")]
|
||||
REM AT [now()+134] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()-134] where now() = [now()]
|
||||
REM AT [now()-134] MSG [show("1")]
|
||||
REM AT [now()-134] MSG [show("2")]
|
||||
REM AT [now()-134] MSG [show("3")]
|
||||
REM AT [now()-134] MSG [show("4")]
|
||||
REM AT [now()-134] MSG [show("5")]
|
||||
REM AT [now()-134] MSG [show("6")]
|
||||
REM AT [now()-134] MSG [show("7")]
|
||||
REM AT [now()-134] MSG [show("8")]
|
||||
REM AT [now()-134] MSG [show("9")]
|
||||
REM AT [now()-134] MSG [show("0")]
|
||||
REM AT [now()-134] MSG [show("!")]
|
||||
REM AT [now()-134] MSG [show("@")]
|
||||
REM AT [now()-134] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()+60] where now() = [now()]
|
||||
REM AT [now()+60] MSG [show("1")]
|
||||
REM AT [now()+60] MSG [show("2")]
|
||||
REM AT [now()+60] MSG [show("3")]
|
||||
REM AT [now()+60] MSG [show("4")]
|
||||
REM AT [now()+60] MSG [show("5")]
|
||||
REM AT [now()+60] MSG [show("6")]
|
||||
REM AT [now()+60] MSG [show("7")]
|
||||
REM AT [now()+60] MSG [show("8")]
|
||||
REM AT [now()+60] MSG [show("9")]
|
||||
REM AT [now()+60] MSG [show("0")]
|
||||
REM AT [now()+60] MSG [show("!")]
|
||||
REM AT [now()+60] MSG [show("@")]
|
||||
REM AT [now()+60] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()-60] where now() = [now()]
|
||||
REM AT [now()-60] MSG [show("1")]
|
||||
REM AT [now()-60] MSG [show("2")]
|
||||
REM AT [now()-60] MSG [show("3")]
|
||||
REM AT [now()-60] MSG [show("4")]
|
||||
REM AT [now()-60] MSG [show("5")]
|
||||
REM AT [now()-60] MSG [show("6")]
|
||||
REM AT [now()-60] MSG [show("7")]
|
||||
REM AT [now()-60] MSG [show("8")]
|
||||
REM AT [now()-60] MSG [show("9")]
|
||||
REM AT [now()-60] MSG [show("0")]
|
||||
REM AT [now()-60] MSG [show("!")]
|
||||
REM AT [now()-60] MSG [show("@")]
|
||||
REM AT [now()-60] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()+120] where now() = [now()]
|
||||
REM AT [now()+120] MSG [show("1")]
|
||||
REM AT [now()+120] MSG [show("2")]
|
||||
REM AT [now()+120] MSG [show("3")]
|
||||
REM AT [now()+120] MSG [show("4")]
|
||||
REM AT [now()+120] MSG [show("5")]
|
||||
REM AT [now()+120] MSG [show("6")]
|
||||
REM AT [now()+120] MSG [show("7")]
|
||||
REM AT [now()+120] MSG [show("8")]
|
||||
REM AT [now()+120] MSG [show("9")]
|
||||
REM AT [now()+120] MSG [show("0")]
|
||||
REM AT [now()+120] MSG [show("!")]
|
||||
REM AT [now()+120] MSG [show("@")]
|
||||
REM AT [now()+120] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()-120] where now() = [now()]
|
||||
REM AT [now()-120] MSG [show("1")]
|
||||
REM AT [now()-120] MSG [show("2")]
|
||||
REM AT [now()-120] MSG [show("3")]
|
||||
REM AT [now()-120] MSG [show("4")]
|
||||
REM AT [now()-120] MSG [show("5")]
|
||||
REM AT [now()-120] MSG [show("6")]
|
||||
REM AT [now()-120] MSG [show("7")]
|
||||
REM AT [now()-120] MSG [show("8")]
|
||||
REM AT [now()-120] MSG [show("9")]
|
||||
REM AT [now()-120] MSG [show("0")]
|
||||
REM AT [now()-120] MSG [show("!")]
|
||||
REM AT [now()-120] MSG [show("@")]
|
||||
REM AT [now()-120] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()+1] where now() = [now()]
|
||||
REM AT [now()+1] MSG [show("1")]
|
||||
REM AT [now()+1] MSG [show("2")]
|
||||
REM AT [now()+1] MSG [show("3")]
|
||||
REM AT [now()+1] MSG [show("4")]
|
||||
REM AT [now()+1] MSG [show("5")]
|
||||
REM AT [now()+1] MSG [show("6")]
|
||||
REM AT [now()+1] MSG [show("7")]
|
||||
REM AT [now()+1] MSG [show("8")]
|
||||
REM AT [now()+1] MSG [show("9")]
|
||||
REM AT [now()+1] MSG [show("0")]
|
||||
REM AT [now()+1] MSG [show("!")]
|
||||
REM AT [now()+1] MSG [show("@")]
|
||||
REM AT [now()+1] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()-1] where now() = [now()]
|
||||
REM AT [now()-1] MSG [show("1")]
|
||||
REM AT [now()-1] MSG [show("2")]
|
||||
REM AT [now()-1] MSG [show("3")]
|
||||
REM AT [now()-1] MSG [show("4")]
|
||||
REM AT [now()-1] MSG [show("5")]
|
||||
REM AT [now()-1] MSG [show("6")]
|
||||
REM AT [now()-1] MSG [show("7")]
|
||||
REM AT [now()-1] MSG [show("8")]
|
||||
REM AT [now()-1] MSG [show("9")]
|
||||
REM AT [now()-1] MSG [show("0")]
|
||||
REM AT [now()-1] MSG [show("!")]
|
||||
REM AT [now()-1] MSG [show("@")]
|
||||
REM AT [now()-1] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()+2] where now() = [now()]
|
||||
REM AT [now()+2] MSG [show("1")]
|
||||
REM AT [now()+2] MSG [show("2")]
|
||||
REM AT [now()+2] MSG [show("3")]
|
||||
REM AT [now()+2] MSG [show("4")]
|
||||
REM AT [now()+2] MSG [show("5")]
|
||||
REM AT [now()+2] MSG [show("6")]
|
||||
REM AT [now()+2] MSG [show("7")]
|
||||
REM AT [now()+2] MSG [show("8")]
|
||||
REM AT [now()+2] MSG [show("9")]
|
||||
REM AT [now()+2] MSG [show("0")]
|
||||
REM AT [now()+2] MSG [show("!")]
|
||||
REM AT [now()+2] MSG [show("@")]
|
||||
REM AT [now()+2] MSG [show("#")]
|
||||
MSG %_Time substitutions for [now()-2] where now() = [now()]
|
||||
REM AT [now()-2] MSG [show("1")]
|
||||
REM AT [now()-2] MSG [show("2")]
|
||||
REM AT [now()-2] MSG [show("3")]
|
||||
REM AT [now()-2] MSG [show("4")]
|
||||
REM AT [now()-2] MSG [show("5")]
|
||||
REM AT [now()-2] MSG [show("6")]
|
||||
REM AT [now()-2] MSG [show("7")]
|
||||
REM AT [now()-2] MSG [show("8")]
|
||||
REM AT [now()-2] MSG [show("9")]
|
||||
REM AT [now()-2] MSG [show("0")]
|
||||
REM AT [now()-2] MSG [show("!")]
|
||||
REM AT [now()-2] MSG [show("@")]
|
||||
REM AT [now()-2] MSG [show("#")]
|
||||
MSG %_Time substitutions for [0:00] where now() = [now()]
|
||||
REM AT [0:00] MSG [show("1")]
|
||||
REM AT [0:00] MSG [show("2")]
|
||||
REM AT [0:00] MSG [show("3")]
|
||||
REM AT [0:00] MSG [show("4")]
|
||||
REM AT [0:00] MSG [show("5")]
|
||||
REM AT [0:00] MSG [show("6")]
|
||||
REM AT [0:00] MSG [show("7")]
|
||||
REM AT [0:00] MSG [show("8")]
|
||||
REM AT [0:00] MSG [show("9")]
|
||||
REM AT [0:00] MSG [show("0")]
|
||||
REM AT [0:00] MSG [show("!")]
|
||||
REM AT [0:00] MSG [show("@")]
|
||||
REM AT [0:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [1:00] where now() = [now()]
|
||||
REM AT [1:00] MSG [show("1")]
|
||||
REM AT [1:00] MSG [show("2")]
|
||||
REM AT [1:00] MSG [show("3")]
|
||||
REM AT [1:00] MSG [show("4")]
|
||||
REM AT [1:00] MSG [show("5")]
|
||||
REM AT [1:00] MSG [show("6")]
|
||||
REM AT [1:00] MSG [show("7")]
|
||||
REM AT [1:00] MSG [show("8")]
|
||||
REM AT [1:00] MSG [show("9")]
|
||||
REM AT [1:00] MSG [show("0")]
|
||||
REM AT [1:00] MSG [show("!")]
|
||||
REM AT [1:00] MSG [show("@")]
|
||||
REM AT [1:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [2:00] where now() = [now()]
|
||||
REM AT [2:00] MSG [show("1")]
|
||||
REM AT [2:00] MSG [show("2")]
|
||||
REM AT [2:00] MSG [show("3")]
|
||||
REM AT [2:00] MSG [show("4")]
|
||||
REM AT [2:00] MSG [show("5")]
|
||||
REM AT [2:00] MSG [show("6")]
|
||||
REM AT [2:00] MSG [show("7")]
|
||||
REM AT [2:00] MSG [show("8")]
|
||||
REM AT [2:00] MSG [show("9")]
|
||||
REM AT [2:00] MSG [show("0")]
|
||||
REM AT [2:00] MSG [show("!")]
|
||||
REM AT [2:00] MSG [show("@")]
|
||||
REM AT [2:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [3:00] where now() = [now()]
|
||||
REM AT [3:00] MSG [show("1")]
|
||||
REM AT [3:00] MSG [show("2")]
|
||||
REM AT [3:00] MSG [show("3")]
|
||||
REM AT [3:00] MSG [show("4")]
|
||||
REM AT [3:00] MSG [show("5")]
|
||||
REM AT [3:00] MSG [show("6")]
|
||||
REM AT [3:00] MSG [show("7")]
|
||||
REM AT [3:00] MSG [show("8")]
|
||||
REM AT [3:00] MSG [show("9")]
|
||||
REM AT [3:00] MSG [show("0")]
|
||||
REM AT [3:00] MSG [show("!")]
|
||||
REM AT [3:00] MSG [show("@")]
|
||||
REM AT [3:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [4:00] where now() = [now()]
|
||||
REM AT [4:00] MSG [show("1")]
|
||||
REM AT [4:00] MSG [show("2")]
|
||||
REM AT [4:00] MSG [show("3")]
|
||||
REM AT [4:00] MSG [show("4")]
|
||||
REM AT [4:00] MSG [show("5")]
|
||||
REM AT [4:00] MSG [show("6")]
|
||||
REM AT [4:00] MSG [show("7")]
|
||||
REM AT [4:00] MSG [show("8")]
|
||||
REM AT [4:00] MSG [show("9")]
|
||||
REM AT [4:00] MSG [show("0")]
|
||||
REM AT [4:00] MSG [show("!")]
|
||||
REM AT [4:00] MSG [show("@")]
|
||||
REM AT [4:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [5:00] where now() = [now()]
|
||||
REM AT [5:00] MSG [show("1")]
|
||||
REM AT [5:00] MSG [show("2")]
|
||||
REM AT [5:00] MSG [show("3")]
|
||||
REM AT [5:00] MSG [show("4")]
|
||||
REM AT [5:00] MSG [show("5")]
|
||||
REM AT [5:00] MSG [show("6")]
|
||||
REM AT [5:00] MSG [show("7")]
|
||||
REM AT [5:00] MSG [show("8")]
|
||||
REM AT [5:00] MSG [show("9")]
|
||||
REM AT [5:00] MSG [show("0")]
|
||||
REM AT [5:00] MSG [show("!")]
|
||||
REM AT [5:00] MSG [show("@")]
|
||||
REM AT [5:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [6:00] where now() = [now()]
|
||||
REM AT [6:00] MSG [show("1")]
|
||||
REM AT [6:00] MSG [show("2")]
|
||||
REM AT [6:00] MSG [show("3")]
|
||||
REM AT [6:00] MSG [show("4")]
|
||||
REM AT [6:00] MSG [show("5")]
|
||||
REM AT [6:00] MSG [show("6")]
|
||||
REM AT [6:00] MSG [show("7")]
|
||||
REM AT [6:00] MSG [show("8")]
|
||||
REM AT [6:00] MSG [show("9")]
|
||||
REM AT [6:00] MSG [show("0")]
|
||||
REM AT [6:00] MSG [show("!")]
|
||||
REM AT [6:00] MSG [show("@")]
|
||||
REM AT [6:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [7:00] where now() = [now()]
|
||||
REM AT [7:00] MSG [show("1")]
|
||||
REM AT [7:00] MSG [show("2")]
|
||||
REM AT [7:00] MSG [show("3")]
|
||||
REM AT [7:00] MSG [show("4")]
|
||||
REM AT [7:00] MSG [show("5")]
|
||||
REM AT [7:00] MSG [show("6")]
|
||||
REM AT [7:00] MSG [show("7")]
|
||||
REM AT [7:00] MSG [show("8")]
|
||||
REM AT [7:00] MSG [show("9")]
|
||||
REM AT [7:00] MSG [show("0")]
|
||||
REM AT [7:00] MSG [show("!")]
|
||||
REM AT [7:00] MSG [show("@")]
|
||||
REM AT [7:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [8:00] where now() = [now()]
|
||||
REM AT [8:00] MSG [show("1")]
|
||||
REM AT [8:00] MSG [show("2")]
|
||||
REM AT [8:00] MSG [show("3")]
|
||||
REM AT [8:00] MSG [show("4")]
|
||||
REM AT [8:00] MSG [show("5")]
|
||||
REM AT [8:00] MSG [show("6")]
|
||||
REM AT [8:00] MSG [show("7")]
|
||||
REM AT [8:00] MSG [show("8")]
|
||||
REM AT [8:00] MSG [show("9")]
|
||||
REM AT [8:00] MSG [show("0")]
|
||||
REM AT [8:00] MSG [show("!")]
|
||||
REM AT [8:00] MSG [show("@")]
|
||||
REM AT [8:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [9:00] where now() = [now()]
|
||||
REM AT [9:00] MSG [show("1")]
|
||||
REM AT [9:00] MSG [show("2")]
|
||||
REM AT [9:00] MSG [show("3")]
|
||||
REM AT [9:00] MSG [show("4")]
|
||||
REM AT [9:00] MSG [show("5")]
|
||||
REM AT [9:00] MSG [show("6")]
|
||||
REM AT [9:00] MSG [show("7")]
|
||||
REM AT [9:00] MSG [show("8")]
|
||||
REM AT [9:00] MSG [show("9")]
|
||||
REM AT [9:00] MSG [show("0")]
|
||||
REM AT [9:00] MSG [show("!")]
|
||||
REM AT [9:00] MSG [show("@")]
|
||||
REM AT [9:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [10:00] where now() = [now()]
|
||||
REM AT [10:00] MSG [show("1")]
|
||||
REM AT [10:00] MSG [show("2")]
|
||||
REM AT [10:00] MSG [show("3")]
|
||||
REM AT [10:00] MSG [show("4")]
|
||||
REM AT [10:00] MSG [show("5")]
|
||||
REM AT [10:00] MSG [show("6")]
|
||||
REM AT [10:00] MSG [show("7")]
|
||||
REM AT [10:00] MSG [show("8")]
|
||||
REM AT [10:00] MSG [show("9")]
|
||||
REM AT [10:00] MSG [show("0")]
|
||||
REM AT [10:00] MSG [show("!")]
|
||||
REM AT [10:00] MSG [show("@")]
|
||||
REM AT [10:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [11:00] where now() = [now()]
|
||||
REM AT [11:00] MSG [show("1")]
|
||||
REM AT [11:00] MSG [show("2")]
|
||||
REM AT [11:00] MSG [show("3")]
|
||||
REM AT [11:00] MSG [show("4")]
|
||||
REM AT [11:00] MSG [show("5")]
|
||||
REM AT [11:00] MSG [show("6")]
|
||||
REM AT [11:00] MSG [show("7")]
|
||||
REM AT [11:00] MSG [show("8")]
|
||||
REM AT [11:00] MSG [show("9")]
|
||||
REM AT [11:00] MSG [show("0")]
|
||||
REM AT [11:00] MSG [show("!")]
|
||||
REM AT [11:00] MSG [show("@")]
|
||||
REM AT [11:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [11:59] where now() = [now()]
|
||||
REM AT [11:59] MSG [show("1")]
|
||||
REM AT [11:59] MSG [show("2")]
|
||||
REM AT [11:59] MSG [show("3")]
|
||||
REM AT [11:59] MSG [show("4")]
|
||||
REM AT [11:59] MSG [show("5")]
|
||||
REM AT [11:59] MSG [show("6")]
|
||||
REM AT [11:59] MSG [show("7")]
|
||||
REM AT [11:59] MSG [show("8")]
|
||||
REM AT [11:59] MSG [show("9")]
|
||||
REM AT [11:59] MSG [show("0")]
|
||||
REM AT [11:59] MSG [show("!")]
|
||||
REM AT [11:59] MSG [show("@")]
|
||||
REM AT [11:59] MSG [show("#")]
|
||||
MSG %_Time substitutions for [12:00] where now() = [now()]
|
||||
REM AT [12:00] MSG [show("1")]
|
||||
REM AT [12:00] MSG [show("2")]
|
||||
REM AT [12:00] MSG [show("3")]
|
||||
REM AT [12:00] MSG [show("4")]
|
||||
REM AT [12:00] MSG [show("5")]
|
||||
REM AT [12:00] MSG [show("6")]
|
||||
REM AT [12:00] MSG [show("7")]
|
||||
REM AT [12:00] MSG [show("8")]
|
||||
REM AT [12:00] MSG [show("9")]
|
||||
REM AT [12:00] MSG [show("0")]
|
||||
REM AT [12:00] MSG [show("!")]
|
||||
REM AT [12:00] MSG [show("@")]
|
||||
REM AT [12:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [12:01] where now() = [now()]
|
||||
REM AT [12:01] MSG [show("1")]
|
||||
REM AT [12:01] MSG [show("2")]
|
||||
REM AT [12:01] MSG [show("3")]
|
||||
REM AT [12:01] MSG [show("4")]
|
||||
REM AT [12:01] MSG [show("5")]
|
||||
REM AT [12:01] MSG [show("6")]
|
||||
REM AT [12:01] MSG [show("7")]
|
||||
REM AT [12:01] MSG [show("8")]
|
||||
REM AT [12:01] MSG [show("9")]
|
||||
REM AT [12:01] MSG [show("0")]
|
||||
REM AT [12:01] MSG [show("!")]
|
||||
REM AT [12:01] MSG [show("@")]
|
||||
REM AT [12:01] MSG [show("#")]
|
||||
MSG %_Time substitutions for [13:00] where now() = [now()]
|
||||
REM AT [13:00] MSG [show("1")]
|
||||
REM AT [13:00] MSG [show("2")]
|
||||
REM AT [13:00] MSG [show("3")]
|
||||
REM AT [13:00] MSG [show("4")]
|
||||
REM AT [13:00] MSG [show("5")]
|
||||
REM AT [13:00] MSG [show("6")]
|
||||
REM AT [13:00] MSG [show("7")]
|
||||
REM AT [13:00] MSG [show("8")]
|
||||
REM AT [13:00] MSG [show("9")]
|
||||
REM AT [13:00] MSG [show("0")]
|
||||
REM AT [13:00] MSG [show("!")]
|
||||
REM AT [13:00] MSG [show("@")]
|
||||
REM AT [13:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [14:00] where now() = [now()]
|
||||
REM AT [14:00] MSG [show("1")]
|
||||
REM AT [14:00] MSG [show("2")]
|
||||
REM AT [14:00] MSG [show("3")]
|
||||
REM AT [14:00] MSG [show("4")]
|
||||
REM AT [14:00] MSG [show("5")]
|
||||
REM AT [14:00] MSG [show("6")]
|
||||
REM AT [14:00] MSG [show("7")]
|
||||
REM AT [14:00] MSG [show("8")]
|
||||
REM AT [14:00] MSG [show("9")]
|
||||
REM AT [14:00] MSG [show("0")]
|
||||
REM AT [14:00] MSG [show("!")]
|
||||
REM AT [14:00] MSG [show("@")]
|
||||
REM AT [14:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [15:00] where now() = [now()]
|
||||
REM AT [15:00] MSG [show("1")]
|
||||
REM AT [15:00] MSG [show("2")]
|
||||
REM AT [15:00] MSG [show("3")]
|
||||
REM AT [15:00] MSG [show("4")]
|
||||
REM AT [15:00] MSG [show("5")]
|
||||
REM AT [15:00] MSG [show("6")]
|
||||
REM AT [15:00] MSG [show("7")]
|
||||
REM AT [15:00] MSG [show("8")]
|
||||
REM AT [15:00] MSG [show("9")]
|
||||
REM AT [15:00] MSG [show("0")]
|
||||
REM AT [15:00] MSG [show("!")]
|
||||
REM AT [15:00] MSG [show("@")]
|
||||
REM AT [15:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [16:00] where now() = [now()]
|
||||
REM AT [16:00] MSG [show("1")]
|
||||
REM AT [16:00] MSG [show("2")]
|
||||
REM AT [16:00] MSG [show("3")]
|
||||
REM AT [16:00] MSG [show("4")]
|
||||
REM AT [16:00] MSG [show("5")]
|
||||
REM AT [16:00] MSG [show("6")]
|
||||
REM AT [16:00] MSG [show("7")]
|
||||
REM AT [16:00] MSG [show("8")]
|
||||
REM AT [16:00] MSG [show("9")]
|
||||
REM AT [16:00] MSG [show("0")]
|
||||
REM AT [16:00] MSG [show("!")]
|
||||
REM AT [16:00] MSG [show("@")]
|
||||
REM AT [16:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [17:00] where now() = [now()]
|
||||
REM AT [17:00] MSG [show("1")]
|
||||
REM AT [17:00] MSG [show("2")]
|
||||
REM AT [17:00] MSG [show("3")]
|
||||
REM AT [17:00] MSG [show("4")]
|
||||
REM AT [17:00] MSG [show("5")]
|
||||
REM AT [17:00] MSG [show("6")]
|
||||
REM AT [17:00] MSG [show("7")]
|
||||
REM AT [17:00] MSG [show("8")]
|
||||
REM AT [17:00] MSG [show("9")]
|
||||
REM AT [17:00] MSG [show("0")]
|
||||
REM AT [17:00] MSG [show("!")]
|
||||
REM AT [17:00] MSG [show("@")]
|
||||
REM AT [17:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [18:00] where now() = [now()]
|
||||
REM AT [18:00] MSG [show("1")]
|
||||
REM AT [18:00] MSG [show("2")]
|
||||
REM AT [18:00] MSG [show("3")]
|
||||
REM AT [18:00] MSG [show("4")]
|
||||
REM AT [18:00] MSG [show("5")]
|
||||
REM AT [18:00] MSG [show("6")]
|
||||
REM AT [18:00] MSG [show("7")]
|
||||
REM AT [18:00] MSG [show("8")]
|
||||
REM AT [18:00] MSG [show("9")]
|
||||
REM AT [18:00] MSG [show("0")]
|
||||
REM AT [18:00] MSG [show("!")]
|
||||
REM AT [18:00] MSG [show("@")]
|
||||
REM AT [18:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [19:00] where now() = [now()]
|
||||
REM AT [19:00] MSG [show("1")]
|
||||
REM AT [19:00] MSG [show("2")]
|
||||
REM AT [19:00] MSG [show("3")]
|
||||
REM AT [19:00] MSG [show("4")]
|
||||
REM AT [19:00] MSG [show("5")]
|
||||
REM AT [19:00] MSG [show("6")]
|
||||
REM AT [19:00] MSG [show("7")]
|
||||
REM AT [19:00] MSG [show("8")]
|
||||
REM AT [19:00] MSG [show("9")]
|
||||
REM AT [19:00] MSG [show("0")]
|
||||
REM AT [19:00] MSG [show("!")]
|
||||
REM AT [19:00] MSG [show("@")]
|
||||
REM AT [19:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [20:00] where now() = [now()]
|
||||
REM AT [20:00] MSG [show("1")]
|
||||
REM AT [20:00] MSG [show("2")]
|
||||
REM AT [20:00] MSG [show("3")]
|
||||
REM AT [20:00] MSG [show("4")]
|
||||
REM AT [20:00] MSG [show("5")]
|
||||
REM AT [20:00] MSG [show("6")]
|
||||
REM AT [20:00] MSG [show("7")]
|
||||
REM AT [20:00] MSG [show("8")]
|
||||
REM AT [20:00] MSG [show("9")]
|
||||
REM AT [20:00] MSG [show("0")]
|
||||
REM AT [20:00] MSG [show("!")]
|
||||
REM AT [20:00] MSG [show("@")]
|
||||
REM AT [20:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [21:00] where now() = [now()]
|
||||
REM AT [21:00] MSG [show("1")]
|
||||
REM AT [21:00] MSG [show("2")]
|
||||
REM AT [21:00] MSG [show("3")]
|
||||
REM AT [21:00] MSG [show("4")]
|
||||
REM AT [21:00] MSG [show("5")]
|
||||
REM AT [21:00] MSG [show("6")]
|
||||
REM AT [21:00] MSG [show("7")]
|
||||
REM AT [21:00] MSG [show("8")]
|
||||
REM AT [21:00] MSG [show("9")]
|
||||
REM AT [21:00] MSG [show("0")]
|
||||
REM AT [21:00] MSG [show("!")]
|
||||
REM AT [21:00] MSG [show("@")]
|
||||
REM AT [21:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [22:00] where now() = [now()]
|
||||
REM AT [22:00] MSG [show("1")]
|
||||
REM AT [22:00] MSG [show("2")]
|
||||
REM AT [22:00] MSG [show("3")]
|
||||
REM AT [22:00] MSG [show("4")]
|
||||
REM AT [22:00] MSG [show("5")]
|
||||
REM AT [22:00] MSG [show("6")]
|
||||
REM AT [22:00] MSG [show("7")]
|
||||
REM AT [22:00] MSG [show("8")]
|
||||
REM AT [22:00] MSG [show("9")]
|
||||
REM AT [22:00] MSG [show("0")]
|
||||
REM AT [22:00] MSG [show("!")]
|
||||
REM AT [22:00] MSG [show("@")]
|
||||
REM AT [22:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [23:00] where now() = [now()]
|
||||
REM AT [23:00] MSG [show("1")]
|
||||
REM AT [23:00] MSG [show("2")]
|
||||
REM AT [23:00] MSG [show("3")]
|
||||
REM AT [23:00] MSG [show("4")]
|
||||
REM AT [23:00] MSG [show("5")]
|
||||
REM AT [23:00] MSG [show("6")]
|
||||
REM AT [23:00] MSG [show("7")]
|
||||
REM AT [23:00] MSG [show("8")]
|
||||
REM AT [23:00] MSG [show("9")]
|
||||
REM AT [23:00] MSG [show("0")]
|
||||
REM AT [23:00] MSG [show("!")]
|
||||
REM AT [23:00] MSG [show("@")]
|
||||
REM AT [23:00] MSG [show("#")]
|
||||
MSG %_Time substitutions for [23:59] where now() = [now()]
|
||||
REM AT [23:59] MSG [show("1")]
|
||||
REM AT [23:59] MSG [show("2")]
|
||||
REM AT [23:59] MSG [show("3")]
|
||||
REM AT [23:59] MSG [show("4")]
|
||||
REM AT [23:59] MSG [show("5")]
|
||||
REM AT [23:59] MSG [show("6")]
|
||||
REM AT [23:59] MSG [show("7")]
|
||||
REM AT [23:59] MSG [show("8")]
|
||||
REM AT [23:59] MSG [show("9")]
|
||||
REM AT [23:59] MSG [show("0")]
|
||||
REM AT [23:59] MSG [show("!")]
|
||||
REM AT [23:59] MSG [show("@")]
|
||||
REM AT [23:59] MSG [show("#")]
|
||||
|
||||
msg %_Time substititions for the current time:%
|
||||
set e a + " at " + now()
|
||||
[e] msg [show("1")]
|
||||
[e] msg [show("2")]
|
||||
[e] msg [show("3")]
|
||||
[e] msg [show("4")]
|
||||
[e] msg [show("5")]
|
||||
[e] msg [show("6")]
|
||||
[e] msg [show("7")]
|
||||
[e] msg [show("8")]
|
||||
[e] msg [show("9")]
|
||||
[e] msg [show("0")]
|
||||
[e] msg [show("!")]
|
||||
[e] msg [show("@")]
|
||||
[e] msg [show("#")]
|
||||
|
||||
msg %_The following are the days of the week:
|
||||
fset showwd(x) "wkday("+x+") = " + wkday(x) + "%"
|
||||
|
||||
@@ -17,7 +17,7 @@ HTMLDIR = /var/www/remind
|
||||
# Where you stick images and CSS files, as seen by UNIX
|
||||
IMAGEDIR = /var/www/remind/resources
|
||||
|
||||
# Where images and CSS fiels are, as seen by web browers
|
||||
# Where images and CSS files are, as seen by web browsers
|
||||
IMAGEBASE = /remind/resources
|
||||
|
||||
# Set by configure - don't touch.
|
||||
|
||||
@@ -10,7 +10,7 @@ it should work on any UNIX web server.
|
||||
|
||||
To install it, you need the Remind package, available via ftp from
|
||||
https://dianne.skoll.ca/projects/remind/ You should install Remind,
|
||||
setting the lattitude, longitude, location and time zone as appropriate
|
||||
setting the latitude, longitude, location and time zone as appropriate
|
||||
for your machine.
|
||||
|
||||
Once you have Remind installed, follow these steps to set up your WWW
|
||||
|
||||
Reference in New Issue
Block a user