mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 23:08:40 +02:00
Compare commits
160 Commits
03.03.10
...
03.04.00-B
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c593fe849 | ||
|
|
6a7bdb2ec7 | ||
|
|
a4aead18dd | ||
|
|
d277154d9f | ||
|
|
d2662fb026 | ||
|
|
2f522ea705 | ||
|
|
cd68041312 | ||
|
|
9c2556f16d | ||
|
|
b80b938d3d | ||
|
|
0bd6278050 | ||
|
|
b2746f28db | ||
|
|
cfd3698b53 | ||
|
|
6b5150d30e | ||
|
|
b011adf94e | ||
|
|
d09b725710 | ||
|
|
2f1e3524df | ||
|
|
2de47cfa51 | ||
|
|
15a778075d | ||
|
|
2502191982 | ||
|
|
47af91d136 | ||
|
|
e249fe3a17 | ||
|
|
72838a07f3 | ||
|
|
c098acc659 | ||
|
|
15ee32b5bd | ||
|
|
5a059d9b09 | ||
|
|
77516dbdff | ||
|
|
835af9ad6a | ||
|
|
4c30db06c0 | ||
|
|
3aee12073e | ||
|
|
654fd78ee7 | ||
|
|
b8126d3a85 | ||
|
|
3054091688 | ||
|
|
6e0fd7ea5f | ||
|
|
bbb82029d2 | ||
|
|
716d7bcc92 | ||
|
|
e7a6bf0e19 | ||
|
|
27c17252e7 | ||
|
|
940254bec6 | ||
|
|
79952d52f1 | ||
|
|
e58545d3f6 | ||
|
|
b7c9643a05 | ||
|
|
c2be6c348a | ||
|
|
0161f81389 | ||
|
|
2a2df322dc | ||
|
|
b276b5fdce | ||
|
|
b5f7dabf10 | ||
|
|
307f8a07e0 | ||
|
|
3fe5e2becd | ||
|
|
e8a4acf517 | ||
|
|
9ba28c01e7 | ||
|
|
ff3b04f46d | ||
|
|
9f6f452b18 | ||
|
|
9b4e35841e | ||
|
|
927e260f5b | ||
|
|
949156f77c | ||
|
|
cc59fcac58 | ||
|
|
db624d8a8a | ||
|
|
ae90243352 | ||
|
|
ff58c7f699 | ||
|
|
bd9738f6f4 | ||
|
|
47e5c63290 | ||
|
|
2abdcac15c | ||
|
|
f0f12e4099 | ||
|
|
b1720317a4 | ||
|
|
d90f466b53 | ||
|
|
fec84a5efc | ||
|
|
1f3f869983 | ||
|
|
a6bd6f44bf | ||
|
|
78aac61fe1 | ||
|
|
8d735f0410 | ||
|
|
de014732c6 | ||
|
|
aae6511394 | ||
|
|
d973439b4f | ||
|
|
32adce2de8 | ||
|
|
2ac6378fea | ||
|
|
153b7df5fc | ||
|
|
9d9bdabf79 | ||
|
|
2f8eaeacf0 | ||
|
|
dc07a3cf32 | ||
|
|
b775e60d1b | ||
|
|
7290bccfd7 | ||
|
|
a1d884ec3f | ||
|
|
cc05d88618 | ||
|
|
2675fa53df | ||
|
|
59ee9198e2 | ||
|
|
5235936e7b | ||
|
|
03ab44ea10 | ||
|
|
b8c2d2b39b | ||
|
|
6ae7e71fbf | ||
|
|
c49740ed81 | ||
|
|
16c0a819a9 | ||
|
|
4a61fe73de | ||
|
|
a76feebe45 | ||
|
|
3a52eadeb1 | ||
|
|
dd56b7c385 | ||
|
|
f6f201085c | ||
|
|
daf09d9d4e | ||
|
|
511cdb2784 | ||
|
|
a567a9b777 | ||
|
|
05bc3af03d | ||
|
|
7a048d1702 | ||
|
|
8d7f9bcb8b | ||
|
|
9fd8b0f890 | ||
|
|
86873d0725 | ||
|
|
b22438b489 | ||
|
|
683b38a7ab | ||
|
|
d6b4fdd6d3 | ||
|
|
c996649954 | ||
|
|
d59ad77893 | ||
|
|
e637c20dee | ||
|
|
19dc588319 | ||
|
|
dc53ef2e71 | ||
|
|
e51d7f3c6d | ||
|
|
5a7e86e443 | ||
|
|
7f4edae006 | ||
|
|
2f4e1462e3 | ||
|
|
54f5d81a8c | ||
|
|
d33c27289a | ||
|
|
1675fdb499 | ||
|
|
9321109691 | ||
|
|
e6a4f939a3 | ||
|
|
c7ae214853 | ||
|
|
68a9cc047e | ||
|
|
1f2b25f852 | ||
|
|
20040c8857 | ||
|
|
ac64b0c11f | ||
|
|
ba47ce7ca8 | ||
|
|
be1ab4ea36 | ||
|
|
13cd9f3d04 | ||
|
|
8e1f82de5f | ||
|
|
8631ad3122 | ||
|
|
90e6aef9d7 | ||
|
|
698190fb72 | ||
|
|
27cfaa9404 | ||
|
|
9f296fe76d | ||
|
|
d0112adb08 | ||
|
|
75f4fe3595 | ||
|
|
211bfbc1e2 | ||
|
|
afaa1841fc | ||
|
|
027662c9c3 | ||
|
|
43e652321b | ||
|
|
83a2216d19 | ||
|
|
82ae568add | ||
|
|
2573003034 | ||
|
|
c33e873577 | ||
|
|
a1d03b8159 | ||
|
|
762530f6ab | ||
|
|
f53a3ecc69 | ||
|
|
1ed60fecee | ||
|
|
c1a12ea4e9 | ||
|
|
0efd235e36 | ||
|
|
c7be8c59f3 | ||
|
|
20bb3eb674 | ||
|
|
cde0e5883e | ||
|
|
0b43099621 | ||
|
|
386f36c3ae | ||
|
|
b391b2129e | ||
|
|
5478673bda | ||
|
|
6295048b3e | ||
|
|
4fa956aa27 |
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
rem2pdf/Makefile.old
|
||||||
*.bak
|
*.bak
|
||||||
*.o
|
*.o
|
||||||
*~
|
*~
|
||||||
@@ -15,3 +16,11 @@ src/remind
|
|||||||
src/version.h
|
src/version.h
|
||||||
tests/test.out
|
tests/test.out
|
||||||
www/Makefile
|
www/Makefile
|
||||||
|
rem2pdf/Makefile.PL
|
||||||
|
MYMETA.json
|
||||||
|
MYMETA.yml
|
||||||
|
Makefile
|
||||||
|
blib/
|
||||||
|
pm_to_blib
|
||||||
|
rem2pdf/Makefile.top
|
||||||
|
rem2pdf/bin/rem2pdf
|
||||||
|
|||||||
11
Makefile
11
Makefile
@@ -9,7 +9,7 @@ all: src/Makefile
|
|||||||
@echo "*******************"
|
@echo "*******************"
|
||||||
@echo ""
|
@echo ""
|
||||||
@cd src && $(MAKE) all LANGDEF=$(LANGDEF)
|
@cd src && $(MAKE) all LANGDEF=$(LANGDEF)
|
||||||
|
@$(MAKE) -C rem2pdf -f Makefile.top
|
||||||
install:
|
install:
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "*********************"
|
@echo "*********************"
|
||||||
@@ -20,16 +20,17 @@ install:
|
|||||||
@echo ""
|
@echo ""
|
||||||
@$(MAKE) -C src install
|
@$(MAKE) -C src install
|
||||||
@$(MAKE) -C rem2html install
|
@$(MAKE) -C rem2html install
|
||||||
|
@$(MAKE) -C rem2pdf -f Makefile.top install
|
||||||
clean:
|
clean:
|
||||||
find . -name '*~' -exec rm {} \;
|
find . -name '*~' -exec rm {} \;
|
||||||
cd src && $(MAKE) clean
|
$(MAKE) -C src clean
|
||||||
|
-$(MAKE) -C rem2pdf clean
|
||||||
|
|
||||||
test:
|
test:
|
||||||
@cd src && $(MAKE) -s test
|
@$(MAKE) -C src -s test
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f config.cache config.log config.status src/Makefile src/config.h tests/test.out www/Makefile
|
rm -f config.cache config.log config.status src/Makefile src/config.h tests/test.out www/Makefile rem2pdf/Makefile.top rem2pdf/Makefile.old rem2pdf/Makefile rem2pdf/Makefile.PL rem2pdf/bin/rem2pdf
|
||||||
|
|
||||||
src/Makefile: src/Makefile.in
|
src/Makefile: src/Makefile.in
|
||||||
./configure
|
./configure
|
||||||
|
|||||||
90
build.tk
90
build.tk
@@ -27,16 +27,14 @@ proc SetConfigDefaults {} {
|
|||||||
global Config
|
global Config
|
||||||
set Config(LAT_DEG) 45
|
set Config(LAT_DEG) 45
|
||||||
set Config(LAT_MIN) 24
|
set Config(LAT_MIN) 24
|
||||||
|
set Config(LAT_SEC) 14
|
||||||
set Config(LON_DEG) 75
|
set Config(LON_DEG) 75
|
||||||
set Config(LON_MIN) 39
|
set Config(LON_MIN) 39
|
||||||
|
set Config(LON_SEC) 23
|
||||||
set Config(LOCATION) "Ottawa"
|
set Config(LOCATION) "Ottawa"
|
||||||
set Config(DEFAULT_PAGE) "Letter"
|
set Config(DEFAULT_PAGE) "Letter"
|
||||||
set Config(DATESEP) "-"
|
set Config(DATESEP) "-"
|
||||||
set Config(TIMESEP) ":"
|
set Config(TIMESEP) ":"
|
||||||
set Config(ISOLATIN1) 0
|
|
||||||
set Config(IBMEXTENDED) 0
|
|
||||||
set Config(ISOLATIN2) 0
|
|
||||||
set Config(IBM852) 0
|
|
||||||
set Config(NORTHERN_HEMISPHERE) 1
|
set Config(NORTHERN_HEMISPHERE) 1
|
||||||
set Config(WESTERN_HEMISPHERE) 1
|
set Config(WESTERN_HEMISPHERE) 1
|
||||||
set Config(LANGUAGE) "English"
|
set Config(LANGUAGE) "English"
|
||||||
@@ -161,10 +159,14 @@ proc CreateLocationDialog { w } {
|
|||||||
-from 0 -to 89 -length 300 -variable Config(LAT_DEG)
|
-from 0 -to 89 -length 300 -variable Config(LAT_DEG)
|
||||||
scale $w.latmin -label "Latitude (minutes)" -orient horizontal \
|
scale $w.latmin -label "Latitude (minutes)" -orient horizontal \
|
||||||
-from 0 -to 59 -length 300 -variable Config(LAT_MIN)
|
-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 \
|
scale $w.londeg -label "Longitude (degrees)" -orient horizontal \
|
||||||
-from 0 -to 179 -length 300 -variable Config(LON_DEG)
|
-from 0 -to 179 -length 300 -variable Config(LON_DEG)
|
||||||
scale $w.lonmin -label "Longtude (minutes)" -orient horizontal \
|
scale $w.lonmin -label "Longtude (minutes)" -orient horizontal \
|
||||||
-from 0 -to 59 -length 300 -variable Config(LON_MIN)
|
-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" \
|
radiobutton $w.north -text "Northern Hemisphere" \
|
||||||
-variable Config(NORTHERN_HEMISPHERE) -value 1
|
-variable Config(NORTHERN_HEMISPHERE) -value 1
|
||||||
@@ -180,8 +182,10 @@ proc CreateLocationDialog { w } {
|
|||||||
$w.location insert end $Config(LOCATION)
|
$w.location insert end $Config(LOCATION)
|
||||||
grid $w.latdeg -
|
grid $w.latdeg -
|
||||||
grid $w.latmin -
|
grid $w.latmin -
|
||||||
|
grid $w.latsec -
|
||||||
grid $w.londeg -
|
grid $w.londeg -
|
||||||
grid $w.lonmin -
|
grid $w.lonmin -
|
||||||
|
grid $w.lonsec -
|
||||||
|
|
||||||
grid $w.north $w.west
|
grid $w.north $w.west
|
||||||
grid $w.south $w.east
|
grid $w.south $w.east
|
||||||
@@ -233,19 +237,6 @@ proc CreateOptionsDialog { w } {
|
|||||||
grid configure $w.timelabel -row 2 -column 0 -sticky e
|
grid configure $w.timelabel -row 2 -column 0 -sticky e
|
||||||
grid configure $w.time -row 2 -column 1 -sticky nsew
|
grid configure $w.time -row 2 -column 1 -sticky nsew
|
||||||
|
|
||||||
label $w.charlabel -text "Character set: "
|
|
||||||
menubutton $w.char -text "ISO 8859-1" -indicatoron 1 -relief raised \
|
|
||||||
-menu $w.char.menu
|
|
||||||
menu $w.char.menu -tearoff 0
|
|
||||||
$w.char.menu add command -label "ISO 8859-1" -command "$w.char configure -text {ISO 8859-1}"
|
|
||||||
$w.char.menu add command -label "ISO 8859-2" -command "$w.char configure -text {ISO 8859-2}"
|
|
||||||
$w.char.menu add command -label "IBM Extended" -command "$w.char configure -text {IBM Extended}"
|
|
||||||
$w.char.menu add command -label "IBM CPI-852" -command "$w.char configure -text {ISO 8859-2}"
|
|
||||||
$w.char.menu add command -label "Plain ASCII" -command "$w.char configure -text {Plain ASCII}"
|
|
||||||
|
|
||||||
grid configure $w.charlabel -row 3 -column 0 -sticky e
|
|
||||||
grid configure $w.char -row 3 -column 1 -sticky nsew
|
|
||||||
|
|
||||||
label $w.langlabel -text "Language: "
|
label $w.langlabel -text "Language: "
|
||||||
menubutton $w.lang -text $Config(LANGUAGE) -indicatoron 1 -relief raised \
|
menubutton $w.lang -text $Config(LANGUAGE) -indicatoron 1 -relief raised \
|
||||||
-menu $w.lang.menu
|
-menu $w.lang.menu
|
||||||
@@ -268,8 +259,8 @@ proc CreateOptionsDialog { w } {
|
|||||||
$w.lang.menu add command -label $lang -command [list $w.lang configure -text $lang]
|
$w.lang.menu add command -label $lang -command [list $w.lang configure -text $lang]
|
||||||
}
|
}
|
||||||
|
|
||||||
grid configure $w.langlabel -row 4 -column 0 -sticky e
|
grid configure $w.langlabel -row 3 -column 0 -sticky e
|
||||||
grid configure $w.lang -row 4 -column 1 -sticky nsew
|
grid configure $w.lang -row 3 -column 1 -sticky nsew
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -423,15 +414,19 @@ proc CreateCustomH {} {
|
|||||||
# modify them willy-nilly
|
# modify them willy-nilly
|
||||||
set LAT_DEG $Config(LAT_DEG)
|
set LAT_DEG $Config(LAT_DEG)
|
||||||
set LAT_MIN $Config(LAT_MIN)
|
set LAT_MIN $Config(LAT_MIN)
|
||||||
|
set LAT_SEC $Config(LAT_SEC)
|
||||||
set LON_DEG $Config(LON_DEG)
|
set LON_DEG $Config(LON_DEG)
|
||||||
set LON_MIN $Config(LON_MIN)
|
set LON_MIN $Config(LON_MIN)
|
||||||
|
set LON_SEC $Config(LON_SEC)
|
||||||
if {!$Config(NORTHERN_HEMISPHERE)} {
|
if {!$Config(NORTHERN_HEMISPHERE)} {
|
||||||
set LAT_DEG "-$LAT_DEG"
|
set LAT_DEG "-$LAT_DEG"
|
||||||
set LAT_MIN "-$LAT_MIN"
|
set LAT_MIN "-$LAT_MIN"
|
||||||
|
set LAT_SEC "-$LAT_SEC"
|
||||||
}
|
}
|
||||||
if {!$Config(WESTERN_HEMISPHERE)} {
|
if {!$Config(WESTERN_HEMISPHERE)} {
|
||||||
set LON_DEG "-$LON_DEG"
|
set LON_DEG "-$LON_DEG"
|
||||||
set LON_MIN "-$LON_MIN"
|
set LON_MIN "-$LON_MIN"
|
||||||
|
set LON_SEC "-$LON_SEC"
|
||||||
}
|
}
|
||||||
set Config(LOCATION) [$Loc.location get]
|
set Config(LOCATION) [$Loc.location get]
|
||||||
|
|
||||||
@@ -446,38 +441,17 @@ proc CreateCustomH {} {
|
|||||||
set Config(DATESEP) [$Options.date cget -text]
|
set Config(DATESEP) [$Options.date cget -text]
|
||||||
set Config(TIMESEP) [$Options.time cget -text]
|
set Config(TIMESEP) [$Options.time cget -text]
|
||||||
|
|
||||||
switch -- [$Options.char cget -text] {
|
|
||||||
"ISO 8859-1" {
|
|
||||||
set Config(ISOLATIN1) 1
|
|
||||||
}
|
|
||||||
"ISO 8859-2" {
|
|
||||||
set Config(ISOLATIN2) 1
|
|
||||||
}
|
|
||||||
"IBM CPI-852" {
|
|
||||||
set Config(IBM852) 1
|
|
||||||
}
|
|
||||||
"IBM Extended" {
|
|
||||||
set Config(IBMEXTENDED) 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while {[gets $in line] != -1} {
|
while {[gets $in line] != -1} {
|
||||||
switch -glob -- $line {
|
switch -glob -- $line {
|
||||||
"#define LAT_DEG *" {
|
"#define DEFAULT_LATITUDE *" {
|
||||||
puts $out "#define LAT_DEG $LAT_DEG"
|
set lat [expr $LAT_DEG + ($LAT_MIN/60.0) + ($LAT_SEC/3600.0)];
|
||||||
.msgs insert end "#define LAT_DEG $LAT_DEG\n"
|
puts $out "#define DEFAULT_LATITUDE $lat"
|
||||||
|
.msgs insert end "#define DEFAULT_LATITUDE $lat"
|
||||||
}
|
}
|
||||||
"#define LAT_MIN *" {
|
"#define DEFAULT_LONGITUDE *" {
|
||||||
puts $out "#define LAT_MIN $LAT_MIN"
|
set lon [expr -1.0 * ($LON_DEG + ($LON_MIN/60.0) + ($LON_SEC/3600.0))]
|
||||||
.msgs insert end "#define LAT_MIN $LAT_MIN\n"
|
puts $out "#define DEFAULT_LONGITUDE $lon"
|
||||||
}
|
.msgs insert end "#define DEFAULT_LONGITUDE $lon"
|
||||||
"#define LON_DEG *" {
|
|
||||||
puts $out "#define LON_DEG $LON_DEG"
|
|
||||||
.msgs insert end "#define LON_DEG $LON_DEG\n"
|
|
||||||
}
|
|
||||||
"#define LON_MIN *" {
|
|
||||||
puts $out "#define LON_MIN $LON_MIN"
|
|
||||||
.msgs insert end "#define LON_MIN $LON_MIN\n"
|
|
||||||
}
|
}
|
||||||
"#define LOCATION *" {
|
"#define LOCATION *" {
|
||||||
puts $out "#define LOCATION \"$Config(LOCATION)\""
|
puts $out "#define LOCATION \"$Config(LOCATION)\""
|
||||||
@@ -495,22 +469,6 @@ proc CreateCustomH {} {
|
|||||||
puts $out "#define TIMESEP '$Config(TIMESEP)'"
|
puts $out "#define TIMESEP '$Config(TIMESEP)'"
|
||||||
.msgs insert end "#define TIMESEP '$Config(TIMESEP)'\n"
|
.msgs insert end "#define TIMESEP '$Config(TIMESEP)'\n"
|
||||||
}
|
}
|
||||||
"#define ISOLATIN1 *" {
|
|
||||||
puts $out "#define ISOLATIN1 $Config(ISOLATIN1)"
|
|
||||||
.msgs insert end "#define ISOLATIN1 $Config(ISOLATIN1)\n"
|
|
||||||
}
|
|
||||||
"#define ISOLATIN2 *" {
|
|
||||||
puts $out "#define ISOLATIN2 $Config(ISOLATIN2)"
|
|
||||||
.msgs insert end "#define ISOLATIN2 $Config(ISOLATIN2)\n"
|
|
||||||
}
|
|
||||||
"#define IBM852 *" {
|
|
||||||
puts $out "#define IBM852 $Config(IBM852)"
|
|
||||||
.msgs insert end "#define IBM852 $Config(IBM852)\n"
|
|
||||||
}
|
|
||||||
"#define IBMEXTENDED *" {
|
|
||||||
puts $out "#define IBMEXTENDED $Config(IBMEXTENDED)"
|
|
||||||
.msgs insert end "#define IBMEXTENDED $Config(IBMEXTENDED)\n"
|
|
||||||
}
|
|
||||||
default {
|
default {
|
||||||
puts $out $line
|
puts $out $line
|
||||||
}
|
}
|
||||||
@@ -806,14 +764,17 @@ proc SetConfigFromRemind {} {
|
|||||||
# Query Remind for the rest
|
# Query Remind for the rest
|
||||||
QueryRemind $rem LAT_DEG {$LatDeg}
|
QueryRemind $rem LAT_DEG {$LatDeg}
|
||||||
QueryRemind $rem LAT_MIN {$LatMin}
|
QueryRemind $rem LAT_MIN {$LatMin}
|
||||||
|
QueryRemind $rem LAT_SEC {$LatSec}
|
||||||
QueryRemind $rem LON_DEG {$LongDeg}
|
QueryRemind $rem LON_DEG {$LongDeg}
|
||||||
QueryRemind $rem LON_MIN {$LongMin}
|
QueryRemind $rem LON_MIN {$LongMin}
|
||||||
|
QueryRemind $rem LON_SEC {$LongSec}
|
||||||
QueryRemind $rem LOCATION {$Location}
|
QueryRemind $rem LOCATION {$Location}
|
||||||
QueryRemind $rem DATESEP {$DateSep}
|
QueryRemind $rem DATESEP {$DateSep}
|
||||||
QueryRemind $rem TIMESEP {$TimeSep}
|
QueryRemind $rem TIMESEP {$TimeSep}
|
||||||
QueryRemind $rem LANGUAGE {language()}
|
QueryRemind $rem LANGUAGE {language()}
|
||||||
|
|
||||||
set $Config(LAT_MIN) [expr abs($Config(LAT_MIN))]
|
set $Config(LAT_MIN) [expr abs($Config(LAT_MIN))]
|
||||||
|
set $Config(LAT_SEC) [expr abs($Config(LAT_SEC))]
|
||||||
if {$Config(LAT_DEG) >= 0} {
|
if {$Config(LAT_DEG) >= 0} {
|
||||||
set Config(NORTHERN_HEMISPHERE) 1
|
set Config(NORTHERN_HEMISPHERE) 1
|
||||||
} else {
|
} else {
|
||||||
@@ -822,6 +783,7 @@ proc SetConfigFromRemind {} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set $Config(LON_MIN) [expr abs($Config(LON_MIN))]
|
set $Config(LON_MIN) [expr abs($Config(LON_MIN))]
|
||||||
|
set $Config(LON_SEC) [expr abs($Config(LON_SEC))]
|
||||||
if {$Config(LON_DEG) >= 0} {
|
if {$Config(LON_DEG) >= 0} {
|
||||||
set Config(WESTERN_HEMISPHERE) 1
|
set Config(WESTERN_HEMISPHERE) 1
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
71
configure
vendored
71
configure
vendored
@@ -2292,36 +2292,6 @@ EOF
|
|||||||
ac_config_headers="$ac_config_headers src/config.h"
|
ac_config_headers="$ac_config_headers src/config.h"
|
||||||
|
|
||||||
|
|
||||||
if test "`uname -s`" = "Darwin" ; then
|
|
||||||
trap 'echo Be patient...' INT TERM
|
|
||||||
cat <<'EOF'
|
|
||||||
|
|
||||||
Please don't use Apple products. This script will continue in 30 seconds
|
|
||||||
if you insist on compiling Remind on Mac OS X.
|
|
||||||
|
|
||||||
EOF
|
|
||||||
for i in 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 ; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
trap - INT
|
|
||||||
trap - TERM
|
|
||||||
fi
|
|
||||||
|
|
||||||
if uname -s | grep -i -q 'cygwin' ; then
|
|
||||||
trap 'echo Be patient...' INT TERM
|
|
||||||
cat <<'EOF'
|
|
||||||
|
|
||||||
Please don't use Microsoft products. This script will continue in 30
|
|
||||||
seconds if you insist on compiling Remind on Cygwin.
|
|
||||||
|
|
||||||
EOF
|
|
||||||
for i in 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 ; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
trap - INT
|
|
||||||
trap - TERM
|
|
||||||
fi
|
|
||||||
|
|
||||||
ac_ext=c
|
ac_ext=c
|
||||||
ac_cpp='$CPP $CPPFLAGS'
|
ac_cpp='$CPP $CPPFLAGS'
|
||||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||||
@@ -3761,39 +3731,6 @@ fi
|
|||||||
done
|
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
|
# 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
|
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||||
@@ -4032,10 +3969,10 @@ _ACEOF
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
VERSION=03.03.10
|
VERSION=03.04.00
|
||||||
|
|
||||||
|
|
||||||
ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h rem2html/Makefile"
|
ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf"
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
@@ -4732,6 +4669,9 @@ do
|
|||||||
"www/Makefile") CONFIG_FILES="$CONFIG_FILES www/Makefile" ;;
|
"www/Makefile") CONFIG_FILES="$CONFIG_FILES www/Makefile" ;;
|
||||||
"src/version.h") CONFIG_FILES="$CONFIG_FILES src/version.h" ;;
|
"src/version.h") CONFIG_FILES="$CONFIG_FILES src/version.h" ;;
|
||||||
"rem2html/Makefile") CONFIG_FILES="$CONFIG_FILES rem2html/Makefile" ;;
|
"rem2html/Makefile") CONFIG_FILES="$CONFIG_FILES rem2html/Makefile" ;;
|
||||||
|
"rem2pdf/Makefile.PL") CONFIG_FILES="$CONFIG_FILES rem2pdf/Makefile.PL" ;;
|
||||||
|
"rem2pdf/Makefile.top") CONFIG_FILES="$CONFIG_FILES rem2pdf/Makefile.top" ;;
|
||||||
|
"rem2pdf/bin/rem2pdf") CONFIG_FILES="$CONFIG_FILES rem2pdf/bin/rem2pdf" ;;
|
||||||
|
|
||||||
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
||||||
esac
|
esac
|
||||||
@@ -5318,3 +5258,4 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
|
|||||||
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
|
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
chmod a+x rem2pdf/bin/rem2pdf
|
||||||
|
|||||||
36
configure.in
36
configure.in
@@ -14,36 +14,6 @@ EOF
|
|||||||
|
|
||||||
AC_CONFIG_HEADER(src/config.h)
|
AC_CONFIG_HEADER(src/config.h)
|
||||||
|
|
||||||
if test "`uname -s`" = "Darwin" ; then
|
|
||||||
trap 'echo Be patient...' INT TERM
|
|
||||||
cat <<'EOF'
|
|
||||||
|
|
||||||
Please don't use Apple products. This script will continue in 30 seconds
|
|
||||||
if you insist on compiling Remind on Mac OS X.
|
|
||||||
|
|
||||||
EOF
|
|
||||||
for i in 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 ; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
trap - INT
|
|
||||||
trap - TERM
|
|
||||||
fi
|
|
||||||
|
|
||||||
if uname -s | grep -i -q 'cygwin' ; then
|
|
||||||
trap 'echo Be patient...' INT TERM
|
|
||||||
cat <<'EOF'
|
|
||||||
|
|
||||||
Please don't use Microsoft products. This script will continue in 30
|
|
||||||
seconds if you insist on compiling Remind on Cygwin.
|
|
||||||
|
|
||||||
EOF
|
|
||||||
for i in 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 ; do
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
trap - INT
|
|
||||||
trap - TERM
|
|
||||||
fi
|
|
||||||
|
|
||||||
dnl Checks for programs.
|
dnl Checks for programs.
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
@@ -57,7 +27,6 @@ dnl Replace `main' with a function in -lm:
|
|||||||
AC_CHECK_LIB(m, sqrt)
|
AC_CHECK_LIB(m, sqrt)
|
||||||
|
|
||||||
dnl Integer sizes
|
dnl Integer sizes
|
||||||
AC_CHECK_SIZEOF(unsigned short)
|
|
||||||
AC_CHECK_SIZEOF(unsigned int)
|
AC_CHECK_SIZEOF(unsigned int)
|
||||||
AC_CHECK_SIZEOF(unsigned long)
|
AC_CHECK_SIZEOF(unsigned long)
|
||||||
|
|
||||||
@@ -76,7 +45,8 @@ if test "$GCC" = yes; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
||||||
VERSION=03.03.10
|
VERSION=03.04.00
|
||||||
AC_SUBST(VERSION)
|
AC_SUBST(VERSION)
|
||||||
AC_SUBST(PERL)
|
AC_SUBST(PERL)
|
||||||
AC_OUTPUT(src/Makefile www/Makefile src/version.h rem2html/Makefile)
|
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
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ know! Here are the basic guidelines:
|
|||||||
|
|
||||||
- You can test your language file with the script "tests/tstlang.rem"
|
- You can test your language file with the script "tests/tstlang.rem"
|
||||||
|
|
||||||
|
- Your localized strings must be encoded using UTF-8.
|
||||||
|
|
||||||
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
||||||
|
|
||||||
1. POPUP REMINDERS
|
1. POPUP REMINDERS
|
||||||
|
|||||||
125
docs/WHATSNEW
125
docs/WHATSNEW
@@ -1,5 +1,130 @@
|
|||||||
CHANGES TO REMIND
|
CHANGES TO REMIND
|
||||||
|
|
||||||
|
* VERSION 3.4 Patch 0 - 2022-??-??
|
||||||
|
|
||||||
|
- 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
|
||||||
|
can handle UTF-8 encoding, you can enjoy full Unicode support in Remind.
|
||||||
|
|
||||||
|
- NEW FEATURE: Added a rem2pdf Remind-to-PDF converter. It can handle
|
||||||
|
the full UTF-8 character set and features a new PANGO special reminder
|
||||||
|
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. 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
|
||||||
|
to whatever you like, permitting you to produce calendars in your
|
||||||
|
local language, even if it's not one of the languages Remind supports
|
||||||
|
by default.
|
||||||
|
|
||||||
|
- 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 FIX: Properly support formatting of double-wide characters in the
|
||||||
|
terminal mode "remind -c" calendar.
|
||||||
|
|
||||||
|
- 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
|
||||||
|
on UTF-8.
|
||||||
|
|
||||||
|
- CHANGE: remind: Non-English versions of remind *no longer* accept
|
||||||
|
non-English month- and weekday-names in trigger specifications. This
|
||||||
|
was a misfeature. NOTE INCOMPATIBILITY.
|
||||||
|
|
||||||
|
* VERSION 3.3 Patch 12 - 2022-01-24
|
||||||
|
|
||||||
|
- UPDATE: rem2html: Use JSON::MaybeXS instead of JSON::Any, since JSON::Any
|
||||||
|
is deprecated. NOTE INCOMPATIBILITY: If you don't have JSON::MaybeXS
|
||||||
|
installed, you'll need to install it before trying to install or update
|
||||||
|
rem2html
|
||||||
|
|
||||||
|
- NEW FEATURE: Add a DO command. This is just like INCLUDE, but relative
|
||||||
|
paths are interpreted relative to the directory containing the current
|
||||||
|
file. That is:
|
||||||
|
|
||||||
|
DO somefile.rem
|
||||||
|
|
||||||
|
is equivalent to:
|
||||||
|
|
||||||
|
INCLUDE [filedir()]/somefile.rem
|
||||||
|
|
||||||
|
- NEW FEATURE: Add the $DefaultTDelta system variable and associated
|
||||||
|
-tt[N] command-line option to set a default time delta for timed
|
||||||
|
reminder without an explicit +N delta.
|
||||||
|
|
||||||
|
- IMPROVEMENT: TkRemind: Store .tkremindrc in $XDG_CONFIG_HOME/tkremindrc
|
||||||
|
or $HOME/.config/tkremindrc as per the XDG Base Directory Specification.
|
||||||
|
|
||||||
|
- BUG FIX: remind: Make the shell() built-in function respect
|
||||||
|
$MaxStringLen
|
||||||
|
|
||||||
|
- BUG FIX: Use size_t to track the size of dynamic buffers rather than int.
|
||||||
|
This permits Remind to read in files with lines longer than 1GB and to
|
||||||
|
consume more than 1GB of output from the shell() command, both of which
|
||||||
|
will surely be massively useful. (The old limit was 1GB rather than 2GB
|
||||||
|
because of details of the dynamic buffer resizing algorithm.)
|
||||||
|
|
||||||
|
* VERSION 3.3 Patch 11 - 2021-12-30
|
||||||
|
|
||||||
|
- IMPROVEMENT: TkRemind: Save the print dialog settings so they persist.
|
||||||
|
|
||||||
|
- IMPROVEMENT: TkRemind: Show queue in sorted order.
|
||||||
|
|
||||||
|
- IMPROVEMENT: TkRemind: Pass "-r" flag to inotifywait
|
||||||
|
|
||||||
|
- IMPROVEMENT: TkRemind: Draw moon phases with Tk canvas items rather than
|
||||||
|
using PNG images. This lets them change color along with other TkRemind
|
||||||
|
preferences.
|
||||||
|
|
||||||
|
- IMPROVEMENT: TkRemind: Underline editable reminders when the pointer enters
|
||||||
|
them; fire up the editor with either Button-1 or Button-3 for
|
||||||
|
non-TkRemind-generated reminders.
|
||||||
|
|
||||||
|
- NEW FUNCTION: Remind: Add the isany() built-in function.
|
||||||
|
|
||||||
|
- IMPROVEMENT: rem2html: Add class names indicating number of rows in calendar
|
||||||
|
|
||||||
|
- IMPROVEMENT: remind: In -z0 mode, sleep with higher precision to ensure we
|
||||||
|
wake as close to possible to each 1-minute boundary.
|
||||||
|
|
||||||
|
- IMPROVEMENT: rem2html: Coalesce table.rem-cal CSS into one block. Thanks
|
||||||
|
to Ian! D. Allen for pointing this out.
|
||||||
|
|
||||||
|
- IMPROVEMENT: examples/defs.rem: Modernize the examples and get rid of some
|
||||||
|
cruft.
|
||||||
|
|
||||||
|
- CHANGE: Add $Latitude and $Longitude system variables. Deprecate
|
||||||
|
$LatDeg, $LatMin, $LatSec, $LongDeg, $LongMin and $LongSec.
|
||||||
|
|
||||||
|
- CHANGE: Test: Add "dump $" to test.rem.
|
||||||
|
|
||||||
* VERSION 3.3 Patch 10 - 2021-11-30
|
* VERSION 3.3 Patch 10 - 2021-11-30
|
||||||
|
|
||||||
- IMPROVEMENT: TkRemind: Apply window and text colors to all GUI elements
|
- IMPROVEMENT: TkRemind: Apply window and text colors to all GUI elements
|
||||||
|
|||||||
@@ -14,7 +14,6 @@
|
|||||||
# "#USHOLS" for U.S. holidays #
|
# "#USHOLS" for U.S. holidays #
|
||||||
# "#JHOLS" for Jewish holidays #
|
# "#JHOLS" for Jewish holidays #
|
||||||
# "#PSSTUFF" for nifty PostScript examples #
|
# "#PSSTUFF" for nifty PostScript examples #
|
||||||
# "#COLORS" for examples of ANSI color escape sequences. #
|
|
||||||
# #
|
# #
|
||||||
# This file is part of REMIND. #
|
# This file is part of REMIND. #
|
||||||
# Copyright (C) 1992-2018 Dianne Skoll #
|
# Copyright (C) 1992-2018 Dianne Skoll #
|
||||||
@@ -26,8 +25,8 @@ RUN OFF
|
|||||||
################################################
|
################################################
|
||||||
# Ensure required version of remind is used... #
|
# Ensure required version of remind is used... #
|
||||||
################################################
|
################################################
|
||||||
IF version() < "03.01.09"
|
IF version() < "03.01.10"
|
||||||
ERRMSG This file requires at least version 03.01.09 of Remind.%
|
ERRMSG This file requires at least version 03.01.10 of Remind.%
|
||||||
ERRMSG This version is version [version()].
|
ERRMSG This version is version [version()].
|
||||||
EXIT
|
EXIT
|
||||||
ENDIF
|
ENDIF
|
||||||
@@ -93,9 +92,6 @@ SET Week_3 15
|
|||||||
SET Week_4 22
|
SET Week_4 22
|
||||||
FSET _last(mo) "1 " + MON((mo%12)+1) + " --7"
|
FSET _last(mo) "1 " + MON((mo%12)+1) + " --7"
|
||||||
|
|
||||||
# Handy function to provide SCANFROM dates...
|
|
||||||
FSET _back(days) $U-days
|
|
||||||
|
|
||||||
#################################################################
|
#################################################################
|
||||||
# Function that removes a single leading zero from a string... #
|
# Function that removes a single leading zero from a string... #
|
||||||
#################################################################
|
#################################################################
|
||||||
@@ -135,7 +131,7 @@ REM 1 MSG John's [_mo_num(11, 1984)] 'monthly' anniversary
|
|||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
# Calculate the weekday of the holiday.
|
# Calculate the weekday of the holiday.
|
||||||
REM 4 July SCANFROM [_back(7)] SATISFY 1
|
REM 4 July SCANFROM -7 SATISFY 1
|
||||||
|
|
||||||
SET iday $T
|
SET iday $T
|
||||||
IF WKDAYNUM(iday) == Sat
|
IF WKDAYNUM(iday) == Sat
|
||||||
@@ -217,17 +213,15 @@ REM [easter+39] MSG %"Ascension Day%"
|
|||||||
REM [easter+49] MSG %"Pentecost%"
|
REM [easter+49] MSG %"Pentecost%"
|
||||||
|
|
||||||
# Some holidays are omitted, some are not. You may want to change
|
# Some holidays are omitted, some are not. You may want to change
|
||||||
# which ones are omitted - use the general forms shown below.
|
# which ones are omitted - use the general forms shown below. You'll
|
||||||
# You'll need the _back() function and the Week_n variables defined
|
# need the Week_n variables defined way up in the file.
|
||||||
# way up in the file.
|
|
||||||
|
|
||||||
OMIT Jan 1 MSG %"New Year's%" Day
|
OMIT Jan 1 MSG %"New Year's%" Day
|
||||||
REM Mon Jan [Week_3] MSG Martin Luther King - %"MLK Day%"
|
REM Mon Jan [Week_3] MSG Martin Luther King - %"MLK Day%"
|
||||||
REM Feb 2 MSG %"Ground Hog Day%"
|
REM Feb 2 MSG %"Ground Hog Day%"
|
||||||
REM Feb 14 MSG %"Valentine's%" Day
|
REM Feb 14 MSG %"Valentine's%" Day
|
||||||
REM Mon Feb [Week_3] SCANFROM [_back(7)] SATISFY 1
|
REM Mon Feb [Week_3] SCANFROM -7 ADDOMIT MSG %"President's Day%"
|
||||||
OMIT [$T] MSG %"President's Day%"
|
REM Mar 17 MSG %"St. Patrick's%" Day
|
||||||
REM Mar 17 MSG %"St. Patrick's%" Day
|
|
||||||
|
|
||||||
# The DST rules are accurate for most locations in
|
# The DST rules are accurate for most locations in
|
||||||
# North America
|
# North America
|
||||||
@@ -237,38 +231,31 @@ 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 [_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 Sun 1 Nov ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
|
||||||
|
|
||||||
REM Apr 1 MSG %"April Fool's%" Day
|
REM Apr 1 MSG %"April Fool's%" Day
|
||||||
REM Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
|
REM Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
|
||||||
REM May 5 MSG %"Cinco de Mayo%"
|
REM May 5 MSG %"Cinco de Mayo%"
|
||||||
REM Sat May [Week_1] MSG %"Kentucky Derby%"
|
REM Sat May [Week_1] MSG %"Kentucky Derby%"
|
||||||
REM Sun May [Week_2] MSG %"Mother's Day%"
|
REM Sun May [Week_2] MSG %"Mother's Day%"
|
||||||
REM Sat May [Week_3] MSG %"Armed Forces Day%"
|
REM Sat May [Week_3] MSG %"Armed Forces Day%"
|
||||||
REM Mon [_last(May)] SCANFROM [_back(7)] SATISFY 1
|
REM Mon [_last(May)] SCANFROM -7 ADDOMIT MSG %"Memorial Day%"
|
||||||
OMIT [$T] MSG %"Memorial Day%"
|
REM Jun 14 MSG %"Flag Day%"
|
||||||
REM Jun 14 MSG %"Flag Day%"
|
REM Sun Jun [Week_3] MSG %"Father's Day%"
|
||||||
REM Sun Jun [Week_3] MSG %"Father's Day%"
|
REM Mon Sep [Week_1] SCANFROM -7 ADDOMIT MSG %"Labor Day%"
|
||||||
REM Mon Sep [Week_1] SCANFROM [_back(7)] SATISFY 1
|
REM Mon Oct [Week_2] MSG %"Columbus Day%"
|
||||||
OMIT [$T] MSG %"Labor Day%"
|
REM Nov 11 MSG %"Veterans Day%"
|
||||||
REM Mon Oct [Week_2] MSG %"Columbus Day%"
|
|
||||||
REM Nov 11 MSG %"Veterans Day%"
|
|
||||||
|
|
||||||
REM Oct 30 MSG %"Mischief Night%"
|
REM Oct 30 MSG %"Mischief Night%"
|
||||||
REM Oct 31 MSG %"Halloween%"
|
REM Oct 31 MSG %"Halloween%"
|
||||||
REM Tue Nov 2 SCANFROM [_back(7)] \
|
REM Tue Nov 2 SCANFROM -7 SATISFY [($Ty % 4) == 0] MSG %"Election Day%"
|
||||||
SATISFY [($Ty % 4) == 0] \
|
REM Thu Nov [Week_4] SCANFROM -7 ADDOMIT MSG %"Thanksgiving Day%"
|
||||||
MSG %"Election%" Day
|
REM Fri Nov [Week_4+1] SCANFROM -7 ADDOMIT MSG %"Thanksgiving (cont.)%"
|
||||||
REM Thu Nov [Week_4] SCANFROM [_back(7)] SATISFY 1
|
OMIT Dec 24 MSG %"Christmas Eve%"
|
||||||
OMIT [$T] MSG %"Thanksgiving%" Day
|
OMIT Dec 25 MSG %"Christmas%" Day
|
||||||
REM Fri Nov [Week_4+1] SCANFROM [_back(7)] SATISFY 1
|
|
||||||
OMIT [$T] MSG %"Thanksgiving%" (cont.)
|
|
||||||
OMIT Dec 24 MSG %"Christmas Eve%"
|
|
||||||
OMIT Dec 25 MSG %"Christmas%" Day
|
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# #
|
# #
|
||||||
# If any US holidays were triggered above, shade in the calendar #
|
# If any US holidays were triggered above, shade in the calendar #
|
||||||
# entry in PostScript. This is not quite correct, as it blots out any #
|
# entry in PostScript. #
|
||||||
# other PostScript stuff above. I was too lazy to do it properly :-) #
|
|
||||||
# #
|
# #
|
||||||
##########################################################################
|
##########################################################################
|
||||||
if $NumTrig > SaveTrig
|
if $NumTrig > SaveTrig
|
||||||
@@ -495,48 +482,10 @@ REM Friday CAL Candle lighting at [sunset($T)-18]
|
|||||||
REM Saturday CAL Havdalah at [sunset($T)+42]
|
REM Saturday CAL Havdalah at [sunset($T)+42]
|
||||||
|
|
||||||
#COLORS
|
#COLORS
|
||||||
##########################################################################
|
|
||||||
# #
|
|
||||||
# This contains sample ANSI escape sequences for coloring messages. #
|
|
||||||
# It should work on an IBM PC with the ANSI.SYS driver, and on #
|
|
||||||
# other terminals which use the ANSI sequences. #
|
|
||||||
# #
|
|
||||||
# This information was provided by Gail Gurman.
|
|
||||||
# #
|
|
||||||
##########################################################################
|
|
||||||
# Colors - use Nrm to reset to normal text.
|
|
||||||
SET Esc CHAR(27)
|
|
||||||
|
|
||||||
SET Nrm Esc + "[0m"
|
|
||||||
SET Blk Esc + "[0;30m"
|
|
||||||
SET Red Esc + "[0;31m"
|
|
||||||
SET Grn Esc + "[0;32m"
|
|
||||||
SET Ylw Esc + "[0;33m"
|
|
||||||
SET Blu Esc + "[0;34m"
|
|
||||||
SET Mag Esc + "[0;35m"
|
|
||||||
SET Cyn Esc + "[0;36m"
|
|
||||||
SET Wht Esc + "[0;37m"
|
|
||||||
SET Gry Esc + "[30;1m"
|
|
||||||
SET BrRed Esc + "[31;1m"
|
|
||||||
SET BrGrn Esc + "[32;1m"
|
|
||||||
SET BrYlw Esc + "[33;1m"
|
|
||||||
SET BrBlu Esc + "[34;1m"
|
|
||||||
SET BrMag Esc + "[35;1m"
|
|
||||||
SET BrCyn Esc + "[36;1m"
|
|
||||||
SET BrWht Esc + "[37;1m"
|
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
REM MSG A [Blu]blue[Nrm] reminder.
|
REM 1 SPECIAL COLOR 0 0 255 A blue reminder.
|
||||||
REM MSG [Red]%"A red reminder%" safe to use in the calendar mode.[Nrm]
|
REM 2 SPECIAL COLOR 255 0 0 %"A red reminder%" safe to use in the calendar mode.
|
||||||
|
|
||||||
# Here is an example of how to use msgprefix() and msgsuffix(). These
|
|
||||||
# will highlight priority-0 reminders in bright red,
|
|
||||||
# priority-2500 in red, and priority-7500 in blue. All others
|
|
||||||
# will be in the normal colors
|
|
||||||
FSET msgprefix(x) iif(x==0, BrRed, x==2500, Red, x==7500, Blu, Nrm)
|
|
||||||
|
|
||||||
# Don't forget to return to normal color set at the end of reminder!
|
|
||||||
FSET msgsuffix(x) Nrm
|
|
||||||
|
|
||||||
# The next examples are great for putting right at the end of the reminder
|
# The next examples are great for putting right at the end of the reminder
|
||||||
# file. They make queued reminders more eye-catching when they pop up.
|
# file. They make queued reminders more eye-catching when they pop up.
|
||||||
|
|||||||
17
man/rem2ps.1
17
man/rem2ps.1
@@ -12,6 +12,10 @@ emits PostScript code (which draws a calendar) to the standard output.
|
|||||||
See the section "Rem2PS Input Format" for details about the \fB\-p\fR
|
See the section "Rem2PS Input Format" for details about the \fB\-p\fR
|
||||||
data. This may be useful if you wish to create other \fBRemind\fR
|
data. This may be useful if you wish to create other \fBRemind\fR
|
||||||
back-ends.
|
back-ends.
|
||||||
|
.PP
|
||||||
|
Note that \fBRem2PS\fR does not handle UTF-8 input. If you need to
|
||||||
|
render characters outside the ASCII character set, see
|
||||||
|
\fBrem2pdf\fR instead.
|
||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
@@ -61,7 +65,9 @@ there is room and otherwise follows \fIn\fR=2 yields the same results as
|
|||||||
.TP
|
.TP
|
||||||
.B \-i
|
.B \-i
|
||||||
Use ISO 8859-1 standard encoding for the PostScript fonts. If you do
|
Use ISO 8859-1 standard encoding for the PostScript fonts. If you do
|
||||||
not use this option, the default encoding is used.
|
not use this option, the default encoding is used. If you use this option,
|
||||||
|
you probably also need to convert Remind's output (typically UTF-8)
|
||||||
|
to ISO-8859-1 using \fBiconv\fR(1).
|
||||||
.TP
|
.TP
|
||||||
.B \-e
|
.B \-e
|
||||||
Make the calendar fill the entire page. By default, the calendar is
|
Make the calendar fill the entire page. By default, the calendar is
|
||||||
@@ -340,6 +346,10 @@ month (0 = Sunday, 1 = Monday, 6 = Saturday.) And \fImonday_first\fR is
|
|||||||
1 if the \fB\-m\fR flag was supplied to \fBRemind\fR, or 0 if it was not.
|
1 if the \fB\-m\fR flag was supplied to \fBRemind\fR, or 0 if it was not.
|
||||||
All this information is supplied so back-ends don't need any date calculation
|
All this information is supplied so back-ends don't need any date calculation
|
||||||
facilities.
|
facilities.
|
||||||
|
|
||||||
|
Note that all spaces in \fImonth_name\fR will be replaced with
|
||||||
|
underscores. Back-ends should undo this replacement.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\fIsun mon tue wed thu fri sat\fR
|
\fIsun mon tue wed thu fri sat\fR
|
||||||
This line consists of
|
This line consists of
|
||||||
@@ -347,6 +357,9 @@ space-separated names of days in whatever language \fBRemind\fR was
|
|||||||
compiled for. This information can be used by back-ends to annotate
|
compiled for. This information can be used by back-ends to annotate
|
||||||
calendars, and means they don't have to be created for a specific
|
calendars, and means they don't have to be created for a specific
|
||||||
language.
|
language.
|
||||||
|
|
||||||
|
Note that all spaces in day names will be replaced with
|
||||||
|
underscores. Back-ends should undo this replacement.
|
||||||
.TP
|
.TP
|
||||||
\fInext_mon next_days\fR
|
\fInext_mon next_days\fR
|
||||||
The name of the next month and the number of days in it.
|
The name of the next month and the number of days in it.
|
||||||
@@ -662,4 +675,4 @@ You should ensure that the values you supply for margin widths are sensible.
|
|||||||
If they are too big for the media size, \fBRem2ps\fR will not complain,
|
If they are too big for the media size, \fBRem2ps\fR will not complain,
|
||||||
but again, the PostScript output will probably not work.
|
but again, the PostScript output will probably not work.
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
\fBremind\fR
|
\fBremind\fR, \fBrem2pdf\fR
|
||||||
|
|||||||
197
man/remind.1
197
man/remind.1
@@ -190,6 +190,11 @@ If you supply a number \fIn\fR after the \fB\-t\fR option, then
|
|||||||
\fBRemind\fR pretends that each non-expired reminder has a \fIdelta\fR
|
\fBRemind\fR pretends that each non-expired reminder has a \fIdelta\fR
|
||||||
of \fIn\fR days and triggers reminders accordingly.
|
of \fIn\fR days and triggers reminders accordingly.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-tt\fR[\fIn\fR]
|
||||||
|
The \fB-tt\fR option causes \fBRemind\fR to assume a default delta of
|
||||||
|
\fIn\fR minutes for all timed reminders. If \fB\-tt\fR is given with
|
||||||
|
no \fIn\fR, a default delta of 5 minutes is used.
|
||||||
|
.TP
|
||||||
.B \-h
|
.B \-h
|
||||||
The \fB\-h\fR option ("hush...") suppresses certain warning and information
|
The \fB\-h\fR option ("hush...") suppresses certain warning and information
|
||||||
messages. In particular, if no reminders are triggered, this mode
|
messages. In particular, if no reminders are triggered, this mode
|
||||||
@@ -1390,6 +1395,12 @@ the same as substitutions built up from the simpler %w, %y, etc.
|
|||||||
sequences.
|
sequences.
|
||||||
.TP
|
.TP
|
||||||
o
|
o
|
||||||
|
The a, c, e, f, g, h, i, j, k, l, u, v, 2, and 3 substitutions may
|
||||||
|
be preceded by an asterisk (for example, %*c) which causes the word
|
||||||
|
"at" or "on" that would normally be included in the output to be
|
||||||
|
omitted.
|
||||||
|
.TP
|
||||||
|
o
|
||||||
Any of the substitutions dealing with time (0 through 9 and '!')
|
Any of the substitutions dealing with time (0 through 9 and '!')
|
||||||
produce undefined results if used in a reminder that does not have
|
produce undefined results if used in a reminder that does not have
|
||||||
an \fBAT\fR keyword. Also, if a reminder has a \fIdelta\fR and may
|
an \fBAT\fR keyword. Also, if a reminder has a \fIdelta\fR and may
|
||||||
@@ -1546,7 +1557,7 @@ the first day of the month. The local \fBOMIT\fR keyword causes the
|
|||||||
Finally, the \fBAFTER\fR keyword will keep moving the reminder forward
|
Finally, the \fBAFTER\fR keyword will keep moving the reminder forward
|
||||||
until it has passed any holidays specified with global \fBOMIT\fR
|
until it has passed any holidays specified with global \fBOMIT\fR
|
||||||
commands.
|
commands.
|
||||||
.SH THE INCLUDE COMMAND
|
.SH THE DO AND INCLUDE COMMANDS
|
||||||
.PP
|
.PP
|
||||||
\fBRemind\fR allows you to include other files in your reminder script,
|
\fBRemind\fR allows you to include other files in your reminder script,
|
||||||
similar to the C preprocessor #include directive. For example, your
|
similar to the C preprocessor #include directive. For example, your
|
||||||
@@ -1570,7 +1581,32 @@ If you specify a \fIdirectory\fR as the argument to \fBINCLUDE\fR, then
|
|||||||
\fBRemind\fR will process all files in that directory that match the shell
|
\fBRemind\fR will process all files in that directory that match the shell
|
||||||
patterm "*.rem". The files are processed in sorted order; the sort order
|
patterm "*.rem". The files are processed in sorted order; the sort order
|
||||||
matches that used by the shell when it expands "*.rem".
|
matches that used by the shell when it expands "*.rem".
|
||||||
|
.PP
|
||||||
|
Note that the file specified by an \fBINCLUDE\fR command is interpreted
|
||||||
|
relative to the \fIcurrent working directory of the Remind process\fR.
|
||||||
|
If you want to include a file relative to the directory containing the
|
||||||
|
currently-processing file, use \fBDO\fR instead. For example,
|
||||||
|
if the current file is \fB/home/user/.reminders/foo.rem\fR and Remind's
|
||||||
|
working directory is \fB/home/user\fR, then:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
# Read /home/user/.reminders/bar.rem
|
||||||
|
DO bar.rem
|
||||||
|
|
||||||
|
# Read /usr/share/bar.rem - absolute path
|
||||||
|
DO /usr/share/bar.rem
|
||||||
|
|
||||||
|
# Read /home/user/bar.rem
|
||||||
|
INCLUDE bar.rem
|
||||||
|
|
||||||
|
# Read /usr/share/bar.rem - absolute path
|
||||||
|
INCLUDE /usr/share/bar.rem
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
Arguably, the \fBINCLUDE\fR command should have worked the way \fBDO\fR
|
||||||
|
does right from the start, but changing it would have broken
|
||||||
|
backward-compatibility, hence the introduction of \fBDO\fR.
|
||||||
|
.PP
|
||||||
.SH THE RUN COMMAND
|
.SH THE RUN COMMAND
|
||||||
.PP
|
.PP
|
||||||
If you include other files in your reminder script, you may not always
|
If you include other files in your reminder script, you may not always
|
||||||
@@ -2080,6 +2116,12 @@ blocks of reminders without having to type priorities for individual
|
|||||||
reminders. At startup, \fB$DefaultPrio\fR is set to 5000; it can range
|
reminders. At startup, \fB$DefaultPrio\fR is set to 5000; it can range
|
||||||
from 0 to 9999.
|
from 0 to 9999.
|
||||||
.TP
|
.TP
|
||||||
|
.B $DefaultTDelta
|
||||||
|
The default time delta used if no +N is given in an AT clause. This
|
||||||
|
is normally 0, but can be set with the \fB\-tt\fR option or explicitly
|
||||||
|
set in your script. If \fB$DefaultDelta\fR is non-zero, you can use an
|
||||||
|
explicit delta of +0 in an AT clause to countermand the default delta.
|
||||||
|
.TP
|
||||||
.B $DontFork (read-only)
|
.B $DontFork (read-only)
|
||||||
If non-zero, then the \fB\-c\fR option was supplied on the command line.
|
If non-zero, then the \fB\-c\fR option was supplied on the command line.
|
||||||
.TP
|
.TP
|
||||||
@@ -2156,11 +2198,35 @@ using twos-complement representation, this will be 2147483647.
|
|||||||
The smallest representable \fBINT\fR. On a machine with 32-bit signed integers
|
The smallest representable \fBINT\fR. On a machine with 32-bit signed integers
|
||||||
using twos-complement representation, this will be -2147483648.
|
using twos-complement representation, this will be -2147483648.
|
||||||
.TP
|
.TP
|
||||||
.B $LatDeg, $LatMin, $LatSec
|
.B $Latitude (STRING type)
|
||||||
|
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.
|
||||||
|
.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.
|
||||||
|
.RS
|
||||||
|
.PP
|
||||||
|
For example, the coordinates of the Statue of Liberty in New York City
|
||||||
|
are approximately set by:
|
||||||
|
.nf
|
||||||
|
SET $Latitude "40.68933"
|
||||||
|
SET $Longitude "-74.04454"
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
|
.B $LatDeg, $LatMin, $LatSec (DEPRECATED)
|
||||||
These specify the latitude of your location. \fB$LatDeg\fR can
|
These specify the latitude of your location. \fB$LatDeg\fR can
|
||||||
range from \-90 to 90, and the others from \-59 to 59. Northern latitudes
|
range from \-90 to 90, and the others from \-59 to 59. Northern latitudes
|
||||||
are positive; southern ones are negative. For southern latitudes, all
|
are positive; southern ones are negative. For southern latitudes, all
|
||||||
three components should be negative.
|
three components should be negative. These three variables
|
||||||
|
are deprecated; you should use \fB$Latitude\fR instead.
|
||||||
.TP
|
.TP
|
||||||
.B $Location (STRING type)
|
.B $Location (STRING type)
|
||||||
This is a string specifying the name of your location. It is usually
|
This is a string specifying the name of your location. It is usually
|
||||||
@@ -2168,23 +2234,30 @@ the name of your town or city. It can be set to whatever you like,
|
|||||||
but good style indicates that it should be kept consistent with
|
but good style indicates that it should be kept consistent with
|
||||||
the latitude and longitude system variables.
|
the latitude and longitude system variables.
|
||||||
.TP
|
.TP
|
||||||
.B $LongDeg, $LongMin, $LongSec
|
.B $LongDeg, $LongMin, $LongSec (DEPRECATED)
|
||||||
These specify the longitude of your location. \fB$LongDeg\fR can
|
These specify the longitude of your location. \fB$LongDeg\fR can
|
||||||
range from \-180 to 180. Western longitudes are positive; eastern
|
range from \-180 to 180. Western longitudes are positive; eastern
|
||||||
ones are negative. Note that all three components should have the
|
ones are negative. Note that all three components should have the
|
||||||
same sign: All positive for Western longitudes and all negative for
|
same sign: All positive for western longitudes and all negative for
|
||||||
Eastern longitudes. Note that for historical reasons, the sign for
|
eastern longitudes. Note that for historical reasons, the sign for
|
||||||
longitude is \fIdifferent\fR from the usual convention! If you find
|
longitude is \fIdifferent\fR from the usual convention! If you find
|
||||||
the longitude of your location from a search engine, you will most
|
the longitude of your location from a search engine, you will most
|
||||||
likely \fIneed to invert the sign to have it work correctly with
|
likely \fIneed to invert the sign to have it work correctly with
|
||||||
Remind.\fR
|
Remind.\fR These three variables are deprecated; you should use
|
||||||
|
\fB$Longitude\fR instead. Note also that \fB$Longitude\fR uses the
|
||||||
|
standard convention of negative for western longitudes and positive
|
||||||
|
for eastern ones.
|
||||||
.RS
|
.RS
|
||||||
.PP
|
.PP
|
||||||
The latitude and longitude information is required for the functions
|
The latitude and longitude information is required for the functions
|
||||||
\fBsunrise()\fR and \fBsunset()\fR. Default values can be compiled
|
\fBsunrise()\fR and \fBsunset()\fR. Default values can be compiled
|
||||||
into \fBRemind\fR, or you can \fBSET\fR the correct values at the
|
into \fBRemind\fR, or you can \fBSET\fR the correct values at the
|
||||||
start of your reminder scripts.
|
start of your reminder scripts.
|
||||||
|
.PP
|
||||||
|
Note that setting any of \fB$LongDec\fR, \fB$LongMin\fR and \fB$LongSec\fR
|
||||||
|
updates \fB$Longitude\fR correspondingly, and setting \fB$Longitude\fR
|
||||||
|
updates \fB$LongDeg\fR, \fB$LongMin\fR and \fB$LongSec\fR. Similar
|
||||||
|
rules apply to \fB$Latitude\fR, \fB$LatDeg\fR, \fB$LatMin\fR and \fB$LatSec\fR.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B $MaxSatIter
|
.B $MaxSatIter
|
||||||
@@ -2193,7 +2266,9 @@ The maximum number of iterations for the \fBSATISFY\fR clause
|
|||||||
.TP
|
.TP
|
||||||
.B $MaxStringLen
|
.B $MaxStringLen
|
||||||
A limit on the longest string that \fBRemind\fR will allow you
|
A limit on the longest string that \fBRemind\fR will allow you
|
||||||
to create. The default is 65535.
|
to create. The default is 65535. If you set \fB$MaxStringLen\fR to 0
|
||||||
|
or to -1, then \fBremind\fR will allow you to create arbitrarily-long
|
||||||
|
strings, at least until it runs out of memory.
|
||||||
.TP
|
.TP
|
||||||
.B $MinsFromUTC
|
.B $MinsFromUTC
|
||||||
The number of minutes between Universal Time Coordinated and local time. If
|
The number of minutes between Universal Time Coordinated and local time. If
|
||||||
@@ -2588,7 +2663,9 @@ follows:
|
|||||||
.PP
|
.PP
|
||||||
.RS
|
.RS
|
||||||
This includes the file "stuff" in the same directory as the
|
This includes the file "stuff" in the same directory as the
|
||||||
current file being processed.
|
current file being processed. Note that this workaround is
|
||||||
|
no longer necessary because \fBDO stuff\fR will achieve the
|
||||||
|
same goal.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B filename()
|
.B filename()
|
||||||
@@ -2637,6 +2714,21 @@ The optional parameter \fIstart\fR specifies the position in
|
|||||||
\fIsearch\fR at which to start looking for \fItarget\fR.
|
\fIsearch\fR at which to start looking for \fItarget\fR.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
|
.B isany(arg1 [,arg2, ..., argN]);
|
||||||
|
Returns 1 if the first argument \fIarg1\fR is equal to any of the
|
||||||
|
subsequent arguments \fIarg2\fR through \fIargN\fR; returns 0 otherwise.
|
||||||
|
Also returns 0 if called with only one argument.
|
||||||
|
.RS
|
||||||
|
.PP
|
||||||
|
As an example, the following two expressions are equivalent:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
(a == b) || (a == c) || (a == d) || (a == e)
|
||||||
|
|
||||||
|
isany(a, b, c, d, e)
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
.B isdst([d_date [,t_time]]) \fRor\fB isdst(q_datetime)
|
.B isdst([d_date [,t_time]]) \fRor\fB isdst(q_datetime)
|
||||||
Returns a positive number if daylight saving time is in
|
Returns a positive number if daylight saving time is in
|
||||||
effect on the specified date and time. \fIDate\fR
|
effect on the specified date and time. \fIDate\fR
|
||||||
@@ -2660,7 +2752,7 @@ clauses are \fInot\fR taken into account by this function.
|
|||||||
.TP
|
.TP
|
||||||
.B language()
|
.B language()
|
||||||
Returns a \fBSTRING\fR naming the language supported by \fBRemind\fR.
|
Returns a \fBSTRING\fR naming the language supported by \fBRemind\fR.
|
||||||
(See "Foreign Language Support.") By default, \fBRemind\fR is compiled
|
(See "SUPPORT FOR OTHER LANGUAGES") By default, \fBRemind\fR is compiled
|
||||||
to support English messages, so this function returns "English". For
|
to support English messages, so this function returns "English". For
|
||||||
other languages, this function will return the English name of the
|
other languages, this function will return the English name of the
|
||||||
language (e.g. "German") Note that \fBlanguage()\fR is not available
|
language (e.g. "German") Note that \fBlanguage()\fR is not available
|
||||||
@@ -2931,8 +3023,8 @@ not be executed.
|
|||||||
.PP
|
.PP
|
||||||
If \fImaxlen\fR is specified, then \fBshell()\fR returns the first
|
If \fImaxlen\fR is specified, then \fBshell()\fR returns the first
|
||||||
\fImaxlen\fR characters of output (rather than the first 511). If
|
\fImaxlen\fR characters of output (rather than the first 511). If
|
||||||
\fImaxlen\fR is specified as a negative number, then \fIall\fR the
|
\fImaxlen\fR is specified as a negative number, then it defaults to
|
||||||
output from \fIcmd\fR is returned.
|
the value of the system variable \fB$MaxStringLen\fR.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B shellescape(s_str)
|
.B shellescape(s_str)
|
||||||
@@ -2978,7 +3070,8 @@ takes \fIa\fR back to 2009-05-13.
|
|||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B strlen(s_str)
|
.B strlen(s_str)
|
||||||
Returns the length of \fIstr\fR.
|
Returns the length of \fIstr\fR. If the length of \fIstr\fR is too large
|
||||||
|
to represent as an integers, emits a "Number too high" error.
|
||||||
.TP
|
.TP
|
||||||
.B substr(s_str, i_start [,i_end])
|
.B substr(s_str, i_start [,i_end])
|
||||||
Returns a \fBSTRING\fR consisting of all characters in \fIstr\fR from
|
Returns a \fBSTRING\fR consisting of all characters in \fIstr\fR from
|
||||||
@@ -3104,18 +3197,17 @@ Returns (as a \fBDATE\fR type) the \fBFROM\fR parameter of the last \fBREM\fR or
|
|||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B trigger(d_date [,t_time [,i_utcflag]]) \fRor\fB trigger(q_datetime [,i_utcflag])
|
.B trigger(d_date [,t_time [,i_utcflag]]) \fRor\fB trigger(q_datetime [,i_utcflag])
|
||||||
Returns a string suitable for use in a \fBREM\fR command or a \fBSCANFROM\fR
|
Returns a string suitable for use in a \fBREM\fR command or a
|
||||||
or UNTIL clause, allowing you to calculate trigger dates in advance.
|
\fBSCANFROM\fR or UNTIL clause, allowing you to calculate trigger
|
||||||
Note that in earlier versions of \fBRemind\fR, \fBtrigger\fR was
|
dates in advance. Note that in earlier versions of \fBRemind\fR,
|
||||||
required to convert a date into something the \fBREM\fR command could
|
\fBtrigger\fR was required to convert a date into something the
|
||||||
consume. However, in this version of \fBRemind\fR, you can omit it.
|
\fBREM\fR command could consume. However, in this version of
|
||||||
Note that \fBtrigger()\fR \fIalways\fR returns its result in English,
|
\fBRemind\fR, you can omit it. Note that \fBtrigger()\fR \fIalways\fR
|
||||||
even for foreign-language versions of \fBRemind\fR. This is to avoid
|
returns its result in English, even for non-English versions of
|
||||||
problems with certain C libraries that do not handle accented
|
\fBRemind\fR. Normally, the \fIdate\fR and \fItime\fR are the local
|
||||||
characters properly. Normally, the \fIdate\fR and \fItime\fR are the
|
date and time; however, if \fIutcflag\fR is non-zero, the \fIdate\fR
|
||||||
local date and time; however, if \fIutcflag\fR is non-zero, the
|
and \fItime\fR are interpreted as UTC times, and are converted to
|
||||||
\fIdate\fR and \fItime\fR are interpreted as UTC times, and are
|
local time. Examples:
|
||||||
converted to local time. Examples:
|
|
||||||
.RS
|
.RS
|
||||||
.PP
|
.PP
|
||||||
trigger('1993/04/01')
|
trigger('1993/04/01')
|
||||||
@@ -3733,6 +3825,14 @@ We could also have written:
|
|||||||
but this would result in more iterations, since "Fridays" occur more
|
but this would result in more iterations, since "Fridays" occur more
|
||||||
often than "13ths of the month."
|
often than "13ths of the month."
|
||||||
.PP
|
.PP
|
||||||
|
Here is another example: Suppose you want to be reminded of something
|
||||||
|
on the 15th of January, April, July, and October. You could make
|
||||||
|
four separate reminders, or you could use:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
REM 15 SATISFY [isany($Tm, 1, 4, 7, 10)] MSG 15th Reminder!
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
This technique of using one \fBREM\fR command to calculate a trigger date
|
This technique of using one \fBREM\fR command to calculate a trigger date
|
||||||
to be used by another command is quite powerful. For example, suppose
|
to be used by another command is quite powerful. For example, suppose
|
||||||
you wanted to OMIT Labour day, which is the first Monday in September. You
|
you wanted to OMIT Labour day, which is the first Monday in September. You
|
||||||
@@ -4356,23 +4456,42 @@ error messages. For an example of this, define the following:
|
|||||||
fset msgprefix(x) x/0
|
fset msgprefix(x) x/0
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
.SH FOREIGN LANGUAGE SUPPORT
|
.SH SUPPORT FOR OTHER LANGUAGES
|
||||||
.PP
|
.PP
|
||||||
Your version of \fBRemind\fR may have been compiled to support a
|
Your version of \fBRemind\fR may have been compiled to support a
|
||||||
language other than English. This support may or may not be complete -
|
language other than English. This support may or may not be complete -
|
||||||
for example, all error and usage messages may still be in English.
|
for example, all error and usage messages may still be in English.
|
||||||
However, at a minimum, foreign-language versions of \fBRemind\fR will
|
However, at a minimum, non-English versions of \fBRemind\fR will
|
||||||
output names of months and weekdays in the foreign language. Also,
|
output names of months and weekdays in the selected language. Also,
|
||||||
the substitution mechanism will substitute constructs suitable for the
|
the substitution mechanism will substitute constructs suitable for the
|
||||||
foreign language rather than for English.
|
selected language rather than for English.
|
||||||
.PP
|
.PP
|
||||||
A foreign-language version of \fBRemind\fR will accept either the English
|
Note that a non-English version of \fBRemind\fR will accept \fIonly\fR
|
||||||
or foreign-language names of weekdays and months in a reminder script.
|
English names of weekdays and months in a reminder script.
|
||||||
However, for compatibility between versions of \fBRemind\fR, you should
|
.PP
|
||||||
use only the English names in your scripts. Also, if your C compiler or
|
If there is no support for your particular language, you can set
|
||||||
run-time libraries are not "8-bit clean" or don't understand the ISO-Latin
|
\fBRemind\fR system variables so that calendars are printed using
|
||||||
character set, month or day names with accented letters may not be
|
your language's day and month names. The system variables that you
|
||||||
recognized.
|
can set are:
|
||||||
|
.PP
|
||||||
|
.TP
|
||||||
|
.B $Monday, $Tuesday, $Wednesday, $Thursday, $Friday, $Saturday
|
||||||
|
Set each of these system variables to a string representing the corresponding
|
||||||
|
day's name in your language. Strings must be valid UTF-8 strings.
|
||||||
|
.TP
|
||||||
|
.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.
|
||||||
|
.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.
|
||||||
|
.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
|
.PP
|
||||||
.SH THE HEBREW CALENDAR
|
.SH THE HEBREW CALENDAR
|
||||||
.PP
|
.PP
|
||||||
@@ -4862,7 +4981,7 @@ was copied largely unmodified from "moontool" by John Walker. The
|
|||||||
sunrise and sunset functions use ideas from programs by Michael
|
sunrise and sunset functions use ideas from programs by Michael
|
||||||
Schwartz and Marc T. Kaufman. The Hebrew calendar support was taken
|
Schwartz and Marc T. Kaufman. The Hebrew calendar support was taken
|
||||||
from "hdate" by Amos Shapir. OS/2 support was done by Darrel
|
from "hdate" by Amos Shapir. OS/2 support was done by Darrel
|
||||||
Hankerson, Russ Herman, and Norman Walsh. The supported foreign
|
Hankerson, Russ Herman, and Norman Walsh. The supported
|
||||||
languages and their translators are listed below. Languages marked
|
languages and their translators are listed below. Languages marked
|
||||||
"complete" support error messages and usage instructions in that
|
"complete" support error messages and usage instructions in that
|
||||||
language; all others only support the substitution filter mechanism
|
language; all others only support the substitution filter mechanism
|
||||||
@@ -4931,4 +5050,4 @@ Catalog\fR, Jewish Publication Society of America.
|
|||||||
.PP
|
.PP
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.PP
|
.PP
|
||||||
rem, rem2ps, tkremind
|
\fBrem\fR(1), \fBrem2ps\fR(1), \fBrem2pdf\fR(1), \fBtkremind\fR(1)
|
||||||
|
|||||||
@@ -115,6 +115,8 @@ edit the reminder, thereby gaining access to advanced features of
|
|||||||
To print the current month's calendar, click \fBPrint...\fR on the
|
To print the current month's calendar, click \fBPrint...\fR on the
|
||||||
main calendar window. This brings up the print dialog. Printing
|
main calendar window. This brings up the print dialog. Printing
|
||||||
either produces a PostScript file or sends PostScript to a UNIX command.
|
either produces a PostScript file or sends PostScript to a UNIX command.
|
||||||
|
(If you have \fBrem2pdf\fR installed, you can choose to produce
|
||||||
|
PDF output rather than PostScript.)
|
||||||
|
|
||||||
Select the print destination by choosing either \fBTo file:\fR or
|
Select the print destination by choosing either \fBTo file:\fR or
|
||||||
\fBTo command:\fR in the print dialog. Press \fBBrowse...\fR to bring
|
\fBTo command:\fR in the print dialog. Press \fBBrowse...\fR to bring
|
||||||
@@ -131,12 +133,13 @@ the directory.
|
|||||||
Select the appropriate paper size and orientation. Activate
|
Select the appropriate paper size and orientation. Activate
|
||||||
\fBFill page\fR if you want the calendar to fill the page. This should
|
\fBFill page\fR if you want the calendar to fill the page. This should
|
||||||
be the normal case unless you have many reminders in a particular
|
be the normal case unless you have many reminders in a particular
|
||||||
day. (See the \fBRem2PS\fR documentation.)
|
day. (See the \fBRem2PS\fR or \fBrem2pdf\fR documentation.)
|
||||||
|
|
||||||
Finally, click \fBPrint\fR to print or \fBCancel\fR to cancel. Note
|
Finally, click \fBPrint\fR to print or \fBCancel\fR to cancel. Note
|
||||||
that during printing, \fBRemind\fR is called with the
|
that during printing, \fBRemind\fR is called with the
|
||||||
\fB-itkremind=1\fR option and also an additional \fB-itkprint=1\fR
|
\fB-itkremind=1\fR option and also an additional \fB-itkprint=1\fR
|
||||||
option.
|
option. If you are producing PDF output, then the option \fB-itkpdf=1\fR
|
||||||
|
is also supplied to \fBRemind\fR.
|
||||||
|
|
||||||
|
|
||||||
.SH EDITING REMINDERS
|
.SH EDITING REMINDERS
|
||||||
@@ -164,7 +167,11 @@ it with \fBTkRemind\fR.
|
|||||||
If you have set the "text editor" option correctly, right-clicking
|
If you have set the "text editor" option correctly, right-clicking
|
||||||
on a reminder will bring up a text editor on the file containing
|
on a reminder will bring up a text editor on the file containing
|
||||||
the reminder. The cursor will be positioned on the line that
|
the reminder. The cursor will be positioned on the line that
|
||||||
generated the reminder.
|
generated the reminder. In addition, if you have a reminder that
|
||||||
|
is editable with an editor but was not created using \fBTkRemind\fR,
|
||||||
|
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 BACKGROUND REMINDERS
|
.SH BACKGROUND REMINDERS
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ bindir=@bindir@
|
|||||||
datadir=@datadir@
|
datadir=@datadir@
|
||||||
datarootdir=@datarootdir@
|
datarootdir=@datarootdir@
|
||||||
PERL=@PERL@
|
PERL=@PERL@
|
||||||
PERLMODS_NEEDED=JSON::Any Getopt::Long
|
PERLMODS_NEEDED=JSON::MaybeXS Getopt::Long
|
||||||
all:
|
all:
|
||||||
true
|
true
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use JSON::Any;
|
use JSON::MaybeXS;
|
||||||
|
|
||||||
my %Options;
|
my %Options;
|
||||||
|
|
||||||
@@ -232,23 +232,30 @@ sub parse_input
|
|||||||
chomp($line);
|
chomp($line);
|
||||||
($Month, $Year, $Numdays, $Firstwkday, $Mondayfirst) = split(' ', $line);
|
($Month, $Year, $Numdays, $Firstwkday, $Mondayfirst) = split(' ', $line);
|
||||||
|
|
||||||
|
$Month =~ s/_/ /g;
|
||||||
# Day names
|
# Day names
|
||||||
$line = <STDIN>;
|
$line = <STDIN>;
|
||||||
return 0 unless $line;
|
return 0 unless $line;
|
||||||
chomp($line);
|
chomp($line);
|
||||||
@Daynames = split(' ', $line);
|
@Daynames = split(' ', $line);
|
||||||
|
|
||||||
|
for (my $i=0; $i<7; $i++) {
|
||||||
|
$Daynames[$i] =~ s/_/ /g;
|
||||||
|
}
|
||||||
|
|
||||||
# Prevmon prevlen
|
# Prevmon prevlen
|
||||||
$line = <STDIN>;
|
$line = <STDIN>;
|
||||||
return 0 unless $line;
|
return 0 unless $line;
|
||||||
chomp($line);
|
chomp($line);
|
||||||
($Prevmon, $Prevlen) = split(' ', $line);
|
($Prevmon, $Prevlen) = split(' ', $line);
|
||||||
|
$Prevmon =~ s/_/ /g;
|
||||||
|
|
||||||
# Nextmon nextlen
|
# Nextmon nextlen
|
||||||
$line = <STDIN>;
|
$line = <STDIN>;
|
||||||
return 0 unless $line;
|
return 0 unless $line;
|
||||||
chomp($line);
|
chomp($line);
|
||||||
($Nextmon, $Nextlen) = split(' ', $line);
|
($Nextmon, $Nextlen) = split(' ', $line);
|
||||||
|
$Nextmon =~ s/_/ /g;
|
||||||
|
|
||||||
$found_data = 1;
|
$found_data = 1;
|
||||||
my $class;
|
my $class;
|
||||||
@@ -266,7 +273,7 @@ sub parse_input
|
|||||||
($y, $m, $d, $special, $tag, $duration, $time, $body) =
|
($y, $m, $d, $special, $tag, $duration, $time, $body) =
|
||||||
($1, $2, $3, $4, $5, $6, $7, $8);
|
($1, $2, $3, $4, $5, $6, $7, $8);
|
||||||
} elsif (/\{/) {
|
} elsif (/\{/) {
|
||||||
my $obj = JSON::Any->jsonToObj($_);
|
my $obj = decode_json($_);
|
||||||
next unless ($obj->{date} =~ /^(\d+)-(\d+)-(\d+)$/);
|
next unless ($obj->{date} =~ /^(\d+)-(\d+)-(\d+)$/);
|
||||||
$y = $1;
|
$y = $1;
|
||||||
$m = $2;
|
$m = $2;
|
||||||
@@ -419,6 +426,14 @@ sub output_calendar
|
|||||||
# Last column
|
# Last column
|
||||||
my $last_col = ($first_col + $Numdays - 1) % 7;
|
my $last_col = ($first_col + $Numdays - 1) % 7;
|
||||||
|
|
||||||
|
# Figure out how many rows
|
||||||
|
my $number_of_rows = int(($first_col + $Numdays ) / 7 + 0.999);
|
||||||
|
|
||||||
|
# Add a row for small calendars if necessary
|
||||||
|
if ($first_col == 0 && $last_col == 6) {
|
||||||
|
$number_of_rows++;
|
||||||
|
}
|
||||||
|
|
||||||
# Start the table
|
# Start the table
|
||||||
my $class;
|
my $class;
|
||||||
if ($Options{nostyle}) {
|
if ($Options{nostyle}) {
|
||||||
@@ -448,7 +463,7 @@ sub output_calendar
|
|||||||
if ($Options{nostyle}) {
|
if ($Options{nostyle}) {
|
||||||
print "<tr>\n";
|
print "<tr>\n";
|
||||||
} else {
|
} else {
|
||||||
print "<tr class=\"rem-cal-row\">\n";
|
print "<tr class=\"rem-cal-row rem-cal-row-$number_of_rows-rows\">\n";
|
||||||
}
|
}
|
||||||
if ($first_col > 0) {
|
if ($first_col > 0) {
|
||||||
small_calendar($Prevmon, $Prevlen, $Options{backurl},
|
small_calendar($Prevmon, $Prevlen, $Options{backurl},
|
||||||
@@ -464,7 +479,7 @@ sub output_calendar
|
|||||||
if ($Options{nostyle}) {
|
if ($Options{nostyle}) {
|
||||||
$class = ' width="14%"';
|
$class = ' width="14%"';
|
||||||
} else {
|
} else {
|
||||||
$class = ' class="rem-empty"';
|
$class = ' class="rem-empty rem-empty-$number_of_rows-rows"';
|
||||||
}
|
}
|
||||||
while ($col < $first_col) {
|
while ($col < $first_col) {
|
||||||
print("<td$class> </td>\n");
|
print("<td$class> </td>\n");
|
||||||
@@ -472,7 +487,7 @@ sub output_calendar
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (my $day=1; $day<=$Numdays; $day++) {
|
for (my $day=1; $day<=$Numdays; $day++) {
|
||||||
draw_day_cell($day);
|
draw_day_cell($day, $number_of_rows);
|
||||||
$col++;
|
$col++;
|
||||||
if ($col == 7) {
|
if ($col == 7) {
|
||||||
$col = 0;
|
$col = 0;
|
||||||
@@ -481,7 +496,7 @@ sub output_calendar
|
|||||||
if ($Options{nostyle}) {
|
if ($Options{nostyle}) {
|
||||||
print "<tr>\n";
|
print "<tr>\n";
|
||||||
} else {
|
} else {
|
||||||
print "<tr class=\"rem-cal-row\">\n";
|
print "<tr class=\"rem-cal-row rem-cal-row-$number_of_rows-rows\">\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -512,7 +527,7 @@ sub output_calendar
|
|||||||
if ($Options{nostyle}) {
|
if ($Options{nostyle}) {
|
||||||
print "<tr>\n";
|
print "<tr>\n";
|
||||||
} else {
|
} else {
|
||||||
print "<tr class=\"rem-cal-row\">\n";
|
print "<tr class=\"rem-cal-row rem-cal-row-$number_of_rows-rows\">\n";
|
||||||
}
|
}
|
||||||
small_calendar($Prevmon, $Prevlen, $Options{backurl},
|
small_calendar($Prevmon, $Prevlen, $Options{backurl},
|
||||||
($Firstwkday - $Prevlen + 35) % 7);
|
($Firstwkday - $Prevlen + 35) % 7);
|
||||||
@@ -529,7 +544,7 @@ sub output_calendar
|
|||||||
|
|
||||||
sub draw_day_cell
|
sub draw_day_cell
|
||||||
{
|
{
|
||||||
my($day) = @_;
|
my($day, $number_of_rows) = @_;
|
||||||
my $shade = $shades->[$day];
|
my $shade = $shades->[$day];
|
||||||
my $week = '';
|
my $week = '';
|
||||||
if (exists($weeks->{$day})) {
|
if (exists($weeks->{$day})) {
|
||||||
@@ -539,7 +554,7 @@ sub draw_day_cell
|
|||||||
if ($Options{nostyle}) {
|
if ($Options{nostyle}) {
|
||||||
$class = $classes->[$day] || '';
|
$class = $classes->[$day] || '';
|
||||||
} else {
|
} else {
|
||||||
$class = $classes->[$day] || "rem-cell";
|
$class = $classes->[$day] || "rem-cell rem-cell-$number_of_rows-rows";
|
||||||
}
|
}
|
||||||
if ($shade) {
|
if ($shade) {
|
||||||
$shade = " style=\"background: $shade;\"";
|
$shade = " style=\"background: $shade;\"";
|
||||||
|
|||||||
12
rem2pdf/Makefile.PL.in
Normal file
12
rem2pdf/Makefile.PL.in
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
use ExtUtils::MakeMaker;
|
||||||
|
WriteMakefile(
|
||||||
|
NAME => 'Remind::PDF',
|
||||||
|
AUTHOR => q{Dianne Skoll <dianne@skoll.ca>},
|
||||||
|
VERSION => '@VERSION@',
|
||||||
|
PREREQ_PM => {
|
||||||
|
'Getopt::Long' => 0,
|
||||||
|
'Cairo' => 0,
|
||||||
|
'Pango' => 0,
|
||||||
|
},
|
||||||
|
EXE_FILES => [ 'bin/rem2pdf' ]
|
||||||
|
);
|
||||||
40
rem2pdf/Makefile.top.in
Normal file
40
rem2pdf/Makefile.top.in
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Set by configure - don't touch.
|
||||||
|
srcdir=@srcdir@
|
||||||
|
prefix=@prefix@
|
||||||
|
exec_prefix=@exec_prefix@
|
||||||
|
mandir=@mandir@
|
||||||
|
bindir=@bindir@
|
||||||
|
datadir=@datadir@
|
||||||
|
datarootdir=@datarootdir@
|
||||||
|
PERL=@PERL@
|
||||||
|
PERLMODS_NEEDED=Getopt::Long Cairo Pango
|
||||||
|
|
||||||
|
all: Makefile
|
||||||
|
@if test "$(PERL)" = "" ; then \
|
||||||
|
echo "Not building rem2pdf; Perl is required"; exit 0; fi; \
|
||||||
|
for m in $(PERLMODS_NEEDED) ; \
|
||||||
|
do \
|
||||||
|
$(PERL) -M$$m -e 1 > /dev/null 2>&1; \
|
||||||
|
if test $$? != 0 ; then echo "Not building rem2pdf; missing $$m"; exit 0; fi; \
|
||||||
|
done; \
|
||||||
|
$(MAKE) all && exit 0; \
|
||||||
|
exit 1;
|
||||||
|
|
||||||
|
install:
|
||||||
|
@if test "$(PERL)" = "" ; then \
|
||||||
|
echo "Not installing rem2pdf; Perl is required"; exit 0; fi; \
|
||||||
|
for m in $(PERLMODS_NEEDED) ; \
|
||||||
|
do \
|
||||||
|
$(PERL) -M$$m -e 1 > /dev/null 2>&1; \
|
||||||
|
if test $$? != 0 ; then echo "Not installing rem2pdf; missing $$m"; exit 0; fi; \
|
||||||
|
done; \
|
||||||
|
echo "Installing rem2pdf"; \
|
||||||
|
if test "$(prefix)" = "/usr" ; then \
|
||||||
|
$(MAKE) install DESTDIR=$(DESTDIR) INSTALLDIRS=vendor && exit 0; \
|
||||||
|
else \
|
||||||
|
$(MAKE) install DESTDIR=$(DESTDIR) && exit 0; \
|
||||||
|
fi; \
|
||||||
|
exit 1;
|
||||||
|
|
||||||
|
Makefile: Makefile.PL
|
||||||
|
$(PERL) Makefile.PL || true
|
||||||
22
rem2pdf/README
Normal file
22
rem2pdf/README
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
rem2pdf is a Perl program that takes the output of "remind -p" and
|
||||||
|
produces a PDF calendar. See "man rem2pdf" for details.
|
||||||
|
|
||||||
|
rem2pdf has the following Perl modules as prerequisites:
|
||||||
|
|
||||||
|
Pango - https://metacpan.org/pod/Pango
|
||||||
|
Cairo - https://metacpan.org/pod/Cairo
|
||||||
|
|
||||||
|
On Debian or Debian-derived systems, these can be installed with:
|
||||||
|
|
||||||
|
apt install libpango-perl libcairo-perl
|
||||||
|
|
||||||
|
On Red Hat or Red Hat-derived systems, you need to install the perl-Pango
|
||||||
|
and perl-Cairo RPMs, which may require adding other repos to your list of
|
||||||
|
RPM sources.
|
||||||
|
|
||||||
|
rem2pdf is built and installed in the usual Perl program way:
|
||||||
|
|
||||||
|
perl Makefile.PL && make && sudo make install
|
||||||
|
|
||||||
|
--
|
||||||
|
Dianne Skoll - <dianne@skoll.ca>
|
||||||
507
rem2pdf/bin/rem2pdf.in
Normal file
507
rem2pdf/bin/rem2pdf.in
Normal file
@@ -0,0 +1,507 @@
|
|||||||
|
#!@PERL@
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use Encode;
|
||||||
|
use Cairo;
|
||||||
|
use Pango;
|
||||||
|
use Getopt::Long;
|
||||||
|
|
||||||
|
my $VERSION = '@VERSION@';
|
||||||
|
|
||||||
|
use Remind::PDF;
|
||||||
|
|
||||||
|
my $media_to_size = {
|
||||||
|
"Letter" => [ 612, 792],
|
||||||
|
"Tabloid" => [ 792, 1224],
|
||||||
|
"Ledger" => [1224, 792],
|
||||||
|
"Legal" => [ 612, 1008],
|
||||||
|
"Statement" => [ 396, 612],
|
||||||
|
"Executive" => [ 540, 720],
|
||||||
|
"A3" => [ 842, 1190],
|
||||||
|
"A4" => [ 595, 842],
|
||||||
|
"A5" => [ 420, 595],
|
||||||
|
"B4" => [ 729, 1032],
|
||||||
|
"B5" => [ 519, 729],
|
||||||
|
"Folio" => [ 612, 936],
|
||||||
|
"Quarto" => [ 612, 780],
|
||||||
|
"10x14" => [ 720, 1008],
|
||||||
|
};
|
||||||
|
|
||||||
|
my $help = 0;
|
||||||
|
|
||||||
|
my $settings = {
|
||||||
|
landscape => 0,
|
||||||
|
numbers_on_left => 0,
|
||||||
|
small_calendars => 0,
|
||||||
|
fill_entire_page => 0,
|
||||||
|
|
||||||
|
media => 'Letter',
|
||||||
|
width => 0,
|
||||||
|
height => 0,
|
||||||
|
|
||||||
|
title_font => 'Sans',
|
||||||
|
header_font => 'Sans',
|
||||||
|
daynum_font => 'Sans Bold Oblique',
|
||||||
|
entry_font => 'Sans',
|
||||||
|
small_cal_font => 'Sans',
|
||||||
|
|
||||||
|
title_size => 14,
|
||||||
|
header_size => 14,
|
||||||
|
daynum_size => 14,
|
||||||
|
entry_size => 8,
|
||||||
|
|
||||||
|
border_size => 4,
|
||||||
|
line_thickness => 1,
|
||||||
|
|
||||||
|
margin_top => 36,
|
||||||
|
margin_bottom => 36,
|
||||||
|
margin_left => 36,
|
||||||
|
margin_right => 36,
|
||||||
|
|
||||||
|
verbose => 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
my $me = $0;
|
||||||
|
$me =~ s/^.*\///;
|
||||||
|
|
||||||
|
set_default_media();
|
||||||
|
|
||||||
|
sub usage
|
||||||
|
{
|
||||||
|
print <<"EOF";
|
||||||
|
$me (version $VERSION): Convert Remind -pp output to a PDF calendar.
|
||||||
|
|
||||||
|
Usage: remind -pp [options] filename | $me [options] > out.pdf
|
||||||
|
|
||||||
|
Options:
|
||||||
|
|
||||||
|
--landscape, -l Print in landscape orientation
|
||||||
|
--small-calendars=N Choose location for small calendars
|
||||||
|
-cN Synonym for --small-calendars=N
|
||||||
|
--left-numbers, -x Print day numbers on the left
|
||||||
|
--fill-page, -e Fill the entire page
|
||||||
|
--media=MEDIA, -mMEDIA Size for specified media
|
||||||
|
--width=W, -wW Specify media width in 1/72nds of an inch
|
||||||
|
--height=H, -hH Specify media height in 1/72nds of an inch
|
||||||
|
--title-font=FONT Specify font for calendar title
|
||||||
|
--header-font=FONT Specify font for weekday names
|
||||||
|
--daynum-font=FONT Specify font for day numbers
|
||||||
|
--entry-font=FONT Specify font for calendar entries
|
||||||
|
--small-cal-font=FONT Specify font for small calendars
|
||||||
|
--title-size=S Specify size of font for calendar title in points
|
||||||
|
--header-size=S Specify size of font for weekday names
|
||||||
|
--daynum-size=S Specify size of font for day numbers
|
||||||
|
--entry-size=S Specify size of font for calendar entries
|
||||||
|
--border-size=S Specify size of gaps between items in 1/72nds of an inch
|
||||||
|
--line-thickness=S Specify line thickness in 1/72nds of an inch
|
||||||
|
--margin-top=S Specify top margin size in 1/72nds of an inch
|
||||||
|
--margin-bottom=S Specify bottom margin size in 1/72nds of an inch
|
||||||
|
--margin-left=S Specify left margin size in 1/72nds of an inch
|
||||||
|
--margin-right=S Specify right margin size in 1/72nds of an inch
|
||||||
|
--verbose, -v Print progress messages
|
||||||
|
--help Display this help
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
Getopt::Long::Configure('bundling_values');
|
||||||
|
|
||||||
|
my $ret = GetOptions('landscape|l' => \$settings->{landscape},
|
||||||
|
'small-calendars|c=i' => \$settings->{small_calendars},
|
||||||
|
'left-numbers|x' => \$settings->{numbers_on_left},
|
||||||
|
'fill-page|e' => \$settings->{fill_entire_page},
|
||||||
|
'media|m=s' => \$settings->{media},
|
||||||
|
'width|w=i' => \$settings->{width},
|
||||||
|
'height|h=i' => \$settings->{height},
|
||||||
|
'title-font=s' => \$settings->{title_font},
|
||||||
|
'header-font=s' => \$settings->{header_font},
|
||||||
|
'daynum-font=s' => \$settings->{daynum_font},
|
||||||
|
'entry-font=s' => \$settings->{entry_font},
|
||||||
|
'small-cal-font=s' => \$settings->{small_cal_font},
|
||||||
|
'title-size=f' => \$settings->{title_size},
|
||||||
|
'header-size=f' => \$settings->{header_size},
|
||||||
|
'daynum-size=f' => \$settings->{daynum_size},
|
||||||
|
'entry-size=f' => \$settings->{entry_size},
|
||||||
|
'border-size=f' => \$settings->{border_size},
|
||||||
|
'line-thickness=f' => \$settings->{line_thickness},
|
||||||
|
'margin-top=f' => \$settings->{margin_top},
|
||||||
|
'margin-bottom=f' => \$settings->{margin_bottom},
|
||||||
|
'margin-left=f' => \$settings->{margin_left},
|
||||||
|
'margin-right=f' => \$settings->{margin_right},
|
||||||
|
'verbose|v' => \$settings->{verbose},
|
||||||
|
'help' => \$help
|
||||||
|
);
|
||||||
|
if (!$ret) {
|
||||||
|
usage();
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($help) {
|
||||||
|
usage();
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($settings->{width} <= 0 ||
|
||||||
|
$settings->{height} <= 0) {
|
||||||
|
my $size = $media_to_size->{ucfirst($settings->{media})};
|
||||||
|
if (!$size) {
|
||||||
|
if (lc($settings->{media}) ne 'help') {
|
||||||
|
print STDERR "Unknown media " . $settings->{media} . "\n";
|
||||||
|
}
|
||||||
|
set_default_media();
|
||||||
|
printf("%-12s Size in 1/72 in\n", "Valid media:");
|
||||||
|
foreach my $m (sort { $a cmp $b } (keys(%$media_to_size))) {
|
||||||
|
if ($m eq $settings->{media}) {
|
||||||
|
print "* ";
|
||||||
|
} else {
|
||||||
|
print " ";
|
||||||
|
}
|
||||||
|
printf("%-12s %4d x %4d\n", $m,
|
||||||
|
$media_to_size->{$m}->[0],
|
||||||
|
$media_to_size->{$m}->[1]);
|
||||||
|
}
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
$settings->{width} = $size->[0];
|
||||||
|
$settings->{height} = $size->[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($settings->{landscape}) {
|
||||||
|
my $tmp = $settings->{width};
|
||||||
|
$settings->{width} = $settings->{height};
|
||||||
|
$settings->{height} = $tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Don't read from a terminal
|
||||||
|
if (-t STDIN) {
|
||||||
|
print STDERR "I can't read data from a terminal. Please run like this:\n";
|
||||||
|
print STDERR " remind -pp [options] filename | $me [options] > out.pdf\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
my $done_one = 0;
|
||||||
|
|
||||||
|
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');
|
||||||
|
|
||||||
|
my $cr = Cairo::Context->create($surface);
|
||||||
|
$cr->set_line_width($settings->{line_thickness});
|
||||||
|
|
||||||
|
while(1) {
|
||||||
|
my ($obj, $err) = Remind::PDF->create_from_stream(*STDIN,
|
||||||
|
{color => 1,
|
||||||
|
shade => 1,
|
||||||
|
moon => 1,
|
||||||
|
pango => 1,
|
||||||
|
week => 1,});
|
||||||
|
|
||||||
|
if (!$obj) {
|
||||||
|
if (!$done_one) {
|
||||||
|
$errored_out = 1;
|
||||||
|
print STDERR "$me: $err\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
$done_one = 1;
|
||||||
|
$obj->render($cr, $settings);
|
||||||
|
}
|
||||||
|
|
||||||
|
$surface->finish();
|
||||||
|
|
||||||
|
sub set_default_media
|
||||||
|
{
|
||||||
|
my $paper;
|
||||||
|
$paper = $ENV{PAPERSIZE};
|
||||||
|
if ($paper && set_media(ucfirst($paper))) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if ($ENV{PAPERCONF}) {
|
||||||
|
if (set_media_from_file($ENV{PAPERCONF})) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (set_media_from_file('/etc/papersize')) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return set_media('Letter');
|
||||||
|
}
|
||||||
|
|
||||||
|
sub set_media
|
||||||
|
{
|
||||||
|
my ($m) = @_;
|
||||||
|
|
||||||
|
return 0 unless $media_to_size->{$m};
|
||||||
|
$settings->{media} = $m;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub set_media_from_file
|
||||||
|
{
|
||||||
|
my ($fn) = @_;
|
||||||
|
if (!open(IN, '<', $fn)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
while(<IN>) {
|
||||||
|
chomp;
|
||||||
|
s/^\s+//;
|
||||||
|
s/\s+$//;
|
||||||
|
next if ($_ eq '');
|
||||||
|
next if ($_ =~ /^#/);
|
||||||
|
my $m = $_;
|
||||||
|
close(IN);
|
||||||
|
return set_media($m);
|
||||||
|
}
|
||||||
|
close(IN);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
__END__
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
rem2pdf - draw a PDF calendar from Remind output
|
||||||
|
|
||||||
|
=head1 SYNOPSIS
|
||||||
|
|
||||||
|
remind -pp [options] file | rem2pdf [options] > output.pdf
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
B<rem2pdf> reads the standard input, which should be the results of
|
||||||
|
running B<remind> with the B<-p>, B<-pp> or B<-ppp> options. It emits
|
||||||
|
PDF code that draws a calendar to standard output.
|
||||||
|
|
||||||
|
B<rem2pdf> uses the Pango text formatting library (L<https://pango.gnome.org/>)
|
||||||
|
and the Cairo graphics library (L<https://www.cairographics.org/>) to produce
|
||||||
|
its output. The CPAN modules Pango (L<https://metacpan.org/pod/Pango>)
|
||||||
|
and Cairo (L<https://metacpan.org/pod/Cairo>) are prerequisites.
|
||||||
|
|
||||||
|
B<rem2pdf> assumes that its input stream is valid UTF-8. If this is not
|
||||||
|
the case, it may render output incorrectly or even fail to render
|
||||||
|
output at all.
|
||||||
|
|
||||||
|
=head1 OPTIONS
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item --landscape, -l
|
||||||
|
|
||||||
|
Print the calendar in landscape orientation. Essentially, this swaps
|
||||||
|
the width and height of the output media.
|
||||||
|
|
||||||
|
=item --small-calendars=I<n>, -cI<n>
|
||||||
|
|
||||||
|
Control the inclusion of small calendars for the previous and next
|
||||||
|
month. Possible values for I<n> are:
|
||||||
|
|
||||||
|
=over
|
||||||
|
|
||||||
|
=item Z<>0
|
||||||
|
|
||||||
|
Do not draw any small calendares
|
||||||
|
|
||||||
|
=item Z<>1
|
||||||
|
|
||||||
|
Place the small calendars at the bottom-right if there is room;
|
||||||
|
otherwise, place them at the top-left.
|
||||||
|
|
||||||
|
=item Z<>2
|
||||||
|
|
||||||
|
Place the small calendars at the top-left if there is room; otherwise,
|
||||||
|
place them at the bottom-right.
|
||||||
|
|
||||||
|
=item Z<>3
|
||||||
|
|
||||||
|
Place the previous month's small calendar at the top-left and the next
|
||||||
|
month's at the bottom-right if there is room; otherwise, follow
|
||||||
|
I<n>=1. A moment's thought reveals that an option which splits the
|
||||||
|
calendars if there is room and otherwise follows I<n>=2 yields the
|
||||||
|
same results.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=item --left-numbers, -x
|
||||||
|
|
||||||
|
Draw the day numbers in the top-left corner of each day's box rather than
|
||||||
|
the default top-right.
|
||||||
|
|
||||||
|
=item --fill-page, -e
|
||||||
|
|
||||||
|
Make the calendar fill the available space on the page.
|
||||||
|
|
||||||
|
=item --media=I<media>, -mI<media>
|
||||||
|
|
||||||
|
Specify the paper size (Letter, A4, etc.) For a list of valid media sizes,
|
||||||
|
run:
|
||||||
|
|
||||||
|
rem2pdf --media=help
|
||||||
|
|
||||||
|
The default media size will be marked with an asterisk.
|
||||||
|
|
||||||
|
=item --width=I<n>, -wI<n>, --height=I<m>, -hI<m>
|
||||||
|
|
||||||
|
Rather than specifying a named media size, directly specify the width
|
||||||
|
and height of the output in 1/72ths of an inch. You must specify both
|
||||||
|
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 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 Sans.
|
||||||
|
|
||||||
|
=item --daynum-font=I<font>
|
||||||
|
|
||||||
|
Specify the font used for the day numbers. The default is
|
||||||
|
Sans Bold Oblique.
|
||||||
|
|
||||||
|
=item --entry-font=I<font>
|
||||||
|
|
||||||
|
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 Sans.
|
||||||
|
|
||||||
|
=item --title-size=I<n>
|
||||||
|
|
||||||
|
Specify the size of the title font in 1/72ths of an inch. The default
|
||||||
|
is 14. This size, and indeed all following sizes, may be specified as
|
||||||
|
floating-point numbers.
|
||||||
|
|
||||||
|
=item --header-size=I<n>
|
||||||
|
|
||||||
|
Specify the size of the header font in 1/72ths of an inch. The default is 14.
|
||||||
|
|
||||||
|
=item --daynum-size=I<n>
|
||||||
|
|
||||||
|
Specify the size of the day number font in 1/72ths of an inch. The
|
||||||
|
default is 14.
|
||||||
|
|
||||||
|
=item --entry-size=I<n>
|
||||||
|
|
||||||
|
Specify the size of the calendar entry font in 1/72ths of an inch.
|
||||||
|
The default is 8.
|
||||||
|
|
||||||
|
=item --border-size=I<n>
|
||||||
|
|
||||||
|
Specify the size of the blank border between the contents of a calendar
|
||||||
|
box and the centre of the lines surrounding it, in 1/72ths of an inch.
|
||||||
|
The default is 4.
|
||||||
|
|
||||||
|
=item --line-thickness=I<n>
|
||||||
|
|
||||||
|
Specify the thickness of the lines drawn on the calendar. The default is 1.
|
||||||
|
|
||||||
|
=item --margin-top=I<n>
|
||||||
|
|
||||||
|
The size of the margin at the top of the page in 1/72ths of an inch.
|
||||||
|
The default is 36.
|
||||||
|
|
||||||
|
=item --margin-bottom=I<n>
|
||||||
|
|
||||||
|
The size of the margin at the bottom of the page in 1/72ths of an inch.
|
||||||
|
The default is 36.
|
||||||
|
|
||||||
|
=item --margin-left=I<n>
|
||||||
|
|
||||||
|
The size of the margin at the left of the page in 1/72ths of an inch.
|
||||||
|
The default is 36.
|
||||||
|
|
||||||
|
=item --margin-right=I<n>
|
||||||
|
|
||||||
|
The size of the margin at the right of the page in 1/72ths of an inch.
|
||||||
|
The default is 36.
|
||||||
|
|
||||||
|
=item --verbose, -v
|
||||||
|
|
||||||
|
Print (on STDERR) the name of the month and year for each month that
|
||||||
|
is rendered.
|
||||||
|
|
||||||
|
=back
|
||||||
|
|
||||||
|
=head1 USAGE
|
||||||
|
|
||||||
|
To use B<rem2df>, pipe the output of B<remind> with one of the
|
||||||
|
B<-p>, B<-pp> or B<-ppp> options into B<rem2pdf>. The PDF output
|
||||||
|
will be sent to standard output. So for example, to print a 12-month
|
||||||
|
calendar for the year 2030, use:
|
||||||
|
|
||||||
|
remind -pp12 /dev/null Jan 2030 | rem2pdf -e -l -c=3 | lpr
|
||||||
|
|
||||||
|
You can concatenate multiple B<remind> runs. For example, the following
|
||||||
|
will produce a PDF calendar for January through March of 2023, and
|
||||||
|
June of 2023 (for a total of four pages);
|
||||||
|
|
||||||
|
(remind -pp3 Jan 2023 /dev/null ; \
|
||||||
|
remind -p June 2023 /dev/null) | rem2pdf -e -l -c=3 > cal.pdf
|
||||||
|
|
||||||
|
=head1 FORMATTED TEXT
|
||||||
|
|
||||||
|
B<rem2pdf> supports a B<SPECIAL> reminder type called B<PANGO>. This
|
||||||
|
lets you format text using the Pango markup language, described at
|
||||||
|
L<https://docs.gtk.org/Pango/pango_markup.html>. Here are some
|
||||||
|
examples:
|
||||||
|
|
||||||
|
REM Mon SPECIAL PANGO <b>Bold</b> and <i>italic</i>
|
||||||
|
REM Tue SPECIAL PANGO <span face="zapf chancery">Fancy</span>
|
||||||
|
REM Wed SPECIAL PANGO <span foreground="red"><b>Bold red</b></span>
|
||||||
|
|
||||||
|
Other back-ends such as B<rem2ps> and B<rem2html> will ignore PANGO
|
||||||
|
special reminders.
|
||||||
|
|
||||||
|
Neither B<remind> nor B<rem2pdf> will check the markup to ensure
|
||||||
|
it is syntactically correct. If you use invalid Pango markup, the
|
||||||
|
Pango library will print a warning and B<rem2pdf> will not render any
|
||||||
|
output for the invalid reminder.
|
||||||
|
|
||||||
|
=head1 ABSOLUTELY-POSITIONED TEXT
|
||||||
|
|
||||||
|
If your B<PANGO> special reminder starts with C<@I<x>,I<y>> where I<x>
|
||||||
|
and I<y> are floating-point numbers, then the Pango marked-up test is
|
||||||
|
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
|
||||||
|
I<x> value positions the right edge of the text I<x> points to the left
|
||||||
|
of the right side of the calender 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
|
||||||
|
positions the bottom edge of the text I<y> points above the bottom of
|
||||||
|
the calender 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
|
||||||
|
prevent this.
|
||||||
|
|
||||||
|
As an example, this places Sunrise and Sunset times at the bottom left
|
||||||
|
of each calendar box:
|
||||||
|
|
||||||
|
REM SPECIAL PANGO @1,-1 <span size="4800"><i>Rise [sunrise($U)] Set [sunset($U)]</i></span>
|
||||||
|
|
||||||
|
(Note that Pango expresses font sizes in 1024's of a point, so a size of
|
||||||
|
4800 works out to about 4.6 points.)
|
||||||
|
|
||||||
|
=head1 AUTHOR
|
||||||
|
|
||||||
|
B<Rem2PDF> was written by Dianne Skoll <dianne@skoll.ca>
|
||||||
|
|
||||||
|
=head1 SEE ALSO
|
||||||
|
|
||||||
|
B<remind>, B<rem2ps>
|
||||||
937
rem2pdf/lib/Remind/PDF.pm
Normal file
937
rem2pdf/lib/Remind/PDF.pm
Normal file
@@ -0,0 +1,937 @@
|
|||||||
|
package Remind::PDF;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use Cairo;
|
||||||
|
use Pango;
|
||||||
|
|
||||||
|
use Remind::PDF::Entry;
|
||||||
|
use Encode;
|
||||||
|
|
||||||
|
use JSON::MaybeXS;
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
Remind::PDF - Render a month's worth of Remind data to PDF
|
||||||
|
|
||||||
|
=head1 CLASS METHODS
|
||||||
|
|
||||||
|
=head2 Remind::PDF->create_from_stream($in, $specials_accepted)
|
||||||
|
|
||||||
|
This method reads data from an open file handle C<$in>. C<$specials_accepted>
|
||||||
|
is a hashref of SPECIAL reminder types to accept; the key is the name of the
|
||||||
|
SPECIAL (all lower-case) and the value should be 1. Any SPECIAL reminders
|
||||||
|
not in the hash are ignored.
|
||||||
|
|
||||||
|
This function returns a two-element array: C<($obj, $err)>. On success,
|
||||||
|
C<$obj> will be a C<Remind::PDF> object and C<$err> will be undef. On
|
||||||
|
failure, C<$obj> will be undef and C<$err> will be an error message.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub create_from_stream
|
||||||
|
{
|
||||||
|
my ($class, $in, $specials_accepted) = @_;
|
||||||
|
while (<$in>) {
|
||||||
|
chomp;
|
||||||
|
if ($_ eq '# rem2ps begin' ||
|
||||||
|
$_ eq '# rem2ps2 begin') {
|
||||||
|
my $self = bless {}, $class;
|
||||||
|
return $self->read_one_month($in, $_, $specials_accepted);
|
||||||
|
} elsif ($_ eq '[') {
|
||||||
|
return Remind::PDF::Multi->create_from_stream($in, $specials_accepted);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (undef, "Could not find any remind -p output anywhere");
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 Remind::PDF->create_from_hash($hash, $specials_accepted)
|
||||||
|
|
||||||
|
This method takes data from a hash C<$hash>, which must be one month's
|
||||||
|
worth of data from C<remind -ppp> output. C<$specials_accepted> is a
|
||||||
|
hashref of SPECIAL reminder types to accept; the key is the name of
|
||||||
|
the SPECIAL (all lower-case) and the value should be 1. Any SPECIAL
|
||||||
|
reminders not in the hash are ignored.
|
||||||
|
|
||||||
|
This function returns a two-element array: C<($obj, $err)>. On success,
|
||||||
|
C<$obj> will be a C<Remind::PDF> object and C<$err> will be undef. On
|
||||||
|
failure, C<$obj> will be undef and C<$err> will be an error message.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub create_from_hash
|
||||||
|
{
|
||||||
|
my ($class, $hash, $specials_accepted) = @_;
|
||||||
|
|
||||||
|
bless $hash, $class;
|
||||||
|
|
||||||
|
my $filtered_entries = [];
|
||||||
|
for (my $i=0; $i<=31; $i++) {
|
||||||
|
$filtered_entries->[$i] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach my $e (@{$hash->{entries}}) {
|
||||||
|
if ($hash->accept_special($e, $specials_accepted)) {
|
||||||
|
my $day = $e->{date};
|
||||||
|
$day =~ s/^\d\d\d\d-\d\d-//;
|
||||||
|
$day =~ s/^0//;
|
||||||
|
push(@{$filtered_entries->[$day]}, Remind::PDF::Entry->new_from_hash($e));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$hash->{entries} = $filtered_entries;
|
||||||
|
return $hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
=head1 INSTANCE METHODS
|
||||||
|
|
||||||
|
=head2 read_one_month($in, $first_line, $specials_accepted)
|
||||||
|
|
||||||
|
This function reads one month's worth of data from the file handle
|
||||||
|
C<$in>. C<$first_line> is the line that was read from C<$in>
|
||||||
|
just before calling this function. C<$specials_accepted> is a
|
||||||
|
hashref as documented above.
|
||||||
|
|
||||||
|
The return value is the same C<($obj, $err)> two-element array
|
||||||
|
as C<create_from_stream> returns.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub read_one_month
|
||||||
|
{
|
||||||
|
my ($self, $in, $first_line, $specials_accepted) = @_;
|
||||||
|
$self->{entries} = [];
|
||||||
|
$self->{daynames} = [];
|
||||||
|
$self->{monthname} = '';
|
||||||
|
$self->{year} = '';
|
||||||
|
$self->{daysinmonth} = 0;
|
||||||
|
$self->{firstwkday} = 0;
|
||||||
|
$self->{mondayfirst} = 0;
|
||||||
|
$self->{prevmonthname} = '';
|
||||||
|
$self->{nextmonthname} = '';
|
||||||
|
$self->{daysinprevmonth} = 0;
|
||||||
|
$self->{daysinnextmonth} = 0;
|
||||||
|
$self->{prevmonthyear} = 0;
|
||||||
|
$self->{nextmonthyear} = 0;
|
||||||
|
|
||||||
|
for (my $i=0; $i<=31; $i++) {
|
||||||
|
$self->{entries}->[$i] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
my $line = $in->getline();
|
||||||
|
chomp($line);
|
||||||
|
|
||||||
|
# Month Year Days FirstWkday MondayFirst
|
||||||
|
if ($line =~ /^(\S+) (\d+) (\d+) (\d+) (\d+)/) {
|
||||||
|
$self->{monthname} = $1;
|
||||||
|
$self->{year} = $2;
|
||||||
|
$self->{daysinmonth} = $3;
|
||||||
|
$self->{firstwkday} = $4;
|
||||||
|
$self->{mondayfirst} = $5;
|
||||||
|
} else {
|
||||||
|
return (undef, "Cannot interpret line: $line");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{monthname} =~ s/_/ /g;
|
||||||
|
# Day names
|
||||||
|
$line = $in->getline();
|
||||||
|
chomp($line);
|
||||||
|
if ($line =~ /^\S+ \S+ \S+ \S+ \S+ \S+ \S+$/) {
|
||||||
|
@{$self->{daynames}} = map { s/_/ /g; $_; } (split(/ /, $line));
|
||||||
|
} else {
|
||||||
|
return (undef, "Cannot interpret line: $line");
|
||||||
|
}
|
||||||
|
|
||||||
|
# Prev month, num days
|
||||||
|
$line = $in->getline();
|
||||||
|
chomp($line);
|
||||||
|
if ($line =~ /^\S+ \d+$/) {
|
||||||
|
($self->{prevmonthname}, $self->{daysinprevmonth}) = split(/ /, $line);
|
||||||
|
} else {
|
||||||
|
return (undef, "Cannot interpret line: $line");
|
||||||
|
}
|
||||||
|
# Next month, num days
|
||||||
|
$line = $in->getline();
|
||||||
|
chomp($line);
|
||||||
|
if ($line =~ /^\S+ \d+$/) {
|
||||||
|
($self->{nextmonthname}, $self->{daysinnextmonth}) = split(/ /, $line);
|
||||||
|
} else {
|
||||||
|
return (undef, "Cannot interpret line: $line");
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{prevmonthname} =~ s/_/ /g;
|
||||||
|
$self->{nextmonthname} =~ s/_/ /g;
|
||||||
|
|
||||||
|
if ($first_line eq '# rem2ps2 begin') {
|
||||||
|
# remind -pp format
|
||||||
|
return $self->read_one_month_pp($in, $specials_accepted);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Old-style "remind -p"
|
||||||
|
# TODO: Eventually support this?
|
||||||
|
return $self->read_one_month_p($in, $specials_accepted);
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 read_one_month_p($in, $specials_accepted)
|
||||||
|
|
||||||
|
This function reads one month's worth of data from the file handle
|
||||||
|
C<$in>, assuming the original "remind -p" format.
|
||||||
|
C<$specials_accepted> is a hashref as documented above.
|
||||||
|
|
||||||
|
The return value is the same C<($obj, $err)> two-element array
|
||||||
|
as C<create_from_stream> returns.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub read_one_month_p
|
||||||
|
{
|
||||||
|
my ($self, $in, $specials_accepted) = @_;
|
||||||
|
my $line;
|
||||||
|
while ($line = $in->getline()) {
|
||||||
|
chomp($line);
|
||||||
|
if ($line eq '# rem2ps end') {
|
||||||
|
return ($self, undef);
|
||||||
|
}
|
||||||
|
# Ignore comments
|
||||||
|
next if $line =~ /^#/;
|
||||||
|
my $hash = $self->parse_oldstyle_line($line);
|
||||||
|
next unless $hash;
|
||||||
|
|
||||||
|
my $day = $hash->{date};
|
||||||
|
$day =~ s/^\d\d\d\d-\d\d-//;
|
||||||
|
$day =~ s/^0//;
|
||||||
|
if ($self->accept_special($hash, $specials_accepted)) {
|
||||||
|
push(@{$self->{entries}->[$day]}, Remind::PDF::Entry->new_from_hash($hash));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (undef, "Missing # rem2ps end marker");
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 parse_oldstyle_line ($line)
|
||||||
|
|
||||||
|
This method parses an old-style "remind -p" line
|
||||||
|
and returns a hashref containing some or all of the
|
||||||
|
hash keys found in the newer "remind -pp" JSON output.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub parse_oldstyle_line
|
||||||
|
{
|
||||||
|
my ($self, $line) = @_;
|
||||||
|
return undef unless $line =~ m|^(\d+)/(\d+)/(\d+) (\S+) (\S+) (\S+) (\S+) (.*)$|;
|
||||||
|
|
||||||
|
my $hash = {
|
||||||
|
date => "$1-$2-$3",
|
||||||
|
passthru => $4,
|
||||||
|
tags => $5,
|
||||||
|
duration => $6,
|
||||||
|
time => $7,
|
||||||
|
body => $8};
|
||||||
|
foreach my $key (qw(passthru tags time duration)) {
|
||||||
|
delete $hash->{$key} if $hash->{$key} eq '*';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($hash->{passthru}) {
|
||||||
|
if ($hash->{passthru} =~ /^(shade|color|colour)$/i) {
|
||||||
|
if ($hash->{body} =~ /^\s*(\d+)\s+(\d+)\s+(\d+)/) {
|
||||||
|
$hash->{r} = $1;
|
||||||
|
$hash->{g} = $2;
|
||||||
|
$hash->{b} = $3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 read_one_month_pp($in, $specials_accepted)
|
||||||
|
|
||||||
|
This function reads one month's worth of data from the file handle
|
||||||
|
C<$in>, assuming the "remind -pp" partial-JSON format.
|
||||||
|
C<$specials_accepted> is a hashref as documented above.
|
||||||
|
|
||||||
|
The return value is the same C<($obj, $err)> two-element array
|
||||||
|
as C<create_from_stream> returns.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub read_one_month_pp
|
||||||
|
{
|
||||||
|
my ($self, $in, $specials_accepted) = @_;
|
||||||
|
|
||||||
|
my $json = JSON::MaybeXS->new(utf8 => 0);
|
||||||
|
my $line;
|
||||||
|
while ($line = $in->getline()) {
|
||||||
|
chomp($line);
|
||||||
|
if ($line eq '# rem2ps2 end') {
|
||||||
|
return ($self, undef);
|
||||||
|
}
|
||||||
|
my $hash;
|
||||||
|
eval {
|
||||||
|
$hash = $json->decode($line);
|
||||||
|
};
|
||||||
|
if (!$hash) {
|
||||||
|
return (undef, "Unable to decode JSON: $@");
|
||||||
|
}
|
||||||
|
|
||||||
|
my $day = $hash->{date};
|
||||||
|
$day =~ s/^\d\d\d\d-\d\d-//;
|
||||||
|
$day =~ s/^0//;
|
||||||
|
if ($self->accept_special($hash, $specials_accepted)) {
|
||||||
|
push(@{$self->{entries}->[$day]}, Remind::PDF::Entry->new_from_hash($hash));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (undef, "Missing # rem2ps2 end marker");
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 accept_special($hash, $specials_accepted)
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub accept_special
|
||||||
|
{
|
||||||
|
my ($self, $hash, $specials_accepted) = @_;
|
||||||
|
return 1 unless exists($hash->{passthru});
|
||||||
|
return 1 if $specials_accepted->{lc($hash->{passthru})};
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 find_last_special($special, $entries)
|
||||||
|
|
||||||
|
Given an array of Reminder entries, find the last
|
||||||
|
C<$special>-type SPECIAL in the array. Return
|
||||||
|
the entry if one was found or undef if not.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub find_last_special
|
||||||
|
{
|
||||||
|
my ($self, $special, $entries) = @_;
|
||||||
|
my $class = "Remind::PDF::Entry::$special";
|
||||||
|
my $found = undef;
|
||||||
|
foreach my $e (@$entries) {
|
||||||
|
$found = $e if ($e->isa($class));
|
||||||
|
}
|
||||||
|
return $found;
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 render($cr, $settings)
|
||||||
|
|
||||||
|
Render a calendar for one month. C<$cr> is a Cairo
|
||||||
|
drawing context, and C<$settings> is a settings hash
|
||||||
|
passed in by the caller. See the source code of
|
||||||
|
C<rem2pdf> for the contents of C<$settings>
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub render
|
||||||
|
{
|
||||||
|
my ($self, $cr, $settings) = @_;
|
||||||
|
|
||||||
|
$self->{horiz_lines} = [];
|
||||||
|
$cr->set_line_cap('square');
|
||||||
|
my $so_far = $self->draw_title($cr, $settings);
|
||||||
|
|
||||||
|
# Top line
|
||||||
|
push(@{$self->{horiz_lines}}, $so_far);
|
||||||
|
|
||||||
|
my $top_line = $so_far;
|
||||||
|
|
||||||
|
$so_far = $self->draw_daynames($cr, $settings, $so_far);
|
||||||
|
|
||||||
|
# Line under the days
|
||||||
|
push(@{$self->{horiz_lines}}, $so_far);
|
||||||
|
|
||||||
|
# Remaining space on page
|
||||||
|
$self->{remaining_space} = $settings->{height} - $settings->{margin_bottom} - $so_far;
|
||||||
|
|
||||||
|
$self->{minimum_row_height} = $self->{remaining_space} / 9;
|
||||||
|
# First column
|
||||||
|
my $first_col = $self->{firstwkday};
|
||||||
|
if ($self->{mondayfirst}) {
|
||||||
|
$first_col--;
|
||||||
|
if ($first_col < 0) {
|
||||||
|
$first_col = 6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Last column
|
||||||
|
my $last_col = ($first_col + $self->{daysinmonth} - 1) % 7;
|
||||||
|
|
||||||
|
# Number of rows
|
||||||
|
my $rows = 1;
|
||||||
|
my $last_day_on_row = 7 - $first_col;
|
||||||
|
while ($last_day_on_row < $self->{daysinmonth}) {
|
||||||
|
$last_day_on_row += 7;
|
||||||
|
$rows++;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $extra_row = 0;
|
||||||
|
# Add a row for small calendars if necessary
|
||||||
|
if (($settings->{small_calendars} != 0) && ($first_col == 0) && ($last_col == 6)) {
|
||||||
|
$rows++;
|
||||||
|
$extra_row++;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Figure out where to draw the small calendars
|
||||||
|
my $prevcal_top = 0;
|
||||||
|
my $nextcal_top = 0;
|
||||||
|
my $prevcal_bottom = 0;
|
||||||
|
my $nextcal_bottom = 0;
|
||||||
|
|
||||||
|
if ($settings->{small_calendars} == 1) {
|
||||||
|
if ($last_col <= 4 || ($last_col == 6 && $extra_row)) {
|
||||||
|
$prevcal_bottom = 1;
|
||||||
|
$nextcal_bottom = 1;
|
||||||
|
} else {
|
||||||
|
$prevcal_top = 1;
|
||||||
|
$nextcal_top = 1;
|
||||||
|
}
|
||||||
|
} elsif ($settings->{small_calendars} == 2) {
|
||||||
|
if ($first_col >= 2) {
|
||||||
|
$prevcal_top = 1;
|
||||||
|
$nextcal_top = 1;
|
||||||
|
} else {
|
||||||
|
$prevcal_bottom = 1;
|
||||||
|
$nextcal_bottom = 1;
|
||||||
|
}
|
||||||
|
} elsif ($settings->{small_calendars} == 3) {
|
||||||
|
if ($first_col >= 1 && $last_col <= 5) {
|
||||||
|
$prevcal_top = 1;
|
||||||
|
$nextcal_bottom = 1;
|
||||||
|
} else {
|
||||||
|
if ($last_col <= 4 || ($last_col == 6 && $extra_row)) {
|
||||||
|
$prevcal_bottom = 1;
|
||||||
|
$nextcal_bottom = 1;
|
||||||
|
} else {
|
||||||
|
$prevcal_top = 1;
|
||||||
|
$nextcal_top = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Row height if we are filling the page
|
||||||
|
$self->{row_height} = $self->{remaining_space} / $rows;
|
||||||
|
|
||||||
|
my ($start_col, $start_day);
|
||||||
|
for (my $row = 0; $row < $rows; $row++) {
|
||||||
|
if ($row == 0) {
|
||||||
|
$start_day = 1;
|
||||||
|
$start_col = $first_col;
|
||||||
|
} else {
|
||||||
|
$start_col = 0;
|
||||||
|
}
|
||||||
|
my $old_so_far = $so_far;
|
||||||
|
$so_far = $self->draw_row($cr, $settings, $so_far, $row, $start_day, $start_col);
|
||||||
|
$start_day += 7 - $start_col;
|
||||||
|
push(@{$self->{horiz_lines}}, $so_far);
|
||||||
|
if ($row == 0) {
|
||||||
|
if ($prevcal_top) {
|
||||||
|
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($old_so_far, 0, $so_far - $old_so_far, $settings);
|
||||||
|
$self->draw_small_calendar($cr, $x1 + $settings->{border_size}, $y1 + $settings->{border_size},
|
||||||
|
$x2 - $x1 - 2*$settings->{border_size}, $y2 - $y1 - 2*$settings->{border_size},
|
||||||
|
$settings, $self->{prevmonthname}, $self->{daysinprevmonth}, ($first_col + 35 - $self->{daysinprevmonth}) % 7);
|
||||||
|
}
|
||||||
|
if ($nextcal_top) {
|
||||||
|
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($old_so_far, 1, $so_far - $old_so_far, $settings);
|
||||||
|
$self->draw_small_calendar($cr, $x1 + $settings->{border_size}, $y1 + $settings->{border_size},
|
||||||
|
$x2 - $x1 - 2*$settings->{border_size}, $y2 - $y1 - 2*$settings->{border_size},
|
||||||
|
$settings, $self->{nextmonthname}, $self->{daysinnextmonth}, ($last_col + 1) % 7);
|
||||||
|
}
|
||||||
|
} elsif ($row == $rows-1) {
|
||||||
|
if ($prevcal_bottom) {
|
||||||
|
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($old_so_far, 5, $so_far - $old_so_far, $settings);
|
||||||
|
$self->draw_small_calendar($cr, $x1 + $settings->{border_size}, $y1 + $settings->{border_size},
|
||||||
|
$x2 - $x1 - 2*$settings->{border_size}, $y2 - $y1 - 2*$settings->{border_size},
|
||||||
|
$settings, $self->{prevmonthname}, $self->{daysinprevmonth}, ($first_col + 35 - $self->{daysinprevmonth}) % 7);
|
||||||
|
}
|
||||||
|
if ($nextcal_bottom) {
|
||||||
|
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($old_so_far, 6, $so_far - $old_so_far, $settings);
|
||||||
|
$self->draw_small_calendar($cr, $x1 + $settings->{border_size}, $y1 + $settings->{border_size},
|
||||||
|
$x2 - $x1 - 2*$settings->{border_size}, $y2 - $y1 - 2*$settings->{border_size},
|
||||||
|
$settings, $self->{nextmonthname}, $self->{daysinnextmonth}, ($last_col + 1) % 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($so_far > $settings->{height} - $settings->{margin_bottom}) {
|
||||||
|
print STDERR "WARNING: overfull calendar box\n";
|
||||||
|
}
|
||||||
|
# The vertical lines
|
||||||
|
my $cell = ($settings->{width} - $settings->{margin_left} - $settings->{margin_right}) / 7;
|
||||||
|
for (my $i=0; $i<=7; $i++) {
|
||||||
|
$cr->move_to($settings->{margin_left} + $i * $cell, $top_line);
|
||||||
|
$cr->line_to($settings->{margin_left} + $i * $cell, $so_far);
|
||||||
|
$cr->stroke();
|
||||||
|
}
|
||||||
|
|
||||||
|
# And the horizontal lines
|
||||||
|
foreach my $y (@{$self->{horiz_lines}}) {
|
||||||
|
$cr->move_to($settings->{margin_left}, $y);
|
||||||
|
$cr->line_to($settings->{width} - $settings->{margin_right}, $y);
|
||||||
|
$cr->stroke();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($settings->{verbose}) {
|
||||||
|
print STDERR "remdp2f: Rendered " . $self->{monthname} . ' ' . $self->{year} . "\n";
|
||||||
|
}
|
||||||
|
# Done this page
|
||||||
|
$cr->show_page();
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 draw_row($cr, $settings, $so_far, $row, $start_day, $start_col)
|
||||||
|
|
||||||
|
Draw a single row in the calendar. C<$cr> is a Cairo drawing context
|
||||||
|
and C<$settings> is the settings hash passed to C<render>. C<$so_far>
|
||||||
|
is the Y-coordinate of the top of the row; drawing starts at this
|
||||||
|
coordinate. C<$start_day> is the day of the month at which the
|
||||||
|
row starts and C<$start> col is the column number (0-6) at which
|
||||||
|
to start drawing from C<$start_day>
|
||||||
|
|
||||||
|
Returns the Y coordinate at which to start drawing the I<next>
|
||||||
|
calendar row.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub draw_row
|
||||||
|
{
|
||||||
|
my ($self, $cr, $settings, $so_far, $row, $start_day, $start_col) = @_;
|
||||||
|
|
||||||
|
my $col = $start_col;
|
||||||
|
my $day = $start_day;
|
||||||
|
my $height = 0;
|
||||||
|
|
||||||
|
# Preview them to figure out the row height...
|
||||||
|
if (!$settings->{fill_entire_page}) {
|
||||||
|
while ($col < 7) {
|
||||||
|
my $h = $self->draw_day($cr, $settings, $so_far, $day, $col, 0);
|
||||||
|
$height = $h if ($h > $height);
|
||||||
|
$day++;
|
||||||
|
$col++;
|
||||||
|
last if ($day > $self->{daysinmonth});
|
||||||
|
}
|
||||||
|
$col = $start_col;
|
||||||
|
$day = $start_day;
|
||||||
|
} else {
|
||||||
|
$height = $self->{row_height} - $settings->{border_size} * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$settings->{fill_entire_page} && $height < $self->{minimum_row_height}) {
|
||||||
|
$height = $self->{minimum_row_height};
|
||||||
|
}
|
||||||
|
# Now draw for real
|
||||||
|
while ($col < 7 && $day <= $self->{daysinmonth}) {
|
||||||
|
$self->draw_day($cr, $settings, $so_far, $day, $col, $height);
|
||||||
|
$day++;
|
||||||
|
$col++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $so_far + $height + $settings->{border_size};
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 col_box_coordinates($so_far, $col, $height, $settings)
|
||||||
|
|
||||||
|
Returns a four-element array C<($x1, $y1, $x2, $y2)> representing
|
||||||
|
the bounding box of the calendar box at column C<$col> (0-6). C<$height>
|
||||||
|
is the height of the box and C<$settings> is the settings hashref
|
||||||
|
passed to C<render>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub col_box_coordinates
|
||||||
|
{
|
||||||
|
my ($self, $so_far, $col, $height, $settings) = @_;
|
||||||
|
my $cell = ($settings->{width} - $settings->{margin_left} - $settings->{margin_right}) / 7;
|
||||||
|
|
||||||
|
return (
|
||||||
|
$settings->{margin_left} + $cell * $col,
|
||||||
|
$so_far,
|
||||||
|
$settings->{margin_left} + $cell * ($col + 1),
|
||||||
|
$so_far + $height + $settings->{border_size},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 draw_day($cr, $settings, $so_far, $day, $col, $height)
|
||||||
|
|
||||||
|
Renders a single day's worth of reminders. C<$cr> is a Cairo
|
||||||
|
drawing context and C<$settings> is the settings hash passed
|
||||||
|
to C<render>. C<$so_far> is the Y-coordinate of the top
|
||||||
|
of the box and C<$col> is the column number.
|
||||||
|
|
||||||
|
C<$height> is the height of the box. If C<$height> is passed
|
||||||
|
in as zero, then do not actually render anything... instead,
|
||||||
|
compute how high the box should be. If C<$height> is non-zero,
|
||||||
|
then it is the height of the box.
|
||||||
|
|
||||||
|
Returns the height required for the calendar box.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub draw_day
|
||||||
|
{
|
||||||
|
my ($self, $cr, $settings, $so_far, $day, $col, $height) = @_;
|
||||||
|
|
||||||
|
my $top = $so_far;
|
||||||
|
|
||||||
|
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($so_far, $col, $height, $settings);
|
||||||
|
|
||||||
|
# Do shading if we're in "for real" mode
|
||||||
|
if ($height) {
|
||||||
|
my $shade = $self->find_last_special('shade', $self->{entries}->[$day]);
|
||||||
|
if ($shade) {
|
||||||
|
$cr->save;
|
||||||
|
$cr->set_source_rgb($shade->{r} / 255,
|
||||||
|
$shade->{g} / 255,
|
||||||
|
$shade->{b} / 255);
|
||||||
|
$cr->rectangle($x1, $y1, $x2 - $x1, $y2 - $y1);
|
||||||
|
$cr->fill();
|
||||||
|
$cr->restore;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# Draw the day number
|
||||||
|
my $layout = Pango::Cairo::create_layout($cr);
|
||||||
|
$layout->set_text($day);
|
||||||
|
my $desc = Pango::FontDescription->from_string($settings->{daynum_font} . ' ' . $settings->{daynum_size} . 'px');
|
||||||
|
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
my ($wid, $h) = $layout->get_pixel_size();
|
||||||
|
|
||||||
|
|
||||||
|
# Don't actually draw if we're just previewing to get the cell height
|
||||||
|
if ($height) {
|
||||||
|
$cr->save;
|
||||||
|
if ($settings->{numbers_on_left}) {
|
||||||
|
$cr->move_to($x1 + $settings->{border_size}, $so_far + $settings->{border_size});
|
||||||
|
} else {
|
||||||
|
$cr->move_to($x2 - $settings->{border_size} - $wid, $so_far + $settings->{border_size});
|
||||||
|
}
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
$so_far += $h + 2 * $settings->{border_size};
|
||||||
|
my $entry_height = 0;
|
||||||
|
my $done = 0;
|
||||||
|
foreach my $entry (@{$self->{entries}->[$day]}) {
|
||||||
|
# Moon and week should not adjust height
|
||||||
|
if ($entry->isa('Remind::PDF::Entry::moon') ||
|
||||||
|
$entry->isa('Remind::PDF::Entry::week')) {
|
||||||
|
$entry->render($self, $cr, $settings, $top, $day, $col, $height);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
# An absolutely-positioned Pango markup should not adjust height
|
||||||
|
# either
|
||||||
|
if ($entry->isa('Remind::PDF::Entry::pango') &&
|
||||||
|
defined($entry->{atx}) && defined($entry->{aty})) {
|
||||||
|
$entry->render($self, $cr, $settings, $top, $day, $col, $height);
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Shade is done already
|
||||||
|
if ($entry->isa('Remind::PDF::Entry::shade')) {
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($done) {
|
||||||
|
$so_far += $settings->{border_size};
|
||||||
|
$entry_height += $settings->{border_size};
|
||||||
|
}
|
||||||
|
$done = 1;
|
||||||
|
my $h2 = $entry->render($self, $cr, $settings, $so_far, $day, $col, $height);
|
||||||
|
$entry_height += $h2;
|
||||||
|
$so_far += $h2;
|
||||||
|
}
|
||||||
|
if ($height) {
|
||||||
|
if ($entry_height > $height) {
|
||||||
|
print STDERR "WARNING: overfull box at $day " . $self->{monthname} . ' ' . $self->{year} . "\n";
|
||||||
|
$entry_height = $height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $h + $entry_height + 2 * $settings->{border_size};
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 draw_daynames($cr, $settings, $so_far)
|
||||||
|
|
||||||
|
Draw the weekday names heading. C<$cr> is a Cairo drawing context
|
||||||
|
and C<$settings> is the settings hash passed to C<render>. C<$so_far>
|
||||||
|
is the Y-coordinate of the top of the row; drawing starts at this
|
||||||
|
coordinate.
|
||||||
|
|
||||||
|
Returns the Y coordinate at which to start drawing the first
|
||||||
|
calendar row.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub draw_daynames
|
||||||
|
{
|
||||||
|
my ($self, $cr, $settings, $so_far) = @_;
|
||||||
|
|
||||||
|
my $w = $settings->{width} - $settings->{margin_left} - $settings->{margin_right};
|
||||||
|
my $cell = $w/7;
|
||||||
|
|
||||||
|
$so_far += $settings->{border_size};
|
||||||
|
my $height = 0;
|
||||||
|
for (my $i=0; $i<7; $i++) {
|
||||||
|
my $j;
|
||||||
|
if ($self->{mondayfirst}) {
|
||||||
|
$j = ($i + 1) % 7;
|
||||||
|
} else {
|
||||||
|
$j = $i;
|
||||||
|
}
|
||||||
|
my $layout = Pango::Cairo::create_layout($cr);
|
||||||
|
$layout->set_text(Encode::decode('UTF-8', $self->{daynames}->[$j]));
|
||||||
|
my $desc = Pango::FontDescription->from_string($settings->{header_font} . ' ' . $settings->{header_size} . 'px');
|
||||||
|
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
|
||||||
|
my ($wid, $h) = $layout->get_pixel_size();
|
||||||
|
$cr->save;
|
||||||
|
$cr->move_to($settings->{margin_left} + $i * $cell + $cell/2 - $wid/2, $so_far);
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
if ($h > $height) {
|
||||||
|
$height = $h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $so_far + $height + $settings->{border_size} * .75;
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 draw_title($cr, $settings)
|
||||||
|
|
||||||
|
Draw the title ("Monthname Year") at the top of the calendar.
|
||||||
|
C<$cr> is a Cairo drawing context
|
||||||
|
and C<$settings> is the settings hash passed to C<render>.
|
||||||
|
|
||||||
|
Returns the Y coordinate at which to start drawing the row
|
||||||
|
containing the weekday names.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub draw_title
|
||||||
|
{
|
||||||
|
my ($self, $cr, $settings) = @_;
|
||||||
|
my $title = $self->{monthname} . ' ' . $self->{year};
|
||||||
|
|
||||||
|
$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');
|
||||||
|
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
|
||||||
|
my ($w, $h) = $layout->get_pixel_size();
|
||||||
|
$cr->save();
|
||||||
|
$cr->move_to($settings->{width}/2 - $w/2, $settings->{margin_top});
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
return $h + $settings->{margin_top} + $settings->{border_size};
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 draw_small_calendar($cr, $x, $y, $width, $height, $settings, $month, $days, $start_wkday)
|
||||||
|
|
||||||
|
Draw a small calendar on the Cairo context C<$cr>. The top left-hand
|
||||||
|
corner of the box is at C<($x, $y)> and the size of the box is
|
||||||
|
C<($width, $height>). $settings is the settings hashref passed to
|
||||||
|
C<render>. C<$month> is the name of the month to draw and C<$days> is
|
||||||
|
the number of days in the month. Finally, C<$start_wkday> is the
|
||||||
|
weekday (0=Sunday, 6=Saturday) on which the month starts
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub draw_small_calendar
|
||||||
|
{
|
||||||
|
my ($self, $cr, $x, $y, $width, $height, $settings, $month, $days, $start_wkday) = @_;
|
||||||
|
|
||||||
|
my $first_col = $start_wkday;
|
||||||
|
if ($self->{mondayfirst}) {
|
||||||
|
$first_col--;
|
||||||
|
if ($first_col < 0) {
|
||||||
|
$first_col = 6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Last column
|
||||||
|
my $last_col = ($first_col + $days - 1) % 7;
|
||||||
|
|
||||||
|
# Number of rows
|
||||||
|
my $rows = 1;
|
||||||
|
my $last_day_on_row = 7 - $first_col;
|
||||||
|
while ($last_day_on_row < $days) {
|
||||||
|
$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 $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');
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
$layout->set_text('88 ');
|
||||||
|
($wid, $h) = $layout->get_pixel_size();
|
||||||
|
$h += 1;
|
||||||
|
|
||||||
|
# Month name
|
||||||
|
$layout = Pango::Cairo::create_layout($cr);
|
||||||
|
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
$layout->set_text(Encode::decode('UTF-8', $month));
|
||||||
|
my ($mw, $mh) = $layout->get_pixel_size();
|
||||||
|
$cr->save();
|
||||||
|
$cr->move_to($x + $width/2 - $mw/2, $y);
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
|
||||||
|
$y += $h;
|
||||||
|
# Day names
|
||||||
|
for (my $col=0; $col <7; $col++) {
|
||||||
|
my $j;
|
||||||
|
if ($self->{mondayfirst}) {
|
||||||
|
$j = ($col + 1) % 7;
|
||||||
|
} else {
|
||||||
|
$j = $col;
|
||||||
|
}
|
||||||
|
my $day = $self->{daynames}->[$j];
|
||||||
|
my $l = substr(Encode::decode('UTF-8', $day), 0, 1);
|
||||||
|
$layout = Pango::Cairo::create_layout($cr);
|
||||||
|
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
$layout->set_text($l);
|
||||||
|
$cr->save();
|
||||||
|
$cr->move_to($x + $col*$wid, $y);
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
}
|
||||||
|
$y += $h;
|
||||||
|
|
||||||
|
my $col = $start_wkday;
|
||||||
|
|
||||||
|
for (my $d=1; $d <= $days; $d++) {
|
||||||
|
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
$layout->set_text($d);
|
||||||
|
$cr->save();
|
||||||
|
$cr->move_to($x + $col*$wid, $y);
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
$col++;
|
||||||
|
if ($col > 6) {
|
||||||
|
$col = 0;
|
||||||
|
$y += $h;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
package Remind::PDF::Multi;
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
Remind::PDF::Multi - A container for multiple months' worth of calendar data
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
The C<remind -ppp> output consists of a JSON array with each element
|
||||||
|
representing one month's worth of reminders. C<Remind::PDF::Multi>
|
||||||
|
reads this output and returns an instance of itself containing
|
||||||
|
an array of C<Remind::PDF> objects, one object for each month.
|
||||||
|
|
||||||
|
=head1 CLASS METHODS
|
||||||
|
|
||||||
|
=head2 Remind::PDF::Multi->create_from_stream($in, $specials_accepted)
|
||||||
|
|
||||||
|
This method reads data from an open file handle C<$in>. C<$specials_accepted>
|
||||||
|
is a hashref of SPECIAL reminder types to accept; the key is the name of the
|
||||||
|
SPECIAL (all lower-case) and the value should be 1. Any SPECIAL reminders
|
||||||
|
not in the hash are ignored.
|
||||||
|
|
||||||
|
This function returns a two-element array: C<($obj, $err)>. On
|
||||||
|
success, C<$obj> will be a C<Remind::PDF::Multi> object and C<$err>
|
||||||
|
will be undef. On failure, C<$obj> will be undef and C<$err> will be
|
||||||
|
an error message.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
|
||||||
|
sub create_from_stream
|
||||||
|
{
|
||||||
|
my ($class, $in, $specials_accepted) = @_;
|
||||||
|
my $json = "[\n";
|
||||||
|
my $right_bracket = 0;
|
||||||
|
my $right_curly = 0;
|
||||||
|
|
||||||
|
while(<$in>) {
|
||||||
|
$json .= $_;
|
||||||
|
chomp;
|
||||||
|
if ($_ eq ']') {
|
||||||
|
$right_bracket++;
|
||||||
|
if ($right_bracket == 2 && $right_curly == 1) {
|
||||||
|
return $class->create_from_json($json, $specials_accepted);
|
||||||
|
}
|
||||||
|
} elsif($_ eq '}') {
|
||||||
|
$right_curly++;
|
||||||
|
} else {
|
||||||
|
$right_bracket = 0;
|
||||||
|
$right_curly = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(undef, 'Unable to parse JSON stream');
|
||||||
|
}
|
||||||
|
|
||||||
|
=head2 Remind::PDF::Multi->create_from_stream($json, $specials_accepted)
|
||||||
|
|
||||||
|
This method takes data from a JSON string <$json>. C<$specials_accepted>
|
||||||
|
is a hashref of SPECIAL reminder types to accept; the key is the name of the
|
||||||
|
SPECIAL (all lower-case) and the value should be 1. Any SPECIAL reminders
|
||||||
|
not in the hash are ignored.
|
||||||
|
|
||||||
|
This function returns a two-element array: C<($obj, $err)>. On
|
||||||
|
success, C<$obj> will be a C<Remind::PDF::Multi> object and C<$err>
|
||||||
|
will be undef. On failure, C<$obj> will be undef and C<$err> will be
|
||||||
|
an error message.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub create_from_json
|
||||||
|
{
|
||||||
|
my ($class, $json, $specials_accepted) = @_;
|
||||||
|
my $parser = JSON::MaybeXS->new(utf8 => 0);
|
||||||
|
|
||||||
|
my $array;
|
||||||
|
eval {
|
||||||
|
$array = $parser->decode($json);
|
||||||
|
};
|
||||||
|
if (!$array) {
|
||||||
|
return (undef, "Unable to decode JSON: $@");
|
||||||
|
}
|
||||||
|
if (ref($array) ne 'ARRAY') {
|
||||||
|
return (undef, "Expecting array; found " . ref($array));
|
||||||
|
}
|
||||||
|
|
||||||
|
my $self = bless { months => []}, $class;
|
||||||
|
foreach my $m (@$array) {
|
||||||
|
my ($e, $error) = Remind::PDF->create_from_hash($m, $specials_accepted);
|
||||||
|
if (!$e) {
|
||||||
|
return (undef, $error);
|
||||||
|
}
|
||||||
|
push(@{$self->{entries}}, $e);
|
||||||
|
}
|
||||||
|
return ($self, undef);
|
||||||
|
}
|
||||||
|
|
||||||
|
=head1 INSTANCE METHODS
|
||||||
|
|
||||||
|
=head2 render($cr, $settings)
|
||||||
|
|
||||||
|
Iterate through all the C<Remind::PDF> objects
|
||||||
|
and call their C<render> methods. This method
|
||||||
|
renders as many months worth of calendar data
|
||||||
|
as were read from the C<remind -ppp> stream
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub render
|
||||||
|
{
|
||||||
|
my ($self, $cr, $settings) = @_;
|
||||||
|
foreach my $e (@{$self->{entries}}) {
|
||||||
|
$e->render($cr, $settings);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
311
rem2pdf/lib/Remind/PDF/Entry.pm
Normal file
311
rem2pdf/lib/Remind/PDF/Entry.pm
Normal file
@@ -0,0 +1,311 @@
|
|||||||
|
package Remind::PDF::Entry;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use Cairo;
|
||||||
|
use Pango;
|
||||||
|
use Encode;
|
||||||
|
|
||||||
|
=head1 NAME
|
||||||
|
|
||||||
|
Remind::PDF::Entry - Representation of one calendar entry
|
||||||
|
|
||||||
|
=head1 DESCRIPTION
|
||||||
|
|
||||||
|
C<Remind::PDF::Entry> and its subclasses represent one calendar
|
||||||
|
entry. They can be normal reminder-type entries or SPECIAL reminders.
|
||||||
|
|
||||||
|
=head1 CLASS METHODS
|
||||||
|
|
||||||
|
=head2 Remind::PDF::Entry->new_from_hash($hash)
|
||||||
|
|
||||||
|
Create and return a new C<Remind::PDF::Entry> based on one reminder's
|
||||||
|
worth of data from C<remind -p>. Returns a C<Remind::PDF::Entry> object,
|
||||||
|
or in the case of SPECIAL reminders, a subclass of C<Remind::PDF::Entry>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub new_from_hash
|
||||||
|
{
|
||||||
|
my ($class, $hash) = @_;
|
||||||
|
if (exists($hash->{passthru})) {
|
||||||
|
my $special = lc($hash->{passthru});
|
||||||
|
if ($special =~ /^(html|htmlclass|week|moon|shade|color|colour|postscript|psfile|pango)$/) {
|
||||||
|
$special = 'color' if $special eq 'colour';
|
||||||
|
$class = 'Remind::PDF::Entry::' . $special;
|
||||||
|
} else {
|
||||||
|
$class = 'Remind::PDF::Entry::UNKNOWN';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bless $hash, $class;
|
||||||
|
$hash->_adjust();
|
||||||
|
return $hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Base class: Set the color to black
|
||||||
|
sub _adjust
|
||||||
|
{
|
||||||
|
my ($self) = @_;
|
||||||
|
$self->{r} = 0;
|
||||||
|
$self->{g} = 0;
|
||||||
|
$self->{b} = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
=head1 INSTANCE METHODS
|
||||||
|
|
||||||
|
=head2 render($pdf, $cr, $settings, $so_far, $day, $col, $height)
|
||||||
|
|
||||||
|
Render a single entry. C<$pdf> is the parent C<Remind::PDF>
|
||||||
|
object. C<$cr> is a Cairo drawing context and C<$settings> is the
|
||||||
|
usual settings hash. C<$so_far> is the Y-coordinate at which
|
||||||
|
to start drawing. C<$day> is the month day and C<$col> is
|
||||||
|
the calendar column. C<$height> is the height of the calendar
|
||||||
|
box.
|
||||||
|
|
||||||
|
If C<$height> is zero, then nothing should actually be drawn,
|
||||||
|
but the height of the calendar entry should be computed.
|
||||||
|
|
||||||
|
Returns the height of the calendar entry.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
sub render
|
||||||
|
{
|
||||||
|
my ($self, $pdf, $cr, $settings, $so_far, $day, $col, $height) = @_;
|
||||||
|
|
||||||
|
my ($x1, $y1, $x2, $y2) = $pdf->col_box_coordinates($so_far, $col, $height, $settings);
|
||||||
|
my $layout = Pango::Cairo::create_layout($cr);
|
||||||
|
|
||||||
|
$layout->set_width(1024 * ($x2 - $x1 - 2 * $settings->{border_size}));
|
||||||
|
$layout->set_wrap('word-char');
|
||||||
|
$layout->set_text(Encode::decode('UTF-8', $self->{body}));
|
||||||
|
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . $settings->{entry_size} . 'px');
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
my ($wid, $h) = $layout->get_pixel_size();
|
||||||
|
|
||||||
|
if ($height) {
|
||||||
|
$cr->save();
|
||||||
|
$cr->set_source_rgb($self->{r} / 255,
|
||||||
|
$self->{g} / 255,
|
||||||
|
$self->{b} / 255);
|
||||||
|
$cr->move_to($x1 + $settings->{border_size}, $so_far);
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
}
|
||||||
|
return $h;
|
||||||
|
}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::html;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
sub render {}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::htmlclass;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
sub render {}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::week;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
|
||||||
|
sub render
|
||||||
|
{
|
||||||
|
my ($self, $pdf, $cr, $settings, $so_far, $day, $col, $height) = @_;
|
||||||
|
# Do nothing in pre-render mode
|
||||||
|
return 0 unless $height;
|
||||||
|
|
||||||
|
# Render in small text at bottom-right
|
||||||
|
my ($x1, $y1, $x2, $y2) = $pdf->col_box_coordinates($so_far, $col, $height, $settings);
|
||||||
|
my $layout = Pango::Cairo::create_layout($cr);
|
||||||
|
|
||||||
|
$layout->set_text(Encode::decode('UTF-8', $self->{body}));
|
||||||
|
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . int(0.75 * $settings->{entry_size}) . 'px');
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
my ($wid, $h) = $layout->get_pixel_size();
|
||||||
|
|
||||||
|
$cr->save();
|
||||||
|
$cr->move_to($x2 - $settings->{border_size}/4 - $wid, $y2 - $settings->{border_size}/4 - $h);
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::moon;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
|
||||||
|
sub _adjust {
|
||||||
|
my ($self) = @_;
|
||||||
|
my ($phase, $size, $fontsize, $msg) = split(/\s+/, $self->{body}, 4);
|
||||||
|
$phase = '' unless defined($phase);
|
||||||
|
$size = -1 unless defined($size);
|
||||||
|
$fontsize = -1 unless defined($fontsize);
|
||||||
|
$msg = '' unless defined($msg);
|
||||||
|
$self->{phase} = $phase;
|
||||||
|
$self->{size} = $size;
|
||||||
|
$self->{fontsize} = $fontsize;
|
||||||
|
$self->{body} = $msg;
|
||||||
|
}
|
||||||
|
sub render
|
||||||
|
{
|
||||||
|
my ($self, $pdf, $cr, $settings, $so_far, $day, $col, $height) = @_;
|
||||||
|
|
||||||
|
# Do nothing in pre-render mode
|
||||||
|
return 0 unless $height;
|
||||||
|
|
||||||
|
my ($x1, $y1, $x2, $y2) = $pdf->col_box_coordinates($so_far, $col, $height, $settings);
|
||||||
|
|
||||||
|
my $layout;
|
||||||
|
my $bodywidth = 0;
|
||||||
|
if ($self->{fontsize} <= 0) {
|
||||||
|
$self->{fontsize} = $settings->{entry_size};
|
||||||
|
}
|
||||||
|
if ($self->{size} <= 0) {
|
||||||
|
$self->{size} = $settings->{daynum_size};
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->{phase} !~ /^[0123]$/) {
|
||||||
|
# Invalid phase
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->{body} ne '') {
|
||||||
|
$layout = Pango::Cairo::create_layout($cr);
|
||||||
|
$layout->set_text(Encode::decode('UTF-8', $self->{body}));
|
||||||
|
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . $self->{fontsize} . 'px');
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
($bodywidth, undef) = $layout->get_pixel_size();
|
||||||
|
}
|
||||||
|
my ($xc, $yc);
|
||||||
|
if ($settings->{numbers_on_left}) {
|
||||||
|
$yc = $so_far + $settings->{border_size} + ($self->{size} / 2);
|
||||||
|
$xc = $x2 - $settings->{border_size} - ($self->{size} / 2);
|
||||||
|
if ($bodywidth) {
|
||||||
|
$xc -= ($bodywidth + $settings->{border_size});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$xc = $x1 + $settings->{border_size} + ($self->{size} / 2);
|
||||||
|
$yc = $so_far + $settings->{border_size} + ($self->{size} / 2);
|
||||||
|
}
|
||||||
|
$self->draw_moon($xc, $yc, $cr);
|
||||||
|
if ($layout) {
|
||||||
|
$cr->save();
|
||||||
|
$cr->move_to ($xc + ($self->{size}/2) + $settings->{border_size},
|
||||||
|
$yc + ($self->{size}/2) - $self->{fontsize} );
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub draw_moon
|
||||||
|
{
|
||||||
|
my ($self, $xc, $yc, $cr) = @_;
|
||||||
|
$cr->save();
|
||||||
|
$cr->new_path();
|
||||||
|
$cr->arc($xc, $yc, $self->{size}/2, 0, 2*3.1415926535);
|
||||||
|
if ($self->{phase} == 0) {
|
||||||
|
$cr->stroke_preserve();
|
||||||
|
$cr->fill();
|
||||||
|
} elsif ($self->{phase} == 1) {
|
||||||
|
$cr->stroke();
|
||||||
|
$cr->arc($xc, $yc, $self->{size}/2, 3.1415926535/2, 3 * 3.1415926535/2);
|
||||||
|
$cr->stroke_preserve();
|
||||||
|
$cr->fill();
|
||||||
|
} elsif ($self->{phase} == 2) {
|
||||||
|
$cr->stroke();
|
||||||
|
} elsif ($self->{phase} == 3) {
|
||||||
|
$cr->stroke();
|
||||||
|
$cr->arc($xc, $yc, $self->{size}/2, 3 * 3.1415926535/2, 3.1415926535/2);
|
||||||
|
$cr->stroke_preserve();
|
||||||
|
$cr->fill();
|
||||||
|
}
|
||||||
|
$cr->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::shade;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
sub _adjust
|
||||||
|
{
|
||||||
|
my ($self) = @_;
|
||||||
|
if ($self->{body} =~ /^(\d+)\s+(\d+)\s+(\d+)/) {
|
||||||
|
$self->{r} = $1;
|
||||||
|
$self->{g} = $2;
|
||||||
|
$self->{b} = $3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::color;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
|
||||||
|
# Strip the RGB prefix from body
|
||||||
|
sub _adjust
|
||||||
|
{
|
||||||
|
my ($self) = @_;
|
||||||
|
$self->{body} =~ s/^\d+\s+\d+\s+\d+\s+//;
|
||||||
|
}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::postscript;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
sub render {}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::psfile;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
sub render {}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::pango;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
sub _adjust
|
||||||
|
{
|
||||||
|
my ($self) = @_;
|
||||||
|
if ($self->{body} =~ /^@([-0-9.]+),\s*([-0-9.]+)\s*(.*)/) {
|
||||||
|
$self->{atx} = $1;
|
||||||
|
$self->{aty} = $2;
|
||||||
|
$self->{body} = $3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub render
|
||||||
|
{
|
||||||
|
my ($self, $pdf, $cr, $settings, $so_far, $day, $col, $height) = @_;
|
||||||
|
|
||||||
|
my ($x1, $y1, $x2, $y2) = $pdf->col_box_coordinates($so_far, $col, $height, $settings);
|
||||||
|
my $layout = Pango::Cairo::create_layout($cr);
|
||||||
|
|
||||||
|
$layout->set_width(1024 * ($x2 - $x1 - 2 * $settings->{border_size}));
|
||||||
|
$layout->set_wrap('word-char');
|
||||||
|
$layout->set_markup(Encode::decode('UTF-8', $self->{body}));
|
||||||
|
|
||||||
|
if (($layout->get_text() // '') eq '') {
|
||||||
|
# Invalid markup
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . $settings->{entry_size} . 'px');
|
||||||
|
$layout->set_font_description($desc);
|
||||||
|
my ($wid, $h) = $layout->get_pixel_size();
|
||||||
|
|
||||||
|
if ($height) {
|
||||||
|
$cr->save();
|
||||||
|
if (defined($self->{atx}) && defined($self->{aty})) {
|
||||||
|
my ($x, $y);
|
||||||
|
if ($self->{atx} < 0) {
|
||||||
|
$x = $x2 + $self->{atx} - $wid;
|
||||||
|
} else {
|
||||||
|
$x = $x1 + $self->{atx};
|
||||||
|
}
|
||||||
|
if ($self->{aty} < 0) {
|
||||||
|
$y = $y2 + $self->{aty} - $h;
|
||||||
|
} else {
|
||||||
|
$y = $y1 + $self->{aty};
|
||||||
|
}
|
||||||
|
$cr->move_to($x, $y);
|
||||||
|
} else {
|
||||||
|
$cr->move_to($x1 + $settings->{border_size}, $so_far);
|
||||||
|
}
|
||||||
|
Pango::Cairo::show_layout($cr, $layout);
|
||||||
|
$cr->restore();
|
||||||
|
}
|
||||||
|
return $h;
|
||||||
|
}
|
||||||
|
|
||||||
|
package Remind::PDF::Entry::UNKNOWN;
|
||||||
|
use base 'Remind::PDF::Entry';
|
||||||
|
sub render {}
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
481
scripts/tkremind
481
scripts/tkremind
@@ -21,17 +21,6 @@ if {[catch {package require Tcl 8.5}]} {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# If it's 8.5, try using the Img or the TkPNG package to
|
|
||||||
# get PNG support
|
|
||||||
if {[info tclversion] == 8.5} {
|
|
||||||
if {[catch {package require Img}]} {
|
|
||||||
if {[catch {package require tkpng}]} {
|
|
||||||
puts stderr "Tcl/Tk version 8.5 might require either the Img or tkpng"
|
|
||||||
puts stderr "package to handle PNG images correctly. TkRemind may"
|
|
||||||
puts stderr "crash because neither of these packages was found."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wm withdraw .
|
wm withdraw .
|
||||||
|
|
||||||
set Hostname [exec hostname]
|
set Hostname [exec hostname]
|
||||||
@@ -148,17 +137,28 @@ set TimerUpdateForChanges ""
|
|||||||
|
|
||||||
# Remind program to execute -- supply full path if you want
|
# Remind program to execute -- supply full path if you want
|
||||||
set Remind "remind"
|
set Remind "remind"
|
||||||
#set Remind "/home/dfs/Remind/src/remind"
|
|
||||||
|
|
||||||
# Rem2PS program to execute -- supply full path if you want
|
# Rem2PS program to execute -- supply full path if you want
|
||||||
set Rem2PS "rem2ps"
|
set Rem2PS "rem2ps"
|
||||||
|
|
||||||
|
# Rem2PDF program to execute -- supply full path if you want
|
||||||
|
set Rem2PDF "rem2pdf"
|
||||||
|
|
||||||
|
# Check if we have Rem2PDF
|
||||||
|
set HaveRem2PDF 0
|
||||||
|
|
||||||
|
set a [exec sh -c "$Rem2PDF < /dev/null 2>&1 || true"]
|
||||||
|
|
||||||
|
if {[string match "rem2pdf:*" "$a"]} {
|
||||||
|
set HaveRem2PDF 1
|
||||||
|
}
|
||||||
|
|
||||||
# Reminder file to source -- default
|
# Reminder file to source -- default
|
||||||
set ReminderFile {NOSUCHFILE}
|
set ReminderFile {NOSUCHFILE}
|
||||||
set ReminderFile [file nativename "~/.reminders"]
|
set ReminderFile [file nativename "~/.reminders"]
|
||||||
|
|
||||||
# Default options file
|
# Default options file
|
||||||
set ConfigFile ~/.tkremindrc
|
set ConfigFile ""
|
||||||
|
|
||||||
set EditorPid -1
|
set EditorPid -1
|
||||||
|
|
||||||
@@ -184,12 +184,12 @@ set MondayFirst 0
|
|||||||
# Month names in English
|
# Month names in English
|
||||||
set MonthNames {January February March April May June July August September October November December}
|
set MonthNames {January February March April May June July August September October November December}
|
||||||
|
|
||||||
# Day names in Remind's pre-selected language
|
|
||||||
set DayNames {}
|
|
||||||
|
|
||||||
# Day name in English
|
# Day name in English
|
||||||
set EnglishDayNames {Sunday Monday Tuesday Wednesday Thursday Friday Saturday}
|
set EnglishDayNames {Sunday Monday Tuesday Wednesday Thursday Friday Saturday}
|
||||||
|
|
||||||
|
# Day names in Remind's pre-selected language - will be overwritten
|
||||||
|
set DayNames $EnglishDayNames
|
||||||
|
|
||||||
# Current month and year -- will be set by Initialize procedure
|
# Current month and year -- will be set by Initialize procedure
|
||||||
set CurMonth -1
|
set CurMonth -1
|
||||||
set CurYear -1
|
set CurYear -1
|
||||||
@@ -198,9 +198,13 @@ set CurYear -1
|
|||||||
set BgCounter 0
|
set BgCounter 0
|
||||||
|
|
||||||
# Absolutely today -- unlike the CurMonth and CurYear, these won't change
|
# Absolutely today -- unlike the CurMonth and CurYear, these won't change
|
||||||
set TodayMonth -1
|
set now [clock seconds]
|
||||||
set TodayYear -1
|
|
||||||
set TodayDay -1
|
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 CurMonth $TodayMonth
|
||||||
|
set CurYear $TodayYear
|
||||||
|
|
||||||
# Reminder option types and skip types
|
# Reminder option types and skip types
|
||||||
set OptionType 1
|
set OptionType 1
|
||||||
@@ -211,14 +215,32 @@ set PSCmd {}
|
|||||||
|
|
||||||
# Print options -- destination file; letter-size; landscape; fill page; default
|
# Print options -- destination file; letter-size; landscape; fill page; default
|
||||||
# encoding; 36pt margins; print small calendars
|
# encoding; 36pt margins; print small calendars
|
||||||
set PrintDest file
|
set OptDescr(PrintDest) "Print destination: file or command"
|
||||||
set PrintSize letter
|
set Option(PrintDest) file
|
||||||
set PrintOrient landscape
|
|
||||||
set PrintFill 1
|
set OptDescr(PrintSize) "Page size: a4 or letter"
|
||||||
set PrintDaysRight 1
|
set Option(PrintSize) letter
|
||||||
set PrintEncoding 0
|
|
||||||
set PrintMargins 36pt
|
set OptDescr(PrintOrient) "Page orientation: portrait or landscape"
|
||||||
set PrintSmallCalendars 1
|
set Option(PrintOrient) landscape
|
||||||
|
|
||||||
|
set OptDescr(PrintFill) "(0/1) If 1, fill entire page when printing"
|
||||||
|
set Option(PrintFill) 1
|
||||||
|
|
||||||
|
set OptDescr(PrintDaysRight) "(0/1) If 1, put day numbers in the top-right of each calendar box"
|
||||||
|
set Option(PrintDaysRight) 1
|
||||||
|
|
||||||
|
set OptDescr(PrintEncoding) "(0/1) If 1, apply ISO-8859-1 encoding to PostScript output"
|
||||||
|
set Option(PrintEncoding) 0
|
||||||
|
|
||||||
|
set OptDescr(PrintMargins) "Print margins: One of 24pt, 36pt or 48pt"
|
||||||
|
set Option(PrintMargins) 36pt
|
||||||
|
|
||||||
|
set OptDescr(PrintSmallCalendars) "(0/1) If 1, print small calendars in PostScript output"
|
||||||
|
set Option(PrintSmallCalendars) 1
|
||||||
|
|
||||||
|
set OptDescr(PrintFormat) "Print format: pdf or ps"
|
||||||
|
set Option(PrintFormat) ps
|
||||||
|
|
||||||
set WarningHeaders [list "# Lines staring with REM TAG TKTAGnnn ... were created by tkremind" "# Do not edit them by hand or results may be unpredictable."]
|
set WarningHeaders [list "# Lines staring with REM TAG TKTAGnnn ... were created by tkremind" "# Do not edit them by hand or results may be unpredictable."]
|
||||||
|
|
||||||
@@ -258,7 +280,6 @@ proc is_warning_header { line } {
|
|||||||
# MondayFirst flag, current date, etc.
|
# MondayFirst flag, current date, etc.
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc Initialize {} {
|
proc Initialize {} {
|
||||||
|
|
||||||
global DayNames argc argv CommandLine ReminderFile AppendFile Remind PSCmd
|
global DayNames argc argv CommandLine ReminderFile AppendFile Remind PSCmd
|
||||||
global MondayFirst TwentyFourHourMode ReminderFileModTime
|
global MondayFirst TwentyFourHourMode ReminderFileModTime
|
||||||
global Option ConfigFile
|
global Option ConfigFile
|
||||||
@@ -337,7 +358,6 @@ proc Initialize {} {
|
|||||||
|
|
||||||
append CommandLine " $ReminderFile"
|
append CommandLine " $ReminderFile"
|
||||||
append PSCmd " $ReminderFile"
|
append PSCmd " $ReminderFile"
|
||||||
set DayNames [GetWeekdayNames]
|
|
||||||
|
|
||||||
# Get modification time of ReminderFile
|
# Get modification time of ReminderFile
|
||||||
set ReminderFileModTime -1
|
set ReminderFileModTime -1
|
||||||
@@ -380,40 +400,6 @@ proc MonitorReminderFile {} {
|
|||||||
ScheduleUpdateForChanges
|
ScheduleUpdateForChanges
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
# GetWeekdayNames - Spawn a remind process and get the names of the weekdays
|
|
||||||
# Also sets CurMonth and CurYear.
|
|
||||||
#---------------------------------------------------------------------------
|
|
||||||
proc GetWeekdayNames {} {
|
|
||||||
global CurMonth CurYear TodayYear TodayMonth TodayDay Remind
|
|
||||||
set f [open "|$Remind - 2>/dev/null" r+]
|
|
||||||
puts $f "banner %"
|
|
||||||
set i 0
|
|
||||||
while { $i < 7 } {
|
|
||||||
puts $f "msg \[wkday($i)\]%"
|
|
||||||
incr i
|
|
||||||
}
|
|
||||||
|
|
||||||
# Get current month and year as long as we're running Remind
|
|
||||||
puts $f "msg %n%"
|
|
||||||
puts $f "msg %y%"
|
|
||||||
puts $f "msg %d%"
|
|
||||||
puts $f "FLUSH"
|
|
||||||
flush $f
|
|
||||||
set ans {}
|
|
||||||
set i 0
|
|
||||||
while { $i < 7 } {
|
|
||||||
lappend ans [gets $f]
|
|
||||||
incr i
|
|
||||||
}
|
|
||||||
set CurMonth [expr [gets $f] - 1]
|
|
||||||
set CurYear [gets $f]
|
|
||||||
set TodayDay [gets $f]
|
|
||||||
set TodayMonth $CurMonth
|
|
||||||
set TodayYear $CurYear
|
|
||||||
close $f
|
|
||||||
return $ans
|
|
||||||
}
|
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
# %PROCEDURE: CalEntryOffset
|
# %PROCEDURE: CalEntryOffset
|
||||||
@@ -484,7 +470,6 @@ proc CreateCalFrame { w dayNames } {
|
|||||||
-state disabled -takefocus 0 -cursor {} -font CalboxFont -foreground $Option(TextColor) -background $Option(BackgroundColor)
|
-state disabled -takefocus 0 -cursor {} -font CalboxFont -foreground $Option(TextColor) -background $Option(BackgroundColor)
|
||||||
$w.t$f tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$f"
|
$w.t$f tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$f"
|
||||||
$w.t$f tag bind REM <ButtonPress-3> "FireEditor $w.t$f"
|
$w.t$f tag bind REM <ButtonPress-3> "FireEditor $w.t$f"
|
||||||
|
|
||||||
grid configure $w.l$f -row [expr $i*2+1] -column $j -sticky ew
|
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
|
grid configure $w.t$f -row [expr $i*2+2] -column $j -sticky nsew
|
||||||
}
|
}
|
||||||
@@ -512,6 +497,8 @@ proc CreateCalFrame { w dayNames } {
|
|||||||
proc ConfigureCalFrame { w firstDay numDays } {
|
proc ConfigureCalFrame { w firstDay numDays } {
|
||||||
global CurMonth CurYear TodayMonth TodayYear TodayDay
|
global CurMonth CurYear TodayMonth TodayYear TodayDay
|
||||||
global tk_version Option
|
global tk_version Option
|
||||||
|
|
||||||
|
CreateMoonWindows
|
||||||
set offset [CalEntryOffset $firstDay]
|
set offset [CalEntryOffset $firstDay]
|
||||||
set first [expr $offset+1]
|
set first [expr $offset+1]
|
||||||
set last [expr $offset+$numDays]
|
set last [expr $offset+$numDays]
|
||||||
@@ -839,27 +826,9 @@ proc ApplyOptions { w } {
|
|||||||
# Saves options in specified config file
|
# Saves options in specified config file
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc SaveOptions { w } {
|
proc SaveOptions { w } {
|
||||||
global Option OptDescr ConfigFile
|
global Option OptDescr
|
||||||
ApplyOptions $w
|
ApplyOptions $w
|
||||||
|
WriteOptionsToFile
|
||||||
set problem [catch {set f [open $ConfigFile "w"]} err]
|
|
||||||
if {$problem} {
|
|
||||||
tk_dialog .error Error "Can't write $ConfigFile: $err" 0 OK
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
puts $f "# TkRemind option file -- created automatically"
|
|
||||||
puts $f "# [clock format [clock seconds]]"
|
|
||||||
puts $f "# Format of each line is 'key value' where 'key'"
|
|
||||||
puts $f "# specifies the option name, and 'value' is a"
|
|
||||||
puts $f "# *legal Tcl list element* specifying the option value."
|
|
||||||
foreach name [lsort [array names Option]] {
|
|
||||||
puts $f ""
|
|
||||||
puts $f "# $OptDescr($name)"
|
|
||||||
puts $f [list $name $Option($name)]
|
|
||||||
}
|
|
||||||
puts $f ""
|
|
||||||
close $f
|
|
||||||
FillCalWindow
|
FillCalWindow
|
||||||
.h.title configure -background $Option(WinBackground) -foreground $Option(LabelColor)
|
.h.title configure -background $Option(WinBackground) -foreground $Option(LabelColor)
|
||||||
for {set i 0} {$i < 7} {incr i} {
|
for {set i 0} {$i < 7} {incr i} {
|
||||||
@@ -878,6 +847,30 @@ proc SaveOptions { w } {
|
|||||||
.b.options configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
.b.options configure -foreground $Option(LabelColor) -background $Option(WinBackground)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc WriteOptionsToFile {} {
|
||||||
|
global ConfigFile
|
||||||
|
global Option OptDescr
|
||||||
|
set problem [catch {set f [open "$ConfigFile.tmp" "w"]} err]
|
||||||
|
if {$problem} {
|
||||||
|
tk_dialog .error Error "Can't write $ConfigFile.tmp: $err" 0 OK
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
puts $f "# TkRemind option file -- created automatically"
|
||||||
|
puts $f "# [clock format [clock seconds]]"
|
||||||
|
puts $f "# Format of each line is 'key value' where 'key'"
|
||||||
|
puts $f "# specifies the option name, and 'value' is a"
|
||||||
|
puts $f "# *legal Tcl list element* specifying the option value."
|
||||||
|
foreach name [lsort [array names Option]] {
|
||||||
|
puts $f ""
|
||||||
|
puts $f "# $OptDescr($name)"
|
||||||
|
puts $f [list $name $Option($name)]
|
||||||
|
}
|
||||||
|
puts $f ""
|
||||||
|
close $f
|
||||||
|
file rename -force "$ConfigFile.tmp" $ConfigFile
|
||||||
|
}
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
# %PROCEDURE: LoadOptions
|
# %PROCEDURE: LoadOptions
|
||||||
# %ARGUMENTS:
|
# %ARGUMENTS:
|
||||||
@@ -971,9 +964,21 @@ proc FillCalWindow {} {
|
|||||||
gets $file line
|
gets $file line
|
||||||
regexp {^([^ ]*) ([0-9][0-9][0-9][0-9]) ([0-9][0-9]?) ([0-9]) ([0-9])} $line dummy monthName year daysInMonth firstWkday mondayFirst
|
regexp {^([^ ]*) ([0-9][0-9][0-9][0-9]) ([0-9][0-9]?) ([0-9]) ([0-9])} $line dummy monthName year daysInMonth firstWkday mondayFirst
|
||||||
|
|
||||||
# Skip day names -- we already have them
|
set monthName [regsub -all {_} $monthName " "]
|
||||||
|
# Get the day names
|
||||||
gets $file line
|
gets $file line
|
||||||
|
set DayNames {}
|
||||||
|
foreach day $line {
|
||||||
|
set day [regsub -all {_} $day " "];
|
||||||
|
lappend DayNames $day
|
||||||
|
}
|
||||||
|
|
||||||
ConfigureCalWindow $monthName $year $firstWkday $daysInMonth
|
ConfigureCalWindow $monthName $year $firstWkday $daysInMonth
|
||||||
|
|
||||||
|
# Update the day names in the calendar window
|
||||||
|
for {set i 0} {$i < 7} {incr i} {
|
||||||
|
.cal.day$i configure -text [lindex $DayNames $i]
|
||||||
|
}
|
||||||
set offset [CalEntryOffset $firstWkday]
|
set offset [CalEntryOffset $firstWkday]
|
||||||
|
|
||||||
while { [gets $file line] >= 0 } {
|
while { [gets $file line] >= 0 } {
|
||||||
@@ -1027,7 +1032,7 @@ proc FillCalWindow {} {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
"MOON" {
|
"MOON" {
|
||||||
DoMoonSpecial $n $stuff
|
DoMoonSpecial $n $stuff $fntag
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
"COLOUR" -
|
"COLOUR" -
|
||||||
@@ -1072,6 +1077,9 @@ proc FillCalWindow {} {
|
|||||||
.cal.t$n insert end [string trim $stuff] [list REM $extratags]
|
.cal.t$n insert end [string trim $stuff] [list REM $extratags]
|
||||||
} else {
|
} else {
|
||||||
.cal.t$n insert end [string trim $stuff] [list REM $extratags $fntag]
|
.cal.t$n insert end [string trim $stuff] [list REM $extratags $fntag]
|
||||||
|
.cal.t$n tag bind $fntag <Enter> "EditableEnter .cal.t$n"
|
||||||
|
.cal.t$n tag bind $fntag <Leave> "EditableLeave .cal.t$n"
|
||||||
|
.cal.t$n tag bind $fntag <ButtonPress-1> "FireEditor .cal.t$n"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.cal.t$n insert end "\n"
|
.cal.t$n insert end "\n"
|
||||||
@@ -1137,8 +1145,9 @@ proc Status { stuff } {
|
|||||||
# None
|
# None
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
proc DoPrint {} {
|
proc DoPrint {} {
|
||||||
global PrintDest PrintSize PrintMargins PrintOrient PrintFill PrintDaysRight PrintEncoding PrintSmallCalendars PrintStatus Rem2PS PSCmd Option
|
global Rem2PS Rem2PDF HaveRem2PDF PSCmd Option PrintStatus
|
||||||
global CurMonth CurYear MonthNames
|
global CurMonth CurYear MonthNames
|
||||||
|
|
||||||
catch {destroy .p}
|
catch {destroy .p}
|
||||||
toplevel .p
|
toplevel .p
|
||||||
wm title .p "TkRemind Print..."
|
wm title .p "TkRemind Print..."
|
||||||
@@ -1152,42 +1161,57 @@ proc DoPrint {} {
|
|||||||
frame .p.f3a -relief sunken -border 2
|
frame .p.f3a -relief sunken -border 2
|
||||||
frame .p.f4
|
frame .p.f4
|
||||||
|
|
||||||
radiobutton .p.tofile -text "To file: " -variable PrintDest -value file
|
radiobutton .p.tofile -text "To file: " -variable Option(PrintDest) -value file
|
||||||
entry .p.filename
|
entry .p.filename
|
||||||
button .p.browse -text "Browse..." -command PrintFileBrowse
|
button .p.browse -text "Browse..." -command PrintFileBrowse
|
||||||
radiobutton .p.tocmd -text "To command: " -variable PrintDest -value command
|
radiobutton .p.tocmd -text "To command: " -variable Option(PrintDest) -value command
|
||||||
entry .p.command
|
entry .p.command
|
||||||
.p.command insert end "lpr"
|
.p.command insert end "lpr"
|
||||||
|
|
||||||
|
if { $HaveRem2PDF } {
|
||||||
|
frame .p.ff -relief sunken -border 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
|
||||||
|
}
|
||||||
|
|
||||||
label .p.size -text "Paper Size:"
|
label .p.size -text "Paper Size:"
|
||||||
radiobutton .p.letter -text "Letter" -variable PrintSize -value letter
|
radiobutton .p.letter -text "Letter" -variable Option(PrintSize) -value letter
|
||||||
radiobutton .p.a4 -text "A4" -variable PrintSize -value a4
|
radiobutton .p.a4 -text "A4" -variable Option(PrintSize) -value a4
|
||||||
|
|
||||||
label .p.margin -text "Margins:"
|
label .p.margin -text "Margins:"
|
||||||
radiobutton .p.24pt -text "24pt margins" -variable PrintMargins -value 24pt
|
radiobutton .p.24pt -text "24pt margins" -variable Option(PrintMargins) -value 24pt
|
||||||
radiobutton .p.36pt -text "36pt margins" -variable PrintMargins -value 36pt
|
radiobutton .p.36pt -text "36pt margins" -variable Option(PrintMargins) -value 36pt
|
||||||
radiobutton .p.48pt -text "48pt margins" -variable PrintMargins -value 48pt
|
radiobutton .p.48pt -text "48pt margins" -variable Option(PrintMargins) -value 48pt
|
||||||
|
|
||||||
label .p.orient -text "Orientation:"
|
label .p.orient -text "Orientation:"
|
||||||
radiobutton .p.landscape -text "Landscape" -variable PrintOrient -value landscape
|
radiobutton .p.landscape -text "Landscape" -variable Option(PrintOrient) -value landscape
|
||||||
radiobutton .p.portrait -text "Portrait" -variable PrintOrient -value portrait
|
radiobutton .p.portrait -text "Portrait" -variable Option(PrintOrient) -value portrait
|
||||||
|
|
||||||
checkbutton .p.fill -text "Fill page" -variable PrintFill
|
checkbutton .p.fill -text "Fill page" -variable Option(PrintFill)
|
||||||
checkbutton .p.right -text "Day numbers at top-right" -variable PrintDaysRight
|
checkbutton .p.right -text "Day numbers at top-right" -variable Option(PrintDaysRight)
|
||||||
checkbutton .p.encoding -text "ISO 8859-1 PostScript encoding" -variable PrintEncoding
|
checkbutton .p.encoding -text "ISO 8859-1 PostScript encoding" -variable Option(PrintEncoding)
|
||||||
checkbutton .p.calendars -text "Print small calendars" -variable PrintSmallCalendars
|
checkbutton .p.calendars -text "Print small calendars" -variable Option(PrintSmallCalendars)
|
||||||
|
|
||||||
button .p.print -text "Print" -command {set PrintStatus print}
|
button .p.print -text "Print" -command {set PrintStatus print}
|
||||||
button .p.cancel -text "Cancel" -command {set PrintStatus cancel}
|
button .p.cancel -text "Cancel" -command {set PrintStatus cancel}
|
||||||
|
|
||||||
pack .p.f1 .p.f2 .p.f2a .p.f3 .p.f3a \
|
if {$HaveRem2PDF} {
|
||||||
-side top -fill both -expand 1 -anchor w
|
pack .p.f1 .p.ff .p.f2 .p.f2a .p.f3 .p.f3a \
|
||||||
|
-side top -fill both -expand 1 -anchor w
|
||||||
|
} else {
|
||||||
|
pack .p.f1 .p.f2 .p.f2a .p.f3 .p.f3a \
|
||||||
|
-side top -fill both -expand 1 -anchor w
|
||||||
|
}
|
||||||
pack .p.fill .p.right .p.encoding .p.calendars -in .p.f3a \
|
pack .p.fill .p.right .p.encoding .p.calendars -in .p.f3a \
|
||||||
-side top -anchor w -fill none -expand 0
|
-side top -anchor w -fill none -expand 0
|
||||||
pack .p.f4 -side top -fill both -expand 1 -anchor w
|
pack .p.f4 -side top -fill both -expand 1 -anchor w
|
||||||
pack .p.f11 .p.f12 -in .p.f1 -side top -fill none -expand 0 -anchor w
|
pack .p.f11 .p.f12 -in .p.f1 -side top -fill none -expand 0 -anchor w
|
||||||
pack .p.tofile .p.filename .p.browse -in .p.f11 -side left -fill none -expand 0 -anchor w
|
pack .p.tofile .p.filename .p.browse -in .p.f11 -side left -fill none -expand 0 -anchor w
|
||||||
pack .p.tocmd .p.command -in .p.f12 -side left -fill none -expand 0 -anchor w
|
pack .p.tocmd .p.command -in .p.f12 -side left -fill none -expand 0 -anchor w
|
||||||
|
if { $HaveRem2PDF } {
|
||||||
|
pack .p.format .p.pdf .p.ps -in .p.ff -side top -fill none -expand 0 -anchor w
|
||||||
|
}
|
||||||
pack .p.size .p.letter .p.a4 -in .p.f2 -side top -fill none -expand 0 -anchor w
|
pack .p.size .p.letter .p.a4 -in .p.f2 -side top -fill none -expand 0 -anchor w
|
||||||
pack .p.margin .p.24pt .p.36pt .p.48pt -in .p.f2a -side top -anchor w -fill none -expand 0
|
pack .p.margin .p.24pt .p.36pt .p.48pt -in .p.f2a -side top -anchor w -fill none -expand 0
|
||||||
pack .p.orient .p.landscape .p.portrait -in .p.f3 -side top -fill none -expand 0 -anchor w
|
pack .p.orient .p.landscape .p.portrait -in .p.f3 -side top -fill none -expand 0 -anchor w
|
||||||
@@ -1209,7 +1233,8 @@ proc DoPrint {} {
|
|||||||
if {$PrintStatus == "cancel"} {
|
if {$PrintStatus == "cancel"} {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if {$PrintDest == "file"} {
|
WriteOptionsToFile
|
||||||
|
if {$Option(PrintDest) == "file"} {
|
||||||
if {$fname == ""} {
|
if {$fname == ""} {
|
||||||
tk_dialog .error Error "No filename specified" error 0 Ok
|
tk_dialog .error Error "No filename specified" error 0 Ok
|
||||||
return
|
return
|
||||||
@@ -1229,39 +1254,67 @@ proc DoPrint {} {
|
|||||||
set fname "| $cmd"
|
set fname "| $cmd"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build the command line
|
if {$HaveRem2PDF && $Option(PrintFormat) == "pdf"} {
|
||||||
set p [regsub EXTRA $PSCmd $Option(ExtraRemindArgs)]
|
set p [regsub EXTRA $PSCmd "-itkpdf=1 $Option(ExtraRemindArgs)"]
|
||||||
set cmd "$p 1 [lindex $MonthNames $CurMonth] $CurYear | $Rem2PS"
|
set cmd "$p 1 [lindex $MonthNames $CurMonth] $CurYear | $Rem2PDF"
|
||||||
if {$PrintSize == "letter"} {
|
|
||||||
append cmd " -m Letter"
|
|
||||||
} else {
|
} else {
|
||||||
append cmd " -m A4"
|
set p [regsub EXTRA $PSCmd $Option(ExtraRemindArgs)]
|
||||||
|
set cmd "$p 1 [lindex $MonthNames $CurMonth] $CurYear | $Rem2PS"
|
||||||
|
set Option(PrintFormat) ps
|
||||||
}
|
}
|
||||||
|
|
||||||
if {$PrintMargins == "24pt"} {
|
if {$Option(PrintSize) == "letter"} {
|
||||||
append cmd " -or 24 -ol 24 -ot 24 -ob 24"
|
if {$Option(PrintFormat) == "ps"} {
|
||||||
} elseif {$PrintMargins == "36pt"} {
|
append cmd " -m Letter"
|
||||||
append cmd " -or 36 -ol 36 -ot 36 -ob 36"
|
} else {
|
||||||
|
append cmd " --media=Letter"
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
append cmd " -or 48 -ol 48 -ot 48 -ob 48"
|
if {$Option(PrintFormat) == "ps"} {
|
||||||
|
append cmd " -m A4"
|
||||||
|
} else {
|
||||||
|
append cmd " --media=A4"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if {$PrintOrient == "landscape"} {
|
if {$Option(PrintMargins) == "24pt"} {
|
||||||
|
if {$Option(PrintFormat) == "ps"} {
|
||||||
|
append cmd " -or 24 -ol 24 -ot 24 -ob 24"
|
||||||
|
} else {
|
||||||
|
append cmd " --margin-right=24 --margin-left=24 --margin-top=24 --margin-bottom=24"
|
||||||
|
}
|
||||||
|
} elseif {$Option(PrintMargins) == "36pt"} {
|
||||||
|
if {$Option(PrintFormat) == "ps"} {
|
||||||
|
append cmd " -or 36 -ol 36 -ot 36 -ob 36"
|
||||||
|
} else {
|
||||||
|
append cmd " --margin-right=36 --margin-left=36 --margin-top=36 --margin-bottom=36"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if {$Option(PrintFormat) == "ps"} {
|
||||||
|
append cmd " -or 48 -ol 48 -ot 48 -ob 48"
|
||||||
|
} else {
|
||||||
|
append cmd " --margin-right=48 --margin-left=48 --margin-top=48 --margin-bottom=48"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if {$Option(PrintOrient) == "landscape"} {
|
||||||
append cmd " -l"
|
append cmd " -l"
|
||||||
}
|
}
|
||||||
|
|
||||||
if {$PrintFill} {
|
if {$Option(PrintFill)} {
|
||||||
append cmd " -e"
|
append cmd " -e"
|
||||||
}
|
}
|
||||||
|
|
||||||
if {!$PrintDaysRight} {
|
if {!$Option(PrintDaysRight)} {
|
||||||
append cmd " -x"
|
append cmd " -x"
|
||||||
}
|
}
|
||||||
if {$PrintEncoding} {
|
if {$Option(PrintEncoding)} {
|
||||||
append cmd " -i"
|
if {$Option(PrintFormat) == "ps"} {
|
||||||
|
append cmd " -i"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if {$PrintSmallCalendars} {
|
if {$Option(PrintSmallCalendars)} {
|
||||||
append cmd " -c3"
|
append cmd " -c3"
|
||||||
} else {
|
} else {
|
||||||
append cmd " -c0"
|
append cmd " -c0"
|
||||||
@@ -2505,6 +2558,7 @@ proc ShowQueue { file } {
|
|||||||
if {[catch {set obj [::json::json2dict $line]}]} {
|
if {[catch {set obj [::json::json2dict $line]}]} {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
set obj [lsort -command sort_q $obj]
|
||||||
foreach q $obj {
|
foreach q $obj {
|
||||||
$w.t insert end "$q\n"
|
$w.t insert end "$q\n"
|
||||||
}
|
}
|
||||||
@@ -2512,6 +2566,18 @@ proc ShowQueue { file } {
|
|||||||
$w.t configure -state disabled
|
$w.t configure -state disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc sort_q { a b } {
|
||||||
|
set a_ttime [dict get $a nextttime]
|
||||||
|
set b_ttime [dict get $b nextttime]
|
||||||
|
if {$a_ttime < $b_ttime} {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
if {$a_ttime > $b_ttime} {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# DaemonReadable
|
# DaemonReadable
|
||||||
# Arguments:
|
# Arguments:
|
||||||
@@ -2704,8 +2770,8 @@ proc main {} {
|
|||||||
close $f
|
close $f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FindConfigFile
|
||||||
LoadOptions
|
LoadOptions
|
||||||
CreateMoonImages
|
|
||||||
ShowTodaysReminders
|
ShowTodaysReminders
|
||||||
ScanForTags $AppendFile
|
ScanForTags $AppendFile
|
||||||
CreateCalWindow $DayNames
|
CreateCalWindow $DayNames
|
||||||
@@ -3053,17 +3119,19 @@ proc ReadTaggedOptions { tag date } {
|
|||||||
}
|
}
|
||||||
return $ans
|
return $ans
|
||||||
}
|
}
|
||||||
proc FireEditor { w } {
|
proc FireEditor { w {fntag ""}} {
|
||||||
global Option
|
global Option
|
||||||
global EditorPid
|
global EditorPid
|
||||||
set tags [$w tag names current]
|
if {"$fntag" == ""} {
|
||||||
set index [lsearch -glob $tags "FILE_*"]
|
set tags [$w tag names current]
|
||||||
if {$index < 0} {
|
set index [lsearch -glob $tags "FILE_*"]
|
||||||
return
|
if {$index < 0} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
set fntag [lindex $tags $index]
|
||||||
}
|
}
|
||||||
set tag [lindex $tags $index]
|
if {![regexp {^FILE_([0-9]+)_(.*)} $fntag all line file]} {
|
||||||
if {![regexp {^FILE_([0-9]+)_(.*)} $tag all line file]} {
|
return
|
||||||
return
|
|
||||||
}
|
}
|
||||||
set editor $Option(Editor)
|
set editor $Option(Editor)
|
||||||
regsub -all "%s" $editor $file editor
|
regsub -all "%s" $editor $file editor
|
||||||
@@ -3116,6 +3184,7 @@ proc TaggedEnter { w } {
|
|||||||
$w tag configure $tag -foreground #FF0000
|
$w tag configure $tag -foreground #FF0000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
# %PROCEDURE: TaggedLeave
|
# %PROCEDURE: TaggedLeave
|
||||||
# %ARGUMENTS:
|
# %ARGUMENTS:
|
||||||
@@ -3141,6 +3210,35 @@ proc TaggedLeave { w } {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc EditableEnter { w } {
|
||||||
|
set tags [$w tag names current]
|
||||||
|
set index [lsearch -glob $tags "FILE_*"]
|
||||||
|
if {$index < 0} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
set tag [lindex $tags $index]
|
||||||
|
|
||||||
|
set c ""
|
||||||
|
set index [lsearch -glob $tags "clr*"]
|
||||||
|
if {$index >= 0} {
|
||||||
|
set ctag [lindex $tags $index]
|
||||||
|
set c [$w tag cget $ctag -foreground]
|
||||||
|
}
|
||||||
|
if {"$c" != ""} {
|
||||||
|
$w tag configure $tag -underline 1 -underlinefg $c
|
||||||
|
} else {
|
||||||
|
$w tag configure $tag -underline 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
proc EditableLeave { w } {
|
||||||
|
set tags [$w tag names current]
|
||||||
|
set index [lsearch -glob $tags "FILE_*"]
|
||||||
|
if {$index < 0} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
set tag [lindex $tags $index]
|
||||||
|
$w tag configure $tag -underline 0
|
||||||
|
}
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
# %PROCEDURE: EditTaggedReminder
|
# %PROCEDURE: EditTaggedReminder
|
||||||
# %ARGUMENTS:
|
# %ARGUMENTS:
|
||||||
@@ -3426,12 +3524,13 @@ proc DoShadeSpecial { n r g b } {
|
|||||||
# %ARGUMENTS:
|
# %ARGUMENTS:
|
||||||
# n -- calendar box for moon
|
# n -- calendar box for moon
|
||||||
# stuff -- Remind command line
|
# stuff -- Remind command line
|
||||||
|
# fntag - filename tag, if any
|
||||||
# %RETURNS:
|
# %RETURNS:
|
||||||
# Nothing
|
# Nothing
|
||||||
# %DESCRIPTION:
|
# %DESCRIPTION:
|
||||||
# Handles the "MOON" special -- draws a moon symbol
|
# Handles the "MOON" special -- draws a moon symbol
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc DoMoonSpecial { n stuff } {
|
proc DoMoonSpecial { n stuff fntag } {
|
||||||
set msg ""
|
set msg ""
|
||||||
set num [scan $stuff "%d %d %d %s" phase junk1 junk2 msg]
|
set num [scan $stuff "%d %d %d %s" phase junk1 junk2 msg]
|
||||||
if {$num < 1} {
|
if {$num < 1} {
|
||||||
@@ -3441,18 +3540,34 @@ proc DoMoonSpecial { n stuff } {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
switch -exact -- $phase {
|
switch -exact -- $phase {
|
||||||
0 { set image new }
|
0 { set win .moon_new }
|
||||||
1 { set image first }
|
1 { set win .moon_first }
|
||||||
2 { set image full }
|
2 { set win .moon_full }
|
||||||
3 { set image last }
|
3 { set win .moon_last }
|
||||||
}
|
}
|
||||||
.cal.t$n configure -state normal
|
.cal.t$n configure -state normal
|
||||||
.cal.t$n image create 1.0 -image $image
|
.cal.t$n window create 1.0 -window $win
|
||||||
|
|
||||||
if {$msg != ""} {
|
if {$msg != ""} {
|
||||||
.cal.t$n insert 1.1 " $msg\n"
|
if {"$fntag" == "x"} {
|
||||||
|
.cal.t$n insert 1.1 " $msg\n"
|
||||||
|
} else {
|
||||||
|
.cal.t$n insert 1.1 " $msg\n" [list REM $fntag]
|
||||||
|
.cal.t$n tag bind $fntag <Enter> "EditableEnter .cal.t$n"
|
||||||
|
.cal.t$n tag bind $fntag <Leave> "EditableLeave .cal.t$n"
|
||||||
|
.cal.t$n tag bind $fntag <ButtonPress-1> "FireEditor .cal.t$n $fntag"
|
||||||
|
bind $win <ButtonPress-1> "FireEditor .cal.t$n $fntag"
|
||||||
|
bind $win <ButtonPress-3> "FireEditor .cal.t$n $fntag"
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
.cal.t$n insert 1.1 "\n"
|
if {"$fntag" == "x"} {
|
||||||
|
.cal.t$n insert 1.1 "\n"
|
||||||
|
} else {
|
||||||
|
.cal.t$n insert 1.1 "\n" [list REM $fntag]
|
||||||
|
.cal.t$n tag bind $fntag <Enter> "EditableEnter .cal.t$n"
|
||||||
|
.cal.t$n tag bind $fntag <Leave> "EditableLeave .cal.t$n"
|
||||||
|
.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
|
||||||
}
|
}
|
||||||
@@ -3476,19 +3591,52 @@ proc DisplayTime {} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
# %PROCEDURE: CreateMoonImages
|
# %PROCEDURE: CreateMoonWindows
|
||||||
# %ARGUMENTS:
|
# %ARGUMENTS:
|
||||||
# None
|
# None
|
||||||
# %RETURNS:
|
# %RETURNS:
|
||||||
# Nothing
|
# Nothing
|
||||||
# %DESCRIPTION:
|
# %DESCRIPTION:
|
||||||
# Creates the moon images "new", "first", "full" and "last"
|
# Creates the moon windows .moon_new, .moon_first, .moon_full and
|
||||||
|
# .moon_last
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc CreateMoonImages {} {
|
proc CreateMoonWindows {} {
|
||||||
image create photo full -data "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAGQAAABkABchkaRQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADlSURBVDiNrdNBUsJAEAXQlyw4hq4hwWPqTixET6ELkZ16CcAq7oFLqXExjaYgQVNlV/Viev7/6XT/4TjGuME7PiLXUatb8N8xwB12SFjiIXIZtU/MAntEfgvQE4YtHxhiHpjXQ5H7uLhEcaLLAleBvd0Xx9Ha/BdyU+Q5OBV5OKmj7a4YBWdSyNPe4aKHAHkzqcQZNj3JgnNexqE8heyIAulffuFF3kTfIVbBVeu/xoXGGsn2TLJJ/mqkafNiINszySYZdbS90GHlvcgsWktY4TFy7ecxTdvIzahxHQLbyFXUqkPwF2ASRNYgB/PXAAAAAElFTkSuQmCC"
|
global Option;
|
||||||
image create photo first -data "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAGQAAABkABchkaRQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADfSURBVDiNndM9TsNAFATgzy5yjZSAE85JBygETgENUPF3iBCitHAFQkcIhZ/Ryn9gRlrZmp2Z3ef3TBOHOMULPrDBMrhpi/4HI5xjix2+4nmJRbx/Yh7ahvkpRPVV4QDXwT3UQy46zGkAZDgK/iytefvHgCrkJsqZUH6cLnNbABSxd5Jhhf1IbkMXv8Qux7hH1Ic1xvk/jBWy6gavumvtwx7ectwZXkKh7MA95XgObeOtpI2U4zl0kGbpxgiPvwQUcXLrKFchc82f6Ur0PK49azOnmOI4TBu84zm4SV38DeIVYkrYJyNbAAAAAElFTkSuQmCC"
|
catch { destroy .moon_new }
|
||||||
image create photo new -data "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAGQAAABkABchkaRQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAC6SURBVDiNpdNNbsIwFATgL0HKolchHKBX6yFaBOEyoPYUabvOIVKJRaCL2JX5TRNGGvnJ8ozGz89cYoElPvET+BX2yivn/1Bggw5HHMKa1h2qcPZC/JEIhvh+brIZIY6sorhMYo9hh3KGFzzfa84NZNjDt9OG/ZcH1BlaPE1IAG0+URhxzNGESKPFaHJs9Q0Ziww7HnvGeXSrJhis0jiFfjwnj3I0WRv+TKtr4hQl3lDrZ6QN9Wt654hfWfGDmBpUwDkAAAAASUVORK5CYII="
|
catch { destroy .moon_first }
|
||||||
image create photo last -data "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAGQAAABkABchkaRQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADmSURBVDiNndMxTsNAEIXhzy5yCyQ6FAgcE7oQheQWUAAl5BIkREoZrgB0GFNkHBl7bURGsryaee/3jHeXdpxjghU+8InXyI0S+n0MMEeBEi+4jfV3vAvMQtsyL0J0j2GtViaeRRMyj8IlsgY8BSijE2Kur/hy09wHKMJrEolhwtwHKDHOsI4OLnoAXfl1jiNsOkR9keE4P8D4q4scbzg5xIxtjie709f1E7siC+9+Gx/8fxvPKtEsklcJSBdgWhcN8ByFR5z+AWgd5QpyE+OUWOJO+zJNU+Z6jHAdgHe7K73CuD5zFT9nCmRDIssCaAAAAABJRU5ErkJggg=="
|
catch { destroy .moon_full }
|
||||||
|
catch { destroy .moon_last }
|
||||||
|
|
||||||
|
set extra 1
|
||||||
|
#set wid [font measure CalboxFont 0]
|
||||||
|
set wid [font metrics CalboxFont -ascent]
|
||||||
|
set orig_wid $wid
|
||||||
|
incr wid $extra
|
||||||
|
incr wid $extra
|
||||||
|
incr wid $extra
|
||||||
|
incr wid $extra
|
||||||
|
incr orig_wid $extra
|
||||||
|
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 {}
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
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 {}
|
||||||
|
|
||||||
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
@@ -3631,7 +3779,7 @@ proc SetFonts {} {
|
|||||||
proc SetupInotify {} {
|
proc SetupInotify {} {
|
||||||
global InotifyFP
|
global InotifyFP
|
||||||
global ReminderFile
|
global ReminderFile
|
||||||
set failed [catch {set InotifyFP [open "|inotifywait -q -m -e close_write -e move -e create -e delete $ReminderFile" "r"] } ]
|
set failed [catch {set InotifyFP [open "|inotifywait -r -q -m -e close_write -e move -e create -e delete $ReminderFile < /dev/null 2>/dev/null" "r"] } ]
|
||||||
if {$failed} {
|
if {$failed} {
|
||||||
# inotifywait probably not available... meh.
|
# inotifywait probably not available... meh.
|
||||||
return
|
return
|
||||||
@@ -3805,4 +3953,47 @@ proc PickColor {index button} {
|
|||||||
raise .opt
|
raise .opt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc FindConfigFile {} {
|
||||||
|
global ConfigFile
|
||||||
|
|
||||||
|
# If it was set on the command line, use that
|
||||||
|
if {"$ConfigFile" != ""} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
set confighome ""
|
||||||
|
if {[info exists env(XDG_CONFIG_HOME)]} {
|
||||||
|
set confighome $env(XDG_CONFIG_HOME)
|
||||||
|
}
|
||||||
|
if {"$confighome" == ""} {
|
||||||
|
set confighome "~/.config"
|
||||||
|
}
|
||||||
|
|
||||||
|
# If $confighome does not exist, attempt to
|
||||||
|
# create it
|
||||||
|
if {![file exists $confighome]} {
|
||||||
|
catch { file mkdir $confighome }
|
||||||
|
}
|
||||||
|
|
||||||
|
if {[file isdirectory $confighome]} {
|
||||||
|
# Migrate .tkremindrc to $confighome/tkremindrc
|
||||||
|
if {[file exists "~/.tkremindrc"]} {
|
||||||
|
if {![file exists "$confighome/tkreminderc"]} {
|
||||||
|
puts "Migrating ~/.tkremindrc to $confighome/tkremindrc"
|
||||||
|
if {[catch { file copy "~/.tkremindrc" "$confighome/tkremindrc"}]} {
|
||||||
|
puts "FAILED!\n"
|
||||||
|
set ConfigFile "~/.tkremindrc"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
catch { file delete "~/.tkremindrc" }
|
||||||
|
}
|
||||||
|
set ConfigFile "$confighome/tkremindrc"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
set ConfigFile "$confighome/tkremindrc"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
set ConfigFile "~/.tkremindrc"
|
||||||
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|||||||
229
src/calendar.c
229
src/calendar.c
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#define _XOPEN_SOURCE
|
#define _XOPEN_SOURCE
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "custom.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -247,6 +248,28 @@ static void WriteBottomCalLine (void);
|
|||||||
static void WriteIntermediateCalLine (void);
|
static void WriteIntermediateCalLine (void);
|
||||||
static void WriteCalDays (void);
|
static void WriteCalDays (void);
|
||||||
|
|
||||||
|
static char const *
|
||||||
|
despace(char const *s)
|
||||||
|
{
|
||||||
|
static char buf[256];
|
||||||
|
|
||||||
|
char *t = buf;
|
||||||
|
if (strlen(s) > sizeof(buf)-1) {
|
||||||
|
/* Punt. :( */
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
while (*s) {
|
||||||
|
if (isspace(*s)) {
|
||||||
|
*t++ = '_';
|
||||||
|
} else {
|
||||||
|
*t++ = *s;
|
||||||
|
}
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
*t = 0;
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
void PrintJSONString(char const *s)
|
void PrintJSONString(char const *s)
|
||||||
{
|
{
|
||||||
while (*s) {
|
while (*s) {
|
||||||
@@ -346,6 +369,41 @@ static void PutWideChar(wchar_t const wc)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static char const *
|
||||||
|
get_month_abbrev(char const *mon)
|
||||||
|
{
|
||||||
|
static char buf[80];
|
||||||
|
#ifndef REM_USE_WCHAR
|
||||||
|
sprintf(buf, "%.3s", mon);
|
||||||
|
return buf;
|
||||||
|
#else
|
||||||
|
char *s;
|
||||||
|
wchar_t tmp_buf[128];
|
||||||
|
wchar_t *ws;
|
||||||
|
int i;
|
||||||
|
int len;
|
||||||
|
|
||||||
|
*buf = 0;
|
||||||
|
(void) mbstowcs(tmp_buf, mon, 127);
|
||||||
|
ws = tmp_buf;
|
||||||
|
s = buf;
|
||||||
|
for (i=0; i<3; i++) {
|
||||||
|
if (*ws) {
|
||||||
|
len = wctomb(s, *ws);
|
||||||
|
s += len;
|
||||||
|
if (wcwidth(*ws) == 0) {
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
ws++;
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*s = 0;
|
||||||
|
return buf;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static int make_wchar_versions(CalEntry *e)
|
static int make_wchar_versions(CalEntry *e)
|
||||||
{
|
{
|
||||||
#ifdef REM_USE_WCHAR
|
#ifdef REM_USE_WCHAR
|
||||||
@@ -543,9 +601,11 @@ void ProduceCalendar(void)
|
|||||||
ColSpaces = (CalWidth - 9) / 7;
|
ColSpaces = (CalWidth - 9) / 7;
|
||||||
CalWidth = 7*ColSpaces + 8;
|
CalWidth = 7*ColSpaces + 8;
|
||||||
|
|
||||||
|
/* Run the file once to get potentially-overridden day names */
|
||||||
if (CalMonths) {
|
if (CalMonths) {
|
||||||
FromJulian(JulianToday, &y, &m, &d);
|
FromJulian(JulianToday, &y, &m, &d);
|
||||||
JulianToday = Julian(y, m, 1);
|
JulianToday = Julian(y, m, 1);
|
||||||
|
GenerateCalEntries(-1);
|
||||||
DidAMonth = 0;
|
DidAMonth = 0;
|
||||||
if (PsCal == PSCAL_LEVEL3) {
|
if (PsCal == PSCAL_LEVEL3) {
|
||||||
printf("[\n");
|
printf("[\n");
|
||||||
@@ -562,6 +622,8 @@ void ProduceCalendar(void)
|
|||||||
if (MondayFirst) JulianToday -= (JulianToday%7);
|
if (MondayFirst) JulianToday -= (JulianToday%7);
|
||||||
else JulianToday -= ((JulianToday+1)%7);
|
else JulianToday -= ((JulianToday+1)%7);
|
||||||
|
|
||||||
|
GenerateCalEntries(-1);
|
||||||
|
|
||||||
if (!DoSimpleCalendar) {
|
if (!DoSimpleCalendar) {
|
||||||
WriteWeekHeaderLine();
|
WriteWeekHeaderLine();
|
||||||
WriteCalDays();
|
WriteCalDays();
|
||||||
@@ -584,7 +646,7 @@ void ProduceCalendar(void)
|
|||||||
static void DoCalendarOneWeek(int nleft)
|
static void DoCalendarOneWeek(int nleft)
|
||||||
{
|
{
|
||||||
int y, m, d, done, i, l, wd;
|
int y, m, d, done, i, l, wd;
|
||||||
char buf[81];
|
char buf[128];
|
||||||
int LinesWritten = 0;
|
int LinesWritten = 0;
|
||||||
int OrigJul = JulianToday;
|
int OrigJul = JulianToday;
|
||||||
|
|
||||||
@@ -612,8 +674,8 @@ static void DoCalendarOneWeek(int nleft)
|
|||||||
goff();
|
goff();
|
||||||
for (i=0; i<7; i++) {
|
for (i=0; i<7; i++) {
|
||||||
FromJulian(OrigJul+i, &y, &m, &d);
|
FromJulian(OrigJul+i, &y, &m, &d);
|
||||||
sprintf(buf, "%d %c%c%c ", d, MonthName[m][0], MonthName[m][1],
|
char const *mon = get_month_name(m);
|
||||||
MonthName[m][2]);
|
snprintf(buf, sizeof(buf), "%d %s ", d, get_month_abbrev(mon));
|
||||||
if (OrigJul+i == RealToday)
|
if (OrigJul+i == RealToday)
|
||||||
PrintLeft(buf, ColSpaces, '*');
|
PrintLeft(buf, ColSpaces, '*');
|
||||||
else
|
else
|
||||||
@@ -622,7 +684,7 @@ static void DoCalendarOneWeek(int nleft)
|
|||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
goff();
|
goff();
|
||||||
}
|
}
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
for (l=0; l<CalPad; l++) {
|
for (l=0; l<CalPad; l++) {
|
||||||
gon();
|
gon();
|
||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
@@ -633,7 +695,7 @@ static void DoCalendarOneWeek(int nleft)
|
|||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
goff();
|
goff();
|
||||||
}
|
}
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write the body lines */
|
/* Write the body lines */
|
||||||
@@ -654,7 +716,7 @@ static void DoCalendarOneWeek(int nleft)
|
|||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
goff();
|
goff();
|
||||||
}
|
}
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write the final line */
|
/* Write the final line */
|
||||||
@@ -674,7 +736,7 @@ static void DoCalendarOneWeek(int nleft)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static void DoCalendarOneMonth(void)
|
static void DoCalendarOneMonth(void)
|
||||||
{
|
{
|
||||||
int y, m, d, mm, yy;
|
int y, m, d, mm, yy, i, j;
|
||||||
|
|
||||||
if (!DoSimpleCalendar) WriteCalHeader();
|
if (!DoSimpleCalendar) WriteCalHeader();
|
||||||
|
|
||||||
@@ -694,20 +756,26 @@ static void DoCalendarOneMonth(void)
|
|||||||
}
|
}
|
||||||
if (PsCal < PSCAL_LEVEL3) {
|
if (PsCal < PSCAL_LEVEL3) {
|
||||||
printf("%s %d %d %d %d\n",
|
printf("%s %d %d %d %d\n",
|
||||||
MonthName[m], y, DaysInMonth(m, y), (JulianToday+1) % 7,
|
despace(get_month_name(m)), y, DaysInMonth(m, y), (JulianToday+1) % 7,
|
||||||
MondayFirst);
|
MondayFirst);
|
||||||
printf("%s %s %s %s %s %s %s\n",
|
for (i=0; i<7; i++) {
|
||||||
DayName[6], DayName[0], DayName[1], DayName[2],
|
j=(i+6)%7;
|
||||||
DayName[3], DayName[4], DayName[5]);
|
if (i) {
|
||||||
|
printf(" %s", despace(get_day_name(j)));
|
||||||
|
} else {
|
||||||
|
printf("%s", despace(get_day_name(j)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
} else {
|
} else {
|
||||||
PrintJSONKeyPairString("monthname", MonthName[m]);
|
PrintJSONKeyPairString("monthname", get_month_name(m));
|
||||||
PrintJSONKeyPairInt("year", y);
|
PrintJSONKeyPairInt("year", y);
|
||||||
PrintJSONKeyPairInt("daysinmonth", DaysInMonth(m, y));
|
PrintJSONKeyPairInt("daysinmonth", DaysInMonth(m, y));
|
||||||
PrintJSONKeyPairInt("firstwkday", (JulianToday+1) % 7);
|
PrintJSONKeyPairInt("firstwkday", (JulianToday+1) % 7);
|
||||||
PrintJSONKeyPairInt("mondayfirst", MondayFirst);
|
PrintJSONKeyPairInt("mondayfirst", MondayFirst);
|
||||||
printf("\"daynames\":[\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"],",
|
printf("\"daynames\":[\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\"],",
|
||||||
DayName[6], DayName[0], DayName[1], DayName[2],
|
get_day_name(6), get_day_name(0), get_day_name(1), get_day_name(2),
|
||||||
DayName[3], DayName[4], DayName[5]);
|
get_day_name(3), get_day_name(4), get_day_name(5));
|
||||||
}
|
}
|
||||||
mm = m-1;
|
mm = m-1;
|
||||||
if (mm<0) {
|
if (mm<0) {
|
||||||
@@ -715,9 +783,9 @@ static void DoCalendarOneMonth(void)
|
|||||||
} else yy=y;
|
} else yy=y;
|
||||||
|
|
||||||
if (PsCal < PSCAL_LEVEL3) {
|
if (PsCal < PSCAL_LEVEL3) {
|
||||||
printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
|
printf("%s %d\n", despace(get_month_name(mm)), DaysInMonth(mm,yy));
|
||||||
} else {
|
} else {
|
||||||
PrintJSONKeyPairString("prevmonthname", MonthName[mm]);
|
PrintJSONKeyPairString("prevmonthname", get_month_name(mm));
|
||||||
PrintJSONKeyPairInt("daysinprevmonth", DaysInMonth(mm, yy));
|
PrintJSONKeyPairInt("daysinprevmonth", DaysInMonth(mm, yy));
|
||||||
PrintJSONKeyPairInt("prevmonthyear", yy);
|
PrintJSONKeyPairInt("prevmonthyear", yy);
|
||||||
}
|
}
|
||||||
@@ -726,9 +794,9 @@ static void DoCalendarOneMonth(void)
|
|||||||
mm = 0; yy = y+1;
|
mm = 0; yy = y+1;
|
||||||
} else yy=y;
|
} else yy=y;
|
||||||
if (PsCal < PSCAL_LEVEL3) {
|
if (PsCal < PSCAL_LEVEL3) {
|
||||||
printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
|
printf("%s %d\n", despace(get_month_name(mm)), DaysInMonth(mm,yy));
|
||||||
} else {
|
} else {
|
||||||
PrintJSONKeyPairString("nextmonthname", MonthName[mm]);
|
PrintJSONKeyPairString("nextmonthname", get_month_name(mm));
|
||||||
PrintJSONKeyPairInt("daysinnextmonth", DaysInMonth(mm, yy));
|
PrintJSONKeyPairInt("daysinnextmonth", DaysInMonth(mm, yy));
|
||||||
PrintJSONKeyPairInt("nextmonthyear", yy);
|
PrintJSONKeyPairInt("nextmonthyear", yy);
|
||||||
printf("\"entries\":[\n");
|
printf("\"entries\":[\n");
|
||||||
@@ -799,7 +867,7 @@ static int WriteCalendarRow(void)
|
|||||||
sprintf(buf, "%d ", d+i-wd);
|
sprintf(buf, "%d ", d+i-wd);
|
||||||
if (Julian(y, m, d+i-wd) == RealToday) {
|
if (Julian(y, m, d+i-wd) == RealToday) {
|
||||||
PrintLeft(buf, ColSpaces-1, '*');
|
PrintLeft(buf, ColSpaces-1, '*');
|
||||||
PutChar(' ');
|
putchar(' ');
|
||||||
} else {
|
} else {
|
||||||
PrintLeft(buf, ColSpaces, ' ');
|
PrintLeft(buf, ColSpaces, ' ');
|
||||||
}
|
}
|
||||||
@@ -808,7 +876,7 @@ static int WriteCalendarRow(void)
|
|||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
goff();
|
goff();
|
||||||
}
|
}
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
for (l=0; l<CalPad; l++) {
|
for (l=0; l<CalPad; l++) {
|
||||||
gon();
|
gon();
|
||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
@@ -819,7 +887,7 @@ static int WriteCalendarRow(void)
|
|||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
goff();
|
goff();
|
||||||
}
|
}
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Write the body lines */
|
/* Write the body lines */
|
||||||
@@ -840,7 +908,7 @@ static int WriteCalendarRow(void)
|
|||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
goff();
|
goff();
|
||||||
}
|
}
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
moreleft = (d+7-wd <= DaysInMonth(m, y));
|
moreleft = (d+7-wd <= DaysInMonth(m, y));
|
||||||
@@ -863,9 +931,54 @@ static int WriteCalendarRow(void)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static void PrintLeft(char const *s, int width, char pad)
|
static void PrintLeft(char const *s, int width, char pad)
|
||||||
{
|
{
|
||||||
|
#ifndef REM_USE_WCHAR
|
||||||
int len = strlen(s);
|
int len = strlen(s);
|
||||||
printf("%s", s);
|
printf("%s", s);
|
||||||
while (len++ < width) PutChar(pad);
|
while (len++ < width) putchar(pad);
|
||||||
|
#else
|
||||||
|
size_t len = mbstowcs(NULL, s, 0);
|
||||||
|
int i;
|
||||||
|
wchar_t static_buf[128];
|
||||||
|
wchar_t *buf;
|
||||||
|
wchar_t *ws;
|
||||||
|
int display_len;
|
||||||
|
|
||||||
|
if (!len) {
|
||||||
|
for (i=0; i<width; i++) {
|
||||||
|
fputc(pad, stdout);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (len + 1 <= 128) {
|
||||||
|
buf = static_buf;
|
||||||
|
} else {
|
||||||
|
buf = calloc(len+1, sizeof(wchar_t));
|
||||||
|
if (!buf) {
|
||||||
|
/* Uh-oh... cannot recover */
|
||||||
|
fprintf(stderr, "%s\n", ErrMsg[E_NO_MEM]);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
(void) mbstowcs(buf, s, len+1);
|
||||||
|
display_len = wcswidth(buf, len+1);
|
||||||
|
|
||||||
|
ws = buf;
|
||||||
|
for (i=0; i<width;) {
|
||||||
|
if (*ws) {
|
||||||
|
PutWideChar(*ws++);
|
||||||
|
i+= wcwidth(*ws);
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* Mop up any potential combining characters */
|
||||||
|
while (*ws && wcwidth(*ws) == 0) {
|
||||||
|
PutWideChar(*ws++);
|
||||||
|
}
|
||||||
|
for (i=display_len; i<width; i++) fputc(pad, stdout);
|
||||||
|
if (buf != static_buf) free(buf);
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -886,10 +999,10 @@ static void PrintCentered(char const *s, int width, char *pad)
|
|||||||
for (i=0; i<width; i++) {
|
for (i=0; i<width; i++) {
|
||||||
if (*s) {
|
if (*s) {
|
||||||
if (isspace(*s)) {
|
if (isspace(*s)) {
|
||||||
PutChar(' ');
|
putchar(' ');
|
||||||
s++;
|
s++;
|
||||||
} else {
|
} else {
|
||||||
PutChar(*s++);
|
putchar(*s++);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
@@ -942,7 +1055,7 @@ static void PrintCentered(char const *s, int width, char *pad)
|
|||||||
while (*ws && wcwidth(*ws) == 0) {
|
while (*ws && wcwidth(*ws) == 0) {
|
||||||
PutWideChar(*ws++);
|
PutWideChar(*ws++);
|
||||||
}
|
}
|
||||||
for (i=d+len; i<width; i++) fputs(pad, stdout);
|
for (i=d+display_len; i<width; i++) fputs(pad, stdout);
|
||||||
if (buf != static_buf) free(buf);
|
if (buf != static_buf) free(buf);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -971,7 +1084,7 @@ static int WriteOneCalLine(void)
|
|||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
goff();
|
goff();
|
||||||
}
|
}
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
|
|
||||||
return done;
|
return done;
|
||||||
}
|
}
|
||||||
@@ -1044,7 +1157,7 @@ static int WriteOneColLine(int col)
|
|||||||
for (ws = e->wc_pos; ws - e->wc_pos < ColSpaces; ws++) {
|
for (ws = e->wc_pos; ws - e->wc_pos < ColSpaces; ws++) {
|
||||||
if (!*ws) break;
|
if (!*ws) break;
|
||||||
if (iswspace(*ws)) {
|
if (iswspace(*ws)) {
|
||||||
PutChar(' ');
|
putchar(' ');
|
||||||
numwritten++;
|
numwritten++;
|
||||||
} else {
|
} else {
|
||||||
if (wcwidth(*ws) > 0) {
|
if (wcwidth(*ws) > 0) {
|
||||||
@@ -1059,7 +1172,7 @@ static int WriteOneColLine(int col)
|
|||||||
for (ws = e->wc_pos; ws<wspace; ws++) {
|
for (ws = e->wc_pos; ws<wspace; ws++) {
|
||||||
if (!*ws) break;
|
if (!*ws) break;
|
||||||
if (iswspace(*ws)) {
|
if (iswspace(*ws)) {
|
||||||
PutChar(' ');
|
putchar(' ');
|
||||||
numwritten++;
|
numwritten++;
|
||||||
} else {
|
} else {
|
||||||
if (wcwidth(*ws) > 0) {
|
if (wcwidth(*ws) > 0) {
|
||||||
@@ -1076,7 +1189,7 @@ static int WriteOneColLine(int col)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Flesh out the rest of the column */
|
/* Flesh out the rest of the column */
|
||||||
while(numwritten++ < ColSpaces) PutChar(' ');
|
while(numwritten++ < ColSpaces) putchar(' ');
|
||||||
|
|
||||||
/* Skip any spaces before next word */
|
/* Skip any spaces before next word */
|
||||||
while (iswspace(*ws)) ws++;
|
while (iswspace(*ws)) ws++;
|
||||||
@@ -1131,9 +1244,9 @@ static int WriteOneColLine(int col)
|
|||||||
if (!*s) break;
|
if (!*s) break;
|
||||||
numwritten++;
|
numwritten++;
|
||||||
if (isspace(*s)) {
|
if (isspace(*s)) {
|
||||||
PutChar(' ');
|
putchar(' ');
|
||||||
} else {
|
} else {
|
||||||
PutChar(*s);
|
putchar(*s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e->pos = s;
|
e->pos = s;
|
||||||
@@ -1143,9 +1256,9 @@ static int WriteOneColLine(int col)
|
|||||||
if (!*s) break;
|
if (!*s) break;
|
||||||
numwritten++;
|
numwritten++;
|
||||||
if (isspace(*s)) {
|
if (isspace(*s)) {
|
||||||
PutChar(' ');
|
putchar(' ');
|
||||||
} else {
|
} else {
|
||||||
PutChar(*s);
|
putchar(*s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1156,7 +1269,7 @@ static int WriteOneColLine(int col)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Flesh out the rest of the column */
|
/* Flesh out the rest of the column */
|
||||||
while(numwritten++ < ColSpaces) PutChar(' ');
|
while(numwritten++ < ColSpaces) putchar(' ');
|
||||||
|
|
||||||
/* Skip any spaces before next word */
|
/* Skip any spaces before next word */
|
||||||
while (isspace(*s)) s++;
|
while (isspace(*s)) s++;
|
||||||
@@ -1238,7 +1351,10 @@ static void GenerateCalEntries(int col)
|
|||||||
case T_IfTrig: r=DoIfTrig(&p); break;
|
case T_IfTrig: r=DoIfTrig(&p); break;
|
||||||
case T_Else: r=DoElse(&p); break;
|
case T_Else: r=DoElse(&p); break;
|
||||||
case T_EndIf: r=DoEndif(&p); break;
|
case T_EndIf: r=DoEndif(&p); break;
|
||||||
case T_Include: r=DoInclude(&p); break;
|
|
||||||
|
case T_Include:
|
||||||
|
case T_IncludeR: r=DoInclude(&p, tok.type); break;
|
||||||
|
|
||||||
case T_IncludeCmd: r=DoIncludeCmd(&p); break;
|
case T_IncludeCmd: r=DoIncludeCmd(&p); break;
|
||||||
case T_Exit: DoExit(&p); break;
|
case T_Exit: DoExit(&p); break;
|
||||||
case T_Set: r=DoSet(&p); break;
|
case T_Set: r=DoSet(&p); break;
|
||||||
@@ -1296,7 +1412,7 @@ static void WriteCalHeader(void)
|
|||||||
int y, m, d;
|
int y, m, d;
|
||||||
|
|
||||||
FromJulian(JulianToday, &y, &m, &d);
|
FromJulian(JulianToday, &y, &m, &d);
|
||||||
sprintf(buf, "%s %d", MonthName[m], y);
|
sprintf(buf, "%s %d", get_month_name(m), y);
|
||||||
|
|
||||||
WriteTopCalLine();
|
WriteTopCalLine();
|
||||||
|
|
||||||
@@ -1307,7 +1423,7 @@ static void WriteCalHeader(void)
|
|||||||
gon();
|
gon();
|
||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
goff();
|
goff();
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
|
|
||||||
WritePostHeaderLine();
|
WritePostHeaderLine();
|
||||||
WriteCalDays();
|
WriteCalDays();
|
||||||
@@ -1321,7 +1437,7 @@ static void WriteCalHeader(void)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static void WriteCalTrailer(void)
|
static void WriteCalTrailer(void)
|
||||||
{
|
{
|
||||||
PutChar('\f');
|
putchar('\f');
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -1333,13 +1449,13 @@ static void WriteCalTrailer(void)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static int DoCalRem(ParsePtr p, int col)
|
static int DoCalRem(ParsePtr p, int col)
|
||||||
{
|
{
|
||||||
int oldLen;
|
size_t oldLen;
|
||||||
Trigger trig;
|
Trigger trig;
|
||||||
TimeTrig tim;
|
TimeTrig tim;
|
||||||
Value v;
|
Value v;
|
||||||
int r, err;
|
int r, err;
|
||||||
int jul;
|
int jul;
|
||||||
CalEntry *CurCol = CalColumn[col];
|
CalEntry *CurCol;
|
||||||
CalEntry *e;
|
CalEntry *e;
|
||||||
char const *s, *s2;
|
char const *s, *s2;
|
||||||
DynamicBuffer buf, obuf, pre_buf, raw_buf;
|
DynamicBuffer buf, obuf, pre_buf, raw_buf;
|
||||||
@@ -1348,6 +1464,11 @@ static int DoCalRem(ParsePtr p, int col)
|
|||||||
|
|
||||||
int is_color, col_r, col_g, col_b;
|
int is_color, col_r, col_g, col_b;
|
||||||
|
|
||||||
|
if (col >= 0) {
|
||||||
|
CurCol = CalColumn[col];
|
||||||
|
} else {
|
||||||
|
CurCol = NULL;
|
||||||
|
}
|
||||||
is_color = 0;
|
is_color = 0;
|
||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
DBufInit(&pre_buf);
|
DBufInit(&pre_buf);
|
||||||
@@ -1444,6 +1565,12 @@ static int DoCalRem(ParsePtr p, int col)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we're not actually generating any calendar entries, we're done */
|
||||||
|
if (col < 0) {
|
||||||
|
FreeTrig(&trig);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
/* Don't include timed reminders in calendar if -a option supplied. */
|
/* Don't include timed reminders in calendar if -a option supplied. */
|
||||||
if (DontIssueAts && tim.ttime != NO_TIME) {
|
if (DontIssueAts && tim.ttime != NO_TIME) {
|
||||||
FreeTrig(&trig);
|
FreeTrig(&trig);
|
||||||
@@ -1924,7 +2051,7 @@ static void WriteTopCalLine(void)
|
|||||||
PrintCentered("", CalWidth-2, linestruct->lr);
|
PrintCentered("", CalWidth-2, linestruct->lr);
|
||||||
DRAW(bl);
|
DRAW(bl);
|
||||||
goff();
|
goff();
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteBottomCalLine(void)
|
static void WriteBottomCalLine(void)
|
||||||
@@ -1941,7 +2068,7 @@ static void WriteBottomCalLine(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
goff();
|
goff();
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WritePostHeaderLine(void)
|
static void WritePostHeaderLine(void)
|
||||||
@@ -1958,7 +2085,7 @@ static void WritePostHeaderLine(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
goff();
|
goff();
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteWeekHeaderLine(void)
|
static void WriteWeekHeaderLine(void)
|
||||||
@@ -1975,7 +2102,7 @@ static void WriteWeekHeaderLine(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
goff();
|
goff();
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteIntermediateCalLine(void)
|
static void WriteIntermediateCalLine(void)
|
||||||
@@ -1993,7 +2120,7 @@ static void WriteIntermediateCalLine(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
goff();
|
goff();
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void WriteCalDays(void)
|
static void WriteCalDays(void)
|
||||||
@@ -2004,14 +2131,14 @@ static void WriteCalDays(void)
|
|||||||
goff();
|
goff();
|
||||||
for (i=0; i<7; i++) {
|
for (i=0; i<7; i++) {
|
||||||
if (!MondayFirst)
|
if (!MondayFirst)
|
||||||
PrintCentered(DayName[(i+6)%7], ColSpaces, " ");
|
PrintCentered(get_day_name((i+6)%7), ColSpaces, " ");
|
||||||
else
|
else
|
||||||
PrintCentered(DayName[i%7], ColSpaces, " ");
|
PrintCentered(get_day_name(i%7), ColSpaces, " ");
|
||||||
gon();
|
gon();
|
||||||
DRAW(tb);
|
DRAW(tb);
|
||||||
goff();
|
goff();
|
||||||
}
|
}
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -38,7 +38,4 @@
|
|||||||
/* The number of bytes in a unsigned long. */
|
/* The number of bytes in a unsigned long. */
|
||||||
#undef SIZEOF_UNSIGNED_LONG
|
#undef SIZEOF_UNSIGNED_LONG
|
||||||
|
|
||||||
/* The number of bytes in a unsigned short. */
|
|
||||||
#undef SIZEOF_UNSIGNED_SHORT
|
|
||||||
|
|
||||||
#include "custom.h"
|
#include "custom.h"
|
||||||
|
|||||||
80
src/custom.h
80
src/custom.h
@@ -11,22 +11,18 @@
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
/* DEFAULT_LATITUDE: Latitude of your location */
|
||||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
/* DEFAULT_LONGITUDE: Longitude of your location */
|
||||||
/* LOCATION: A string identifying your location. */
|
/* LOCATION: A string identifying your location. */
|
||||||
/* All latitude and longitude numbers should be positive for the */
|
/* Latitude and longitude should be positive for the */
|
||||||
/* northern and western hemisphere. If you live in the southern */
|
/* northern and eastern hemisphere and negative for the southern and */
|
||||||
/* hemisphere, ALL latitude values should be negative. If you live */
|
/* western hemisphere. */
|
||||||
/* in the eastern hemisphere, ALL longitude values should be negative. */
|
|
||||||
/* */
|
/* */
|
||||||
/* 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 DEFAULT_LATITUDE 45.42055555555555
|
||||||
#define LAT_MIN 24
|
#define DEFAULT_LONGITUDE -75.68972222222223
|
||||||
#define LAT_SEC 0
|
|
||||||
#define LON_DEG 75
|
|
||||||
#define LON_MIN 39
|
|
||||||
#define LON_SEC 0
|
|
||||||
#define LOCATION "Ottawa"
|
#define LOCATION "Ottawa"
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
@@ -58,45 +54,6 @@
|
|||||||
#define DATETIMESEP '@'
|
#define DATETIMESEP '@'
|
||||||
/* #define DATETIMESEP '/' */
|
/* #define DATETIMESEP '/' */
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* ISOLATIN1: define it to 1 if you use the */
|
|
||||||
/* ISO 8859-1 character set instead of ASCII. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define ISOLATIN1 1
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* ISOLATIN2: define it to 1 if you use the */
|
|
||||||
/* ISO 8859-2 character set instead of ASCII. */
|
|
||||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
|
||||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
|
||||||
/* then one are defined as 1, the results are unspecified. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define ISOLATIN2 0
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* IBMEXTENDED: define as 1 if your system uses the IBM extended */
|
|
||||||
/* character set. */
|
|
||||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
|
||||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
|
||||||
/* then one are defined as 1, the results are unspecified. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define IBMEXTENDED 0
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* IBM852: define as 1 if your system uses the IBM CPI-852 extended */
|
|
||||||
/* character set. */
|
|
||||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
|
||||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
|
||||||
/* then one are defined as 1, the results are unspecified. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define IBM852 0
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
|
||||||
/* the -u option. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define WANT_U_OPTION 1
|
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
@@ -114,16 +71,7 @@
|
|||||||
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
||||||
/* characters to be escaped with a backslash for the -k option. */
|
/* characters to be escaped with a backslash for the -k option. */
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
#if defined(UNIX)
|
|
||||||
#define WANT_SHELL_ESCAPING 1
|
#define WANT_SHELL_ESCAPING 1
|
||||||
#endif
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* Some implementations have a broken 'putc' and 'putchar'. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#ifdef __SASC_60
|
|
||||||
#define BROKEN_PUTC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
||||||
@@ -189,7 +137,7 @@
|
|||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
/* 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? */
|
/* How many global omits of the form MM DD do we handle? */
|
||||||
@@ -223,14 +171,6 @@
|
|||||||
#define PSBEGIN2 "# rem2ps2 begin"
|
#define PSBEGIN2 "# rem2ps2 begin"
|
||||||
#define PSEND2 "# rem2ps2 end"
|
#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)
|
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
|
||||||
#define REM_USE_WCHAR 1
|
#define REM_USE_WCHAR 1
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -11,22 +11,18 @@
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
/* DEFAULT_LATITUDE: Latitude of your location */
|
||||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
/* DEFAULT_LONGITUDE: Longitude of your location */
|
||||||
/* LOCATION: A string identifying your location. */
|
/* LOCATION: A string identifying your location. */
|
||||||
/* All latitude and longitude numbers should be positive for the */
|
/* Latitude and longitude should be positive for the */
|
||||||
/* northern and western hemisphere. If you live in the southern */
|
/* northern and eastern hemisphere and negative for the southern and */
|
||||||
/* hemisphere, ALL latitude values should be negative. If you live */
|
/* western hemisphere. */
|
||||||
/* in the eastern hemisphere, ALL longitude values should be negative. */
|
|
||||||
/* */
|
/* */
|
||||||
/* 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 DEFAULT_LATITUDE 45.42055555555555
|
||||||
#define LAT_MIN 24
|
#define DEFAULT_LONGITUDE -75.68972222222223
|
||||||
#define LAT_SEC 0
|
|
||||||
#define LON_DEG 75
|
|
||||||
#define LON_MIN 39
|
|
||||||
#define LON_SEC 0
|
|
||||||
#define LOCATION "Ottawa"
|
#define LOCATION "Ottawa"
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
@@ -58,45 +54,6 @@
|
|||||||
#define DATETIMESEP '@'
|
#define DATETIMESEP '@'
|
||||||
/* #define DATETIMESEP '/' */
|
/* #define DATETIMESEP '/' */
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* ISOLATIN1: define it to 1 if you use the */
|
|
||||||
/* ISO 8859-1 character set instead of ASCII. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define ISOLATIN1 1
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* ISOLATIN2: define it to 1 if you use the */
|
|
||||||
/* ISO 8859-2 character set instead of ASCII. */
|
|
||||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
|
||||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
|
||||||
/* then one are defined as 1, the results are unspecified. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define ISOLATIN2 0
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* IBMEXTENDED: define as 1 if your system uses the IBM extended */
|
|
||||||
/* character set. */
|
|
||||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
|
||||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
|
||||||
/* then one are defined as 1, the results are unspecified. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define IBMEXTENDED 0
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* IBM852: define as 1 if your system uses the IBM CPI-852 extended */
|
|
||||||
/* character set. */
|
|
||||||
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
|
|
||||||
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
|
|
||||||
/* then one are defined as 1, the results are unspecified. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define IBM852 0
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
|
||||||
/* the -u option. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#define WANT_U_OPTION 1
|
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
@@ -114,16 +71,7 @@
|
|||||||
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
||||||
/* characters to be escaped with a backslash for the -k option. */
|
/* characters to be escaped with a backslash for the -k option. */
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
#if defined(UNIX)
|
|
||||||
#define WANT_SHELL_ESCAPING 1
|
#define WANT_SHELL_ESCAPING 1
|
||||||
#endif
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
/* Some implementations have a broken 'putc' and 'putchar'. */
|
|
||||||
/*---------------------------------------------------------------------*/
|
|
||||||
#ifdef __SASC_60
|
|
||||||
#define BROKEN_PUTC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
||||||
@@ -189,7 +137,7 @@
|
|||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
/* 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? */
|
/* How many global omits of the form MM DD do we handle? */
|
||||||
@@ -223,14 +171,6 @@
|
|||||||
#define PSBEGIN2 "# rem2ps2 begin"
|
#define PSBEGIN2 "# rem2ps2 begin"
|
||||||
#define PSEND2 "# rem2ps2 end"
|
#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)
|
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
|
||||||
#define REM_USE_WCHAR 1
|
#define REM_USE_WCHAR 1
|
||||||
#else
|
#else
|
||||||
|
|||||||
13
src/dorem.c
13
src/dorem.c
@@ -234,7 +234,7 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
|||||||
DBufInit(&(trig->tags));
|
DBufInit(&(trig->tags));
|
||||||
trig->passthru[0] = 0;
|
trig->passthru[0] = 0;
|
||||||
tim->ttime = NO_TIME;
|
tim->ttime = NO_TIME;
|
||||||
tim->delta = NO_DELTA;
|
tim->delta = DefaultTDelta;
|
||||||
tim->rep = NO_REP;
|
tim->rep = NO_REP;
|
||||||
tim->duration = NO_TIME;
|
tim->duration = NO_TIME;
|
||||||
if (save_in_globals) {
|
if (save_in_globals) {
|
||||||
@@ -489,7 +489,7 @@ static int ParseTimeTrig(ParsePtr s, TimeTrig *tim, int save_in_globals)
|
|||||||
{
|
{
|
||||||
Token tok;
|
Token tok;
|
||||||
int r;
|
int r;
|
||||||
|
int seen_delta = 0;
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
|
|
||||||
@@ -506,8 +506,9 @@ static int ParseTimeTrig(ParsePtr s, TimeTrig *tim, int save_in_globals)
|
|||||||
|
|
||||||
case T_Delta:
|
case T_Delta:
|
||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
if (tim->delta != NO_DELTA) return E_DELTA_TWICE;
|
if (seen_delta) return E_DELTA_TWICE;
|
||||||
tim->delta = (tok.val > 0) ? tok.val : -tok.val;
|
seen_delta = 1;
|
||||||
|
tim->delta = (tok.val >= 0) ? tok.val : -tok.val;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_Rep:
|
case T_Rep:
|
||||||
@@ -1158,9 +1159,9 @@ int DoSatRemind(Trigger *trig, TimeTrig *tt, ParsePtr p)
|
|||||||
FromJulian(LastTriggerDate, &y, &m, &d);
|
FromJulian(LastTriggerDate, &y, &m, &d);
|
||||||
fprintf(ErrFp, "%s(%d): Trig(satisfied) = %s, %d %s, %d",
|
fprintf(ErrFp, "%s(%d): Trig(satisfied) = %s, %d %s, %d",
|
||||||
FileName, LineNo,
|
FileName, LineNo,
|
||||||
DayName[LastTriggerDate % 7],
|
get_day_name(LastTriggerDate % 7),
|
||||||
d,
|
d,
|
||||||
MonthName[m],
|
get_month_name(m),
|
||||||
y);
|
y);
|
||||||
if (tt->ttime != NO_TIME) {
|
if (tt->ttime != NO_TIME) {
|
||||||
fprintf(ErrFp, " AT %02d:%02d",
|
fprintf(ErrFp, " AT %02d:%02d",
|
||||||
|
|||||||
@@ -219,11 +219,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
L_A_OVER
|
L_A_OVER
|
||||||
#else
|
#else
|
||||||
if (altmode == '*') {
|
if (altmode == '*') {
|
||||||
sprintf(s, "%s, %d %s, %d", DayName[jul%7], d,
|
sprintf(s, "%s, %d %s, %d", get_day_name(jul%7), d,
|
||||||
MonthName[m], y);
|
get_month_name(m), y);
|
||||||
} else {
|
} else {
|
||||||
sprintf(s, "%s %s, %d %s, %d", L_ON, DayName[jul%7], d,
|
sprintf(s, "%s %s, %d %s, %d", L_ON, get_day_name(jul%7), d,
|
||||||
MonthName[m], y);
|
get_month_name(m), y);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SHIP_OUT(s);
|
SHIP_OUT(s);
|
||||||
@@ -243,9 +243,9 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
L_C_OVER
|
L_C_OVER
|
||||||
#else
|
#else
|
||||||
if (altmode == '*') {
|
if (altmode == '*') {
|
||||||
sprintf(s, "%s", DayName[jul%7]);
|
sprintf(s, "%s", get_day_name(jul%7));
|
||||||
} else {
|
} else {
|
||||||
sprintf(s, "%s %s", L_ON, DayName[jul%7]);
|
sprintf(s, "%s %s", L_ON, get_day_name(jul%7));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SHIP_OUT(s);
|
SHIP_OUT(s);
|
||||||
@@ -293,9 +293,9 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
L_G_OVER
|
L_G_OVER
|
||||||
#else
|
#else
|
||||||
if (altmode == '*') {
|
if (altmode == '*') {
|
||||||
sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
|
sprintf(s, "%s, %d %s", get_day_name(jul%7), d, get_month_name(m));
|
||||||
} else {
|
} else {
|
||||||
sprintf(s, "%s %s, %d %s", L_ON, DayName[jul%7], d, MonthName[m]);
|
sprintf(s, "%s %s, %d %s", L_ON, get_day_name(jul%7), d, get_month_name(m));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SHIP_OUT(s);
|
SHIP_OUT(s);
|
||||||
@@ -332,11 +332,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
L_J_OVER
|
L_J_OVER
|
||||||
#else
|
#else
|
||||||
if (altmode == '*') {
|
if (altmode == '*') {
|
||||||
sprintf(s, "%s, %s %d%s, %d", DayName[jul%7],
|
sprintf(s, "%s, %s %d%s, %d", get_day_name(jul%7),
|
||||||
MonthName[m], d, plu, y);
|
get_month_name(m), d, plu, y);
|
||||||
} else {
|
} else {
|
||||||
sprintf(s, "%s %s, %s %d%s, %d", L_ON, DayName[jul%7],
|
sprintf(s, "%s %s, %s %d%s, %d", L_ON, get_day_name(jul%7),
|
||||||
MonthName[m], d, plu, y);
|
get_month_name(m), d, plu, y);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SHIP_OUT(s);
|
SHIP_OUT(s);
|
||||||
@@ -347,11 +347,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
L_K_OVER
|
L_K_OVER
|
||||||
#else
|
#else
|
||||||
if (altmode == '*') {
|
if (altmode == '*') {
|
||||||
sprintf(s, "%s, %s %d%s", DayName[jul%7],
|
sprintf(s, "%s, %s %d%s", get_day_name(jul%7),
|
||||||
MonthName[m], d, plu);
|
get_month_name(m), d, plu);
|
||||||
} else {
|
} else {
|
||||||
sprintf(s, "%s %s, %s %d%s", L_ON, DayName[jul%7],
|
sprintf(s, "%s %s, %s %d%s", L_ON, get_day_name(jul%7),
|
||||||
MonthName[m], d, plu);
|
get_month_name(m), d, plu);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SHIP_OUT(s);
|
SHIP_OUT(s);
|
||||||
@@ -374,7 +374,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
#ifdef L_M_OVER
|
#ifdef L_M_OVER
|
||||||
L_M_OVER
|
L_M_OVER
|
||||||
#else
|
#else
|
||||||
sprintf(s, "%s", MonthName[m]);
|
sprintf(s, "%s", get_month_name(m));
|
||||||
#endif
|
#endif
|
||||||
SHIP_OUT(s);
|
SHIP_OUT(s);
|
||||||
break;
|
break;
|
||||||
@@ -448,11 +448,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
L_U_OVER
|
L_U_OVER
|
||||||
#else
|
#else
|
||||||
if (altmode == '*') {
|
if (altmode == '*') {
|
||||||
sprintf(s, "%s, %d%s %s, %d", DayName[jul%7], d,
|
sprintf(s, "%s, %d%s %s, %d", get_day_name(jul%7), d,
|
||||||
plu, MonthName[m], y);
|
plu, get_month_name(m), y);
|
||||||
} else {
|
} else {
|
||||||
sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], d,
|
sprintf(s, "%s %s, %d%s %s, %d", L_ON, get_day_name(jul%7), d,
|
||||||
plu, MonthName[m], y);
|
plu, get_month_name(m), y);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SHIP_OUT(s);
|
SHIP_OUT(s);
|
||||||
@@ -463,11 +463,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
L_V_OVER
|
L_V_OVER
|
||||||
#else
|
#else
|
||||||
if (altmode == '*') {
|
if (altmode == '*') {
|
||||||
sprintf(s, "%s, %d%s %s", DayName[jul%7], d, plu,
|
sprintf(s, "%s, %d%s %s", get_day_name(jul%7), d, plu,
|
||||||
MonthName[m]);
|
get_month_name(m));
|
||||||
} else {
|
} else {
|
||||||
sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu,
|
sprintf(s, "%s %s, %d%s %s", L_ON, get_day_name(jul%7), d, plu,
|
||||||
MonthName[m]);
|
get_month_name(m));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SHIP_OUT(s);
|
SHIP_OUT(s);
|
||||||
@@ -477,7 +477,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
#ifdef L_W_OVER
|
#ifdef L_W_OVER
|
||||||
L_W_OVER
|
L_W_OVER
|
||||||
#else
|
#else
|
||||||
sprintf(s, "%s", DayName[jul%7]);
|
sprintf(s, "%s", get_day_name(jul%7));
|
||||||
#endif
|
#endif
|
||||||
SHIP_OUT(s);
|
SHIP_OUT(s);
|
||||||
break;
|
break;
|
||||||
@@ -657,13 +657,8 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case '"':
|
case '"':
|
||||||
if (PsCal != PSCAL_LEVEL3) {
|
if (DBufPutc(dbuf, QUOTE_MARKER) != OK) return E_NO_MEM;
|
||||||
if (DBufPutc(dbuf, QUOTE_MARKER) != OK) return E_NO_MEM;
|
has_quote = 1;
|
||||||
has_quote = 1;
|
|
||||||
} else {
|
|
||||||
if (DBufPutc(dbuf, '%') != OK) return E_NO_MEM;
|
|
||||||
if (DBufPutc(dbuf, c) != OK) return E_NO_MEM;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -27,11 +27,11 @@
|
|||||||
Doubles the size of dynamic buffer until it has room for at least
|
Doubles the size of dynamic buffer until it has room for at least
|
||||||
'n' characters, not including trailing '\0'
|
'n' characters, not including trailing '\0'
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
static int DBufMakeRoom(DynamicBuffer *dbuf, int n)
|
static int DBufMakeRoom(DynamicBuffer *dbuf, size_t n)
|
||||||
{
|
{
|
||||||
/* Double size until it's greater than n (strictly > to leave room
|
/* Double size until it's greater than n (strictly > to leave room
|
||||||
for trailing '\0' */
|
for trailing '\0' */
|
||||||
int size = dbuf->allocatedLen;
|
size_t size = dbuf->allocatedLen;
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
if (size > n) return OK;
|
if (size > n) return OK;
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
#define DBUF_STATIC_SIZE 128
|
#define DBUF_STATIC_SIZE 128
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *buffer;
|
char *buffer;
|
||||||
int len;
|
size_t len;
|
||||||
int allocatedLen;
|
size_t allocatedLen;
|
||||||
char staticBuf[DBUF_STATIC_SIZE];
|
char staticBuf[DBUF_STATIC_SIZE];
|
||||||
} DynamicBuffer;
|
} DynamicBuffer;
|
||||||
|
|
||||||
|
|||||||
14
src/expr.c
14
src/expr.c
@@ -101,7 +101,7 @@ static int DebugPerform(Operator *op)
|
|||||||
fprintf(ErrFp, " => ");
|
fprintf(ErrFp, " => ");
|
||||||
if (!r) {
|
if (!r) {
|
||||||
PrintValue(&ValStack[ValStackPtr-1], ErrFp);
|
PrintValue(&ValStack[ValStackPtr-1], ErrFp);
|
||||||
Putc('\n', ErrFp);
|
putc('\n', ErrFp);
|
||||||
} else {
|
} else {
|
||||||
fprintf(ErrFp, "%s\n", ErrMsg[r]);
|
fprintf(ErrFp, "%s\n", ErrMsg[r]);
|
||||||
}
|
}
|
||||||
@@ -580,7 +580,7 @@ static int MakeValue(char const *s, Value *v, Var *locals, ParsePtr p)
|
|||||||
if (! (DebugFlag & DB_PRTEXPR)) return r;
|
if (! (DebugFlag & DB_PRTEXPR)) return r;
|
||||||
if (r == OK) {
|
if (r == OK) {
|
||||||
PrintValue(v, ErrFp);
|
PrintValue(v, ErrFp);
|
||||||
Putc('\n', ErrFp);
|
putc('\n', ErrFp);
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
} else { /* Must be a symbol */
|
} else { /* Must be a symbol */
|
||||||
@@ -591,7 +591,7 @@ static int MakeValue(char const *s, Value *v, Var *locals, ParsePtr p)
|
|||||||
if (! (DebugFlag & DB_PRTEXPR)) return r;
|
if (! (DebugFlag & DB_PRTEXPR)) return r;
|
||||||
if (r == OK) {
|
if (r == OK) {
|
||||||
PrintValue(v, ErrFp);
|
PrintValue(v, ErrFp);
|
||||||
Putc('\n', ErrFp);
|
putc('\n', ErrFp);
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@@ -828,7 +828,7 @@ static int Add(void)
|
|||||||
v3.type = STR_TYPE;
|
v3.type = STR_TYPE;
|
||||||
l1 = strlen(v1.v.str);
|
l1 = strlen(v1.v.str);
|
||||||
l2 = strlen(v2.v.str);
|
l2 = strlen(v2.v.str);
|
||||||
if (MaxStringLen && (l1 + l2 > (size_t) MaxStringLen)) {
|
if (MaxStringLen > 0 && (l1 + l2 > (size_t) MaxStringLen)) {
|
||||||
DestroyValue(v1); DestroyValue(v2);
|
DestroyValue(v1); DestroyValue(v2);
|
||||||
return E_STRING_TOO_LONG;
|
return E_STRING_TOO_LONG;
|
||||||
}
|
}
|
||||||
@@ -1232,9 +1232,9 @@ void PrintValue (Value *v, FILE *fp)
|
|||||||
|
|
||||||
if (v->type == STR_TYPE) {
|
if (v->type == STR_TYPE) {
|
||||||
s=v->v.str;
|
s=v->v.str;
|
||||||
Putc('"', fp);
|
putc('"', fp);
|
||||||
for (y=0; y<MAX_PRT_LEN && *s; y++) Putc(*s++, fp);
|
for (y=0; y<MAX_PRT_LEN && *s; y++) putc(*s++, fp);
|
||||||
Putc('"',fp);
|
putc('"',fp);
|
||||||
if (*s) fprintf(fp, "...");
|
if (*s) fprintf(fp, "...");
|
||||||
}
|
}
|
||||||
else if (v->type == INT_TYPE) fprintf(fp, "%d", v->v.val);
|
else if (v->type == INT_TYPE) fprintf(fp, "%d", v->v.val);
|
||||||
|
|||||||
57
src/files.c
57
src/files.c
@@ -557,23 +557,68 @@ static int PopFile(void)
|
|||||||
/* The INCLUDE command. */
|
/* The INCLUDE command. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int DoInclude(ParsePtr p)
|
int DoInclude(ParsePtr p, enum TokTypes tok)
|
||||||
{
|
{
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
|
DynamicBuffer fullname;
|
||||||
|
DynamicBuffer path;
|
||||||
int r, e;
|
int r, e;
|
||||||
|
|
||||||
|
r = OK;
|
||||||
|
char const *s;
|
||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
|
DBufInit(&fullname);
|
||||||
|
DBufInit(&path);
|
||||||
if ( (r=ParseToken(p, &buf)) ) return r;
|
if ( (r=ParseToken(p, &buf)) ) return r;
|
||||||
e = VerifyEoln(p);
|
e = VerifyEoln(p);
|
||||||
if (e) Eprint("%s", ErrMsg[e]);
|
if (e) Eprint("%s", ErrMsg[e]);
|
||||||
if ( (r=IncludeFile(DBufValue(&buf))) ) {
|
|
||||||
DBufFree(&buf);
|
if (tok == T_IncludeR && *(DBufValue(&buf)) != '/') {
|
||||||
return r;
|
/* Relative include: Include relative to dir
|
||||||
|
containing current file */
|
||||||
|
if (DBufPuts(&path, FileName) != OK) {
|
||||||
|
r = E_NO_MEM;
|
||||||
|
goto bailout;
|
||||||
|
}
|
||||||
|
if (DBufLen(&path) == 0) {
|
||||||
|
s = DBufValue(&buf);
|
||||||
|
} else {
|
||||||
|
char *t = DBufValue(&path) + DBufLen(&path) - 1;
|
||||||
|
while (t > DBufValue(&path) && *t != '/') t--;
|
||||||
|
if (*t == '/') {
|
||||||
|
*t = 0;
|
||||||
|
if (DBufPuts(&fullname, DBufValue(&path)) != OK) {
|
||||||
|
r = E_NO_MEM;
|
||||||
|
goto bailout;
|
||||||
|
}
|
||||||
|
if (DBufPuts(&fullname, "/") != OK) {
|
||||||
|
r = E_NO_MEM;
|
||||||
|
goto bailout;
|
||||||
|
}
|
||||||
|
if (DBufPuts(&fullname, DBufValue(&buf)) != OK) {
|
||||||
|
r = E_NO_MEM;
|
||||||
|
goto bailout;
|
||||||
|
}
|
||||||
|
s = DBufValue(&fullname);
|
||||||
|
} else {
|
||||||
|
s = DBufValue(&buf);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
s = DBufValue(&buf);
|
||||||
}
|
}
|
||||||
DBufFree(&buf);
|
if ( (r=IncludeFile(s)) ) {
|
||||||
|
goto bailout;
|
||||||
|
}
|
||||||
|
|
||||||
NumIfs = 0;
|
NumIfs = 0;
|
||||||
IfFlags = 0;
|
IfFlags = 0;
|
||||||
return OK;
|
|
||||||
|
bailout:
|
||||||
|
DBufFree(&buf);
|
||||||
|
DBufFree(&path);
|
||||||
|
DBufFree(&fullname);
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
66
src/funcs.c
66
src/funcs.c
@@ -58,6 +58,7 @@ static int FADusk (func_info *);
|
|||||||
static int FAbs (func_info *);
|
static int FAbs (func_info *);
|
||||||
static int FAccess (func_info *);
|
static int FAccess (func_info *);
|
||||||
static int FAmpm (func_info *);
|
static int FAmpm (func_info *);
|
||||||
|
static int FIsAny (func_info *);
|
||||||
static int FArgs (func_info *);
|
static int FArgs (func_info *);
|
||||||
static int FAsc (func_info *);
|
static int FAsc (func_info *);
|
||||||
static int FBaseyr (func_info *);
|
static int FBaseyr (func_info *);
|
||||||
@@ -239,6 +240,7 @@ BuiltinFunc Func[] = {
|
|||||||
{ "hour", 1, 1, 1, FHour },
|
{ "hour", 1, 1, 1, FHour },
|
||||||
{ "iif", 1, NO_MAX, 1, FIif },
|
{ "iif", 1, NO_MAX, 1, FIif },
|
||||||
{ "index", 2, 3, 1, FIndex },
|
{ "index", 2, 3, 1, FIndex },
|
||||||
|
{ "isany", 1, NO_MAX, 1, FIsAny },
|
||||||
{ "isdst", 0, 2, 0, FIsdst },
|
{ "isdst", 0, 2, 0, FIsdst },
|
||||||
{ "isleap", 1, 1, 1, FIsleap },
|
{ "isleap", 1, 1, 1, FIsleap },
|
||||||
{ "isomitted", 1, 1, 0, FIsomitted },
|
{ "isomitted", 1, 1, 0, FIsomitted },
|
||||||
@@ -409,8 +411,9 @@ static int RetStrVal(char const *s, func_info *info)
|
|||||||
if (!s) {
|
if (!s) {
|
||||||
RetVal.v.str = malloc(1);
|
RetVal.v.str = malloc(1);
|
||||||
if (RetVal.v.str) *RetVal.v.str = 0;
|
if (RetVal.v.str) *RetVal.v.str = 0;
|
||||||
} else
|
} else {
|
||||||
RetVal.v.str = StrDup(s);
|
RetVal.v.str = StrDup(s);
|
||||||
|
}
|
||||||
|
|
||||||
if (!RetVal.v.str) {
|
if (!RetVal.v.str) {
|
||||||
RetVal.type = ERR_TYPE;
|
RetVal.type = ERR_TYPE;
|
||||||
@@ -430,7 +433,9 @@ static int FStrlen(func_info *info)
|
|||||||
Value *v = &ARG(0);
|
Value *v = &ARG(0);
|
||||||
if (v->type != STR_TYPE) return E_BAD_TYPE;
|
if (v->type != STR_TYPE) return E_BAD_TYPE;
|
||||||
RetVal.type = INT_TYPE;
|
RetVal.type = INT_TYPE;
|
||||||
RETVAL = strlen(v->v.str);
|
size_t l = strlen(v->v.str);
|
||||||
|
if (l > INT_MAX) return E_2HIGH;
|
||||||
|
RETVAL = (int) l;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -786,8 +791,8 @@ static int FWkday(func_info *info)
|
|||||||
/* Convert 0=Sun to 0=Mon */
|
/* Convert 0=Sun to 0=Mon */
|
||||||
ARGV(0)--;
|
ARGV(0)--;
|
||||||
if (ARGV(0) < 0) ARGV(0) = 6;
|
if (ARGV(0) < 0) ARGV(0) = 6;
|
||||||
s = DayName[ARGV(0)];
|
s = get_day_name(ARGV(0));
|
||||||
} else s = DayName[DATEPART(ARG(0)) % 7];
|
} else s = get_day_name(DATEPART(ARG(0)) % 7);
|
||||||
return RetStrVal(s, info);
|
return RetStrVal(s, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -814,7 +819,7 @@ static int FMon(func_info *info)
|
|||||||
CacheDay = d;
|
CacheDay = d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s = MonthName[m];
|
s = get_month_name(m);
|
||||||
return RetStrVal(s, info);
|
return RetStrVal(s, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1033,6 +1038,36 @@ static int FPlural(func_info *info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
/* */
|
||||||
|
/* FIsAny */
|
||||||
|
/* Return 1 if the first arg equals any subsequent arg, 0 */
|
||||||
|
/* otherwise. */
|
||||||
|
/* */
|
||||||
|
/***************************************************************/
|
||||||
|
static int FIsAny(func_info *info)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
RetVal.type = INT_TYPE;
|
||||||
|
RETVAL = 0;
|
||||||
|
for (i=1; i<Nargs; i++) {
|
||||||
|
if (ARG(0).type == ARG(i).type) {
|
||||||
|
if (ARG(0).type == STR_TYPE) {
|
||||||
|
if (!strcmp(ARGSTR(0), ARGSTR(i))) {
|
||||||
|
RETVAL = 1;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (ARGV(0) == ARGV(i)) {
|
||||||
|
RETVAL = 1;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* FChoose */
|
/* FChoose */
|
||||||
@@ -1539,6 +1574,15 @@ static int FShell(func_info *info)
|
|||||||
ASSERT_TYPE(1, INT_TYPE);
|
ASSERT_TYPE(1, INT_TYPE);
|
||||||
maxlen = ARGV(1);
|
maxlen = ARGV(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Don't allow maxlen to exceed the maximum length of
|
||||||
|
a string variable */
|
||||||
|
if (MaxStringLen > 0) {
|
||||||
|
if (maxlen <= 0 || maxlen > MaxStringLen) {
|
||||||
|
maxlen = MaxStringLen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fp = popen(ARGSTR(0), "r");
|
fp = popen(ARGSTR(0), "r");
|
||||||
if (!fp) return E_IO_ERR;
|
if (!fp) return E_IO_ERR;
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -1552,7 +1596,7 @@ static int FShell(func_info *info)
|
|||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
return E_NO_MEM;
|
return E_NO_MEM;
|
||||||
}
|
}
|
||||||
if (maxlen > 0 && DBufLen(&buf) >= maxlen) {
|
if (maxlen > 0 && DBufLen(&buf) >= (size_t) maxlen) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2113,12 +2157,8 @@ static int SunStuff(int rise, double cosz, int jul)
|
|||||||
} else mins = MinsFromUTC;
|
} else mins = MinsFromUTC;
|
||||||
|
|
||||||
/* Get latitude and longitude */
|
/* Get latitude and longitude */
|
||||||
longdeg = (double) LongDeg + (double) LongMin / 60.0
|
longdeg = -Longitude;
|
||||||
+ (double) LongSec / 3600.0;
|
latitude = DEGRAD * Latitude;
|
||||||
|
|
||||||
latitude = DEGRAD * ((double) LatDeg + (double) LatMin / 60.0
|
|
||||||
+ (double) LatSec / 3600.0);
|
|
||||||
|
|
||||||
|
|
||||||
FromJulian(jul, &year, &mon, &day);
|
FromJulian(jul, &year, &mon, &day);
|
||||||
|
|
||||||
@@ -2372,6 +2412,7 @@ static int FPsshade(func_info *info)
|
|||||||
if (!psshade_warned) {
|
if (!psshade_warned) {
|
||||||
psshade_warned = 1;
|
psshade_warned = 1;
|
||||||
Eprint("psshade() is deprecated; use SPECIAL SHADE instead.");
|
Eprint("psshade() is deprecated; use SPECIAL SHADE instead.");
|
||||||
|
FreshLine = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(s, "/_A LineWidth 2 div def ");
|
sprintf(s, "/_A LineWidth 2 div def ");
|
||||||
@@ -2427,6 +2468,7 @@ static int FPsmoon(func_info *info)
|
|||||||
if (!psmoon_warned) {
|
if (!psmoon_warned) {
|
||||||
psmoon_warned = 1;
|
psmoon_warned = 1;
|
||||||
Eprint("psmoon() is deprecated; use SPECIAL MOON instead.");
|
Eprint("psmoon() is deprecated; use SPECIAL MOON instead.");
|
||||||
|
FreshLine = 1;
|
||||||
}
|
}
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
sprintf(sizebuf, "%d", size);
|
sprintf(sizebuf, "%d", size);
|
||||||
|
|||||||
@@ -17,6 +17,6 @@
|
|||||||
#include <stdio.h> /* For defintion of FILE - sigh! */
|
#include <stdio.h> /* For defintion of FILE - sigh! */
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "custom.h"
|
#include "custom.h"
|
||||||
#define MK_GLOBALS
|
#define MK_GLOBALS 1
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "err.h"
|
#include "err.h"
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ EXTERN INIT( int CalMonths, 0);
|
|||||||
EXTERN INIT( int Hush, 0);
|
EXTERN INIT( int Hush, 0);
|
||||||
EXTERN INIT( int NextMode, 0);
|
EXTERN INIT( int NextMode, 0);
|
||||||
EXTERN INIT( int InfiniteDelta, 0);
|
EXTERN INIT( int InfiniteDelta, 0);
|
||||||
|
EXTERN INIT( int DefaultTDelta, 0);
|
||||||
EXTERN INIT( int DeltaOffset, 0);
|
EXTERN INIT( int DeltaOffset, 0);
|
||||||
EXTERN INIT( int RunDisabled, 0);
|
EXTERN INIT( int RunDisabled, 0);
|
||||||
EXTERN INIT( int IgnoreOnce, 0);
|
EXTERN INIT( int IgnoreOnce, 0);
|
||||||
@@ -117,12 +118,15 @@ EXTERN INIT( int UseTrueColors, 0);
|
|||||||
EXTERN INIT( int TerminalBackground, TERMINAL_BACKGROUND_UNKNOWN);
|
EXTERN INIT( int TerminalBackground, TERMINAL_BACKGROUND_UNKNOWN);
|
||||||
|
|
||||||
/* Latitude and longitude */
|
/* Latitude and longitude */
|
||||||
EXTERN INIT( int LatDeg, LAT_DEG);
|
EXTERN INIT( int LatDeg, 0);
|
||||||
EXTERN INIT( int LatMin, LAT_MIN);
|
EXTERN INIT( int LatMin, 0);
|
||||||
EXTERN INIT( int LatSec, LAT_SEC);
|
EXTERN INIT( int LatSec, 0);
|
||||||
EXTERN INIT( int LongDeg, LON_DEG);
|
EXTERN INIT( int LongDeg, 0);
|
||||||
EXTERN INIT( int LongMin, LON_MIN);
|
EXTERN INIT( int LongMin, 0);
|
||||||
EXTERN INIT( int LongSec, LON_SEC);
|
EXTERN INIT( int LongSec, 0);
|
||||||
|
EXTERN INIT( double Longitude, DEFAULT_LONGITUDE);
|
||||||
|
EXTERN INIT( double Latitude, DEFAULT_LATITUDE);
|
||||||
|
|
||||||
EXTERN INIT( char *Location, LOCATION);
|
EXTERN INIT( char *Location, LOCATION);
|
||||||
|
|
||||||
/* UTC calculation stuff */
|
/* UTC calculation stuff */
|
||||||
@@ -164,6 +168,17 @@ EXTERN char *MonthName[]
|
|||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
EXTERN char *DynamicMonthName[]
|
||||||
|
#ifdef MK_GLOBALS
|
||||||
|
#if LANG == ENGLISH
|
||||||
|
= {"January", "February", "March", "April", "May", "June",
|
||||||
|
"July", "August", "September", "October", "November", "December"}
|
||||||
|
#else
|
||||||
|
= {L_JAN, L_FEB, L_MAR, L_APR, L_MAY, L_JUN,
|
||||||
|
L_JUL, L_AUG, L_SEP, L_OCT, L_NOV, L_DEC}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
;
|
||||||
EXTERN char *EnglishDayName[]
|
EXTERN char *EnglishDayName[]
|
||||||
#ifdef MK_GLOBALS
|
#ifdef MK_GLOBALS
|
||||||
= {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
|
= {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
|
||||||
@@ -182,6 +197,18 @@ EXTERN char *DayName[]
|
|||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
EXTERN char *DynamicDayName []
|
||||||
|
#ifdef MK_GLOBALS
|
||||||
|
#if LANG == ENGLISH
|
||||||
|
= {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
|
||||||
|
"Saturday", "Sunday"}
|
||||||
|
#else
|
||||||
|
= {L_MONDAY, L_TUESDAY, L_WEDNESDAY, L_THURSDAY, L_FRIDAY,
|
||||||
|
L_SATURDAY, L_SUNDAY}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
|
||||||
EXTERN int MonthDays[]
|
EXTERN int MonthDays[]
|
||||||
#ifdef MK_GLOBALS
|
#ifdef MK_GLOBALS
|
||||||
= {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
|
= {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
|
||||||
|
|||||||
74
src/init.c
74
src/init.c
@@ -76,9 +76,6 @@
|
|||||||
* A minus sign alone indicates to take input from stdin
|
* A minus sign alone indicates to take input from stdin
|
||||||
*
|
*
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
#if defined(__APPLE__) || defined(__CYGWIN__)
|
|
||||||
static void rkrphgvba(int x);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* For parsing an integer */
|
/* For parsing an integer */
|
||||||
#define PARSENUM(var, s) \
|
#define PARSENUM(var, s) \
|
||||||
@@ -145,12 +142,6 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
int x;
|
int x;
|
||||||
int jul;
|
int jul;
|
||||||
|
|
||||||
#if defined(__APPLE__)
|
|
||||||
rkrphgvba(0);
|
|
||||||
#elif defined(__CYGWIN__)
|
|
||||||
rkrphgvba(1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
jul = NO_DATE;
|
jul = NO_DATE;
|
||||||
|
|
||||||
/* If stdout is a terminal, initialize $FormWidth to terminal width-8,
|
/* If stdout is a terminal, initialize $FormWidth to terminal width-8,
|
||||||
@@ -193,6 +184,9 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
JulianToday = RealToday;
|
JulianToday = RealToday;
|
||||||
FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
|
FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
|
||||||
|
|
||||||
|
/* Initialize Latitude and Longitude */
|
||||||
|
set_components_from_lat_and_long();
|
||||||
|
|
||||||
/* See if we were invoked as "rem" rather than "remind" */
|
/* See if we were invoked as "rem" rather than "remind" */
|
||||||
if (argv[0]) {
|
if (argv[0]) {
|
||||||
s = strrchr(argv[0], '/');
|
s = strrchr(argv[0], '/');
|
||||||
@@ -204,6 +198,9 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
if (!strcmp(s, "rem")) {
|
if (!strcmp(s, "rem")) {
|
||||||
InvokedAsRem = 1;
|
InvokedAsRem = 1;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Invoked with a NULL argv[0]; bailing because that's just plain bizarre.\n");
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse the command-line options */
|
/* Parse the command-line options */
|
||||||
@@ -290,7 +287,19 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
|
|
||||||
case 't':
|
case 't':
|
||||||
case 'T':
|
case 'T':
|
||||||
if (!*arg) {
|
if (*arg == 'T' || *arg == 't') {
|
||||||
|
arg++;
|
||||||
|
if (!*arg) {
|
||||||
|
DefaultTDelta = 5;
|
||||||
|
} else {
|
||||||
|
PARSENUM(DefaultTDelta, arg);
|
||||||
|
if (DefaultTDelta < 0) {
|
||||||
|
DefaultTDelta = 0;
|
||||||
|
} else if (DefaultTDelta > 1440) {
|
||||||
|
DefaultTDelta = 1440;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (!*arg) {
|
||||||
InfiniteDelta = 1;
|
InfiniteDelta = 1;
|
||||||
} else {
|
} else {
|
||||||
PARSENUM(DeltaOffset, arg);
|
PARSENUM(DeltaOffset, arg);
|
||||||
@@ -646,6 +655,7 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Figure out the offset from UTC */
|
/* Figure out the offset from UTC */
|
||||||
if (CalculateUTC)
|
if (CalculateUTC)
|
||||||
(void) CalcMinsFromUTC(JulianToday, SystemTime(0)/60,
|
(void) CalcMinsFromUTC(JulianToday, SystemTime(0)/60,
|
||||||
@@ -846,6 +856,7 @@ static void InitializeVar(char const *str)
|
|||||||
|
|
||||||
if (*varname == '$') {
|
if (*varname == '$') {
|
||||||
r=SetSysVar(varname+1, &val);
|
r=SetSysVar(varname+1, &val);
|
||||||
|
DestroyValue(val);
|
||||||
if (r) fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
|
if (r) fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -879,46 +890,3 @@ AddTrustedUser(char const *username)
|
|||||||
NumTrustedUsers++;
|
NumTrustedUsers++;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__APPLE__) || defined(__CYGWIN__)
|
|
||||||
static char const pmsg1[] = {
|
|
||||||
0x4c, 0x62, 0x68, 0x20, 0x6e, 0x63, 0x63, 0x72, 0x6e, 0x65, 0x20,
|
|
||||||
0x67, 0x62, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x68, 0x61, 0x61, 0x76,
|
|
||||||
0x61, 0x74, 0x20, 0x45, 0x72, 0x7a, 0x76, 0x61, 0x71, 0x20, 0x62,
|
|
||||||
0x61, 0x20, 0x6e, 0x61, 0x20, 0x4e, 0x63, 0x63, 0x79, 0x72, 0x20,
|
|
||||||
0x63, 0x65, 0x62, 0x71, 0x68, 0x70, 0x67, 0x2e, 0x20, 0x20, 0x56,
|
|
||||||
0x27, 0x71, 0x20, 0x65, 0x6e, 0x67, 0x75, 0x72, 0x65, 0x20, 0x67,
|
|
||||||
0x75, 0x6e, 0x67, 0x0a, 0x6c, 0x62, 0x68, 0x20, 0x71, 0x76, 0x71,
|
|
||||||
0x61, 0x27, 0x67, 0x2e, 0x20, 0x20, 0x45, 0x72, 0x7a, 0x76, 0x61,
|
|
||||||
0x71, 0x20, 0x72, 0x6b, 0x72, 0x70, 0x68, 0x67, 0x76, 0x62, 0x61,
|
|
||||||
0x20, 0x6a, 0x76, 0x79, 0x79, 0x20, 0x70, 0x62, 0x61, 0x67, 0x76,
|
|
||||||
0x61, 0x68, 0x72, 0x20, 0x7a, 0x62, 0x7a, 0x72, 0x61, 0x67, 0x6e,
|
|
||||||
0x65, 0x76, 0x79, 0x6c, 0x2e, 0x0a, 0x00
|
|
||||||
};
|
|
||||||
|
|
||||||
static char const pmsg2[] = {
|
|
||||||
0x4c, 0x62, 0x68, 0x20, 0x6e, 0x63, 0x63, 0x72, 0x6e, 0x65, 0x20,
|
|
||||||
0x67, 0x62, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x68, 0x61, 0x61, 0x76,
|
|
||||||
0x61, 0x74, 0x20, 0x45, 0x72, 0x7a, 0x76, 0x61, 0x71, 0x20, 0x62,
|
|
||||||
0x61, 0x20, 0x6e, 0x20, 0x5a, 0x76, 0x70, 0x65, 0x62, 0x66, 0x62,
|
|
||||||
0x73, 0x67, 0x20, 0x66, 0x6c, 0x66, 0x67, 0x72, 0x7a, 0x2e, 0x20,
|
|
||||||
0x20, 0x56, 0x27, 0x71, 0x20, 0x65, 0x6e, 0x67, 0x75, 0x72, 0x65,
|
|
||||||
0x20, 0x67, 0x75, 0x6e, 0x67, 0x0a, 0x6c, 0x62, 0x68, 0x20, 0x71,
|
|
||||||
0x76, 0x71, 0x61, 0x27, 0x67, 0x2e, 0x20, 0x20, 0x45, 0x72, 0x7a,
|
|
||||||
0x76, 0x61, 0x71, 0x20, 0x72, 0x6b, 0x72, 0x70, 0x68, 0x67, 0x76,
|
|
||||||
0x62, 0x61, 0x20, 0x6a, 0x76, 0x79, 0x79, 0x20, 0x70, 0x62, 0x61,
|
|
||||||
0x67, 0x76, 0x61, 0x68, 0x72, 0x20, 0x7a, 0x62, 0x7a, 0x72, 0x61,
|
|
||||||
0x67, 0x6e, 0x65, 0x76, 0x79, 0x6c, 0x2e, 0x0a, 0x00
|
|
||||||
};
|
|
||||||
|
|
||||||
static void
|
|
||||||
rkrphgvba(int x)
|
|
||||||
{
|
|
||||||
char const *s = (x ? pmsg2 : pmsg1);
|
|
||||||
while(*s) {
|
|
||||||
int c = (int) *s++;
|
|
||||||
c=isalpha(c)?tolower(c)<0x6e?c+13:c-13:c;
|
|
||||||
putchar(c);
|
|
||||||
}
|
|
||||||
sleep(5);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -15,21 +15,13 @@
|
|||||||
#define L_LANGNAME "Danish"
|
#define L_LANGNAME "Danish"
|
||||||
|
|
||||||
/* Day names */
|
/* Day names */
|
||||||
#if ISOLATIN1
|
#define L_SUNDAY "Søndag"
|
||||||
# define L_SUNDAY "S\370ndag"
|
|
||||||
#else
|
|
||||||
# define L_SUNDAY "Soendag"
|
|
||||||
#endif
|
|
||||||
#define L_MONDAY "Mandag"
|
#define L_MONDAY "Mandag"
|
||||||
#define L_TUESDAY "Tirsdag"
|
#define L_TUESDAY "Tirsdag"
|
||||||
#define L_WEDNESDAY "Onsdag"
|
#define L_WEDNESDAY "Onsdag"
|
||||||
#define L_THURSDAY "Torsdag"
|
#define L_THURSDAY "Torsdag"
|
||||||
#define L_FRIDAY "Fredag"
|
#define L_FRIDAY "Fredag"
|
||||||
#if ISOLATIN1
|
#define L_SATURDAY "Lørdag"
|
||||||
# define L_SATURDAY "L\370rdag"
|
|
||||||
#else
|
|
||||||
# define L_SATURDAY "Loerdag"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Month names */
|
/* Month names */
|
||||||
#define L_JAN "Januar"
|
#define L_JAN "Januar"
|
||||||
@@ -50,11 +42,7 @@
|
|||||||
#define L_TOMORROW "i morgen"
|
#define L_TOMORROW "i morgen"
|
||||||
|
|
||||||
/* The default banner */
|
/* The default banner */
|
||||||
#if ISOLATIN1
|
#define L_BANNER "Påmindelse for %w, %d. %m, %y%o:"
|
||||||
# define L_BANNER "P\345mindelse for %w, %d. %m, %y%o:"
|
|
||||||
#else
|
|
||||||
# define L_BANNER "Paamindelse for %w, %d. %m, %y%o:"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* "am" and "pm" */
|
/* "am" and "pm" */
|
||||||
#define L_AM "am"
|
#define L_AM "am"
|
||||||
@@ -71,11 +59,7 @@
|
|||||||
#define L_INXDAYS "om %d dage"
|
#define L_INXDAYS "om %d dage"
|
||||||
|
|
||||||
/* "on" as in "on date..." */
|
/* "on" as in "on date..." */
|
||||||
#if ISOLATIN1
|
#define L_ON "på"
|
||||||
# define L_ON "p\345"
|
|
||||||
#else
|
|
||||||
# define L_ON "paa"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Pluralizing - this is a problem for many languages and may require
|
/* Pluralizing - this is a problem for many languages and may require
|
||||||
a more drastic fix */
|
a more drastic fix */
|
||||||
|
|||||||
@@ -33,16 +33,8 @@
|
|||||||
#define L_MAR "maaliskuu"
|
#define L_MAR "maaliskuu"
|
||||||
#define L_APR "huhtikuu"
|
#define L_APR "huhtikuu"
|
||||||
#define L_MAY "toukokuu"
|
#define L_MAY "toukokuu"
|
||||||
#if ISOLATIN1
|
#define L_JUN "kesäkuu"
|
||||||
#define L_JUN "kes\xE4kuu"
|
#define L_JUL "heinäkuu"
|
||||||
#define L_JUL "hein\xE4kuu"
|
|
||||||
#elif IBMEXTENDED
|
|
||||||
#define L_JUN "kes\x84kuu"
|
|
||||||
#define L_JUL "hein\x84kuu"
|
|
||||||
#else
|
|
||||||
#define L_JUN "kes{kuu"
|
|
||||||
#define L_JUL "hein{kuu"
|
|
||||||
#endif
|
|
||||||
#define L_AUG "elokuu"
|
#define L_AUG "elokuu"
|
||||||
#define L_SEP "syyskuu"
|
#define L_SEP "syyskuu"
|
||||||
#define L_OCT "lokakuu"
|
#define L_OCT "lokakuu"
|
||||||
@@ -50,13 +42,7 @@
|
|||||||
#define L_DEC "joulukuu"
|
#define L_DEC "joulukuu"
|
||||||
|
|
||||||
/* Today and tomorrow */
|
/* Today and tomorrow */
|
||||||
#if ISOLATIN1
|
#define L_TODAY "tänään"
|
||||||
#define L_TODAY "t\xE4n\xE4\xE4n"
|
|
||||||
#elif IBMEXTENDED
|
|
||||||
#define L_TODAY "t\x84n\x84\x84n"
|
|
||||||
#else
|
|
||||||
#define L_TODAY "t{n{{n"
|
|
||||||
#endif
|
|
||||||
#define L_TOMORROW "huomenna"
|
#define L_TOMORROW "huomenna"
|
||||||
|
|
||||||
/* The default banner */
|
/* The default banner */
|
||||||
@@ -74,13 +60,7 @@
|
|||||||
#define L_FROMNOW "kuluttua"
|
#define L_FROMNOW "kuluttua"
|
||||||
|
|
||||||
/* "in %d days' time" */
|
/* "in %d days' time" */
|
||||||
#if ISOLATIN1
|
#define L_INXDAYS "%d päivän kuluttua"
|
||||||
#define L_INXDAYS "%d p\xE4iv\xE4n kuluttua"
|
|
||||||
#elif IBMEXTENDED
|
|
||||||
#define L_INXDAYS "%d p\x84iv\x84n kuluttua"
|
|
||||||
#else
|
|
||||||
#define L_INXDAYS "%d p{iv{n kuluttua"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* "on" as in "on date...", but in Finnish it is a case ending;
|
/* "on" as in "on date...", but in Finnish it is a case ending;
|
||||||
L_PARTIT is the partitive ending appended to -kuu and -tai */
|
L_PARTIT is the partitive ending appended to -kuu and -tai */
|
||||||
@@ -90,13 +70,7 @@
|
|||||||
/* Pluralizing - this is a problem for many languages and may require
|
/* Pluralizing - this is a problem for many languages and may require
|
||||||
a more drastic fix */
|
a more drastic fix */
|
||||||
/* The partitive ending of "day" */
|
/* The partitive ending of "day" */
|
||||||
#if ISOLATIN1
|
#define L_PLURAL "ä"
|
||||||
#define L_PLURAL "\xE4"
|
|
||||||
#elif IBMEXTENDED
|
|
||||||
#define L_PLURAL "\x84"
|
|
||||||
#else
|
|
||||||
#define L_PLURAL "{"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Minutes, hours, at, etc */
|
/* Minutes, hours, at, etc */
|
||||||
#define L_NOW "nyt"
|
#define L_NOW "nyt"
|
||||||
@@ -120,9 +94,8 @@
|
|||||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||||
See the file dosubst.c for more info. */
|
See the file dosubst.c for more info. */
|
||||||
|
|
||||||
#if ISOLATIN1
|
|
||||||
#define L_ORDINAL_OVERRIDE switch(d) { \
|
#define L_ORDINAL_OVERRIDE switch(d) { \
|
||||||
case 1: plu = ":sen\xE4"; break; \
|
case 1: plu = ":senä"; break; \
|
||||||
case 2: plu = ":sena"; break; \
|
case 2: plu = ":sena"; break; \
|
||||||
default: \
|
default: \
|
||||||
switch(d%10) { \
|
switch(d%10) { \
|
||||||
@@ -130,36 +103,9 @@
|
|||||||
case 3: \
|
case 3: \
|
||||||
case 6: \
|
case 6: \
|
||||||
case 8: plu = ":ntena"; break; \
|
case 8: plu = ":ntena"; break; \
|
||||||
default: plu = ":nten\xE4"; break; \
|
default: plu = ":ntenä"; break; \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
#elif IBMEXTENDED
|
|
||||||
#define L_ORDINAL_OVERRIDE switch(d) { \
|
|
||||||
case 1: plu = ":sen\x84"; break; \
|
|
||||||
case 2: plu = ":sena"; break; \
|
|
||||||
default: \
|
|
||||||
switch(d%10) { \
|
|
||||||
case 2: \
|
|
||||||
case 3: \
|
|
||||||
case 6: \
|
|
||||||
case 8: plu = ":ntena"; break; \
|
|
||||||
default: plu = ":nten\x84"; break; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define L_ORDINAL_OVERRIDE switch(d) { \
|
|
||||||
case 1: plu = ":sen{"; break; \
|
|
||||||
case 2: plu = ":sena"; break; \
|
|
||||||
default: \
|
|
||||||
switch(d%10) { \
|
|
||||||
case 2: \
|
|
||||||
case 3: \
|
|
||||||
case 6: \
|
|
||||||
case 8: plu = ":ntena"; break; \
|
|
||||||
default: plu = ":nten{"; break; \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#define L_A_OVER if (altmode == '*') { sprintf(s, "%s %d. %s %d", DayName[jul%7], d, MonthName[m], y); } else { sprintf(s, "%s%s %d. %s%s %d", DayName[jul%7], L_ON, d, MonthName[m], L_PARTIT, y); }
|
#define L_A_OVER if (altmode == '*') { sprintf(s, "%s %d. %s %d", DayName[jul%7], d, MonthName[m], y); } else { sprintf(s, "%s%s %d. %s%s %d", DayName[jul%7], L_ON, d, MonthName[m], L_PARTIT, y); }
|
||||||
#define L_C_OVER if (altmode == '*') { sprintf(s, "%s", DayName[jul%7]); } else { sprintf(s, "%s%s", DayName[jul%7], L_ON); }
|
#define L_C_OVER if (altmode == '*') { sprintf(s, "%s", DayName[jul%7]); } else { sprintf(s, "%s%s", DayName[jul%7], L_ON); }
|
||||||
#define L_E_OVER sprintf(s, "%02d%c%02d%c%04d", d, DateSep, m+1, DateSep, y);
|
#define L_E_OVER sprintf(s, "%02d%c%02d%c%04d", d, DateSep, m+1, DateSep, y);
|
||||||
@@ -199,104 +145,103 @@ else { \
|
|||||||
#define L_ERR_OVERRIDE 1
|
#define L_ERR_OVERRIDE 1
|
||||||
EXTERN char *ErrMsg[] =
|
EXTERN char *ErrMsg[] =
|
||||||
{
|
{
|
||||||
#if ISOLATIN1
|
|
||||||
"Ok",
|
"Ok",
|
||||||
"Puuttuva ']'",
|
"Puuttuva ']'",
|
||||||
"Puuttuva lainausmerkki",
|
"Puuttuva lainausmerkki",
|
||||||
"Liian monimutkainen lauseke - liikaa operaattoreita",
|
"Liian monimutkainen lauseke - liikaa operaattoreita",
|
||||||
"Liian monimutkainen lauseke - liikaa operandeja",
|
"Liian monimutkainen lauseke - liikaa operandeja",
|
||||||
"Puuttuva ')'",
|
"Puuttuva ')'",
|
||||||
"M\xE4\xE4rittelem\xE4t\xF6n funktio",
|
"Määrittelemätön funktio",
|
||||||
"Virheellinen merkki",
|
"Virheellinen merkki",
|
||||||
"Kaksipaikkainen operaattori puuttuu",
|
"Kaksipaikkainen operaattori puuttuu",
|
||||||
"Muisti loppui",
|
"Muisti loppui",
|
||||||
"Virheellinen luku",
|
"Virheellinen luku",
|
||||||
"Operaattoripino tyhj\xE4 - sis\xE4inen virhe",
|
"Operaattoripino tyhjä - sisäinen virhe",
|
||||||
"Muuttujapino tyhj\xE4 - sis\xE4inen virhe",
|
"Muuttujapino tyhjä - sisäinen virhe",
|
||||||
"Tyyppimuunnos ei onnistu",
|
"Tyyppimuunnos ei onnistu",
|
||||||
"Virheellinen tyyppi",
|
"Virheellinen tyyppi",
|
||||||
"Liian suuri p\xE4iv\xE4ys",
|
"Liian suuri päiväys",
|
||||||
"Pinovirhe - sis\xE4inen virhe",
|
"Pinovirhe - sisäinen virhe",
|
||||||
"Jako nollalla",
|
"Jako nollalla",
|
||||||
"M\xE4\xE4rittelem\xE4t\xF6n funktio",
|
"Määrittelemätön funktio",
|
||||||
"Odottamaton rivin loppu",
|
"Odottamaton rivin loppu",
|
||||||
"Odottamaton tiedoston loppu",
|
"Odottamaton tiedoston loppu",
|
||||||
"Sy\xF6tt\xF6- tai tulostusvirhe",
|
"Syöttö- tai tulostusvirhe",
|
||||||
"Liian pitk\xE4 rivi",
|
"Liian pitkä rivi",
|
||||||
"Sis\xE4inen virhe",
|
"Sisäinen virhe",
|
||||||
"Virheellinen p\xE4iv\xE4ys",
|
"Virheellinen päiväys",
|
||||||
"Liian v\xE4h\xE4n argumentteja",
|
"Liian vähän argumentteja",
|
||||||
"Liian paljon argumentteja",
|
"Liian paljon argumentteja",
|
||||||
"Virheellinen aika",
|
"Virheellinen aika",
|
||||||
"Liian suuri luku",
|
"Liian suuri luku",
|
||||||
"Liian pieni luku",
|
"Liian pieni luku",
|
||||||
"Tiedoston avaus ei onnistu",
|
"Tiedoston avaus ei onnistu",
|
||||||
"Liian monta sis\xE4kk\xE4ist\xE4 INCLUDEa",
|
"Liian monta sisäkkäistä INCLUDEa",
|
||||||
"J\xE4sennysvirhe",
|
"Jäsennysvirhe",
|
||||||
"Laukaisuhetken laskenta ei onnistu",
|
"Laukaisuhetken laskenta ei onnistu",
|
||||||
"Liian monta sis\xE4kk\xE4ist\xE4 IF-lausetta",
|
"Liian monta sisäkkäistä IF-lausetta",
|
||||||
"ELSE ilman IF-lausetta",
|
"ELSE ilman IF-lausetta",
|
||||||
"ENDIF ilman IF-lausetta",
|
"ENDIF ilman IF-lausetta",
|
||||||
"Kaikkia viikonp\xE4ivi\xE4 ei voi j\xE4tt\xE4\xE4 pois",
|
"Kaikkia viikonpäiviä ei voi jättää pois",
|
||||||
"Ylim\xE4\xE4r\xE4isi\xE4 merkkej\xE4 rivill\xE4",
|
"Ylimääräisiä merkkejä rivillä",
|
||||||
"POP-OMIT-CONTEXT ilman PUSH-OMIT-CONTEXTia",
|
"POP-OMIT-CONTEXT ilman PUSH-OMIT-CONTEXTia",
|
||||||
"RUN-lauseen k\xE4ytt\xF6 estetty",
|
"RUN-lauseen käyttö estetty",
|
||||||
"Arvoaluevirhe",
|
"Arvoaluevirhe",
|
||||||
"Virheellinen tunniste",
|
"Virheellinen tunniste",
|
||||||
"Rekursiivinen funktiokutsu havaittu",
|
"Rekursiivinen funktiokutsu havaittu",
|
||||||
"",
|
"",
|
||||||
"J\xE4rjestelm\xE4muuttujan muuttaminen ei onnistu",
|
"Järjestelmämuuttujan muuttaminen ei onnistu",
|
||||||
"C-kirjastofunktio ei pysty esitt\xE4m\xE4\xE4n p\xE4iv\xE4yst\xE4 tai aikaa",
|
"C-kirjastofunktio ei pysty esittämään päiväystä tai aikaa",
|
||||||
"Sis\xE4isen funktion m\xE4\xE4ritelm\xE4\xE4 yritettiin muuttaa",
|
"Sisäisen funktion määritelmää yritettiin muuttaa",
|
||||||
"Lausekkeessa ei voi olla sis\xE4kk\xE4isi\xE4 funktiom\xE4\xE4ritelmi\xE4",
|
"Lausekkeessa ei voi olla sisäkkäisiä funktiomääritelmiä",
|
||||||
"P\xE4iv\xE4yksen t\xE4ytyy olla t\xE4ydellinen toistokertoimessa",
|
"Päiväyksen täytyy olla täydellinen toistokertoimessa",
|
||||||
"Vuosi annettu kahdesti",
|
"Vuosi annettu kahdesti",
|
||||||
"Kuukausi annettu kahdesti",
|
"Kuukausi annettu kahdesti",
|
||||||
"P\xE4iv\xE4 annettu kahdesti",
|
"Päivä annettu kahdesti",
|
||||||
"Tuntematon sana tai merkki",
|
"Tuntematon sana tai merkki",
|
||||||
"OMIT-komennossa on annettava kuukausi ja p\xE4iv\xE4",
|
"OMIT-komennossa on annettava kuukausi ja päivä",
|
||||||
"Liian monta osittaista OMIT-komentoa",
|
"Liian monta osittaista OMIT-komentoa",
|
||||||
"Liian monta t\xE4ydellist\xE4 OMIT-komentoa",
|
"Liian monta täydellistä OMIT-komentoa",
|
||||||
"Varoitus: PUSH-OMIT-CONTEXT ilman POP-OMIT-CONTEXTia",
|
"Varoitus: PUSH-OMIT-CONTEXT ilman POP-OMIT-CONTEXTia",
|
||||||
"Virhe tiedoston luvussa",
|
"Virhe tiedoston luvussa",
|
||||||
"Pilkku puuttuu",
|
"Pilkku puuttuu",
|
||||||
"Virheellinen juutalainen p\xE4iv\xE4ys",
|
"Virheellinen juutalainen päiväys",
|
||||||
"IIF vaatii parittoman m\xE4\xE4r\xE4n argumentteja",
|
"IIF vaatii parittoman määrän argumentteja",
|
||||||
"Varoitus: puuttuva ENDIF",
|
"Varoitus: puuttuva ENDIF",
|
||||||
"Pilkku puuttuu",
|
"Pilkku puuttuu",
|
||||||
"Viikonp\xE4iv\xE4 annettu kahdesti",
|
"Viikonpäivä annettu kahdesti",
|
||||||
"K\xE4yt\xE4 vain yht\xE4 komennoista BEFORE, AFTER ja SKIP",
|
"Käytä vain yhtä komennoista BEFORE, AFTER ja SKIP",
|
||||||
"Sis\xE4kk\xE4isi\xE4 MSG-, MSF- ja RUN-lauseita ei voi k\xE4ytt\xE4\xE4 lausekkeessa",
|
"Sisäkkäisiä MSG-, MSF- ja RUN-lauseita ei voi käyttää lausekkeessa",
|
||||||
"Toistokerroin annettu kahdesti",
|
"Toistokerroin annettu kahdesti",
|
||||||
"Delta-arvo annettu kahdesti",
|
"Delta-arvo annettu kahdesti",
|
||||||
"Peruutusarvo annettu kahdesti",
|
"Peruutusarvo annettu kahdesti",
|
||||||
"ONCE-avainsanaa k\xE4ytetty kahdesti. (Hah.)",
|
"ONCE-avainsanaa käytetty kahdesti. (Hah.)",
|
||||||
"AT-sanan per\xE4st\xE4 puuttuu aika",
|
"AT-sanan perästä puuttuu aika",
|
||||||
"THROUGH/UNTIL-sanaa k\xE4ytetty kahdesti",
|
"THROUGH/UNTIL-sanaa käytetty kahdesti",
|
||||||
"Ep\xE4t\xE4ydellinen p\xE4iv\xE4ys",
|
"Epätäydellinen päiväys",
|
||||||
"FROM/SCANFROM-sanaa k\xE4ytetty kahdesti",
|
"FROM/SCANFROM-sanaa käytetty kahdesti",
|
||||||
"Muuttuja",
|
"Muuttuja",
|
||||||
"Arvo",
|
"Arvo",
|
||||||
"*M\xC4\xC4RITTELEM\xC4T\xD6N*",
|
"*MÄÄRITTELEMÄTÖN*",
|
||||||
"Siirryt\xE4\xE4n funktioon",
|
"Siirrytään funktioon",
|
||||||
"Poistutaan funktiosta",
|
"Poistutaan funktiosta",
|
||||||
"Vanhentunut",
|
"Vanhentunut",
|
||||||
"fork() ep\xE4onnistui - jonomuistutukset eiv\xE4t toimi",
|
"fork() epäonnistui - jonomuistutukset eivät toimi",
|
||||||
"Tiedoston avaus ei onnistu",
|
"Tiedoston avaus ei onnistu",
|
||||||
"Virheellinen j\xE4rjestelm\xE4p\xE4iv\xE4ys: vuosi on v\xE4hemm\xE4n kuin %d\n",
|
"Virheellinen järjestelmäpäiväys: vuosi on vähemmän kuin %d\n",
|
||||||
"Tuntematon virheenetsint\xE4tarkenne '%c'\n",
|
"Tuntematon virheenetsintätarkenne '%c'\n",
|
||||||
"Tuntematon tarkenne '%c'\n",
|
"Tuntematon tarkenne '%c'\n",
|
||||||
"Tuntematon k\xE4ytt\xE4j\xE4 '%s'\n",
|
"Tuntematon käyttäjä '%s'\n",
|
||||||
"Ryhm\xE4numeron vaihto %d:ksi ei onnistunut\n",
|
"Ryhmänumeron vaihto %d:ksi ei onnistunut\n",
|
||||||
"K\xE4ytt\xE4j\xE4numeron vaihto %d:ksi ei onnistunut\n",
|
"Käyttäjänumeron vaihto %d:ksi ei onnistunut\n",
|
||||||
"Muisti ei riit\xE4 ymp\xE4rist\xF6lle\n",
|
"Muisti ei riitä ympäristölle\n",
|
||||||
"Puuttuva '='-merkki",
|
"Puuttuva '='-merkki",
|
||||||
"Puuttuva muuttujanimi",
|
"Puuttuva muuttujanimi",
|
||||||
"Puuttuva lauseke",
|
"Puuttuva lauseke",
|
||||||
"P\xE4iv\xE4n asetus %s:ksi ei onnitus\n",
|
"Päivän asetus %s:ksi ei onnitus\n",
|
||||||
"Remind: tarkenne '-i': %s\n",
|
"Remind: tarkenne '-i': %s\n",
|
||||||
"Ei viestej\xE4.",
|
"Ei viestejä.",
|
||||||
"%d viesti(\xE4) t\xE4m\xE4n p\xE4iv\xE4n jonossa.\n",
|
"%d viesti(ä) tämän päivän jonossa.\n",
|
||||||
"Numero puuttuu",
|
"Numero puuttuu",
|
||||||
"Virheellinen funktio WARN-lausekkeessa",
|
"Virheellinen funktio WARN-lausekkeessa",
|
||||||
"Can't convert between time zones",
|
"Can't convert between time zones",
|
||||||
@@ -304,221 +249,6 @@ EXTERN char *ErrMsg[] =
|
|||||||
"String too long",
|
"String too long",
|
||||||
"Time specified twice",
|
"Time specified twice",
|
||||||
"Cannot specify DURATION without specifying AT"
|
"Cannot specify DURATION without specifying AT"
|
||||||
|
|
||||||
#elif IBMEXTENDED
|
|
||||||
"Ok",
|
|
||||||
"Puuttuva ']'",
|
|
||||||
"Puuttuva lainausmerkki",
|
|
||||||
"Liian monimutkainen lauseke - liikaa operaattoreita",
|
|
||||||
"Liian monimutkainen lauseke - liikaa operandeja",
|
|
||||||
"Puuttuva ')'",
|
|
||||||
"M\x84\x84rittelem\x84t\x94n funktio",
|
|
||||||
"Virheellinen merkki",
|
|
||||||
"Kaksipaikkainen operaattori puuttuu",
|
|
||||||
"Muisti loppui",
|
|
||||||
"Virheellinen luku",
|
|
||||||
"Operaattoripino tyhj\x84 - sis\x84inen virhe",
|
|
||||||
"Muuttujapino tyhj\x84 - sis\x84inen virhe",
|
|
||||||
"Tyyppimuunnos ei onnistu",
|
|
||||||
"Virheellinen tyyppi",
|
|
||||||
"Liian suuri p\x84iv\x84ys",
|
|
||||||
"Pinovirhe - sis\x84inen virhe",
|
|
||||||
"Jako nollalla",
|
|
||||||
"M\x84\x84rittelem\x84t\x94n funktio",
|
|
||||||
"Odottamaton rivin loppu",
|
|
||||||
"Odottamaton tiedoston loppu",
|
|
||||||
"Sy\x94tt\x94- tai tulostusvirhe",
|
|
||||||
"Liian pitk\x84 rivi",
|
|
||||||
"Sis\x84inen virhe",
|
|
||||||
"Virheellinen p\x84iv\x84ys",
|
|
||||||
"Liian v\x84h\x84n argumentteja",
|
|
||||||
"Liian paljon argumentteja",
|
|
||||||
"Virheellinen aika",
|
|
||||||
"Liian suuri luku",
|
|
||||||
"Liian pieni luku",
|
|
||||||
"Tiedoston avaus ei onnistu",
|
|
||||||
"Liian monta sis\x84kk\x84ist\x84 INCLUDEa",
|
|
||||||
"J\x84sennysvirhe",
|
|
||||||
"Laukaisuhetken laskenta ei onnistu",
|
|
||||||
"Liian monta sis\x84kk\x84ist\x84 IF-lausetta",
|
|
||||||
"ELSE ilman IF-lausetta",
|
|
||||||
"ENDIF ilman IF-lausetta",
|
|
||||||
"Kaikkia viikonp\x84ivi\x84 ei voi j\x84tt\x84\x84 pois",
|
|
||||||
"Ylim\x84\x84r\x84isi\x84 merkkej\x84 rivill\x84",
|
|
||||||
"POP-OMIT-CONTEXT ilman PUSH-OMIT-CONTEXTia",
|
|
||||||
"RUN-lauseen k\x84ytt\x94 estetty",
|
|
||||||
"Arvoaluevirhe",
|
|
||||||
"Virheellinen tunniste",
|
|
||||||
"Rekursiivinen funktiokutsu havaittu",
|
|
||||||
"",
|
|
||||||
"J\x84rjestelm\x84muuttujan muuttaminen ei onnistu",
|
|
||||||
"C-kirjastofunktio ei pysty esitt\x84m\x84\x84n p\x84iv\x84yst\x84 tai aikaa",
|
|
||||||
"Sis\x84isen funktion m\x84\x84ritelm\x84\x84 yritettiin muuttaa",
|
|
||||||
"Lausekkeessa ei voi olla sis\x84kk\x84isi\x84 funktiom\x84\x84ritelmi\x84",
|
|
||||||
"P\x84iv\x84yksen t\x84ytyy olla t\x84ydellinen toistokertoimessa",
|
|
||||||
"Vuosi annettu kahdesti",
|
|
||||||
"Kuukausi annettu kahdesti",
|
|
||||||
"P\x84iv\x84 annettu kahdesti",
|
|
||||||
"Tuntematon sana tai merkki",
|
|
||||||
"OMIT-komennossa on annettava kuukausi ja p\x84iv\x84",
|
|
||||||
"Liian monta osittaista OMIT-komentoa",
|
|
||||||
"Liian monta t\x84ydellist\x84 OMIT-komentoa",
|
|
||||||
"Varoitus: PUSH-OMIT-CONTEXT ilman POP-OMIT-CONTEXTia",
|
|
||||||
"Virhe tiedoston luvussa",
|
|
||||||
"Pilkku puuttuu",
|
|
||||||
"Virheellinen juutalainen p\x84iv\x84ys",
|
|
||||||
"IIF vaatii parittoman m\x84\x84r\x84n argumentteja",
|
|
||||||
"Varoitus: puuttuva ENDIF",
|
|
||||||
"Pilkku puuttuu",
|
|
||||||
"Viikonp\x84iv\x84 annettu kahdesti",
|
|
||||||
"K\x84yt\x84 vain yht\x84 komennoista BEFORE, AFTER ja SKIP",
|
|
||||||
"Sis\x84kk\x84isi\x84 MSG-, MSF- ja RUN-lauseita ei voi k\x84ytt\x84\x84 lausekkeessa",
|
|
||||||
"Toistokerroin annettu kahdesti",
|
|
||||||
"Delta-arvo annettu kahdesti",
|
|
||||||
"Peruutusarvo annettu kahdesti",
|
|
||||||
"ONCE-avainsanaa k\x84ytetty kahdesti. (Hah.)",
|
|
||||||
"AT-sanan per\x84st\x84 puuttuu aika",
|
|
||||||
"THROUGH/UNTIL-sanaa k\x84ytetty kahdesti",
|
|
||||||
"Ep\x84t\x84ydellinen p\x84iv\x84ys",
|
|
||||||
"FROM/SCANFROM-sanaa k\x84ytetty kahdesti",
|
|
||||||
"Muuttuja",
|
|
||||||
"Arvo",
|
|
||||||
"*M\x8E\x8ERITTELEM\x8ET\x99N*",
|
|
||||||
"Siirryt\x84\x84n funktioon",
|
|
||||||
"Poistutaan funktiosta",
|
|
||||||
"Vanhentunut",
|
|
||||||
"fork() ep\x84onnistui - jonomuistutukset eiv\x84t toimi",
|
|
||||||
"Tiedoston avaus ei onnistu",
|
|
||||||
"Virheellinen j\x84rjestelm\x84p\x84iv\x84ys: vuosi on v\x84hemm\x84n kuin %d\n",
|
|
||||||
"Tuntematon virheenetsint\x84tarkenne '%c'\n",
|
|
||||||
"Tuntematon tarkenne '%c'\n",
|
|
||||||
"Tuntematon k\x84ytt\x84j\x84 '%s'\n",
|
|
||||||
"Ryhm\x84numeron vaihto %d:ksi ei onnistunut\n",
|
|
||||||
"K\x84ytt\x84j\x84numeron vaihto %d:ksi ei onnistunut\n",
|
|
||||||
"Muisti ei riit\x84 ymp\x84rist\x94lle\n",
|
|
||||||
"Puuttuva '='-merkki",
|
|
||||||
"Puuttuva muuttujanimi",
|
|
||||||
"Puuttuva lauseke",
|
|
||||||
"P\x84iv\x84n asetus %s:ksi ei onnitus\n",
|
|
||||||
"Remind: tarkenne '-i': %s\n",
|
|
||||||
"Ei viestej\x84.",
|
|
||||||
"%d viesti(\x84) t\x84m\x84n p\x84iv\x84n jonossa.\n",
|
|
||||||
"Numero puuttuu"
|
|
||||||
"Virheellinen funktio WARN-lausekkeessa",
|
|
||||||
"Can't convert between time zones",
|
|
||||||
"No files matching *.rem",
|
|
||||||
"String too long",
|
|
||||||
"Time specified twice",
|
|
||||||
"Cannot specify DURATION without specifying AT"
|
|
||||||
|
|
||||||
#else
|
|
||||||
"Ok",
|
|
||||||
"Puuttuva ']'",
|
|
||||||
"Puuttuva lainausmerkki",
|
|
||||||
"Liian monimutkainen lauseke - liikaa operaattoreita",
|
|
||||||
"Liian monimutkainen lauseke - liikaa operandeja",
|
|
||||||
"Puuttuva ')'",
|
|
||||||
"M{{rittelem{t|n funktio",
|
|
||||||
"Virheellinen merkki",
|
|
||||||
"Kaksipaikkainen operaattori puuttuu",
|
|
||||||
"Muisti loppui",
|
|
||||||
"Virheellinen luku",
|
|
||||||
"Operaattoripino tyhj{ - sis{inen virhe",
|
|
||||||
"Muuttujapino tyhj{ - sis{inen virhe",
|
|
||||||
"Tyyppimuunnos ei onnistu",
|
|
||||||
"Virheellinen tyyppi",
|
|
||||||
"Liian suuri p{iv{ys",
|
|
||||||
"Pinovirhe - sis{inen virhe",
|
|
||||||
"Jako nollalla",
|
|
||||||
"M{{rittelem{t|n funktio",
|
|
||||||
"Odottamaton rivin loppu",
|
|
||||||
"Odottamaton tiedoston loppu",
|
|
||||||
"Sy|tt|- tai tulostusvirhe",
|
|
||||||
"Liian pitk{ rivi",
|
|
||||||
"Sis{inen virhe",
|
|
||||||
"Virheellinen p{iv{ys",
|
|
||||||
"Liian v{h{n argumentteja",
|
|
||||||
"Liian paljon argumentteja",
|
|
||||||
"Virheellinen aika",
|
|
||||||
"Liian suuri luku",
|
|
||||||
"Liian pieni luku",
|
|
||||||
"Tiedoston avaus ei onnistu",
|
|
||||||
"Liian monta sis{kk{ist{ INCLUDEa",
|
|
||||||
"J{sennysvirhe",
|
|
||||||
"Laukaisuhetken laskenta ei onnistu",
|
|
||||||
"Liian monta sis{kk{ist{ IF-lausetta",
|
|
||||||
"ELSE ilman IF-lausetta",
|
|
||||||
"ENDIF ilman IF-lausetta",
|
|
||||||
"Kaikkia viikonp{ivi{ ei voi j{tt{{ pois",
|
|
||||||
"Ylim{{r{isi{ merkkej{ rivill{",
|
|
||||||
"POP-OMIT-CONTEXT ilman PUSH-OMIT-CONTEXTia",
|
|
||||||
"RUN-lauseen k{ytt| estetty",
|
|
||||||
"Arvoaluevirhe",
|
|
||||||
"Virheellinen tunniste",
|
|
||||||
"Rekursiivinen funktiokutsu havaittu",
|
|
||||||
"",
|
|
||||||
"J{rjestelm{muuttujan muuttaminen ei onnistu",
|
|
||||||
"C-kirjastofunktio ei pysty esitt{m{{n p{iv{yst{ tai aikaa",
|
|
||||||
"Sis{isen funktion m{{ritelm{{ yritettiin muuttaa",
|
|
||||||
"Lausekkeessa ei voi olla sis{kk{isi{ funktiom{{ritelmi{",
|
|
||||||
"P{iv{yksen t{ytyy olla t{ydellinen toistokertoimessa",
|
|
||||||
"Vuosi annettu kahdesti",
|
|
||||||
"Kuukausi annettu kahdesti",
|
|
||||||
"P{iv{ annettu kahdesti",
|
|
||||||
"Tuntematon sana tai merkki",
|
|
||||||
"OMIT-komennossa on annettava kuukausi ja p{iv{",
|
|
||||||
"Liian monta osittaista OMIT-komentoa",
|
|
||||||
"Liian monta t{ydellist{ OMIT-komentoa",
|
|
||||||
"Varoitus: PUSH-OMIT-CONTEXT ilman POP-OMIT-CONTEXTia",
|
|
||||||
"Virhe tiedoston luvussa",
|
|
||||||
"Pilkku puuttuu",
|
|
||||||
"Virheellinen juutalainen p{iv{ys",
|
|
||||||
"IIF vaatii parittoman m{{r{n argumentteja",
|
|
||||||
"Varoitus: puuttuva ENDIF",
|
|
||||||
"Pilkku puuttuu",
|
|
||||||
"Viikonp{iv{ annettu kahdesti",
|
|
||||||
"K{yt{ vain yht{ komennoista BEFORE, AFTER ja SKIP",
|
|
||||||
"Sis{kk{isi{ MSG-, MSF- ja RUN-lauseita ei voi k{ytt{{ lausekkeessa",
|
|
||||||
"Toistokerroin annettu kahdesti",
|
|
||||||
"Delta-arvo annettu kahdesti",
|
|
||||||
"Peruutusarvo annettu kahdesti",
|
|
||||||
"ONCE-avainsanaa k{ytetty kahdesti. (Hah.)",
|
|
||||||
"AT-sanan per{st{ puuttuu aika",
|
|
||||||
"THROUGH/UNTIL-sanaa k{ytetty kahdesti",
|
|
||||||
"Ep{t{ydellinen p{iv{ys",
|
|
||||||
"FROM/SCANFROM-sanaa k{ytetty kahdesti",
|
|
||||||
"Muuttuja",
|
|
||||||
"Arvo",
|
|
||||||
"*M[[RITTELEM[T\\N*",
|
|
||||||
"Siirryt{{n funktioon",
|
|
||||||
"Poistutaan funktiosta",
|
|
||||||
"Vanhentunut",
|
|
||||||
"fork() ep{onnistui - jonomuistutukset eiv{t toimi",
|
|
||||||
"Tiedoston avaus ei onnistu",
|
|
||||||
"Virheellinen j{rjestelm{p{iv{ys: vuosi on v{hemm{n kuin %d\n",
|
|
||||||
"Tuntematon virheenetsint{tarkenne '%c'\n",
|
|
||||||
"Tuntematon tarkenne '%c'\n",
|
|
||||||
"Tuntematon k{ytt{j{ '%s'\n",
|
|
||||||
"Ryhm{numeron vaihto %d:ksi ei onnistunut\n",
|
|
||||||
"K{ytt{j{numeron vaihto %d:ksi ei onnistunut\n",
|
|
||||||
"Muisti ei riit{ ymp{rist|lle\n",
|
|
||||||
"Puuttuva '='-merkki",
|
|
||||||
"Puuttuva muuttujanimi",
|
|
||||||
"Puuttuva lauseke",
|
|
||||||
"P{iv{n asetus %s:ksi ei onnitus\n",
|
|
||||||
"Remind: tarkenne '-i': %s\n",
|
|
||||||
"Ei viestej{.",
|
|
||||||
"%d viesti({) t{m{n p{iv{n jonossa.\n",
|
|
||||||
"Numero puuttuu",
|
|
||||||
"Virheellinen funktio WARN-lausekkeessa",
|
|
||||||
"Can't convert between time zones",
|
|
||||||
"No files matching *.rem",
|
|
||||||
"String too long",
|
|
||||||
"Time specified twice",
|
|
||||||
"Cannot specify DURATION without specifying AT"
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
#endif /* MK_GLOBALS */
|
#endif /* MK_GLOBALS */
|
||||||
|
|
||||||
@@ -531,93 +261,33 @@ void Usage(void)
|
|||||||
#ifdef BETA
|
#ifdef BETA
|
||||||
fprintf(ErrFp, ">>>> BETAVERSIO <<<<\n");
|
fprintf(ErrFp, ">>>> BETAVERSIO <<<<\n");
|
||||||
#endif
|
#endif
|
||||||
#if ISOLATIN1
|
fprintf(ErrFp, "Käyttö: remind [tarkenteet] tiedosto [päiväys] [aika] [*toisto]\n");
|
||||||
fprintf(ErrFp, "K\xE4ytt\xF6: remind [tarkenteet] tiedosto [p\xE4iv\xE4ys] [aika] [*toisto]\n");
|
|
||||||
fprintf(ErrFp, "Tarkenteet:\n");
|
fprintf(ErrFp, "Tarkenteet:\n");
|
||||||
fprintf(ErrFp, " -n Tulosta viestien seuraavat esiintymiskerrat yksink. muodossa\n");
|
fprintf(ErrFp, " -n Tulosta viestien seuraavat esiintymiskerrat yksink. muodossa\n");
|
||||||
fprintf(ErrFp, " -r Est\xE4 RUN-lauseiden k\xE4ytt\xF6\n");
|
fprintf(ErrFp, " -r Estä RUN-lauseiden käyttö\n");
|
||||||
fprintf(ErrFp, " -c[n] Tulosta n:n kuukauden kalenteri (oletus 1)\n");
|
fprintf(ErrFp, " -c[n] Tulosta n:n kuukauden kalenteri (oletus 1)\n");
|
||||||
fprintf(ErrFp, " -c+[n] Tulosta n:n viikon kalenteri (oletus 1)\n");
|
fprintf(ErrFp, " -c+[n] Tulosta n:n viikon kalenteri (oletus 1)\n");
|
||||||
fprintf(ErrFp, " -w[n[,p[,s]]] Aseta kalenterin leveys, tasaus ja v\xE4lit\n");
|
fprintf(ErrFp, " -w[n[,p[,s]]] Aseta kalenterin leveys, tasaus ja välit\n");
|
||||||
fprintf(ErrFp, " -s[+][n] Tulosta n:n kuukauden (viikon) 'yksink. kalenteri' (oletus 1)\n");
|
fprintf(ErrFp, " -s[+][n] Tulosta n:n kuukauden (viikon) 'yksink. kalenteri' (oletus 1)\n");
|
||||||
fprintf(ErrFp, " -p[n] Kuten -s, mutta tulosta rem2ps:lle sopivassa muodossa\n");
|
fprintf(ErrFp, " -p[n] Kuten -s, mutta tulosta rem2ps:lle sopivassa muodossa\n");
|
||||||
fprintf(ErrFp, " -v Laveat tulostukset\n");
|
fprintf(ErrFp, " -v Laveat tulostukset\n");
|
||||||
fprintf(ErrFp, " -o \xC4l\xE4 noudata ONCE-lauseita\n");
|
fprintf(ErrFp, " -o Älä noudata ONCE-lauseita\n");
|
||||||
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta v\xE4litt\xE4m\xE4tt\xE4\n");
|
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta välittämättä\n");
|
||||||
fprintf(ErrFp, " -h Suppeat tulostukset\n");
|
fprintf(ErrFp, " -h Suppeat tulostukset\n");
|
||||||
#ifdef HAVE_QUEUED
|
#ifdef HAVE_QUEUED
|
||||||
fprintf(ErrFp, " -a \xC4l\xE4 laukaise viestej\xE4 heti - lis\xE4\xE4 ne jonoon\n");
|
fprintf(ErrFp, " -a Älä laukaise viestejä heti - lisää ne jonoon\n");
|
||||||
fprintf(ErrFp, " -q \xC4l\xE4 lis\xE4\xE4 viestej\xE4 jonoon\n");
|
fprintf(ErrFp, " -q Älä lisää viestejä jonoon\n");
|
||||||
fprintf(ErrFp, " -f Laukaise viestit, pysy etualalla\n");
|
fprintf(ErrFp, " -f Laukaise viestit, pysy etualalla\n");
|
||||||
fprintf(ErrFp, " -z[n] K\xE4ynnisty demonina, her\xE4tys n:n (5:n) minuutin v\xE4lein\n");
|
fprintf(ErrFp, " -z[n] Käynnisty demonina, herätys n:n (5:n) minuutin välein\n");
|
||||||
#endif
|
#endif
|
||||||
fprintf(ErrFp, " -d... Virheenetsint\xE4: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
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, " -e Ohjaa virhetulostus stdout-vuohon\n");
|
||||||
fprintf(ErrFp, " -b[n] Ajan ilmaisu: 0=ap/ip, 1=24 tuntia, 2=ei aikoja\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 150)\n");
|
||||||
fprintf(ErrFp, " -kcmd Suorita 'cmd' MSG-tyyppisille viesteille\n");
|
fprintf(ErrFp, " -kcmd Suorita 'cmd' MSG-tyyppisille viesteille\n");
|
||||||
fprintf(ErrFp, " -g[ddd] Lajittele viestit p\xE4iv\xE4yksen, ajan ja t\xE4rkeyden mukaan\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\xE4ilyt\xE4 var\n");
|
fprintf(ErrFp, " -ivar=val Alusta muuttuja var arvolla val ja säilytä var\n");
|
||||||
fprintf(ErrFp, " -m Aloita kalenteri maanantaista eik\xE4 sunnuntaista\n");
|
fprintf(ErrFp, " -m Aloita kalenteri maanantaista eikä sunnuntaista\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
#elif IBMEXTENDED
|
|
||||||
fprintf(ErrFp, "K\x84ytt\x94: remind [tarkenteet] tiedosto [p\x84iv\x84ys] [aika] [*toisto]\n");
|
|
||||||
fprintf(ErrFp, "Tarkenteet:\n");
|
|
||||||
fprintf(ErrFp, " -n Tulosta viestien seuraavat esiintymiskerrat yksink. muodossa\n");
|
|
||||||
fprintf(ErrFp, " -r Est\x84 RUN-lauseiden k\x84ytt\x94\n");
|
|
||||||
fprintf(ErrFp, " -c[n] Tulosta n:n kuukauden kalenteri (oletus 1)\n");
|
|
||||||
fprintf(ErrFp, " -c+[n] Tulosta n:n viikon kalenteri (oletus 1)\n");
|
|
||||||
fprintf(ErrFp, " -w[n[,p[,s]]] Aseta kalenterin leveys, tasaus ja v\x84lit\n");
|
|
||||||
fprintf(ErrFp, " -s[+][n] Tulosta n:n kuukauden (viikon) 'yksink. kalenteri' (oletus 1)\n");
|
|
||||||
fprintf(ErrFp, " -p[n] Kuten -s, mutta tulosta rem2ps:lle sopivassa muodossa\n");
|
|
||||||
fprintf(ErrFp, " -v Laveat tulostukset\n");
|
|
||||||
fprintf(ErrFp, " -o \x8El\x84 noudata ONCE-lauseita\n");
|
|
||||||
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta v\x84litt\x84m\x84tt\x84\n");
|
|
||||||
fprintf(ErrFp, " -h Suppeat tulostukset\n");
|
|
||||||
#ifdef HAVE_QUEUED
|
|
||||||
fprintf(ErrFp, " -a \x8El\x84 laukaise viestej\x84 heti - lis\x84\x84 ne jonoon\n");
|
|
||||||
fprintf(ErrFp, " -q \x8El\x84 lis\x84\x84 viestej\x84 jonoon\n");
|
|
||||||
fprintf(ErrFp, " -f Laukaise viestit, pysy etualalla\n");
|
|
||||||
fprintf(ErrFp, " -z[n] K\x84ynnisty demonina, her\x84tys n:n (5:n) minuutin v\x84lein\n");
|
|
||||||
#endif
|
|
||||||
fprintf(ErrFp, " -d... Virheenetsint\x84: 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, " -kcmd Suorita 'cmd' MSG-tyyppisille viesteille\n");
|
|
||||||
fprintf(ErrFp, " -g[ddd] Lajittele viestit p\x84iv\x84yksen, ajan ja t\x84rkeyden mukaan\n");
|
|
||||||
fprintf(ErrFp, " -ivar=val Alusta muuttuja var arvolla val ja s\x84ilyt\x84 var\n");
|
|
||||||
fprintf(ErrFp, " -m Aloita kalenteri maanantaista eik\x84 sunnuntaista\n");
|
|
||||||
exit(1);
|
|
||||||
#else
|
|
||||||
fprintf(ErrFp, "K{ytt|: remind [tarkenteet] tiedosto [p{iv{ys] [aika] [*toisto]\n");
|
|
||||||
fprintf(ErrFp, "Tarkenteet:\n");
|
|
||||||
fprintf(ErrFp, " -n Tulosta viestien seuraavat esiintymiskerrat yksink. muodossa\n");
|
|
||||||
fprintf(ErrFp, " -r Est{ RUN-lauseiden k{ytt|\n");
|
|
||||||
fprintf(ErrFp, " -c[n] Tulosta n:n kuukauden kalenteri (oletus 1)\n");
|
|
||||||
fprintf(ErrFp, " -c+[n] Tulosta n:n viikon kalenteri (oletus 1)\n");
|
|
||||||
fprintf(ErrFp, " -w[n[,p[,s]]] Aseta kalenterin leveys, tasaus ja v{lit\n");
|
|
||||||
fprintf(ErrFp, " -s[+][n] Tulosta n:n kuukauden (viikon) 'yksink. kalenteri' (oletus 1)\n");
|
|
||||||
fprintf(ErrFp, " -p[n] Kuten -s, mutta tulosta rem2ps:lle sopivassa muodossa\n");
|
|
||||||
fprintf(ErrFp, " -v Laveat tulostukset\n");
|
|
||||||
fprintf(ErrFp, " -o [l{ noudata ONCE-lauseita\n");
|
|
||||||
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta v{litt{m{tt{\n");
|
|
||||||
fprintf(ErrFp, " -h Suppeat tulostukset\n");
|
|
||||||
#ifdef HAVE_QUEUED
|
|
||||||
fprintf(ErrFp, " -a [l{ laukaise viestej{ heti - lis{{ ne jonoon\n");
|
|
||||||
fprintf(ErrFp, " -q [l{ lis{{ viestej{ jonoon\n");
|
|
||||||
fprintf(ErrFp, " -f Laukaise viestit, pysy etualalla\n");
|
|
||||||
fprintf(ErrFp, " -z[n] K{ynnisty demonina, her{tys n:n (5:n) minuutin v{lein\n");
|
|
||||||
#endif
|
|
||||||
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, " -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");
|
|
||||||
fprintf(ErrFp, " -m Aloita kalenteri maanantaista eik{ sunnuntaista\n");
|
|
||||||
exit(1);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif /* L_IN_INIT */
|
#endif /* L_IN_INIT */
|
||||||
|
|||||||
@@ -28,29 +28,18 @@
|
|||||||
|
|
||||||
/* Month names */
|
/* Month names */
|
||||||
#define L_JAN "janvier"
|
#define L_JAN "janvier"
|
||||||
#if ISOLATIN1
|
#define L_FEB "février"
|
||||||
#define L_FEB "f\351vrier"
|
|
||||||
#else
|
|
||||||
#define L_FEB "fevrier"
|
|
||||||
#endif
|
|
||||||
#define L_MAR "mars"
|
#define L_MAR "mars"
|
||||||
#define L_APR "avril"
|
#define L_APR "avril"
|
||||||
#define L_MAY "mai"
|
#define L_MAY "mai"
|
||||||
#define L_JUN "juin"
|
#define L_JUN "juin"
|
||||||
#define L_JUL "juillet"
|
#define L_JUL "juillet"
|
||||||
#if ISOLATIN1
|
#define L_AUG "août"
|
||||||
#define L_AUG "ao\373t"
|
|
||||||
#else
|
|
||||||
#define L_AUG "aout"
|
|
||||||
#endif
|
|
||||||
#define L_SEP "septembre"
|
#define L_SEP "septembre"
|
||||||
#define L_OCT "octobre"
|
#define L_OCT "octobre"
|
||||||
#define L_NOV "novembre"
|
#define L_NOV "novembre"
|
||||||
#if ISOLATIN1
|
#define L_DEC "décembre"
|
||||||
#define L_DEC "d\351cembre"
|
|
||||||
#else
|
|
||||||
#define L_DEC "decembre"
|
|
||||||
#endif
|
|
||||||
/* Today and tomorrow */
|
/* Today and tomorrow */
|
||||||
#define L_TODAY "aujourd'hui"
|
#define L_TODAY "aujourd'hui"
|
||||||
#define L_TOMORROW "demain"
|
#define L_TOMORROW "demain"
|
||||||
@@ -81,22 +70,14 @@
|
|||||||
|
|
||||||
/* Minutes, hours, at, etc */
|
/* Minutes, hours, at, etc */
|
||||||
#define L_NOW "maintenant"
|
#define L_NOW "maintenant"
|
||||||
#if ISOLATIN1
|
#define L_AT "à"
|
||||||
#define L_AT "\340"
|
|
||||||
#else
|
|
||||||
#define L_AT "a"
|
|
||||||
#endif
|
|
||||||
#define L_MINUTE "minute"
|
#define L_MINUTE "minute"
|
||||||
#define L_HOUR "heure"
|
#define L_HOUR "heure"
|
||||||
#define L_IS "est"
|
#define L_IS "est"
|
||||||
#if ISOLATIN1
|
#define L_WAS "était"
|
||||||
#define L_WAS "\351tait"
|
|
||||||
#else
|
|
||||||
#define L_WAS "etait"
|
|
||||||
#endif
|
|
||||||
#define L_AND "et"
|
#define L_AND "et"
|
||||||
/* What to add to make "hour" plural */
|
/* What to add to make "hour" plural */
|
||||||
#define L_HPLU "s"
|
#define L_HPLU "s"
|
||||||
/* What to add to make "minute" plural */
|
/* What to add to make "minute" plural */
|
||||||
#define L_MPLU "s"
|
#define L_MPLU "s"
|
||||||
|
|
||||||
@@ -139,218 +120,110 @@ else if (tdiff < 0) { \
|
|||||||
#define L_ERR_OVERRIDE 1
|
#define L_ERR_OVERRIDE 1
|
||||||
EXTERN char *ErrMsg[] =
|
EXTERN char *ErrMsg[] =
|
||||||
{
|
{
|
||||||
#if ISOLATIN1
|
|
||||||
"Ok",
|
"Ok",
|
||||||
"']' manquant",
|
"']' manquant",
|
||||||
"Apostrophe manquant",
|
"Apostrophe manquant",
|
||||||
"Expression trop complexe - trop d'op\351rateurs",
|
"Expression trop complexe - trop d'opérateurs",
|
||||||
"Expression trop complexe - trop d'op\351randes",
|
"Expression trop complexe - trop d'opérandes",
|
||||||
"')' manquante",
|
"')' manquante",
|
||||||
"Fonction non-d\351finie",
|
"Fonction non-définie",
|
||||||
"Caract\350re ill\351gal",
|
"Caractère illégal",
|
||||||
"Op\351rateur binaire attendu",
|
"Opérateur binaire attendu",
|
||||||
"Manque de m\351moire",
|
"Manque de mémoire",
|
||||||
"Nombre mal form\351",
|
"Nombre mal formé",
|
||||||
"Erreur interne - 'underflow' de la pile d'op\351rateurs",
|
"Erreur interne - 'underflow' de la pile d'opérateurs",
|
||||||
"Erreur interne - 'underflow' de la pile de variables",
|
"Erreur interne - 'underflow' de la pile de variables",
|
||||||
"Impossible de convertir",
|
"Impossible de convertir",
|
||||||
"Types non-\351quivalents",
|
"Types non-équivalents",
|
||||||
"D\351bordement de date",
|
"Débordement de date",
|
||||||
"Erreur interne - erreur de pile",
|
"Erreur interne - erreur de pile",
|
||||||
"Division par z\351ro",
|
"Division par zéro",
|
||||||
"Variable non d\351finie",
|
"Variable non définie",
|
||||||
"Fin de ligne non attendue",
|
"Fin de ligne non attendue",
|
||||||
"Fin de fichier non attendue",
|
"Fin de fichier non attendue",
|
||||||
"Erreur I/O",
|
"Erreur I/O",
|
||||||
"Ligne trop longue",
|
"Ligne trop longue",
|
||||||
"Erreur interne",
|
"Erreur interne",
|
||||||
"Mauvaise date sp\351cifi\351e",
|
"Mauvaise date spécifiée",
|
||||||
"Pas assez d'arguments",
|
"Pas assez d'arguments",
|
||||||
"Trop d'arguments",
|
"Trop d'arguments",
|
||||||
"Heure mal form\351e",
|
"Heure mal formée",
|
||||||
"Nombre trop \351lev\351",
|
"Nombre trop élevé",
|
||||||
"Nombre trop bas",
|
"Nombre trop bas",
|
||||||
"Impossible d'ouvrir le fichier",
|
"Impossible d'ouvrir le fichier",
|
||||||
"Trop d'INCLUDE imbriqu\351s",
|
"Trop d'INCLUDE imbriqués",
|
||||||
"Erreur d'analyse",
|
"Erreur d'analyse",
|
||||||
"Impossible de calculer le d\351clenchement",
|
"Impossible de calculer le déclenchement",
|
||||||
"Trop de IF imbriqu\351s",
|
"Trop de IF imbriqués",
|
||||||
"ELSE sans IF correspondant",
|
"ELSE sans IF correspondant",
|
||||||
"ENDIF sans IF correspondant",
|
"ENDIF sans IF correspondant",
|
||||||
"Impossible d'omettre (OMIT) tous les jours",
|
"Impossible d'omettre (OMIT) tous les jours",
|
||||||
"El\351ment(s) \351tranger(s) sur la ligne",
|
"Elément(s) étranger(s) sur la ligne",
|
||||||
"POP-OMIT-CONTEXT sans PUSH-OMIT-CONTEXT correspondant",
|
"POP-OMIT-CONTEXT sans PUSH-OMIT-CONTEXT correspondant",
|
||||||
"RUN d\351activ\351",
|
"RUN déactivé",
|
||||||
"Erreur de domaine",
|
"Erreur de domaine",
|
||||||
"Identificateur invalide",
|
"Identificateur invalide",
|
||||||
"Appel r\351cursif d\351tect\351",
|
"Appel récursif détecté",
|
||||||
"",
|
"",
|
||||||
"Impossible de modifier une variable syst\350me",
|
"Impossible de modifier une variable système",
|
||||||
"Fonction de la librairie C ne peut repr\351senter la date/l'heure",
|
"Fonction de la librairie C ne peut représenter la date/l'heure",
|
||||||
"Tentative de red\351finition d'une fonction intrins\350que",
|
"Tentative de redéfinition d'une fonction intrinsèque",
|
||||||
"Impossible d'imbriquer une d\351finition de fonction dans une expression",
|
"Impossible d'imbriquer une définition de fonction dans une expression",
|
||||||
"Pour utiliser le facteur de r\351p\351tition la date doit \352tre sp\351cifi\351e au complet",
|
"Pour utiliser le facteur de répétition la date doit être spécifiée au complet",
|
||||||
"Ann\351e sp\351cifi\351e deux fois",
|
"Année spécifiée deux fois",
|
||||||
"Mois sp\351cifi\351 deux fois",
|
"Mois spécifié deux fois",
|
||||||
"Jour sp\351cifi\351 deux fois",
|
"Jour spécifié deux fois",
|
||||||
"El\351ment inconnu",
|
"Elément inconnu",
|
||||||
"Mois et jour doivent \352tre sp\351cifi\351s dans commande OMIT",
|
"Mois et jour doivent être spécifiés dans commande OMIT",
|
||||||
"Trop de OMITs partiels",
|
"Trop de OMITs partiels",
|
||||||
"Trop de OMITs complets",
|
"Trop de OMITs complets",
|
||||||
"Attention: PUSH-OMIT-CONTEXT sans POP-OMIT-CONTEXT correspondant",
|
"Attention: PUSH-OMIT-CONTEXT sans POP-OMIT-CONTEXT correspondant",
|
||||||
"Erreur \340 la lecture du fichier",
|
"Erreur à la lecture du fichier",
|
||||||
"Fin de ligne attendue",
|
"Fin de ligne attendue",
|
||||||
"Date h\351breuse invalide",
|
"Date hébreuse invalide",
|
||||||
"IIF demande nombre d'arguments impair",
|
"IIF demande nombre d'arguments impair",
|
||||||
"Attention: ENDIF manquant",
|
"Attention: ENDIF manquant",
|
||||||
"Virgule attendue",
|
"Virgule attendue",
|
||||||
"Jour de la semaine sp\351cifi\351 deux fois",
|
"Jour de la semaine spécifié deux fois",
|
||||||
"Utiliser un seul parmi BEFORE, AFTER ou SKIP",
|
"Utiliser un seul parmi BEFORE, AFTER ou SKIP",
|
||||||
"Impossible d'imbriquer MSG, MSF, RUN, etc. dans une expression",
|
"Impossible d'imbriquer MSG, MSF, RUN, etc. dans une expression",
|
||||||
"Valeur de r\351p\351tition sp\351cifi\351e deux fois",
|
"Valeur de répétition spécifiée deux fois",
|
||||||
"Valeur delta sp\351cifi\351e deux fois",
|
"Valeur delta spécifiée deux fois",
|
||||||
"Valeur de retour sp\351cifi\351e deux fois",
|
"Valeur de retour spécifiée deux fois",
|
||||||
"Mot-cl\351 ONCE utilis\351 deux fois. (Hah.)",
|
"Mot-clé ONCE utilisé deux fois. (Hah.)",
|
||||||
"Heure attendue apr\350s AT",
|
"Heure attendue après AT",
|
||||||
"Mot-cl\351 THROUGH/UNTIL utilis\351 deux fois",
|
"Mot-clé THROUGH/UNTIL utilisé deux fois",
|
||||||
"Sp\351cification de date incompl\350te",
|
"Spécification de date incomplète",
|
||||||
"Mot-cl\351 FROM/SCANFROM utilis\351 deux fois",
|
"Mot-clé FROM/SCANFROM utilisé deux fois",
|
||||||
"Variable",
|
"Variable",
|
||||||
"Valeur",
|
"Valeur",
|
||||||
"*NON-DEFINI*",
|
"*NON-DEFINI*",
|
||||||
"Entr\351e dans UserFN",
|
"Entrée dans UserFN",
|
||||||
"Sortie de UserFN",
|
"Sortie de UserFN",
|
||||||
"Expir\351",
|
"Expiré",
|
||||||
"fork() \351chou\351 - impossible de faire les appels en queue",
|
"fork() échoué - impossible de faire les appels en queue",
|
||||||
"Impossible d'acc\351der au fichier",
|
"Impossible d'accéder au fichier",
|
||||||
"Date syst\350me ill\351gale: Ann\351e est inf\351rieure \340 %d\n",
|
"Date système illégale: Année est inférieure à %d\n",
|
||||||
"Option de d\351verminage inconnue '%c'\n",
|
"Option de déverminage inconnue '%c'\n",
|
||||||
"Option inconnue '%c'\n",
|
"Option inconnue '%c'\n",
|
||||||
"Usager inconnu '%s'\n",
|
"Usager inconnu '%s'\n",
|
||||||
"Impossible de changer gid pour %d\n",
|
"Impossible de changer gid pour %d\n",
|
||||||
"Impossible de changer uid pour %d\n",
|
"Impossible de changer uid pour %d\n",
|
||||||
"Manque de m\351moire pour environnement\n",
|
"Manque de mémoire pour environnement\n",
|
||||||
"Signe '=' manquant",
|
"Signe '=' manquant",
|
||||||
"Nom de variable absent",
|
"Nom de variable absent",
|
||||||
"Expression absente",
|
"Expression absente",
|
||||||
"Impossible de changer la date d'acc\350s de %s\n",
|
"Impossible de changer la date d'accès de %s\n",
|
||||||
"Remind: '-i' option: %s\n",
|
"Remind: '-i' option: %s\n",
|
||||||
"Pas de rappels.",
|
"Pas de rappels.",
|
||||||
"%d rappel(s) en file pour aujourd'hui.\n",
|
"%d rappel(s) en file pour aujourd'hui.\n",
|
||||||
"Nombre attendu",
|
"Nombre attendu",
|
||||||
"Fonction ill\351gale apr\350s WARN",
|
"Fonction illégale après WARN",
|
||||||
"Can't convert between time zones",
|
"Can't convert between time zones",
|
||||||
"No files matching *.rem",
|
"No files matching *.rem",
|
||||||
"String too long",
|
"String too long",
|
||||||
"Time specified twice",
|
"Time specified twice",
|
||||||
"Cannot specify DURATION without specifying AT"
|
"Cannot specify DURATION without specifying AT"
|
||||||
|
|
||||||
#else /* ISOLATIN1 */
|
|
||||||
"Ok",
|
|
||||||
"']' manquant",
|
|
||||||
"Apostrophe manquant",
|
|
||||||
"Expression trop complexe - trop d'operateurs",
|
|
||||||
"Expression trop complexe - trop d'operandes",
|
|
||||||
"')' manquante",
|
|
||||||
"Fonction non-definie",
|
|
||||||
"Caractere illegal",
|
|
||||||
"Operateur binaire attendu",
|
|
||||||
"Manque de memoire",
|
|
||||||
"Nombre mal forme",
|
|
||||||
"Erreur interne - 'underflow' de la pile d'operateurs",
|
|
||||||
"Erreur interne - 'underflow' de la pile de variables",
|
|
||||||
"Impossible de convertir",
|
|
||||||
"Types non-equivalents",
|
|
||||||
"Debordement de date",
|
|
||||||
"Erreur interne - erreur de pile",
|
|
||||||
"Division par zero",
|
|
||||||
"Variable non definie",
|
|
||||||
"Fin de ligne non attendue",
|
|
||||||
"Fin de fichier non attendue",
|
|
||||||
"Erreur I/O",
|
|
||||||
"Ligne trop longue",
|
|
||||||
"Erreur interne",
|
|
||||||
"Mauvaise date specifiee",
|
|
||||||
"Pas assez d'arguments",
|
|
||||||
"Trop d'arguments",
|
|
||||||
"Heure mal formee",
|
|
||||||
"Nombre trop eleve",
|
|
||||||
"Nombre trop bas",
|
|
||||||
"Impossible d'ouvrir le fichier",
|
|
||||||
"Trop d'INCLUDE imbriques",
|
|
||||||
"erreur d'analyse",
|
|
||||||
"Impossible de calculer le declenchement",
|
|
||||||
"Trop de IF imbriques",
|
|
||||||
"ELSE sans IF correspondant",
|
|
||||||
"ENDIF sans IF correspondant",
|
|
||||||
"Impossible d'omettre (OMIT) tous les jours",
|
|
||||||
"Element(s) etranger(s) sur la ligne",
|
|
||||||
"POP-OMIT-CONTEXT sans PUSH-OMIT-CONTEXT correspondant",
|
|
||||||
"RUN desactive",
|
|
||||||
"Erreur de domaine",
|
|
||||||
"Identificateur invalide",
|
|
||||||
"Appel recursif detecte",
|
|
||||||
"",
|
|
||||||
"Impossible de modifier une variable systeme",
|
|
||||||
"Fonction de la librairie C ne peut representer la date/l'heure",
|
|
||||||
"Tentative de redefinition d'une fonction intrinseque",
|
|
||||||
"Impossible d'imbriquer une definition de fonction dans une expression",
|
|
||||||
"Pour utiliser le facteur de repetition la date doit etre specifiee au complet",
|
|
||||||
"Annee specifiee deux fois",
|
|
||||||
"Mois specifie deux fois",
|
|
||||||
"Jour specifie deux fois",
|
|
||||||
"Element inconnu",
|
|
||||||
"Mois et jour doivent etre specifies dans commande OMIT",
|
|
||||||
"Trop de OMITs partiels",
|
|
||||||
"Trop de OMITs complets",
|
|
||||||
"Attention: PUSH-OMIT-CONTEXT sans POP-OMIT-CONTEXT correspondant",
|
|
||||||
"Erreur a la lecture du fichier",
|
|
||||||
"Fin de ligne attendue",
|
|
||||||
"Date hebreuse invalide",
|
|
||||||
"IIF demande nombre d'arguments impair",
|
|
||||||
"Attention: ENDIF manquant",
|
|
||||||
"Virgule attendue",
|
|
||||||
"Jour de la semaine specifie deux fois",
|
|
||||||
"Utiliser un seul parmi BEFORE, AFTER ou SKIP",
|
|
||||||
"Impossible d'imbriquer MSG, MSF, RUN, etc. dans une expression",
|
|
||||||
"Valeur de repetition specifiee deux fois",
|
|
||||||
"Valeur delta specifiee deux fois",
|
|
||||||
"Valeur de retour specifiee deux fois",
|
|
||||||
"Mot-cle ONCE utilise deux fois. (Hah.)",
|
|
||||||
"Heure attendue apres AT",
|
|
||||||
"Mot-cle THROUGH/UNTIL utilise deux fois",
|
|
||||||
"Specification de date incomplete",
|
|
||||||
"Mot-cle FROM/SCANFROM utilise deux fois",
|
|
||||||
"Variable",
|
|
||||||
"Valeur",
|
|
||||||
"*NON-DEFINI*",
|
|
||||||
"Entree dans UserFN",
|
|
||||||
"Sortie de UserFN",
|
|
||||||
"Expire",
|
|
||||||
"fork() echoue - impossible de faire les appels en queue",
|
|
||||||
"Impossible d'acceder au fichier",
|
|
||||||
"Date systeme illegale: Annee est inferieure a %d\n",
|
|
||||||
"Option de deverminage inconnue '%c'\n",
|
|
||||||
"Option inconnue '%c'\n",
|
|
||||||
"Usager inconnu '%s'\n",
|
|
||||||
"Impossible de changer gid pour %d\n",
|
|
||||||
"Impossible de changer uid pour %d\n",
|
|
||||||
"Manque de memoire pour environnement\n",
|
|
||||||
"Signe '=' manquant",
|
|
||||||
"Nom de variable absent",
|
|
||||||
"Expression absente",
|
|
||||||
"Impossible de changer la date d'acces de %s\n",
|
|
||||||
"Remind: '-i' option: %s\n",
|
|
||||||
"Pas de rappels.",
|
|
||||||
"%d rappel(s) en file pour aujourd'hui.\n",
|
|
||||||
"Nombre attendu",
|
|
||||||
"Fonction illegale apres WARN",
|
|
||||||
"Can't convert between time zones",
|
|
||||||
"No files matching *.rem",
|
|
||||||
"String too long",
|
|
||||||
"Time specified twice",
|
|
||||||
"Cannot specify DURATION without specifying AT"
|
|
||||||
#endif /* ISOLATIN1 */
|
|
||||||
};
|
};
|
||||||
#endif /* MK_GLOBALS */
|
#endif /* MK_GLOBALS */
|
||||||
|
|
||||||
@@ -363,63 +236,33 @@ void Usage(void)
|
|||||||
#ifdef BETA
|
#ifdef BETA
|
||||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||||
#endif
|
#endif
|
||||||
#if ISOLATIN1
|
fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [heure] [*répétition]\n");
|
||||||
fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [heure] [*r\351p\351tition]\n");
|
|
||||||
fprintf(ErrFp, "Options:\n");
|
fprintf(ErrFp, "Options:\n");
|
||||||
fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
|
fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
|
||||||
fprintf(ErrFp, " -r D\351sactiver les instructions RUN\n");
|
fprintf(ErrFp, " -r Désactiver les instructions RUN\n");
|
||||||
fprintf(ErrFp, " -c[n] Produire un calendrier pour n (d\351faut 1) mois\n");
|
fprintf(ErrFp, " -c[n] Produire un calendrier pour n (défaut 1) mois\n");
|
||||||
fprintf(ErrFp, " -c+[n] Produire un calendrier pour n (d\351faut 1) semaines\n");
|
fprintf(ErrFp, " -c+[n] Produire un calendrier pour n (défaut 1) semaines\n");
|
||||||
fprintf(ErrFp, " -w[n[,p[,s]]] Sp\351cifier largeur, remplissage et espacement du calendrier\n");
|
fprintf(ErrFp, " -w[n[,p[,s]]] Spécifier largeur, remplissage et espacement du calendrier\n");
|
||||||
fprintf(ErrFp, " -s[+][n] Produire un 'calendrier simple' pour n (1) mois (semaines)\n");
|
fprintf(ErrFp, " -s[+][n] Produire un 'calendrier simple' pour n (1) mois (semaines)\n");
|
||||||
fprintf(ErrFp, " -p[n] Comme -s, mais avec entr\351e compatible avec rem2ps\n");
|
fprintf(ErrFp, " -p[n] Comme -s, mais avec entrée compatible avec rem2ps\n");
|
||||||
fprintf(ErrFp, " -v Mode verbeux\n");
|
fprintf(ErrFp, " -v Mode verbeux\n");
|
||||||
fprintf(ErrFp, " -o Ignorer instructions ONCE\n");
|
fprintf(ErrFp, " -o Ignorer instructions ONCE\n");
|
||||||
fprintf(ErrFp, " -t D\351clencher tous les rappels peu importe le delta\n");
|
fprintf(ErrFp, " -t Déclencher tous les rappels peu importe le delta\n");
|
||||||
fprintf(ErrFp, " -h Mode silencieux\n");
|
fprintf(ErrFp, " -h Mode silencieux\n");
|
||||||
#ifdef HAVE_QUEUED
|
#ifdef HAVE_QUEUED
|
||||||
fprintf(ErrFp, " -a Ne pas d\351clencher les rappels minut\351s imm\351diatement - les mettre en file\n");
|
fprintf(ErrFp, " -a Ne pas déclencher les rappels minutés immédiatement - les mettre en file\n");
|
||||||
fprintf(ErrFp, " -q Ne pas mettre les rappels minut\351s en file\n");
|
fprintf(ErrFp, " -q Ne pas mettre les rappels minutés en file\n");
|
||||||
fprintf(ErrFp, " -f D\351clencher les rappels minut\351s imm\351diatement en restant en avant-plan\n");
|
fprintf(ErrFp, " -f Déclencher les rappels minutés immédiatement en restant en avant-plan\n");
|
||||||
fprintf(ErrFp, " -z[n] Entrer en mode 'daemon', r\351veil chaque n (5) minutes\n");
|
fprintf(ErrFp, " -z[n] Entrer en mode 'daemon', réveil chaque n (5) minutes\n");
|
||||||
#endif
|
#endif
|
||||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||||
fprintf(ErrFp, " -e Envoyer les messages de stderr \340 stdout\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, " -b[n] Formats de l'heure pour le calendrier: 0=am/pm, 1=24hr, 2=aucun\n");
|
||||||
fprintf(ErrFp, " -x[n] Limite d'it\351rations pour la clause SATISFY (def=150)\n");
|
fprintf(ErrFp, " -x[n] Limite d'itérations pour la clause SATISFY (def=150)\n");
|
||||||
fprintf(ErrFp, " -kcmd Ex\351cuter 'cmd' pour les rappels de type MSG\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\351 avant d'\351mettre\n");
|
fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorité avant d'émettre\n");
|
||||||
fprintf(ErrFp, " -ivar=val Initialiser var \340 val et conserver var\n");
|
fprintf(ErrFp, " -ivar=val Initialiser var à val et conserver var\n");
|
||||||
fprintf(ErrFp, " -m Commencer le calendrier avec lundi plut\364t que dimanche\n");
|
fprintf(ErrFp, " -m Commencer le calendrier avec lundi plutôt que dimanche\n");
|
||||||
#else /* ISOLATIN1 */
|
|
||||||
fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [heure] [*repetition]\n");
|
|
||||||
fprintf(ErrFp, "Options:\n");
|
|
||||||
fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
|
|
||||||
fprintf(ErrFp, " -r Desactiver les instructions RUN\n");
|
|
||||||
fprintf(ErrFp, " -c[n] Produire un calendrier pour n (defaut 1) mois\n");
|
|
||||||
fprintf(ErrFp, " -c+[n] Produire un calendrier pour n (defaut 1) semaines\n");
|
|
||||||
fprintf(ErrFp, " -w[n[,p[,s]]] Specifier largeur, remplissage et espacement du calendrier\n");
|
|
||||||
fprintf(ErrFp, " -s[+][n] Produire un 'calendrier simple' pour n (1) mois (semaines)\n");
|
|
||||||
fprintf(ErrFp, " -p[n] Comme -s, mais avec entree compatible avec rem2ps\n");
|
|
||||||
fprintf(ErrFp, " -v Mode verbeux\n");
|
|
||||||
fprintf(ErrFp, " -o Ignorer instructions ONCE\n");
|
|
||||||
fprintf(ErrFp, " -t Declencher tous les rappels peu importe le delta\n");
|
|
||||||
fprintf(ErrFp, " -h Mode silencieux\n");
|
|
||||||
#ifdef HAVE_QUEUED
|
|
||||||
fprintf(ErrFp, " -a Ne pas declencher les rappels minutes immediatement - les mettre en file\n");
|
|
||||||
fprintf(ErrFp, " -q Ne pas mettre les rappels minutes en file\n");
|
|
||||||
fprintf(ErrFp, " -f Declencher les rappels minutes immediatement en restant en avant-plan\n");
|
|
||||||
fprintf(ErrFp, " -z[n] Entrer en mode 'daemon', reveil chaque n (5) minutes\n");
|
|
||||||
#endif
|
|
||||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
|
||||||
fprintf(ErrFp, " -e Envoyer les messages de stderr a 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'iterations pour la clause SATISFY (def=150)\n");
|
|
||||||
fprintf(ErrFp, " -kcmd Executer 'cmd' pour les rappels de type MSG\n");
|
|
||||||
fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorite avant d'emettre\n");
|
|
||||||
fprintf(ErrFp, " -ivar=val Initialiser var a val et conserver var\n");
|
|
||||||
fprintf(ErrFp, " -m Commencer le calendrier avec lundi plutot que dimanche\n");
|
|
||||||
#endif /* ISOLATIN1 */
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#endif /* L_IN_INIT */
|
#endif /* L_IN_INIT */
|
||||||
|
|||||||
@@ -28,11 +28,7 @@
|
|||||||
/* Month names */
|
/* Month names */
|
||||||
#define L_JAN "Januar"
|
#define L_JAN "Januar"
|
||||||
#define L_FEB "Februar"
|
#define L_FEB "Februar"
|
||||||
#if ISOLATIN1
|
#define L_MAR "März"
|
||||||
# define L_MAR "M\344rz"
|
|
||||||
#else
|
|
||||||
# define L_MAR "Maerz"
|
|
||||||
#endif
|
|
||||||
#define L_APR "April"
|
#define L_APR "April"
|
||||||
#define L_MAY "Mai"
|
#define L_MAY "Mai"
|
||||||
#define L_JUN "Juni"
|
#define L_JUN "Juni"
|
||||||
@@ -48,11 +44,7 @@
|
|||||||
#define L_TOMORROW "morgen"
|
#define L_TOMORROW "morgen"
|
||||||
|
|
||||||
/* The default banner */
|
/* The default banner */
|
||||||
#if ISOLATIN1
|
#define L_BANNER "Termine für %w, den %d. %m %y%o:"
|
||||||
# define L_BANNER "Termine f\374r %w, den %d. %m %y%o:"
|
|
||||||
#else
|
|
||||||
# define L_BANNER "Termine fuer %w, den %d. %m %y%o:"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* "am" and "pm" */
|
/* "am" and "pm" */
|
||||||
#define L_AM "am"
|
#define L_AM "am"
|
||||||
|
|||||||
@@ -15,23 +15,13 @@
|
|||||||
#define L_LANGNAME "Italian"
|
#define L_LANGNAME "Italian"
|
||||||
|
|
||||||
/* Day names */
|
/* Day names */
|
||||||
#if ISOLATIN1
|
|
||||||
#define L_SUNDAY "Domenica"
|
#define L_SUNDAY "Domenica"
|
||||||
#define L_MONDAY "Luned\354"
|
#define L_MONDAY "Lunedí"
|
||||||
#define L_TUESDAY "Marted\354"
|
#define L_TUESDAY "Martedí"
|
||||||
#define L_WEDNESDAY "Mercoled\354"
|
#define L_WEDNESDAY "Mercoledí"
|
||||||
#define L_THURSDAY "Gioved\354"
|
#define L_THURSDAY "Giovedí"
|
||||||
#define L_FRIDAY "Venerd\354"
|
#define L_FRIDAY "Venerdí"
|
||||||
#define L_SATURDAY "Sabato"
|
#define L_SATURDAY "Sabato"
|
||||||
#else /* ISOLATIN1 */
|
|
||||||
#define L_SUNDAY "Domenica"
|
|
||||||
#define L_MONDAY "Lunedi`"
|
|
||||||
#define L_TUESDAY "Martedi`"
|
|
||||||
#define L_WEDNESDAY "Mercoledi`"
|
|
||||||
#define L_THURSDAY "Giovedi`"
|
|
||||||
#define L_FRIDAY "Venerdi`"
|
|
||||||
#define L_SATURDAY "Sabato"
|
|
||||||
#endif /* ISOLATIN */
|
|
||||||
|
|
||||||
/* Month names */
|
/* Month names */
|
||||||
#define L_JAN "Gennaio"
|
#define L_JAN "Gennaio"
|
||||||
@@ -76,58 +66,54 @@
|
|||||||
a more drastic fix */
|
a more drastic fix */
|
||||||
|
|
||||||
/* Minutes, hours, at, etc */
|
/* Minutes, hours, at, etc */
|
||||||
#define L_NOW "ora"
|
#define L_NOW "ora"
|
||||||
#define L_AT "alle"
|
#define L_AT "alle"
|
||||||
#define L_MINUTE "minut"
|
#define L_MINUTE "minut"
|
||||||
#define L_HOUR "or"
|
#define L_HOUR "or"
|
||||||
#if ISOLATIN1
|
#define L_IS "é"
|
||||||
#define L_IS "\350"
|
|
||||||
#else /* ISOLATIN1 */
|
|
||||||
#define L_IS "e`"
|
|
||||||
#endif/* ISOLATIN1 */
|
|
||||||
#define L_WAS "era"
|
#define L_WAS "era"
|
||||||
#define L_AND "e"
|
#define L_AND "e"
|
||||||
/* What to add to make "hour" plural */
|
/* What to add to make "hour" plural */
|
||||||
#define L_HPLU "s"
|
#define L_HPLU "s"
|
||||||
/* What to add to make "minute" plural */
|
/* What to add to make "minute" plural */
|
||||||
#define L_MPLU "s"
|
#define L_MPLU "s"
|
||||||
|
|
||||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||||
See the file dosubst.c for more info. */
|
See the file dosubst.c for more info. */
|
||||||
|
|
||||||
#define L_P_OVER sprintf(s, (diff == 1 ? "o" : "i"));
|
#define L_P_OVER sprintf(s, (diff == 1 ? "o" : "i"));
|
||||||
#define L_Q_OVER sprintf(s, (diff == 1 ? "a" : "e"));
|
#define L_Q_OVER sprintf(s, (diff == 1 ? "a" : "e"));
|
||||||
|
|
||||||
#define L_HPLU_OVER hplu = (hdiff == 1 ? "a" : "e");
|
#define L_HPLU_OVER hplu = (hdiff == 1 ? "a" : "e");
|
||||||
#define L_MPLU_OVER mplu = (mdiff == 1 ? "o" : "i");
|
#define L_MPLU_OVER mplu = (mdiff == 1 ? "o" : "i");
|
||||||
|
|
||||||
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d,\
|
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d,\
|
||||||
MonthName[m], y);
|
MonthName[m], y);
|
||||||
#define L_C_OVER sprintf(s, "%s", DayName[jul%7]);
|
#define L_C_OVER sprintf(s, "%s", DayName[jul%7]);
|
||||||
|
|
||||||
#define L_E_OVER sprintf(s, "%02d%c%02d%c%04d", d, DateSep,\
|
#define L_E_OVER sprintf(s, "%02d%c%02d%c%04d", d, DateSep,\
|
||||||
m+1, DateSep, y);
|
m+1, DateSep, y);
|
||||||
|
|
||||||
#define L_F_OVER sprintf(s, "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
|
#define L_F_OVER sprintf(s, "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
|
||||||
|
|
||||||
#define L_G_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
|
#define L_G_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
|
||||||
|
|
||||||
#define L_H_OVER sprintf(s, "%02d%c%02d", d, DateSep, m+1);
|
#define L_H_OVER sprintf(s, "%02d%c%02d", d, DateSep, m+1);
|
||||||
|
|
||||||
#define L_I_OVER sprintf(s, "%02d%c%02d", m+1, DateSep, d);
|
#define L_I_OVER sprintf(s, "%02d%c%02d", m+1, DateSep, d);
|
||||||
|
|
||||||
#define L_J_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, \
|
#define L_J_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, \
|
||||||
MonthName[m], y);
|
MonthName[m], y);
|
||||||
|
|
||||||
#define L_K_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
|
#define L_K_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
|
||||||
MonthName[m]);
|
MonthName[m]);
|
||||||
#define L_L_OVER sprintf(s, "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
|
#define L_L_OVER sprintf(s, "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
|
||||||
|
|
||||||
#define L_U_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, \
|
#define L_U_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, \
|
||||||
MonthName[m], y);
|
MonthName[m], y);
|
||||||
|
|
||||||
#define L_V_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
|
#define L_V_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
|
||||||
MonthName[m]);
|
MonthName[m]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* L_IN_DOSUBST */
|
#endif /* L_IN_DOSUBST */
|
||||||
|
|||||||
@@ -14,21 +14,13 @@
|
|||||||
#define L_LANGNAME "Norwegian"
|
#define L_LANGNAME "Norwegian"
|
||||||
|
|
||||||
/* Day names */
|
/* Day names */
|
||||||
#if ISOLATIN1
|
#define L_SUNDAY "Søndag"
|
||||||
# define L_SUNDAY "S\370ndag"
|
|
||||||
#else
|
|
||||||
# define L_SUNDAY "Soendag"
|
|
||||||
#endif
|
|
||||||
#define L_MONDAY "Mandag"
|
#define L_MONDAY "Mandag"
|
||||||
#define L_TUESDAY "Tirsdag"
|
#define L_TUESDAY "Tirsdag"
|
||||||
#define L_WEDNESDAY "Onsdag"
|
#define L_WEDNESDAY "Onsdag"
|
||||||
#define L_THURSDAY "Torsdag"
|
#define L_THURSDAY "Torsdag"
|
||||||
#define L_FRIDAY "Fredag"
|
#define L_FRIDAY "Fredag"
|
||||||
#if ISOLATIN1
|
#define L_SATURDAY "Lørdag"
|
||||||
# define L_SATURDAY "L\370rdag"
|
|
||||||
#else
|
|
||||||
# define L_SATURDAY "Loerdag"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Month names */
|
/* Month names */
|
||||||
#define L_JAN "Januar"
|
#define L_JAN "Januar"
|
||||||
@@ -49,11 +41,7 @@
|
|||||||
#define L_TOMORROW "i morgen"
|
#define L_TOMORROW "i morgen"
|
||||||
|
|
||||||
/* The default banner */
|
/* The default banner */
|
||||||
#if ISOLATIN1
|
#define L_BANNER "Påminnelse for %w, %d. %m, %y%o:"
|
||||||
# define L_BANNER "P\345minnelse for %w, %d. %m, %y%o:"
|
|
||||||
#else
|
|
||||||
# define L_BANNER "Paaminnelse for %w, %d. %m, %y%o:"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* "am" and "pm" */
|
/* "am" and "pm" */
|
||||||
#define L_AM "am"
|
#define L_AM "am"
|
||||||
@@ -64,11 +52,7 @@
|
|||||||
|
|
||||||
/* Ago and from now */
|
/* Ago and from now */
|
||||||
#define L_AGO "siden"
|
#define L_AGO "siden"
|
||||||
#if ISOLATIN1
|
#define L_FROMNOW "fra nå"
|
||||||
# define L_FROMNOW "fra n\345"
|
|
||||||
#else
|
|
||||||
# define L_FROMNOW "fra naa"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* "in %d days' time" */
|
/* "in %d days' time" */
|
||||||
#define L_INXDAYS "om %d dager"
|
#define L_INXDAYS "om %d dager"
|
||||||
@@ -81,11 +65,7 @@
|
|||||||
#define L_PLURAL "er"
|
#define L_PLURAL "er"
|
||||||
|
|
||||||
/* Minutes, hours, at, etc */
|
/* Minutes, hours, at, etc */
|
||||||
#if ISOLATIN1
|
#define L_NOW "nå"
|
||||||
# define L_NOW "n\345"
|
|
||||||
#else
|
|
||||||
# define L_NOW "naa"
|
|
||||||
#endif
|
|
||||||
#define L_AT "kl."
|
#define L_AT "kl."
|
||||||
#define L_MINUTE "minutt"
|
#define L_MINUTE "minutt"
|
||||||
#define L_HOUR "time"
|
#define L_HOUR "time"
|
||||||
@@ -93,7 +73,7 @@
|
|||||||
#define L_WAS "var"
|
#define L_WAS "var"
|
||||||
#define L_AND "og"
|
#define L_AND "og"
|
||||||
/* What to add to make "hour" plural */
|
/* What to add to make "hour" plural */
|
||||||
#define L_HPLU "r"
|
#define L_HPLU "r"
|
||||||
/* What to add to make "minute" plural */
|
/* What to add to make "minute" plural */
|
||||||
#define L_MPLU "er"
|
#define L_MPLU "er"
|
||||||
|
|
||||||
|
|||||||
@@ -17,52 +17,27 @@
|
|||||||
#define L_LANGNAME "Polish"
|
#define L_LANGNAME "Polish"
|
||||||
|
|
||||||
/* Day names */
|
/* Day names */
|
||||||
#if ISOLATIN1
|
|
||||||
# define L_SUNDAY "Niedziela"
|
# define L_SUNDAY "Niedziela"
|
||||||
# define L_MONDAY "Poniedzia\263ek"
|
# define L_MONDAY "Poniedziałek"
|
||||||
# define L_TUESDAY "Wtorek"
|
# define L_TUESDAY "Wtorek"
|
||||||
# define L_WEDNESDAY "\246roda"
|
# define L_WEDNESDAY "Środa"
|
||||||
# define L_THURSDAY "Czwartek"
|
# define L_THURSDAY "Czwartek"
|
||||||
# define L_FRIDAY "Pi\261tek"
|
# define L_FRIDAY "Piątek"
|
||||||
# define L_SATURDAY "Sobota"
|
# define L_SATURDAY "Sobota"
|
||||||
#else
|
|
||||||
# define L_SUNDAY "Niedziela"
|
|
||||||
# define L_MONDAY "Poniedzialek"
|
|
||||||
# define L_TUESDAY "Wtorek"
|
|
||||||
# define L_WEDNESDAY "Sroda"
|
|
||||||
# define L_THURSDAY "Czwartek"
|
|
||||||
# define L_FRIDAY "Piatek"
|
|
||||||
# define L_SATURDAY "Sobota"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Month names */
|
/* Month names */
|
||||||
#if ISOLATIN1
|
# define L_JAN "Styczeń"
|
||||||
# define L_JAN "Stycze\361"
|
|
||||||
# define L_FEB "Luty"
|
# define L_FEB "Luty"
|
||||||
# define L_MAR "Marzec"
|
# define L_MAR "Marzec"
|
||||||
# define L_APR "Kwiecie\361"
|
# define L_APR "Kwiecień"
|
||||||
# define L_MAY "Maj"
|
# define L_MAY "Maj"
|
||||||
# define L_JUN "Czerwiec"
|
# define L_JUN "Czerwiec"
|
||||||
# define L_JUL "Lipiec"
|
# define L_JUL "Lipiec"
|
||||||
# define L_AUG "Sierpie\361"
|
# define L_AUG "Sierpień"
|
||||||
# define L_SEP "Wrzesie\361"
|
# define L_SEP "Wrzesień"
|
||||||
# define L_OCT "Pa\274dziernik"
|
# define L_OCT "Październik"
|
||||||
# define L_NOV "Listopad"
|
# define L_NOV "Listopad"
|
||||||
# define L_DEC "Grudzie\361"
|
# define L_DEC "Grudzień"
|
||||||
#else
|
|
||||||
# define L_JAN "Styczen"
|
|
||||||
# define L_FEB "Luty"
|
|
||||||
# define L_MAR "Marzec"
|
|
||||||
# define L_APR "Kwiecien"
|
|
||||||
# define L_MAY "Maj"
|
|
||||||
# define L_JUN "Czerwiec"
|
|
||||||
# define L_JUL "Lipiec"
|
|
||||||
# define L_AUG "Sierpien"
|
|
||||||
# define L_SEP "Wrzesien"
|
|
||||||
# define L_OCT "Pazdziernik"
|
|
||||||
# define L_NOV "Listopad"
|
|
||||||
# define L_DEC "Grudzien"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Today and tomorrow */
|
/* Today and tomorrow */
|
||||||
#define L_TODAY "dzisiaj"
|
#define L_TODAY "dzisiaj"
|
||||||
@@ -97,22 +72,12 @@
|
|||||||
#define L_AT "o"
|
#define L_AT "o"
|
||||||
#define L_MINUTE "minut"
|
#define L_MINUTE "minut"
|
||||||
#define L_HOUR "godzin"
|
#define L_HOUR "godzin"
|
||||||
#if ISOLATIN1
|
# define L_IS "będzie"
|
||||||
# define L_IS "b\352dzie"
|
# define L_WAS "było"
|
||||||
# define L_WAS "by\263o"
|
|
||||||
#else
|
|
||||||
# define L_IS "bedzie"
|
|
||||||
# define L_WAS "bylo"
|
|
||||||
#endif
|
|
||||||
#define L_AND "i"
|
#define L_AND "i"
|
||||||
/* What to add to make "hour" or "minute" plural */
|
/* What to add to make "hour" or "minute" plural */
|
||||||
#if ISOLATIN1
|
#define L_NPLU( N ) ((N == 1) ? "ę" : ((N==12) || (N==13) || (N==14)) ? "" : \
|
||||||
#define L_NPLU( N ) ((N == 1) ? "\352" : ((N==12) || (N==13) || (N==14)) ? "" : \
|
|
||||||
((N%10==2) || (N%10==3) || (N%10==4)) ? "y" : "" )
|
((N%10==2) || (N%10==3) || (N%10==4)) ? "y" : "" )
|
||||||
#else
|
|
||||||
#define L_NPLU( N ) ((N == 1) ? "e" : ((N==12) || (N==13) || (N==14)) ? "" : \
|
|
||||||
((N%10==2) || (N%10==3) || (N%10==4)) ? "y" : "" )
|
|
||||||
#endif
|
|
||||||
/* What to add to make "hour" plural */
|
/* What to add to make "hour" plural */
|
||||||
#define L_HPLU L_NPLU( hdiff )
|
#define L_HPLU L_NPLU( hdiff )
|
||||||
/* What to add to make "minute" plural */
|
/* What to add to make "minute" plural */
|
||||||
@@ -120,25 +85,14 @@
|
|||||||
|
|
||||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||||
See the file dosubst.c for more info. */
|
See the file dosubst.c for more info. */
|
||||||
#if ISOLATIN1
|
|
||||||
#define L_AMPM_OVERRIDE(ampm, hour) \
|
#define L_AMPM_OVERRIDE(ampm, hour) \
|
||||||
ampm = (hour<12) ? \
|
ampm = (hour<12) ? \
|
||||||
(hour<5) ? " w nocy" \
|
(hour<5) ? " w nocy" \
|
||||||
: (hour<10) ? " rano" \
|
: (hour<10) ? " rano" \
|
||||||
: " przed po\263udniem" \
|
: " przed południem" \
|
||||||
: (hour<18) ? " po po\263udniu" \
|
: (hour<18) ? " po południu" \
|
||||||
: (hour<22) ? " wieczorem" \
|
: (hour<22) ? " wieczorem" \
|
||||||
: " w nocy";
|
: " w nocy";
|
||||||
#else
|
|
||||||
#define L_AMPM_OVERRIDE(ampm, hour) \
|
|
||||||
ampm = (hour<12) ? \
|
|
||||||
(hour<5) ? " w nocy" \
|
|
||||||
: (hour<10) ? " rano" \
|
|
||||||
: " przed poludniem" \
|
|
||||||
: (hour<18) ? " po poludniu" \
|
|
||||||
: (hour<22) ? " wieczorem" \
|
|
||||||
: " w nocy";
|
|
||||||
#endif
|
|
||||||
#define L_ORDINAL_OVERRIDE plu = "";
|
#define L_ORDINAL_OVERRIDE plu = "";
|
||||||
#define L_A_OVER if (altmode == '*') { sprintf(s, "%s, %d. %s %d", DayName[jul%7], d, MonthName[m], y); } else { sprintf(s, "%s %s, %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y); }
|
#define L_A_OVER if (altmode == '*') { sprintf(s, "%s, %d. %s %d", DayName[jul%7], d, MonthName[m], y); } else { sprintf(s, "%s %s, %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y); }
|
||||||
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, %d. %s", DayName[jul%7], d, MonthName[m]); } else { sprintf(s, "%s %s, %d. %s", L_ON, DayName[jul%7], d, MonthName[m]); }
|
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, %d. %s", DayName[jul%7], d, MonthName[m]); } else { sprintf(s, "%s %s, %d. %s", L_ON, DayName[jul%7], d, MonthName[m]); }
|
||||||
@@ -178,104 +132,103 @@ else \
|
|||||||
#define L_ERR_OVERRIDE 1
|
#define L_ERR_OVERRIDE 1
|
||||||
EXTERN char *ErrMsg[] =
|
EXTERN char *ErrMsg[] =
|
||||||
{
|
{
|
||||||
#if ISOLATIN1
|
|
||||||
"OK",
|
"OK",
|
||||||
"Brakuj\261cy ']'",
|
"Brakujący ']'",
|
||||||
"Brakuj\261cy nawias",
|
"Brakujący nawias",
|
||||||
"Zbyt skomplikowane wyra\277enie - za du\277o operator\363w",
|
"Zbyt skomplikowane wyrażenie - za dużo operatorów",
|
||||||
"Zbyt skomplikowane wyra\277enie - za du\277o argument\363w",
|
"Zbyt skomplikowane wyrażenie - za dużo argumentów",
|
||||||
"Brakuj\261cy ')'",
|
"Brakujący ')'",
|
||||||
"Nie zdefiniowana funkcja",
|
"Nie zdefiniowana funkcja",
|
||||||
"Nielegalny znak",
|
"Nielegalny znak",
|
||||||
"Spodziewany operator binarny",
|
"Spodziewany operator binarny",
|
||||||
"Brak pami\352ci",
|
"Brak pamięci",
|
||||||
"Niepoprawny numer",
|
"Niepoprawny numer",
|
||||||
"Pusty stos operator\363w - b\263\261d wewn\352trzny",
|
"Pusty stos operatorów - błąd wewnętrzny",
|
||||||
"Pusty stos zmiennych - b\263\261d wewn\352trzny",
|
"Pusty stos zmiennych - błąd wewnętrzny",
|
||||||
"Niemo\277liwa konwersja",
|
"Niemożliwa konwersja",
|
||||||
"B\263\261d typu",
|
"Błąd typu",
|
||||||
"Nadmiar daty",
|
"Nadmiar daty",
|
||||||
"B\263\261d stosu - b\263\261d wewn\352trzny",
|
"Błąd stosu - błąd wewnętrzny",
|
||||||
"Dzielenie przez zero",
|
"Dzielenie przez zero",
|
||||||
"Niezdefiniowana zmienna",
|
"Niezdefiniowana zmienna",
|
||||||
"Niespodziewany koniec linii",
|
"Niespodziewany koniec linii",
|
||||||
"Niespodziewany koniec pliku",
|
"Niespodziewany koniec pliku",
|
||||||
"B\263\261d wejscia/wyjscia",
|
"Błąd wejscia/wyjscia",
|
||||||
"Za d\263uga linia",
|
"Za długa linia",
|
||||||
"B\263\261d wewn\352trzny",
|
"Błąd wewnętrzny",
|
||||||
"Z\263a specyfikacja daty",
|
"Zła specyfikacja daty",
|
||||||
"Za ma\263o argument\363w",
|
"Za mało argumentów",
|
||||||
"Za du\277o argument\363w",
|
"Za dużo argumentów",
|
||||||
"Nieprawid\263owy czas",
|
"Nieprawidłowy czas",
|
||||||
"Liczba za du\277a",
|
"Liczba za duża",
|
||||||
"Liczba za ma\263a",
|
"Liczba za mała",
|
||||||
"Nie mog\352 otworzy\346 pliku",
|
"Nie mogę otworzyć pliku",
|
||||||
"Zbyt zagnie\277d\277one INCLUDE",
|
"Zbyt zagnieżdżone INCLUDE",
|
||||||
"B\263\261d sk\263adniowy",
|
"Błąd składniowy",
|
||||||
"Nie mog\352 obliczy\346 przypomnienia",
|
"Nie mogę obliczyć przypomnienia",
|
||||||
"Zbyt zagnie\277d\277one IF",
|
"Zbyt zagnieżdżone IF",
|
||||||
"ELSE bez IF do pary",
|
"ELSE bez IF do pary",
|
||||||
"ENDIF bez IF do pary",
|
"ENDIF bez IF do pary",
|
||||||
"Nie mog\352 omin\261\346 (OMIT) wszystkich dni",
|
"Nie mogę ominąć (OMIT) wszystkich dni",
|
||||||
"Niespodziewany wyraz w lini",
|
"Niespodziewany wyraz w lini",
|
||||||
"POP-OMIT-CONTEXT bez PUSH-OMIT-CONTEXT",
|
"POP-OMIT-CONTEXT bez PUSH-OMIT-CONTEXT",
|
||||||
"Komenda RUN zablokowana",
|
"Komenda RUN zablokowana",
|
||||||
"B\263\261d dziedziny",
|
"Błąd dziedziny",
|
||||||
"Niepoprawny identyfikator",
|
"Niepoprawny identyfikator",
|
||||||
"Wykryto rekursywne wywo\263anie funkcji",
|
"Wykryto rekursywne wywołanie funkcji",
|
||||||
"",
|
"",
|
||||||
"Nie mog\352 zmieni\346 zmiennej systemowej",
|
"Nie mogę zmienić zmiennej systemowej",
|
||||||
"Funkcja biblioteki C nie mo\277e reprezentowac daty/czasu",
|
"Funkcja biblioteki C nie może reprezentowac daty/czasu",
|
||||||
"Pr\363ba redefinicji funkcji wbudowanej",
|
"Próba redefinicji funkcji wbudowanej",
|
||||||
"Nie wolno zagnie\277d\277a\346 definicji funkcji w wyra\277eniu",
|
"Nie wolno zagnieżdżać definicji funkcji w wyrażeniu",
|
||||||
"Aby u\277yc powt\363rzenia trzeba w pe\263ni wyspecyfikowa\346 dat\352",
|
"Aby użyc powtórzenia trzeba w pełni wyspecyfikować datę",
|
||||||
"Rok podany dw\363krotnie",
|
"Rok podany dwókrotnie",
|
||||||
"Miesi\261c podany dw\363krotnie",
|
"Miesiąc podany dwókrotnie",
|
||||||
"Dzie\361 podany dw\363krotnie",
|
"Dzień podany dwókrotnie",
|
||||||
"Nieznane s\263owo",
|
"Nieznane słowo",
|
||||||
"W komendzie OMIT trzeba poda\346 miesi\261c i dzie\361",
|
"W komendzie OMIT trzeba podać miesiąc i dzień",
|
||||||
"Za du\277o cz\352\266ciowych komend OMIT",
|
"Za dużo częściowych komend OMIT",
|
||||||
"Za du\277o pe\263nych komend OMIT",
|
"Za dużo pełnych komend OMIT",
|
||||||
"Ostrze\277enie: PUSH-OMIT-CONTEXT bez POP-OMIT-CONTEXT",
|
"Ostrzeżenie: PUSH-OMIT-CONTEXT bez POP-OMIT-CONTEXT",
|
||||||
"B\263\261d odczytu pliku",
|
"Błąd odczytu pliku",
|
||||||
"Oczekiwany koniec linii",
|
"Oczekiwany koniec linii",
|
||||||
"B\263\352dna data hebrajska",
|
"Błędna data hebrajska",
|
||||||
"IIF wymaga nieparzystej liczby argument\363w",
|
"IIF wymaga nieparzystej liczby argumentów",
|
||||||
"Ostrze\277enie: Brakujacy ENDIF",
|
"Ostrzeżenie: Brakujacy ENDIF",
|
||||||
"Oczekiwany przecinek",
|
"Oczekiwany przecinek",
|
||||||
"Dzie\361 tygodnia podany dw\363krotnie",
|
"Dzień tygodnia podany dwókrotnie",
|
||||||
"Dozwolone tylko jedno z: BEFORE, AFTER i SKIP",
|
"Dozwolone tylko jedno z: BEFORE, AFTER i SKIP",
|
||||||
"Nie mo\277na zagnie\277d\277a\346 MSG, MSF, RUN, itp. w wyra\277eniu",
|
"Nie można zagnieżdżać MSG, MSF, RUN, itp. w wyrażeniu",
|
||||||
"Warto\266\346 powtorzenia podana dw\363krotnie",
|
"Wartość powtorzenia podana dwókrotnie",
|
||||||
"Warto\266\346 r\363\277nicy podana dw\363krotnie",
|
"Wartość różnicy podana dwókrotnie",
|
||||||
"Warto\266\346 cofni\352cia podana dw\363krotnie",
|
"Wartość cofnięcia podana dwókrotnie",
|
||||||
"S\263owo ONCE u\277yte dw\363krotnie.",
|
"Słowo ONCE użyte dwókrotnie.",
|
||||||
"Po AT oczekiwany jest czas",
|
"Po AT oczekiwany jest czas",
|
||||||
"S\263owo THROUGH/UNTIL u\277yte dw\363krotnie",
|
"Słowo THROUGH/UNTIL użyte dwókrotnie",
|
||||||
"Niekompletna specyfikacja daty",
|
"Niekompletna specyfikacja daty",
|
||||||
"S\263owo FROM/SCANFROM u\277yte dw\363krotnie",
|
"Słowo FROM/SCANFROM użyte dwókrotnie",
|
||||||
"Zmienna",
|
"Zmienna",
|
||||||
"Warto\266\346",
|
"Wartość",
|
||||||
"*NIE ZDEFINIOWANE*",
|
"*NIE ZDEFINIOWANE*",
|
||||||
"Pocz\261tek UserFN",
|
"Początek UserFN",
|
||||||
"Koniec UserFN",
|
"Koniec UserFN",
|
||||||
"Przemine\263o",
|
"Przemineło",
|
||||||
"Niepowodzenie w funkcji fork() - nie mog\352 kolejkowa\346 przypomnie\361",
|
"Niepowodzenie w funkcji fork() - nie mogę kolejkować przypomnień",
|
||||||
"Nie ma dost\352pu do pliku",
|
"Nie ma dostępu do pliku",
|
||||||
"B\263\352dna data systemowa: Rok mniejszy ni\277 %d\n",
|
"Błędna data systemowa: Rok mniejszy niż %d\n",
|
||||||
"Nieznana flaga odpluskwiania '%c'\n",
|
"Nieznana flaga odpluskwiania '%c'\n",
|
||||||
"Nieznana opcja '%c'\n",
|
"Nieznana opcja '%c'\n",
|
||||||
"Nieznany u\277ytkownik '%s'\n",
|
"Nieznany użytkownik '%s'\n",
|
||||||
"Nie mog\352 zmieni\346 gid na %d\n",
|
"Nie mogę zmienić gid na %d\n",
|
||||||
"Nie mog\352 zmieni\346 uid na %d\n",
|
"Nie mogę zmienić uid na %d\n",
|
||||||
"Brak pami\352ci na zmienne \266rodowiska\n",
|
"Brak pamięci na zmienne środowiska\n",
|
||||||
"Brak znaku '='",
|
"Brak znaku '='",
|
||||||
"Brak nazwy zmiennej",
|
"Brak nazwy zmiennej",
|
||||||
"Brak wyra\277enia",
|
"Brak wyrażenia",
|
||||||
"Nie mog\352 zmieni\346 daty dost\352pu pliku %s\n",
|
"Nie mogę zmienić daty dostępu pliku %s\n",
|
||||||
"Remind: '-i' option: %s\n",
|
"Remind: '-i' option: %s\n",
|
||||||
"Brak przypomnie\361.",
|
"Brak przypomnień.",
|
||||||
"%d Przypomnienia zakolejkowane na p\363\274niej.\n",
|
"%d Przypomnienia zakolejkowane na później.\n",
|
||||||
"Spodziewana liczba",
|
"Spodziewana liczba",
|
||||||
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)",
|
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)",
|
||||||
"Can't convert between time zones",
|
"Can't convert between time zones",
|
||||||
@@ -283,112 +236,6 @@ EXTERN char *ErrMsg[] =
|
|||||||
"String too long",
|
"String too long",
|
||||||
"Time specified twice",
|
"Time specified twice",
|
||||||
"Cannot specify DURATION without specifying AT"
|
"Cannot specify DURATION without specifying AT"
|
||||||
#else /* ISOLATIN1 */
|
|
||||||
"OK",
|
|
||||||
"Brakujacy ']'",
|
|
||||||
"Brakujacy nawias",
|
|
||||||
"Zbyt skomplikowane wyrazenie - za duzo operatorow",
|
|
||||||
"Zbyt skomplikowane wyrazenie - za duzo argumentow",
|
|
||||||
"Brakujacy ')'",
|
|
||||||
"Niezdefiniowana funkcja",
|
|
||||||
"Nielegalny znak",
|
|
||||||
"Spodziewany operator binarny",
|
|
||||||
"Brak pamieci",
|
|
||||||
"Niepoprawny numer",
|
|
||||||
"Pusty stos operatorow - blad wewnetrzny",
|
|
||||||
"Pusty stos zmiennych - blad wewnetrzny",
|
|
||||||
"Niemozliwa konwersja",
|
|
||||||
"Blad typu",
|
|
||||||
"Nadmiar daty",
|
|
||||||
"Blad stosu - blad wewnetrzny",
|
|
||||||
"Dzielenie przez zero",
|
|
||||||
"Niezdefiniowana zmienna",
|
|
||||||
"Niespodziewany koniec linii",
|
|
||||||
"Niespodziewany koniec pliku",
|
|
||||||
"Blad wejscia/wyjscia",
|
|
||||||
"Za dluga linia",
|
|
||||||
"Blad wewnetrzny",
|
|
||||||
"Zla specyfikacja daty",
|
|
||||||
"Za malo argumentow",
|
|
||||||
"Za duzo argumentow",
|
|
||||||
"Nieprawidlowy czas",
|
|
||||||
"Liczba za duza",
|
|
||||||
"Liczba za mala",
|
|
||||||
"Nie moge otworzyc pliku",
|
|
||||||
"INCLUDE zbyt zagniezdzone",
|
|
||||||
"Blad skladniowy",
|
|
||||||
"Nie moge obliczyc przypomnienia",
|
|
||||||
"Zbyt zagniezdzone IF",
|
|
||||||
"ELSE bez IF do pary",
|
|
||||||
"ENDIF bez IF do pary",
|
|
||||||
"Nie moge ominac (OMIT) wszystkich dni",
|
|
||||||
"Niespodziewany wyraz w lini",
|
|
||||||
"POP-OMIT-CONTEXT bez PUSH-OMIT-CONTEXT",
|
|
||||||
"Komenda RUN zablokowana",
|
|
||||||
"Blad dziedziny",
|
|
||||||
"Niepoprawny identyfikator",
|
|
||||||
"Wykryto rekursywne wywolanie funkcji",
|
|
||||||
"",
|
|
||||||
"Nie moga zmienic zmiennej systemowej",
|
|
||||||
"Funkcja biblioteki C nie moze reprezentowac daty/czasu",
|
|
||||||
"Proba redefinicji funkcji wbudowanej",
|
|
||||||
"Nie wolno zagniezdzac definicji funkcji w wyrazeniu",
|
|
||||||
"Aby uzyc powtorzenia trzeba w pelni wyspecyfikowac date",
|
|
||||||
"Rok podany dwokrotnie",
|
|
||||||
"Miesiac podany dwokrotnie",
|
|
||||||
"Dzien podany dwokrotnie",
|
|
||||||
"Nieznane slowo",
|
|
||||||
"W komendzie OMIT trzeba podac miesiac i dzien",
|
|
||||||
"Za duzo czesciowych komend OMIT",
|
|
||||||
"Za duzo pelnych komend OMIT",
|
|
||||||
"ostrzezenie: PUSH-OMIT-CONTEXT bez POP-OMIT-CONTEXT",
|
|
||||||
"Blad odczytu pliku",
|
|
||||||
"Oczekiwany koniec linii",
|
|
||||||
"Bledna data hebrajska",
|
|
||||||
"IIF wymaga nieparzystej liczby argumentow",
|
|
||||||
"Ostrzezenie: Brakujacy ENDIF",
|
|
||||||
"Oczekiwany przecinek",
|
|
||||||
"Dzien tygodnia podany dwokrotnie",
|
|
||||||
"Dozwolone tylko jedno z: BEFORE, AFTER i SKIP",
|
|
||||||
"Nie mozna zagniezdzac MSG, MSF, RUN, itp. w wyrazeniu",
|
|
||||||
"Wartosc powtorzenia podana dwokrotnie",
|
|
||||||
"Wartosc roznicy podana dwokrotnie",
|
|
||||||
"Wartosc cofniecia podana dwokrotnie",
|
|
||||||
"Slowo ONCE uzyte dwokrotnie.",
|
|
||||||
"Po AT oczekiwany jest czas",
|
|
||||||
"Slowo THROUGH/UNTIL uzyte dwokrotnie",
|
|
||||||
"Niekompletna specyfikacja daty",
|
|
||||||
"Slowo FROM/SCANFROM uzyte dwokrotnie",
|
|
||||||
"Zmienna",
|
|
||||||
"Wartosc",
|
|
||||||
"*UNDEFINED*",
|
|
||||||
"Poczatek UserFN",
|
|
||||||
"Koniec UserFN",
|
|
||||||
"Przeminelo",
|
|
||||||
"niepowodzenie w funkcji fork() - nie moge kolejkowac przypomnien",
|
|
||||||
"Nie ma dostepu do pliku",
|
|
||||||
"Bledna data systemowa: Rok mniejszy niz %d\n",
|
|
||||||
"Nieznana flaga odpluskwiania '%c'\n",
|
|
||||||
"Nieznana opcja '%c'\n",
|
|
||||||
"Nieznany uzytkownik '%s'\n",
|
|
||||||
"Nie moge zmienic gid na %d\n",
|
|
||||||
"Nie moge zmienic uid na %d\n",
|
|
||||||
"Brak pamieci na zmienne srodowiska\n",
|
|
||||||
"Brak znaku '='",
|
|
||||||
"Brak nazwy zmiennej",
|
|
||||||
"Brak wyrazenia",
|
|
||||||
"Nie moge zmienic daty dostepu pliku %s\n",
|
|
||||||
"Remind: '-i' option: %s\n",
|
|
||||||
"Brak przypomnien.",
|
|
||||||
"%d Przypomnienia zakolejkowane na pozniej.\n",
|
|
||||||
"Spodziewana liczba",
|
|
||||||
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)",
|
|
||||||
"Can't convert between time zones",
|
|
||||||
"No files matching *.rem",
|
|
||||||
"String too long",
|
|
||||||
"Time specified twice",
|
|
||||||
"Cannot specify DURATION without specifying AT"
|
|
||||||
#endif /* ISOLATIN1 */
|
|
||||||
};
|
};
|
||||||
#endif /* MK_GLOBALS */
|
#endif /* MK_GLOBALS */
|
||||||
|
|
||||||
@@ -401,63 +248,33 @@ void Usage(void)
|
|||||||
#ifdef BETA
|
#ifdef BETA
|
||||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||||
#endif
|
#endif
|
||||||
#if ISOLATIN1
|
fprintf(ErrFp, "\nSposób użycia: remind [opcje] plik [data] [czas] [*powtórzenie]\n");
|
||||||
fprintf(ErrFp, "\nSpos\363b u\277ycia: remind [opcje] plik [data] [czas] [*powt\363rzenie]\n");
|
|
||||||
fprintf(ErrFp, "Opcje:\n");
|
fprintf(ErrFp, "Opcje:\n");
|
||||||
fprintf(ErrFp, " -n Wypisz nast\352pne przypomnienia w prostym formacie\n");
|
fprintf(ErrFp, " -n Wypisz następne przypomnienia w prostym formacie\n");
|
||||||
fprintf(ErrFp, " -r Zablokuj dyrektywy RUN\n");
|
fprintf(ErrFp, " -r Zablokuj dyrektywy RUN\n");
|
||||||
fprintf(ErrFp, " -c[n] Wypisz kalendarz na n (domy\266lnie 1) miesi\352cy\n");
|
fprintf(ErrFp, " -c[n] Wypisz kalendarz na n (domyślnie 1) miesięcy\n");
|
||||||
fprintf(ErrFp, " -c+[n] Wypisz kalendarz na n (domy\266lnie 1) tygodni\n");
|
fprintf(ErrFp, " -c+[n] Wypisz kalendarz na n (domyślnie 1) tygodni\n");
|
||||||
fprintf(ErrFp, " -w[n[,p[,s]]] Ustaw szeroko\266\346, wype\263nienie i odst\352py w kalendarzu\n");
|
fprintf(ErrFp, " -w[n[,p[,s]]] Ustaw szerokość, wypełnienie i odstępy w kalendarzu\n");
|
||||||
fprintf(ErrFp, " -s[+][n] Wypisz uproszczony kalendarz na n (1) miesi\352cy (tygodni)\n");
|
fprintf(ErrFp, " -s[+][n] Wypisz uproszczony kalendarz na n (1) miesięcy (tygodni)\n");
|
||||||
fprintf(ErrFp, " -p[n] To samo co -s, ale kompatybilne z rem2ps\n");
|
fprintf(ErrFp, " -p[n] To samo co -s, ale kompatybilne z rem2ps\n");
|
||||||
fprintf(ErrFp, " -v Obszerniejsze komentarze\n");
|
fprintf(ErrFp, " -v Obszerniejsze komentarze\n");
|
||||||
fprintf(ErrFp, " -o Ignoruj instrukcje ONCE\n");
|
fprintf(ErrFp, " -o Ignoruj instrukcje ONCE\n");
|
||||||
fprintf(ErrFp, " -t Odpal wszystkie przysz\263e przypomnienia niezale\277nie od delty\n");
|
fprintf(ErrFp, " -t Odpal wszystkie przyszłe przypomnienia niezależnie od delty\n");
|
||||||
fprintf(ErrFp, " -h Praca bezszmerowa\n");
|
fprintf(ErrFp, " -h Praca bezszmerowa\n");
|
||||||
#ifdef HAVE_QUEUED
|
#ifdef HAVE_QUEUED
|
||||||
fprintf(ErrFp, " -a Nie odpalaj przyponie\361 czasowych - kolejkuj je\n");
|
fprintf(ErrFp, " -a Nie odpalaj przyponień czasowych - kolejkuj je\n");
|
||||||
fprintf(ErrFp, " -q Nie kolejkuj przyponie\361 czasowych\n");
|
fprintf(ErrFp, " -q Nie kolejkuj przyponień czasowych\n");
|
||||||
fprintf(ErrFp, " -f Nie przechod\274 do pracy w tle\n");
|
fprintf(ErrFp, " -f Nie przechodź do pracy w tle\n");
|
||||||
fprintf(ErrFp, " -z[n] Pracuj jako demon, budz\261c si\352 co n (5) minut\n");
|
fprintf(ErrFp, " -z[n] Pracuj jako demon, budząc się co n (5) minut\n");
|
||||||
#endif
|
#endif
|
||||||
fprintf(ErrFp, " -d... Odpluskwianie: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
fprintf(ErrFp, " -d... Odpluskwianie: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||||
fprintf(ErrFp, " -e Komunikaty o b\263\352dach skieruj na stdout\n");
|
fprintf(ErrFp, " -e Komunikaty o błędach skieruj na stdout\n");
|
||||||
fprintf(ErrFp, " -b[n] Format czasu: 0=am/pm, 1=24godz., 2=\277aden\n");
|
fprintf(ErrFp, " -b[n] Format czasu: 0=am/pm, 1=24godz., 2=żaden\n");
|
||||||
fprintf(ErrFp, " -x[n] Limit powt\363rze\361 klauzuli SATISFY (domy\266lnie=150)\n");
|
fprintf(ErrFp, " -x[n] Limit powtórzeń klauzuli SATISFY (domyślnie=150)\n");
|
||||||
fprintf(ErrFp, " -kcmd Wywo\263aj 'cmd' dla przypomnie\361 typu MSG\n");
|
fprintf(ErrFp, " -kcmd Wywołaj 'cmd' dla przypomnień typu MSG\n");
|
||||||
fprintf(ErrFp, " -g[ddd] Sortuj przypomnienia wed\263ug daty, czasu i priorytetu\n");
|
fprintf(ErrFp, " -g[ddd] Sortuj przypomnienia według daty, czasu i priorytetu\n");
|
||||||
fprintf(ErrFp, " -ivar=val Zainicjuj zmienn\261 var warto\266cia val i zachowaj ja\n");
|
fprintf(ErrFp, " -ivar=val Zainicjuj zmienną var wartościa val i zachowaj ja\n");
|
||||||
fprintf(ErrFp, " -m Rozpocznij kalendarz od poniedzia\263ku zamiast od niedzieli\n");
|
fprintf(ErrFp, " -m Rozpocznij kalendarz od poniedziałku zamiast od niedzieli\n");
|
||||||
#else /* ISOLATIN1 */
|
|
||||||
fprintf(ErrFp, "\nSposob uzycia: remind [opcje] plik [data] [czas] [*powtorzenie]\n");
|
|
||||||
fprintf(ErrFp, "Opcje:\n");
|
|
||||||
fprintf(ErrFp, " -n Wypisz nastepne przypomnienia w prostym formacie\n");
|
|
||||||
fprintf(ErrFp, " -r Zablokuj dyrektywy RUN\n");
|
|
||||||
fprintf(ErrFp, " -c[n] Wypisz kalendarz na n (domyslnie 1) miesiecy\n");
|
|
||||||
fprintf(ErrFp, " -c+[n] Wypisz kalendarz na n (domyslnie 1) tygodni\n");
|
|
||||||
fprintf(ErrFp, " -w[n[,p[,s]]] Ustaw szerokosc, wypelnienie i odstepy w kalendarzu\n");
|
|
||||||
fprintf(ErrFp, " -s[+][n] Wypisz uproszczony kalendarz na n (1) miesiecy (tygodni)\n");
|
|
||||||
fprintf(ErrFp, " -p[n] To samo co -s, ale kompatybilne z rem2ps\n");
|
|
||||||
fprintf(ErrFp, " -v Obszerniejsze komentarze\n");
|
|
||||||
fprintf(ErrFp, " -o Ignoruj instrukcje ONCE\n");
|
|
||||||
fprintf(ErrFp, " -t Odpal wszystkie przyszle przypomnienia niezaleznie od delty\n");
|
|
||||||
fprintf(ErrFp, " -h Praca bezszmerowa\n");
|
|
||||||
#ifdef HAVE_QUEUED
|
|
||||||
fprintf(ErrFp, " -a Nie odpalaj przyponien czasowych - kolejkuj je\n");
|
|
||||||
fprintf(ErrFp, " -q Nie kolejkuj przyponien czasowych\n");
|
|
||||||
fprintf(ErrFp, " -f Nie przechodz do pracy w tle\n");
|
|
||||||
fprintf(ErrFp, " -z[n] Pracuj jako demon, budzac sie co n (5) minut\n");
|
|
||||||
#endif
|
|
||||||
fprintf(ErrFp, " -d... Odpluskwianie: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
|
||||||
fprintf(ErrFp, " -e Komunikaty o bledach skieruj na stdout\n");
|
|
||||||
fprintf(ErrFp, " -b[n] Format czasu: 0=am/pm, 1=24godz., 2=zaden\n");
|
|
||||||
fprintf(ErrFp, " -x[n] Limit powtorzen klauzuli SATISFY (domyslnie=150)\n");
|
|
||||||
fprintf(ErrFp, " -kcmd Wywolaj 'cmd' dla przypomnien typu MSG\n");
|
|
||||||
fprintf(ErrFp, " -g[ddd] Sortuj przypomnienia wedlug daty, czasu i priorytetu\n");
|
|
||||||
fprintf(ErrFp, " -ivar=val Zainicjuj zmienna var wartoscia val i zachowaj ja\n");
|
|
||||||
fprintf(ErrFp, " -m Rozpocznij kalendarz od poniedzialku zamiast od niedzieli\n");
|
|
||||||
#endif /* ISOLATIN1 */
|
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#endif /* L_IN_INIT */
|
#endif /* L_IN_INIT */
|
||||||
|
|||||||
@@ -17,39 +17,13 @@
|
|||||||
#define L_LANGNAME "Romanian"
|
#define L_LANGNAME "Romanian"
|
||||||
|
|
||||||
/* Day names */
|
/* Day names */
|
||||||
#if ISOLATIN1
|
# define L_SUNDAY "Duminică"
|
||||||
# define L_SUNDAY "Duminica"
|
|
||||||
# define L_MONDAY "Luni"
|
# define L_MONDAY "Luni"
|
||||||
# define L_TUESDAY "Marti"
|
# define L_TUESDAY "Marți"
|
||||||
# define L_WEDNESDAY "Miercuri"
|
# define L_WEDNESDAY "Miercuri"
|
||||||
# define L_THURSDAY "Joi"
|
# define L_THURSDAY "Joi"
|
||||||
# define L_FRIDAY "Vineri"
|
# define L_FRIDAY "Vineri"
|
||||||
# define L_SATURDAY "S\342mbata"
|
# define L_SATURDAY "Sâmbătă"
|
||||||
#elif ISOLATIN2
|
|
||||||
# define L_SUNDAY "Duminic\343"
|
|
||||||
# define L_MONDAY "Luni"
|
|
||||||
# define L_TUESDAY "Mar\376i"
|
|
||||||
# define L_WEDNESDAY "Miercuri"
|
|
||||||
# define L_THURSDAY "Joi"
|
|
||||||
# define L_FRIDAY "Vineri"
|
|
||||||
# define L_SATURDAY "S\342mb\343t\343"
|
|
||||||
#elif IBM852
|
|
||||||
# define L_SUNDAY "Duminic\307"
|
|
||||||
# define L_MONDAY "Luni"
|
|
||||||
# define L_TUESDAY "Mar\316i"
|
|
||||||
# define L_WEDNESDAY "Miercuri"
|
|
||||||
# define L_THURSDAY "Joi"
|
|
||||||
# define L_FRIDAY "Vineri"
|
|
||||||
# define L_SATURDAY "S\203mb\307t\307"
|
|
||||||
#else
|
|
||||||
# define L_SUNDAY "Duminica"
|
|
||||||
# define L_MONDAY "Luni"
|
|
||||||
# define L_TUESDAY "Marti"
|
|
||||||
# define L_WEDNESDAY "Miercuri"
|
|
||||||
# define L_THURSDAY "Joi"
|
|
||||||
# define L_FRIDAY "Vineri"
|
|
||||||
# define L_SATURDAY "Sambata"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Month names */
|
/* Month names */
|
||||||
#define L_JAN "Ianuarie"
|
#define L_JAN "Ianuarie"
|
||||||
@@ -66,19 +40,8 @@
|
|||||||
#define L_DEC "Decembrie"
|
#define L_DEC "Decembrie"
|
||||||
|
|
||||||
/* Today and tomorrow */
|
/* Today and tomorrow */
|
||||||
#if ISOLATIN1
|
# define L_TODAY "astăzi"
|
||||||
# define L_TODAY "astazi"
|
# define L_TOMORROW "mâine"
|
||||||
# define L_TOMORROW "m\342ine"
|
|
||||||
#elif ISOLATIN2
|
|
||||||
# define L_TODAY "ast\343zi"
|
|
||||||
# define L_TOMORROW "m\342ine"
|
|
||||||
#elif IBM852
|
|
||||||
# define L_TODAY "ast\307zi"
|
|
||||||
# define L_TOMORROW "m\203ine"
|
|
||||||
#else
|
|
||||||
# define L_TODAY "astazi"
|
|
||||||
# define L_TOMORROW "maine"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* The default banner */
|
/* The default banner */
|
||||||
#define L_BANNER "Reamintiri pentru %w, %d %m %y%o:"
|
#define L_BANNER "Reamintiri pentru %w, %d %m %y%o:"
|
||||||
@@ -114,30 +77,13 @@
|
|||||||
/* What to add to make "minute" plural */
|
/* What to add to make "minute" plural */
|
||||||
#define L_MPLU "e"
|
#define L_MPLU "e"
|
||||||
|
|
||||||
#if ISOLATIN2
|
/* What to add to make "hour" plural */
|
||||||
/* What to add to make "hour" plural */
|
#define L_HPLU_OVER hplu = (hdiff == 1 ? "ă" : "e");
|
||||||
# define L_HPLU_OVER hplu = (hdiff == 1 ? "\343" : "e");
|
#define L_AND "şi"
|
||||||
# define L_AND "\272i"
|
|
||||||
#elif IBM852
|
|
||||||
/* What to add to make "hour" plural */
|
|
||||||
# define L_HPLU_OVER hplu = (hdiff == 1 ? "\307" : "e");
|
|
||||||
# define L_AND "\255i"
|
|
||||||
#else
|
|
||||||
/* What to add to make "hour" plural */
|
|
||||||
# define L_HPLU_OVER hplu = (hdiff == 1 ? "a" : "e");
|
|
||||||
# define L_AND "si"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||||
See the file dosubst.c for more info. */
|
See the file dosubst.c for more info. */
|
||||||
#if ISOLATIN2
|
#define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " dimineaţa" : (hour > 17) ? " seara" : " după-amiaza";
|
||||||
# define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " diminea\376a" : (hour > 17) ? " seara" : " dup\343-amiaza";
|
|
||||||
#elif IBM852
|
|
||||||
# define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " diminea\316a" : (hour > 17) ? " seara" : " dup\307-amiaza";
|
|
||||||
#else
|
|
||||||
# define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " dimineata" : (hour > 17) ? " seara" : " dupa-amiaza";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define L_ORDINAL_OVERRIDE plu = "";
|
#define L_ORDINAL_OVERRIDE plu = "";
|
||||||
|
|
||||||
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, MonthName[m], y);
|
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, MonthName[m], y);
|
||||||
|
|||||||
@@ -17,19 +17,10 @@
|
|||||||
#define L_SUNDAY "Domingo"
|
#define L_SUNDAY "Domingo"
|
||||||
#define L_MONDAY "Lunes"
|
#define L_MONDAY "Lunes"
|
||||||
#define L_TUESDAY "Martes"
|
#define L_TUESDAY "Martes"
|
||||||
#if ISOLATIN1
|
#define L_WEDNESDAY "Miércoles"
|
||||||
#define L_WEDNESDAY "Mi\351rcoles"
|
|
||||||
#else
|
|
||||||
#define L_WEDNESDAY "Miercoles"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define L_THURSDAY "Jueves"
|
#define L_THURSDAY "Jueves"
|
||||||
#define L_FRIDAY "Viernes"
|
#define L_FRIDAY "Viernes"
|
||||||
#if ISOLATIN1
|
#define L_SATURDAY "Sábado"
|
||||||
#define L_SATURDAY "S\341bado"
|
|
||||||
#else
|
|
||||||
#define L_SATURDAY "Sabado"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Nombres de los meses */
|
/* Nombres de los meses */
|
||||||
#define L_JAN "Enero"
|
#define L_JAN "Enero"
|
||||||
@@ -47,11 +38,7 @@
|
|||||||
|
|
||||||
/* Hoy y man~ana */
|
/* Hoy y man~ana */
|
||||||
#define L_TODAY "hoy"
|
#define L_TODAY "hoy"
|
||||||
#if ISOLATIN1
|
#define L_TOMORROW "mañana"
|
||||||
#define L_TOMORROW "ma\361ana"
|
|
||||||
#else
|
|
||||||
#define L_TOMORROW "manana"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* El titular habitual */
|
/* El titular habitual */
|
||||||
#define L_BANNER "Agenda para el %w, %d%s %m, %y%o:"
|
#define L_BANNER "Agenda para el %w, %d%s %m, %y%o:"
|
||||||
@@ -68,13 +55,8 @@
|
|||||||
#define L_FROMNOW "desde hoy"
|
#define L_FROMNOW "desde hoy"
|
||||||
|
|
||||||
/* "dentro de %d di'as" */
|
/* "dentro de %d di'as" */
|
||||||
#if ISOLATIN1
|
#define L_INXDAYS "dentro de %d días"
|
||||||
#define L_INXDAYS "dentro de %d d\355as"
|
#define L_ON "el día"
|
||||||
#define L_ON "el d\355a"
|
|
||||||
#else
|
|
||||||
#define L_INXDAYS "dentro de %d di'as"
|
|
||||||
#define L_ON "el di'a"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* "el di'a..." */
|
/* "el di'a..." */
|
||||||
|
|
||||||
|
|||||||
43
src/main.c
43
src/main.c
@@ -44,10 +44,6 @@
|
|||||||
|
|
||||||
static void DoReminders(void);
|
static void DoReminders(void);
|
||||||
|
|
||||||
/* Whooo... the putchar/Putchar/PutChar macros are a mess...
|
|
||||||
my apologies... */
|
|
||||||
#define Putchar(c) PutChar(c)
|
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/** **/
|
/** **/
|
||||||
@@ -235,12 +231,13 @@ static void DoReminders(void)
|
|||||||
case T_Else: r=DoElse(&p); break;
|
case T_Else: r=DoElse(&p); break;
|
||||||
case T_EndIf: r=DoEndif(&p); break;
|
case T_EndIf: r=DoEndif(&p); break;
|
||||||
case T_Include:
|
case T_Include:
|
||||||
|
case T_IncludeR:
|
||||||
/* In purge mode, include closes file, so we
|
/* In purge mode, include closes file, so we
|
||||||
need to echo it here! */
|
need to echo it here! */
|
||||||
if (PurgeMode) {
|
if (PurgeMode) {
|
||||||
PurgeEchoLine("%s\n", CurLine);
|
PurgeEchoLine("%s\n", CurLine);
|
||||||
}
|
}
|
||||||
r=DoInclude(&p);
|
r=DoInclude(&p, tok.type);
|
||||||
purge_handled = 1;
|
purge_handled = 1;
|
||||||
break;
|
break;
|
||||||
case T_IncludeCmd:
|
case T_IncludeCmd:
|
||||||
@@ -615,11 +612,11 @@ void OutputLine(FILE *fp)
|
|||||||
char c = 0;
|
char c = 0;
|
||||||
|
|
||||||
while (*s) {
|
while (*s) {
|
||||||
if (*s == '\n') Putc('\\', fp);
|
if (*s == '\n') putc('\\', fp);
|
||||||
Putc(*s, fp);
|
putc(*s, fp);
|
||||||
c = *s++;
|
c = *s++;
|
||||||
}
|
}
|
||||||
if (c != '\n') Putc('\n', fp);
|
if (c != '\n') putc('\n', fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -1211,7 +1208,7 @@ void FillParagraph(char const *s)
|
|||||||
|
|
||||||
/* If it's a carriage return, output it and start new paragraph */
|
/* If it's a carriage return, output it and start new paragraph */
|
||||||
if (*s == '\n') {
|
if (*s == '\n') {
|
||||||
Putchar('\n');
|
putchar('\n');
|
||||||
s++;
|
s++;
|
||||||
line = 0;
|
line = 0;
|
||||||
while(ISBLANK(*s)) s++;
|
while(ISBLANK(*s)) s++;
|
||||||
@@ -1224,7 +1221,7 @@ void FillParagraph(char const *s)
|
|||||||
number of spaces */
|
number of spaces */
|
||||||
j = line ? SubsIndent : FirstIndent;
|
j = line ? SubsIndent : FirstIndent;
|
||||||
for (i=0; i<j; i++) {
|
for (i=0; i<j; i++) {
|
||||||
Putchar(' ');
|
putchar(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate the amount of room left on this line */
|
/* Calculate the amount of room left on this line */
|
||||||
@@ -1243,17 +1240,17 @@ void FillParagraph(char const *s)
|
|||||||
}
|
}
|
||||||
if (!pendspace || len+pendspace <= roomleft) {
|
if (!pendspace || len+pendspace <= roomleft) {
|
||||||
for (i=0; i<pendspace; i++) {
|
for (i=0; i<pendspace; i++) {
|
||||||
Putchar(' ');
|
putchar(' ');
|
||||||
}
|
}
|
||||||
while(t < s) {
|
while(t < s) {
|
||||||
Putchar(*t);
|
putchar(*t);
|
||||||
if (strchr(EndSent, *t)) doublespace = 2;
|
if (strchr(EndSent, *t)) doublespace = 2;
|
||||||
else if (!strchr(EndSentIg, *t)) doublespace = 1;
|
else if (!strchr(EndSentIg, *t)) doublespace = 1;
|
||||||
t++;
|
t++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
s = t;
|
s = t;
|
||||||
Putchar('\n');
|
putchar('\n');
|
||||||
line++;
|
line++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1414,3 +1411,23 @@ System(char const *cmd)
|
|||||||
r = 1;
|
r = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char const *
|
||||||
|
get_day_name(int wkday)
|
||||||
|
{
|
||||||
|
if (wkday < 0 || wkday > 6) {
|
||||||
|
return "INVALID_WKDAY";
|
||||||
|
}
|
||||||
|
if (DynamicDayName[wkday]) return DynamicDayName[wkday];
|
||||||
|
return DayName[wkday];
|
||||||
|
}
|
||||||
|
|
||||||
|
char const *
|
||||||
|
get_month_name(int mon)
|
||||||
|
{
|
||||||
|
if (mon < 0 || mon > 11) {
|
||||||
|
return "INVALID_MON";
|
||||||
|
}
|
||||||
|
if (DynamicMonthName[mon]) return DynamicMonthName[mon];
|
||||||
|
return MonthName[mon];
|
||||||
|
}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ void PrintValue (Value *v, FILE *fp);
|
|||||||
int CopyValue (Value *dest, const Value *src);
|
int CopyValue (Value *dest, const Value *src);
|
||||||
int ReadLine (void);
|
int ReadLine (void);
|
||||||
int OpenFile (char const *fname);
|
int OpenFile (char const *fname);
|
||||||
int DoInclude (ParsePtr p);
|
int DoInclude (ParsePtr p, enum TokTypes tok);
|
||||||
int DoIncludeCmd (ParsePtr p);
|
int DoIncludeCmd (ParsePtr p);
|
||||||
int IncludeFile (char const *fname);
|
int IncludeFile (char const *fname);
|
||||||
int GetAccessDate (char const *file);
|
int GetAccessDate (char const *file);
|
||||||
@@ -164,3 +164,8 @@ void PrintJSONKeyPairTime(char const *name, int t);
|
|||||||
void System(char const *cmd);
|
void System(char const *cmd);
|
||||||
int ShellEscape(char const *in, DynamicBuffer *out);
|
int ShellEscape(char const *in, DynamicBuffer *out);
|
||||||
int AddGlobalOmit(int jul);
|
int AddGlobalOmit(int jul);
|
||||||
|
void set_lat_and_long_from_components(void);
|
||||||
|
void set_components_from_lat_and_long(void);
|
||||||
|
|
||||||
|
char const *get_day_name(int wkday);
|
||||||
|
char const *get_month_name(int mon);
|
||||||
|
|||||||
31
src/queue.c
31
src/queue.c
@@ -57,7 +57,7 @@ static void CheckInitialFile (void);
|
|||||||
static int CalculateNextTime (QueuedRem *q);
|
static int CalculateNextTime (QueuedRem *q);
|
||||||
static QueuedRem *FindNextReminder (void);
|
static QueuedRem *FindNextReminder (void);
|
||||||
static int CalculateNextTimeUsingSched (QueuedRem *q);
|
static int CalculateNextTimeUsingSched (QueuedRem *q);
|
||||||
static void DaemonWait (unsigned int sleeptime);
|
static void DaemonWait (struct timeval *sleep_tv);
|
||||||
static void reread (void);
|
static void reread (void);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -121,6 +121,8 @@ void HandleQueuedReminders(void)
|
|||||||
unsigned SleepTime;
|
unsigned SleepTime;
|
||||||
Parser p;
|
Parser p;
|
||||||
Trigger trig;
|
Trigger trig;
|
||||||
|
struct timeval tv;
|
||||||
|
struct timeval sleep_tv;
|
||||||
|
|
||||||
/* Suppress the BANNER from being issued */
|
/* Suppress the BANNER from being issued */
|
||||||
NumTriggered = 1;
|
NumTriggered = 1;
|
||||||
@@ -186,16 +188,20 @@ void HandleQueuedReminders(void)
|
|||||||
|
|
||||||
/* Wake up once a minute to recalibrate sleep time in
|
/* Wake up once a minute to recalibrate sleep time in
|
||||||
case of laptop hibernation */
|
case of laptop hibernation */
|
||||||
if (Daemon <= 0) {
|
if (Daemon < 0) {
|
||||||
/* Wake up on the next exact minute */
|
/* Wake up on the next exact minute */
|
||||||
SleepTime = 60 - (SystemTime(1)%60);
|
gettimeofday(&tv, NULL);
|
||||||
}
|
sleep_tv.tv_sec = 60 - (tv.tv_sec % 60);
|
||||||
|
if (tv.tv_usec != 0 && sleep_tv.tv_sec != 0) {
|
||||||
if (Daemon >= 0) {
|
sleep_tv.tv_sec--;
|
||||||
sleep(SleepTime);
|
sleep_tv.tv_usec = 1000000 - tv.tv_usec;
|
||||||
|
} else {
|
||||||
|
sleep_tv.tv_usec = 0;
|
||||||
|
}
|
||||||
|
DaemonWait(&sleep_tv);
|
||||||
} else {
|
} else {
|
||||||
DaemonWait(SleepTime);
|
sleep(SleepTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If not in daemon mode and day has rolled around,
|
/* If not in daemon mode and day has rolled around,
|
||||||
exit -- not much we can do. */
|
exit -- not much we can do. */
|
||||||
@@ -519,19 +525,16 @@ json_queue(QueuedRem const *q)
|
|||||||
/* Sleep or read command from stdin in "daemon -1" mode */
|
/* Sleep or read command from stdin in "daemon -1" mode */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static void DaemonWait(unsigned int sleeptime)
|
static void DaemonWait(struct timeval *sleep_tv)
|
||||||
{
|
{
|
||||||
fd_set readSet;
|
fd_set readSet;
|
||||||
struct timeval timeout;
|
|
||||||
int retval;
|
int retval;
|
||||||
int y, m, d;
|
int y, m, d;
|
||||||
char cmdLine[256];
|
char cmdLine[256];
|
||||||
|
|
||||||
FD_ZERO(&readSet);
|
FD_ZERO(&readSet);
|
||||||
FD_SET(0, &readSet);
|
FD_SET(0, &readSet);
|
||||||
timeout.tv_sec = sleeptime;
|
retval = select(1, &readSet, NULL, NULL, sleep_tv);
|
||||||
timeout.tv_usec = 0;
|
|
||||||
retval = select(1, &readSet, NULL, NULL, &timeout);
|
|
||||||
|
|
||||||
/* If date has rolled around, restart */
|
/* If date has rolled around, restart */
|
||||||
if (RealToday != SystemDate(&y, &m, &d)) {
|
if (RealToday != SystemDate(&y, &m, &d)) {
|
||||||
|
|||||||
46
src/rem2ps.c
46
src/rem2ps.c
@@ -146,9 +146,9 @@ put_escaped_string(char const *s)
|
|||||||
{
|
{
|
||||||
while(*s) {
|
while(*s) {
|
||||||
if (*s == '\\' || *s == '(' || *s == ')') {
|
if (*s == '\\' || *s == '(' || *s == ')') {
|
||||||
PutChar('\\');
|
putchar('\\');
|
||||||
}
|
}
|
||||||
PutChar(*s);
|
putchar(*s);
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -383,6 +383,7 @@ void DoPsCal(void)
|
|||||||
int firstcol;
|
int firstcol;
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
CalEntry *c, *d, *p;
|
CalEntry *c, *d, *p;
|
||||||
|
char *s;
|
||||||
|
|
||||||
/* Read the month and year name, followed by # days in month and 1st day of
|
/* Read the month and year name, followed by # days in month and 1st day of
|
||||||
month */
|
month */
|
||||||
@@ -391,12 +392,28 @@ void DoPsCal(void)
|
|||||||
sscanf(DBufValue(&buf), "%s %s %d %d %d", month, year, &days, &wkday,
|
sscanf(DBufValue(&buf), "%s %s %d %d %d", month, year, &days, &wkday,
|
||||||
&MondayFirst);
|
&MondayFirst);
|
||||||
|
|
||||||
|
/* Replace underscores in month name with spaces */
|
||||||
|
s = month;
|
||||||
|
while(*s) {
|
||||||
|
if (*s == '_') *s = ' ';
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get day names */
|
/* Get day names */
|
||||||
DBufGets(&buf, stdin);
|
DBufGets(&buf, stdin);
|
||||||
sscanf(DBufValue(&buf), "%32s %32s %32s %32s %32s %32s %32s",
|
sscanf(DBufValue(&buf), "%32s %32s %32s %32s %32s %32s %32s",
|
||||||
DayName[0], DayName[1], DayName[2], DayName[3],
|
DayName[0], DayName[1], DayName[2], DayName[3],
|
||||||
DayName[4], DayName[5], DayName[6]);
|
DayName[4], DayName[5], DayName[6]);
|
||||||
|
|
||||||
|
/* Replace underscores in day names with spaces */
|
||||||
|
for (i=0; i<7; i++) {
|
||||||
|
s = DayName[i];
|
||||||
|
while(*s) {
|
||||||
|
if (*s == '_') *s = ' ';
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* We write the prolog here because it's only at this point that
|
/* We write the prolog here because it's only at this point that
|
||||||
MondayFirst is set correctly. */
|
MondayFirst is set correctly. */
|
||||||
if (validfile == 1) {
|
if (validfile == 1) {
|
||||||
@@ -407,6 +424,19 @@ void DoPsCal(void)
|
|||||||
sscanf(DBufValue(&buf), "%s %d", prevm, &prevdays);
|
sscanf(DBufValue(&buf), "%s %d", prevm, &prevdays);
|
||||||
DBufGets(&buf, stdin);
|
DBufGets(&buf, stdin);
|
||||||
sscanf(DBufValue(&buf), "%s %d", nextm, &nextdays);
|
sscanf(DBufValue(&buf), "%s %d", nextm, &nextdays);
|
||||||
|
|
||||||
|
/* Replace underscores with spaces in names of next/prev month */
|
||||||
|
s = prevm;
|
||||||
|
while(*s) {
|
||||||
|
if (*s == '_') *s = ' ';
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
s = nextm;
|
||||||
|
while(*s) {
|
||||||
|
if (*s == '_') *s = ' ';
|
||||||
|
s++;
|
||||||
|
}
|
||||||
|
|
||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
MaxDay = days;
|
MaxDay = days;
|
||||||
FirstWkDay = wkday;
|
FirstWkDay = wkday;
|
||||||
@@ -595,7 +625,7 @@ void WriteProlog(void)
|
|||||||
strcmp(SmallFont, DayFont) &&
|
strcmp(SmallFont, DayFont) &&
|
||||||
strcmp(TitleFont, SmallFont) &&
|
strcmp(TitleFont, SmallFont) &&
|
||||||
strcmp(SmallFont, EntryFont)) printf(" %s", SmallFont);
|
strcmp(SmallFont, EntryFont)) printf(" %s", SmallFont);
|
||||||
PutChar('\n');
|
putchar('\n');
|
||||||
printf("%%%%Creator: Rem2PS\n");
|
printf("%%%%Creator: Rem2PS\n");
|
||||||
printf("%%%%Pages: (atend)\n");
|
printf("%%%%Pages: (atend)\n");
|
||||||
printf("%%%%Orientation: %s\n", PortraitMode ? "Portrait" : "Landscape");
|
printf("%%%%Orientation: %s\n", PortraitMode ? "Portrait" : "Landscape");
|
||||||
@@ -775,20 +805,20 @@ void WriteOneEntry(CalEntry *c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PutChar('(');
|
putchar('(');
|
||||||
while(*s) {
|
while(*s) {
|
||||||
/* Use the "unsigned char" cast to fix problem on Solaris 2.5 */
|
/* Use the "unsigned char" cast to fix problem on Solaris 2.5 */
|
||||||
/* which treated some latin1 characters as white space. */
|
/* which treated some latin1 characters as white space. */
|
||||||
ch = (unsigned char) *s++;
|
ch = (unsigned char) *s++;
|
||||||
if (ch == '\\' || ch == '(' || ch == ')') PutChar('\\');
|
if (ch == '\\' || ch == '(' || ch == ')') putchar('\\');
|
||||||
if (!isspace(ch)) PutChar(ch);
|
if (!isspace(ch)) putchar(ch);
|
||||||
else {
|
else {
|
||||||
PutChar(')');
|
putchar(')');
|
||||||
while(isspace((unsigned char)*s)) s++;
|
while(isspace((unsigned char)*s)) s++;
|
||||||
if (!*s) {
|
if (!*s) {
|
||||||
goto finish;
|
goto finish;
|
||||||
}
|
}
|
||||||
PutChar('(');
|
putchar('(');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf(")\n");
|
printf(")\n");
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
ALL=`grep ^#define lang.h | grep -v '#define LANG' | awk '{print $2}'`
|
ALL=`grep ^#define lang.h | grep -v '#define LANG' | awk '{print $2}'`
|
||||||
|
|
||||||
for i in $ALL ; do
|
for i in $ALL ; do
|
||||||
make clean all LANGDEF=-DLANG=$i || exit 1
|
make clean
|
||||||
|
make -j`nproc` all LANGDEF=-DLANG=$i || exit 1
|
||||||
./remind -q -r ../tests/tstlang.rem
|
./remind -q -r ../tests/tstlang.rem
|
||||||
done
|
done
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
41
src/token.c
41
src/token.c
@@ -48,6 +48,7 @@ Token TokArray[] = {
|
|||||||
{ "clear-omit-context", 5, T_Clr, 0 },
|
{ "clear-omit-context", 5, T_Clr, 0 },
|
||||||
{ "debug", 5, T_Debug, 0 },
|
{ "debug", 5, T_Debug, 0 },
|
||||||
{ "december", 3, T_Month, 11 },
|
{ "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 },
|
{ "duration", 3, T_Duration, 0 },
|
||||||
{ "else", 4, T_Else, 0 },
|
{ "else", 4, T_Else, 0 },
|
||||||
@@ -104,33 +105,6 @@ Token TokArray[] = {
|
|||||||
{ "wednesday", 3, T_WkDay, 2 }
|
{ "wednesday", 3, T_WkDay, 2 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* If language != English, we must also search the following... */
|
|
||||||
#if LANG != ENGLISH
|
|
||||||
Token NonEnglishToks[] = {
|
|
||||||
/* NAME MINLEN TYPE VALUE */
|
|
||||||
|
|
||||||
{ L_MONDAY, 3, T_WkDay, 0 },
|
|
||||||
{ L_TUESDAY, 3, T_WkDay, 1 },
|
|
||||||
{ L_WEDNESDAY, 3, T_WkDay, 2 },
|
|
||||||
{ L_THURSDAY, 3, T_WkDay, 3 },
|
|
||||||
{ L_FRIDAY, 3, T_WkDay, 4 },
|
|
||||||
{ L_SATURDAY, 3, T_WkDay, 5 },
|
|
||||||
{ L_SUNDAY, 3, T_WkDay, 6 },
|
|
||||||
{ L_JAN, 3, T_Month, 0 },
|
|
||||||
{ L_FEB, 3, T_Month, 1 },
|
|
||||||
{ L_MAR, 3, T_Month, 2 },
|
|
||||||
{ L_APR, 3, T_Month, 3 },
|
|
||||||
{ L_MAY, 3, T_Month, 4 },
|
|
||||||
{ L_JUN, 3, T_Month, 5 },
|
|
||||||
{ L_JUL, 3, T_Month, 6 },
|
|
||||||
{ L_AUG, 3, T_Month, 7 },
|
|
||||||
{ L_SEP, 3, T_Month, 8 },
|
|
||||||
{ L_OCT, 3, T_Month, 9 },
|
|
||||||
{ L_NOV, 3, T_Month, 10 },
|
|
||||||
{ L_DEC, 3, T_Month, 11 }
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int TokStrCmp (Token const *t, char const *s);
|
static int TokStrCmp (Token const *t, char const *s);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -231,19 +205,6 @@ void FindToken(char const *s, Token *tok)
|
|||||||
if (r > 0) top = mid-1; else bot=mid+1;
|
if (r > 0) top = mid-1; else bot=mid+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If language is other than English, search the DayNames[] and MonthNames[]
|
|
||||||
array. */
|
|
||||||
#if LANG != ENGLISH
|
|
||||||
for (i=0; i<(sizeof(NonEnglishToks) / sizeof(Token)); i++) {
|
|
||||||
if (l >= NonEnglishToks[i].MinLen &&
|
|
||||||
!TokStrCmp(&NonEnglishToks[i], s)) {
|
|
||||||
tok->type = NonEnglishToks[i].type;
|
|
||||||
tok->val = NonEnglishToks[i].val;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -442,9 +442,9 @@ AdjustTriggerForDuration(int today, int r, Trigger *trig, TimeTrig *tim, int sav
|
|||||||
FromJulian(r, &y, &m, &d);
|
FromJulian(r, &y, &m, &d);
|
||||||
fprintf(ErrFp, "%s(%d): Trig(adj) = %s, %d %s, %d",
|
fprintf(ErrFp, "%s(%d): Trig(adj) = %s, %d %s, %d",
|
||||||
FileName, LineNo,
|
FileName, LineNo,
|
||||||
DayName[r % 7],
|
get_day_name(r % 7),
|
||||||
d,
|
d,
|
||||||
MonthName[m],
|
get_month_name(m),
|
||||||
y);
|
y);
|
||||||
if (tim->ttime != NO_TIME) {
|
if (tim->ttime != NO_TIME) {
|
||||||
fprintf(ErrFp, " AT %02d:%02d",
|
fprintf(ErrFp, " AT %02d:%02d",
|
||||||
@@ -593,9 +593,9 @@ int ComputeTriggerNoAdjustDuration(int today, Trigger *trig, TimeTrig *tim,
|
|||||||
FromJulian(result, &y, &m, &d);
|
FromJulian(result, &y, &m, &d);
|
||||||
fprintf(ErrFp, "%s(%d): Trig = %s, %d %s, %d",
|
fprintf(ErrFp, "%s(%d): Trig = %s, %d %s, %d",
|
||||||
FileName, LineNo,
|
FileName, LineNo,
|
||||||
DayName[result % 7],
|
get_day_name(result % 7),
|
||||||
d,
|
d,
|
||||||
MonthName[m],
|
get_month_name(m),
|
||||||
y);
|
y);
|
||||||
if (tim->ttime != NO_TIME) {
|
if (tim->ttime != NO_TIME) {
|
||||||
fprintf(ErrFp, " AT %02d:%02d",
|
fprintf(ErrFp, " AT %02d:%02d",
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ typedef Parser *ParsePtr; /* Pointer to parser structure */
|
|||||||
enum TokTypes
|
enum TokTypes
|
||||||
{ T_Illegal,
|
{ T_Illegal,
|
||||||
/* Commands first */
|
/* Commands first */
|
||||||
T_Rem, T_Push, T_Pop, T_Preserve, T_Include, T_IncludeCmd, T_If, T_Else, T_EndIf,
|
T_Rem, T_Push, T_Pop, T_Preserve, T_Include, T_IncludeR, T_IncludeCmd, T_If, T_Else, T_EndIf,
|
||||||
T_IfTrig, T_ErrMsg,
|
T_IfTrig, T_ErrMsg,
|
||||||
T_Set, T_UnSet, T_Fset, T_Omit, T_Banner, T_Exit,
|
T_Set, T_UnSet, T_Fset, T_Omit, T_Banner, T_Exit,
|
||||||
T_AddOmit,
|
T_AddOmit,
|
||||||
|
|||||||
334
src/var.c
334
src/var.c
@@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <errno.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
@@ -39,6 +40,99 @@ static Var *VHashTbl[VAR_HASH_SIZE];
|
|||||||
|
|
||||||
typedef int (*SysVarFunc)(int, Value *);
|
typedef int (*SysVarFunc)(int, Value *);
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int latlong_component_func(int do_set, Value *val, int *var, int min, int max, char const *varname, char const *newvarname)
|
||||||
|
{
|
||||||
|
if (!do_set) {
|
||||||
|
val->type = INT_TYPE;
|
||||||
|
val->v.val = *var;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
deprecated_var(varname, newvarname);
|
||||||
|
if (val->type != INT_TYPE) return E_BAD_TYPE;
|
||||||
|
if (val->v.val < min) return E_2LOW;
|
||||||
|
if (val->v.val > max) return E_2HIGH;
|
||||||
|
*var = val->v.val;
|
||||||
|
set_lat_and_long_from_components();
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
static int latdeg_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
return latlong_component_func(do_set, val, &LatDeg, -90, 90, "$LatDeg", "$Latitude");
|
||||||
|
}
|
||||||
|
|
||||||
|
static int latmin_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
return latlong_component_func(do_set, val, &LatMin, -59, 59, "$LatMin", "$Latitude");
|
||||||
|
}
|
||||||
|
|
||||||
|
static int latsec_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
return latlong_component_func(do_set, val, &LatSec, -59, 59, "$LatSec", "$Latitude");
|
||||||
|
}
|
||||||
|
|
||||||
|
static int longdeg_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
return latlong_component_func(do_set, val, &LongDeg, -180, 180, "$LongDeg", "$Longitude");
|
||||||
|
}
|
||||||
|
|
||||||
|
static int longmin_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
return latlong_component_func(do_set, val, &LongMin, -59, 59, "$LongMin", "$Longitude");
|
||||||
|
}
|
||||||
|
|
||||||
|
static int longsec_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
return latlong_component_func(do_set, val, &LongSec, -59, 59, "$LongSec", "$Longitude");
|
||||||
|
}
|
||||||
|
|
||||||
|
static int latitude_longitude_func(int do_set, Value *val, double *var, double min, double max) {
|
||||||
|
char buf[64];
|
||||||
|
double x;
|
||||||
|
char *endptr;
|
||||||
|
|
||||||
|
if (!do_set) {
|
||||||
|
snprintf(buf, sizeof(buf), "%f", *var);
|
||||||
|
val->v.str = malloc(strlen(buf)+1);
|
||||||
|
if (!val->v.str) return E_NO_MEM;
|
||||||
|
strcpy(val->v.str, buf);
|
||||||
|
val->type = STR_TYPE;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
if (val->type == INT_TYPE) {
|
||||||
|
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;
|
||||||
|
if (*endptr) return E_BAD_TYPE;
|
||||||
|
}
|
||||||
|
if (x < min) return E_2LOW;
|
||||||
|
if (x > max) return E_2HIGH;
|
||||||
|
*var = x;
|
||||||
|
set_components_from_lat_and_long();
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int longitude_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
return latitude_longitude_func(do_set, val, &Longitude, -180.0, 180.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int latitude_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
return latitude_longitude_func(do_set, val, &Latitude, -90.0, 90.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int trig_date_func(int do_set, Value *val)
|
static int trig_date_func(int do_set, Value *val)
|
||||||
{
|
{
|
||||||
UNUSED(do_set);
|
UNUSED(do_set);
|
||||||
@@ -177,15 +271,15 @@ static int default_color_func(int do_set, Value *val)
|
|||||||
int col_r, col_g, col_b;
|
int col_r, col_g, col_b;
|
||||||
if (!do_set) {
|
if (!do_set) {
|
||||||
/* 12 = strlen("255 255 255\0") */
|
/* 12 = strlen("255 255 255\0") */
|
||||||
val->v.str = malloc(12);
|
val->v.str = malloc(12);
|
||||||
if (!val->v.str) return E_NO_MEM;
|
if (!val->v.str) return E_NO_MEM;
|
||||||
snprintf(val->v.str, 12, "%d %d %d",
|
snprintf(val->v.str, 12, "%d %d %d",
|
||||||
DefaultColorR,
|
DefaultColorR,
|
||||||
DefaultColorG,
|
DefaultColorG,
|
||||||
DefaultColorB
|
DefaultColorB
|
||||||
);
|
);
|
||||||
val->type = STR_TYPE;
|
val->type = STR_TYPE;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
if (val->type != STR_TYPE) return E_BAD_TYPE;
|
if (val->type != STR_TYPE) return E_BAD_TYPE;
|
||||||
if (sscanf(val->v.str, "%d %d %d", &col_r, &col_g, &col_b) != 3) {
|
if (sscanf(val->v.str, "%d %d %d", &col_r, &col_g, &col_b) != 3) {
|
||||||
@@ -634,6 +728,7 @@ typedef struct {
|
|||||||
void *value;
|
void *value;
|
||||||
int min;
|
int min;
|
||||||
int max;
|
int max;
|
||||||
|
int (*validate)(void const *newvalue);
|
||||||
} SysVar;
|
} SysVar;
|
||||||
|
|
||||||
/* If the type of a sys variable is STR_TYPE, then min is redefined
|
/* If the type of a sys variable is STR_TYPE, then min is redefined
|
||||||
@@ -645,61 +740,83 @@ typedef struct {
|
|||||||
|
|
||||||
/* All of the system variables sorted alphabetically */
|
/* All of the system variables sorted alphabetically */
|
||||||
static SysVar SysVarArr[] = {
|
static SysVar SysVarArr[] = {
|
||||||
/* name mod type value min/mal max */
|
/* name mod type value min/mal max validate*/
|
||||||
{"CalcUTC", 1, INT_TYPE, &CalculateUTC, 0, 1 },
|
{"April", 1, STR_TYPE, &DynamicMonthName[3], 0, 0, NULL },
|
||||||
{"CalMode", 0, INT_TYPE, &DoCalendar, 0, 0 },
|
{"August", 1, STR_TYPE, &DynamicMonthName[7], 0, 0, NULL },
|
||||||
{"Daemon", 0, INT_TYPE, &Daemon, 0, 0 },
|
{"CalMode", 0, INT_TYPE, &DoCalendar, 0, 0, NULL },
|
||||||
{"DateSep", 1, SPECIAL_TYPE, date_sep_func, 0, 0 },
|
{"CalcUTC", 1, INT_TYPE, &CalculateUTC, 0, 1, NULL },
|
||||||
{"DateTimeSep", 1, SPECIAL_TYPE, datetime_sep_func, 0, 0 },
|
{"Daemon", 0, INT_TYPE, &Daemon, 0, 0, NULL },
|
||||||
{"DefaultColor", 1, SPECIAL_TYPE, default_color_func, 0, 0 },
|
{"DateSep", 1, SPECIAL_TYPE, date_sep_func, 0, 0, NULL },
|
||||||
{"DefaultPrio", 1, INT_TYPE, &DefaultPrio, 0, 9999},
|
{"DateTimeSep", 1, SPECIAL_TYPE, datetime_sep_func, 0, 0, NULL },
|
||||||
{"DeltaOffset", 0, INT_TYPE, &DeltaOffset, 0, 0 },
|
{"December", 1, STR_TYPE, &DynamicMonthName[11],0, 0, NULL },
|
||||||
{"DontFork", 0, INT_TYPE, &DontFork, 0, 0 },
|
{"DefaultColor", 1, SPECIAL_TYPE, default_color_func, 0, 0, NULL },
|
||||||
{"DontQueue", 0, INT_TYPE, &DontQueue, 0, 0 },
|
{"DefaultPrio", 1, INT_TYPE, &DefaultPrio, 0, 9999, NULL },
|
||||||
{"DontTrigAts", 0, INT_TYPE, &DontIssueAts, 0, 0 },
|
{"DefaultTDelta", 1, INT_TYPE, &DefaultTDelta, 0, 1440, NULL },
|
||||||
{"EndSent", 1, STR_TYPE, &EndSent, 0, 0 },
|
{"DeltaOffset", 0, INT_TYPE, &DeltaOffset, 0, 0, NULL },
|
||||||
{"EndSentIg", 1, STR_TYPE, &EndSentIg, 0, 0 },
|
{"DontFork", 0, INT_TYPE, &DontFork, 0, 0, NULL },
|
||||||
{"FirstIndent", 1, INT_TYPE, &FirstIndent, 0, 132 },
|
{"DontQueue", 0, INT_TYPE, &DontQueue, 0, 0, NULL },
|
||||||
{"FoldYear", 1, INT_TYPE, &FoldYear, 0, 1 },
|
{"DontTrigAts", 0, INT_TYPE, &DontIssueAts, 0, 0, NULL },
|
||||||
{"FormWidth", 1, INT_TYPE, &FormWidth, 20, 500 },
|
{"EndSent", 1, STR_TYPE, &EndSent, 0, 0, NULL },
|
||||||
{"HushMode", 0, INT_TYPE, &Hush, 0, 0 },
|
{"EndSentIg", 1, STR_TYPE, &EndSentIg, 0, 0, NULL },
|
||||||
{"IgnoreOnce", 0, INT_TYPE, &IgnoreOnce, 0, 0 },
|
{"February", 1, STR_TYPE, &DynamicMonthName[1], 0, 0, NULL },
|
||||||
{"InfDelta", 0, INT_TYPE, &InfiniteDelta, 0, 0 },
|
{"FirstIndent", 1, INT_TYPE, &FirstIndent, 0, 132, NULL },
|
||||||
{"IntMax", 0, INT_TYPE, &IntMax, 0, 0 },
|
{"FoldYear", 1, INT_TYPE, &FoldYear, 0, 1, NULL },
|
||||||
{"IntMin", 0, INT_TYPE, &IntMin, 0, 0 },
|
{"FormWidth", 1, INT_TYPE, &FormWidth, 20, 500, NULL },
|
||||||
{"LatDeg", 1, INT_TYPE, &LatDeg, -90, 90 },
|
{"Friday", 1, STR_TYPE, &DynamicDayName[4], 0, 0, NULL },
|
||||||
{"LatMin", 1, INT_TYPE, &LatMin, -59, 59 },
|
{"HushMode", 0, INT_TYPE, &Hush, 0, 0, NULL },
|
||||||
{"LatSec", 1, INT_TYPE, &LatSec, -59, 59 },
|
{"IgnoreOnce", 0, INT_TYPE, &IgnoreOnce, 0, 0, NULL },
|
||||||
{"Location", 1, STR_TYPE, &Location, 0, 0 },
|
{"InfDelta", 0, INT_TYPE, &InfiniteDelta, 0, 0, NULL },
|
||||||
{"LongDeg", 1, INT_TYPE, &LongDeg, -180, 180 },
|
{"IntMax", 0, INT_TYPE, &IntMax, 0, 0, NULL },
|
||||||
{"LongMin", 1, INT_TYPE, &LongMin, -59, 59 },
|
{"IntMin", 0, INT_TYPE, &IntMin, 0, 0, NULL },
|
||||||
{"LongSec", 1, INT_TYPE, &LongSec, -59, 59 },
|
{"January", 1, STR_TYPE, &DynamicMonthName[0], 0, 0, NULL },
|
||||||
{"MaxSatIter", 1, INT_TYPE, &MaxSatIter, 10, ANY },
|
{"July", 1, STR_TYPE, &DynamicMonthName[6], 0, 0, NULL },
|
||||||
{"MaxStringLen", 1, INT_TYPE, &MaxStringLen, -1, ANY },
|
{"June", 1, STR_TYPE, &DynamicMonthName[5], 0, 0, NULL },
|
||||||
{"MinsFromUTC", 1, INT_TYPE, &MinsFromUTC, -780, 780 },
|
{"LatDeg", 1, SPECIAL_TYPE, latdeg_func, 0, 0, NULL },
|
||||||
{"NextMode", 0, INT_TYPE, &NextMode, 0, 0 },
|
{"Latitude", 1, SPECIAL_TYPE, latitude_func, 0, 0, NULL },
|
||||||
{"NumQueued", 0, INT_TYPE, &NumQueued, 0, 0 },
|
{"LatMin", 1, SPECIAL_TYPE, latmin_func, 0, 0, NULL },
|
||||||
{"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
|
{"LatSec", 1, SPECIAL_TYPE, latsec_func, 0, 0, NULL },
|
||||||
{"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0 },
|
{"Location", 1, STR_TYPE, &Location, 0, 0, NULL },
|
||||||
{"PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
|
{"LongDeg", 1, SPECIAL_TYPE, longdeg_func, 0, 0, NULL },
|
||||||
{"RunOff", 0, INT_TYPE, &RunDisabled, 0, 0 },
|
{"Longitude", 1, SPECIAL_TYPE, longitude_func, 0, 0, NULL },
|
||||||
{"SimpleCal", 0, INT_TYPE, &DoSimpleCalendar, 0, 0 },
|
{"LongMin", 1, SPECIAL_TYPE, longmin_func, 0, 0, NULL },
|
||||||
{"SortByDate", 0, INT_TYPE, &SortByDate, 0, 0 },
|
{"LongSec", 1, SPECIAL_TYPE, longsec_func, 0, 0, NULL },
|
||||||
{"SortByPrio", 0, INT_TYPE, &SortByPrio, 0, 0 },
|
{"March", 1, STR_TYPE, &DynamicMonthName[2], 0, 0, NULL },
|
||||||
{"SortByTime", 0, INT_TYPE, &SortByTime, 0, 0 },
|
{"MaxSatIter", 1, INT_TYPE, &MaxSatIter, 10, ANY, NULL },
|
||||||
{"SubsIndent", 1, INT_TYPE, &SubsIndent, 0, 132 },
|
{"MaxStringLen", 1, INT_TYPE, &MaxStringLen, -1, ANY, NULL },
|
||||||
{"T", 0, SPECIAL_TYPE, trig_date_func, 0, 0 },
|
{"May", 1, STR_TYPE, &DynamicMonthName[4], 0, 0, NULL },
|
||||||
{"Td", 0, SPECIAL_TYPE, trig_day_func, 0, 0 },
|
{"MinsFromUTC", 1, INT_TYPE, &MinsFromUTC, -780, 780, NULL },
|
||||||
{"TimeSep", 1, SPECIAL_TYPE, time_sep_func, 0, 0 },
|
{"Monday", 1, STR_TYPE, &DynamicDayName[0], 0, 0, NULL },
|
||||||
{"Tm", 0, SPECIAL_TYPE, trig_mon_func, 0, 0 },
|
{"NextMode", 0, INT_TYPE, &NextMode, 0, 0, NULL },
|
||||||
{"Tw", 0, SPECIAL_TYPE, trig_wday_func, 0, 0 },
|
{"November", 1, STR_TYPE, &DynamicMonthName[10],0, 0, NULL },
|
||||||
{"Ty", 0, SPECIAL_TYPE, trig_year_func, 0, 0 },
|
{"NumQueued", 0, INT_TYPE, &NumQueued, 0, 0, NULL },
|
||||||
{"U", 0, SPECIAL_TYPE, today_date_func, 0, 0 },
|
{"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0, NULL },
|
||||||
{"Ud", 0, SPECIAL_TYPE, today_day_func, 0, 0 },
|
{"October", 1, STR_TYPE, &DynamicMonthName[9], 0, 0, NULL },
|
||||||
{"Um", 0, SPECIAL_TYPE, today_mon_func, 0, 0 },
|
{"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0, NULL },
|
||||||
{"UntimedFirst", 0, INT_TYPE, &UntimedBeforeTimed, 0, 0 },
|
{"PSCal", 0, INT_TYPE, &PsCal, 0, 0, NULL },
|
||||||
{"Uw", 0, SPECIAL_TYPE, today_wday_func, 0, 0 },
|
{"RunOff", 0, INT_TYPE, &RunDisabled, 0, 0, NULL },
|
||||||
{"Uy", 0, SPECIAL_TYPE, today_year_func, 0, 0 }
|
{"Saturday", 1, STR_TYPE, &DynamicDayName[5], 0, 0, NULL },
|
||||||
|
{"September", 1, STR_TYPE, &DynamicMonthName[8], 0, 0, NULL },
|
||||||
|
{"SimpleCal", 0, INT_TYPE, &DoSimpleCalendar, 0, 0, NULL },
|
||||||
|
{"SortByDate", 0, INT_TYPE, &SortByDate, 0, 0, NULL },
|
||||||
|
{"SortByPrio", 0, INT_TYPE, &SortByPrio, 0, 0, NULL },
|
||||||
|
{"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 },
|
||||||
|
{"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 },
|
||||||
|
{"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 },
|
||||||
|
{"U", 0, SPECIAL_TYPE, today_date_func, 0, 0, NULL },
|
||||||
|
{"Ud", 0, SPECIAL_TYPE, today_day_func, 0, 0, NULL },
|
||||||
|
{"Um", 0, SPECIAL_TYPE, today_mon_func, 0, 0, NULL },
|
||||||
|
{"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 },
|
||||||
|
{"Wednesday", 1, STR_TYPE, &DynamicDayName[2], 0, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
|
#define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
|
||||||
@@ -714,6 +831,7 @@ static void DumpSysVar (char const *name, const SysVar *v);
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int SetSysVar(char const *name, Value *value)
|
int SetSysVar(char const *name, Value *value)
|
||||||
{
|
{
|
||||||
|
int r;
|
||||||
SysVar *v = FindSysVar(name);
|
SysVar *v = FindSysVar(name);
|
||||||
if (!v) return E_NOSUCH_VAR;
|
if (!v) return E_NOSUCH_VAR;
|
||||||
if (v->type != SPECIAL_TYPE &&
|
if (v->type != SPECIAL_TYPE &&
|
||||||
@@ -725,8 +843,27 @@ int SetSysVar(char const *name, Value *value)
|
|||||||
|
|
||||||
if (v->type == SPECIAL_TYPE) {
|
if (v->type == SPECIAL_TYPE) {
|
||||||
SysVarFunc f = (SysVarFunc) v->value;
|
SysVarFunc f = (SysVarFunc) v->value;
|
||||||
return f(1, value);
|
r = f(1, value);
|
||||||
} else if (v->type == STR_TYPE) {
|
DestroyValue(*value);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
if (v->validate) {
|
||||||
|
if (v->type == STR_TYPE) {
|
||||||
|
r = (v->validate)((void *) value->v.str);
|
||||||
|
} else {
|
||||||
|
r = (v->validate)((void *) &(value->v.val));
|
||||||
|
}
|
||||||
|
if (r != OK) {
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (v->type == STR_TYPE) {
|
||||||
|
/* If it's already the same, don't bother doing anything */
|
||||||
|
if (!strcmp(value->v.str, (char const *) v->value)) {
|
||||||
|
DestroyValue(*value);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
/* If it's a string variable, special measures must be taken */
|
/* If it's a string variable, special measures must be taken */
|
||||||
if (v->been_malloced) free(*((char **)(v->value)));
|
if (v->been_malloced) free(*((char **)(v->value)));
|
||||||
v->been_malloced = 1;
|
v->been_malloced = 1;
|
||||||
@@ -757,7 +894,11 @@ int GetSysVar(char const *name, Value *val)
|
|||||||
SysVarFunc f = (SysVarFunc) v->value;
|
SysVarFunc f = (SysVarFunc) v->value;
|
||||||
return f(0, val);
|
return f(0, val);
|
||||||
} else if (v->type == STR_TYPE) {
|
} else if (v->type == STR_TYPE) {
|
||||||
val->v.str = StrDup(*((char **) v->value));
|
if (! * (char **) v->value) {
|
||||||
|
val->v.str = StrDup("");
|
||||||
|
} else {
|
||||||
|
val->v.str = StrDup(*((char **) v->value));
|
||||||
|
}
|
||||||
if (!val->v.str) return E_NO_MEM;
|
if (!val->v.str) return E_NO_MEM;
|
||||||
} else {
|
} else {
|
||||||
val->v.val = *((int *) v->value);
|
val->v.val = *((int *) v->value);
|
||||||
@@ -767,7 +908,7 @@ int GetSysVar(char const *name, Value *val)
|
|||||||
/* In "verbose" mode, print attempts to test $RunOff */
|
/* In "verbose" mode, print attempts to test $RunOff */
|
||||||
if (DebugFlag & DB_PRTLINE) {
|
if (DebugFlag & DB_PRTLINE) {
|
||||||
if (v->value == (void *) &RunDisabled) {
|
if (v->value == (void *) &RunDisabled) {
|
||||||
Eprint("(Security note: $RunOff variable tested.)\n");
|
Eprint("(Security note: $RunOff variable tested.)");
|
||||||
/* Allow further messages from this line */
|
/* Allow further messages from this line */
|
||||||
FreshLine = 1;
|
FreshLine = 1;
|
||||||
}
|
}
|
||||||
@@ -848,29 +989,29 @@ static void DumpSysVar(char const *name, const SysVar *v)
|
|||||||
SysVarFunc f = (SysVarFunc) v->value;
|
SysVarFunc f = (SysVarFunc) v->value;
|
||||||
f(0, &val);
|
f(0, &val);
|
||||||
PrintValue(&val, ErrFp);
|
PrintValue(&val, ErrFp);
|
||||||
Putc('\n', ErrFp);
|
putc('\n', ErrFp);
|
||||||
DestroyValue(val);
|
DestroyValue(val);
|
||||||
} else if (v->type == STR_TYPE) {
|
} else if (v->type == STR_TYPE) {
|
||||||
char const *s = *((char **)v->value);
|
char const *s = *((char **)v->value);
|
||||||
int y;
|
int y;
|
||||||
Putc('"', ErrFp);
|
putc('"', ErrFp);
|
||||||
for (y=0; y<MAX_PRT_LEN && *s; y++) {
|
for (y=0; y<MAX_PRT_LEN && *s; y++) {
|
||||||
if (*s == '"') {
|
if (*s == '"') {
|
||||||
fprintf(ErrFp, "\" + char(34) + \"");
|
fprintf(ErrFp, "\" + char(34) + \"");
|
||||||
s++;
|
s++;
|
||||||
} else {
|
} else {
|
||||||
Putc(*s++, ErrFp);
|
putc(*s++, ErrFp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Putc('"', ErrFp);
|
putc('"', ErrFp);
|
||||||
if (*s) fprintf(ErrFp, "...");
|
if (*s) fprintf(ErrFp, "...");
|
||||||
Putc('\n', ErrFp);
|
putc('\n', ErrFp);
|
||||||
} else if (v->type == DATE_TYPE) {
|
} else if (v->type == DATE_TYPE) {
|
||||||
Value val;
|
Value val;
|
||||||
val.type = DATE_TYPE;
|
val.type = DATE_TYPE;
|
||||||
val.v.val = * (int *) v->value;
|
val.v.val = * (int *) v->value;
|
||||||
PrintValue(&val, ErrFp);
|
PrintValue(&val, ErrFp);
|
||||||
Putc('\n', ErrFp);
|
putc('\n', ErrFp);
|
||||||
} else {
|
} else {
|
||||||
if (!v->modifiable) fprintf(ErrFp, "%d\n", *((int *)v->value));
|
if (!v->modifiable) fprintf(ErrFp, "%d\n", *((int *)v->value));
|
||||||
else {
|
else {
|
||||||
@@ -885,3 +1026,48 @@ static void DumpSysVar(char const *name, const SysVar *v)
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
set_lat_and_long_from_components(void)
|
||||||
|
{
|
||||||
|
Latitude = (double) LatDeg + ((double) LatMin) / 60.0 + ((double) LatSec) / 3600.0;
|
||||||
|
Longitude = - ( (double) LongDeg + ((double) LongMin) / 60.0 + ((double) LongSec) / 3600.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
set_components_from_lat_and_long(void)
|
||||||
|
{
|
||||||
|
double x;
|
||||||
|
|
||||||
|
x = (Latitude < 0.0 ? -Latitude : Latitude);
|
||||||
|
LatDeg = (int) x;
|
||||||
|
x -= (double) LatDeg;
|
||||||
|
x *= 60;
|
||||||
|
LatMin = (int) x;
|
||||||
|
x -= (double) LatMin;
|
||||||
|
x *= 60;
|
||||||
|
LatSec = (int) x;
|
||||||
|
if (Latitude < 0.0) {
|
||||||
|
LatDeg = -LatDeg;
|
||||||
|
LatMin = -LatMin;
|
||||||
|
LatSec = -LatSec;
|
||||||
|
}
|
||||||
|
|
||||||
|
x = (Longitude < 0.0 ? -Longitude : Longitude);
|
||||||
|
LongDeg = (int) x;
|
||||||
|
x -= (double) LongDeg;
|
||||||
|
x *= 60;
|
||||||
|
LongMin = (int) x;
|
||||||
|
x -= (double) LongMin;
|
||||||
|
x *= 60;
|
||||||
|
LongSec = (int) x;
|
||||||
|
|
||||||
|
/* Use STANDARD sign for $Longitude even if $LongDeg, $LongMin and
|
||||||
|
* $LongSec are messed up */
|
||||||
|
if (Longitude > 0.0) {
|
||||||
|
LongDeg = -LongDeg;
|
||||||
|
LongMin = -LongMin;
|
||||||
|
LongSec = -LongSec;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
REM 15 MSG 02
|
REM 15 MSG 02
|
||||||
|
DO subdir/04.rem
|
||||||
|
INCLUDE subdir/04.rem
|
||||||
|
|||||||
1
tests/include_dir/subdir/04.rem
Normal file
1
tests/include_dir/subdir/04.rem
Normal file
@@ -0,0 +1 @@
|
|||||||
|
REM 16 MSG Should be included by 02.rem
|
||||||
70
tests/scripts.rem
Normal file
70
tests/scripts.rem
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
# This is a test file that tests the
|
||||||
|
# rendering of various Unicode characters.
|
||||||
|
# It also tests some of the features of
|
||||||
|
# the Pango/Cairo-based rem2pdf program.
|
||||||
|
|
||||||
|
SET $Sunday "እሁድ"
|
||||||
|
SET $Monday "一"
|
||||||
|
SET $Tuesday "mardi"
|
||||||
|
SET $Wednesday "水曜日"
|
||||||
|
SET $Thursday "четвер"
|
||||||
|
SET $Friday "piątek"
|
||||||
|
SET $Saturday "יום שבת"
|
||||||
|
|
||||||
|
SET $January "January"
|
||||||
|
SET $February "février"
|
||||||
|
SET $March "März"
|
||||||
|
SET $April "אַפּרִיל"
|
||||||
|
SET $May "ግንቦት"
|
||||||
|
SET $June "Чэрвень"
|
||||||
|
SET $July "تموز"
|
||||||
|
SET $August "Наймдугаар сар"
|
||||||
|
SET $September "Вересень"
|
||||||
|
SET $October "październik"
|
||||||
|
SET $November "נאוועמבער"
|
||||||
|
SET $December "दिसंबर"
|
||||||
|
|
||||||
|
REM 1 MSG Përkujtues
|
||||||
|
REM 2 SPECIAL SHADE 192 192 255
|
||||||
|
REM 2 MSG تذكير
|
||||||
|
REM 3 MSG 提醒
|
||||||
|
REM 4 MSG રીમાઇન્ડર
|
||||||
|
REM 5 MSG Emlékeztető
|
||||||
|
REM 6 MSG Áminning
|
||||||
|
REM 7 SPECIAL PANGO <u>תִזכּוֹרֶת</u>
|
||||||
|
REM 8 MSG अनुस्मारक
|
||||||
|
REM 9 SPECIAL COLOR 0 0 192 Эскертүү
|
||||||
|
REM 10 SPECIAL COLOR 0 192 0 Напоминание
|
||||||
|
REM 11 SPECIAL COLOR 192 0 0 Υπενθύμιση
|
||||||
|
REM 12 SPECIAL PANGO <b>Bold</b> <small>and</small> <i>Italic</i> <big>and</big> <span bgcolor="#C0C0C0" foreground="red"><u>underline</u></span>
|
||||||
|
REM 12 MSG Hello
|
||||||
|
REM 28 SPECIAL PANGO <span face="zapf chancery" size="10000">Very Fancy</span>
|
||||||
|
|
||||||
|
REM 13 SPECIAL PANGO <bad>Invalid
|
||||||
|
REM 13 MSG Hello Again
|
||||||
|
|
||||||
|
REM 15 SPECIAL PANGO @1,-1 <small><small>[hebday($U)] [hebmon($U)] Rise [sunrise($U)] Set [sunset($U)]</small></small>
|
||||||
|
|
||||||
|
REM 16 MSG یادآور
|
||||||
|
REM 17 MSG Lời nhắc nhở
|
||||||
|
REM 18 MSG Påminnelse
|
||||||
|
REM 19 MSG דערמאָנונג
|
||||||
|
REM 20 MSG Hatırlatma
|
||||||
|
REM 21 SPECIAL PANGO <big><big> Нагадування</big></big>
|
||||||
|
REM 22 MSG შეხსენება
|
||||||
|
REM 23 MSG เตือนความจำ
|
||||||
|
REM 24 MSG リマインダー
|
||||||
|
REM 25 MSG Искә төшерү
|
||||||
|
REM 26 MSG Напомняне
|
||||||
|
REM 27 MSG ഓർമ്മപ്പെടുത്തൽ
|
||||||
|
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>
|
||||||
|
REM [moondate(0)] SPECIAL MOON 0
|
||||||
|
REM [moondate(1)] SPECIAL MOON 1
|
||||||
|
REM [moondate(2)] SPECIAL MOON 2 -1 -1 [moontime(2)]
|
||||||
|
REM [moondate(3)] SPECIAL MOON 3 -1 -1 [moontime(3)]
|
||||||
|
|
||||||
|
REM Mon SPECIAL WEEK (W[weekno(today())])
|
||||||
|
|
||||||
|
REM SATISFY [$Td != 15] SPECIAL PANGO @1,-1 <span size="4800"><i>Rise [sunrise($U)] Set [sunset($U)]</i></span>
|
||||||
1291
tests/test.cmp
1291
tests/test.cmp
File diff suppressed because it is too large
Load Diff
@@ -233,6 +233,29 @@ REM Mon 15 Feb ADDOMIT MSG Family Day
|
|||||||
REM Feb 18 AFTER MSG Should trigger on Feb 19
|
REM Feb 18 AFTER MSG Should trigger on Feb 19
|
||||||
OMIT DUMP
|
OMIT DUMP
|
||||||
|
|
||||||
|
set $CalcUTC 0
|
||||||
|
set $DateTimeSep "@"
|
||||||
|
set $DefaultColor "-1 -1 -1"
|
||||||
|
set $DefaultPrio 5000
|
||||||
|
set $EndSent ".?!"
|
||||||
|
set $EndSentIg "" + char(34) + "')]}>"
|
||||||
|
set $FirstIndent 0
|
||||||
|
set $FoldYear 0
|
||||||
|
set $FormWidth 72
|
||||||
|
set $Location "Ottawa"
|
||||||
|
set $MaxSatIter 150
|
||||||
|
set $MaxStringLen 65535
|
||||||
|
set $MinsFromUTC -300
|
||||||
|
set $SubsIndent 0
|
||||||
|
set $TimeSep ":"
|
||||||
|
|
||||||
|
set $LatDeg 30
|
||||||
|
set $LatMin 30
|
||||||
|
set $LatSec 0
|
||||||
|
set $LongDeg -25
|
||||||
|
set $LongMin 15
|
||||||
|
set $LongSec 0
|
||||||
|
|
||||||
set a000 abs(1)
|
set a000 abs(1)
|
||||||
set a001 abs(-1)
|
set a001 abs(-1)
|
||||||
set a002 asc("foo")
|
set a002 asc("foo")
|
||||||
@@ -423,6 +446,7 @@ REM MAYBE-UNCOMPUTABLE Mon OMIT Mon SKIP MSG Never ever ever...
|
|||||||
REM MAYBE-UNCOMPUTABLE Mon SATISFY [wkdaynum($T) == 3] MSG Nope nope...
|
REM MAYBE-UNCOMPUTABLE Mon SATISFY [wkdaynum($T) == 3] MSG Nope nope...
|
||||||
|
|
||||||
dump
|
dump
|
||||||
|
dump $
|
||||||
dump $aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
dump $aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
||||||
OMIT 2010-09-03 THROUGH 2010-09-15
|
OMIT 2010-09-03 THROUGH 2010-09-15
|
||||||
OMIT December 25 MSG X
|
OMIT December 25 MSG X
|
||||||
@@ -593,11 +617,26 @@ set a $IntMin * (-1)
|
|||||||
set a (-1) * $IntMin
|
set a (-1) * $IntMin
|
||||||
set a abs($IntMin)
|
set a abs($IntMin)
|
||||||
|
|
||||||
|
# The "isany" function
|
||||||
|
set a isany(1)
|
||||||
|
set a isany("foo")
|
||||||
|
set a isany(1:00)
|
||||||
|
set a isany(1, 2)
|
||||||
|
set a isany("foo", 2)
|
||||||
|
set a isany(1:00, 2)
|
||||||
|
set a isany(1, 2, 1, 3)
|
||||||
|
set a isany("foo", 2, 3, "foo")
|
||||||
|
set a isany(1:00, 2, "foo", 2:00, 1:00, 9:00)
|
||||||
|
|
||||||
# Shellescape
|
# Shellescape
|
||||||
set a shellescape(" !\"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")
|
set a shellescape(" !\"#$%%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~")
|
||||||
|
|
||||||
msg [a]
|
msg [a]
|
||||||
|
|
||||||
|
# Deprecated functions
|
||||||
|
set x psshade(50)
|
||||||
|
set x psmoon(0)
|
||||||
|
|
||||||
# Don't want Remind to queue reminders
|
# Don't want Remind to queue reminders
|
||||||
EXIT
|
EXIT
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
table.rem-cal {
|
table.rem-cal {
|
||||||
font-family: helvetica, arial, sans-serif;
|
font-family: helvetica, arial, sans-serif;
|
||||||
font-size: 12pt;
|
font-size: 12pt;
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.rem-sc-table {
|
table.rem-sc-table {
|
||||||
@@ -37,11 +39,6 @@ td.rem-today {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.rem-cal {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.rem-daynumber {
|
div.rem-daynumber {
|
||||||
float: right;
|
float: right;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
|||||||
Reference in New Issue
Block a user