mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Compare commits
839 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cce4b2cb14 | ||
|
|
e49d9f8ab6 | ||
|
|
48cbeb28f4 | ||
|
|
57d5c54559 | ||
|
|
3b2260f67e | ||
|
|
d423a62327 | ||
|
|
ac8da00030 | ||
|
|
77eb7fb99d | ||
|
|
a751149dd3 | ||
|
|
69d45618c6 | ||
|
|
22fa1a28e5 | ||
|
|
f4cc233009 | ||
|
|
1d6e4edd0f | ||
|
|
daffa8cba0 | ||
|
|
2e161a1bc1 | ||
|
|
204bb00060 | ||
|
|
d6029a54aa | ||
|
|
f99b5c5a66 | ||
|
|
2df4119c1a | ||
|
|
d06b4e5dcd | ||
|
|
bf8a25137d | ||
|
|
0f302ad0fc | ||
|
|
e3d6b283c5 | ||
|
|
2e3ed09039 | ||
|
|
37971a3f07 | ||
|
|
2a1960f257 | ||
|
|
350564c304 | ||
|
|
9e2a9fea37 | ||
|
|
3592b43629 | ||
|
|
becf1fc459 | ||
|
|
2bccd058ed | ||
|
|
12c6621051 | ||
|
|
504bc6a875 | ||
|
|
9cfdd0b53f | ||
|
|
d59024f399 | ||
|
|
24e0178d1a | ||
|
|
1ede5775f2 | ||
|
|
a5c9b07052 | ||
|
|
22353d4833 | ||
|
|
7499ada891 | ||
|
|
3f0a4e5c39 | ||
|
|
b8d6472974 | ||
|
|
6358297724 | ||
|
|
4f6dcde980 | ||
|
|
8a7985c48e | ||
|
|
4ddbe54e55 | ||
|
|
ef0bf73a29 | ||
|
|
beda9014d8 | ||
|
|
498a429b2c | ||
|
|
6aa2aa0fb3 | ||
|
|
1bef88fccd | ||
|
|
8308068067 | ||
|
|
8385c7f1b0 | ||
|
|
0537d02fef | ||
|
|
c33a1a3b0b | ||
|
|
fd39999128 | ||
|
|
0aa40094fa | ||
|
|
e3bbbe07be | ||
|
|
5633798d33 | ||
|
|
0e7e1b1b75 | ||
|
|
4d3790bc1a | ||
|
|
2002c7f1f8 | ||
|
|
1be14e99a2 | ||
|
|
78efdaf85f | ||
|
|
0e98a1c656 | ||
|
|
7aa483e201 | ||
|
|
a6dbf05af4 | ||
|
|
8ab78fd8be | ||
|
|
4f119031a4 | ||
|
|
19bdd6c2db | ||
|
|
f1557b8243 | ||
|
|
85f96e2e01 | ||
|
|
47331cd919 | ||
|
|
d9f18ed6a7 | ||
|
|
efa4816371 | ||
|
|
2dc8c63adb | ||
|
|
c3c1781021 | ||
|
|
cd39480a98 | ||
|
|
281a1a206e | ||
|
|
cbff2a7bf2 | ||
|
|
2a08be8fd0 | ||
|
|
0826678209 | ||
|
|
f2e421bfa5 | ||
|
|
ce53a9b91a | ||
|
|
b166b1cf82 | ||
|
|
d09fbb03b2 | ||
|
|
7a835f3b10 | ||
|
|
6b991cdf9c | ||
|
|
018e9d0323 | ||
|
|
f499ae096f | ||
|
|
725e046a15 | ||
|
|
275b1f62b6 | ||
|
|
6e58dea198 | ||
|
|
ad4e62c8c3 | ||
|
|
a5768d55d8 | ||
|
|
7db49971c8 | ||
|
|
45ca6631ac | ||
|
|
d51944f36c | ||
|
|
037c79fb0f | ||
|
|
993373414f | ||
|
|
38a0a9992a | ||
|
|
a82bbe3776 | ||
|
|
a32ba217ba | ||
|
|
d322cf54ac | ||
|
|
b1d07a231d | ||
|
|
97851a08e6 | ||
|
|
8547b30a8f | ||
|
|
405c7d9ed0 | ||
|
|
ac5b641d93 | ||
|
|
06a79989c0 | ||
|
|
671db64436 | ||
|
|
33344cefe6 | ||
|
|
5ef0341537 | ||
|
|
6abca08189 | ||
|
|
35670ce651 | ||
|
|
e230d53d84 | ||
|
|
88537a3471 | ||
|
|
7c9d74da73 | ||
|
|
3b582935ee | ||
|
|
508fafb875 | ||
|
|
6f718f0fe5 | ||
|
|
53acbf2052 | ||
|
|
1606dbbe77 | ||
|
|
adced3ac6c | ||
|
|
14f207140a | ||
|
|
d2da32de6c | ||
|
|
e5d6a36f05 | ||
|
|
68ecfcf876 | ||
|
|
fcb14b9dfe | ||
|
|
6a4b4257a6 | ||
|
|
385b57e269 | ||
|
|
a8e81e3984 | ||
|
|
46c5f0e752 | ||
|
|
454d859fdd | ||
|
|
57134a182c | ||
|
|
5801e143ea | ||
|
|
4e0d0ff98b | ||
|
|
d4ac1849ae | ||
|
|
c16ac1bd8c | ||
|
|
16222ac3bc | ||
|
|
8d88931fb1 | ||
|
|
63f0356e70 | ||
|
|
786b0dee6f | ||
|
|
e7ef9dc295 | ||
|
|
f59461b95d | ||
|
|
566a86b9fd | ||
|
|
8589a3730d | ||
|
|
c05fd366df | ||
|
|
fc9fd1e53c | ||
|
|
a5e6eb9f7c | ||
|
|
a9430fea5f | ||
|
|
828a0d6589 | ||
|
|
32601da748 | ||
|
|
ac50f119cf | ||
|
|
7622ebaa0a | ||
|
|
a586d5cd37 | ||
|
|
edbc88bd19 | ||
|
|
94f99f3414 | ||
|
|
fd4f84349e | ||
|
|
f86350b2ff | ||
|
|
564b72066a | ||
|
|
2890c52090 | ||
|
|
c1d45485c1 | ||
|
|
8b2a69cf8d | ||
|
|
034c1341b3 | ||
|
|
29bbf1a030 | ||
|
|
be6661d6be | ||
|
|
3f876e792c | ||
|
|
f2457b90ff | ||
|
|
e999e9009b | ||
|
|
46326c001b | ||
|
|
b84c2c403c | ||
|
|
861ad72187 | ||
|
|
7dbbc34ccc | ||
|
|
4ea45d1d14 | ||
|
|
c1b9243e2f | ||
|
|
a41c40c7a4 | ||
|
|
318d4547ef | ||
|
|
6f98b60a6a | ||
|
|
baa8f7f3c4 | ||
|
|
6297622072 | ||
|
|
9f3ba0bf2b | ||
|
|
9591dec708 | ||
|
|
ee2d0b7518 | ||
|
|
2d46749c58 | ||
|
|
494664d1b6 | ||
|
|
49686210ae | ||
|
|
ddfa44188b | ||
|
|
73cf93d27b | ||
|
|
60d1a34bf0 | ||
|
|
6f80986801 | ||
|
|
2078f087b2 | ||
|
|
68d110826e | ||
|
|
9fb04c54ae | ||
|
|
d82314594b | ||
|
|
ad169a5248 | ||
|
|
a9bab81226 | ||
|
|
fa63a9ba51 | ||
|
|
1e7a630737 | ||
|
|
de1afce8da | ||
|
|
ac3cb19c26 | ||
|
|
af0479d11d | ||
|
|
0d9c04707f | ||
|
|
c2218f133b | ||
|
|
1ad0645fab | ||
|
|
3c16f6839a | ||
|
|
e8bac1e469 | ||
|
|
b3b69596f4 | ||
|
|
6a7bcb0956 | ||
|
|
f18a0704c1 | ||
|
|
d6f24b7c1e | ||
|
|
e2c9bbf94c | ||
|
|
f53aa4f656 | ||
|
|
a7ab9b8bf8 | ||
|
|
4448271166 | ||
|
|
4861b535a2 | ||
|
|
167f0100c7 | ||
|
|
b0367c7a5c | ||
|
|
4ae8ad52f5 | ||
|
|
dbd64828ab | ||
|
|
158ca882ba | ||
|
|
623ed44608 | ||
|
|
f13b867626 | ||
|
|
ff85325886 | ||
|
|
aa830116ea | ||
|
|
1a4504ba28 | ||
|
|
20365c4627 | ||
|
|
fae8f89ed6 | ||
|
|
a0689999fe | ||
|
|
a42a0ab032 | ||
|
|
b66eb5d3ec | ||
|
|
8b4bc0f56e | ||
|
|
c9d984983f | ||
|
|
47125b051a | ||
|
|
e5e6ff6031 | ||
|
|
9f0aedb608 | ||
|
|
08af33ece5 | ||
|
|
9b421d0b94 | ||
|
|
7bd8d2dd25 | ||
|
|
a7c4879a0a | ||
|
|
8b3585a6b8 | ||
|
|
a223149aee | ||
|
|
9185341b0c | ||
|
|
bf2d707e13 | ||
|
|
f081e5c54d | ||
|
|
18a3db0f31 | ||
|
|
d2c115127d | ||
|
|
c12e7e1b8f | ||
|
|
d3495ab3aa | ||
|
|
b93a7a6195 | ||
|
|
e5519a8498 | ||
|
|
eb2256f873 | ||
|
|
637b137b1c | ||
|
|
e2d14e73bf | ||
|
|
fbbffb4672 | ||
|
|
422e098727 | ||
|
|
87347e30b2 | ||
|
|
3314ce9823 | ||
|
|
402c1fe614 | ||
|
|
1d57856aa8 | ||
|
|
c027c215d6 | ||
|
|
fa0428b9fe | ||
|
|
b01c499ce5 | ||
|
|
4e5033dd24 | ||
|
|
00863f3830 | ||
|
|
2d4b35e8b9 | ||
|
|
6e4f2b9466 | ||
|
|
9a6fc0253b | ||
|
|
3180c781ed | ||
|
|
632152e8b6 | ||
|
|
1048f7e98d | ||
|
|
3de265216e | ||
|
|
2bdcadc7ab | ||
|
|
421ddfc68e | ||
|
|
41594bc1ac | ||
|
|
e85199d464 | ||
|
|
a6ee3bc704 | ||
|
|
2909106f30 | ||
|
|
05b97aabb2 | ||
|
|
84af60d817 | ||
|
|
72403a2512 | ||
|
|
4ec619d646 | ||
|
|
6178a627a0 | ||
|
|
3095fd7e4a | ||
|
|
74a6041760 | ||
|
|
96127e37ff | ||
|
|
df5484ea35 | ||
|
|
0ae3dae030 | ||
|
|
e5979139ac | ||
|
|
f81f6deb20 | ||
|
|
f9951909d8 | ||
|
|
bbda972b05 | ||
|
|
4445e9c434 | ||
|
|
709adacac2 | ||
|
|
9841cdd355 | ||
|
|
4cabe5fd71 | ||
|
|
0db239f8a0 | ||
|
|
32fb1706c8 | ||
|
|
c9e6cd9796 | ||
|
|
81677528a5 | ||
|
|
7761baba10 | ||
|
|
52d252723f | ||
|
|
d476709b59 | ||
|
|
0910e3da74 | ||
|
|
2cc7b7c817 | ||
|
|
011a95ebbd | ||
|
|
bbdc086a1f | ||
|
|
7d6617d21e | ||
|
|
f684baeeb9 | ||
|
|
308104853b | ||
|
|
6953bcac35 | ||
|
|
69e9fa4721 | ||
|
|
72d154c5e0 | ||
|
|
84b0a96170 | ||
|
|
6d3b8f7a09 | ||
|
|
81749ac1c9 | ||
|
|
65989c29b7 | ||
|
|
ec4e58f25c | ||
|
|
0c699c2a19 | ||
|
|
739a938d32 | ||
|
|
61ad405b4a | ||
|
|
700e649e76 | ||
|
|
7bfdb1f0eb | ||
|
|
0c0280b2a9 | ||
|
|
57a1871077 | ||
|
|
ee972ad29f | ||
|
|
29c8475ea9 | ||
|
|
6dd0f6ed63 | ||
|
|
fc2d7ae446 | ||
|
|
d232ac0334 | ||
|
|
6e8dd68c8a | ||
|
|
495cc1b38d | ||
|
|
d90e74b1a3 | ||
|
|
bbd8a4b729 | ||
|
|
cae3e18717 | ||
|
|
0e989a7422 | ||
|
|
7b7ce5bb57 | ||
|
|
df95cdaad0 | ||
|
|
3026b6e5c2 | ||
|
|
b3306c5572 | ||
|
|
9ef3be33e5 | ||
|
|
292262c128 | ||
|
|
e54bfe9197 | ||
|
|
c56cfe9e1d | ||
|
|
f6b6a3285c | ||
|
|
6b031b0fdf | ||
|
|
2dab7025ba | ||
|
|
7403114897 | ||
|
|
82cbeec560 | ||
|
|
df6b4ac566 | ||
|
|
4ba21ab526 | ||
|
|
acac7a7b31 | ||
|
|
2290fd09f5 | ||
|
|
f02b6a1773 | ||
|
|
efffe05d42 | ||
|
|
950d67c522 | ||
|
|
a1aa61f54e | ||
|
|
3c2bd66460 | ||
|
|
245cebee56 | ||
|
|
c45364fdb3 | ||
|
|
e380308604 | ||
|
|
bd019524dd | ||
|
|
895536d7d3 | ||
|
|
3a0e41afd1 | ||
|
|
23dd28471e | ||
|
|
761217d403 | ||
|
|
77ed694111 | ||
|
|
61bcce3104 | ||
|
|
bf41b12ccd | ||
|
|
5eabd7d8d8 | ||
|
|
0c66f5f3af | ||
|
|
3190f784d9 | ||
|
|
394ff55879 | ||
|
|
9b846835bc | ||
|
|
01776af167 | ||
|
|
0db10424ad | ||
|
|
bafd7ea073 | ||
|
|
0ab27fcb4b | ||
|
|
95d016712e | ||
|
|
fcb55001bb | ||
|
|
7bc6961101 | ||
|
|
450e88fad8 | ||
|
|
3222b4c311 | ||
|
|
1e0cc3605d | ||
|
|
129b7bfeb7 | ||
|
|
388811b684 | ||
|
|
f83257407b | ||
|
|
e4ced77340 | ||
|
|
92e0bc316a | ||
|
|
a4a55f35b2 | ||
|
|
ed1150c189 | ||
|
|
08080f4e86 | ||
|
|
de4ebb8be6 | ||
|
|
11e2ce5093 | ||
|
|
2c560e6f2b | ||
|
|
643f394e6a | ||
|
|
6d047c2856 | ||
|
|
be86746685 | ||
|
|
da429b9629 | ||
|
|
b21a206c26 | ||
|
|
85bde8ba3a | ||
|
|
f84e658e6b | ||
|
|
8f0eba8bcd | ||
|
|
2faaaf78a8 | ||
|
|
7f659dace2 | ||
|
|
54cdd566c7 | ||
|
|
e212df87f9 | ||
|
|
4fb4db15e8 | ||
|
|
9a15a25a7b | ||
|
|
c02cfb9b17 | ||
|
|
3e726f21f7 | ||
|
|
21d4faa26f | ||
|
|
1d13d0ee07 | ||
|
|
329d13e480 | ||
|
|
2161c09b1d | ||
|
|
3f2e396c3c | ||
|
|
412e242109 | ||
|
|
e827516b72 | ||
|
|
7f953e98d7 | ||
|
|
821d3fe783 | ||
|
|
fdb4b302ac | ||
|
|
760d5d4a09 | ||
|
|
d561f98c42 | ||
|
|
ea74f276dc | ||
|
|
42cf82a5d5 | ||
|
|
825a6700da | ||
|
|
2f27645dac | ||
|
|
1e5b44d063 | ||
|
|
099ad9945d | ||
|
|
540ce3d946 | ||
|
|
ac2efcc993 | ||
|
|
b4bb1d9e37 | ||
|
|
9ec8b30934 | ||
|
|
fb38e5b35b | ||
|
|
5fa10e9d84 | ||
|
|
3bc1b5bd46 | ||
|
|
b266b399ba | ||
|
|
0e827a457d | ||
|
|
d05d85b243 | ||
|
|
a1faa8d804 | ||
|
|
70adbf90c2 | ||
|
|
501c04f4b6 | ||
|
|
d294e62be1 | ||
|
|
31f90b6c53 | ||
|
|
184d29c592 | ||
|
|
2d798bc4ec | ||
|
|
bd9a3761a6 | ||
|
|
b1063b0a9e | ||
|
|
cb2fffab92 | ||
|
|
55cca49428 | ||
|
|
5a0ab9ed8a | ||
|
|
1f2cfdfd84 | ||
|
|
dfd688caa6 | ||
|
|
830e3e339c | ||
|
|
bc9f560950 | ||
|
|
f91b748f50 | ||
|
|
3adbd7468c | ||
|
|
b66039ee24 | ||
|
|
27371f6475 | ||
|
|
19e7c34b47 | ||
|
|
3375aff3a7 | ||
|
|
41e9cb5ca3 | ||
|
|
6348860adf | ||
|
|
4e9d401002 | ||
|
|
3db2fc7d0f | ||
|
|
0101d76113 | ||
|
|
6fabab6d4b | ||
|
|
905f1b0aaf | ||
|
|
6a5ab8e70c | ||
|
|
943b037589 | ||
|
|
5624cd44de | ||
|
|
8529f8b843 | ||
|
|
08be7c43cf | ||
|
|
aae76207ec | ||
|
|
5434f8330e | ||
|
|
e18b4ed119 | ||
|
|
51f6ffc093 | ||
|
|
72de7c6b14 | ||
|
|
bd4785d631 | ||
|
|
cb08f12470 | ||
|
|
04146db69b | ||
|
|
d3fe045a39 | ||
|
|
2be1e16087 | ||
|
|
051e44ae3e | ||
|
|
6d5ae7a258 | ||
|
|
2e69e140eb | ||
|
|
516c4e2c39 | ||
|
|
b58ed62000 | ||
|
|
c685818783 | ||
|
|
3e20ce56c9 | ||
|
|
dd8d67f659 | ||
|
|
5ef4061819 | ||
|
|
a146a0c819 | ||
|
|
0f5a93cdf1 | ||
|
|
7db51e913e | ||
|
|
93ac1aebf7 | ||
|
|
56ebedb9de | ||
|
|
e87d33de50 | ||
|
|
a5774fd793 | ||
|
|
adb60f3400 | ||
|
|
47a0f63caa | ||
|
|
30a385a7bb | ||
|
|
9f2ae1773c | ||
|
|
f470297958 | ||
|
|
93dfc7995c | ||
|
|
c96869817f | ||
|
|
1bffa0e00b | ||
|
|
36035dda01 | ||
|
|
50a15cf089 | ||
|
|
b59d4ed4a4 | ||
|
|
4c53710279 | ||
|
|
2274e88485 | ||
|
|
984a4677f2 | ||
|
|
5e3dc54725 | ||
|
|
53a7bf9773 | ||
|
|
1dcc3897d6 | ||
|
|
fbc0375739 | ||
|
|
4a74c03fa4 | ||
|
|
d8833e6ce2 | ||
|
|
2b8b9a56aa | ||
|
|
85a8ebb357 | ||
|
|
a67d9e2524 | ||
|
|
6845e72fd5 | ||
|
|
0ab977fa05 | ||
|
|
ad64a12b2a | ||
|
|
cfde4b50bb | ||
|
|
f302c8eb95 | ||
|
|
7ecc355358 | ||
|
|
a52216d7e7 | ||
|
|
8d8d4b667d | ||
|
|
670369121e | ||
|
|
4365e580ee | ||
|
|
a8a09a905e | ||
|
|
dbb7381eb1 | ||
|
|
aa3531a6bf | ||
|
|
2848203d75 | ||
|
|
f0aef0703c | ||
|
|
7356a511e0 | ||
|
|
5be26a3cff | ||
|
|
36a80acb0c | ||
|
|
37ab03b49d | ||
|
|
75209cb40e | ||
|
|
4b2d274748 | ||
|
|
1423495b88 | ||
|
|
42e4ec8890 | ||
|
|
58fbd51ef4 | ||
|
|
7552dbb812 | ||
|
|
31e0ecb71d | ||
|
|
f6743a4f87 | ||
|
|
5f574949e6 | ||
|
|
724bce4fb9 | ||
|
|
8d59f025af | ||
|
|
aad44f4716 | ||
|
|
0a38d7d213 | ||
|
|
4fcd60fd95 | ||
|
|
38beeb8cb0 | ||
|
|
26f0acab35 | ||
|
|
3897973bc1 | ||
|
|
7b3da27461 | ||
|
|
a85ee5f31c | ||
|
|
b272863aa0 | ||
|
|
8249964380 | ||
|
|
af81bbb299 | ||
|
|
d818dd9c80 | ||
|
|
fe8e34dece | ||
|
|
ba928989f7 | ||
|
|
742f973028 | ||
|
|
043932fcbe | ||
|
|
ad5e096caa | ||
|
|
06c8fc8f78 | ||
|
|
487338d10c | ||
|
|
3d1c0e5667 | ||
|
|
ce3bb191c4 | ||
|
|
03e9dbf364 | ||
|
|
518aab3d02 | ||
|
|
f055664f77 | ||
|
|
ba3e01f2ce | ||
|
|
b6883c8a45 | ||
|
|
9e49ee3acb | ||
|
|
7481f68bb2 | ||
|
|
99792eec03 | ||
|
|
91458c7845 | ||
|
|
cad5849dc0 | ||
|
|
a38e120e99 | ||
|
|
0b31a78cf2 | ||
|
|
861858c1a6 | ||
|
|
d43a2277da | ||
|
|
f678dc96b8 | ||
|
|
c2e371904e | ||
|
|
2a1cbff22e | ||
|
|
a2d9f277c4 | ||
|
|
d939059417 | ||
|
|
740cd4cfed | ||
|
|
91a5306a67 | ||
|
|
b78ffcbffd | ||
|
|
4f72f557b7 | ||
|
|
e3b21d6d0d | ||
|
|
af28c49d8d | ||
|
|
67f4635573 | ||
|
|
5f8d10908d | ||
|
|
7307421812 | ||
|
|
5cd3b628c5 | ||
|
|
29e483ab64 | ||
|
|
66ddba45af | ||
|
|
9325b3f035 | ||
|
|
522c4c94e1 | ||
|
|
730505cff3 | ||
|
|
019783e1fa | ||
|
|
8612bb6480 | ||
|
|
7f1e6d21d9 | ||
|
|
e6c0371be1 | ||
|
|
58feaa7e0c | ||
|
|
a828378466 | ||
|
|
53316e8b06 | ||
|
|
6127e390a1 | ||
|
|
4caa77f6b1 | ||
|
|
70419e8757 | ||
|
|
21d8bd1406 | ||
|
|
25abee3259 | ||
|
|
2d490c2b7a | ||
|
|
902b7895b7 | ||
|
|
1c80bb649f | ||
|
|
4508215617 | ||
|
|
739b68347a | ||
|
|
d834760cda | ||
|
|
1bc78650bf | ||
|
|
ec4e203099 | ||
|
|
d23528da82 | ||
|
|
7401a0ba23 | ||
|
|
b14b4f08b1 | ||
|
|
70ece81340 | ||
|
|
19ac350527 | ||
|
|
a9b08d7db8 | ||
|
|
df8fa05632 | ||
|
|
6556137aad | ||
|
|
aa1ab2bbb4 | ||
|
|
be38d86521 | ||
|
|
3931afb6b1 | ||
|
|
7d2df86b75 | ||
|
|
5a3bd5839b | ||
|
|
b91ce9a3f7 | ||
|
|
ac889dd329 | ||
|
|
420df9b6ed | ||
|
|
f862b6811d | ||
|
|
c072698927 | ||
|
|
d22895831b | ||
|
|
3c41f4ade4 | ||
|
|
335d5fb984 | ||
|
|
66bd2b8fac | ||
|
|
fed3cad3b8 | ||
|
|
b20578f24f | ||
|
|
7a86e7f777 | ||
|
|
16c93fcad6 | ||
|
|
edd66d8d89 | ||
|
|
3ba39b6efe | ||
|
|
c656a1a169 | ||
|
|
19f03e419a | ||
|
|
5a281d5999 | ||
|
|
d80d14f585 | ||
|
|
520b8511bd | ||
|
|
91627d4f22 | ||
|
|
a21147c7a5 | ||
|
|
d22c1dee49 | ||
|
|
95b0fc7480 | ||
|
|
b40d5d7984 | ||
|
|
2df93c9df3 | ||
|
|
51cdea4b17 | ||
|
|
f229e64744 | ||
|
|
0f15955a41 | ||
|
|
390e6c2eed | ||
|
|
877eaccd6d | ||
|
|
6424e655a1 | ||
|
|
176037082b | ||
|
|
a361c7e426 | ||
|
|
caba0c1695 | ||
|
|
71b3f9fefc | ||
|
|
91f8507e51 | ||
|
|
b68e81a126 | ||
|
|
72658025f1 | ||
|
|
93aea240d6 | ||
|
|
7717b37c36 | ||
|
|
e1b2990fb0 | ||
|
|
e49194c6ee | ||
|
|
79ab150546 | ||
|
|
fc658d15d4 | ||
|
|
76d130ef82 | ||
|
|
3e9a55fbdb | ||
|
|
b071397d46 | ||
|
|
df0dd55635 | ||
|
|
960d08fd24 | ||
|
|
38603916a2 | ||
|
|
0ed1bb4017 | ||
|
|
b4ac0c9f6c | ||
|
|
b136af88ad | ||
|
|
508b5f9aae | ||
|
|
43dff67a60 | ||
|
|
41b850321f | ||
|
|
523237007b | ||
|
|
a3f6c5fd9c | ||
|
|
785cdc8726 | ||
|
|
cbf12b5601 | ||
|
|
1a6d59d9c0 | ||
|
|
23ae054abb | ||
|
|
b57852d3d8 | ||
|
|
c0e1be2f3a | ||
|
|
a442a15a8d | ||
|
|
f91bf634ad | ||
|
|
ce4311c3df | ||
|
|
08e69cb541 | ||
|
|
f8e2eaed73 | ||
|
|
e68a16e73d | ||
|
|
ca191fbd92 | ||
|
|
10276826c0 | ||
|
|
02c9129903 | ||
|
|
04e4c902bd | ||
|
|
0663ae77de | ||
|
|
0c0f5ea093 | ||
|
|
f450fd633e | ||
|
|
59cdd35f61 | ||
|
|
eab67cbda4 | ||
|
|
b3c4a48641 | ||
|
|
07ac8ed341 | ||
|
|
e32aa218fc | ||
|
|
09d11d36c3 | ||
|
|
629e287526 | ||
|
|
e2cd29c824 | ||
|
|
69e597dbe7 | ||
|
|
152e7ebac9 | ||
|
|
8d4451ed85 | ||
|
|
5b8836d4b8 | ||
|
|
be7086579e | ||
|
|
ab16c8f1fe | ||
|
|
6bb71ee5e3 | ||
|
|
ebb4ebea97 | ||
|
|
bf97e62d56 | ||
|
|
47645cddb6 | ||
|
|
cf2af56a05 | ||
|
|
50d1ae42c9 | ||
|
|
9501498a7e | ||
|
|
614ab08099 | ||
|
|
64ee338433 | ||
|
|
43556238d0 | ||
|
|
58d7ac0520 | ||
|
|
0754678ce7 | ||
|
|
2bea176816 | ||
|
|
fa90333219 | ||
|
|
e007b3bc0f | ||
|
|
978e83567b | ||
|
|
d01c1190cd | ||
|
|
0b1855df9b | ||
|
|
951f2785cc | ||
|
|
30090d3f8d | ||
|
|
b6ad67891c | ||
|
|
b61c9db6e6 | ||
|
|
29368ec2ee | ||
|
|
88ff86c910 | ||
|
|
0cc5ae521c | ||
|
|
da1b5ed9a0 | ||
|
|
f786d05c04 | ||
|
|
0bcbe9047e | ||
|
|
585346f753 | ||
|
|
324aa01f80 | ||
|
|
8d0adfa6b7 | ||
|
|
bffae3724c | ||
|
|
a60dc3d1c8 | ||
|
|
df9977d4da | ||
|
|
c31678d28e | ||
|
|
40c1a5a3ee | ||
|
|
846dbd9338 | ||
|
|
2bfed13ebc | ||
|
|
2a5c625a7f | ||
|
|
7660e4a5f1 | ||
|
|
779672a5b5 | ||
|
|
46e9ac86bc | ||
|
|
8d6ca79934 | ||
|
|
2212d1eebe | ||
|
|
c78c284f19 | ||
|
|
b6b30637c6 | ||
|
|
b17198697c | ||
|
|
3ec57a608d | ||
|
|
49cd14846c | ||
|
|
1fd794a5bc | ||
|
|
5848991c27 | ||
|
|
d71f92d034 | ||
|
|
f9719ae7f5 | ||
|
|
4e0be6645a | ||
|
|
da25a18610 | ||
|
|
7bc3aa52d4 | ||
|
|
ca5bb13096 | ||
|
|
da124475fa | ||
|
|
ff04b2e481 | ||
|
|
09d66135b2 | ||
|
|
65cb72f7e8 | ||
|
|
8ae1f93899 | ||
|
|
0017f81da5 | ||
|
|
8c782c5b4e | ||
|
|
ffd283d779 | ||
|
|
b9227e11df | ||
|
|
5a289add73 | ||
|
|
614254a40d | ||
|
|
e31981c4c8 | ||
|
|
eb67e7757b | ||
|
|
ececf4a76e | ||
|
|
0a437420d8 | ||
|
|
b6ddc22c80 | ||
|
|
83d88affb7 | ||
|
|
5ae835db6c | ||
|
|
47e16f5525 | ||
|
|
a6a3dffbd6 | ||
|
|
9d1fcb19bf | ||
|
|
7176277ddb | ||
|
|
d9acf28ea5 | ||
|
|
00bbb8b159 | ||
|
|
dbe22e99ee | ||
|
|
361aa04c6d | ||
|
|
7e82b93a84 | ||
|
|
36731d2606 | ||
|
|
2e3ca89e0b | ||
|
|
394c4d0791 | ||
|
|
2bc3d991c1 | ||
|
|
a479ea971d | ||
|
|
075a491847 | ||
|
|
fefaea005b | ||
|
|
c564fa6165 | ||
|
|
0f4d6b5f8b | ||
|
|
55059d60e7 | ||
|
|
d45b590e59 | ||
|
|
76938d27f9 | ||
|
|
e89b5a2d91 | ||
|
|
a9ffc57ce6 | ||
|
|
97fdee4616 | ||
|
|
f9884f3e9d | ||
|
|
87b9dbf36b | ||
|
|
415c49fdb9 | ||
|
|
89cbe86ad9 | ||
|
|
db605a774c | ||
|
|
0e00cf4ee9 | ||
|
|
5bfac19a2e | ||
|
|
ea34bd0950 |
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
.gitignore export-ignore
|
||||
.gitattributes export-ignore
|
||||
remind.php export-ignore
|
||||
sync-to-dianne-git export-ignore
|
||||
16
.gitignore
vendored
Normal file
16
.gitignore
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
*.bak
|
||||
autom4te.cache
|
||||
config.log
|
||||
config.status
|
||||
src/Makefile
|
||||
www/Makefile
|
||||
*.o
|
||||
src/config.h
|
||||
src/remind
|
||||
src/*.tar.gz*
|
||||
tests/test.out
|
||||
.gitignore
|
||||
*~
|
||||
src/rem2ps
|
||||
src/version.h
|
||||
TAGS
|
||||
@@ -1,54 +0,0 @@
|
||||
$Id: ACKNOWLEDGEMENTS,v 1.1 1998-01-19 03:33:34 dfs Exp $
|
||||
|
||||
I would like to thank the following people:
|
||||
|
||||
Bill Aten <netagw!bill@uunet.UU.NET> for providing remind-all.sh
|
||||
|
||||
Bradley D. Keister <keister@poincare.phys.cmu.edu>, Rhys Weatherly
|
||||
rhys@batserver.cs.uq.OZ.AU> and Anthony Cheng for initially providing
|
||||
the Turbo C compiler support.
|
||||
|
||||
Dennis Cottel <dennis@peanuts.nosc.mil> for providing the patch to
|
||||
produce calendars by weeks as well as by months.
|
||||
|
||||
Bill Silvert <bill%biomel@cs.dal.ca> and Dennis Cottel
|
||||
<dennis@peanuts.nosc.mil> for suggesting many of the new features in
|
||||
REMIND.
|
||||
|
||||
Dave Wolfe <dwolfe@pffft.sps.mot.com> and Raphael Manfredi
|
||||
<ram@eiffel.com> for noticing bugs and sending me fixes.
|
||||
|
||||
Dave Rickel and George M. Sipe for sample reminders and holidays.
|
||||
|
||||
Michael Salmon for ISO encoding of PostScript output.
|
||||
|
||||
Darrel Hankerson for helping me provide some OS/2 support. Sorry
|
||||
it's not complete, Darrel!
|
||||
|
||||
Phillipp Slusallek for suggesting the -k option.
|
||||
|
||||
Amos Shapir, David W. Tamkin and Frank Yellin for help with the Hebrew
|
||||
calendar.
|
||||
|
||||
All of the language translators whose names are listed in lang.h
|
||||
|
||||
Mark Harrison and Michael McLennan for the excellent book
|
||||
"Effective Tcl/Tk Programming". This is where I stole the source
|
||||
for Tcl/Tk tabbed notebooks, and is an excellent reference book.
|
||||
Thanks also to Lucent Technologies and Addison Wesley Longman for
|
||||
making it legal to steal the code.
|
||||
|
||||
All others who have corresponded with me to report bugs, express
|
||||
appreciation or suggest features - too many people to list here.
|
||||
|
||||
Finally, all those who donated money to support the production of
|
||||
REMIND. Your donations were gratefully appreciated.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca> <aa775@freenet.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
|
||||
14
COPYRIGHT
14
COPYRIGHT
@@ -1,11 +1,10 @@
|
||||
$Id: COPYRIGHT,v 1.11 1999-04-05 17:34:27 dfs Exp $
|
||||
THE REMIND COPYRIGHT
|
||||
|
||||
1. REMIND refers to the entire set of files and documentation in the
|
||||
REMIND package.
|
||||
|
||||
2. REMIND is Copyright 1999 by Roaring Penguin Software Inc.,
|
||||
except where noted in individual files.
|
||||
2. REMIND is Copyright 1992-2020 Dianne Skoll, except where noted in
|
||||
individual files.
|
||||
|
||||
3. DISTRIBUTION AND USE
|
||||
|
||||
@@ -294,11 +293,8 @@ POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
--
|
||||
David F. Skoll <dskoll@iname.com>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
Dianne Skoll <dianne@skoll.ca>
|
||||
|
||||
https://dianne.skoll.ca/projects/remind
|
||||
|
||||
Tel. (613) 225-8687
|
||||
http://www.roaringpenguin.com
|
||||
|
||||
|
||||
30
MICROSOFT-AND-APPLE
Normal file
30
MICROSOFT-AND-APPLE
Normal file
@@ -0,0 +1,30 @@
|
||||
MICROSOFT WINDOWS
|
||||
=================
|
||||
|
||||
I used to prohibit porting Remind to Microsoft Windows. However, this
|
||||
may cause problems with the GPL, so I have removed that restriction.
|
||||
|
||||
Although I cannot prevent you from porting Remind to Windows, I appeal
|
||||
to you not to do it. I am trying to encourage the growth of free
|
||||
software, not proprietary software.
|
||||
|
||||
If you port Remind to Windows, I will not provide support or answers to
|
||||
questions -- you're on your own. On the other hand, I will feel no guilt
|
||||
in taking enhancements and merging them into the UNIX stream.
|
||||
|
||||
APPLE
|
||||
=====
|
||||
|
||||
I can't prevent you from using Remind on Apple's products, but I hope
|
||||
you don't. Apple's corporate culture is the very antithesis of Free
|
||||
Software. Rather than using Mac OS X, I encourage you to switch to
|
||||
Linux or FreeBSD, two Free Software operating systems that are every
|
||||
bit as capable as Mac OS X and which are unencumbered by Apple's
|
||||
arbitrary restrictions.
|
||||
|
||||
And if you're looking to port Remind to other Apple products like the
|
||||
iPhone or iPad, please don't. Those products enforce Apple's rigorous
|
||||
controls much more stringently than Mac OS X on an Apple PC.
|
||||
|
||||
--
|
||||
Dianne Skoll
|
||||
16
Makefile
16
Makefile
@@ -1,7 +1,5 @@
|
||||
# Top-level Makefile for Remind.
|
||||
|
||||
# $Id: Makefile,v 1.28 1998-05-06 01:51:12 dfs Exp $
|
||||
|
||||
all: src/Makefile
|
||||
@echo ""
|
||||
@echo "*******************"
|
||||
@@ -10,7 +8,7 @@ all: src/Makefile
|
||||
@echo "* *"
|
||||
@echo "*******************"
|
||||
@echo ""
|
||||
@cd src; $(MAKE) all LANGDEF=$(LANGDEF)
|
||||
@cd src && $(MAKE) all LANGDEF=$(LANGDEF)
|
||||
|
||||
install:
|
||||
@echo ""
|
||||
@@ -20,14 +18,20 @@ install:
|
||||
@echo "* *"
|
||||
@echo "*********************"
|
||||
@echo ""
|
||||
cd src; $(MAKE) install
|
||||
@cd src && $(MAKE) install
|
||||
|
||||
clean:
|
||||
find . -name '*~' -exec rm {} \;
|
||||
cd src; $(MAKE) clean
|
||||
cd src && $(MAKE) clean
|
||||
|
||||
test:
|
||||
@cd src && $(MAKE) -s test
|
||||
|
||||
distclean: clean
|
||||
rm -f config.cache config.log config.status src/Makefile src/config.h
|
||||
rm -f config.cache config.log config.status src/Makefile src/config.h tests/test.out www/Makefile
|
||||
|
||||
src/Makefile: src/Makefile.in
|
||||
./configure
|
||||
|
||||
# DO NOT DELETE
|
||||
|
||||
|
||||
10
README
10
README
@@ -27,8 +27,12 @@ If you do NOT have Tcl/Tk or are NOT running X Windows:
|
||||
|
||||
2) Edit the file "src/lang.h" to choose a language.
|
||||
|
||||
3) Type: "make"
|
||||
3) Type: "./configure" (You can supply options; type "./configure --help"
|
||||
for details.)
|
||||
|
||||
4) Type: "make install" -- you may need to be root to do this.
|
||||
4) Type: "make"
|
||||
|
||||
$Id: README,v 1.4 1998-01-19 03:24:03 dfs Exp $
|
||||
5) Type: "make install" -- you may need to be root to do this.
|
||||
|
||||
Contact info: mailto:dianne@skoll.ca
|
||||
Home page: https://dianne.skoll.ca/projects/remind/
|
||||
|
||||
17
WINDOWS
17
WINDOWS
@@ -1,17 +0,0 @@
|
||||
$Id: WINDOWS,v 1.1 1999-04-05 17:34:28 dfs Exp $
|
||||
|
||||
MICROSOFT WINDOWS
|
||||
|
||||
I used to prohibit porting Remind to Microsoft Windows. However, this
|
||||
may cause problems with the GPL, so I have removed that restriction.
|
||||
|
||||
Although I cannot prevent you from porting Remind to Windows, I appeal
|
||||
to you not to do it. I am trying to encourage the growth of free
|
||||
software, not proprietary software.
|
||||
|
||||
If you port Remind to Windows, I will not provide support or answers to
|
||||
questions -- you're on your own. On the other hand, I will feel no guilt
|
||||
in taking enhancements and merging them into the UNIX stream.
|
||||
|
||||
--
|
||||
David F. Skoll.
|
||||
56
configure.in
56
configure.in
@@ -1,7 +1,6 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl $Id: configure.in,v 1.5 1998-02-16 03:41:39 dfs Exp $
|
||||
|
||||
AC_INIT(src/amiga.c)
|
||||
AC_INIT(src/queue.c)
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
@@ -15,6 +14,36 @@ EOF
|
||||
|
||||
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.
|
||||
AC_PROG_CC
|
||||
AC_PROG_INSTALL
|
||||
@@ -26,21 +55,26 @@ dnl Replace `main' with a function in -lm:
|
||||
|
||||
AC_CHECK_LIB(m, sqrt)
|
||||
|
||||
dnl Integer sizes
|
||||
AC_CHECK_SIZEOF(unsigned short)
|
||||
AC_CHECK_SIZEOF(unsigned int)
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(sys/file.h sys/time.h sys/types.h unistd.h malloc.h stdarg.h stdlib.h pwd.h)
|
||||
AC_CHECK_HEADERS(sys/file.h glob.h wctype.h locale.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_STRUCT_TM
|
||||
|
||||
dnl Checks for library functions.
|
||||
AC_TYPE_SIGNAL
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_UID_T
|
||||
AC_FUNC_UTIME_NULL
|
||||
AC_HEADER_TIME
|
||||
AC_FUNC_VPRINTF
|
||||
AC_CHECK_FUNCS(mktime putenv strstr timegm difftime)
|
||||
|
||||
AC_OUTPUT(src/Makefile)
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale)
|
||||
VERSION=03.03.05
|
||||
AC_SUBST(VERSION)
|
||||
AC_OUTPUT(src/Makefile www/Makefile src/version.h)
|
||||
|
||||
9
contrib/README
Normal file
9
contrib/README
Normal file
@@ -0,0 +1,9 @@
|
||||
This directory contains contributed scripts. They are provided
|
||||
"as-is" with no warranty. Please do not contact Dianne Skoll for help
|
||||
with these scripts; instead, contact the script authors.
|
||||
|
||||
You should check the upstream sources; there may be newer versions
|
||||
of these scripts available.
|
||||
|
||||
--
|
||||
Dianne Skoll
|
||||
279
contrib/ical2rem.pl
Executable file
279
contrib/ical2rem.pl
Executable file
@@ -0,0 +1,279 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# ical2rem.pl -
|
||||
# Reads iCal files and outputs remind-compatible files. Tested ONLY with
|
||||
# calendar files created by Mozilla Calendar/Sunbird. Use at your own risk.
|
||||
# Copyright (c) 2005, 2007, Justin B. Alcorn
|
||||
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
#
|
||||
#
|
||||
# version 0.5.2 2007-03-23
|
||||
# - BUG: leadtime for recurring events had a max of 4 instead of DEFAULT_LEAD_TIME
|
||||
# - remove project-lead-time, since Category was a non-standard attribute
|
||||
# - NOTE: There is a bug in iCal::Parser v1.14 that causes multiple calendars to
|
||||
# fail if a calendar with recurring events is followed by a calendar with no
|
||||
# recurring events. This has been reported to the iCal::Parser author.
|
||||
# version 0.5.1 2007-03-21
|
||||
# - BUG: Handle multiple calendars on STDIN
|
||||
# - add --heading option for priority on section headers
|
||||
# version 0.5 2007-03-21
|
||||
# - Add more help options
|
||||
# - --project-lead-time option
|
||||
# - Supress printing of heading if there are no todos to print
|
||||
# version 0.4
|
||||
# - Version 0.4 changes all written or inspired by, and thanks to Mark Stosberg
|
||||
# - Change to GetOptions
|
||||
# - Change to pipe
|
||||
# - Add --label, --help options
|
||||
# - Add Help Text
|
||||
# - Change to subroutines
|
||||
# - Efficiency and Cleanup
|
||||
# version 0.3
|
||||
# - Convert to GPL (Thanks to Mark Stosberg)
|
||||
# - Add usage
|
||||
# version 0.2
|
||||
# - add command line switches
|
||||
# - add debug code
|
||||
# - add SCHED _sfun keyword
|
||||
# - fix typos
|
||||
# version 0.1 - ALPHA CODE.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
cat /path/to/file*.ics | ical2rem.pl > ~/.ical2rem
|
||||
|
||||
All options have reasonable defaults:
|
||||
--label Calendar name (Default: Calendar)
|
||||
--lead-time Advance days to start reminders (Default: 3)
|
||||
--todos, --no-todos Process Todos? (Default: Yes)
|
||||
--heading Define a priority for static entries
|
||||
--help Usage
|
||||
--man Complete man page
|
||||
|
||||
Expects an ICAL stream on STDIN. Converts it to the format
|
||||
used by the C<remind> script and prints it to STDOUT.
|
||||
|
||||
=head2 --label
|
||||
|
||||
ical2rem.pl --label "Bob's Calendar"
|
||||
|
||||
The syntax generated includes a label for the calendar parsed.
|
||||
By default this is "Calendar". You can customize this with
|
||||
the "--label" option.
|
||||
|
||||
=head2 --lead-time
|
||||
|
||||
ical2rem.pl --lead-time 3
|
||||
|
||||
How may days in advance to start getting reminders about the events. Defaults to 3.
|
||||
|
||||
=head2 --no-todos
|
||||
|
||||
ical2rem.pl --no-todos
|
||||
|
||||
If you don't care about the ToDos the calendar, this will surpress
|
||||
printing of the ToDo heading, as well as skipping ToDo processing.
|
||||
|
||||
=head2 --heading
|
||||
|
||||
ical2rem.pl --heading "PRIORITY 9999"
|
||||
|
||||
Set an option on static messages output. Using priorities can made the static messages look different from
|
||||
the calendar entries. See the file defs.rem from the remind distribution for more information.
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use iCal::Parser;
|
||||
use DateTime;
|
||||
use Getopt::Long 2.24 qw':config auto_help';
|
||||
use Pod::Usage;
|
||||
use Data::Dumper;
|
||||
use vars '$VERSION';
|
||||
$VERSION = "0.5.2";
|
||||
|
||||
# Declare how many days in advance to remind
|
||||
my $DEFAULT_LEAD_TIME = 3;
|
||||
my $PROCESS_TODOS = 1;
|
||||
my $HEADING = "";
|
||||
my $help;
|
||||
my $man;
|
||||
|
||||
my $label = 'Calendar';
|
||||
GetOptions (
|
||||
"label=s" => \$label,
|
||||
"lead-time=i" => \$DEFAULT_LEAD_TIME,
|
||||
"todos!" => \$PROCESS_TODOS,
|
||||
"heading=s" => \$HEADING,
|
||||
"help|?" => \$help,
|
||||
"man" => \$man
|
||||
);
|
||||
pod2usage(1) if $help;
|
||||
pod2usage(-verbose => 2) if $man;
|
||||
|
||||
my $month = ['None','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
|
||||
|
||||
my @calendars;
|
||||
my $in;
|
||||
|
||||
while (<>) {
|
||||
$in .= $_;
|
||||
if (/END:VCALENDAR/) {
|
||||
push(@calendars,$in);
|
||||
$in = "";
|
||||
}
|
||||
}
|
||||
my $parser = iCal::Parser->new();
|
||||
my $hash = $parser->parse_strings(@calendars);
|
||||
|
||||
##############################################################
|
||||
#
|
||||
# Subroutines
|
||||
#
|
||||
#############################################################
|
||||
#
|
||||
# _process_todos()
|
||||
# expects 'todos' hashref from iCal::Parser is input
|
||||
# returns String to output
|
||||
sub _process_todos {
|
||||
my $todos = shift;
|
||||
|
||||
my ($todo, @newtodos, $leadtime);
|
||||
my $output = "";
|
||||
|
||||
$output .= 'REM '.$HEADING.' MSG '.$label.' ToDos:%"%"%'."\n";
|
||||
|
||||
# For sorting, make sure everything's got something
|
||||
# To sort on.
|
||||
my $now = DateTime->now;
|
||||
for $todo (@{$todos}) {
|
||||
# remove completed items
|
||||
if ($todo->{'STATUS'} && $todo->{'STATUS'} eq 'COMPLETED') {
|
||||
next;
|
||||
} elsif ($todo->{'DUE'}) {
|
||||
# All we need is a due date, everything else is sugar
|
||||
$todo->{'SORT'} = $todo->{'DUE'}->clone;
|
||||
} elsif ($todo->{'DTSTART'}) {
|
||||
# for sorting, sort on start date if there's no due date
|
||||
$todo->{'SORT'} = $todo->{'DTSTART'}->clone;
|
||||
} else {
|
||||
# if there's no due or start date, just make it now.
|
||||
$todo->{'SORT'} = $now;
|
||||
}
|
||||
push(@newtodos,$todo);
|
||||
}
|
||||
if (! (scalar @newtodos)) {
|
||||
return "";
|
||||
}
|
||||
# Now sort on the new Due dates and print them out.
|
||||
for $todo (sort { DateTime->compare($a->{'SORT'}, $b->{'SORT'}) } @newtodos) {
|
||||
my $due = $todo->{'SORT'}->clone();
|
||||
my $priority = "";
|
||||
if (defined($todo->{'PRIORITY'})) {
|
||||
if ($todo->{'PRIORITY'} == 1) {
|
||||
$priority = "PRIORITY 1000";
|
||||
} elsif ($todo->{'PRIORITY'} == 3) {
|
||||
$priority = "PRIORITY 7500";
|
||||
}
|
||||
}
|
||||
if (defined($todo->{'DTSTART'}) && defined($todo->{'DUE'})) {
|
||||
# Lead time is duration of task + lead time
|
||||
my $diff = ($todo->{'DUE'}->delta_days($todo->{'DTSTART'})->days())+$DEFAULT_LEAD_TIME;
|
||||
$leadtime = "+".$diff;
|
||||
} else {
|
||||
$leadtime = "+".$DEFAULT_LEAD_TIME;
|
||||
}
|
||||
$output .= "REM ".$due->month_abbr." ".$due->day." ".$due->year." $leadtime $priority MSG \%a $todo->{'SUMMARY'}\%\"\%\"\%\n";
|
||||
}
|
||||
$output .= 'REM '.$HEADING.' MSG %"%"%'."\n";
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
#######################################################################
|
||||
#
|
||||
# Main Program
|
||||
#
|
||||
######################################################################
|
||||
|
||||
print _process_todos($hash->{'todos'}) if $PROCESS_TODOS;
|
||||
|
||||
my ($leadtime, $yearkey, $monkey, $daykey,$uid,%eventsbyuid);
|
||||
print 'REM '.$HEADING.' MSG '.$label.' Events:%"%"%'."\n";
|
||||
my $events = $hash->{'events'};
|
||||
foreach $yearkey (sort keys %{$events} ) {
|
||||
my $yearevents = $events->{$yearkey};
|
||||
foreach $monkey (sort {$a <=> $b} keys %{$yearevents}){
|
||||
my $monevents = $yearevents->{$monkey};
|
||||
foreach $daykey (sort {$a <=> $b} keys %{$monevents} ) {
|
||||
my $dayevents = $monevents->{$daykey};
|
||||
foreach $uid (sort {
|
||||
DateTime->compare($dayevents->{$a}->{'DTSTART'}, $dayevents->{$b}->{'DTSTART'})
|
||||
} keys %{$dayevents}) {
|
||||
my $event = $dayevents->{$uid};
|
||||
if ($eventsbyuid{$uid}) {
|
||||
my $curreventday = $event->{'DTSTART'}->clone;
|
||||
$curreventday->truncate( to => 'day' );
|
||||
$eventsbyuid{$uid}{$curreventday->epoch()} =1;
|
||||
for (my $i = 0;$i < $DEFAULT_LEAD_TIME && !defined($event->{'LEADTIME'});$i++) {
|
||||
if ($eventsbyuid{$uid}{$curreventday->subtract( days => $i+1 )->epoch() }) {
|
||||
$event->{'LEADTIME'} = $i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$eventsbyuid{$uid} = $event;
|
||||
my $curreventday = $event->{'DTSTART'}->clone;
|
||||
$curreventday->truncate( to => 'day' );
|
||||
$eventsbyuid{$uid}{$curreventday->epoch()} =1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach $yearkey (sort keys %{$events} ) {
|
||||
my $yearevents = $events->{$yearkey};
|
||||
foreach $monkey (sort {$a <=> $b} keys %{$yearevents}){
|
||||
my $monevents = $yearevents->{$monkey};
|
||||
foreach $daykey (sort {$a <=> $b} keys %{$monevents} ) {
|
||||
my $dayevents = $monevents->{$daykey};
|
||||
foreach $uid (sort {
|
||||
DateTime->compare($dayevents->{$a}->{'DTSTART'}, $dayevents->{$b}->{'DTSTART'})
|
||||
} keys %{$dayevents}) {
|
||||
my $event = $dayevents->{$uid};
|
||||
if (exists($event->{'LEADTIME'})) {
|
||||
$leadtime = "+".$event->{'LEADTIME'};
|
||||
} else {
|
||||
$leadtime = "+".$DEFAULT_LEAD_TIME;
|
||||
}
|
||||
my $start = $event->{'DTSTART'};
|
||||
print "REM ".$start->month_abbr." ".$start->day." ".$start->year." $leadtime ";
|
||||
if ($start->hour > 0) {
|
||||
print " AT ";
|
||||
print $start->strftime("%H:%M");
|
||||
print " SCHED _sfun MSG %a %2 ";
|
||||
} else {
|
||||
print " MSG %a ";
|
||||
}
|
||||
print "%\"$event->{'SUMMARY'}";
|
||||
print " at $event->{'LOCATION'}" if $event->{'LOCATION'};
|
||||
print "\%\"%\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exit 0;
|
||||
#:vim set ft=perl ts=4 sts=4 expandtab :
|
||||
13
contrib/rem2ics-0.93/Makefile
Normal file
13
contrib/rem2ics-0.93/Makefile
Normal file
@@ -0,0 +1,13 @@
|
||||
DESTDIR?=
|
||||
PREFIX?=/usr
|
||||
BINDIR?=$(PREFIX)/bin
|
||||
MANDIR?=$(PREFIX)/share/man
|
||||
|
||||
default: rem2ics.1
|
||||
|
||||
rem2ics.1:
|
||||
pod2man -c "" rem2ics > rem2ics.1
|
||||
|
||||
install: rem2ics.1
|
||||
install -p -D rem2ics $(DESTDIR)$(BINDIR)/rem2ics
|
||||
install -p -D -m 0644 rem2ics.1 $(DESTDIR)$(MANDIR)/man1/rem2ics.1
|
||||
847
contrib/rem2ics-0.93/rem2ics
Executable file
847
contrib/rem2ics-0.93/rem2ics
Executable file
@@ -0,0 +1,847 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# rem2ics -- convert the output of "remind -s" into RFC2445 iCalendar format.
|
||||
|
||||
# Copyright 2007,2008,2009
|
||||
# Mark Atwood <me@mark.atwood.name>
|
||||
# Paul Hinze <paul dot t dot hinze at gmail dot com>
|
||||
# Michael Schultz <mjschultz at gmail dot com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the
|
||||
# Free Software Foundation, Inc.
|
||||
# 51 Franklin Street, Fifth Floor
|
||||
# Boston MA 02110-1301 USA
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
rem2ics - convert the output of "remind -s" into RFC2445 iCalendar format.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
TZ=I<timezone> B<rem2ics> [B<-man>] [B<-do>] [B<-norecur>] [B<-usetag>] E<lt>input E<gt>output
|
||||
|
||||
=head1 OPTIONS AND ARGUMENTS
|
||||
|
||||
=over 8
|
||||
|
||||
=item B<-man>
|
||||
|
||||
Print the manual page and exit.
|
||||
|
||||
=item B<-do>
|
||||
|
||||
Actually do the conversion. Otherwise just print a brief help message
|
||||
and usage example, and then exit.
|
||||
|
||||
=item B<-norecur>
|
||||
|
||||
Do not attempt to detect and fold together recurring events.
|
||||
|
||||
=item B<-usetag>
|
||||
|
||||
Generate UIDs using remind TAG clauses.
|
||||
|
||||
=back
|
||||
|
||||
Input is from standard input
|
||||
|
||||
Output is to standard output.
|
||||
|
||||
=head1 USAGE
|
||||
|
||||
remind -s360 -irem2ics=1 ~/.reminders 1 Jan 1991 | TZ=PST8PDT rem2ics -do >reminders.ics
|
||||
|
||||
This tells B<remind> to use ~/.reminders, and to process the entire
|
||||
range of dates it can handle (from Jan 1 1991 to Dec 31 2020), and to
|
||||
define a variable named C<rem2ics>, which can be used in
|
||||
C<IF !defined("rem2ics")> / C<ENDIF> pairs.
|
||||
B<rem2ics> will use a timezone of PST8PDT, and will fold events that
|
||||
have the same name and duration into a single iCalendar VEVENT object.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
=head2 Timezones and the TZ environment variable.
|
||||
|
||||
B<rem2ics> uses the TZ environment variable to determine the value of
|
||||
the RFC2445 TZID property. If you are running on a Linux or other GNU
|
||||
libc based system, you probably don't (and probably shouldn't)
|
||||
normally have TZ set. You can confirm this by running C<printenv TZ>
|
||||
at a shell prompt. If your remind data is in your "local time", and
|
||||
it probably is, you should probably set TZ to a good name for your
|
||||
local timezone just for the run of this script. You probably should
|
||||
NOT set TZ in your login scripts.
|
||||
|
||||
You can use TZ like this:
|
||||
|
||||
remind -s ~/.reminders | TZ=PST8PDT rem2ics -do >reminders.ics
|
||||
|
||||
or
|
||||
|
||||
remind -s ~/.reminders | TZ=US/Pacific rem2ics -do >reminders.ics
|
||||
|
||||
|
||||
If, for some reason, your remind files are all in GMT instead of
|
||||
localtime (you smart person you!), you can do this:
|
||||
|
||||
remind -s ~/.reminders | TZ=GMT rem2ics -do >reminders.ics
|
||||
|
||||
or
|
||||
|
||||
remind -s ~/.reminders | TZ=0 rem2ics -do >reminders.ics
|
||||
|
||||
and B<rem2ics> will use the ISO8601 "Z" notation for GMT time in the ics
|
||||
file. (Other synonyms for GMT are the empty string (not the same as
|
||||
the TZ not set), "I<0>", "I<Z>", "I<Zulu>", "I<Greenwitch>", "I<GMT>",
|
||||
"I<GMT+0>, and "I<GMT-0>".)
|
||||
|
||||
If you leave TZ undefined and unset, B<rem2ics> will use the ISO8601
|
||||
"T" notation date strings with no TZID property, which RFC2445 calls a
|
||||
"floating time". Who knows, it might work for you!
|
||||
|
||||
The TZ string value is literally incorporated into the iCalendar
|
||||
stream, so whatever your iCalendar-using application needs is what you
|
||||
should use. You may have to experiment a bit.
|
||||
|
||||
You can look around in C</usr/share/zoneinfo> to get the names of
|
||||
every timezone anywhere. This is the "Olson database" that RFC2445
|
||||
refers to. Read the man page for L<tzfile(5)> for more than you ever
|
||||
wanted to know about the format of these files, and about GNU libc's
|
||||
handling of timezones. As complex as it is, it's certainly better
|
||||
than what POSIX defines or what most legacy UNIX systems do, and most
|
||||
certainly better than Microsoft, who in their "cutting edge" "state of
|
||||
the art" "server" OS, still hasn't figured out that daylight time
|
||||
rules might be different in different years.
|
||||
|
||||
If you just ran B<rem2ics> without reading all this stuff, or if you
|
||||
don't want to worry about it at all, and somehow your iCalendar
|
||||
application manager is able to guess the proper timezone for you, just
|
||||
leave TZ undefined, and B<rem2ics> will use the ISO8601 "T" notation
|
||||
date strings with no TZID property, which RFC2445 calls a "floating
|
||||
time". Who knows, it might work for you!
|
||||
|
||||
=head2 Detecting recurring events
|
||||
|
||||
B<rem2ics> tries to detect recurring events. If any multiple events
|
||||
appear with exactly the text and exactly the same duration (including
|
||||
"no duration"), instead of multiple VEVENT objects, there will be just
|
||||
one VEVENT object, that will have a RFC2445 C<RDATE> property.
|
||||
|
||||
B<rem2ics> is not yet smart enough to derive an C<RRULE> based
|
||||
recurrance. If you really want that feature, either implement it and
|
||||
send in a patch, or contact the author and convince him to do it.
|
||||
|
||||
=head2 Other iCalendar Properties
|
||||
|
||||
B<rem2ics> does not generate C<DESCRIPTION> or C<LOCATION>. One
|
||||
would have to heuristically parse them out of the text, and everyone
|
||||
uses a idiosyncratic way of putting things in B<remind>.
|
||||
|
||||
If the B<-usetag> option is not used or no C<TAG> is set for a
|
||||
reminder, B<rem2ics> will synthesize C<UID> properties for each
|
||||
VEVENT, but the UIDs will be different (and unique) for each run of
|
||||
B<rem2ics>. If you run rem2ics twice and import the two resulting ICS
|
||||
streams into your new scheduling program, your appointments will
|
||||
appear twice. If, however, you have set C<TAG> clauses in your
|
||||
reminders and activated B<-usetag>, these will be used. The same
|
||||
applies for tags synthesized by B<remind>'s B<-y> option. Hence, it
|
||||
is more useful to use the B<-y> option than to let B<rem2ics>
|
||||
synthesize UIDs, because the UIDs will stay the same across multiple
|
||||
runs.
|
||||
|
||||
=head2 Other iCalendar Perl objects
|
||||
|
||||
Why does't B<rem2ics> use any of the iCalendar Perl stuff in CPAN?
|
||||
Because I don't trust them, and they are too big for this app. One
|
||||
links to a binary library. Another hasn't been maintained since 1991,
|
||||
and is full of notes as to how buggy and incomplete it is. And so
|
||||
forth. I am not at this moment interested in groveling around in
|
||||
L<Net::iCal>, L<DateTime::Format::iCal>, L<Tie::iCal>,
|
||||
L<iCal::Parser>, or C<libical>.
|
||||
|
||||
=head2 Previous implementation
|
||||
|
||||
There is a working quick & dirty rem2ics written in awk
|
||||
by Anthony J. Chivetta E<lt>achivetta@gmail.comE<gt>.
|
||||
|
||||
But it has the following problems: it doesn't escape the text, it
|
||||
doesn't handle events that cross over midnight, it doesn't do
|
||||
timezones, it doesn't enforce the correct EOL sequence, and it doesn't
|
||||
fold long lines. This is a replacement for that script.
|
||||
|
||||
=head1 TODO
|
||||
|
||||
If TZ not set, grab out of system config somewhere
|
||||
Detect recurring events.
|
||||
If I'm REALLY smart, derive RRULE
|
||||
Handle characters not in US-ASCII. Latin1? UTF8?
|
||||
|
||||
=head1 VERSION HISTORY
|
||||
|
||||
=over 8
|
||||
|
||||
=item version 0.1 2007-02-08
|
||||
|
||||
First cut.
|
||||
|
||||
=item version 0.2 2007-02-09
|
||||
|
||||
Reorg into multipass over a data structure.
|
||||
|
||||
=item version 0.3 2007-02-10
|
||||
|
||||
Collapse repeating events. Fold output lines.
|
||||
|
||||
=item version 0.9 2007-02-11
|
||||
|
||||
POD. Command line options. First public release.
|
||||
|
||||
=item version 0.91 2007-02-14
|
||||
|
||||
Bug fix, error message for non-recurring events
|
||||
|
||||
=item version 0.92 2008-01-28
|
||||
|
||||
Bug fix,
|
||||
rem2ics 0.91 chokes on timed reminders with
|
||||
duration using `remind -s` as it functions in remind-03.01.03.
|
||||
Remind 3.01 changed how the -s data is formated for events that have a duration
|
||||
Patch by Paul Hinze E<lt>paul dot t dot hinze at gmail dot comE<gt>
|
||||
and Michael Schultz E<lt>mjschultz at gmail dot comE<gt>
|
||||
|
||||
=item version 0.93 2009-06-25
|
||||
|
||||
Add B<-usetag> option to allow for UIDs to stay the same across multiple runs
|
||||
by using the remind TAG clause.
|
||||
Patch by Tim Weber E<lt>scy at scytale dot nameE<gt>
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<http://mark.atwood.name/code/rem2ics>
|
||||
|
||||
L<http://en.wikipedia.org/wiki/ICalendar>
|
||||
|
||||
L<http://tools.ietf.org/html/rfc2445>
|
||||
|
||||
L<https://dianne.skoll.ca/projects/remind/>
|
||||
|
||||
L<remind(1)>
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Copyright 2007,2008,2009 by Mark Atwood E<lt>me+rem2ics@mark.atwood.nameE<gt>. L<http://mark.atwood.name/>.
|
||||
|
||||
Please report bugs (with patches, if possible).
|
||||
|
||||
Inspired by Anthony J. Chivetta E<lt>achivetta@gmail.comE<gt>'s
|
||||
rem2ics in awk.
|
||||
|
||||
Thank you to Dianne Skoll E<lt>dianne@skoll.ca<gt> for Remind,
|
||||
and to the IETF calsch wg for the iCalendar specification.
|
||||
|
||||
=cut
|
||||
|
||||
use Getopt::Long;
|
||||
use Pod::Usage;
|
||||
|
||||
my $app_name = "rem2ics";
|
||||
my $app_version = "0.93";
|
||||
|
||||
# process the command line
|
||||
my %options;
|
||||
GetOptions(\%options, qw(man do norecurr usetag)) || pod2usage(2);
|
||||
pod2usage(-verbose => 2) if ($options{man});
|
||||
|
||||
unless ($options{do}) {
|
||||
print STDERR "Run \"$0 -man\" for information and usage examples.\n"
|
||||
. "Pay special attention to information about timezone.\n";
|
||||
exit(99);
|
||||
}
|
||||
|
||||
# grab the hostname
|
||||
# this is used as part of the UID property of each VEVENT
|
||||
my $ical_uid_hostname = $ENV{'HOSTNAME'};
|
||||
unless ($ical_uid_hostname) {
|
||||
print STDERR "Warning! "
|
||||
. "The environment variable HOSTNAME was not properly set.\n"
|
||||
. "Will use \"localhost\" in the RFC2445 UID property\n";
|
||||
$ical_uid_hostname = "localhost";
|
||||
}
|
||||
|
||||
# look for the TZ
|
||||
my $ical_tzid = undef;
|
||||
if (exists $ENV{'TZ'}) {
|
||||
$ical_tzid = $ENV{'TZ'};
|
||||
my %synonyms_for_gmt = (
|
||||
'' => 1, '0' => 1, 'z' => 1, 'zulu' => 1, 'greenwitch' => 1,
|
||||
'gmt' => 1, 'gmt+0' => 1, 'gmt-0' => 1, );
|
||||
if (exists $synonyms_for_gmt{lc($ical_tzid)}) {
|
||||
$ical_tzid = ''; # empty means GMT, below
|
||||
}
|
||||
} else {
|
||||
# leave it undefined, that has a meaning below
|
||||
}
|
||||
|
||||
# RFC2445 DTSTAMP property will be the time we started running ($^T)
|
||||
my ($ical_dtstamp);
|
||||
{
|
||||
my @gt = gmtime($^T);
|
||||
$ical_dtstamp = sprintf("%04d%02d%02dZ%02d%02d%02dZ",
|
||||
1900+$gt[5], $gt[4]+1, $gt[3],
|
||||
$gt[2], $gt[1], $gt[0]);
|
||||
}
|
||||
|
||||
my ($cnt, $v, @events);
|
||||
|
||||
$cnt = 0;
|
||||
foreach (<STDIN>) {
|
||||
$cnt++;
|
||||
|
||||
s/#.*//; # toss comments
|
||||
next if /^\s*$/; # skip blank lines
|
||||
chomp;
|
||||
|
||||
$v = undef;
|
||||
|
||||
# store the raw line
|
||||
$v->{src} = $_;
|
||||
$v->{cnt} = $cnt;
|
||||
|
||||
# split and parse the line
|
||||
# if we don't like it, skip it and go around again
|
||||
|
||||
# sf[0] = date, in yyyy/mm/dd format
|
||||
# sf[1] = special, usually "*"
|
||||
# sf[2] = tag, usually "*"
|
||||
# sf[3] = duration, in minutes
|
||||
# sf[4] = time, since midnight, in minutes
|
||||
# sf[5] = text
|
||||
|
||||
my @sf = split(' ', $_, 6);
|
||||
next unless ($sf[1] eq '*'); # ignore SPECIAL lines
|
||||
next unless (($sf[3] eq '*') or ($sf[3] =~ m/\d+/));
|
||||
next unless (($sf[4] eq '*') or ($sf[4] =~ m/\d+/));
|
||||
next unless (length($sf[5]) > 0);
|
||||
|
||||
my @dt = split('/', $sf[0], 3);
|
||||
next unless ($dt[0] =~ m/^\d{4}$/); # year
|
||||
next unless ($dt[1] =~ m/^\d{2}$/); # month
|
||||
next unless ($dt[2] =~ m/^\d{2}$/); # day
|
||||
|
||||
if ($sf[4] ne "*") { # a time was given
|
||||
# When an event has a time, remind -s "helpfully" also
|
||||
# puts it as text at the start of the text portion.
|
||||
# This takes the following form:
|
||||
# ##:##[a|p]m <rest of MSG>
|
||||
# or, if the event has a duration:
|
||||
# ##:##[a|p]m-##:##[a|p]m <rest of MSG>
|
||||
# Rather than a nasty regex, just splitting at the
|
||||
# first space does the trick.
|
||||
my($extra_time, $textmsg) = split(' ', $sf[5], 2);
|
||||
$sf[5] = $textmsg;
|
||||
}
|
||||
|
||||
$v->{sf} = \@sf;
|
||||
$v->{dt} = \@dt;
|
||||
|
||||
push @events, $v;
|
||||
}
|
||||
|
||||
# generate the "date time string" for each event
|
||||
foreach $v (@events) {
|
||||
if (${$v->{sf}}[4] eq "*") { # no time was given
|
||||
$v->{dts} = sprintf("%04d%02d%02d", @{$v->{dt}});
|
||||
} else { # a time was given
|
||||
my ($t_hr, $t_mn) = &idiv(${$v->{sf}}[4], 60);
|
||||
$v->{dts} = sprintf("%04d%02d%02dT%02d%02d00",
|
||||
@{$v->{dt}}, $t_hr, $t_mn);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
my(%grovel);
|
||||
|
||||
# if the user doesnt want recurrance detection
|
||||
unless ($options{norecurr}) {
|
||||
|
||||
# then dont put events in the grovel hash
|
||||
|
||||
foreach $v (@events) {
|
||||
# key is duration followed by text
|
||||
# \036 is "ASCII RS Record Separator"
|
||||
my $k = ${$v->{sf}}[3] . "\036" . ${$v->{sf}}[5];
|
||||
push @{$grovel{$k}}, $v;
|
||||
}
|
||||
|
||||
foreach my $k (keys %grovel) {
|
||||
if ((scalar @{$grovel{$k}}) > 1) {
|
||||
$v = ${$grovel{$k}}[0];
|
||||
$v->{recurlist} = \@{$grovel{$k}};
|
||||
foreach my $v0 (@{$grovel{$k}}) {
|
||||
$v0->{is_recurrance} = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# All of the individual events are in the @events array. All of the
|
||||
# unique combinations of duration/event name are the keys in the
|
||||
# %grovel hash, the elements of which are references to an arrays of
|
||||
# references to the events, in the same ordering as they we read by
|
||||
# us, which *ought* to be in datewise order. I don't know if "remind
|
||||
# -s" actually sorts into true chronological order. If it doesn't, we
|
||||
# might have a problem if a recurring event has two instances both on
|
||||
# the first day.
|
||||
|
||||
# Every event that is recurring has a "is_recurrance" property.
|
||||
# Additionally, (hopefully) the first/earliest event in a set of
|
||||
# recurrances has a "recurlist" property. The "recurlist" is a
|
||||
# reference to a list of references to each of the events. The first
|
||||
# one on that list will be the same event that has the "recurlist"
|
||||
# property. The "is_recurrance" property is a reference back to the
|
||||
# event that has the "recurlist" property.
|
||||
|
||||
foreach my $k (keys %grovel) {
|
||||
next if ((scalar @{$grovel{$k}}) <= 1);
|
||||
|
||||
my $recur_str = "";
|
||||
foreach $v (@{$grovel{$k}}) {
|
||||
if (${$v->{sf}}[4] eq "*") { # no time was given
|
||||
$recur_str .= ($v->{dts} . ",");
|
||||
} else {
|
||||
if (defined($ical_tzid)) {
|
||||
if ($ical_tzid eq '') { # tz is defined but empty, so in GMT
|
||||
$recur_str .= $v->{dts} . "Z,";
|
||||
} else { # tz is non-zero, so output the tz as well
|
||||
$recur_str .= $v->{dts} . ",";
|
||||
}
|
||||
} else { # undefined tz, just floating time
|
||||
$recur_str .= $v->{dts} . ",";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# the recur_str now has an extra comma at the end. chop it off
|
||||
chop($recur_str);
|
||||
${$grovel{$k}}[0]->{recur_str} = $recur_str;
|
||||
}
|
||||
|
||||
foreach my $k (keys %grovel) {
|
||||
next if ((scalar @{$grovel{$k}}) <= 1);
|
||||
my $v = ${$grovel{$k}}[0]; # grab the head of each list
|
||||
if (${$v->{sf}}[4] eq "*") { # no time was given
|
||||
# the default value type for an RDATE is DATE-TIME,
|
||||
# we much change the type to DATE
|
||||
$v->{i_rdate} = sprintf("RDATE;VALUE=DATE:");
|
||||
} else {
|
||||
if (defined($ical_tzid)) {
|
||||
if ($ical_tzid eq '') { # tz is defined but empty, so in GMT
|
||||
$v->{i_rdate} = sprintf("RDATE:");
|
||||
} else { # tz is non-zero, so output the tz as well
|
||||
$v->{i_rdate} = sprintf("RDATE;TZID=%s:", $ical_tzid);
|
||||
}
|
||||
} else { # undefined tz, just floating time
|
||||
$v->{i_rdate} = sprintf("RDATE:");
|
||||
}
|
||||
}
|
||||
# now stick the recur_str onto the end
|
||||
$v->{i_rdate} .= $v->{recur_str};
|
||||
# if we ever get memory tight, we can probably undef($v->{recur_str})
|
||||
}
|
||||
|
||||
foreach $v (@events) {
|
||||
# for recurrant events, skip those that arnt the "head"
|
||||
next if ($v->{is_recurrance} and (not $v->{recurlist}));
|
||||
|
||||
if (${$v->{sf}}[4] eq "*") { # no time was given
|
||||
$v->{i_dtstart} = sprintf("DTSTART:%s", $v->{dts});
|
||||
} else {
|
||||
if (defined($ical_tzid)) {
|
||||
if ($ical_tzid eq '') { # tz is defined but empty, so in GMT
|
||||
$v->{i_dtstart} = sprintf("DTSTART:%sZ", $v->{dts});
|
||||
} else { # tz is non-zero, so output the tz as well
|
||||
$v->{i_dtstart} = sprintf("DTSTART;TZID=%s:%s",
|
||||
$ical_tzid, $v->{dts});
|
||||
}
|
||||
} else { # undefined tz, just floating time
|
||||
$v->{i_dtstart} = sprintf("DTSTART:%s", $v->{dts});
|
||||
}
|
||||
}
|
||||
|
||||
if (${$v->{sf}}[3] ne "*") { # a duration was given
|
||||
# It's convienient that RFC2445 defines DURATION, thus we
|
||||
# don't need to calculate DTEND, with awkward figuring out
|
||||
# crossing hours, days, months, year, etc. Instead we
|
||||
# will let the iCalendar consuming application worry about it.
|
||||
$v->{i_duration} = sprintf("PT%dM", ${$v->{sf}}[3]);
|
||||
}
|
||||
}
|
||||
|
||||
# output header
|
||||
print "BEGIN:VCALENDAR\015\012"
|
||||
. "VERSION:2.0\015\012"
|
||||
. "PRODID:http://mark.atwood.name/code/rem2ics"
|
||||
. " $app_name $app_version\015\012";
|
||||
|
||||
# output each vevent
|
||||
foreach $v (@events) {
|
||||
# for recurrant events, only output the "head", skip the others
|
||||
next if ($v->{is_recurrance} and (not $v->{recurlist}));
|
||||
|
||||
print "BEGIN:VEVENT\015\012";
|
||||
my $tag = ${$v->{sf}}[2];
|
||||
# if $tag is not set, fake up a UID from start time, process id & input line count
|
||||
if ($tag eq "*" || !$options{usetag}) {
|
||||
$tag = sprintf("%x.%x.%x", $^T, $$, $v->{cnt});
|
||||
}
|
||||
# add rem2ics and hostname to UID
|
||||
print &lineify(sprintf("UID:rem2ics.%s@%s",
|
||||
$tag, $ical_uid_hostname));
|
||||
print &lineify("SUMMARY:" . "ify(${$v->{sf}}[5]));
|
||||
print &lineify($v->{i_dtstart});
|
||||
print &lineify("DURATION:" . $v->{i_duration})
|
||||
if ($v->{i_duration});
|
||||
print &lineify($v->{i_rdate})
|
||||
if ($v->{i_rdate});
|
||||
print &lineify("DTSTAMP:" . $ical_dtstamp);
|
||||
print &lineify("COMMENT: generated by $app_name $app_version\\n"
|
||||
. " http://mark.atwood.name/code/rem2ics\\n"
|
||||
. " data[" . $v->{cnt} . "]=|" . "ify($v->{src}) . "|");
|
||||
print "END:VEVENT\015\012";
|
||||
}
|
||||
|
||||
# output trailer
|
||||
print "END:VCALENDAR\015\012";
|
||||
|
||||
|
||||
# integer division, return both quotient and remainder
|
||||
sub idiv {
|
||||
my $n = shift; my $d = shift;
|
||||
my $r = $n; my $q = 0;
|
||||
while ($r >= $d) {
|
||||
$r = $r - $d;
|
||||
$q = $q + 1;
|
||||
}
|
||||
return ($q, $r);
|
||||
}
|
||||
|
||||
# todo, perl5 version that defines ()*, need to specify a requires up top
|
||||
sub lineify {
|
||||
return join("\015\012 ", unpack('(A72)*', shift)) . "\015\012";
|
||||
}
|
||||
|
||||
sub quotify {
|
||||
my $s = shift;
|
||||
return $s if $s =~ m/^(\w| )*$/;
|
||||
|
||||
$s =~ s/\\/\\\\/gso;
|
||||
$s =~ s/\n/\\n/gso;
|
||||
$s =~ s/\s/ /gso;
|
||||
$s =~ s/\"/\\"/gso;
|
||||
$s =~ s/\,/\\,/gso;
|
||||
$s =~ s/\:/\\:/gso;
|
||||
$s =~ s/\;/\\;/gso;
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
__END__
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
EOF
|
||||
50
contrib/rem2ics-0.93/rem2ics.spec
Normal file
50
contrib/rem2ics-0.93/rem2ics.spec
Normal file
@@ -0,0 +1,50 @@
|
||||
Name: rem2ics
|
||||
Version: 0.93
|
||||
Release: 1%{?dist}
|
||||
Summary: Converts the output of "remind -s" into RFC2445 iCalendar format
|
||||
|
||||
Group: Applications/Productivity
|
||||
License: GPLv2+
|
||||
URL: http://mark.atwood.name/code/rem2ics/
|
||||
Source0: http://mark.atwood.name/code/rem2ics/rem2ics-%{version}.tar.gz
|
||||
Source1: rem2ics-Makefile
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: perl
|
||||
|
||||
|
||||
%description
|
||||
rem2ics converts the output of "remind -s" into RFC2445 iCalendar format.
|
||||
You may want to install remind if you install this package.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -c
|
||||
cp -a %SOURCE1 Makefile
|
||||
|
||||
|
||||
%build
|
||||
make %{?_smp_mflags}
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc
|
||||
%{_bindir}/rem2ics
|
||||
%{_mandir}/man1/rem2ics.1*
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Mar 25 2008 Till Maas <opensource till name> - 0.92-1
|
||||
- initial spec for Fedora
|
||||
56
contrib/remind-conf-mode.06/ac-remind.el
Normal file
56
contrib/remind-conf-mode.06/ac-remind.el
Normal file
@@ -0,0 +1,56 @@
|
||||
;;; setup for remind autocompletion (totally optional)
|
||||
|
||||
;; put something like
|
||||
;; (add-hook 'remind-conf-mode '(load-library "ac-remind")) in your .emacs file.
|
||||
(require 'auto-complete)
|
||||
|
||||
(define-key ac-complete-mode-map "\r" nil)
|
||||
|
||||
(defvar ac-remind-keywords
|
||||
'((candidates
|
||||
. (lambda ()
|
||||
(all-completions ac-target remind-keywords ))))
|
||||
"Source for remind-conf completion keywords.")
|
||||
|
||||
(defvar ac-remind-time-words
|
||||
'((candidates
|
||||
. (lambda ()
|
||||
(all-completions ac-target remind-time-words))))
|
||||
"Source for remind-conf time words completions.")
|
||||
|
||||
(defvar ac-remind-builtin-variables
|
||||
'((candidates
|
||||
. (lambda ()
|
||||
(all-completions ac-target remind-builtin-variables))))
|
||||
"Source for remind-conf builtin variables.")
|
||||
|
||||
(defvar ac-remind-type-keywords
|
||||
'((candidates
|
||||
. (lambda ()
|
||||
(all-completions ac-target remind-type-keywords))))
|
||||
"Source for remind-conf type keywords.")
|
||||
|
||||
(defvar ac-remind-builtin-functions
|
||||
'((candidates
|
||||
. (lambda ()
|
||||
(all-completions ac-target remind-builtin-functions))))
|
||||
"Source for remind-conf completion builtin functions.")
|
||||
|
||||
(add-hook 'remind-conf-mode-hook
|
||||
(lambda () "Makes auto-completion work in remind-conf-mode"
|
||||
(make-local-variable 'ac-sources)
|
||||
(setq ac-sources '(ac-remind-keywords
|
||||
ac-remind-builtin-variables
|
||||
ac-remind-builtin-functions
|
||||
ac-remind-type-keywords
|
||||
ac-remind-time-words
|
||||
ac-source-abbrev))
|
||||
(auto-complete-mode 1)))
|
||||
|
||||
(provide 'ac-remind)
|
||||
;; (define-skeleton ac-look
|
||||
;; ""
|
||||
;; (skeleton-read "well? ")
|
||||
;; "(when (looking-at (regexp-opt remind-" str " 'words))" \n
|
||||
;; >"(setq ac-sources '(ac-remind-" str ")))"
|
||||
;; )
|
||||
444
contrib/remind-conf-mode.06/remind-conf-mode.el
Normal file
444
contrib/remind-conf-mode.06/remind-conf-mode.el
Normal file
@@ -0,0 +1,444 @@
|
||||
;;; remind-conf-mode.el --- A mode to help configure remind.
|
||||
|
||||
;; Copyright (C) 2008 Shelagh Manton <shelagh.manton@gmail.com>
|
||||
|
||||
;; Author: Shelagh Manton <shelagh.manton@gmail.com> with help from
|
||||
;; Dianne Skoll
|
||||
;; Keywords: remind configure mode
|
||||
;; Version: .04
|
||||
|
||||
;; This program is free software; you can redistribute it and/or
|
||||
;; modify it under the terms of the GNU General Public License
|
||||
;; as published by the Free Software Foundation; either version 2
|
||||
;; of the License, or (at your option) any later version.
|
||||
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with this program; if not, write to the Free Software
|
||||
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
;; 02111-1307, USA.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Use this mode to help with the configuration of remind configuration files.
|
||||
;; Put (require 'remind-conf-mode) in your .emacs file
|
||||
;; or (autoload 'remind-conf-mode "remind-conf-mode" "Mode to help with remind files" t)
|
||||
;; also put (add-to-list 'auto-mode-alist '("\\.rem\\'" . remind-conf-mode)) and
|
||||
;; (setq auto-mode-alist
|
||||
;; (cons '(".reminders$" . remind-conf-mode) auto-mode-alist))
|
||||
;; if you want to have the mode work automatically when you open a remind configuration file.
|
||||
|
||||
;; If you want to use the auto-complete stuff, you will need to download and install the
|
||||
;; auto-complete library from http://www.cx4a.org/pub/auto-complete.el and put
|
||||
;; (require 'auto-complete) in your emacs with
|
||||
;; (add-hook 'remind-conf-mode-hook
|
||||
;; (lambda ()
|
||||
;; (make-local-variable 'ac-sources)
|
||||
;; (setq ac-sources '(ac-remind-conf ac-remind-builtin-variables ac-remind-builtin-functions))
|
||||
;; (auto-complete t)))
|
||||
;; in your .emacs file
|
||||
|
||||
;; PS. you could add ac-source-abbrev ac-source-words-in-buffer to have abbrevs and
|
||||
;; other words in buffer auto-complete too
|
||||
|
||||
;;; History:
|
||||
;; Thu, Feb 14, 2008
|
||||
;; Based mode on wpld-mode tutorial and sample-mode on emacs wiki.
|
||||
;; Ideas from mupad.el for font-lock styles.
|
||||
;; Mon, Jan 26, 2008
|
||||
;; Added rem-setup-colors to make it easy for colourised remind output.
|
||||
;; Added a demo skeleton for people to copy for easy entry of coloured remind entries.
|
||||
;; tried to hook in the auto-complete library so that all known functions and keywords can be easily entered.
|
||||
;; EXPERIMENTAL, but seems to work well here (emacs cvs).
|
||||
;; Seems to work without case folding which is nice. wonder why it didn't yesterday?
|
||||
|
||||
;;; Code:
|
||||
|
||||
|
||||
(require 'font-lock); this goes in the define-derived-mode part.
|
||||
(when (featurep 'xemacs)
|
||||
(require 'overlay)) ;I wonder if this will help with font-lock and xemacs?
|
||||
|
||||
|
||||
(defgroup remind-conf nil
|
||||
"Options for remind-conf-mode."
|
||||
:group 'remind-conf
|
||||
:prefix "remind-conf-")
|
||||
|
||||
|
||||
(defvar remind-conf-mode-hook nil
|
||||
"Hook to run in `remind-conf-mode'.")
|
||||
|
||||
;; keymap
|
||||
|
||||
(defvar remind-conf-mode-map
|
||||
(let ((remind-conf-mode-map (make-sparse-keymap)))
|
||||
remind-conf-mode-map)
|
||||
"Keymap for `remind-conf-mode'.")
|
||||
|
||||
(define-key remind-conf-mode-map "\C-cr" 'rem-skel)
|
||||
(define-key remind-conf-mode-map "\C-ct" 'rem-today)
|
||||
(define-key remind-conf-mode-map "\C-cd" 'rem-today-skel)
|
||||
(define-key remind-conf-mode-map "\C-cw" 'rem-week-away)
|
||||
(define-key remind-conf-mode-map "\C-cx" 'rem-tomorrow)
|
||||
(define-key remind-conf-mode-map "\C-ca" 'rem-days-away)
|
||||
(define-key remind-conf-mode-map "\M-j" 'remind-indent-line)
|
||||
(define-key remind-conf-mode-map (kbd "RET") 'remind-indent-line)
|
||||
(define-key remind-conf-mode-map "\C-c\C-c" 'rem-save-file)
|
||||
|
||||
;; syntax-table
|
||||
|
||||
(defvar remind-conf-syntax-table
|
||||
(let ((remind-conf-syntax-table (make-syntax-table text-mode-syntax-table)))
|
||||
(modify-syntax-entry ?\; ". 1b" remind-conf-syntax-table)
|
||||
(modify-syntax-entry ?\# ". 1b" remind-conf-syntax-table)
|
||||
(modify-syntax-entry ?\n "> b" remind-conf-syntax-table)
|
||||
;Names with _ are still one word.
|
||||
(modify-syntax-entry ?_ "w" remind-conf-syntax-table)
|
||||
(modify-syntax-entry ?. "w" remind-conf-syntax-table)
|
||||
remind-conf-syntax-table)
|
||||
"Syntax table for `remind-conf-mode'.")
|
||||
|
||||
;;; keyword sets
|
||||
|
||||
(defconst remind-keywords
|
||||
(sort
|
||||
(list "RUN" "REM" "ONCE" "SATISFY" "BEFORE" "UNSET" "OMIT"
|
||||
"OMIT" "DATE" "SKIP" "ONCE" "AFTER" "WARN" "PRIORITY" "AT" "SCHED" "IF" "ELSE" "ENDIF"
|
||||
"WARN" "UNTIL" "THROUGH" "SCANFROM" "DURATION" "TAG" "MSG" "MSF" "CAL" "SPECIAL" "IFTRIG"
|
||||
"PS" "PSFILE" "BANNER" "INCLUDE" "PUSH-OMIT-CONTEXT" "DEBUG" "DUMPVARS"
|
||||
"CLEAR-OMIT-CONTEXT" "POP-OMIT-CONTEXT" "SET" "ERRMSG" "FSET"
|
||||
"EXIT" "FLUSH" "PRESERVE" "MOON" "COLOR" "COLOUR")
|
||||
#'(lambda (a b) (> (length a) (length b)))))
|
||||
|
||||
(defconst remind-type-keywords
|
||||
(sort
|
||||
(list "INT" "STRING" "TIME" "DATE" "SHADE")
|
||||
#'(lambda (a b) (> (length a) (length b)))))
|
||||
|
||||
(defconst remind-builtin-variables
|
||||
(sort
|
||||
(list "$CalcUTC" "$CalMode" "$DefaultPrio" "$EndSent" "$EndSentIg" "$NumTrig"
|
||||
"$FirstIndent" "$FoldYear" "$FormWidth" "$MinsFromUTC" "$LatDeg" "$LatMin" "$LatSec"
|
||||
"$Location" "$LongDeg" "$LongMin" "$LongSec" "$MaxSatIter" "$SubsIndent")
|
||||
#'(lambda (a b) (> (length a) (length b)))))
|
||||
|
||||
(defconst remind-time-words
|
||||
(sort
|
||||
(list "Jan" "January" "Feb" "Mar" "Apr" "Jun" "Jul" "Aug" "Sept" "Sep" "Oct" "Nov" "Dec" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December" "Mon" "Monday" "Tue" "Tues" "Tuesday" "Wed" "Wednesday" "Thu" "Thursday" "Fri" "Friday" "Saturday" "Sat" "Sun" "Sunday")
|
||||
#'(lambda (a b) (> (length a) (length b)))))
|
||||
|
||||
(defconst remind-builtin-functions
|
||||
(sort
|
||||
(list "abs" "access" "shell" "args" "asc" "baseyr" "char" "choose" "coerce" "date"
|
||||
"dawn" "today" "day" "daysinmon" "defined" "dosubst" "dusk" "easterdate" "easter"
|
||||
"filedir" "filename" "getenv" "hour" "iif" "trigger" "index" "isdst" "isleap"
|
||||
"isomitted" "hebdate" "hebday" "hebmon" "hebyear" "language" "ord" "thisyear"
|
||||
"sunrise" "sunset" "lower" "max" "min" "minute" "mon" "moondate" "moontime"
|
||||
"moonphase" "now" "ostype" "plural" "realnow" "realtoday" "sgn" "strlen" "psshade"
|
||||
"substr" "trigdate" "trigger" "trigtime" "trigvalid" "typeof" "upper" "psmoon"
|
||||
"value" "version" "wkday" "wkdaynum" "msgprefix" "msgsuffix" "year")
|
||||
#'(lambda (a b) (> (length a) (length b)))))
|
||||
|
||||
;;; faces
|
||||
;;example of setting up special faces for a mode.
|
||||
|
||||
(defvar remind-conf-command-face 'remind-conf-command-face
|
||||
"Remind commands.")
|
||||
(defface remind-conf-command-face
|
||||
'((t :foreground "SeaGreen4" :bold t))
|
||||
"Font Lock mode face used to highlight commands."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-conf-keyword-face 'remind-conf-keyword-face
|
||||
"Remind keywords.")
|
||||
(defface remind-conf-keyword-face
|
||||
'((t :foreground "blue violet"))
|
||||
"Font Lock mode face used to highlight keywords."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-conf-substitutes-face 'remind-conf-substitutes-face
|
||||
"Remind substitutes.")
|
||||
(defface remind-conf-substitutes-face
|
||||
'((t :foreground "blue2"))
|
||||
"Font Lock mode face used to highlight substitutes."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-conf-endline-face 'remind-conf-endline-face
|
||||
"Remind endline.")
|
||||
(defface remind-conf-endline-face
|
||||
'((t :foreground "goldenrod2" :bold t))
|
||||
"Font Lock mode face used to highlight commands."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-conf-variable-face 'remind-conf-variable-face
|
||||
"Remind variable.")
|
||||
(defface remind-conf-variable-face
|
||||
'((t :foreground "DeepPink2" :bold t))
|
||||
"Font Lock mode face used to highlight commands."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-conf-color-face 'remind-conf-color-face
|
||||
"Remind color variables.")
|
||||
(defface remind-conf-color-face
|
||||
'((t :foreground "gold" :bold t))
|
||||
"Font Lock mode face used to highlight color changes."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-conf-delta-face 'remind-conf-delta-face
|
||||
"Remind deltas.")
|
||||
(defface remind-conf-delta-face
|
||||
'((t :foreground "sandy brown" :bold t))
|
||||
"Font Lock mode face used to highlight deltas."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-comment-face 'remind-comment-face
|
||||
"Remind comments.")
|
||||
(defface remind-comment-face
|
||||
'((t :foreground "brown"))
|
||||
"Font-lock face for highlighting comments."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-string-face 'remind-string-face
|
||||
"Remind strings.")
|
||||
(defface remind-string-face
|
||||
'((t :foreground "tomato"))
|
||||
"Font lock mode face used to highlight strings."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-time-face 'remind-time-face
|
||||
"Remind time words.")
|
||||
(defface remind-time-face
|
||||
'((t :foreground "LightSeaGreen" :bold t))
|
||||
"Font lock mode face to highlight time phrases."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defvar remind-conf-type-face 'remind-conf-type-face
|
||||
"Remind type keywords.")
|
||||
(defface remind-conf-type-face
|
||||
'((t :foreground "orange" :bold t))
|
||||
"Font lock mode face to highlight type keywords."
|
||||
:group 'remind-conf)
|
||||
|
||||
(defcustom rem-post-save-function ""
|
||||
"Name of shell function that can be run when you save and close a remind file.
|
||||
|
||||
If you put a & after the name of the function, it will run asyncronously. This might
|
||||
be useful if the process takes a long time."
|
||||
:type 'string
|
||||
:group 'remind-conf
|
||||
)
|
||||
|
||||
;; keywords
|
||||
|
||||
(defconst remind-conf-font-lock-keywords-1
|
||||
(list
|
||||
'("^[\;\#]\\s-+.*$" . remind-comment-face)
|
||||
(cons (regexp-opt remind-keywords 'words) remind-conf-keyword-face)
|
||||
'("%[\"_]" . font-lock-warning-face)
|
||||
'("\\(%[a-mops-w]\\)" . remind-conf-substitutes-face)
|
||||
'("\"[^\"]*\"" . remind-string-face))
|
||||
"Minimal font-locking for `remind-conf-mode'.")
|
||||
|
||||
(defconst remind-conf-font-lock-keywords-2
|
||||
(append remind-conf-font-lock-keywords-1
|
||||
(list
|
||||
(cons (regexp-opt remind-time-words 'words) remind-time-face)
|
||||
(cons (regexp-opt remind-builtin-functions 'words) remind-conf-command-face)
|
||||
'("%$" . remind-conf-endline-face)))
|
||||
"Additional commands to highlight in `remind-conf-mode'.")
|
||||
|
||||
(defconst remind-conf-font-lock-keywords-3
|
||||
(append remind-conf-font-lock-keywords-2
|
||||
(list
|
||||
(cons (regexp-opt remind-type-keywords 'words) remind-conf-type-face)
|
||||
'("\[[a-zA-Z]\\{3,6\\}\]" . remind-conf-color-face)
|
||||
'("\\s-+\\([12][0-9]\\|3[01]\\|0?[0-9]\\)\\s-+" . remind-conf-substitutes-face);better date regexp
|
||||
'("\\s-+\\(\\(?:20\\|19\\)[0-9][0-9]\\)\\s-+" . remind-conf-substitutes-face);years
|
||||
'("\\s-+\\(2[0-4]\\|[01]?[0-9][.:][0-5][0-9]\\)\\s-+" . remind-conf-substitutes-face);24hour clock, more precise
|
||||
'("\\s-+\\([+-][+-]?[1-9][0-9]*\\)\\s-+" 1 remind-conf-delta-face prepend)
|
||||
(cons (regexp-opt remind-builtin-variables 'words) remind-conf-variable-face)))
|
||||
"The ultimate in highlighting experiences for `remind-conf-mode'.")
|
||||
|
||||
(defcustom remind-conf-font-lock-keywords 'remind-conf-font-lock-keywords-3
|
||||
"Font-lock highlighting level for `remind-conf-mode'."
|
||||
:group 'remind-conf
|
||||
:type '(choice (const :tag "Barest minimum of highlighting." remind-conf-font-lock-keywords-1)
|
||||
(const :tag "Medium highlighting." remind-conf-font-lock-keywords-2)
|
||||
(const :tag "Highlighting deluxe." remind-conf-font-lock-keywords-3)))
|
||||
|
||||
;;; Indentation (I'm sure this could be made more simple. But at least it works.)
|
||||
|
||||
(defcustom remind-indent-level 4
|
||||
"User definable indentation."
|
||||
:group 'remind-conf
|
||||
:type '(integer)
|
||||
)
|
||||
|
||||
(defun remind-indent-line ()
|
||||
"Indent current line for remind configuration files."
|
||||
(interactive)
|
||||
(forward-line 0) ;remember this happens on every line as it is done per line basis
|
||||
(if (bobp)
|
||||
(indent-line-to 0)
|
||||
(let ((not-indented t) cur-indent)
|
||||
(if (looking-at "^[ \t]*\\<\\(ENDIF\\|POP\\(?:-OMIT-CONTEXT\\)?\\)\\>")
|
||||
(progn
|
||||
(save-excursion
|
||||
(forward-line -1)
|
||||
(setq cur-indent (- (current-indentation) remind-indent-level))) ;note that not-indented is still t
|
||||
(if (< cur-indent 0) (setq cur-indent 0)))
|
||||
(save-excursion
|
||||
(while not-indented
|
||||
(forward-line -1)
|
||||
(if (looking-at "^[ \t]*\\<\\(ENDIF\\|POP\\(?:-OMIT-CONTEXT\\)?\\)\\>")
|
||||
(progn
|
||||
(setq cur-indent 0)
|
||||
(delete-horizontal-space) ;don't know why I need this when other similar indent functions don't.
|
||||
(setq not-indented nil))
|
||||
(if (looking-at "\\<\\(IF\\(?:TRIG\\)?\\|PUSH\\(?:-OMIT-CONTEXT\\)?\\)\\>")
|
||||
(progn
|
||||
(setq cur-indent remind-indent-level)
|
||||
(setq not-indented nil))
|
||||
(if (bobp)
|
||||
(setq not-indented nil))))))
|
||||
(if cur-indent
|
||||
(indent-line-to cur-indent)
|
||||
(indent-line-to 0))))))
|
||||
|
||||
;;; Convenience functions
|
||||
|
||||
(define-skeleton rem-skel
|
||||
"Skeleton to insert a rem line in a remind configuration file."
|
||||
nil
|
||||
"REM "(skeleton-read "Date? " )
|
||||
("Optional: How many days ahead? " " +" str )
|
||||
resume:
|
||||
("Optional: At what time? Format eg 13:00. " " AT " str)
|
||||
resume:
|
||||
("Optional: How many minutes ahead? " " +" str )
|
||||
resume:
|
||||
("Optional: At what priority? eg 0-9999" " PRIORITY " str )
|
||||
resume:
|
||||
" MSG %\"" (skeleton-read "Your message? " )"%b%\"%" \n
|
||||
)
|
||||
|
||||
(define-skeleton rem-today-skel
|
||||
"Skeleton to insert a line for today's date."
|
||||
nil
|
||||
"REM " (format-time-string "%d %b %Y")
|
||||
("Optional: At what time? Format eg 13:20. " " AT " str)
|
||||
resume:
|
||||
("Optional: How many minutes ahead? " " +" str )
|
||||
resume:
|
||||
("Optional: At what priority? eg 0-9999" " PRIORITY " str )
|
||||
resume:
|
||||
" MSG " (skeleton-read "Your message? " )"%b.%" \n
|
||||
)
|
||||
|
||||
(defun rem-today ()
|
||||
"Insert the date for today in a remind friendly style."
|
||||
(interactive)
|
||||
(insert (format-time-string "%e %b %Y")))
|
||||
|
||||
(defun rem-tomorrow ()
|
||||
"Insert tomorrow's date in a remind friendly style."
|
||||
(interactive)
|
||||
(insert (format-time-string "%e %b %Y" (time-add (current-time) (days-to-time 1)))))
|
||||
|
||||
(defun rem-days-away (arg)
|
||||
"Insert a day N number of days in the future.
|
||||
|
||||
Takes a prefix argument, but defaults to 4."
|
||||
(interactive "nHow many Days?: ")
|
||||
(insert (format-time-string "%e %b %Y" (time-add (current-time) (days-to-time arg)))))
|
||||
|
||||
(defun rem-week-away ()
|
||||
"Insert a day 7 days in the future."
|
||||
(interactive)
|
||||
(insert (format-time-string "%e %b %Y" (time-add (current-time) (days-to-time 7)))))
|
||||
|
||||
(setq skeleton-end-hook nil) ; so the skeletons will not automatically go to a new line.
|
||||
|
||||
;;; private function
|
||||
;; could make it useful for others. Put somethin like the following in your .emacs
|
||||
;(setq rem-post-save-function "~/bin/dailypic &")
|
||||
|
||||
(defun rem-save-file ()
|
||||
"Save the file and start the shell function in one go.
|
||||
|
||||
This function will close the window after running. It needs the
|
||||
variable `rem-post-save-function' to be set. It will be most
|
||||
useful to people who have some sort of function they run to use
|
||||
remind data ie procucing calendars."
|
||||
(interactive)
|
||||
(if (boundp 'rem-post-save-function)
|
||||
(progn (save-buffer)
|
||||
(shell-command rem-post-save-function)
|
||||
(kill-buffer-and-window))
|
||||
(error "`rem-post-save-function' variable is not set")))
|
||||
|
||||
(defun rem-setup-colors ()
|
||||
"Insert set of variables for coloured output in remind messages."
|
||||
(interactive)
|
||||
(find-file (expand-file-name "~/.reminders"))
|
||||
(goto-char 0) ;we do want it somewhere near the top of the file.
|
||||
(save-excursion
|
||||
(re-search-forward "\n\n"); squeeze it in where you have a free line.
|
||||
(insert "\nSET 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\" \n \n")))
|
||||
|
||||
;; So now you can do things like:
|
||||
|
||||
(define-skeleton birthcol
|
||||
"Make birthdays magenta.
|
||||
Acts on the region or places point where it needs to be."
|
||||
nil
|
||||
"[Mag]" _ " [Nrm]")
|
||||
|
||||
;; finally the derived mode.
|
||||
|
||||
;;;###autoload
|
||||
(define-derived-mode remind-conf-mode text-mode "REM"
|
||||
"Major mode for editing remind calendar configuration files.
|
||||
|
||||
\\{remind-conf-mode-map}"
|
||||
:syntax-table remind-conf-syntax-table
|
||||
(set (make-local-variable 'font-lock-keywords-case-fold-search) t) ;this is not working atm 2009-04-13
|
||||
(set (make-local-variable 'font-lock-defaults) '(remind-conf-font-lock-keywords))
|
||||
(set (make-local-variable 'comment-start) ";")
|
||||
(set (make-local-variable 'comment-start) "#")
|
||||
(set (make-local-variable 'comment-end) "\n")
|
||||
(set (make-local-variable 'fill-column) '100);cause I was having problems with autofill.
|
||||
(set (make-local-variable 'indent-line-function) 'remind-indent-line)
|
||||
(use-local-map remind-conf-mode-map)
|
||||
)
|
||||
|
||||
|
||||
(provide 'remind-conf-mode)
|
||||
;;; remind-conf-mode.el ends here
|
||||
|
||||
;;; Indentation code
|
||||
;;; work out how to make the syntax highlighting work only before the (MSG|MSF)
|
||||
;;; keywords and not after.
|
||||
;;; for my own use. keymap to save file and do dailypic C-c C-c in time honoured tradition?
|
||||
@@ -1,31 +0,0 @@
|
||||
$Id: README.AMIGA,v 1.2 1998-01-17 04:50:33 dfs Exp $
|
||||
REMIND version 3.0 for AmigaDOS
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
|
||||
1 - Read the file COPYRIGHT.
|
||||
|
||||
2 - cd src; examine the files config.h and custom.h and adjust parameters
|
||||
as needed
|
||||
|
||||
3 - If you are using SAS/C to compile Remind, type:
|
||||
|
||||
copy amiga-SCOPTIONS SCOPTIONS
|
||||
smake -f smakefile
|
||||
|
||||
This will create remind, which is ready to be executed.
|
||||
|
||||
[Please note: I CANNOT SUPPORT THE AMIGA VERSION!]
|
||||
|
||||
See README.UNIX for more info.
|
||||
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
$Id: README.BCC,v 1.2 1998-01-17 04:50:33 dfs Exp $
|
||||
REMIND version 3.0 for Borland C++
|
||||
|
||||
IMPORTANT NOTE: BCC SUPPORT MAY BE BROKEN. I DON'T CARE. I'M NOT
|
||||
MAINTAINING IT ANY LONGER.
|
||||
|
||||
1 - Read the file COPYRIGHT. (This may be called COPYRIGH on your
|
||||
MS-DOS system.)
|
||||
|
||||
2 - You must use the Borland C++ OS/2 or MSDOS/Windows compiler.
|
||||
|
||||
3 - cd src; examine the files custom.h and config.h and adjust
|
||||
parameters as needed
|
||||
|
||||
4 - Examine the file makefile.bcc and adjust parameters as needed.
|
||||
|
||||
5 - Type:
|
||||
|
||||
make -f makefile.bcc
|
||||
|
||||
This will make 'remind.exe' and 'rem2ps.exe' in the ..\os2-ex or ..\msdos-ex
|
||||
directories.
|
||||
|
||||
See README.UNIX for more info.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
$Id: README.DOS,v 1.2 1998-01-17 04:50:33 dfs Exp $
|
||||
REMIND version 3.0 for MS-DOS
|
||||
|
||||
IMPORTANT NOTE: DOS SUPPORT MAY BE BROKEN. I DON'T CARE. I NO LONGER
|
||||
MAINTAIN THE DOS VERSION.
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
|
||||
1 - Read the file COPYRIGHT. (This may be called COPYRIGH on your
|
||||
MS-DOS system.)
|
||||
|
||||
2 - cd src; examine the files custom.h and config.h and adjust parameters
|
||||
as needed
|
||||
|
||||
3 - If you are using Turbo C to compile Remind, type:
|
||||
|
||||
make -fmakefile.tc
|
||||
|
||||
If you are using Microsoft C to compile Remind, type:
|
||||
|
||||
make makefile.msc
|
||||
|
||||
This will create REMIND.EXE, which is ready to be executed.
|
||||
|
||||
The file "defs.rem" has some sample Remind definitions and commands,
|
||||
as well as U.S. and Jewish holidays.
|
||||
|
||||
See README.UNIX for more info.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
|
||||
109
docs/README.OS2
109
docs/README.OS2
@@ -1,109 +0,0 @@
|
||||
$Id: README.OS2,v 1.2 1998-01-17 04:50:34 dfs Exp $
|
||||
REMIND version 3.0 for OS/2
|
||||
|
||||
This file contains instructions for compiling Remind under OS/2 with
|
||||
Eberhard Mattes' emx/gcc compiler and with the Microsoft C compiler.
|
||||
There are a number of targets in Makefile.os2, including OS/2-only
|
||||
versions and bound versions (programs which run under OS/2 and DOS).
|
||||
|
||||
Note that there is also support for OS/2 using the Borland C
|
||||
compiler--see the file README.BCC for details.
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
|
||||
1 - Read the file COPYRIGHT. (This may be called COPYRIGH on your
|
||||
MS-DOS system.)
|
||||
|
||||
2 - To compile Remind for OS/2, you must use the Microsoft C compiler
|
||||
or emx/gcc. You must also have a decent version of 'make', such
|
||||
as dmake or GNU make.
|
||||
|
||||
3 - Change to "src" directory and examine the files config.h and custom.h
|
||||
and adjust parameters as needed.
|
||||
|
||||
4 - Examine the file Makefile.os2 and adjust parameters as needed.
|
||||
|
||||
5 - Type:
|
||||
|
||||
make -f Makefile.os2
|
||||
|
||||
to see a list of targets. For example,
|
||||
|
||||
make -f Makefile.os2 emx
|
||||
|
||||
will build a 32-bit emx version which runs under OS/2 2.x and DOS.
|
||||
|
||||
NOTE that I do not have access to an OS/2 system, so support for this
|
||||
system may not be as good as I'd like.
|
||||
|
||||
OS/2 support is courtesy of Russ Herman <rwh@gov.on.ca>, Norman Walsh
|
||||
<norm@ora.com>, and Darrel Hankerson <hankedr@mail.auburn.edu>.
|
||||
However, if you have problems, please contact me.
|
||||
|
||||
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
||||
|
||||
1. POPUP REMINDERS
|
||||
|
||||
If you define the symbol OS2_POPUP in the OS/2 Makefile, you get
|
||||
"full-screen popups" (as implemented by Russ Herman) for all MSG-
|
||||
and MSF-type reminders. You may or may not like this feature.
|
||||
|
||||
One way of implementing popup reminders is to get the program
|
||||
"pmpopup.exe" from ftp-os2.cdrom.com, and using Remind with the
|
||||
'-k' option as follows from C:\STARTUP.CMD:
|
||||
|
||||
start /pm /inv /n remind "-kstart pmpopup %%s" remfile
|
||||
|
||||
Alternatively, if you have the Vrexx package, you can use this
|
||||
procedure suggested by Norman Walsh:
|
||||
|
||||
Start remind like this in C:\STARTUP.CMD:
|
||||
|
||||
start /pm /inv /n \bin\remind -faz "-kstart popupmsg %%s" .reminders
|
||||
|
||||
The popups are done by POPUPMSG.CMD which looks like this:
|
||||
|
||||
-------------- Cut Here ---------- Cut Here ---------- Cut Here --------
|
||||
/* PopUpMsg */
|
||||
|
||||
'@echo off'
|
||||
|
||||
parse arg theargs
|
||||
if theargs = "" then
|
||||
theargs = "Empty message"
|
||||
|
||||
call RxFuncAdd 'VInit', 'VREXX', 'VINIT'
|
||||
initcode = VInit()
|
||||
if initcode = 'ERROR' then signal CLEANUP
|
||||
|
||||
signal on failure name CLEANUP
|
||||
signal on halt name CLEANUP
|
||||
signal on syntax name CLEANUP
|
||||
|
||||
/* example VMsgBox call */
|
||||
|
||||
msg.0 = 1
|
||||
msg.1 = theargs
|
||||
|
||||
call VDialogPos 50, 50
|
||||
call VMsgBox 'Popup Message', msg, 1
|
||||
|
||||
/* end of CMD file */
|
||||
|
||||
CLEANUP:
|
||||
call VExit
|
||||
|
||||
exit
|
||||
-------------- Cut Here ---------- Cut Here ---------- Cut Here --------
|
||||
|
||||
See README.UNIX for some more information about Remind.
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
$Id: README.UNIX,v 1.4 1998-01-19 03:24:09 dfs Exp $
|
||||
REMIND version 3.0 for UNIX
|
||||
REMIND version 3.2 for UNIX
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the man page, "remind.1".
|
||||
@@ -7,16 +6,16 @@ in the man page, "remind.1".
|
||||
INSTALLING REMIND:
|
||||
-----------------
|
||||
|
||||
If you have Tcl/Tk (wish 4.1 or higher) installed and are running X Windows:
|
||||
--------------------------------------------------------------
|
||||
If you have Tcl/Tk (wish 4.1 or higher) installed and are running X11:
|
||||
----------------------------------------------------------------------
|
||||
|
||||
1) Type: wish ./build.tk from the top-level Remind directory.
|
||||
Fill in the various options and hit "Build Remind"
|
||||
|
||||
2) Type: "make install" -- you may need to be root to do this.
|
||||
|
||||
If you do NOT have Tcl/Tk or are NOT running X Windows:
|
||||
-------------------------------------------------------
|
||||
If you do NOT have Tcl/Tk or are NOT running X11:
|
||||
-------------------------------------------------
|
||||
|
||||
1) Edit the file "src/custom.h" according to your preferences.
|
||||
|
||||
@@ -29,30 +28,6 @@ If you do NOT have Tcl/Tk or are NOT running X Windows:
|
||||
The subdirectory "www" contains scripts for making a nice calendar
|
||||
web server. See the files README and Makefile in that directory.
|
||||
|
||||
Two shell scripts, "scripts/remind-all.csh" and
|
||||
"scripts/remind-all.sh" are provided. These allow automatic mailing of
|
||||
reminders to all users who create a $HOME/.reminders file. These two
|
||||
scripts are equivalent; one is a "sh" script and the other is a "csh"
|
||||
script. Pick the one you want to use, and follow the instructions in
|
||||
the opening comments of the script.
|
||||
|
||||
A shell script called "scripts/rem" is provided for those who like to have
|
||||
'remind' assume a default reminders file. A man page for this script
|
||||
is provided. You should examine the script to ensure that the defaults
|
||||
are correct.
|
||||
|
||||
Many people have asked me why I supply the "rem" script instead of
|
||||
having Remind assume a default file. The answer is: That's how I like
|
||||
it! My personal preference is for a program which normally takes
|
||||
parameters to display usage information when invoked with no
|
||||
parameters. I like that behaviour so I can quickly get an idea of
|
||||
what a program does without poring through the man page. And I think
|
||||
I'll keep Remind that way. Sorry to all who dislike it. :-)
|
||||
|
||||
A shell script called "scripts/kall" is provided so you can kill your
|
||||
background remind processes when you log out. See the man page. Note
|
||||
that kall depends on the output of "ps", and may not be portable.
|
||||
|
||||
The file "examples/defs.rem" has some sample Remind definitions and
|
||||
commands, as well as U.S. and Jewish holidays.
|
||||
|
||||
@@ -98,12 +73,12 @@ RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
||||
|
||||
1. POPUP REMINDERS
|
||||
|
||||
If you're running under X-Windows and you have the TCL tools,
|
||||
you can create simple pop-up reminders by creating the following
|
||||
TCL script called 'popup'. It pops a message on to the screen and
|
||||
waits for you to press the 'OK' button. If you don't press the OK button
|
||||
within 15 seconds, it exits anyway. To use it, you can use the '-k' option
|
||||
for Remind as follows:
|
||||
If you're running under X11 and you have the Tcl tools, you can create
|
||||
simple pop-up reminders by creating the following Tcl script called
|
||||
'popup'. It pops a message on to the screen and waits for you to
|
||||
press the 'OK' button. If you don't press the OK button within 15
|
||||
seconds, it exits anyway. To use it, you can use the '-k' option for
|
||||
Remind as follows:
|
||||
|
||||
remind "-kpopup '%s'&" .reminders
|
||||
|
||||
@@ -118,16 +93,12 @@ Norman Walsh.
|
||||
#!/usr/local/bin/wish
|
||||
wm withdraw .
|
||||
after 15000 { destroy . ; exit }
|
||||
tk_dialog .d { Message } $argv warning 0 { OK }
|
||||
tk_dialog .d { Message } $argv warning 0 { OK }
|
||||
destroy .
|
||||
exit
|
||||
-------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
|
||||
|
||||
|
||||
--
|
||||
David F. Skoll <dfs@doe.carleton.ca>
|
||||
986 Eiffel Avenue
|
||||
Ottawa, Ontario K2C 0J2
|
||||
CANADA
|
||||
|
||||
Tel. (613) 225-8687
|
||||
Dianne Skoll <dianne@skoll.ca>
|
||||
https://dianne.skoll.ca/projects/remind/
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
$Id: README_QDOS,v 1.3 1998-03-01 20:43:04 dfs Exp $
|
||||
REMIND version 3.0.19 for QDOS / SMSQ
|
||||
|
||||
REMIND is a sophisticated alarm/calendar program. Details are given
|
||||
in the documentation file, "remind_doc" (QUILL format).
|
||||
[Note from David Skoll -- I was not sent the file `remind_doc', so
|
||||
you're on your own here. You'll have to use the UNIX man pages.]
|
||||
|
||||
1 - Read the file COPYRIGHT.
|
||||
|
||||
2 - Change to the directory "src"
|
||||
|
||||
3 - Examine the Makefile and change any parameters which need to be
|
||||
changed for your system. (The makefile for QDOS / SMSQ is
|
||||
makefile_QDOS).
|
||||
|
||||
4 - Examine the files config_h and custom_h and adjust parameters as needed
|
||||
|
||||
5 - Examine lang_h and choose the language you want Remind to use.
|
||||
There has no effort been put in making the language modules working
|
||||
on the QL. You'll have to adjust the files for yourself to get
|
||||
them working (umlauts etc).
|
||||
|
||||
6 - Execute "make;'-fMakefile_QDOS'". Be sure, that your DATA_DEFAULT
|
||||
directory is the directory where the remind source files are
|
||||
placed.
|
||||
|
||||
See README.UNIX for some more information about Remind.
|
||||
|
||||
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
|
||||
|
||||
The QDOS / SMSQ version does not support the enhanced features of
|
||||
the UNIX and/or OS/2 versions.
|
||||
|
||||
I had some problems with the sunrise() and sunset() functions,
|
||||
but didn't examine it.
|
||||
|
||||
I've ported Remind on a SMSQ/SGC system. It should work on other
|
||||
systems without problems. The compiler used was C68 v4.14c.
|
||||
|
||||
Remind should work with each QL or compatible with 512K or more RAM.
|
||||
It'll however NOT work on a standard QL due to it's code size.
|
||||
|
||||
Any problems with the QDOS / SMSQ versions should be sent to:
|
||||
|
||||
Robert H. Klein
|
||||
Bluecherstrasse 24
|
||||
D-56349 Kaub
|
||||
|
||||
Germany
|
||||
@@ -1,11 +1,712 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* Version 3.0 Patch 20
|
||||
* VERSION 3.3 Patch 5 - 2021-01-21
|
||||
|
||||
+ NEWS
|
||||
- NEW FEATURE: tkremind: Add ability to change fonts and colors from
|
||||
within TkRemind "Options" dialog.
|
||||
|
||||
- I have started a company, Roaring Penguin Software
|
||||
Inc. (http://www.roaringpenguin.com) and it now holds the Remind copyright.
|
||||
- CHANGE: tkremind: TkRemind now requires Tcl/Tk 8.5 or newer.
|
||||
|
||||
- CHANGE: tkremind: You can specify the location of the options
|
||||
file on the command-line if you want to use one other than ~/.tkremindrc
|
||||
|
||||
- CLEANUP: tkremind: Remove "Apply Options" from Options dialog; we only
|
||||
need "Save Options".
|
||||
|
||||
- DOC FIX: Add missing release note in 3.3.4 notes regarding
|
||||
setpagedevice patch
|
||||
|
||||
- DOC FIX: tkremind: Document shortcut keys.
|
||||
|
||||
* VERSION 3.3 Patch 4 - 2021-01-12
|
||||
|
||||
- NEW FEATURE: If "inotifywait" is installed, TkRemind uses it to refresh
|
||||
the calendar display right away when the reminders file/directory is updated.
|
||||
This makes TkRemind react almost instantly if external tools are editing
|
||||
or updating reminders.
|
||||
|
||||
- MINOR NEW FEATURE: rem2ps has a new '-x' option; this puts the day numbers
|
||||
on the top-left of the day's box instead of the top-right.
|
||||
|
||||
- MINOR FIXES: A typo in remind.1 was fixed; additional comments regarding
|
||||
UNTIL were added.
|
||||
|
||||
- BUG FIX: rem2ps: Call setpagedevice to set page size. Based on a patch
|
||||
from Jonathan Kamens.
|
||||
|
||||
* VERSION 3.3 Patch 3 - 2020-11-09
|
||||
|
||||
- BUG FIX: Fix startup crash in TkRemind if "Show Today's Reminders on
|
||||
Startup" is enabled (which, unfortunately, is the default.) Bug reported
|
||||
by Martin Ziemer.
|
||||
|
||||
* VERSION 3.3 Patch 2 - 2020-11-08
|
||||
|
||||
- MINOR NEW FEATURE: Add MAYBE-UNCOMPUTABLE keyword; see the man page
|
||||
and discussion at
|
||||
https://dianne.skoll.ca/pipermail/remind-fans/2020/003745.html
|
||||
|
||||
- CHANGE: TkRemind always invokes Remind with the "-itkremind=1" option,
|
||||
even when printing. NOTE INCOMPATIBILITY: This is a behavior change!
|
||||
When you print from TkRemind, we also invoke Remind with "-itkprint=1"
|
||||
so you can detect that PostScript is being generated.
|
||||
|
||||
- CHANGE: The maxmimum length of a variable name has been increased from
|
||||
16 characters to 64 characters. Modern computers have plenty of memory.
|
||||
|
||||
- BUG FIXES: Minor documentation updates, typo fixes, clarifications, etc.
|
||||
|
||||
- BUG FIX: Fix calendar-drawing alignment errors when displaying UTF-8
|
||||
strings with zero-width combining characters and strings with tabs.
|
||||
|
||||
- BUG FIX: TkRemind would mess up placement of the WEEK special if invoked
|
||||
with the "-m" option. This has been fixed.
|
||||
|
||||
- BUG FIX: TkRemind would sometimes fail with an error message when editing
|
||||
a reminder; this is because it was interpreting months 08 and 09 as
|
||||
illegal octal numbers. This has been fixed.
|
||||
|
||||
* VERSION 3.3 Patch 1 - 2020-03-20
|
||||
|
||||
- CHANGE: For overlapping multi-day events, issue a reminder for the
|
||||
most *recent* event rather than the earliest event. NOTE
|
||||
INCOMPATIBILITY: This is a behavior change!
|
||||
|
||||
- CHANGE: Do not convert 90-99 to 1990-1999 when parsing numbers to
|
||||
recognize years. NOTE INCOMPATIBILITY: This is a behavior change!
|
||||
|
||||
- CHANGE: Revert change to -y option that included filename and line
|
||||
number in the hash.
|
||||
|
||||
- CHANGE: Retain newlines (produced by %_) in JSON output.
|
||||
|
||||
- FIX: Document $FormWidth system variable
|
||||
|
||||
- FIX: Highlight today's date in "remind -c" output
|
||||
|
||||
- FIX: Eliminate compiler warnings on Ubuntu 18.04.
|
||||
|
||||
- IMPROVEMENT: Allow times to be specified either in 24-hour mode
|
||||
(HH:MM or HH.MM) or AM/PM mode (HH:MMam; HH:MMpm, etc.)
|
||||
|
||||
- IMPROVEMENT: Allow DURATION to be specified as a time (1:30) or a
|
||||
number of minutes (90).
|
||||
|
||||
- IMPROVEMENT: If terminal size can be determined, set $FormWidth to
|
||||
terminal width - 8; if not, set $FormWidth to 72.
|
||||
|
||||
- MINOR IMPROVEMENT: Add the "ampm()" built-in function.
|
||||
|
||||
* Version 3.3 Patch 0 - 2020-01-31
|
||||
|
||||
- FIX: rem2ps: Add a %%PageBoundingBox: document structuring convention
|
||||
comment.
|
||||
|
||||
- FIX: rem2ps: Ignore unknown SPECIAL-type reminders.
|
||||
|
||||
- IMPROVEMENT: In calendar mode ("-c" option), Remind automatically adjusts
|
||||
the width of the calendar to fit the terminal window if standard output
|
||||
is a TTY.
|
||||
|
||||
- IMPROVEMENT: Add JSON-based output with "remind -pp" and "remind -ppp"
|
||||
The JSON-based intermediate format preserves a lot more information
|
||||
about the original reminder, allowing back-ends more insight into
|
||||
the intent of the reminder, the recurrence used, etc. See the documentation
|
||||
in "man rem2ps"
|
||||
|
||||
- IMPROVEMENT: TkRemind can "reverse-engineer" reminders that it creates
|
||||
using the additional information in the "remind -pp" format, so it
|
||||
doesn't create or use ugly comment blocks to delimit the reminders
|
||||
it creates.
|
||||
|
||||
- IMPROVEMENT: TkRemind: Add popup help to most buttons and controls.
|
||||
|
||||
- NEW FEATURE: Add support for $DefaultColor system variable, suggested
|
||||
by Tim Chase.
|
||||
|
||||
- NEW FEATURE: The "-@[n][,m]" command-line option allows colored reminders
|
||||
in Agenda Mode as well as in Calendar Mode. It also adds support for
|
||||
terminal emulators that can handle the xterm 256-color escape sequences
|
||||
as well as the true 24-bit color escape sequences.
|
||||
|
||||
- CHANGE: SPECIALs are now case-insensitive. Before, only SPECIAL COLOR
|
||||
would work. Now you can use Special Color, special color, etc.
|
||||
|
||||
* Version 3.2 Patch 0 - 2020-01-03
|
||||
|
||||
- IMPROVEMENT: Add support for events spanning multiple days (with AT
|
||||
and DURATION). Add trigeventstart() and trigeventduration()
|
||||
introspection functions; see "MULTI-DAY EVENTS" in the man page.
|
||||
|
||||
- IMPROVEMENT: Add introspection functions trigback(), trigdelta(),
|
||||
trigduration(), trigfrom(), trigpriority(), trigrep(),
|
||||
trigscanfrom(), trigtimedelta(), trigtimerep(), and triguntil(). See
|
||||
man page for details; thanks to Tim Chase for the suggestion.
|
||||
|
||||
- IMPROVEMENT: TkRemind: Use PNG images for the next month / previous
|
||||
month buttons rather than -> and <-. Also use nice anti-aliased
|
||||
moon phase images instead of ugly blocky bitmaps.
|
||||
|
||||
- CHANGE: Modify addition so that previously-illegal combinations
|
||||
TIME + TIME, TIME + DATETIME and DATETIME + TIME are now allowed.
|
||||
Also allow DATETIME - TIME. If t1 and t2 are expressions of type TIME
|
||||
and dt is an expression of type DATETIME, then the following are now
|
||||
equivalent (before, the expressions on the left-hand side would fail
|
||||
with a "Type mismatch" error.)
|
||||
|
||||
t1 + t2 == t1 + coerce("INT", t2)
|
||||
dt + t2 == dt + coerce("INT", t2)
|
||||
t1 + dt == coerce("INT", t1) + dt
|
||||
dt - t2 == dt - coerce("INT", t2)
|
||||
|
||||
- DOC FIX: Document previously-undocumented $MaxStringLen system variable
|
||||
|
||||
- DOC FIX: Various minor documentation fixes.
|
||||
|
||||
- BUG FIX: Specifying a DURATION without an AT clause results in an error.
|
||||
Before, it would be accepted but not do anything useful.
|
||||
|
||||
- BUG FIX: Catch potential date overflow in slide() function
|
||||
|
||||
- BUG FIX: Fix compile error when compiling Romanian version; eliminate
|
||||
compiler warning when compiling non-English versions.
|
||||
|
||||
- BUG FIX: TkRemind: Fix startup failure of TkRemind if options are at
|
||||
default. :(
|
||||
|
||||
* Version 3.1 Patch 17 - 2019-11-15
|
||||
|
||||
- IMPROVEMENT: Add "Extra Remind Options" setting to TkRemind.
|
||||
|
||||
- IMPROVEMENT: Enable warning-free compilation even with gcc -Wextra flag.
|
||||
|
||||
- IMPROVEMENT: Warn if "OMIT a THROUGH b" has a > b.
|
||||
|
||||
- SYNTACTIC SUGAR: Make "SCANFROM -n" the same as "SCANFROM [today() - n]"
|
||||
|
||||
- BUG FIX: Don't dump expired reminders when dumping queue.
|
||||
|
||||
- BUG FIX: Fix failure when specifying a Jahrzeit in Adar. Fix
|
||||
courtesy of Dov Feldstern
|
||||
|
||||
- BUG FIX: Fix various documentation errors and update man page.
|
||||
|
||||
* Version 3.1 Patch 16 - 2018-11-09
|
||||
|
||||
- IMPROVEMENT: Add patch from Stephen Morgan to calculate astronomical and
|
||||
nautical twilight in addition to civil twilight.
|
||||
|
||||
- BUG FIX: The rem2html script correctly handles a SHADE special with only
|
||||
one number (a grey level).
|
||||
|
||||
- IMPROVEMENT: Remind accepts DATETIME constants in ISO-8601 format and can
|
||||
optionally be configured to output them that way too.
|
||||
|
||||
- MINOR IMPROVEMENT: TkRemind puts its hostname in the window title bar.
|
||||
|
||||
- MINOR IMPROVEMENT: TkRemind restarts the background remind daemon if
|
||||
the .reminders file changes
|
||||
|
||||
- MINOR IMPROVEMENT: TkRemind has a "Queue" button that lets you see details
|
||||
of upcoming queued reminders. This is mostly for debugging and the output
|
||||
is not particularly readable.
|
||||
|
||||
- BUG FIX: The definitions form Yom Hazikaron and Yom Ha'atzmaut were not
|
||||
quite right; they have been fixed.
|
||||
|
||||
- MINOR IMPROVEMENT: TkRemind centers popups over the main calendar
|
||||
window rather than over the desktop background. This is better
|
||||
behavior in multi-monitor setups.
|
||||
|
||||
- BUG FIX: In "remind -z0" mode, remind wakes up exactly on the minute instead
|
||||
of sleeping for 60 seconds each time, which could cause it to fall behind.
|
||||
|
||||
* Version 3.1 Patch 15 - 2015-07-27
|
||||
|
||||
- BUG FIX: Fix a buffer overflow found by Alexander Keller
|
||||
|
||||
- BUG FIX: Fix a typo in this file: was 2014 instead of 2015.
|
||||
|
||||
- BUG FIX: Make parser reject an AT followed by more than one time.
|
||||
|
||||
- BUG FIX: Make parser reject epeated delta or *repeat values.
|
||||
|
||||
* Version 3.1 Patch 14 - 2015-04-24
|
||||
|
||||
- NEW FEATURE: Putting the line __EOF__ in a .rem file causes Remind
|
||||
to treat it as end-of-file.
|
||||
|
||||
- IMPROVEMENT: Use better PNG images for moons in the HTML display
|
||||
|
||||
- CHANGE: Author name updated from "David" to "Dianne"
|
||||
|
||||
- BUG FIX: The "-n" command-line option should really run in "ADVANCE_MODE"
|
||||
rather than "CAL_MODE" internally; otherwise, the substitution sequences
|
||||
may be misinterpreted.
|
||||
|
||||
- BUG FIX: A typo in clearing out MD5 sum context has been fixed.
|
||||
|
||||
- BUG FIX: Typo in Spanish translation was fixed.
|
||||
|
||||
* Version 3.1 Patch 13 - 2013-03-22
|
||||
|
||||
- BUG FIX: Sunrise/Sunset calculations greatly improved thanks to John
|
||||
McGowan. Accuracy should now be within a couple of minutes in most
|
||||
places.
|
||||
|
||||
- BUG FIX: Allow specification of margins as low as 0 points in rem2ps,
|
||||
courtesy of Jonathan Kamens.
|
||||
|
||||
- BUG FIX: Permit compilation with gcc 2.95 (which doesn't allow variable
|
||||
declarations after non-declaration statements in a block.)
|
||||
|
||||
- BUG FIX: Several minor documentation errors corrected courtesy of
|
||||
Simon Ruderich.
|
||||
|
||||
- BUG FIX: Spurious test harness failure was fixed.
|
||||
|
||||
* Version 3.1 Patch 12 - 2012-01-23
|
||||
|
||||
- NEW FEATURE: Many substitution sequences "%x" have an alternate mode
|
||||
denoted by "%*x". This alternate mode leaves out prepositions. For
|
||||
example, in English "%i" might yield "on 01-25" while "%*i" yields only
|
||||
"01-25".
|
||||
|
||||
- BUG FIX: The "dusk" and "dawn" calculations were completely wrong. They
|
||||
have been fixed. Also, sunrise/sunset calculations have been tweaked,
|
||||
so the results may be off by a minute or two compared to previous versions
|
||||
of Remind.
|
||||
|
||||
* Version 3.1 Patch 11 - 2011-12-16
|
||||
|
||||
- BUG FIX: For some inexplicable reason, dawn was considered to happen when
|
||||
the sun was 14 degrees below the horizon instead of the standard 6
|
||||
degrees for Civil Dawn. This has been fixed.
|
||||
|
||||
- BUG FIXES: Clarified the man pages and fixed some typos.
|
||||
|
||||
- BUG FIX: Add THROUGH to the remind.vim syntax highlighting file.
|
||||
|
||||
- ENHANCEMENT (?): Allow SPECIAL COLOR to be spelled SPECIAL COLOUR.
|
||||
|
||||
- BUG FIX: Apply minor Debian cleanups reported by Kurt B. Kaiser.
|
||||
|
||||
* Version 3.1 Patch 10 - 2010-11-01
|
||||
|
||||
- NOTE: This is the 20th anniversary of Remind's first public release.
|
||||
|
||||
- ENHANCEMENT: Add the THROUGH keyword. You can omit blocks of dates with:
|
||||
|
||||
OMIT start THROUGH end
|
||||
|
||||
and the syntax REM start THROUGH end is equivalent to REM start *1 UNTIL end
|
||||
|
||||
- ENHANCEMENT: Add support for multibyte characters (eg, UTF-8) in calendar
|
||||
output. Note that UTF-8 strings are still not supported in PostScript
|
||||
output.
|
||||
|
||||
- ENHANCEMENT: Add support for UTF-8 line-drawing characters in calendar
|
||||
output.
|
||||
|
||||
- ENHANCEMENT: You can have multiple TAG clauses in a REM statement.
|
||||
|
||||
- BUG FIX: Avoid spawning long-running background processes in "make test".
|
||||
|
||||
- BUG FIX: Don't declare variables in the middle of statements (old C
|
||||
compilers choke.)
|
||||
|
||||
* Version 3.1 Patch 9 - 2010-06-20
|
||||
|
||||
- MAJOR ENHANCEMENT: New "purge mode" to delete expired reminders. See
|
||||
the PURGE MODE section of the remind man page.
|
||||
|
||||
- ENHANCEMENT: Support DURATION in TkRemind. Thanks to Marek Marczykowski.
|
||||
|
||||
- BUG FIX: Don't change the order of PS and PSFILE reminders. Bug found
|
||||
by John McGowan.
|
||||
|
||||
- BUG FIX: "REM 1990-01-01 SATISFY 1" would yield a spurious parse error
|
||||
in earlier versions of Remind.
|
||||
|
||||
- BUG FIX: Yom HaShoah is moved to Thursday if it would normally fall on
|
||||
a Friday. Thanks to Jonathan Kamens for pointing this out.
|
||||
|
||||
* Version 3.1 Patch 8 - 2010-03-09
|
||||
|
||||
- ENHANCEMENT: Include some useful scripts in contrib/
|
||||
|
||||
- ENHANCEMENT: Add the $T, $Td, $Tm, $Tw, $Ty, $U, $Ud, $Um, $Uw, $Uy
|
||||
special variables to make reminder files less wordy. See man page
|
||||
for details.
|
||||
|
||||
- MINOR ENHANCEMENT: Set an icon photo window manager resource on TkRemind.
|
||||
|
||||
- POLICY CHANGE: Discourage use of Remind on MS Windows or Apple Mac OS X.
|
||||
|
||||
- BUG FIX: Ignore msgprefix() and msgsuffix() on RUN-type reminders.
|
||||
|
||||
- BUG FIX: Adjust Remind and Rem2PS so that SHADE specials don't obliterate
|
||||
earlier MOON specials.
|
||||
|
||||
- BUG FIX: Fix bug in SCHED calculations if Remind is started in the middle
|
||||
of a SCHED interval.
|
||||
|
||||
* Version 3.1 Patch 7 - 2009-05-31
|
||||
|
||||
- ENHANCEMENT: Wherever you could write "day Mon year", the parser now
|
||||
accepts "YYYY-MM-DD". This applies on the command-line and to the
|
||||
REM and OMIT keywords. You can avoid wrapping date calculations in
|
||||
the trigger() function in many cases.
|
||||
|
||||
- ENHANCEMENT: New slide() built-in function eases some complicated reminders.
|
||||
|
||||
* Version 3.1 Patch 6 - 2008-11-16
|
||||
|
||||
- MAJOR ENHANCEMENT: A new OMITFUNC clause gives you additional
|
||||
control and flexibility over "omitted days" calculations. This is
|
||||
useful when holidays influence the timing of events several days
|
||||
later. See "COMPUTED LOCAL OMITS" in the man page.
|
||||
|
||||
- ENHANCEMENT: The new evaltrig() built-in function lets you evaluate triggers
|
||||
from within an expression.
|
||||
|
||||
- ENHANCEMENT: The new weekno() built-in function returns the ISO 8601
|
||||
week number of a date.
|
||||
|
||||
- ENHANCEMENT: The "WEEK" special lets you annotate calendar output with the
|
||||
week number. The TkRemind, rem2ps and rem2html back-ends support WEEK.
|
||||
|
||||
- MINOR ENHANCEMENT: You can control whether timed reminders come before or
|
||||
after non-timed reminders with the "-g" flag.
|
||||
|
||||
- BUG FIX: TkRemind did not work correctly if ~/.reminders was a directory.
|
||||
|
||||
- BUG FIX: TkRemind incorrectly invoked Remind with the "-a" flag when
|
||||
showing today's reminders.
|
||||
|
||||
- BUG FIX: In certain cases, a trigger containing a day, month and
|
||||
weekday would fail if it needed to cross a year boundary. This has
|
||||
been fixed.
|
||||
|
||||
* Version 3.1 Patch 5 - 2008-04-15
|
||||
|
||||
- MAJOR ENHANCEMENT: If you supply a directory name on the command line
|
||||
or for an INCLUDE command, then Remind reads all *.rem file in that
|
||||
directory (in the order returned by "glob")
|
||||
|
||||
- ENHANCEMENT: The plain-text calendar ("-c") can draw lines using VT-100
|
||||
line-drawing characters if invoked as "-cl"
|
||||
|
||||
- ENHANCEMENT: The plain-text calendar can approximate SPECIAL COLOR reminders
|
||||
using VT-100 color escape sequences if invoked as "-cc". (You can combine
|
||||
the colors and line-drawing characters with -clc or -ccl.)
|
||||
|
||||
- ENHANCEMENT: The "-t" option can take a numeric argument n. In this case,
|
||||
all reminders are assumed to have a delta of +n. (Without the argument,
|
||||
an infinite delta is assumed, as before.) If a numeric argument is given,
|
||||
the new system variable $DeltaOffset is set to the argument.
|
||||
|
||||
- MINOR ENHANCEMENT: The "-i" command-line option can be used to define
|
||||
a function as well as set a variable.
|
||||
|
||||
- MINOR ENHANCEMENT: String constants can have embedded quotes "Like \"this"
|
||||
|
||||
- MINOR ENHANCEMENT: tkremind works better on small screens like that of
|
||||
the Eee-PC.
|
||||
|
||||
- BUG FIX: Minor fix to HTML output courtesy of Ian! Allen.
|
||||
|
||||
- BUG FIX: Parse error in calendar mode was fixed.
|
||||
|
||||
* Version 3.1 Patch 4 - 2008-02-03
|
||||
|
||||
- ENHANCMENT: tkremind respects the "-b1" option and operates in 24-hour
|
||||
clock mode if the option is supplied.
|
||||
|
||||
- ENHANCEMENT: tkremind has been tweaked to look better with Tcl/Tk 8.5.
|
||||
|
||||
- CLEANUP: Version is kept only in configure.in instead of two different
|
||||
places.
|
||||
|
||||
- CLEANUP: Added "const" qualifier to many places in the code that previously
|
||||
lacked it.
|
||||
|
||||
- BUG FIX: A rare parsing error involving interaction between SATISFY and
|
||||
SKIP has been fixed.
|
||||
|
||||
- BUG FIX: rem2html would output a horribly-wrong calendar for a 28-day
|
||||
February starting on Sunday (such as February 2009.) This has been fixed.
|
||||
|
||||
- BUG FIX: The "-ivar=value" command-line option failed if Remind re-execed
|
||||
itself because we overwrote argv[]. This has been fixed.
|
||||
|
||||
* Version 3.1 Patch 3 - 2007-10-15
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- rem2html now uses CSS for a much better-looking calendar.
|
||||
NOTE: rem2html was completely rewritten and some of the command-line
|
||||
options have changed!
|
||||
|
||||
- If a reminder has a DURATION clause, then the starting and ending times
|
||||
are output in calendar mode.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- DST rules in "defs.rem" were updated to reflect new US/Canadian DST rules.
|
||||
|
||||
- If a REM command cannot compute a trigger date, the SATISFY expression
|
||||
is not evaluated. This helps avoid spurious error messages in some
|
||||
reminders.
|
||||
|
||||
* Version 3.1 Patch 2 - 2007-09-12
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- build.tk tries to set defaults for location, paper size, etc from an
|
||||
existing "remind" installation if it detects one.
|
||||
|
||||
- In queue mode, wake up once a minute and recalibrate sleep time.
|
||||
This should make Remind work better on laptops that suspend or
|
||||
hibernate. Note that "remind -q" does *not* handle date-rollover
|
||||
well; it simply exits if it notices date rollover. "remind -z0"
|
||||
(as used by tkremind) handles date rollover properly; it rereads the
|
||||
reminder file and rebuilds the queue if it notices date rollover.
|
||||
|
||||
- tkremind: Added some key bindings to make navigation easier.
|
||||
|
||||
- tkremind: Made calendar boxes use space more efficiently.
|
||||
|
||||
- remind: The functionality of "rem" is now built into remind. If you
|
||||
invoke remind as "rem", then it uses a default filename. The installer
|
||||
sets up "rem" as a symbolic link to "remind".
|
||||
|
||||
+ CHANGE
|
||||
|
||||
- "remind -p" no longer sorts SPECIAL reminders before non-SPECIAL.
|
||||
|
||||
*** THIS MAY AFFECT BACKENDS ***
|
||||
|
||||
Backends supplied with Remind (rem2ps, rem2html and tkremind)
|
||||
are known to work properly.
|
||||
|
||||
- "remind -p" no longer suppresses any AT-time associated with SPECIAL
|
||||
reminders.
|
||||
|
||||
*** THIS MAY AFFECT BACKENDS ***
|
||||
|
||||
Backends supplied with Remind (rem2ps, rem2html and tkremind)
|
||||
are known to work properly.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- examples/defs.rem: A few corrections to Jewish holidays courtesy of
|
||||
Art Werschulz.
|
||||
|
||||
- src/Makefile.in: Added install-nostripped target.
|
||||
|
||||
- SPECIAL COLOR now works more like MSG, including proper support for AT and
|
||||
for the %" %" escape sequence.
|
||||
|
||||
- SPECIAL COLOR is queued correctly if it has an AT clause.
|
||||
|
||||
- Using the psshade() or psmoon() functions emits a warning on stderr. You
|
||||
should use SPECIAL SHADE or SPECIAL MOON instead.
|
||||
|
||||
* Version 3.1 Patch 1 - 2007-08-23
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
- Added the "nonomitted" function that solves a number of
|
||||
moving-reminder-in-response-to-holiday problems. The real-world
|
||||
problems solved are the "moving-garbage-day" problem and the
|
||||
"six-day-school-cycle" problem.
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- A few minor performance improvements in response to profiling runs.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Prevent compilation failure with gcc 2.95.
|
||||
|
||||
- Fix trailing "s" bug with -k option. This was fixed in Debian's release,
|
||||
but the Debian maintainer never bothered to let me know.
|
||||
|
||||
- Removed obsolete scripts: kall, rem, remind-all.sh, remind-all.csh
|
||||
|
||||
- Made "-n" output always use "/" as date separator for consistency with
|
||||
"-p" and "-s".
|
||||
|
||||
- Moon PNG images are transparent. Output of moon phases in rem2html
|
||||
improved slightly.
|
||||
|
||||
- Various man-page fixes.
|
||||
|
||||
* Version 3.1 Patch 0 - 2007-07-14
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
- Added the FROM clause. This lets you write reminders like:
|
||||
|
||||
REM Mon FROM 16 July 2007 UNTIL 13 Aug 2007 MSG Some Mondays...
|
||||
|
||||
- Remind now has a new datatype: A DATETIME object represents a date AND
|
||||
a time (to the nearest minute). DATETIME constants are written
|
||||
as '2007-09-01@14:33'. Various operators and functions have been
|
||||
modified to do sensible things with DATETIMEs and several new DATETIME
|
||||
functions have been added.
|
||||
|
||||
- The SPECIAL COLOR reminder type has been hacked to behave more like
|
||||
a MSG type. It sorts properly and is emitted as a normal reminder
|
||||
in non-calendar mode. Simlarly, SPECIAL HTML sorts with -g as well.
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- TkRemind can e-mail you reminders if you don't dismiss the popup window
|
||||
after one minute. This is useful if you need to leave your workstation
|
||||
but want reminders to "follow" you via e-mail.
|
||||
|
||||
- A new "-y" option to Remind generates tags for all reminders that lack
|
||||
a TAG clause. This may be useful for conversion tools that want each
|
||||
reminder to have a unique identifier.
|
||||
|
||||
- A new "tzconvert" function lets you convert datetimes between different
|
||||
time zones. It's only as good as your C library, so test thoroughly
|
||||
please! Based on a patch from Stefan Wehr.
|
||||
|
||||
- TkRemind sorts reminders by invoking Remind with the '-g' option.
|
||||
|
||||
- The time and date separator characters can be changed at runtime by
|
||||
setting $TimeSep and $DateSep respectively.
|
||||
|
||||
- The simple calendar ('-s') option can be immediately followed by an 'a'.
|
||||
This causes Remind to output reminders with deltas before the actual
|
||||
trigger date. Based loosely on an idea from Frank Terbeck.
|
||||
|
||||
+ MINOR CHANGES
|
||||
|
||||
- Default date separator is now '-' instead of '/'
|
||||
|
||||
- trigdate() and trigtime() behave differently - they return the integer 0
|
||||
if the last reminder could not be computed or did not have an AT clause
|
||||
(respectively).
|
||||
|
||||
- Maximum length of variable names has been increased from 12 to 16 characters.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed a potential memory leak in queue.c
|
||||
|
||||
- Fixed compile error on Mac OS X.
|
||||
|
||||
- Fixed behaviour of "-sa" option so deltas correctly obey omitted days
|
||||
and the scheduling function (if one is used).
|
||||
|
||||
- rem2ps would produce invalid PostScript in some rare cases
|
||||
(eg, for February 2007). This has been fixed.
|
||||
|
||||
* Version 3.0 Patch 24 - 2005-11-19
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Permit the DURATION of a reminder to be as high as you like. Previously,
|
||||
DURATIONs could be at most 23:59. Fix courtesy of Paul Pelzl.
|
||||
|
||||
- The "-n" flag can be usefully combined with "-s", "-p" and "-l" now.
|
||||
Fix courtesy of Paul Pelzl.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- The "-k" command escapes all characters except those known to be
|
||||
safe, rather than attempting to escape only characters thought to be
|
||||
unsafe.
|
||||
|
||||
- Removed the crufty code that supported non-ANSI C compilers.
|
||||
|
||||
- Removed all support for non-UNIX/non-Linux systems.
|
||||
|
||||
- Fixed a bug in the tokenizer that could make Remind segfault. Fix courtesy
|
||||
of Stan Tobias.
|
||||
|
||||
* Version 3.0 Patch 23 - 2005-04-14
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Added the COLOR special for putting colored reminders in the calendar.
|
||||
Supported by the HTML, Tcl/Tk and PostScript back-ends.
|
||||
|
||||
- Many minor tweaks to tkremind.
|
||||
|
||||
- Added ability to specify paper size in inches or centimetres to rem2ps.
|
||||
|
||||
- Added the "-l" option to Remind. This outputs additional information
|
||||
for back-end programs that use the "-p" output format. Currently
|
||||
used only by the "tkremind" back-end.
|
||||
|
||||
- Fixed dates for Yom Hazikaron and Yom Ha'atzmaut if 5 Iyar falls on a
|
||||
Saturday. (Hebrew calendar fix.)
|
||||
|
||||
- Added support for the Icelandic language, courtesy of Björn Davíðsson.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed parser error for unterminated date constant: '2005/01/01
|
||||
|
||||
* Version 3.0 Patch 22 - 2000-06-16
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Added option to have TkRemind display all of today's reminders in a text
|
||||
box on startup. This option is on by default.
|
||||
|
||||
- Makefile in "www" directory allows you to add ".cgi" suffix to CGI scripts.
|
||||
|
||||
- Added option to completely delete a reminder from the reminder file in
|
||||
the timed reminder popup dialog.
|
||||
|
||||
- Clarified build instructions.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed packing order in TkRemind so resizing window doesn't make control
|
||||
buttons disappear.
|
||||
|
||||
- Fixed serious bug in which background queued reminders were ignored and
|
||||
Remind simply exited. Doh! Sorry about that.
|
||||
|
||||
* Version 3.0 Patch 21 - 2000-03-15
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
- Updated copyright years and contact info.
|
||||
|
||||
- Changed GIF images to PNG to avoid patent problems.
|
||||
|
||||
- Added "cm2trem.tcl" to convert from CDE's "cm" calendar manager to Remind
|
||||
format. It handles only an older version of "cm" data; there is a utility
|
||||
available (under Solaris anyway) to convert newer files to the older "cm"
|
||||
format.
|
||||
|
||||
- Fixed the scripts in the "www" directory to install and work properly.
|
||||
|
||||
- Added "remind.vim" file for Vim syntax highlighting of Remind files,
|
||||
thanks to Davide Alberani.
|
||||
|
||||
- Added "dusk" and "dawn" built-in functions, thanks to Ron Aaron.
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Files for no-longer-supported platforms (OS/2, amiga, MS-DOS) have been
|
||||
moved to OBSOLETE subdirectory. They will disappear unless someone
|
||||
wants to maintain them.
|
||||
|
||||
- Fixed typo which caused compilation failure on compilers without function
|
||||
prototypes. Thanks to Ian Darwin for the patch.
|
||||
|
||||
- Fixed compilation problem on FreeBSD, IRIX, Tru64 and other UNIXes.
|
||||
|
||||
* Version 3.0 Patch 20 - 1999-04-12
|
||||
|
||||
+ LICENSE CHANGE
|
||||
|
||||
@@ -22,14 +723,12 @@ CHANGES TO REMIND
|
||||
|
||||
+ BUG FIXES
|
||||
|
||||
- Changed copyright notices to Roaring Penguin Software Inc.
|
||||
|
||||
- Rem2PS was passing specials like HTML, etc. in PostScript output.
|
||||
YECH! Fix courtesty of Derek J. Decker.
|
||||
|
||||
- Fixed a typo in danish.h, courtesy of Niels Kristian Bech Jensen.
|
||||
|
||||
* Version 3.0 Patch 19
|
||||
* Version 3.0 Patch 19 - 1998-05-09
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
@@ -71,7 +770,7 @@ CHANGES TO REMIND
|
||||
- Lots more silly little bugs squashed -- too many to go into in
|
||||
detail.
|
||||
|
||||
* Version 3.0 Patch 18
|
||||
* Version 3.0 Patch 18 - 1998-02-15
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
@@ -121,7 +820,7 @@ CHANGES TO REMIND
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed sunset(), sunrise() and minsfromutc() functions which were broken
|
||||
by 3.0.17. (In 3.0.17, they did not account for daylight savings time.)
|
||||
by 3.0.17. (In 3.0.17, they did not account for daylight saving time.)
|
||||
|
||||
- Updated "finnish.h" to include proper URL and translation of all
|
||||
error messages.
|
||||
@@ -135,7 +834,7 @@ CHANGES TO REMIND
|
||||
- Getting rid of fixed-sized buffers meant lots of changes to code.
|
||||
No doubt, I missed a few regression tests.
|
||||
|
||||
* Version 3.0 Patch 17
|
||||
* Version 3.0 Patch 17 - 1997-09-07
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
@@ -176,7 +875,7 @@ CHANGES TO REMIND
|
||||
library. All three of these fixes are courtesy of Christopher
|
||||
J. Madsen <madsen@iglobal.net>. Thanks, Christopher.
|
||||
|
||||
* Version 3.0 Patch 16
|
||||
* Version 3.0 Patch 16 - 1997-02-11
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
@@ -204,7 +903,7 @@ CHANGES TO REMIND
|
||||
- Fixed a problem under Solaris 2.5 whereby rem2ps was skipping some
|
||||
latin1 characters which it interpreted as white space.
|
||||
|
||||
* Version 3.0 Patch 15
|
||||
* Version 3.0 Patch 15 - 1996-10-27
|
||||
|
||||
+ IMPORTANT NOTES
|
||||
|
||||
@@ -234,7 +933,7 @@ CHANGES TO REMIND
|
||||
- Fixed bug in TkRemind which caused a crash if the "-m" option was used
|
||||
for a month beginning on Sunday. Doh!!!
|
||||
|
||||
* Version 3.0 Patch 14
|
||||
* Version 3.0 Patch 14 - 1996-05-25
|
||||
|
||||
+ CHANGE IN COPYING POLICY
|
||||
|
||||
@@ -293,7 +992,7 @@ CHANGES TO REMIND
|
||||
_not_ support MS Windows, and in fact do not allow Remind to run
|
||||
under Windows (see COPYRIGHT).
|
||||
|
||||
* Version 3.0 Patch 13
|
||||
* Version 3.0 Patch 13 - 1994-05-06
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
@@ -328,7 +1027,7 @@ CHANGES TO REMIND
|
||||
|
||||
- Updated the copyright notices everywhere.
|
||||
|
||||
* Version 3.0 Patch 12
|
||||
* Version 3.0 Patch 12 - 1994-02-01
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
@@ -347,7 +1046,7 @@ CHANGES TO REMIND
|
||||
- Fixed a problem with the '-k' option which resulted in a newline being
|
||||
placed after the message text. This was giving sh(1) heartburn...
|
||||
|
||||
* Version 3.0 Patch 11
|
||||
* Version 3.0 Patch 11 - 1993-11-26
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
@@ -427,7 +1126,7 @@ CHANGES TO REMIND
|
||||
|
||||
- Fixed the Finnish language support which was missing a few newlines.
|
||||
|
||||
* Version 3.0 Patch 9
|
||||
* Version 3.0 Patch 9 - 1993-10-04
|
||||
|
||||
+ NOTES
|
||||
|
||||
@@ -484,7 +1183,7 @@ CHANGES TO REMIND
|
||||
so that newlines in the body start new paragraphs, rather than being
|
||||
swallowed as white-space.
|
||||
|
||||
* Version 3.0 Patch 8
|
||||
* Version 3.0 Patch 8 - 1993-09-08
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
@@ -536,7 +1235,7 @@ CHANGES TO REMIND
|
||||
range [-128, 255] (but not 0) so that char(asc(s)) works even
|
||||
on machines with signed char types.
|
||||
|
||||
* Version 3.0 Patch 7
|
||||
* Version 3.0 Patch 7 - 1993-07-22
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
@@ -579,7 +1278,7 @@ CHANGES TO REMIND
|
||||
- Changed kall so that "kall sh" doesn't commit suicide - patch courtesy
|
||||
of Michael Salmon.
|
||||
|
||||
* Version 3.0 Patch 6
|
||||
* Version 3.0 Patch 6 - 1993-05-05
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
@@ -602,7 +1301,7 @@ CHANGES TO REMIND
|
||||
- Fixed a bug in the -u option which sometimes caused a core dump
|
||||
(embarrassed grin!) The fix is due to Tina Hoeltig. Thanks, Tina!
|
||||
|
||||
* Version 3.0 Patch 5
|
||||
* Version 3.0 Patch 5 - 1993-04-27
|
||||
|
||||
+ MAJOR ENHANCEMENTS:
|
||||
|
||||
@@ -637,7 +1336,7 @@ CHANGES TO REMIND
|
||||
|
||||
- Fixed a bug in the man page - thanks to Ed Oskiewicz.
|
||||
|
||||
* Version 3.0 Patch 4
|
||||
* Version 3.0 Patch 4 - 1993-03-08
|
||||
|
||||
- Added the -g option - this sorts reminders by date/time before
|
||||
issuing them. (You can see I'm running out of letters to
|
||||
@@ -696,13 +1395,13 @@ CHANGES TO REMIND
|
||||
|
||||
- Put my new mailing address in the README files.
|
||||
|
||||
* Version 3.0 Patch 3
|
||||
* Version 3.0 Patch 3 - 1993-02-21
|
||||
|
||||
- Corrected bugs in Remind and Rem2PS. No new features added. You
|
||||
should NOT use patch level 2 - either stick to 3.0.1 or upgrade to
|
||||
3.0.3.
|
||||
|
||||
* Version 3.0 Patch 2
|
||||
* Version 3.0 Patch 2 - 1993-02-04
|
||||
|
||||
- Added the -u option to Remind so that root can run it as any user.
|
||||
This simplifies the remind-all scripts, and makes them more efficient.
|
||||
@@ -742,7 +1441,7 @@ CHANGES TO REMIND
|
||||
- Changed Remind so that supplying the -a option causes timed reminders
|
||||
not to be placed into the calendar in calendar mode.
|
||||
|
||||
* Version 3.0 Patch 1
|
||||
* Version 3.0 Patch 1 - 1992-12-18
|
||||
|
||||
- Wrote the Rem2ps program to produce PostScript calendars
|
||||
|
||||
@@ -782,7 +1481,7 @@ CHANGES TO REMIND
|
||||
|
||||
- Re-formatted the WHATSNEW.30 file.
|
||||
|
||||
* Version 3.0
|
||||
* Version 3.0 - 1992-11-09
|
||||
|
||||
- Total rewrite from previous versions
|
||||
|
||||
@@ -803,23 +1502,23 @@ CHANGES TO REMIND
|
||||
- Fixed a lurking bug in trigger date calculation which, amazingly, had not
|
||||
been caught in the couple of years that Remind has been out!
|
||||
|
||||
* Version 2.3 Patch 5
|
||||
* Version 2.3 Patch 5 - 1992-04-11
|
||||
|
||||
- Added the "c+n" option for printing a calendar by
|
||||
weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
|
||||
|
||||
* Version 2.3 Patch 4
|
||||
* Version 2.3 Patch 4 - 1991-11-06
|
||||
|
||||
- Made the init.c file nicer. Made the Makefile
|
||||
prettier. Added "make test", "make tar" and "make shar" Makefile targets.
|
||||
|
||||
* Version 2.3 Patch 3
|
||||
* Version 2.3 Patch 3 - 1991-09-11
|
||||
|
||||
- Added a command-line option for Remind to process
|
||||
queued reminders in the foreground. This makes automatic termination
|
||||
of Remind processes from within X-Windows and Sunview easier.
|
||||
|
||||
* Version 2.3 Patch 2
|
||||
* Version 2.3 Patch 2 - 1991-07-19
|
||||
|
||||
- Fixed up a problem with timed reminders which resulted
|
||||
in cursor not starting from left side of screen on some systems.
|
||||
@@ -836,7 +1535,7 @@ CHANGES TO REMIND
|
||||
|
||||
- Made the Makefile more portable
|
||||
|
||||
* Version 2.3 Patch 1
|
||||
* Version 2.3 Patch 1 - 1991-03-08
|
||||
|
||||
- Added the "-t" command-line option to get Remind
|
||||
to trigger all non-expired reminders.
|
||||
@@ -850,7 +1549,7 @@ CHANGES TO REMIND
|
||||
|
||||
- Added manual pages for "kall" and "rem".
|
||||
|
||||
* Version 2.3
|
||||
* Version 2.3 - 1991-02-20
|
||||
|
||||
- Added the UNTIL keyword for forcing reminders to expire.
|
||||
|
||||
@@ -872,28 +1571,28 @@ CHANGES TO REMIND
|
||||
- Modified the calendar and SimpleCalendar formats so that the % escape
|
||||
substitutions ARE performed.
|
||||
|
||||
* Version 2.2 - Patch 5
|
||||
* Version 2.2 - Patch 5 - 1990-12-03
|
||||
|
||||
- Added the BEFORE, AFTER and SKIP tokens to make the
|
||||
handling of holidays more sensible. Also corrected a few more bugs.
|
||||
|
||||
* Version 2.2 - Patch 3
|
||||
* Version 2.2 - Patch 3 - 1990-11-28
|
||||
|
||||
- Added the MSG or RUN tokens in an OMIT command; also
|
||||
allowed RUN-type reminders to be explicitly included in the calendar by
|
||||
using the %" escape sequence.
|
||||
|
||||
* Version 2.2
|
||||
* Version 2.2 - 1990-11-16
|
||||
|
||||
- Added the AT keyword, the timed reminders daemon, and the
|
||||
calendar facility.
|
||||
|
||||
* Version 2.1
|
||||
* Version 2.1 - 1990-11-06
|
||||
|
||||
- Added the "repeat" token for repeating reminders with a period
|
||||
other than 7 days. Also fixed some bugs from version 2.0
|
||||
|
||||
* Version 2.0
|
||||
* Version 2.0 - 1990-11-01
|
||||
|
||||
- first public release. Included advanced date specifications,
|
||||
character substitution, and the RUN keyword.
|
||||
@@ -17,22 +17,17 @@
|
||||
# "#COLORS" for examples of ANSI color escape sequences. #
|
||||
# #
|
||||
# This file is part of REMIND. #
|
||||
# Copyright (C) 1992-1997 by David F. Skoll #
|
||||
# Copyright (C) 1999 by Roaring Penguin Software Inc. #
|
||||
# Copyright (C) 1992-2018 Dianne Skoll #
|
||||
# #
|
||||
#############################################################################
|
||||
|
||||
#
|
||||
# $Id: defs.rem,v 1.3 1999-04-05 17:34:38 dfs Exp $
|
||||
#
|
||||
|
||||
RUN OFF
|
||||
|
||||
################################################
|
||||
# Ensure required version of remind is used... #
|
||||
################################################
|
||||
IF version() < "03.00.19"
|
||||
ERRMSG This file requires at least version 03.00.19 of Remind.%
|
||||
IF version() < "03.01.09"
|
||||
ERRMSG This file requires at least version 03.01.09 of Remind.%
|
||||
ERRMSG This version is version [version()].
|
||||
EXIT
|
||||
ENDIF
|
||||
@@ -89,7 +84,6 @@ SET December 12
|
||||
###########################################################
|
||||
# Other symbolic constants and functions for "pasting"... #
|
||||
###########################################################
|
||||
|
||||
SET Quote CHAR(34)
|
||||
|
||||
# Handy constants/function for specifing week of month...
|
||||
@@ -97,75 +91,20 @@ SET Week_1 1
|
||||
SET Week_2 8
|
||||
SET Week_3 15
|
||||
SET Week_4 22
|
||||
FSET _last(mo) "1 " + MON((mo%12)+1)+" --7"
|
||||
|
||||
# Shorthand for commonly used expression...
|
||||
FSET _trig() TRIGGER(TRIGDATE())
|
||||
FSET _last(mo) "1 " + MON((mo%12)+1) + " --7"
|
||||
|
||||
# Handy function to provide SCANFROM dates...
|
||||
FSET _back(days) TRIGGER(TODAY()-days)
|
||||
|
||||
###########################################################
|
||||
# On MS-DOS systems, the standard C library functions are #
|
||||
# not reliable for computing offsets from local time to #
|
||||
# UTC. The following provides a work-around for the #
|
||||
# sunrise() and sunset() functions. Note, however, that #
|
||||
# if Daylight Savings Time is in effect for today(), the #
|
||||
# sun functions return times in DST even for dates on #
|
||||
# which DST is not in effect; the converse can also occur.#
|
||||
# #
|
||||
# Change the timezone to your timezone - the default is #
|
||||
# for EST which is 5 hours (300 minutes) behind UTC. #
|
||||
# The code is correct for places in which Daylight Savings#
|
||||
# Time begins on the last Sunday in April and ends on the #
|
||||
# last Sunday in October. #
|
||||
###########################################################
|
||||
|
||||
IF OSTYPE() == "MSDOS"
|
||||
# Eastern Standard Time
|
||||
SET TimeZone -300
|
||||
|
||||
# Use --8 rather than --7 because we want the last day BEFORE
|
||||
# the time switch occurs.
|
||||
REM Sun 1 May --8 SATISFY 1
|
||||
SET BegDst TRIGDATE()
|
||||
|
||||
REM Sun 1 Nov --8 SATISFY 1
|
||||
SET EndDst TRIGDATE()
|
||||
|
||||
SET $CalcUTC 0
|
||||
|
||||
# Check out the following IF statement and figure out why it works!
|
||||
IF EndDst < BegDst
|
||||
# Daylight Savings Time
|
||||
SET $MinsFromUTC TimeZone+60
|
||||
ELSE
|
||||
# Standard Time
|
||||
SET $MinsFromUTC TimeZone
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
###########################################################
|
||||
# Function which returns a string in "am/pm" format based #
|
||||
# on the time. For example, set a am_pm(NOW())... #
|
||||
###########################################################
|
||||
|
||||
FSET _am_pm(tm) IIF(tm<01:00, tm+12*60+"am", \
|
||||
tm<12:00, tm+"am", \
|
||||
tm<13:00, tm+"pm", \
|
||||
tm-12*60+"pm")
|
||||
FSET _back(days) $U-days
|
||||
|
||||
#################################################################
|
||||
# Function which removes a single leading zero from a string... #
|
||||
# Function that removes a single leading zero from a string... #
|
||||
#################################################################
|
||||
|
||||
FSET _no_lz(s) IIF(SUBSTR(s, 1, 1)=="0", SUBSTR(s, 2), s)
|
||||
|
||||
#################################################################
|
||||
# Return the length of the daylight/night portion of a date, #
|
||||
# in minutes. #
|
||||
#################################################################
|
||||
|
||||
FSET _light_len(date) MAX(SUNSET(date)-SUNRISE(date), 0)
|
||||
FSET _dark_len(date) 1440-_light_len(date)
|
||||
|
||||
@@ -173,26 +112,12 @@ FSET _dark_len(date) 1440-_light_len(date)
|
||||
# Function to calculate number of years since a given year #
|
||||
# or number of months since a given month and year... #
|
||||
############################################################
|
||||
|
||||
FSET _yr_num(yr) ORD(YEAR(TRIGDATE()) - yr)
|
||||
FSET _mo_num(mo, yr) ORD(12 * (YEAR(TRIGDATE()) - yr) + \
|
||||
MONNUM(TRIGDATE()) - mo)
|
||||
FSET _yr_num(yr) ORD($Ty - yr)
|
||||
FSET _mo_num(mo, yr) ORD(12 * ($Ty - yr) + $Tm - mo)
|
||||
|
||||
# Here's an example of how to use them:
|
||||
REM 1 Nov ++12 MSG %"Dean's [_yr_num(1984)] birthday%" is %b.
|
||||
REM 1 MSG Dean's [_mo_num(11, 1984)] 'monthly' anniversary
|
||||
|
||||
###########################################################
|
||||
# Function to send mail via elm's "fastmail" (by GMS!)... #
|
||||
###########################################################
|
||||
|
||||
#FSET _mail(from, subj) "mailx -s " + \
|
||||
# Quote + from + " : " + subj + Quote \
|
||||
# GETENV("LOGNAME") + " < /dev/null 1>&0"
|
||||
FSET _mail(from, subj) "fastmail -f " + \
|
||||
Quote + from + Quote + \
|
||||
" -s " + Quote + subj + Quote + \
|
||||
" /dev/null " + GETENV("LOGNAME")
|
||||
REM 1 Nov ++12 MSG %"John's [_yr_num(1984)] birthday%" is %b.
|
||||
REM 1 MSG John's [_mo_num(11, 1984)] 'monthly' anniversary
|
||||
|
||||
#############################################################################
|
||||
# Here's a tricky problem: The 4th of July is a holiday in the U.S.
|
||||
@@ -206,29 +131,28 @@ FSET _mail(from, subj) "fastmail -f " + \
|
||||
# dependent upon the current date, it's tricky and results may not be
|
||||
# what you expect. You should try to make sure that the OMIT context
|
||||
# "near" any current reminders will not change during a calendar run.
|
||||
# The SCANFROM clause should help make these OMITs very safe.
|
||||
# The SCANFROM clause will make these OMITs safe.
|
||||
############################################################################
|
||||
|
||||
# Calculate the weekday of the holiday.
|
||||
REM 4 July SCANFROM [_back(7)] SATISFY 1
|
||||
|
||||
IF WKDAYNUM(TRIGDATE()) == Sat
|
||||
REM [TRIGGER(TRIGDATE())] MSG Independence day (actual)
|
||||
OMIT [TRIGGER(TRIGDATE()-1)] MSG Independence day (observed)
|
||||
SET iday $T
|
||||
IF WKDAYNUM(iday) == Sat
|
||||
REM [iday] MSG Independence day (actual)
|
||||
OMIT [iday-1] MSG Independence day (observed)
|
||||
ELSE
|
||||
IF WKDAYNUM(TRIGDATE()) == Sun
|
||||
REM [TRIGGER(TRIGDATE())] MSG Independence day (actual)
|
||||
OMIT [TRIGGER(TRIGDATE()+1)] MSG Independence day (observed)
|
||||
IF WKDAYNUM(iday) == Sun
|
||||
REM [iday] MSG Independence day (actual)
|
||||
OMIT [iday+1] MSG Independence day (observed)
|
||||
ELSE
|
||||
OMIT [TRIGGER(TRIGDATE())] MSG Independence day
|
||||
OMIT [iday] MSG Independence day
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
############################################################################
|
||||
# #
|
||||
# A meeting on the first Monday of every month which is moved to the #
|
||||
# second Monday in the event of a holiday. #
|
||||
# #
|
||||
############################################################################
|
||||
|
||||
# First, the normal meeting. However, the SKIP keyword means this
|
||||
@@ -240,68 +164,21 @@ REM Mon 8 SATISFY 1
|
||||
|
||||
# But only actually trigger the delayed meeting if the previous
|
||||
# Monday was a holiday
|
||||
IF ISOMITTED(TRIGDATE()-7)
|
||||
REM [TRIGGER(TRIGDATE())] MSG Delayed meeting
|
||||
IF ISOMITTED($T-7)
|
||||
REM [$T] MSG Delayed meeting
|
||||
ENDIF
|
||||
|
||||
############################################################################
|
||||
# #
|
||||
# A very complicated reminder sent in by a Remind user. #
|
||||
# This person gets paid every two weeks, starting from 8 January 1993. #
|
||||
# If a pay date occurs before the twelfth of a month, then that #
|
||||
# he pays his mortgage on that pay date. Otherwise, he pays the mortgage #
|
||||
# on the previous pay date. Furthermore, he has to schedule his #
|
||||
# mortgage payment six days before it is due. He wants to be reminded #
|
||||
# a further four days before the scheduling deadline. He also #
|
||||
# wants to be mailed a notice two weeks before the scheduling deadline. #
|
||||
# #
|
||||
# Here's the solution - if you can follow this, consider yourself a #
|
||||
# Remind programmer extraordinaire! #
|
||||
# #
|
||||
############################################################################
|
||||
|
||||
# A function to determine whether or not a pay-date is a mortgage-date.
|
||||
|
||||
FSET _IsMortDate(x) DAY(x) < 12 || (DAY(x+14) >= 12 && DAY(x+14) <= 14)
|
||||
|
||||
# Paydays - for reference
|
||||
|
||||
REM 8 Jan 1993 *14 MSG Payday
|
||||
|
||||
# Calculate the mortgage payment six days ahead of time. Note that this
|
||||
# is done "implicitly" by subtracting 6 from the starting date - we start
|
||||
# on 2 Jan rather than 8 Jan. We add 6 to TRIGDATE() in _IsMortDate to
|
||||
# compensate.
|
||||
|
||||
REM 2 Jan 1993 *14 ++4 SATISFY [_IsMortDate(TRIGDATE()+6)] \
|
||||
MSG %"Schedule mortgage payment%" for %a.
|
||||
|
||||
# Now the mail reminder two weeks before the payment date - because two
|
||||
# weeks before a payment date is also a payment date, no pre-compensation
|
||||
# in the starting date of 8 Jan is necessary - convince yourself of this!
|
||||
# This uses the _mail() function defined earlier.
|
||||
|
||||
REM ONCE 8 Jan 1993 *14 SATISFY [_IsMortDate(TRIGDATE()+14)] \
|
||||
RUN [_mail("Decatur Federal", \
|
||||
"Pay mortgage by the " + ORD(DAY(TRIGDATE()+14)))]
|
||||
|
||||
# Make an entry on the calendar when the mortgage should be paid
|
||||
|
||||
REM 8 Jan 1993 *14 SATISFY [_IsMortDate(TRIGDATE())] \
|
||||
CAL Mortgage payment
|
||||
|
||||
##########################################################################
|
||||
# #
|
||||
# On our UNIX system, I run a program which queries the university #
|
||||
# On our UNIX system, I run a program that queries the university #
|
||||
# library and creates a file called ".booksdue". This file is #
|
||||
# a REMIND script to tell me when my library books are due. Here's #
|
||||
# an example from my reminder file - it shows the use of filedate(). #
|
||||
# When the .booksdue file is at least 7 days old, I create a new version #
|
||||
# by querying the library computer. Note the use of realtoday() rather #
|
||||
# than today. #
|
||||
# than today(). #
|
||||
# #
|
||||
##########################################################################
|
||||
|
||||
IF !$RunOff && !$CalMode && !$SimpleCal
|
||||
IF REALTODAY()-FILEDATE("/home/dfs/.booksdue") >= 7
|
||||
REM RUN /home/dfs/bilge/library/getbooks
|
||||
@@ -331,13 +208,13 @@ REM Sat Sun SPECIAL SHADE 220
|
||||
#############################################################################
|
||||
|
||||
SET SaveTrig $NumTrig
|
||||
SET easter EASTERDATE(YEAR(TODAY()))
|
||||
REM [TRIGGER(easter-46)] MSG %"Ash Wednesday%"
|
||||
REM [TRIGGER(easter-7)] MSG %"Palm Sunday%"
|
||||
OMIT [TRIGGER(easter-2)] MSG %"Good Friday%"
|
||||
OMIT [TRIGGER(easter)] MSG %"Easter%" Sunday
|
||||
REM [TRIGGER(easter+39)] MSG %"Ascension Day%"
|
||||
REM [TRIGGER(easter+49)] MSG %"Pentecost%"
|
||||
SET easter EASTERDATE($Uy)
|
||||
REM [easter-46] MSG %"Ash Wednesday%"
|
||||
REM [easter-7] MSG %"Palm Sunday%"
|
||||
OMIT [easter-2] MSG %"Good Friday%"
|
||||
OMIT [easter] MSG %"Easter%" Sunday
|
||||
REM [easter+39] MSG %"Ascension Day%"
|
||||
REM [easter+49] MSG %"Pentecost%"
|
||||
|
||||
# Some holidays are omitted, some are not. You may want to change
|
||||
# which ones are omitted - use the general forms shown below.
|
||||
@@ -349,9 +226,17 @@ REM Mon Jan [Week_3] MSG Martin Luther King - %"MLK Day%"
|
||||
REM Feb 2 MSG %"Ground Hog Day%"
|
||||
REM Feb 14 MSG %"Valentine's%" Day
|
||||
REM Mon Feb [Week_3] SCANFROM [_back(7)] SATISFY 1
|
||||
OMIT [_trig()] MSG %"President's Day%"
|
||||
OMIT [$T] MSG %"President's Day%"
|
||||
REM Mar 17 MSG %"St. Patrick's%" Day
|
||||
REM Sun Apr 1 ++2 MSG Daylight Savings Time - %"DST starts%" %b
|
||||
|
||||
# The DST rules are accurate for most locations in
|
||||
# North America
|
||||
REM Sun Apr 1 ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
|
||||
REM Sun Mar 8 ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
|
||||
|
||||
REM Sun [_last(Oct)] ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
|
||||
REM Sun 1 Nov ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
|
||||
|
||||
REM Apr 1 MSG %"April Fool's%" Day
|
||||
REM Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
|
||||
REM May 5 MSG %"Cinco de Mayo%"
|
||||
@@ -359,23 +244,23 @@ REM Sat May [Week_1] MSG %"Kentucky Derby%"
|
||||
REM Sun May [Week_2] MSG %"Mother's Day%"
|
||||
REM Sat May [Week_3] MSG %"Armed Forces Day%"
|
||||
REM Mon [_last(May)] SCANFROM [_back(7)] SATISFY 1
|
||||
OMIT [_trig()] MSG %"Memorial Day%"
|
||||
OMIT [$T] MSG %"Memorial Day%"
|
||||
REM Jun 14 MSG %"Flag Day%"
|
||||
REM Sun Jun [Week_3] MSG %"Father's Day%"
|
||||
REM Mon Sep [Week_1] SCANFROM [_back(7)] SATISFY 1
|
||||
OMIT [_trig()] MSG %"Labor Day%"
|
||||
OMIT [$T] MSG %"Labor Day%"
|
||||
REM Mon Oct [Week_2] MSG %"Columbus Day%"
|
||||
REM Nov 11 MSG %"Veterans Day%"
|
||||
REM Sun [_last(Oct)] MSG Daylight Savings Time - %"DST over%"
|
||||
|
||||
REM Oct 30 MSG %"Mischief Night%"
|
||||
REM Oct 31 MSG %"Halloween%"
|
||||
REM Tue Nov 2 SCANFROM [_back(7)] \
|
||||
SATISFY [(YEAR(TRIGDATE()) % 4) == 0] \
|
||||
SATISFY [($Ty % 4) == 0] \
|
||||
MSG %"Election%" Day
|
||||
REM Thu Nov [Week_4] SCANFROM [_back(7)] SATISFY 1
|
||||
OMIT [_trig()] MSG %"Thanksgiving%" Day
|
||||
OMIT [$T] MSG %"Thanksgiving%" Day
|
||||
REM Fri Nov [Week_4+1] SCANFROM [_back(7)] SATISFY 1
|
||||
OMIT [_trig()] MSG %"Thanksgiving%" (cont.)
|
||||
OMIT [$T] MSG %"Thanksgiving%" (cont.)
|
||||
OMIT Dec 24 MSG %"Christmas Eve%"
|
||||
OMIT Dec 25 MSG %"Christmas%" Day
|
||||
|
||||
@@ -390,13 +275,6 @@ if $NumTrig > SaveTrig
|
||||
REM SPECIAL SHADE 220
|
||||
endif
|
||||
|
||||
# Seasons (valid from 1992 to 2000)...
|
||||
REM Mar 20 MSG %"Spring%" begins
|
||||
REM Jun [IIF(YEAR(TODAY())%4, 21, 20)] MSG %"Summer%" begins
|
||||
REM Sep [CHOOSE(YEAR(TODAY())-1991, 22,22,23,23,22,22,22,23,22)] \
|
||||
MSG %"Fall%" begins
|
||||
REM Dec [IIF((YEAR(TODAY())+1)%4, 21, 22)] MSG %"Winter%" begins
|
||||
|
||||
#PSSTUFF2
|
||||
##########################################################################
|
||||
# #
|
||||
@@ -410,19 +288,19 @@ REM Dec [IIF((YEAR(TODAY())+1)%4, 21, 22)] MSG %"Winter%" begins
|
||||
# example, I recommend that you use the -sd 10 option for Rem2PS.
|
||||
REM PS Border Border moveto \
|
||||
/DayFont findfont DaySize scalefont setfont \
|
||||
([hebday(today())] [hebmon(today())]) show
|
||||
([hebday($U)] [hebmon($U)]) show
|
||||
|
||||
# Fill in the phases of the moon on the PostScript calendar
|
||||
[trigger(moondate(0))] SPECIAL MOON 0
|
||||
[trigger(moondate(1))] SPECIAL MOON 1
|
||||
[trigger(moondate(2))] SPECIAL MOON 2
|
||||
[trigger(moondate(3))] SPECIAL MOON 3
|
||||
[moondate(0)] SPECIAL MOON 0
|
||||
[moondate(1)] SPECIAL MOON 1
|
||||
[moondate(2)] SPECIAL MOON 2
|
||||
[moondate(3)] SPECIAL MOON 3
|
||||
|
||||
# The following example puts sunrise and sunset times in PostScript in the
|
||||
# calendar - the sizes are hard-coded, however, and work best in landscape.
|
||||
REM PS Border Border 5 sub moveto \
|
||||
/SmallFont findfont 4 scalefont setfont \
|
||||
(Sunrise: [sunrise(trigdate())] Sunset: [sunset(trigdate())]) show
|
||||
(Sunrise: [sunrise($T)] Sunset: [sunset($T)]) show
|
||||
|
||||
# The next one puts the day number (1-366) and days left in the year at the
|
||||
# bottom of the post-script calendar. Again, the hard-coded sizes work best
|
||||
@@ -430,7 +308,7 @@ REM PS Border Border 5 sub moveto \
|
||||
FSET _DayOfYear(x) x-(date(year(x),1,1) - 1)
|
||||
REM PS BoxWidth 3 mul 4 div Border 5 sub moveto \
|
||||
/SmallFont findfont 4 scalefont setfont \
|
||||
([_DayOfYear(today())]([365+isleap(today())-_DayOfYear(today())])) show
|
||||
([_DayOfYear($U)]([365+isleap($U)-_DayOfYear($U)])) show
|
||||
|
||||
#JHOLS
|
||||
##########################################################################
|
||||
@@ -439,7 +317,7 @@ REM PS BoxWidth 3 mul 4 div Border 5 sub moveto \
|
||||
# dates were obtained from "The First Jewish Catalog" by Richard Siegel #
|
||||
# and Michael and Sharon Strassfeld, published by the Jewish Publication #
|
||||
# Society of America. The Reform version of the calendar was guessed #
|
||||
# at by David Skoll based on experience. There is probably no standard #
|
||||
# at by Dianne Skoll based on experience. There is probably no standard #
|
||||
# Reform position on many of the holidays, so you may have to adjust #
|
||||
# the file as required. #
|
||||
# #
|
||||
@@ -469,9 +347,11 @@ SET InIsrael 0
|
||||
SET Reform 0
|
||||
|
||||
# Convenient function definition to save typing
|
||||
FSET _h(x, y) TRIGGER(HEBDATE(x,y))
|
||||
FSET _h2(x, y) HEBDATE(x, y, TODAY()-7)
|
||||
FSET _PastSat(x, y) TRIGGER(IIF(WKDAYNUM(_h2(x,y))!=6, _h2(x,y), _h2(x,y)+1))
|
||||
FSET _h(x, y) HEBDATE(x,y)
|
||||
FSET _h2(x, y) HEBDATE(x, y, $U-7)
|
||||
FSET _PastSat(x, y) IIF(WKDAYNUM(_h2(x,y))!=6, _h2(x,y), _h2(x,y)+1)
|
||||
FSET _PastSun(x, y) IIF(WKDAYNUM(_h2(x,y))!=0, _h2(x,y), _h2(x,y)+1)
|
||||
FSET _PastMon(x, y) IIF(WKDAYNUM(_h2(x,y))!=1, _h2(x,y), _h2(x,y)+1)
|
||||
|
||||
# Default values in case InIsrael and Reform are not set
|
||||
SET InIsrael VALUE("InIsrael", 0)
|
||||
@@ -492,7 +372,7 @@ IF !InIsrael
|
||||
[_h(16, "Tishrey")] MSG %"Sukkot 2%"
|
||||
ENDIF
|
||||
|
||||
[_h(21, "Tishrey")] ++4 MSG %"Hashana Rabba%" is %b.
|
||||
[_h(21, "Tishrey")] ++4 MSG %"Hoshana Rabba%" is %b.
|
||||
[_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b.
|
||||
|
||||
IF InIsrael
|
||||
@@ -502,7 +382,7 @@ ELSE
|
||||
ENDIF
|
||||
|
||||
# Because Kislev can change length, we must be more careful about Chanukah
|
||||
FSET _chan(x) TRIGGER(HEBDATE(24, "Kislev", today()-9)+x)
|
||||
FSET _chan(x) HEBDATE(24, "Kislev", $U-9)+x
|
||||
[_chan(1)] ++4 MSG %"Chanukah 1%" is %b.
|
||||
[_chan(2)] MSG %"Chanukah 2%"
|
||||
[_chan(3)] MSG %"Chanukah 3%"
|
||||
@@ -520,15 +400,17 @@ IF !Reform
|
||||
ENDIF
|
||||
|
||||
[_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b.
|
||||
[_h(15, "Adar A")] ++4 MSG %"Purim Katan%" is %b.
|
||||
[_h(14, "Adar A")] ++4 MSG %"Purim Katan%" is %b.
|
||||
[_h(15, "Adar A")] ++4 MSG %"Shushan Purim Katan%" is %b.
|
||||
|
||||
# If Purim is on Sunday, then Fast of Esther is 11 Adar.
|
||||
IF WKDAYNUM(_h2(13, "Adar")) != 6
|
||||
REM [TRIGGER(_h2(13, "Adar"))] ++4 MSG %"Fast of Esther%" is %b.
|
||||
REM [_h2(13, "Adar")] ++4 MSG %"Fast of Esther%" is %b.
|
||||
ELSE
|
||||
REM [TRIGGER(_h2(11, "Adar"))] ++4 MSG %"Fast of Esther%" is %b.
|
||||
REM [_h2(11, "Adar")] ++4 MSG %"Fast of Esther%" is %b.
|
||||
ENDIF
|
||||
[_h(14, "Adar")] ++4 MSG %"Purim%" is %b.
|
||||
[_h(15, "Adar")] ++4 MSG %"Shushan Purim%" is %b.
|
||||
[_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b.
|
||||
|
||||
IF !InIsrael
|
||||
@@ -541,9 +423,30 @@ IF !InIsrael && !Reform
|
||||
[_h(22, "Nisan")] MSG %"Pesach 8%"
|
||||
ENDIF
|
||||
|
||||
[_h(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
|
||||
[_h(4, "Iyar")] ++4 MSG %"Yom HaZikaron%" is %b.
|
||||
[_h(5, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
|
||||
REM [_PastSun(27, "Nisan")] SATISFY 1
|
||||
|
||||
IF $Tw == 5
|
||||
REM [_PastSun(26, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
|
||||
ELSE
|
||||
REM [_PastSun(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
|
||||
ENDIF
|
||||
|
||||
# If 4 Iyar is a Thursday or Friday, then Yom Hazikaron is
|
||||
# the Wednesday before and Yom Ha'atzmaut is on
|
||||
# Thursday. If 4 Iyar is a Sunday, then Yom Hazikaron
|
||||
# moves to 5 Iyar and Yom Ha'atzmaut to 6 Iyar.
|
||||
IF WKDAYNUM(_h2(4, "Iyar")) == 4 || WKDAYNUM(_h2(4, "Iyar")) == 5
|
||||
[_h(2, "Iyar")] ++4 MSG %"Yom Hazikaron%" is %b.
|
||||
[_h(3, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
|
||||
ELSE
|
||||
IF WKDAYNUM(_h2(4, "Iyar")) == 0
|
||||
[_h(5, "Iyar")] ++4 MSG %"Yom Hazikaron%" is %b.
|
||||
[_h(6, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
|
||||
ELSE
|
||||
[_h(4, "Iyar")] ++4 MSG %"Yom Hazikaron%" is %b.
|
||||
[_h(5, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
# Not sure about Reform's position on Lag B'Omer
|
||||
IF !Reform
|
||||
@@ -568,9 +471,9 @@ ENDIF
|
||||
# Counting the omer - do the whole spiel, i.e:
|
||||
# "This is the xth day of the omer, being y weeks and z days of the omer."
|
||||
# Nice Remind programming example here!
|
||||
SET ostart HEBDATE(16, "Nisan", TODAY()-50)
|
||||
IF ostart <= TODAY() && (TODAY() - ostart < 49)
|
||||
SET odays TODAY()-ostart+1
|
||||
SET ostart HEBDATE(16, "Nisan", $U-50)
|
||||
IF ostart <= $U && ($U - ostart < 49)
|
||||
SET odays $U-ostart+1
|
||||
IF odays < 7
|
||||
MSG %"%"Today is the [ORD(odays)] day of the Omer.
|
||||
ELSE
|
||||
@@ -588,8 +491,8 @@ ENDIF
|
||||
### for Friday and Saturday. Note: You must set your latitude, longitude
|
||||
### and possibly time zone for these to work properly!
|
||||
|
||||
REM Friday CAL Candle lighting at [sunset(trigdate())-18]
|
||||
REM Saturday CAL Havdalah at [sunset(trigdate())+42]
|
||||
REM Friday CAL Candle lighting at [sunset($T)-18]
|
||||
REM Saturday CAL Havdalah at [sunset($T)+42]
|
||||
|
||||
#COLORS
|
||||
##########################################################################
|
||||
|
||||
79
examples/remind.vim
Normal file
79
examples/remind.vim
Normal file
@@ -0,0 +1,79 @@
|
||||
" Vim syntax file
|
||||
" Language: Remind
|
||||
" Maintainer: Davide Alberani <alberanid@libero.it>
|
||||
" Last Change: 18 Sep 2009
|
||||
" Version: 0.5
|
||||
" URL: http://erlug.linux.it/~da/vim/syntax/remind.vim
|
||||
"
|
||||
" remind is a sophisticated reminder service
|
||||
" you can download remind from:
|
||||
" https://dianne.skoll.ca/projects/remind/
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" shut case off.
|
||||
syn case ignore
|
||||
|
||||
syn keyword remindCommands REM OMIT SET FSET UNSET
|
||||
syn keyword remindExpiry UNTIL FROM SCANFROM SCAN WARN SCHED THROUGH
|
||||
syn keyword remindTag PRIORITY TAG
|
||||
syn keyword remindTimed AT DURATION
|
||||
syn keyword remindMove ONCE SKIP BEFORE AFTER
|
||||
syn keyword remindSpecial INCLUDE INC BANNER PUSH-OMIT-CONTEXT PUSH CLEAR-OMIT-CONTEXT CLEAR POP-OMIT-CONTEXT POP COLOR COLOUR
|
||||
syn keyword remindRun MSG MSF RUN CAL SATISFY SPECIAL PS PSFILE SHADE MOON
|
||||
syn keyword remindConditional IF ELSE ENDIF IFTRIG
|
||||
syn keyword remindDebug DEBUG DUMPVARS DUMP ERRMSG FLUSH PRESERVE
|
||||
syn match remindComment "#.*$"
|
||||
syn region remindString start=+'+ end=+'+ skip=+\\\\\|\\'+ oneline
|
||||
syn region remindString start=+"+ end=+"+ skip=+\\\\\|\\"+ oneline
|
||||
syn match remindVar "\$[_a-zA-Z][_a-zA-Z0-9]*"
|
||||
syn match remindSubst "%[^ ]"
|
||||
syn match remindAdvanceNumber "\(\*\|+\|-\|++\|--\)[0-9]\+"
|
||||
" XXX: use different separators for dates and times?
|
||||
syn match remindDateSeparators "[/:@\.-]" contained
|
||||
syn match remindTimes "[0-9]\{1,2}[:\.][0-9]\{1,2}" contains=remindDateSeparators
|
||||
" XXX: why not match only valid dates? Ok, checking for 'Feb the 30' would
|
||||
" be impossible, but at least check for valid months and times.
|
||||
syn match remindDates "'[0-9]\{4}[/-][0-9]\{1,2}[/-][0-9]\{1,2}\(@[0-9]\{1,2}[:\.][0-9]\{1,2}\)\?'" contains=remindDateSeparators
|
||||
" This will match trailing whitespaces that seem to break rem2ps.
|
||||
" Courtesy of Michael Dunn.
|
||||
syn match remindWarning display excludenl "\S\s\+$"ms=s+1
|
||||
|
||||
|
||||
if version >= 508 || !exists("did_remind_syn_inits")
|
||||
if version < 508
|
||||
let did_remind_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink remindCommands Function
|
||||
HiLink remindExpiry Repeat
|
||||
HiLink remindTag Label
|
||||
HiLink remindTimed Statement
|
||||
HiLink remindMove Statement
|
||||
HiLink remindSpecial Include
|
||||
HiLink remindRun Function
|
||||
HiLink remindConditional Conditional
|
||||
HiLink remindComment Comment
|
||||
HiLink remindTimes String
|
||||
HiLink remindString String
|
||||
HiLink remindDebug Debug
|
||||
HiLink remindVar Identifier
|
||||
HiLink remindSubst Constant
|
||||
HiLink remindAdvanceNumber Number
|
||||
HiLink remindDateSeparators Comment
|
||||
HiLink remindDates String
|
||||
HiLink remindWarning Error
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "remind"
|
||||
|
||||
" vim: ts=8 sw=2
|
||||
25
man/cm2rem.1
Normal file
25
man/cm2rem.1
Normal file
@@ -0,0 +1,25 @@
|
||||
.TH CM2REM 1 "18 October 1999"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
cm2rem.tcl \- Convert Sun's "cm" input file to Remind format
|
||||
.SH SYNOPSIS
|
||||
.B cm2rem.tcl < cm_file > remind_file
|
||||
.SH DESCRIPTION
|
||||
\fBcm2rem.tcl\fR reads the Sun calendar manager data file and converts
|
||||
it into a \fBRemind\fR script. Note that \fBcm2rem.tcl\fR can convert
|
||||
\fIonly\fR version 3 calendar manager files. If you are using version 4
|
||||
files, there should be a system utility to convert them to version 3 files.
|
||||
.SH AUTHOR
|
||||
\fBcm2rem.tcl\fR was written by Dianne Skoll <dianne@skoll.ca>.
|
||||
.SH BUGS
|
||||
Not all of the Sun calendar manager options are respected. In particular,
|
||||
nothing is done for e-mail actions. Also, the resulting Remind script
|
||||
is not editable with \fBTkRemind\fR; you can only edit it with a text
|
||||
editor.
|
||||
.PP
|
||||
\fBcm2rem.tcl\fR requires Tcl/Tk version 8.0 or higher. The
|
||||
\fBtclsh\fR interpreter must be on your \fBpath\fR.
|
||||
|
||||
.SH SEE ALSO
|
||||
\fBremind(1)\fR, \fBtkremind(1)\fR
|
||||
|
||||
28
man/kall.1
28
man/kall.1
@@ -1,28 +0,0 @@
|
||||
.\" $Id: kall.1,v 1.2 1998-02-16 02:35:09 dfs Exp $
|
||||
.TH KALL 1 "15 February 1998"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
kall \- kill processes by command name
|
||||
.SH SYNOPSIS
|
||||
.B kall
|
||||
[\-\fIsignal\fR] prog1 [prog2...]
|
||||
.SH DESCRIPTION
|
||||
.B Kall
|
||||
sends the specified \fIsignal\fR (defaults to \fB-TERM\fR) to all processes
|
||||
whose command name is specified on the command line. For example:
|
||||
.PP
|
||||
.nf
|
||||
kall -HUP remind foobar
|
||||
.fi
|
||||
.PP
|
||||
sends a \fBHUP\fR signal to all \fIremind\fR and \fIfoobar\fR programs.
|
||||
Note that \fBkall\fR sends signals only to those processes owned by the
|
||||
user invoking \fBkall\fR.
|
||||
.SH AUTHOR
|
||||
David F. Skoll
|
||||
.SH BUGS
|
||||
.B Kall
|
||||
is a sh(1) script and depends on the behaviour of ps(1); thus, it is
|
||||
not especially portable.
|
||||
.SH SEE ALSO
|
||||
remind, rem
|
||||
39
man/rem.1
39
man/rem.1
@@ -1,35 +1,20 @@
|
||||
.\" $Id: rem.1,v 1.2 1998-02-16 02:35:09 dfs Exp $
|
||||
.TH REM 1 "15 February 1998"
|
||||
.TH REM 1 "1 January 2020"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
rem \- run 'remind' with a default reminder file
|
||||
rem \- Invoke Remind with a default filename
|
||||
.SH SYNOPSIS
|
||||
.B rem
|
||||
[\-F \fIfilename\fR] [\fIremind_options\fR] [\fIremind_params\fR]
|
||||
.B rem [\fIoptions\fR] [\fIdate\fR] [\fI*rep\fR] [\fItime\fR]
|
||||
.SH DESCRIPTION
|
||||
.B Rem
|
||||
runs the \fBremind\fR program with a default reminder file of
|
||||
"$HOME/.reminders". You can supply remind options on the command line,
|
||||
as well as a date specification, just as with \fBremind\fR.
|
||||
|
||||
If you don't want to use the default filename, you can override it with
|
||||
the "-F" option, followed by a space and a filename. (This, however,
|
||||
defeats the purpose of \fBrem\fR)
|
||||
\fBrem\fR is a symbolic link to \fBremind\fR. When \fBremind\fR
|
||||
determines that it has been invoked as \fBrem\fR, it uses a default
|
||||
filename rather than expecting a filename to be supplied on the command
|
||||
line.
|
||||
.PP
|
||||
For example, typing:
|
||||
.PP
|
||||
.nf
|
||||
rem -c 1 jan 1992
|
||||
.fi
|
||||
.PP
|
||||
has the same effect as typing:
|
||||
.PP
|
||||
.nf
|
||||
remind -c $HOME/.reminders 1 jan 1992
|
||||
.fi
|
||||
If the environment variable DOTREMINDERS is set, \fBremind\fR uses the
|
||||
value of DOTREMINDERS as the filename. Otherwise, \fBremind\fR uses
|
||||
the filename $HOME/.reminders
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
David F. Skoll
|
||||
Remind was written by Dianne Skoll <dianne@skoll.ca>
|
||||
.SH SEE ALSO
|
||||
remind, kall
|
||||
|
||||
\fBremind\fR
|
||||
|
||||
323
man/rem2ps.1
323
man/rem2ps.1
@@ -1,14 +1,13 @@
|
||||
.\" $Id: rem2ps.1,v 1.3 1999-04-13 01:46:18 dfs Exp $
|
||||
.TH REM2PS 1 "1 February 1998"
|
||||
.UC4
|
||||
.TH REM2PS 1 "5 January 2021"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
rem2ps \- draw a PostScript calendar from Remind output
|
||||
.SH SYNOPSIS
|
||||
.B rem2ps [\fIoptions\fR]
|
||||
.SH DESCRIPTION
|
||||
\fBRem2ps\fR reads the standard input, which should be the results of running
|
||||
\fBRemind\fR with the \fB\-p\fR option. It emits PostScript code (which
|
||||
draws a calendar) to the standard output.
|
||||
\fBRem2ps\fR reads the standard input, which should be the results of
|
||||
running \fBRemind\fR with the \fB\-p\fR or \fB\-pp\fR option. It
|
||||
emits PostScript code (which draws a calendar) to the standard output.
|
||||
.PP
|
||||
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
|
||||
@@ -30,6 +29,11 @@ include any document structuring comments in your prologue.
|
||||
Produce the calendar in landscape mode rather than the default
|
||||
portrait mode.
|
||||
.TP
|
||||
.B \-x
|
||||
When printing the calendar, place the day numbers in the top-left of each
|
||||
day's box. If this option is omitted, the day numbers appear in the
|
||||
top-right.
|
||||
.TP
|
||||
\fB\-c\fR[\fIn\fR]
|
||||
If \fIn\fR is omitted, disables the small calendars for next and previous
|
||||
months which are normally generated. If \fIn\fR is supplied, it can range
|
||||
@@ -78,10 +82,10 @@ Letter
|
||||
8.5 x 11 in.
|
||||
.TP
|
||||
Legal
|
||||
11 x 17 in.
|
||||
8.5 x 14 in.
|
||||
.TP
|
||||
Ledger
|
||||
8.5 x 14 in.
|
||||
11 x 17 in.
|
||||
.TP
|
||||
Statement
|
||||
5.5 x 8.5 in.
|
||||
@@ -112,11 +116,20 @@ Quarto
|
||||
.TP
|
||||
10x14
|
||||
10 x 14 in.
|
||||
.TP
|
||||
\fIX\fRx\fIY\fRin
|
||||
\fIX\fR by \fIY\fR inches, where \fIX\fR and \fIY\fR can be floating-point
|
||||
numbers.
|
||||
.TP
|
||||
\fIX\fRx\fIY\fRcm
|
||||
\fIX\fR by \fIY\fR centimetres, where \fIX\fR and \fIY\fR can be floating-point
|
||||
numbers.
|
||||
|
||||
.PP
|
||||
Type "rem2ps -m help" for a list of available media. Note that the media
|
||||
Type "rem2ps \-m help" for a list of available media. Note that the media
|
||||
type (and all \fBRem2ps\fR options) are case-sensitive. If you don't use
|
||||
the \fB\-m\fR option, the media defaults to a compiled-in default - this
|
||||
is usually Letter for North America and A4 for Europe. The "-m help"
|
||||
is usually Letter for North America and A4 for Europe. The "\-m help"
|
||||
option will display the compiled-in default.
|
||||
.RE
|
||||
.TP
|
||||
@@ -129,7 +142,7 @@ specifying:
|
||||
.RS
|
||||
.PP
|
||||
.nf
|
||||
-ftshe Helvetica -fd Helvetica-BoldOblique
|
||||
\-ftshe Helvetica \-fd Helvetica-BoldOblique
|
||||
.fi
|
||||
.PP
|
||||
In other words, the heading, entry and small-calendar fonts are set
|
||||
@@ -145,7 +158,7 @@ are equivalent to specifying:
|
||||
.RS
|
||||
.PP
|
||||
.nf
|
||||
-sthd 14 -se 8
|
||||
\-sthd 14 \-se 8
|
||||
.fi
|
||||
.PP
|
||||
In other words, the heading and day numbers are 14-point fonts, and the
|
||||
@@ -171,7 +184,7 @@ for good output:
|
||||
.PP
|
||||
.nf
|
||||
# This gives good results for putting into a binder
|
||||
rem2ps -ol 72 -sh 12
|
||||
rem2ps \-ol 72 \-sh 12
|
||||
.fi
|
||||
.SH USAGE
|
||||
To use \fBRem2ps\fR, you should pipe the output of \fBRemind\fR with the \fB\-p\fR
|
||||
@@ -179,14 +192,14 @@ option to \fBRem2ps\fR, and then send the result to a printer. This is most eas
|
||||
illustrated with examples:
|
||||
.PP
|
||||
.nf
|
||||
remind -p12 /dev/null 1 jan 1994 | rem2ps | lpr -Plaser
|
||||
remind \-p12 /dev/null 1 jan 1994 | rem2ps | lpr \-Plaser
|
||||
.fi
|
||||
.PP
|
||||
That example creates a blank calendar for the entire year of 1994, and
|
||||
sends it the the printer named "laser."
|
||||
.PP
|
||||
.nf
|
||||
remind -p ~/.reminders | rem2ps -l -sd 18 > cal.ps
|
||||
remind \-p ~/.reminders | rem2ps \-l \-sd 18 > cal.ps
|
||||
.fi
|
||||
.PP
|
||||
This reminder creates a calendar for the current month, filling in
|
||||
@@ -259,7 +272,7 @@ hold:
|
||||
.TP
|
||||
o
|
||||
The PostScript origin is at the bottom left-hand corner of the page, and
|
||||
PostScript units of 1/72" are in effect.
|
||||
PostScript units of 1/72 inch are in effect.
|
||||
.TP
|
||||
o
|
||||
The variables MinX, MinY, MaxX and MaxY define the bounding box within
|
||||
@@ -305,7 +318,13 @@ Use that file with the \fBRem2ps\fR \fB\-p\fR option to create calendars
|
||||
with the year and month in large grey letters in the background of the
|
||||
calendar.
|
||||
.PP
|
||||
.SH REM2PS INPUT FORMAT
|
||||
.SH REM2PS INPUT FORMAT (-P OPTION)
|
||||
The \fB\-p\fR option is an older, simpler interchange format used by
|
||||
\fBRemind\fR to communicate with back-ends. New back-ends are
|
||||
encoraged to support the new \fB\-pp\fR format preferably, though they
|
||||
are encouraged to support the older \fB\-p\fR format as well if the
|
||||
older format contains enough information for them to work properly.
|
||||
.PP
|
||||
\fBRemind \-p\fR sends the following lines to standard output.
|
||||
The information is designed to be easily parsed by back-end programs:
|
||||
.TP
|
||||
@@ -342,7 +361,9 @@ The remaining data consists of calendar entries, in the following format:
|
||||
\fIyyyy/mm/dd special tag dur time body\fR
|
||||
.PP
|
||||
Here, \fIyyyy\fR is the year, \fImm\fR is the month (01-12) and
|
||||
\fIdd\fR is the day of the month.
|
||||
\fIdd\fR is the day of the month. Note that the date components are
|
||||
always separated by "/" even if the date separator in \fBRemind\fR has
|
||||
been set to "-". The consistent use of "/" is designed to ease parsing.
|
||||
.PP
|
||||
\fIspecial\fR is a string used
|
||||
for "out-of-band" communication with back-ends. If the reminder
|
||||
@@ -352,7 +373,10 @@ Other back-ends may understand other specials. A back end should
|
||||
\fIsilently ignore\fR a reminder with a special it doesn't understand.
|
||||
.PP
|
||||
\fItag\fR is whatever tag the user provided with the \fBTAG\fR clause,
|
||||
or "*" if no tag was provided.
|
||||
or "*" if no tag was provided. If there is more than one \fBTAG\fR clause,
|
||||
the tags appear in a comma-separated list. For example, the command
|
||||
\fBREM TAG foo TAG bar TAG quux\fR would result in \fBfoo,bar,quux\fR
|
||||
in the \fItag\fR field.
|
||||
.PP
|
||||
\fIdur\fR is the \fBDURATION\fR value in minutes, or "*" if no duration
|
||||
was provided.
|
||||
@@ -362,6 +386,9 @@ was provided.
|
||||
.PP
|
||||
\fIbody\fR is the body of the reminder.
|
||||
.PP
|
||||
Future versions of \fBRemind\fR may add additional keys to the JSON
|
||||
object. Back-ends \fImust\fR ignore keys they don't recognize.
|
||||
.PP
|
||||
After a month's worth of reminders have been emitted, \fBRemind\fR
|
||||
emits the line:
|
||||
.PP
|
||||
@@ -370,11 +397,259 @@ emits the line:
|
||||
However, back-ends should keep reading until EOF in case more data for
|
||||
subsequent months is forthcoming.
|
||||
.PP
|
||||
.SH AUTHOR
|
||||
Rem2PS is now supported by Roaring Penguin Software
|
||||
Inc. (http://www.roaringpenguin.com)
|
||||
If you supply the \fB\-l\fR option to \fBremind\fR, then reminders
|
||||
may be preceded by a line that looks like this:
|
||||
.PP
|
||||
Rem2PS was written by David F. Skoll (dskoll@iname.com).
|
||||
\fB# fileinfo \fIlineno filename\fR
|
||||
.PP
|
||||
The word \fBfileinfo\fR is literal; \fIlineno\fR and \fIfilename\fR specify
|
||||
the line number and file name of the file containing the reminder. Back-ends
|
||||
that don't care about this information should ignore lines starting with
|
||||
"#" (except, of course, for the # rem2ps lines.)
|
||||
.PP
|
||||
.SH REM2PS PARTIAL JSON INPUT FORMAT (-PP OPTION)
|
||||
\fBRemind \-pp\fR sends the following lines to standard output. They
|
||||
are designed to be easily parsed, but contain much more information
|
||||
than the old-style \fBremind -p\fR output. The extra information
|
||||
contains a representation of the parsed "REM" statement, which could
|
||||
allow converters to better preserve semantics of a reminder. For
|
||||
example, this format passes enough information to allow a back-end to
|
||||
(in many cases) determine a reminder's recurrence rather than just treating
|
||||
each reminder as a one-off event.
|
||||
.PP
|
||||
The lines emitted by \fBremind \-pp\fR are as follows:
|
||||
.TP
|
||||
.B # rem2ps2 begin
|
||||
This line signifies the start of calendar data. Back-ends can search
|
||||
for it to verify they are being fed correct information. Note the
|
||||
"2" after "rem2ps", which distinguishes this format from the older \fB\-p\fR
|
||||
format.
|
||||
.TP
|
||||
\fImonth_name year num_days first_day monday_first\fR
|
||||
Same as the \fB\-p\fR format
|
||||
.TP
|
||||
\fIsun mon tue wed thu fri sat\fR
|
||||
Same as the \fB\-p\fR format
|
||||
.TP
|
||||
\fInext_mon next_days\fR
|
||||
Same as the \fB\-p\fR format
|
||||
.TP
|
||||
\fIprev_mon prev_days\fR
|
||||
Same as the \fB\-p\fR format
|
||||
.PP
|
||||
.B CALENDAR ENTRIES
|
||||
.PP
|
||||
The remaining data consists of calendar entries expressed as a JSON object
|
||||
on a single line. Each such line will begin with "{" and will be a well-formed
|
||||
JSON object. The keys that may be present in the JSON object are as
|
||||
follows:
|
||||
.TP
|
||||
.B date \fIYYYY-MM-DD\fR
|
||||
The \fbdate\fR key will \fIalways\fR be present; it is the trigger date
|
||||
of the reminder expressed as a string in the format \fIYYYY-MM-DD\fR
|
||||
.TP
|
||||
.B filename \fIf\fR
|
||||
The filename in which the reminder was found.
|
||||
.TP
|
||||
.B lineno \fIn\fR
|
||||
The line number within the file on which the reminder was found.
|
||||
.TP
|
||||
.B nonconst_expr 1
|
||||
If the reminder contained a non-constant expression that had to be evaluated
|
||||
to determine the trigger date, this key will be present with the value 1.
|
||||
If this key is present, then it is unsafe for a back-end to rely on
|
||||
recurrence semantics or even the semantics of any part of the parsed
|
||||
reminder, as they may have been computed in a way that cannot be expressed
|
||||
in JSON.
|
||||
.TP
|
||||
.B if_depth \fIn\fR
|
||||
If the reminder is inside one or more IF or ELSE statements, this key
|
||||
will be present and the value will be the number of nested IFs from
|
||||
the top-level to the reminder. Back-ends should be wary of
|
||||
interpreting recurrence semantics of reminders within an IF or ELSE
|
||||
block.
|
||||
.TP
|
||||
.B passthru \fIspecial\fR
|
||||
If the reminder was a SPECIAL reminder, the \fBpassthru\fR key will be
|
||||
present and the value will be the type of SPECIAL (such as SHADE, COLOR,
|
||||
MOON, etc.)
|
||||
.TP
|
||||
.B tags \fIdata\fR
|
||||
If any TAG clauses are present, the \fBtag\fR key will be present and consist
|
||||
of a comma-separated list of tags.
|
||||
.TP
|
||||
.B time \fIt\fR
|
||||
If an AT clause was present, this key will contain the time of the AT clause
|
||||
in minutes after midnight.
|
||||
.TP
|
||||
.B tdelta \fIn\fR
|
||||
If a time delta (+n after an AT clause) was present, this key contains the
|
||||
delta value in minutes.
|
||||
.TP
|
||||
.B trep \fIn\fR
|
||||
If a time repeat (*n after an AT clause) was present, this key contains the
|
||||
repeat value in minutes.
|
||||
.TP
|
||||
.B eventduration \fIn\fR
|
||||
If a DURATION clause was present, this key contains the event duration in
|
||||
minutes.
|
||||
.TP
|
||||
.B duration \fIn\fR
|
||||
If a DURATION clause was present, this key contains today's duration in
|
||||
minutes. See the \fBremind(1)\fR man page, "MULTI-DAY EVENTS", for a
|
||||
discussion of duration vs. event duration.
|
||||
.TP
|
||||
.B eventstart \fIdt\fR
|
||||
If an AT clause was present, this key contains the event start time in
|
||||
the format \fIYYYY-MM-DDTHH:MM\fR.
|
||||
.TP
|
||||
.B back \fIn\fR
|
||||
If the reminder contained a "back" clause (\-n or \-\-n), this key
|
||||
contains the back value. If the "back" value was \-n, the value will
|
||||
be positive; if it was \-\-n, the value will be negative.
|
||||
.TP
|
||||
.B delta \fIn\fR
|
||||
If the reminder contained a "delta" clause (\+n or \+\+n), this key
|
||||
contains the delta value. If the "delta" value was \+n, the value will
|
||||
be positive; if it was \+\+n, the value will be negative.
|
||||
.TP
|
||||
.B rep \fIn\fR
|
||||
If the reminder contained a "repeat" clause (*n), this key contains
|
||||
the repeat value.
|
||||
.TP
|
||||
.B skip \fItype\fR
|
||||
If the reminder contained a SKIP, BEFORE or AFTER keyword, then this
|
||||
key will contain that keyword.
|
||||
.TP
|
||||
.B localomit \fIarray\fR
|
||||
If the reminder contains a local OMIT keyword, this key will be present.
|
||||
Its value will be an array of English day names that are OMITted.
|
||||
.TP
|
||||
.B wd \fIarray\fR
|
||||
If the reminder contains one or more weekdays, this key will be present.
|
||||
Its value will be an array of English day names that are present.
|
||||
.TP
|
||||
.B d \fIn\fR
|
||||
If a day-of-month is present in the reminder specification, this key
|
||||
will be present and its value will be the day number.
|
||||
.TP
|
||||
.B m \fIn\fR
|
||||
If a month is present in the reminder specification, this key
|
||||
will be present and its value will be the month number.
|
||||
.TP
|
||||
.B y \fIn\fR
|
||||
If a year is present in the reminder specification, this key
|
||||
will be present and its value will be the year.
|
||||
.TP
|
||||
.B until \fIYYYY-MM-DD\fR
|
||||
If the reminder contains an UNTIL or THROUGH clause, this key
|
||||
will be present. Its value will be a string of the form YYYY-MM-DD.
|
||||
.TP
|
||||
.B once 1
|
||||
If the reminder contains a ONCE keyword, this key will be present
|
||||
with a value of 1.
|
||||
.TP
|
||||
.B scanfrom \fIYYYY-MM-DD\fR
|
||||
If the reminder contains a SCANFROM keyword, this key will be present
|
||||
and its value will be a string of the form YYYY-MM-DD.
|
||||
.TP
|
||||
.B from \fIYYYY-MM-DD\fR
|
||||
If the reminder contains a FROM keyword, this key will be present
|
||||
and its value will be a string of the form YYYY-MM-DD.
|
||||
.TP
|
||||
.B priority \fIn\fR
|
||||
The priority of the reminder. Always present; if no PRIORITY keyword
|
||||
is specified, then a reminder has a default priority of 5000.
|
||||
.TP
|
||||
.B r \fIn\fR
|
||||
For a SHADE or COLOR special, the red color component.
|
||||
.TP
|
||||
.B g \fIn\fR
|
||||
For a SHADE or COLOR special, the green color component.
|
||||
.TP
|
||||
.B b \fIn\fR
|
||||
For a SHADE or COLOR special, the blue color component.
|
||||
.TP
|
||||
.B body \fIbody\fR
|
||||
The body of the reminder to issue. Always present.
|
||||
.TP
|
||||
.B rawbody \fIraw\fR
|
||||
The "raw" body of the reminder, before any expression-pasting or
|
||||
substitution-sequence processing. If the raw body would be the same
|
||||
as the processed body, then this key is not present.
|
||||
.PP
|
||||
After a month's worth of reminders have been emitted, \fBRemind\fR
|
||||
emits the line:
|
||||
.PP
|
||||
\fB# rem2ps2 end
|
||||
.PP
|
||||
However, back-ends should keep reading until EOF in case more data for
|
||||
subsequent months is forthcoming.
|
||||
.PP
|
||||
|
||||
.SH REM2PS PURE JSON INPUT FORMAT (-PPP OPTION)
|
||||
\fBRemind \-ppp\fR emits \fIpure JSON\fR output. The format is
|
||||
as follows:
|
||||
.PP
|
||||
\fBRemind\fR outputs a JSON array. Each element of the array is a
|
||||
\fImonth descriptor\fR.
|
||||
.PP
|
||||
Each month descriptor is a JSON object with the following elements:
|
||||
.TP
|
||||
.B monthname \fIname\fR
|
||||
The name of the month.
|
||||
.TP
|
||||
.B year \fIyyyy\fR
|
||||
The year.
|
||||
.TP
|
||||
.B daysinmonnth \fIn\fR
|
||||
The number of days in the current month.
|
||||
.TP
|
||||
.B firstwkday \fIn\fR
|
||||
The weekday of the first day of the month (0 = Sunday, 1 = Monday, 6 = Saturday).
|
||||
.TP
|
||||
.B mondayfirst \fIn\fR
|
||||
An indicator of whether or not the calendar week should start with
|
||||
Sunday (n=0) or Monday (n=1).
|
||||
.TP
|
||||
.B daynames \fR[\fIdays\fR]
|
||||
A seven-element array of day names; each element is a string representing
|
||||
the names of the days from Sunday through Saturday.
|
||||
.TP
|
||||
.B prevmonthname \fIname\fR
|
||||
The name of the previous month.
|
||||
.TP
|
||||
.B daysinprevmonth \fIn\fR
|
||||
The number of days in the previous month.
|
||||
.TP
|
||||
.B prevmonthyear \fIyyyy\fR
|
||||
The year of the previous month. (The same as \fByear\fR unless the current
|
||||
month is January.)
|
||||
.TP
|
||||
.B nextmonthname \fIname\fR
|
||||
The name of the following month.
|
||||
.TP
|
||||
.B daysinnextmonth \fIn\fR
|
||||
The number of days in the following month.
|
||||
.TP
|
||||
.B nextmonthyear \fIyyyy\fR
|
||||
The year of the following month. (The same as \fByear\fR unless the
|
||||
current month is December.)
|
||||
.TP
|
||||
.B entries \fR[\fIarray\fR]
|
||||
The \fBentries\fR key consists of an array of calendar entries; each
|
||||
entry is a JSON object that has the same format as described in the
|
||||
\fBCALENDAR ENTRIES\fR section in the \fB\-PP FORMAT\fR section,
|
||||
\fIwith the following difference\fR: In \fB\-PP\fR mode, if a reminder
|
||||
has \fB%"\fR markers, only the text between the markers
|
||||
is included in the \fBbody\fR element. In \fB\-PPP\fR mode, the
|
||||
entire text \fIincluding\fR the \fB%"\fR markers is included and it's up to
|
||||
the back-end to extract the portion between the markers if that
|
||||
is desired.
|
||||
|
||||
|
||||
.SH AUTHOR
|
||||
Rem2PS was written by Dianne Skoll <dianne@skoll.ca>
|
||||
.SH BUGS
|
||||
All \fBRem2ps\fR options are case-sensitive, unlike \fBRemind\fR.
|
||||
Any time you supply
|
||||
@@ -387,4 +662,4 @@ You should ensure that the values you supply for margin widths are sensible.
|
||||
If they are too big for the media size, \fBRem2ps\fR will not complain,
|
||||
but again, the PostScript output will probably not work.
|
||||
.SH SEE ALSO
|
||||
\fBRemind\fR
|
||||
\fBremind\fR
|
||||
|
||||
1788
man/remind.1
1788
man/remind.1
File diff suppressed because it is too large
Load Diff
120
man/tkremind.1
120
man/tkremind.1
@@ -1,10 +1,9 @@
|
||||
.\" $Id: tkremind.1,v 1.8 1999-04-13 01:46:20 dfs Exp $ "
|
||||
.TH TKREMIND 1 "15 February 1998"
|
||||
.TH TKREMIND 1 "15 January 2021"
|
||||
.UC 4
|
||||
.SH NAME
|
||||
tkremind \- graphical front-end to Remind calendar program
|
||||
.SH SYNOPSIS
|
||||
.B tkremind \fR[\fIoptions\fR] [\fIread_file\fR] [\fIwrite_file\fR]
|
||||
.B tkremind \fR[\fIoptions\fR] [\fIread_file\fR] [\fIwrite_file\fR] [\fIconfig_file\fR]
|
||||
.SH DESCRIPTION
|
||||
\fBTkRemind\fR is a graphical front-end to the \fBRemind\fR program.
|
||||
It provides a friendly graphical interface which allows you to view
|
||||
@@ -22,6 +21,8 @@ extra features as you become a more sophisticated \fBRemind\fR programmer.
|
||||
on to \fBRemind\fR. The options it passes are
|
||||
\fB\-b\fR, \fB\-g\fR, \fB\-x\fR, \fB\-i\fR and \fB\-m\fR.
|
||||
See the \fBRemind\fR man page for details about the options.
|
||||
Note that \fBTkRemind\fR will respect the \fB\-m\fR and
|
||||
\fB\-b1\fR options and adjust its appearance accordingly.
|
||||
|
||||
\fIRead_file\fR is the file from which \fBTkRemind\fR reads reminders.
|
||||
It is in standard \fBRemind\fR format. \fIWrite_file\fR is the file
|
||||
@@ -40,6 +41,9 @@ include the line:
|
||||
.fi
|
||||
.PP
|
||||
|
||||
\fIConfig_file\fR is the file in which \fBTkRemind\fR stores
|
||||
its options. If it is omitted, it defaults to \fI$HOME/.tkremindrt\fR.
|
||||
|
||||
.SH THE CALENDAR WINDOW
|
||||
When you start \fBTkRemind\fR, it displays a calendar for the current
|
||||
month, with today's date highlighted. Reminders are filled into each
|
||||
@@ -50,11 +54,14 @@ notice that the box appears completely full.
|
||||
|
||||
.SH NAVIGATING
|
||||
To change to the previous or next month, click the \fB<\-\fR
|
||||
or \fB\->\fR button, respectively. To change back to
|
||||
the current month, click \fBToday\fR. To go to a specific month,
|
||||
click \fBGo To Date...\fR. This pops up a dialog box which allows you
|
||||
to select a month and enter a year. Once you've done this, click
|
||||
\fBGo\fR to go to the date, or \fBCancel\fR to cancel.
|
||||
or \fB\->\fR button, respectively. You can also use the left/right arrow
|
||||
keys or PageUp/PageDown to navigate.
|
||||
|
||||
To change back to the current month, click \fBToday\fR or press the
|
||||
Home key. To go to a specific month, click \fBGo To Date...\fR. This
|
||||
pops up a dialog box which allows you to select a month and enter a
|
||||
year. Once you've done this, click \fBGo\fR to go to the date, or
|
||||
\fBCancel\fR to cancel.
|
||||
|
||||
To exit \fBTkRemind\fR, click \fBQuit\fR.
|
||||
|
||||
@@ -73,7 +80,7 @@ The next control specifies an expiry date for the reminder. Select
|
||||
the check button to enable an expiry date, and fill in the values
|
||||
using pull-down menus.
|
||||
|
||||
The third control specifes how much advance notice you want (if any),
|
||||
The third control specifies how much advance notice you want (if any),
|
||||
and whether or not weekends and holidays are counted when computing advance
|
||||
notice.
|
||||
|
||||
@@ -103,7 +110,7 @@ edit the reminder, thereby gaining access to advanced features of
|
||||
\fBRemind\fR's idioms for expressing different types of reminders.
|
||||
|
||||
.SH PRINTING
|
||||
To print the current month's calender, 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
|
||||
either produces a PostScript file or sends PostScript to a UNIX command.
|
||||
|
||||
@@ -124,10 +131,11 @@ Select the appropriate paper size and orientation. Activate
|
||||
be the normal case unless you have many reminders in a particular
|
||||
day. (See the \fBRem2PS\fR documentation.)
|
||||
|
||||
Finally, click \fBPrint\fR to print or \fBCancel\fR to cancel.
|
||||
Note that during printing, \fBRemind\fR is \fInot\fR called with
|
||||
the \fB-itkremind=1\fR option, because it is operated in normal
|
||||
PostScript-producing mode.
|
||||
Finally, click \fBPrint\fR to print or \fBCancel\fR to cancel. Note
|
||||
that during printing, \fBRemind\fR is called with the
|
||||
\fB-itkremind=1\fR option and also an additional \fB-itkprint=1\fR
|
||||
option.
|
||||
|
||||
|
||||
.SH EDITING REMINDERS
|
||||
|
||||
@@ -149,6 +157,13 @@ in the \fBPreview reminder\fR dialog.
|
||||
If the reminder was not created with \fBTkRemind\fR, you can't edit
|
||||
it with \fBTkRemind\fR.
|
||||
|
||||
.SH USING A TEXT EDITOR
|
||||
|
||||
If you have set the "text editor" option correctly, right-clicking
|
||||
on a reminder will bring up a text editor on the file containing
|
||||
the reminder. The cursor will be positioned on the line that
|
||||
generated the reminder.
|
||||
|
||||
.SH BACKGROUND REMINDERS
|
||||
|
||||
If you create "timed" reminders, \fBTkRemind\fR will queue them in
|
||||
@@ -168,6 +183,12 @@ certain aspects of \fBTkRemind\fR. The configuration options are:
|
||||
If this is selected, \fBTkRemind\fR starts up iconified. Otherwise,
|
||||
it starts up in a normal window.
|
||||
|
||||
.TP
|
||||
.B Show Today's Reminders on Startup
|
||||
If this is selected, \fBTkRemind\fR shows a text window containing reminders
|
||||
which would be issued by "remind \-q \-a \-r" on startup, and when the date
|
||||
changes at midnight.
|
||||
|
||||
.TP
|
||||
.B Confirm Quit
|
||||
If this is selected, you will be asked to confirm when you press
|
||||
@@ -196,13 +217,66 @@ background reminder pops up.
|
||||
.TP
|
||||
.B Feed popped-up reminder to command's standard input
|
||||
If selected, feeds the text of the reminder to the command described
|
||||
above.
|
||||
above. The text of the reminder is prefixed by "HH:MM ", where HH:MM
|
||||
is the time of the reminder.
|
||||
|
||||
.TP
|
||||
.B E-mail reminders here if popup not dismissed
|
||||
If you enter a non-blank e-mail address in this field, then \fBTkRemind\fR
|
||||
will e-mail you a reminder if you don't dismiss the popup box within
|
||||
one minute. This is useful if you need to leave your terminal but
|
||||
want your reminders to "follow" you via e-mail.
|
||||
|
||||
.TP
|
||||
.B Name or IP address of SMTP server
|
||||
\fBTkRemind\fR uses a direct SMTP connection to send mail. Enter the
|
||||
IP address of your SMTP server here.
|
||||
|
||||
.TP
|
||||
.B Text Editor
|
||||
This specifies a text editor to invoke when a reminder is right-clicked.
|
||||
The characters "%d" are replaced with the lined number of the file
|
||||
containing the reminder, and "%s" are replaced with the file name.
|
||||
Useful strings might be "emacs +%d %s" or "gvim +%d %s"
|
||||
|
||||
.TP
|
||||
.B Extra Argument for Remind
|
||||
This specifies any extra arguments that should be passed to Remind
|
||||
when \BTkRemind\fR invokes \fBremind\fR. Unless you know what
|
||||
you are doing, leave this blank.
|
||||
|
||||
.TP
|
||||
.B Change entry font...
|
||||
This button pops up a font selection dialog that lets you change the
|
||||
font used to draw calendar items in the calendar boxes.
|
||||
|
||||
.TP
|
||||
.B Change heading font...
|
||||
Similar to Change entry font, but applies to calendar heading
|
||||
(the month and day names and the day numbers.)
|
||||
|
||||
.PP
|
||||
Once you've configured the options the way you like them,
|
||||
press \fBApply Options\fR to put them into effect, \fBSave Options\fR
|
||||
to put them into effect and save them in $HOME/.tkremindrc, or
|
||||
\fBCancel\fR to cancel any changes you made.
|
||||
|
||||
.SH KEYBOARD SHORTCUTS
|
||||
\fBTkRemind\fR's main window includes the following keyboard shortcuts:
|
||||
|
||||
.TP
|
||||
.B Ctrl-Q
|
||||
Quit
|
||||
.TP
|
||||
.B Left Arrow
|
||||
Previous Month
|
||||
.TP
|
||||
.B Right Arrow
|
||||
Next Month
|
||||
.TP
|
||||
.B Home
|
||||
Today
|
||||
|
||||
.SH ODDS AND ENDS
|
||||
\fBTkRemind\fR performs some basic consistency checks when you add or
|
||||
preview a reminder. However, if you edit a reminder in the previewer,
|
||||
@@ -218,7 +292,7 @@ the body. Furthermore, if you use expression-pasting in the body,
|
||||
When \fBTkRemind\fR invokes \fBRemind\fR, it supplies the option:
|
||||
.PP
|
||||
.nf
|
||||
-itkremind=1
|
||||
\-itkremind=1
|
||||
.fi
|
||||
.PP
|
||||
on the command line. So, in your \fBRemind\fR file, you can include:
|
||||
@@ -236,10 +310,12 @@ for \fBTkRemind\fR (for example).
|
||||
script file. It also places special comments in the reminder
|
||||
file to store additional state. You can certainly mix
|
||||
"hand-crafted" reminders with reminders created by \fBTkRemind\fR
|
||||
if you are awared of the following rules and limitations:
|
||||
if you are aware of the following rules and limitations:
|
||||
.TP
|
||||
o
|
||||
Do not use the \fBTAG\fR keyword in hand-crafted reminders.
|
||||
\fBTkRemind\fR uses \fBTAG\fRs of the form \fBTKTAG\fR\fInnn\fR
|
||||
where \fInnn\fR is a number. You should not use such \fBTAG\fRs
|
||||
in hand-crafted reminders.
|
||||
.TP
|
||||
o
|
||||
Do not edit lines starting with "# TKTAGnnn", "# TKEND", or any
|
||||
@@ -306,13 +382,9 @@ This line is emitted in response to a \fBSTATUS\fR command. The number
|
||||
\fIn\fR is the number of reminders in the queue.
|
||||
|
||||
.SH AUTHOR
|
||||
TkRemind is now supported by Roaring Penguin Software
|
||||
Inc. (http://www.roaringpenguin.com)
|
||||
.PP
|
||||
TkRemind was written by David F. Skoll (dskoll@iname.com)
|
||||
TkRemind was written by Dianne Skoll <dianne@skoll.ca>
|
||||
|
||||
\fBTkRemind\fR is Copyright 1996-1998 by David F. Skoll, Copyright
|
||||
1999 by Roaring Penguin Software Inc.
|
||||
\fBTkRemind\fR is Copyright 1996-2020 by Dianne Skoll.
|
||||
|
||||
.SH FILES
|
||||
|
||||
|
||||
23
remind.lsm
23
remind.lsm
@@ -1,23 +0,0 @@
|
||||
Begin3
|
||||
Title: Remind
|
||||
Version: 03.00.19
|
||||
Entered-date: 9 May 1998
|
||||
Description: Full-featured calendar/reminder program featuring
|
||||
sophisticated date calculation, moon phases, sunrise/sunset,
|
||||
Hebrew calendar, alarms, PostScript output, X-Windows
|
||||
front-end, multilingual messages, and proper handling of
|
||||
holidays. Available for UNIX, MS-DOS, OS/2, and other
|
||||
platforms. Includes scripts for making a nice WWW
|
||||
calendar server.
|
||||
Keywords: calendar reminder alarm datebook PostScript www
|
||||
Author: aa775@freenet.carleton.ca (David F. Skoll)
|
||||
Maintained-by: aa775@freenet.carleton.ca (David F. Skoll)
|
||||
Primary-site: ftp.doe.carleton.ca /pub/Remind-3.0
|
||||
266kB remind-3.0.19.tgz
|
||||
Alternate-site:
|
||||
Original-site:
|
||||
Platform: Linux, Solaris, SunOS, HP-UX -- virtually any UN*X-like
|
||||
system. Wish 8.x required for TCL/Tk front-end, but
|
||||
this is not essential to use the software.
|
||||
Copying-policy: GPL (No ports to MS Windows allowed)
|
||||
End
|
||||
@@ -1,10 +1,4 @@
|
||||
Files in this directory:
|
||||
|
||||
kall -- Kills a program by command name, as in "kall remind"
|
||||
rem -- Starts Remind with a default file of $HOME/.reminders
|
||||
remind-all.csh -- Mails reminders to all users (C-Shell version)
|
||||
remind-all.sh -- Mails reminders to all users (Bourne Shell version)
|
||||
tkremind* -- Tcl/Tk graphical calendar using Remind as engine
|
||||
|
||||
$Id: README,v 1.1 1998-01-15 02:50:20 dfs Exp $
|
||||
|
||||
tkremind -- Tcl/Tk graphical calendar using Remind as engine
|
||||
cm2rem.tcl -- Convert Sun's "cm" calendar manager files to Remind.
|
||||
|
||||
358
scripts/cm2rem.tcl
Normal file
358
scripts/cm2rem.tcl
Normal file
@@ -0,0 +1,358 @@
|
||||
#!/bin/sh
|
||||
# -*-Mode: TCL;-*-
|
||||
|
||||
#--------------------------------------------------------------
|
||||
# cm2rem.tcl
|
||||
#
|
||||
# A cheesy Tcl script to convert Sun's "cm" calendar manager
|
||||
# files (version 3 only) to Remind format.
|
||||
#
|
||||
# This file is part of REMIND.
|
||||
# Copyright (C) 1992-2018 by Dianne Skoll
|
||||
#
|
||||
#--------------------------------------------------------------
|
||||
|
||||
# the next line restarts using tclsh \
|
||||
exec tclsh "$0" "$@"
|
||||
|
||||
set i 0
|
||||
foreach month {January February March April May June
|
||||
July August September October November December} {
|
||||
incr i
|
||||
set MonthNum($month) $i
|
||||
set FullMonth([string range $month 0 2]) $month
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertParens
|
||||
# %ARGUMENTS:
|
||||
# line -- a line read from a cm file
|
||||
# %RETURNS:
|
||||
# A new line with all ( and ) outside quotes converted to { and }.
|
||||
# This cheap trick allows us to use Tcl's built-in list manipulation
|
||||
# functions to munge the line.
|
||||
#***********************************************************************
|
||||
proc convertParens { line } {
|
||||
# Convert all ( and ) to { and } unless they are inside a quoted
|
||||
# string
|
||||
set out ""
|
||||
set len [string length $line]
|
||||
set inQuotes 0
|
||||
for {set i 0} {$i < $len} {incr i} {
|
||||
set char [string range $line $i $i]
|
||||
if {$char == "\\" && $inQuotes} {
|
||||
append out $char
|
||||
incr i
|
||||
set char [string range $line $i $i]
|
||||
append out $char
|
||||
continue
|
||||
}
|
||||
|
||||
if {$char == "(" && !$inQuotes} {
|
||||
set char \{
|
||||
}
|
||||
|
||||
if {$char == ")" && !$inQuotes} {
|
||||
set char \}
|
||||
}
|
||||
|
||||
if {$char == "\""} {
|
||||
set inQuotes [expr !$inQuotes]
|
||||
}
|
||||
|
||||
append out $char
|
||||
}
|
||||
return $out
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: processLine
|
||||
# %ARGUMENTS:
|
||||
# line -- a line read from a cm file
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Processes a single line from the file, possibly writing a reminder
|
||||
# in Remind format to stdout
|
||||
#***********************************************************************
|
||||
proc processLine { line } {
|
||||
global Attributes
|
||||
global FullMonth
|
||||
|
||||
catch {unset Attributes}
|
||||
|
||||
# Only convert lines which start with "(add"
|
||||
if {[string range $line 0 3] != "(add"} {
|
||||
return
|
||||
}
|
||||
set line [convertParens $line]
|
||||
# Convert it to a list. CAREFUL: Potential security problem if
|
||||
# $line contains something nasty.
|
||||
|
||||
eval set line $line
|
||||
|
||||
set Attributes(body) ""
|
||||
foreach {key val} $line {
|
||||
switch -exact -- $key {
|
||||
"add" {
|
||||
set Attributes(date) $val
|
||||
}
|
||||
"what:" {
|
||||
append Attributes(body) $val
|
||||
}
|
||||
"details:" {
|
||||
append Attributes(body) $val
|
||||
}
|
||||
"duration:" {
|
||||
set Attributes(duration) $val
|
||||
}
|
||||
"period:" {
|
||||
set Attributes(period) $val
|
||||
}
|
||||
"ntimes:" {
|
||||
set Attributes(ntimes) $val
|
||||
}
|
||||
"attributes:" {
|
||||
set Attributes(action) $val
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if {[info exists Attributes(action)]} {
|
||||
# Nuke quotes and commas in action
|
||||
regsub -all {[,\"]} $Attributes(action) { } Attributes(action)
|
||||
|
||||
# Add spaces to pairs
|
||||
regsub -all \}\{ $Attributes(action) \}\ \{ Attributes(action)
|
||||
|
||||
# Add another pair of brackets to make a proper list
|
||||
set Attributes(action) "{$Attributes(action)}"
|
||||
|
||||
# Convert to a real Tcl list
|
||||
eval set Attributes(action) $Attributes(action)
|
||||
}
|
||||
# Split out date into month, day, year, time parts
|
||||
scan $Attributes(date) "%s%s%s%s%s" wkday month day time year
|
||||
set time [string range $time 0 4]
|
||||
set Attributes(wkday) $wkday
|
||||
set Attributes(month) $FullMonth($month)
|
||||
set Attributes(day) $day
|
||||
set Attributes(time) $time
|
||||
set Attributes(year) $year
|
||||
|
||||
# Convert newlines in body to spaces
|
||||
set body $Attributes(body)
|
||||
regsub -all "\n" $body " " body
|
||||
|
||||
# TODO: Escape BODY to get rid of [] chars.
|
||||
set Attributes(body) $body
|
||||
|
||||
# Convert to Reminder format
|
||||
convertReminder
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertReminder {} {
|
||||
global Attributes
|
||||
switch -exact $Attributes(period) {
|
||||
single { convertSingleReminder }
|
||||
daily { convertDailyReminder }
|
||||
weekly { convertWeeklyReminder }
|
||||
monthly { convertMonthlyReminder }
|
||||
yearly { convertYearlyReminder }
|
||||
default {
|
||||
puts "\# Unable to convert reminder with period $Attributes(period)"
|
||||
puts "\# Body is: $Attributes(body)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertSingleReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "single" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertSingleReminder {} {
|
||||
global Attributes
|
||||
puts "REM $Attributes(day) $Attributes(month) $Attributes(year) [at][duration]MSG $Attributes(body)"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertDailyReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "daily" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertDailyReminder {} {
|
||||
global Attributes
|
||||
set ntimes [expr $Attributes(ntimes) - 1]
|
||||
if {$ntimes <= 1} {
|
||||
convertSingleReminder
|
||||
return
|
||||
}
|
||||
set until [getUntilDate $Attributes(day) $Attributes(month) $Attributes(year) $ntimes]
|
||||
|
||||
puts "REM $Attributes(day) $Attributes(month) $Attributes(year) *1 [at][duration]UNTIL $until MSG $Attributes(body)"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertWeeklyReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "daily" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertWeeklyReminder {} {
|
||||
global Attributes
|
||||
set ntimes [expr $Attributes(ntimes) - 1]
|
||||
if {$ntimes <= 1} {
|
||||
convertSingleReminder
|
||||
return
|
||||
}
|
||||
set until [getUntilDate $Attributes(day) $Attributes(month) $Attributes(year) [expr $ntimes * 7]]
|
||||
|
||||
puts "REM $Attributes(day) $Attributes(month) $Attributes(year) *7 [at][duration]UNTIL $until MSG $Attributes(body)"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertMonthlyReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "monthly" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertMonthlyReminder {} {
|
||||
global Attributes
|
||||
set ntimes [expr $Attributes(ntimes) - 1]
|
||||
if {$ntimes <= 1} {
|
||||
convertSingleReminder
|
||||
return
|
||||
}
|
||||
|
||||
# If repetition > 1000, it's infinite
|
||||
if {$ntimes > 1000} {
|
||||
puts "REM $Attributes(day) [at][duration]MSG $Attributes(body)"
|
||||
return
|
||||
}
|
||||
|
||||
### UNTIL date is fudged!
|
||||
set until [getUntilDate $Attributes(day) $Attributes(month) $Attributes(year) [expr $ntimes * 30]]
|
||||
|
||||
puts "REM $Attributes(day) [at][duration]UNTIL $until MSG $Attributes(body)"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: convertYearlyReminder
|
||||
# %ARGUMENTS:
|
||||
# None -- uses global Attributes variable which must be filled in
|
||||
# %RETURNS:
|
||||
# Nothing
|
||||
# %DESCRIPTION:
|
||||
# Converts a reminder with "yearly" period to Remind format.
|
||||
#***********************************************************************
|
||||
proc convertYearlyReminder {} {
|
||||
global Attributes
|
||||
|
||||
# No special handling of ntimes et al.
|
||||
puts "REM $Attributes(day) $Attributes(month) [at][duration]MSG $Attributes(body)"
|
||||
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: at
|
||||
# %ARGUMENTS:
|
||||
# None -- uses Attributes global variable
|
||||
# %RETURNS:
|
||||
# A string providing the correct AT clause for a timed reminder.
|
||||
#***********************************************************************
|
||||
proc at {} {
|
||||
global Attributes
|
||||
if {![info exists Attributes(time)]} {
|
||||
return ""
|
||||
}
|
||||
if {"$Attributes(time)" == ""} {
|
||||
return ""
|
||||
}
|
||||
|
||||
return "AT $Attributes(time) "
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: duration
|
||||
# %ARGUMENTS:
|
||||
# None -- uses Attributes global variable
|
||||
# %RETURNS:
|
||||
# A string providing the correct DURATION clause for a timed reminder.
|
||||
#***********************************************************************
|
||||
proc duration {} {
|
||||
global Attributes
|
||||
if {![info exists Attributes(duration)]} {
|
||||
return ""
|
||||
}
|
||||
if {"$Attributes(duration)" == ""} {
|
||||
return ""
|
||||
}
|
||||
set h [expr $Attributes(duration) / 3600]
|
||||
set remainder [expr $Attributes(duration) - $h*3600]
|
||||
set m [expr $remainder / 60]
|
||||
return "DURATION [format "%d:%02d " $h $m]"
|
||||
}
|
||||
|
||||
#***********************************************************************
|
||||
# %PROCEDURE: getUntilDate
|
||||
# %ARGUMENTS:
|
||||
# day, month, year -- a date
|
||||
# days -- number of days to add to date
|
||||
# %RETURNS:
|
||||
# The date which is "days" later than supplied date in a correct UNTIL
|
||||
# format.
|
||||
#***********************************************************************
|
||||
proc getUntilDate { day month year days } {
|
||||
global RemindPipe
|
||||
global MonthNum
|
||||
set date "'$year/$MonthNum($month)/$day'"
|
||||
puts $RemindPipe "MSG \[trigger($date + $days)\]%"
|
||||
puts $RemindPipe "flush"
|
||||
flush $RemindPipe
|
||||
gets $RemindPipe line
|
||||
return $line
|
||||
}
|
||||
|
||||
catch {wm withdraw .}
|
||||
# Start a Remind process to issue reminders
|
||||
if {[catch {set RemindPipe [open "|remind -" "r+"]} err]} {
|
||||
puts stderr "Error: Cannot run Remind: $err"
|
||||
exit 1
|
||||
}
|
||||
|
||||
puts $RemindPipe "banner %"
|
||||
flush $RemindPipe
|
||||
|
||||
# Write some blurb
|
||||
puts "\# Reminder file converted from \"cm\" data by cm2rem.tcl"
|
||||
puts ""
|
||||
|
||||
while {[gets stdin line] >= 0} {
|
||||
processLine $line
|
||||
}
|
||||
exit 0
|
||||
42
scripts/kall
42
scripts/kall
@@ -1,42 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $Id: kall,v 1.1 1998-01-15 02:50:20 dfs Exp $
|
||||
#
|
||||
# kall - kill all processes belonging to this user that match
|
||||
# specified string.
|
||||
|
||||
signal=`echo $1 | grep '^\-.*'`
|
||||
me=`basename $0`
|
||||
|
||||
if [ "$signal" != "" ]; then
|
||||
shift
|
||||
else
|
||||
signal="-TERM"
|
||||
fi
|
||||
|
||||
if [ "$1" = "" ]; then
|
||||
echo "usage: $me [-signal] string [string...]"
|
||||
echo " kills all of your processes where command name matches"
|
||||
echo " any of the given strings."
|
||||
exit
|
||||
fi
|
||||
|
||||
msg="0"
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
|
||||
# NOTE: You may have to modify the next line, since PS is non-portable.
|
||||
# The 'awk' command picks out the process IDs to pass them on to kill.
|
||||
rprocs=`ps cx | awk '{if(prog == $NF && $1 != mypid) print $1}' prog=$1 mypid=$$ -`
|
||||
if [ "$rprocs" != "" ]; then
|
||||
msg="1"
|
||||
echo -n "${me}: Sending $signal signal to $1 process(es)"
|
||||
echo '...'
|
||||
kill $signal $rprocs
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if [ $msg = "1" ]; then
|
||||
echo "${me}: Done."
|
||||
fi
|
||||
45
scripts/rem
45
scripts/rem
@@ -1,45 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# rem - by David Skoll - 26 February 1991
|
||||
#
|
||||
# $Id: rem,v 1.1 1998-01-15 02:50:21 dfs Exp $
|
||||
#
|
||||
# This script runs 'remind' with a default reminder file assumed. You
|
||||
# can override the default by using "rem -F newfile ..." (But why would
|
||||
# you use rem unless you wanted to accept the default??)
|
||||
|
||||
# ------ You may wish to change the defaults below this line ------
|
||||
|
||||
# The default reminder file
|
||||
DEFAULT=$HOME/.reminders
|
||||
|
||||
# The executable file (you may wish to change this to /usr/local/bin/remind
|
||||
# or whatever.
|
||||
EXECUTABLE=remind
|
||||
|
||||
# No options yet
|
||||
OPTIONS=""
|
||||
|
||||
# No parameters yet
|
||||
PARAMETERS=""
|
||||
|
||||
# ------ You shouldn't change anything below this line -----
|
||||
|
||||
# Scan for options
|
||||
while test "$1" != ""
|
||||
do
|
||||
case $1 in
|
||||
|
||||
-F) DEFAULT=$2
|
||||
shift
|
||||
shift ;;
|
||||
|
||||
-*) OPTIONS="$OPTIONS $1"
|
||||
shift ;;
|
||||
|
||||
*) PARAMETERS=$*
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
$EXECUTABLE $OPTIONS $DEFAULT $PARAMETERS
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/bin/csh -f
|
||||
|
||||
# Shell script to mail all users reminders.
|
||||
|
||||
# $Id: remind-all.csh,v 1.1 1998-01-15 02:50:21 dfs Exp $
|
||||
|
||||
# Run it AFTER MIDNIGHT so that date is correct!
|
||||
# On our system, we have the following in our crontab:
|
||||
# 05 5 * * * /usr/share/lib/remind/remind-all > /dev/null 2>&1
|
||||
|
||||
# This script must be run by root. The -u option MUST be supplied
|
||||
# to Remind, or a severe security hole will exist. Note that Remind
|
||||
# must be compiled to support the -u option for this script to work.
|
||||
# Also, the -r and -q options must be used.
|
||||
|
||||
# The following line gets a list of users for systems using SUN's
|
||||
# NIS service:
|
||||
set USERS = `ypcat passwd | awk -F: '{print $1}'`
|
||||
|
||||
# The following line gets a list of users by examining /etc/passwd:
|
||||
# set USERS = `awk -F: '{print $1}' /etc/passwd`
|
||||
|
||||
# If neither of the above methods works, you must come up with some
|
||||
# way of getting a list of users on the system
|
||||
|
||||
# Set the following variables as appropriate for your system
|
||||
set REMIND = /usr/local/bin/remind
|
||||
set MAIL = /usr/ucb/mail
|
||||
set RM = "/usr/bin/rm -f"
|
||||
|
||||
set REMFILE = /tmp/RemFile.$$
|
||||
|
||||
# Scan each user's directory for a .reminders file
|
||||
foreach i ($USERS)
|
||||
if (-r ~$i/.reminders) then
|
||||
# echo "$i has a .reminders file." DEBUGGING PURPOSES ONLY
|
||||
|
||||
$REMIND -u$i -h -r -q -iremind_all=1 ~$i/.reminders < /dev/null > $REMFILE
|
||||
if (! -z $REMFILE) then
|
||||
# echo "Sending mail to $i" DEBUGGING PURPOSES ONLY
|
||||
|
||||
$MAIL -s "Reminders" $i < $REMFILE
|
||||
endif
|
||||
$RM $REMFILE
|
||||
endif
|
||||
end
|
||||
@@ -1,55 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Shell script to mail all users reminders.
|
||||
|
||||
# This file is part of REMIND
|
||||
#
|
||||
# $Id: remind-all.sh,v 1.3 1999-04-05 17:34:40 dfs Exp $
|
||||
#
|
||||
# REMIND is Copyright (C) 1992-1998 by David F. Skoll
|
||||
# Copyright (C) 1999 by Roaring Penguin Software Inc.
|
||||
# This file is Copyright (C) 1990 by Bill Aten
|
||||
|
||||
# Thanks to Bill Aten for this script.
|
||||
|
||||
# Run it AFTER MIDNIGHT so that date is correct!
|
||||
# On our system, we have the following in our crontab:
|
||||
# 02 00 * * * /usr/local/adm/remind-all >/dev/null 2>&1
|
||||
|
||||
# This script must be run by root. The -u option MUST be supplied
|
||||
# to Remind, or a severe security hole will exist. Note that Remind
|
||||
# must be compiled to support the -u option for this script to work.
|
||||
# Also, the -r and -q options must be used.
|
||||
|
||||
# The following line gets a list of users for systems using SUN's
|
||||
# NIS service:
|
||||
# USERS=`ypcat passwd | awk -F: '{print $1}'`
|
||||
|
||||
# The following line gets a list of users by examining /etc/passwd:
|
||||
USERS=`awk -F: '{print $1}' /etc/passwd`
|
||||
|
||||
# If neither of the above methods works, you must come up with some
|
||||
# way of getting a list of users on the system
|
||||
|
||||
# Set the following variables as appropriate for your system
|
||||
REMIND=/usr/local/bin/remind
|
||||
MAIL=/usr/bin/mail
|
||||
RM="/bin/rm -f"
|
||||
|
||||
REMFILE=/tmp/RemFile.$$
|
||||
|
||||
# Scan each user's directory for a .reminders file
|
||||
for i in $USERS
|
||||
do
|
||||
HOME=`grep \^$i: /etc/passwd | awk -F: '{print $6}'`
|
||||
if [ -r $HOME/.reminders ]; then
|
||||
|
||||
# echo "$i has a .reminders file." DEBUGGING PURPOSES ONLY
|
||||
|
||||
$REMIND -u$i -h -r -q -iremind_all=1 $HOME/.reminders < /dev/null > $REMFILE
|
||||
if [ -s $REMFILE ]; then
|
||||
# echo "Sending mail to $i" DEBUGGING PURPOSES ONLY
|
||||
$MAIL -s "Reminders" $i < $REMFILE
|
||||
fi
|
||||
$RM $REMFILE
|
||||
fi
|
||||
done
|
||||
2884
scripts/tkremind
2884
scripts/tkremind
File diff suppressed because it is too large
Load Diff
@@ -1,62 +1,72 @@
|
||||
# Makefile.in for REMIND
|
||||
#
|
||||
# $Id: Makefile.in,v 1.11 1998-05-10 02:19:20 dfs Exp $
|
||||
#
|
||||
|
||||
VERSION= 03.00.19
|
||||
SHELL= /bin/sh
|
||||
|
||||
BETA = 1
|
||||
srcdir=@srcdir@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
mandir=@mandir@
|
||||
bindir=@bindir@
|
||||
datadir=@datadir@
|
||||
datarootdir=@datarootdir@
|
||||
VPATH=$(srcdir)
|
||||
VERSION=@VERSION@
|
||||
|
||||
INSTALL=@INSTALL@
|
||||
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
||||
INSTALL_DATA=@INSTALL_DATA@
|
||||
|
||||
PROGS= remind rem2ps
|
||||
SCRIPTS= $(srcdir)/../scripts/kall $(srcdir)/../scripts/rem \
|
||||
$(srcdir)/../scripts/tkremind
|
||||
MANS= $(srcdir)/../man/kall.1 $(srcdir)/../man/rem.1 \
|
||||
$(srcdir)/../man/rem2ps.1 $(srcdir)/../man/remind.1 \
|
||||
$(srcdir)/../man/tkremind.1
|
||||
SCRIPTS= $(srcdir)/../scripts/tkremind $(srcdir)/../scripts/cm2rem.tcl
|
||||
|
||||
MANS= $(srcdir)/../man/rem2ps.1 $(srcdir)/../man/remind.1 \
|
||||
$(srcdir)/../man/tkremind.1 $(srcdir)/../man/cm2rem.1 \
|
||||
$(srcdir)/../man/rem.1
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
REMINDSRCS= calendar.c dynbuf.c dorem.c dosubst.c expr.c files.c funcs.c \
|
||||
globals.c hbcal.c init.c main.c moon.c omit.c queue.c sort.c \
|
||||
token.c trigger.c userfns.c utils.c var.c
|
||||
globals.c hbcal.c init.c main.c md5.c moon.c omit.c queue.c \
|
||||
sort.c token.c trigger.c userfns.c utils.c var.c
|
||||
|
||||
REMINDHDRS=config.h custom.h dynbuf.h err.h expr.h globals.h lang.h \
|
||||
md5.h protos.h rem2ps.h types.h version.h
|
||||
REMINDOBJS= $(REMINDSRCS:.c=.o)
|
||||
|
||||
all: remind rem2ps
|
||||
|
||||
test: remind
|
||||
sh ../tests/test-rem
|
||||
@sh ../tests/test-rem
|
||||
|
||||
.c.o:
|
||||
@CC@ -c @CFLAGS@ @DEFS@ $(LANGDEF) -DUNIX -I. -I$(srcdir) $<
|
||||
@CC@ -c @CPPFLAGS@ @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -I. -I$(srcdir) $<
|
||||
|
||||
rem2ps: rem2ps.o dynbuf.o
|
||||
@CC@ @LDFLAGS@ -o rem2ps rem2ps.o dynbuf.o
|
||||
$(REMINDOBJS): $(REMINDHDRS)
|
||||
|
||||
rem2ps: rem2ps.o dynbuf.o json.o
|
||||
@CC@ @LDFLAGS@ $(LDEXTRA) -o rem2ps rem2ps.o dynbuf.o json.o -lm
|
||||
|
||||
remind: $(REMINDOBJS)
|
||||
@CC@ @LDFLAGS@ -o remind $(REMINDOBJS) @LIBS@
|
||||
@CC@ @LDFLAGS@ $(LDEXTRA) -o remind $(REMINDOBJS) @LIBS@
|
||||
|
||||
install: all
|
||||
install-nostripped: all
|
||||
-mkdir -p $(DESTDIR)$(bindir) || true
|
||||
for prog in $(PROGS) $(SCRIPTS) ; do \
|
||||
$(INSTALL_PROGRAM) $$prog $(bindir) ; \
|
||||
$(INSTALL_PROGRAM) $$prog $(DESTDIR)$(bindir) || exit 1; \
|
||||
done
|
||||
-strip $(bindir)/remind
|
||||
-strip $(bindir)/rem2ps
|
||||
rm -f $(DESTDIR)$(bindir)/rem > /dev/null 2>&1 || true
|
||||
ln -s remind $(DESTDIR)$(bindir)/rem
|
||||
-mkdir -p $(DESTDIR)$(mandir)/man1 || true
|
||||
for man in $(MANS) ; do \
|
||||
$(INSTALL_DATA) $$man $(mandir)/man1 ; \
|
||||
$(INSTALL_DATA) $$man $(DESTDIR)$(mandir)/man1 || exit 1; \
|
||||
done
|
||||
|
||||
install: install-nostripped
|
||||
strip $(DESTDIR)$(bindir)/remind || true
|
||||
strip $(DESTDIR)$(bindir)/rem2ps || true
|
||||
|
||||
clean:
|
||||
rm -f *.o *~ core *.bak $(PROGS)
|
||||
|
||||
@@ -64,24 +74,22 @@ clobber:
|
||||
rm -f *.o *~ remind rem2ps test.out core *.bak
|
||||
|
||||
depend:
|
||||
gccmakedep @DEFS@ -DUNIX $(REMINDSRCS) rem2ps.c
|
||||
gccmakedep @DEFS@ $(REMINDSRCS) rem2ps.c json.c
|
||||
|
||||
# The next targets are not very useful to you. I use them to build
|
||||
# distributions, etc.
|
||||
|
||||
# Build a tar file based on all files checked into CVS.
|
||||
tgz:
|
||||
ln -s .. remind-$(VERSION)
|
||||
peekentry `find remind-$(VERSION) -depth -follow -name 'Entries' -print` | xargs tar cvf remind-$(VERSION).tar
|
||||
gzip -v -9 remind-$(VERSION).tar
|
||||
mv remind-$(VERSION).tar.gz remind-$(VERSION).tgz
|
||||
rm -f remind-$(VERSION)
|
||||
# Build a tar file based on all files checked into git.
|
||||
distro:
|
||||
cd .. && git archive --worktree-attributes --format=tar --prefix=remind-$(VERSION)/ HEAD > src/remind-$(VERSION).tar
|
||||
gzip -f -v -9 remind-$(VERSION).tar
|
||||
gpg --detach-sign -u dianne@skoll.ca remind-$(VERSION).tar.gz
|
||||
|
||||
beta-tgz:
|
||||
ln -s .. remind-$(VERSION)-BETA
|
||||
peekentry `find remind-$(VERSION)-BETA -depth -follow -name 'Entries' -print` | xargs tar cvf remind-$(VERSION)-BETA.tar
|
||||
gzip -v -9 remind-$(VERSION)-BETA.tar
|
||||
mv remind-$(VERSION)-BETA.tar.gz remind-$(VERSION)-BETA.tgz
|
||||
rm -f remind-$(VERSION)-BETA
|
||||
cd .. && git archive --worktree-attributes --format=tar --prefix=remind-$(VERSION)-BETA-$(BETA)/ HEAD > src/remind-$(VERSION)-BETA-$(BETA).tar
|
||||
gzip -f -v -9 remind-$(VERSION)-BETA-$(BETA).tar
|
||||
gpg --detach-sign -u dianne@skoll.ca remind-$(VERSION)-BETA-$(BETA).tar.gz
|
||||
|
||||
#---------------- Stuff after this added by "make depend" -----------------
|
||||
|
||||
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
#$Id: Makefile_QDOS,v 1.2 1998-03-01 20:43:53 dfs Exp $
|
||||
# Makefile for REMIND for QDOS / SMSQ
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# THINGS FOR YOU TO EDIT START BELOW
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Uncomment the next lines if you want to use gcc instead of default compiler
|
||||
# NOTE: Tempting as it may be, if you use 'cc' for the C compiler, do not
|
||||
# use 'ld' for the linker. It will probably work much better if you use
|
||||
# LD= cc rather than LD= ld.
|
||||
# QDOS remark: I made it work the following way, and I found it to be working.
|
||||
CC= cc
|
||||
LD= ld
|
||||
|
||||
# Put any additional flags for the C compiler or linker here - if you
|
||||
# are not using gcc, you probably want to remove '-ansi'.
|
||||
# QDOS remark: no -ansi option and no gcc on QDOS / SMSQ
|
||||
CFLAGS= -V -O -DQDOS
|
||||
CDEFS=
|
||||
LDFLAGS= -bufp200K
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
|
||||
# in config_h; then, you should be able to type 'make'.
|
||||
#-----------------------------------------------------------------------------
|
||||
VERSION= 03.00.19
|
||||
MATHLIB= -lm
|
||||
|
||||
HDRS= config_h err_h expr_h globals_h protos_h types_h version_h \
|
||||
lang_h english_h german_h dutch_h finnish_h french_h norwgian_h \
|
||||
danish_h polish_h
|
||||
|
||||
STDHDRS= config_h types_h protos_h globals_h err_h lang_h
|
||||
|
||||
LANGHDRS= english_h german_h dutch_h finnish_h french_h norwgian_h danish_h \
|
||||
polish_h
|
||||
|
||||
SRCS= calendar_c dorem_c dosubst_c expr_c files_c funcs_c globals_c hbcal_c \
|
||||
init_c main_c moon_c omit_c sort_c queue_c token_c trigger_c userfns_c \
|
||||
utils_c var_c
|
||||
|
||||
OBJS= calendar_o dorem_o dosubst_o expr_o files_o funcs_o globals_o hbcal_o \
|
||||
init_o main_o moon_o omit_o sort_o queue_o token_o trigger_o userfns_o \
|
||||
utils_o var_o
|
||||
|
||||
all: remind rem2ps
|
||||
|
||||
# _c_o:
|
||||
# $(CC) $(UNIX) $(SYSV) -c $(CFLAGS) $(CDEFS) $*_c
|
||||
|
||||
rem2ps: rem2ps_o
|
||||
# $(CC) $(CFLAGS) rem2ps_c
|
||||
$(LD) $(LDFLAGS) -orem2ps rem2ps_o
|
||||
|
||||
remind: $(OBJS)
|
||||
# $(CC) $(CFLAGS) $(SRCS)
|
||||
$(LD) $(LDFLAGS) -oremind $(OBJS) $(MATHLIB)
|
||||
|
||||
rem2ps_o: rem2ps_c rem2ps_h lang_h config_h
|
||||
calendar_o: calendar_c $(STDHDRS) expr_h
|
||||
dorem_o: dorem_c $(STDHDRS) expr_h
|
||||
dosubst_o: dosubst_c $(STDHDRS) $(LANGHDRS)
|
||||
expr_o: expr_c $(STDHDRS) expr_h
|
||||
files_o: files_c $(STDHDRS)
|
||||
funcs_o: funcs_c $(STDHDRS) expr_h version_h
|
||||
globals_o: globals_c config_h types_h globals_h err_h lang_h $(LANGHDRS)
|
||||
hbcal_o: hbcal_c $(STDHDRS)
|
||||
init_o: init_c $(STDHDRS) expr_h version_h lang_h $(LANGHDRS)
|
||||
main_o: main_c $(STDHDRS) expr_h
|
||||
moon_o: moon_c $(STDHDRS)
|
||||
omit_o: omit_c $(STDHDRS)
|
||||
sort_o: sort_c $(STDHDRS)
|
||||
queue_o: queue_c $(STDHDRS)
|
||||
token_o: token_c $(STDHDRS)
|
||||
trigger_o: trigger_c $(STDHDRS) expr_h
|
||||
userfns_o: userfns_c $(STDHDRS) expr_h
|
||||
utils_o: utils_c $(STDHDRS)
|
||||
var_o: var_c $(STDHDRS) expr_h
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *_o *_bak
|
||||
|
||||
clobber:
|
||||
rm -f *_o remind rem2ps test_out *_bak
|
||||
@@ -1,7 +0,0 @@
|
||||
IGNORE=154
|
||||
IGNORE=161
|
||||
IGNORE=100
|
||||
IGNORE=85
|
||||
LINKOPT SC
|
||||
LINKOPT SD
|
||||
LINKOPT NOICONS
|
||||
65
src/amiga.c
65
src/amiga.c
@@ -1,65 +0,0 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* AMIGA.C */
|
||||
/* */
|
||||
/* Support functions for AmigaDOS */
|
||||
/* */
|
||||
/* This file is Copyright (C) 1995 by Martin Hohl */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Remind is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: amiga.c,v 1.3 1999-04-05 17:34:42 dfs Exp $";
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <exec/types.h>
|
||||
#include <dos/dos.h>
|
||||
#include <dos/dosextens.h>
|
||||
|
||||
#include <proto/dos.h>
|
||||
|
||||
#include "version.h" /* Hopefully this will define VERSION as a string */
|
||||
|
||||
#ifdef __SASC_60
|
||||
/* AmigaDOS 2.04 compatible version string for "version" utility */
|
||||
const static char ver_string[] = "$VER: remind "VERSION" "__AMIGADATE__;
|
||||
#endif
|
||||
|
||||
void sleep(int dt)
|
||||
{
|
||||
register long Ticks;
|
||||
|
||||
if (dt != 0) {
|
||||
Ticks = 50L * dt;
|
||||
Delay(Ticks);
|
||||
}
|
||||
}
|
||||
|
||||
void execvp(char *name, char **argvec)
|
||||
{
|
||||
char *cmdline;
|
||||
int i,l;
|
||||
|
||||
l = strlen(name)+2;
|
||||
i=1;
|
||||
while (argvec[i] != 0L) {
|
||||
l += strlen(argvec[i])+1;
|
||||
i++;
|
||||
};
|
||||
cmdline = malloc(l+1);
|
||||
if (cmdline == 0L) return;
|
||||
strcpy(cmdline,name);
|
||||
i=1;
|
||||
while (argvec[i] != 0L) {
|
||||
strcat(cmdline," ");
|
||||
strcat(cmdline,argvec[i]);
|
||||
i++;
|
||||
};
|
||||
system(cmdline);
|
||||
free(cmdline);
|
||||
}
|
||||
1839
src/calendar.c
1839
src/calendar.c
File diff suppressed because it is too large
Load Diff
@@ -1,80 +1,39 @@
|
||||
/* src/config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* $Id: config.h.in,v 1.3 1998-02-16 03:41:44 dfs Exp $ */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* Define if you have the mktime function. */
|
||||
#undef HAVE_MKTIME
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#undef HAVE_STRSTR
|
||||
|
||||
/* Define if you have the timegm function. */
|
||||
#undef HAVE_TIMEGM
|
||||
|
||||
/* Define if you have the difftime function. */
|
||||
#undef HAVE_DIFFTIME
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <stdarg.h> header file. */
|
||||
#undef HAVE_STDARG_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
/* Define if you have the <glob.h> header file */
|
||||
#undef HAVE_GLOB_H
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
#undef HAVE_WCTYPE_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define if you have the m library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
#undef HAVE_GLOB
|
||||
|
||||
#undef HAVE_SETENV
|
||||
|
||||
#undef HAVE_UNSETENV
|
||||
|
||||
#undef HAVE_MBSTOWCS
|
||||
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* The number of bytes in a unsigned int. */
|
||||
#undef SIZEOF_UNSIGNED_INT
|
||||
|
||||
/* The number of bytes in a unsigned long. */
|
||||
#undef SIZEOF_UNSIGNED_LONG
|
||||
|
||||
/* The number of bytes in a unsigned short. */
|
||||
#undef SIZEOF_UNSIGNED_SHORT
|
||||
|
||||
#include "custom.h"
|
||||
|
||||
86
src/custom.h
86
src/custom.h
@@ -6,13 +6,10 @@
|
||||
/* which you can customize. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: custom.h,v 1.19 1999-04-05 17:42:35 dfs Exp $ */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
||||
@@ -39,13 +36,13 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DEFAULT_PAGE {"Letter", 612, 792}
|
||||
/* #define DEFAULT_PAGE {"A4", 595, 842} */
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* DATESEP: The default date separator. North American usage is '/'; */
|
||||
/* others may prefer '-'. */
|
||||
/* DATESEP: The default date separator. Standard usage is '-'; */
|
||||
/* others may prefer '/'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DATESEP '/'
|
||||
/* #define DATESEP '-' */
|
||||
#define DATESEP '-'
|
||||
/* #define DATESEP '/' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* TIMESEP: The default time separator. North American usage is ':'; */
|
||||
@@ -54,6 +51,13 @@
|
||||
#define TIMESEP ':'
|
||||
/* #define TIMESEP '.' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* DATETIMESEP: The default datetime separator. Default is '@'; */
|
||||
/* others may prefer 'T'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DATETIMESEP '@'
|
||||
/* #define DATETIMESEP '/' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* ISOLATIN1: define it to 1 if you use the */
|
||||
/* ISO 8859-1 character set instead of ASCII. */
|
||||
@@ -89,8 +93,7 @@
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
||||
/* the -u option. If you do this, however, remind-all.[c]sh will not */
|
||||
/* work. */
|
||||
/* the -u option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define WANT_U_OPTION 1
|
||||
|
||||
@@ -134,19 +137,16 @@
|
||||
#define BASE 1990
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* YR_RANGE: The range of years allowed. Computers with 16-bit */
|
||||
/* integers can handle about 89 years worth of reminders; if */
|
||||
/* you use 32-bit integers, you can handle over 5 867 000 */
|
||||
/* years. Note that YR_RANGE is set to 88 rather than 89 */
|
||||
/* because we can range up to the last day of the 88th year. */
|
||||
/* YR_RANGE: The range of years allowed. With 32-bit signed integers, */
|
||||
/* the DATETIME type can store 2^31 minutes or about 4074 years. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define YR_RANGE 88
|
||||
#define YR_RANGE 4000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* VAR_NAME_LEN: The maximum length of variable names. Don't make it */
|
||||
/* any less than 12. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define VAR_NAME_LEN 12
|
||||
#define VAR_NAME_LEN 64
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* MAX_PRT_LEN: The maximum number of characters to print when */
|
||||
@@ -154,6 +154,12 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_PRT_LEN 40
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* MAX_STR_LEN: If non-zero, Remind will limit the maximum length */
|
||||
/* of string values to avoid eating up all of memory... */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_STR_LEN 65535
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* OP_STACK_SIZE: The size of the operator stack for expr. parsing */
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -167,7 +173,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* INCLUDE_NEST: How many nested INCLUDES do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define INCLUDE_NEST 8
|
||||
#define INCLUDE_NEST 9
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* IF_NEST: How many nested IFs do we handle? Maximum is the number */
|
||||
@@ -175,35 +181,20 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define IF_NEST (4*sizeof(unsigned int))
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Do we handle queued reminders? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(UNIX) || defined(__OS2__)
|
||||
#define HAVE_QUEUED 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Does our C compiler have prototypes? Override this test if you */
|
||||
/* are using a non-ANSI compiler that nevertheless has prototypes. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(__STDC__) || defined(__TURBOC__) || defined(__BORLANDC__)
|
||||
#define HAVE_PROTOS 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many attempts to resolve a weird date spec? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TRIG_ATTEMPTS 25
|
||||
#define TRIG_ATTEMPTS 500
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_FULL_OMITS 75
|
||||
#define MAX_FULL_OMITS 500
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_PARTIAL_OMITS 75
|
||||
#define MAX_PARTIAL_OMITS 366
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* A newline - some systems need "\n\r" */
|
||||
@@ -222,21 +213,16 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* TAG_LEN: The maximum length of tags. Don't change it */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TAG_LEN 32
|
||||
#define TAG_LEN 48
|
||||
|
||||
#define PASSTHRU_LEN 24
|
||||
|
||||
#define PUBLIC
|
||||
#define PRIVATE static
|
||||
|
||||
#ifdef UNIX
|
||||
#define _POSIX_SOURCE
|
||||
#define _SVID_SOURCE
|
||||
#endif
|
||||
#define PASSTHRU_LEN 32
|
||||
|
||||
#define PSBEGIN "# rem2ps begin"
|
||||
#define PSEND "# rem2ps end"
|
||||
|
||||
#define PSBEGIN2 "# rem2ps2 begin"
|
||||
#define PSEND2 "# rem2ps2 end"
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
#define Putc SafePutc
|
||||
#define PutChar SafePutChar
|
||||
@@ -244,3 +230,9 @@
|
||||
#define Putc putc
|
||||
#define PutChar putchar
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
|
||||
#define REM_USE_WCHAR 1
|
||||
#else
|
||||
#undef REM_USE_WCHAR
|
||||
#endif
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
/* which you can customize. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: custom.h.in,v 1.6 1999-04-05 17:34:43 dfs Exp $ */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
||||
@@ -39,13 +36,13 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DEFAULT_PAGE {"Letter", 612, 792}
|
||||
/* #define DEFAULT_PAGE {"A4", 595, 842} */
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* DATESEP: The default date separator. North American usage is '/'; */
|
||||
/* others may prefer '-'. */
|
||||
/* DATESEP: The default date separator. Standard usage is '-'; */
|
||||
/* others may prefer '/'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DATESEP '/'
|
||||
/* #define DATESEP '-' */
|
||||
#define DATESEP '-'
|
||||
/* #define DATESEP '/' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* TIMESEP: The default time separator. North American usage is ':'; */
|
||||
@@ -54,6 +51,13 @@
|
||||
#define TIMESEP ':'
|
||||
/* #define TIMESEP '.' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* DATETIMESEP: The default datetime separator. Default is '@'; */
|
||||
/* others may prefer 'T'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define DATETIMESEP '@'
|
||||
/* #define DATETIMESEP '/' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* ISOLATIN1: define it to 1 if you use the */
|
||||
/* ISO 8859-1 character set instead of ASCII. */
|
||||
@@ -89,8 +93,7 @@
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
||||
/* the -u option. If you do this, however, remind-all.[c]sh will not */
|
||||
/* work. */
|
||||
/* the -u option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define WANT_U_OPTION 1
|
||||
|
||||
@@ -134,19 +137,16 @@
|
||||
#define BASE 1990
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* YR_RANGE: The range of years allowed. Computers with 16-bit */
|
||||
/* integers can handle about 89 years worth of reminders; if */
|
||||
/* you use 32-bit integers, you can handle over 5 867 000 */
|
||||
/* years. Note that YR_RANGE is set to 88 rather than 89 */
|
||||
/* because we can range up to the last day of the 88th year. */
|
||||
/* YR_RANGE: The range of years allowed. With 32-bit signed integers, */
|
||||
/* the DATETIME type can store 2^31 minutes or about 4074 years. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define YR_RANGE 88
|
||||
#define YR_RANGE 4000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* VAR_NAME_LEN: The maximum length of variable names. Don't make it */
|
||||
/* any less than 12. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define VAR_NAME_LEN 12
|
||||
#define VAR_NAME_LEN 64
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* MAX_PRT_LEN: The maximum number of characters to print when */
|
||||
@@ -154,6 +154,12 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_PRT_LEN 40
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* MAX_STR_LEN: If non-zero, Remind will limit the maximum length */
|
||||
/* of string values to avoid eating up all of memory... */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_STR_LEN 65535
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* OP_STACK_SIZE: The size of the operator stack for expr. parsing */
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -167,7 +173,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* INCLUDE_NEST: How many nested INCLUDES do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define INCLUDE_NEST 8
|
||||
#define INCLUDE_NEST 9
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* IF_NEST: How many nested IFs do we handle? Maximum is the number */
|
||||
@@ -175,35 +181,20 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define IF_NEST (4*sizeof(unsigned int))
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Do we handle queued reminders? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(UNIX) || defined(__OS2__)
|
||||
#define HAVE_QUEUED 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Does our C compiler have prototypes? Override this test if you */
|
||||
/* are using a non-ANSI compiler that nevertheless has prototypes. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(__STDC__) || defined(__TURBOC__) || defined(__BORLANDC__)
|
||||
#define HAVE_PROTOS 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many attempts to resolve a weird date spec? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TRIG_ATTEMPTS 25
|
||||
#define TRIG_ATTEMPTS 500
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_FULL_OMITS 75
|
||||
#define MAX_FULL_OMITS 500
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_PARTIAL_OMITS 75
|
||||
#define MAX_PARTIAL_OMITS 366
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* A newline - some systems need "\n\r" */
|
||||
@@ -222,21 +213,16 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* TAG_LEN: The maximum length of tags. Don't change it */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TAG_LEN 32
|
||||
#define TAG_LEN 48
|
||||
|
||||
#define PASSTHRU_LEN 24
|
||||
|
||||
#define PUBLIC
|
||||
#define PRIVATE static
|
||||
|
||||
#ifdef UNIX
|
||||
#define _POSIX_SOURCE
|
||||
#define _SVID_SOURCE
|
||||
#endif
|
||||
#define PASSTHRU_LEN 32
|
||||
|
||||
#define PSBEGIN "# rem2ps begin"
|
||||
#define PSEND "# rem2ps end"
|
||||
|
||||
#define PSBEGIN2 "# rem2ps2 begin"
|
||||
#define PSEND2 "# rem2ps2 end"
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
#define Putc SafePutc
|
||||
#define PutChar SafePutChar
|
||||
@@ -244,3 +230,9 @@
|
||||
#define Putc putc
|
||||
#define PutChar putchar
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
|
||||
#define REM_USE_WCHAR 1
|
||||
#else
|
||||
#undef REM_USE_WCHAR
|
||||
#endif
|
||||
|
||||
850
src/dorem.c
850
src/dorem.c
File diff suppressed because it is too large
Load Diff
253
src/dosubst.c
253
src/dosubst.c
@@ -6,33 +6,24 @@
|
||||
/* reminders are triggered. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: dosubst.c,v 1.9 1999-04-05 17:34:44 dfs Exp $";
|
||||
|
||||
#define L_IN_DOSUBST
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
|
||||
#define UPPER(c) (islower(c) ? toupper(c) : c)
|
||||
#define UPPER(c) (islower(c) ? toupper(c) : (c))
|
||||
#define ABS(x) ( (x) < 0 ? -(x) : (x) )
|
||||
#ifndef NL
|
||||
#define NL "\n"
|
||||
@@ -50,18 +41,10 @@ static char TOMORROW[] = L_TOMORROW;
|
||||
/* Process the % escapes in the reminder. If */
|
||||
/* mode==NORMAL_MODE, ignore the %" sequence. If */
|
||||
/* mode==CAL_MODE, process the %" sequence. */
|
||||
/* If mode==ADVANCE_MODE, ignore %" but don't add newline */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode)
|
||||
#else
|
||||
int DoSubst(p, dbuf, t, tt, jul, mode)
|
||||
ParsePtr p;
|
||||
DynamicBuffer *dbuf;
|
||||
Trigger *t;
|
||||
TimeTrig *tt;
|
||||
int jul, mode;
|
||||
#endif
|
||||
int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode)
|
||||
{
|
||||
int diff = jul - JulianToday;
|
||||
int curtime = SystemTime(0) / 60;
|
||||
@@ -70,13 +53,15 @@ int jul, mode;
|
||||
int d, m, y;
|
||||
int tim = tt->ttime;
|
||||
int h, min, hh, ch, cmin, chh;
|
||||
char *pm, *cpm;
|
||||
char const *pm, *cpm;
|
||||
int tdiff, adiff, mdiff, hdiff;
|
||||
char *mplu, *hplu, *when, *plu;
|
||||
char const *mplu, *hplu, *when, *plu;
|
||||
int has_quote = 0;
|
||||
char *ss, *os;
|
||||
char *ss;
|
||||
char *os;
|
||||
char s[256];
|
||||
int origLen = DBufLen(dbuf);
|
||||
int altmode;
|
||||
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
|
||||
@@ -92,14 +77,14 @@ int jul, mode;
|
||||
mplu = (mdiff == 1 ? "" : L_MPLU);
|
||||
#endif /* L_MPLU_OVER */
|
||||
|
||||
#ifdef L_HPLU_OVER
|
||||
#ifdef L_HPLU_OVER
|
||||
L_HPLU_OVER
|
||||
#else /* L_HPLU_OVER */
|
||||
hplu = (hdiff == 1 ? "" : L_HPLU);
|
||||
#endif /* L_HPLU_OVER */
|
||||
|
||||
when = (tdiff < 0 ? L_AGO : L_FROMNOW);
|
||||
|
||||
|
||||
h = tim / 60;
|
||||
min = tim % 60;
|
||||
|
||||
@@ -109,7 +94,7 @@ int jul, mode;
|
||||
pm = (h < 12) ? L_AM : L_PM;
|
||||
#endif
|
||||
hh = (h == 12) ? 12 : h % 12;
|
||||
|
||||
|
||||
ch = curtime / 60;
|
||||
cmin = curtime % 60;
|
||||
|
||||
@@ -127,17 +112,17 @@ int jul, mode;
|
||||
case 1:
|
||||
case 21:
|
||||
case 31: plu = "st"; break;
|
||||
|
||||
|
||||
case 2:
|
||||
case 22: plu = "nd"; break;
|
||||
|
||||
|
||||
case 3:
|
||||
case 23: plu = "rd"; break;
|
||||
|
||||
|
||||
default: plu = "th"; break;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
while(1) {
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) {
|
||||
@@ -146,7 +131,8 @@ int jul, mode;
|
||||
}
|
||||
if (c == '\n') continue;
|
||||
if (!c) {
|
||||
if (mode != CAL_MODE && t->typ != RUN_TYPE && !MsgCommand) {
|
||||
if (mode != CAL_MODE && mode != ADVANCE_MODE &&
|
||||
t->typ != RUN_TYPE && !MsgCommand) {
|
||||
if (DBufPutc(dbuf, '\n') != OK) return E_NO_MEM;
|
||||
}
|
||||
break;
|
||||
@@ -155,6 +141,7 @@ int jul, mode;
|
||||
if (DBufPutc(dbuf, c) != OK) return E_NO_MEM;
|
||||
continue;
|
||||
}
|
||||
altmode = 0;
|
||||
s[0] = 0;
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) {
|
||||
@@ -164,14 +151,25 @@ int jul, mode;
|
||||
if (!c) {
|
||||
break;
|
||||
}
|
||||
if (c == '*') {
|
||||
altmode = c;
|
||||
c = ParseChar(p, &err, 0);
|
||||
if (err) {
|
||||
DBufFree(dbuf);
|
||||
return err;
|
||||
}
|
||||
if (!c) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
done = 0;
|
||||
if (diff <= 1) {
|
||||
switch(UPPER(c)) {
|
||||
#ifndef L_NOTOMORROW_A
|
||||
case 'A':
|
||||
case 'A':
|
||||
#endif
|
||||
#ifndef L_NOTOMORROW_B
|
||||
case 'B':
|
||||
case 'B':
|
||||
#endif
|
||||
#ifndef L_NOTOMORROW_C
|
||||
case 'C':
|
||||
@@ -210,36 +208,45 @@ int jul, mode;
|
||||
SHIP_OUT(s);
|
||||
done = 1;
|
||||
break;
|
||||
|
||||
default: done = 0;
|
||||
|
||||
default: done = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!done) switch(UPPER(c)) {
|
||||
case 'A':
|
||||
#ifdef L_A_OVER
|
||||
L_A_OVER
|
||||
#else
|
||||
sprintf(s, "%s %s, %d %s, %d", L_ON, DayName[jul%7], d,
|
||||
MonthName[m], y);
|
||||
#else
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
|
||||
case 'B':
|
||||
#ifdef L_B_OVER
|
||||
L_B_OVER
|
||||
#else
|
||||
#else
|
||||
sprintf(s, L_INXDAYS, diff);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
#ifdef L_C_OVER
|
||||
L_C_OVER
|
||||
#else
|
||||
sprintf(s, "%s %s", L_ON, DayName[jul%7]);
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s", DayName[jul%7]);
|
||||
} else {
|
||||
sprintf(s, "%s %s", L_ON, DayName[jul%7]);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -247,7 +254,7 @@ int jul, mode;
|
||||
case 'D':
|
||||
#ifdef L_D_OVER
|
||||
L_D_OVER
|
||||
#else
|
||||
#else
|
||||
sprintf(s, "%d", d);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
@@ -256,9 +263,14 @@ int jul, mode;
|
||||
case 'E':
|
||||
#ifdef L_E_OVER
|
||||
L_E_OVER
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, d, DATESEP,
|
||||
m+1, DATESEP, y);
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d%c%04d", d, DateSep,
|
||||
m+1, DateSep, y);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, d, DateSep,
|
||||
m+1, DateSep, y);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -266,8 +278,12 @@ int jul, mode;
|
||||
case 'F':
|
||||
#ifdef L_F_OVER
|
||||
L_F_OVER
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, m+1, DATESEP, d, DATESEP, y);
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, m+1, DateSep, d, DateSep, y);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -275,8 +291,12 @@ int jul, mode;
|
||||
case 'G':
|
||||
#ifdef L_G_OVER
|
||||
L_G_OVER
|
||||
#else
|
||||
sprintf(s, "%s %s, %d %s", L_ON, DayName[jul%7], d, MonthName[m]);
|
||||
#else
|
||||
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]);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -284,8 +304,12 @@ int jul, mode;
|
||||
case 'H':
|
||||
#ifdef L_H_OVER
|
||||
L_H_OVER
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, d, DATESEP, m+1);
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d", d, DateSep, m+1);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, d, DateSep, m+1);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -293,8 +317,12 @@ int jul, mode;
|
||||
case 'I':
|
||||
#ifdef L_I_OVER
|
||||
L_I_OVER
|
||||
#else
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, m+1, DATESEP, d);
|
||||
#else
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d", m+1, DateSep, d);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d", L_ON, m+1, DateSep, d);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -303,8 +331,13 @@ int jul, mode;
|
||||
#ifdef L_J_OVER
|
||||
L_J_OVER
|
||||
#else
|
||||
sprintf(s, "%s %s, %s %d%s, %d", L_ON, DayName[jul%7],
|
||||
MonthName[m], d, plu, y);
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %s %d%s, %d", DayName[jul%7],
|
||||
MonthName[m], d, plu, y);
|
||||
} else {
|
||||
sprintf(s, "%s %s, %s %d%s, %d", L_ON, DayName[jul%7],
|
||||
MonthName[m], d, plu, y);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -313,8 +346,13 @@ int jul, mode;
|
||||
#ifdef L_K_OVER
|
||||
L_K_OVER
|
||||
#else
|
||||
sprintf(s, "%s %s, %s %d%s", L_ON, DayName[jul%7],
|
||||
MonthName[m], d, plu);
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %s %d%s", DayName[jul%7],
|
||||
MonthName[m], d, plu);
|
||||
} else {
|
||||
sprintf(s, "%s %s, %s %d%s", L_ON, DayName[jul%7],
|
||||
MonthName[m], d, plu);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -323,7 +361,11 @@ int jul, mode;
|
||||
#ifdef L_L_OVER
|
||||
L_L_OVER
|
||||
#else
|
||||
sprintf(s, "%s %04d%c%02d%c%02d", L_ON, y, DATESEP, m+1, DATESEP, d);
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
|
||||
} else {
|
||||
sprintf(s, "%s %04d%c%02d%c%02d", L_ON, y, DateSep, m+1, DateSep, d);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -405,8 +447,13 @@ int jul, mode;
|
||||
#ifdef L_U_OVER
|
||||
L_U_OVER
|
||||
#else
|
||||
sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], d,
|
||||
plu, MonthName[m], y);
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %d%s %s, %d", DayName[jul%7], d,
|
||||
plu, MonthName[m], y);
|
||||
} else {
|
||||
sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], d,
|
||||
plu, MonthName[m], y);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -415,8 +462,13 @@ int jul, mode;
|
||||
#ifdef L_V_OVER
|
||||
L_V_OVER
|
||||
#else
|
||||
sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu,
|
||||
MonthName[m]);
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%s, %d%s %s", DayName[jul%7], d, plu,
|
||||
MonthName[m]);
|
||||
} else {
|
||||
sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu,
|
||||
MonthName[m]);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -461,9 +513,9 @@ int jul, mode;
|
||||
#ifdef L_1_OVER
|
||||
L_1_OVER
|
||||
#else
|
||||
if (tdiff == 0)
|
||||
if (tdiff == 0)
|
||||
sprintf(s, "%s", L_NOW);
|
||||
else if (hdiff == 0)
|
||||
else if (hdiff == 0)
|
||||
sprintf(s, "%d %s%s %s", mdiff, L_MINUTE, mplu, when);
|
||||
else if (mdiff == 0)
|
||||
sprintf(s, "%d %s%s %s", hdiff, L_HOUR, hplu, when);
|
||||
@@ -478,7 +530,11 @@ int jul, mode;
|
||||
#ifdef L_2_OVER
|
||||
L_2_OVER
|
||||
#else
|
||||
sprintf(s, "%s %d%c%02d%s", L_AT, hh, TIMESEP, min, pm);
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%d%c%02d%s", hh, TimeSep, min, pm);
|
||||
} else {
|
||||
sprintf(s, "%s %d%c%02d%s", L_AT, hh, TimeSep, min, pm);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -488,7 +544,11 @@ int jul, mode;
|
||||
L_3_OVER
|
||||
#else
|
||||
|
||||
sprintf(s, "%s %02d%c%02d", L_AT, h, TIMESEP, min);
|
||||
if (altmode == '*') {
|
||||
sprintf(s, "%02d%c%02d", h, TimeSep, min);
|
||||
} else {
|
||||
sprintf(s, "%s %02d%c%02d", L_AT, h, TimeSep, min);
|
||||
}
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -569,7 +629,7 @@ int jul, mode;
|
||||
#ifdef L_AT_OVER
|
||||
L_AT_OVER
|
||||
#else
|
||||
sprintf(s, "%d%c%02d%s", chh, TIMESEP, cmin, cpm);
|
||||
sprintf(s, "%d%c%02d%s", chh, TimeSep, cmin, cpm);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
@@ -578,16 +638,17 @@ int jul, mode;
|
||||
#ifdef L_HASH_OVER
|
||||
L_HASH_OVER
|
||||
#else
|
||||
sprintf(s, "%02d%c%02d", ch, TIMESEP, cmin);
|
||||
sprintf(s, "%02d%c%02d", ch, TimeSep, cmin);
|
||||
#endif
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
case '_':
|
||||
if (mode != CAL_MODE && !MsgCommand)
|
||||
case '_':
|
||||
if (PsCal == PSCAL_LEVEL2 || PsCal == PSCAL_LEVEL3 || (mode != CAL_MODE && mode != ADVANCE_MODE && !MsgCommand)) {
|
||||
sprintf(s, "%s", NL);
|
||||
else
|
||||
} else {
|
||||
sprintf(s, " ");
|
||||
}
|
||||
SHIP_OUT(s);
|
||||
break;
|
||||
|
||||
@@ -596,16 +657,24 @@ int jul, mode;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
if (DBufPutc(dbuf, QUOTE_MARKER) != OK) return E_NO_MEM;
|
||||
has_quote = 1;
|
||||
if (PsCal != PSCAL_LEVEL3) {
|
||||
if (DBufPutc(dbuf, QUOTE_MARKER) != OK) return E_NO_MEM;
|
||||
has_quote = 1;
|
||||
} else {
|
||||
if (DBufPutc(dbuf, '%') != OK) return E_NO_MEM;
|
||||
if (DBufPutc(dbuf, c) != OK) return E_NO_MEM;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (DBufPutc(dbuf, c) != OK) return E_NO_MEM;
|
||||
}
|
||||
if (isupper(c)) {
|
||||
os = DBufValue(dbuf) - strlen(s);
|
||||
*os = UPPER(*os);
|
||||
os = DBufValue(dbuf);
|
||||
os += strlen(os) - strlen(s);
|
||||
if (os >= DBufValue(dbuf)) {
|
||||
*os = UPPER(*os);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -617,7 +686,7 @@ int jul, mode;
|
||||
/* If there are NO quotes, then: If CAL_MODE && RUN_TYPE, we don't want the
|
||||
reminder in the calendar. Zero the output buffer and quit. */
|
||||
if (!has_quote) {
|
||||
if (mode == CAL_MODE && t->typ == RUN_TYPE) {
|
||||
if ((mode == ADVANCE_MODE || mode == CAL_MODE) && t->typ == RUN_TYPE) {
|
||||
*DBufValue(dbuf) = 0;
|
||||
dbuf->len = 0;
|
||||
}
|
||||
@@ -629,7 +698,7 @@ int jul, mode;
|
||||
|
||||
ss = DBufValue(dbuf) + origLen;
|
||||
os = ss;
|
||||
if (mode == NORMAL_MODE) {
|
||||
if (mode == NORMAL_MODE || mode == ADVANCE_MODE) {
|
||||
while (*ss) {
|
||||
if (*ss != QUOTE_MARKER) *os++ = *ss;
|
||||
ss++;
|
||||
@@ -653,7 +722,7 @@ int jul, mode;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -664,16 +733,8 @@ int jul, mode;
|
||||
/* default triggers and a mode of NORMAL_MODE. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoSubstFromString(char *source, DynamicBuffer *dbuf,
|
||||
int DoSubstFromString(char const *source, DynamicBuffer *dbuf,
|
||||
int jul, int tim)
|
||||
#else
|
||||
int DoSubstFromString(source, dbuf, jul, tim)
|
||||
char *source;
|
||||
DynamicBuffer *dbuf;
|
||||
int jul;
|
||||
int tim;
|
||||
#endif
|
||||
{
|
||||
Trigger tempTrig;
|
||||
TimeTrig tempTime;
|
||||
@@ -686,7 +747,7 @@ int tim;
|
||||
tempP.allownested = 0;
|
||||
tempTrig.typ = MSG_TYPE;
|
||||
tempTime.ttime = tim;
|
||||
|
||||
|
||||
r = DoSubst(&tempP, dbuf, &tempTrig, &tempTime, jul, NORMAL_MODE);
|
||||
DestroyParser(&tempP);
|
||||
return r;
|
||||
|
||||
69
src/dynbuf.c
69
src/dynbuf.c
@@ -6,26 +6,15 @@
|
||||
/* buffers. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
static char const RCSID[] =
|
||||
"$Id: dynbuf.c,v 1.3 1999-04-05 17:34:45 dfs Exp $";
|
||||
|
||||
#include "config.h"
|
||||
#include "dynbuf.h"
|
||||
#include "err.h"
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
/**********************************************************************
|
||||
%FUNCTION: DBufMakeRoom
|
||||
@@ -38,13 +27,7 @@ static char const RCSID[] =
|
||||
Doubles the size of dynamic buffer until it has room for at least
|
||||
'n' characters, not including trailing '\0'
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int DBufMakeRoom(DynamicBuffer *dbuf, int n)
|
||||
#else
|
||||
static int DBufMakeRoom(dbuf, n)
|
||||
DynamicBuffer *dbuf;
|
||||
int n;
|
||||
#endif
|
||||
static int DBufMakeRoom(DynamicBuffer *dbuf, int n)
|
||||
{
|
||||
/* Double size until it's greater than n (strictly > to leave room
|
||||
for trailing '\0' */
|
||||
@@ -58,7 +41,7 @@ int n;
|
||||
}
|
||||
|
||||
/* Allocate memory */
|
||||
buf = (char *) malloc(size);
|
||||
buf = malloc(size);
|
||||
if (!buf) return E_NO_MEM;
|
||||
|
||||
/* Copy contents */
|
||||
@@ -80,12 +63,7 @@ int n;
|
||||
%DESCRIPTION:
|
||||
Initializes a dynamic buffer
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void DBufInit(DynamicBuffer *dbuf)
|
||||
#else
|
||||
void DBufInit(dbuf)
|
||||
DynamicBuffer *dbuf;
|
||||
#endif
|
||||
void DBufInit(DynamicBuffer *dbuf)
|
||||
{
|
||||
dbuf->buffer = dbuf->staticBuf;
|
||||
dbuf->len = 0;
|
||||
@@ -94,7 +72,7 @@ DynamicBuffer *dbuf;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
%FUNCTION: DBufPutc
|
||||
%FUNCTION: DBufPutcFN
|
||||
%ARGUMENTS:
|
||||
dbuf -- pointer to a dynamic buffer
|
||||
c -- character to append to buffer
|
||||
@@ -103,13 +81,7 @@ DynamicBuffer *dbuf;
|
||||
%DESCRIPTION:
|
||||
Appends a character to the buffer.
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DBufPutc(DynamicBuffer *dbuf, char c)
|
||||
#else
|
||||
int DBufPutc(dbuf, c)
|
||||
DynamicBuffer *dbuf;
|
||||
char c;
|
||||
#endif
|
||||
int DBufPutcFN(DynamicBuffer *dbuf, char c)
|
||||
{
|
||||
if (dbuf->allocatedLen == dbuf->len+1) {
|
||||
if (DBufMakeRoom(dbuf, dbuf->len+1) != OK) return E_NO_MEM;
|
||||
@@ -129,13 +101,7 @@ char c;
|
||||
%DESCRIPTION:
|
||||
Appends a string to the buffer.
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DBufPuts(DynamicBuffer *dbuf, char *str)
|
||||
#else
|
||||
int DBufPuts(dbuf, str)
|
||||
DynamicBuffer *dbuf;
|
||||
char *str;
|
||||
#endif
|
||||
int DBufPuts(DynamicBuffer *dbuf, char const *str)
|
||||
{
|
||||
int l = strlen(str);
|
||||
if (!l) return OK;
|
||||
@@ -155,12 +121,7 @@ char *str;
|
||||
%DESCRIPTION:
|
||||
Frees and reinitializes a dynamic buffer
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void DBufFree(DynamicBuffer *dbuf)
|
||||
#else
|
||||
void DBufFree(dbuf)
|
||||
DynamicBuffer *dbuf;
|
||||
#endif
|
||||
void DBufFree(DynamicBuffer *dbuf)
|
||||
{
|
||||
if (dbuf->buffer != dbuf->staticBuf) free(dbuf->buffer);
|
||||
DBufInit(dbuf);
|
||||
@@ -177,13 +138,7 @@ DynamicBuffer *dbuf;
|
||||
Reads an entire line from a file and appends to dbuf. Does not include
|
||||
trailing newline.
|
||||
**********************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DBufGets(DynamicBuffer *dbuf, FILE *fp)
|
||||
#else
|
||||
int DBufGets(dbuf, fp)
|
||||
DynamicBuffer *dbuf;
|
||||
FILE *fp
|
||||
#endif
|
||||
int DBufGets(DynamicBuffer *dbuf, FILE *fp)
|
||||
{
|
||||
char tmp[256]; /* Safe to hard-code */
|
||||
int busy = 1;
|
||||
@@ -195,7 +150,9 @@ FILE *fp
|
||||
we can usually save some unnecessary copying */
|
||||
|
||||
*(dbuf->buffer) = 0;
|
||||
fgets(dbuf->buffer, dbuf->allocatedLen, fp);
|
||||
if (fgets(dbuf->buffer, dbuf->allocatedLen, fp) == NULL) {
|
||||
return OK;
|
||||
}
|
||||
if (!*(dbuf->buffer)) return OK;
|
||||
dbuf->len = strlen(dbuf->buffer);
|
||||
l = dbuf->len - 1;
|
||||
@@ -207,7 +164,7 @@ FILE *fp
|
||||
|
||||
while(busy) {
|
||||
*tmp = 0;
|
||||
fgets(tmp, 256, fp);
|
||||
if (fgets(tmp, 256, fp) == NULL) return OK;
|
||||
if (!*tmp) return OK;
|
||||
l = strlen(tmp) - 1;
|
||||
if (tmp[l] == '\n') {
|
||||
|
||||
19
src/dynbuf.h
19
src/dynbuf.h
@@ -5,13 +5,10 @@
|
||||
/* Declaration of functions for manipulating dynamic buffers */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: dynbuf.h,v 1.2 1999-04-05 17:34:45 dfs Exp $ */
|
||||
|
||||
#ifndef DYNBUF_H
|
||||
#define DYNBUF_H
|
||||
|
||||
@@ -25,21 +22,15 @@ typedef struct {
|
||||
char staticBuf[DBUF_STATIC_SIZE];
|
||||
} DynamicBuffer;
|
||||
|
||||
#ifndef ARGS
|
||||
#ifdef HAVE_PROTOS
|
||||
#define ARGS(x) x
|
||||
#else
|
||||
#define ARGS(x) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void DBufInit(DynamicBuffer *dbuf);
|
||||
int DBufPutc(DynamicBuffer *dbuf, char c);
|
||||
int DBufPuts(DynamicBuffer *dbuf, char *str);
|
||||
int DBufPutcFN(DynamicBuffer *dbuf, char c);
|
||||
int DBufPuts(DynamicBuffer *dbuf, char const *str);
|
||||
void DBufFree(DynamicBuffer *dbuf);
|
||||
int DBufGets(DynamicBuffer *dbuf, FILE *fp);
|
||||
|
||||
#define DBufValue(bufPtr) ((bufPtr)->buffer)
|
||||
#define DBufLen(bufPtr) ((bufPtr)->len)
|
||||
|
||||
#define DBufPutc(dbuf, c) ( (dbuf)->allocatedLen < (dbuf)->len+1 ) ? (dbuf)->buffer[(dbuf)->len++] = c, (dbuf)->buffer[(dbuf)->len] = 0, OK : DBufPutcFN((dbuf), c)
|
||||
|
||||
#endif /* DYNBUF_H */
|
||||
|
||||
24
src/err.h
24
src/err.h
@@ -5,13 +5,10 @@
|
||||
/* Error definitions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: err.h,v 1.3 1999-04-05 17:34:46 dfs Exp $ */
|
||||
|
||||
/* Note that not all of the "errors" are really errors - some are just
|
||||
messages for information purposes. Constants beginning with M_ should
|
||||
never be returned as error indicators - they should only be used to
|
||||
@@ -118,7 +115,11 @@
|
||||
#define M_QUEUED 96
|
||||
#define E_EXPECTING_NUMBER 97
|
||||
#define M_BAD_WARN_FUNC 98
|
||||
|
||||
#define E_CANT_CONVERT_TZ 99
|
||||
#define E_NO_MATCHING_REMS 100
|
||||
#define E_STRING_TOO_LONG 101
|
||||
#define E_TIME_TWICE 102
|
||||
#define E_DURATION_NO_AT 103
|
||||
#ifdef MK_GLOBALS
|
||||
#undef EXTERN
|
||||
#define EXTERN
|
||||
@@ -190,7 +191,7 @@ EXTERN char *ErrMsg[]
|
||||
"Too many partial OMITs",
|
||||
"Too many full OMITs",
|
||||
"Warning: PUSH-OMIT-CONTEXT without matching POP-OMIT-CONTEXT",
|
||||
"Error reading file",
|
||||
"Error reading",
|
||||
"Expecting end-of-line",
|
||||
"Invalid Hebrew date",
|
||||
"IIF needs odd number of arguments",
|
||||
@@ -204,9 +205,9 @@ EXTERN char *ErrMsg[]
|
||||
"Back value specified twice",
|
||||
"ONCE keyword used twice. (Hah.)",
|
||||
"Expecting time after AT",
|
||||
"UNTIL keyword used twice",
|
||||
"THROUGH/UNTIL keyword used twice",
|
||||
"Incomplete date specification",
|
||||
"SCANFROM keyword used twice",
|
||||
"FROM/SCANFROM keyword used twice",
|
||||
"Variable",
|
||||
"Value",
|
||||
"*UNDEFINED*",
|
||||
@@ -230,7 +231,12 @@ EXTERN char *ErrMsg[]
|
||||
"No reminders.",
|
||||
"%d reminder(s) queued for later today.\n",
|
||||
"Expecting number",
|
||||
"Bad function in WARN clause"
|
||||
"Bad function in WARN clause",
|
||||
"Can't convert between time zones",
|
||||
"No files matching *.rem",
|
||||
"String too long",
|
||||
"Time specified twice",
|
||||
"Cannot specify DURATION without specifying AT"
|
||||
}
|
||||
#endif /* MK_GLOBALS */
|
||||
;
|
||||
|
||||
634
src/expr.c
634
src/expr.c
File diff suppressed because it is too large
Load Diff
17
src/expr.h
17
src/expr.h
@@ -5,19 +5,18 @@
|
||||
/* Contains a few definitions used by expression evaluator. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: expr.h,v 1.3 1999-04-05 17:34:48 dfs Exp $ */
|
||||
|
||||
/* Define the types of values */
|
||||
#define ERR_TYPE 0
|
||||
#define INT_TYPE 1
|
||||
#define TIM_TYPE 2
|
||||
#define DATE_TYPE 3
|
||||
#define STR_TYPE 4
|
||||
#define ERR_TYPE 0
|
||||
#define INT_TYPE 1
|
||||
#define TIME_TYPE 2
|
||||
#define DATE_TYPE 3
|
||||
#define STR_TYPE 4
|
||||
#define DATETIME_TYPE 5
|
||||
#define SPECIAL_TYPE 6 /* Only for system variables */
|
||||
|
||||
/* Define stuff for parsing expressions */
|
||||
#define BEG_OF_EXPR '['
|
||||
|
||||
561
src/files.c
561
src/files.c
@@ -7,17 +7,16 @@
|
||||
/* files. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: files.c,v 1.9 1999-04-05 17:34:48 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
@@ -27,28 +26,12 @@ static char const RCSID[] = "$Id: files.c,v 1.9 1999-04-05 17:34:48 dfs Exp $";
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__)
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MSC__
|
||||
#include <dos.h>
|
||||
#ifdef HAVE_GLOB_H
|
||||
#include <glob.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
@@ -63,44 +46,98 @@ static char const RCSID[] = "$Id: files.c,v 1.9 1999-04-05 17:34:48 dfs Exp $";
|
||||
/* Define the structures needed by the file caching system */
|
||||
typedef struct cache {
|
||||
struct cache *next;
|
||||
char *text;
|
||||
char const *text;
|
||||
int LineNo;
|
||||
} CachedLine;
|
||||
|
||||
typedef struct cheader {
|
||||
struct cheader *next;
|
||||
char *filename;
|
||||
char const *filename;
|
||||
CachedLine *cache;
|
||||
#ifdef UNIX
|
||||
int ownedByMe;
|
||||
#endif
|
||||
} CachedFile;
|
||||
|
||||
/* A linked list of filenames if we INCLUDE /some/directory/ */
|
||||
typedef struct fname_chain {
|
||||
struct fname_chain *next;
|
||||
char const *filename;
|
||||
} FilenameChain;
|
||||
|
||||
/* Cache filename chains for directories */
|
||||
typedef struct directory_fname_chain {
|
||||
struct directory_fname_chain *next;
|
||||
FilenameChain *chain;
|
||||
char const *dirname;
|
||||
} DirectoryFilenameChain;
|
||||
|
||||
/* Define the structures needed by the INCLUDE file system */
|
||||
typedef struct {
|
||||
char *filename;
|
||||
char const *filename;
|
||||
FilenameChain *chain;
|
||||
int LineNo;
|
||||
unsigned int IfFlags;
|
||||
int NumIfs;
|
||||
long offset;
|
||||
CachedLine *CLine;
|
||||
#ifdef UNIX
|
||||
int ownedByMe;
|
||||
#endif
|
||||
} IncludeStruct;
|
||||
|
||||
static CachedFile *CachedFiles = (CachedFile *) NULL;
|
||||
static CachedLine *CLine = (CachedLine *) NULL;
|
||||
static DirectoryFilenameChain *CachedDirectoryChains = NULL;
|
||||
|
||||
static FILE *fp;
|
||||
|
||||
static IncludeStruct IStack[INCLUDE_NEST];
|
||||
static int IStackPtr = 0;
|
||||
|
||||
PRIVATE int ReadLineFromFile ARGS ((void));
|
||||
PRIVATE int CacheFile ARGS ((const char *fname));
|
||||
PRIVATE void DestroyCache ARGS ((CachedFile *cf));
|
||||
PRIVATE int CheckSafety ARGS ((void));
|
||||
static int ReadLineFromFile (void);
|
||||
static int CacheFile (char const *fname);
|
||||
static void DestroyCache (CachedFile *cf);
|
||||
static int CheckSafety (void);
|
||||
static int PopFile (void);
|
||||
|
||||
static void OpenPurgeFile(char const *fname, char const *mode)
|
||||
{
|
||||
DynamicBuffer fname_buf;
|
||||
|
||||
if (PurgeFP != NULL && PurgeFP != stdout) {
|
||||
fclose(PurgeFP);
|
||||
}
|
||||
PurgeFP = NULL;
|
||||
|
||||
/* Do not open a purge file if we're below purge
|
||||
include depth */
|
||||
if (IStackPtr-2 >= PurgeIncludeDepth) {
|
||||
PurgeFP = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
DBufInit(&fname_buf);
|
||||
if (DBufPuts(&fname_buf, fname) != OK) return;
|
||||
if (DBufPuts(&fname_buf, ".purged") != OK) return;
|
||||
PurgeFP = fopen(DBufValue(&fname_buf), mode);
|
||||
if (!PurgeFP) {
|
||||
fprintf(ErrFp, "Cannot open `%s' for writing: %s\n", DBufValue(&fname_buf), strerror(errno));
|
||||
}
|
||||
DBufFree(&fname_buf);
|
||||
}
|
||||
|
||||
static void FreeChainItem(FilenameChain *chain)
|
||||
{
|
||||
if (chain->filename) free((void *) chain->filename);
|
||||
free(chain);
|
||||
}
|
||||
|
||||
static void FreeChain(FilenameChain *chain)
|
||||
{
|
||||
FilenameChain *next;
|
||||
while(chain) {
|
||||
next = chain->next;
|
||||
FreeChainItem(chain);
|
||||
chain = next;
|
||||
}
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -109,11 +146,7 @@ PRIVATE int CheckSafety ARGS ((void));
|
||||
/* Read a line from the file or cache. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ReadLine(void)
|
||||
#else
|
||||
int ReadLine()
|
||||
#endif
|
||||
int ReadLine(void)
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -144,13 +177,11 @@ int ReadLine()
|
||||
/* Read a line from the file pointed to by fp. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int ReadLineFromFile(void)
|
||||
#else
|
||||
static int ReadLineFromFile()
|
||||
#endif
|
||||
static int ReadLineFromFile(void)
|
||||
{
|
||||
int l;
|
||||
char copy_buffer[4096];
|
||||
size_t n;
|
||||
|
||||
DynamicBuffer buf;
|
||||
|
||||
@@ -170,14 +201,32 @@ static int ReadLineFromFile()
|
||||
}
|
||||
if (feof(fp)) {
|
||||
FCLOSE(fp);
|
||||
if ((DBufLen(&buf) == 0) &&
|
||||
(DBufLen(&LineBuffer) == 0) && PurgeMode) {
|
||||
if (PurgeFP != NULL && PurgeFP != stdout) fclose(PurgeFP);
|
||||
PurgeFP = NULL;
|
||||
}
|
||||
}
|
||||
l = DBufLen(&buf);
|
||||
if (l && (DBufValue(&buf)[l-1] == '\\')) {
|
||||
DBufValue(&buf)[l-1] = 0;
|
||||
if (DBufPuts(&LineBuffer, DBufValue(&buf)) != OK) {
|
||||
DBufFree(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
return E_NO_MEM;
|
||||
if (PurgeMode) {
|
||||
if (DBufPuts(&LineBuffer, DBufValue(&buf)) != OK) {
|
||||
DBufFree(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
if (DBufPutc(&LineBuffer, '\n') != OK) {
|
||||
DBufFree(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
} else {
|
||||
DBufValue(&buf)[l-1] = '\n';
|
||||
if (DBufPuts(&LineBuffer, DBufValue(&buf)) != OK) {
|
||||
DBufFree(&buf);
|
||||
DBufFree(&LineBuffer);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -186,8 +235,25 @@ static int ReadLineFromFile()
|
||||
DBufFree(&LineBuffer);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
FreshLine = 1;
|
||||
DBufFree(&buf);
|
||||
|
||||
/* If the line is: __EOF__ treat it as end-of-file */
|
||||
CurLine = DBufValue(&LineBuffer);
|
||||
if (!strcmp(CurLine, "__EOF__")) {
|
||||
if (PurgeMode && PurgeFP) {
|
||||
PurgeEchoLine("%s\n", "__EOF__");
|
||||
while ((n = fread(copy_buffer, 1, sizeof(copy_buffer), fp)) != 0) {
|
||||
fwrite(copy_buffer, 1, n, PurgeFP);
|
||||
}
|
||||
if (PurgeFP != stdout) fclose(PurgeFP);
|
||||
PurgeFP = NULL;
|
||||
}
|
||||
FCLOSE(fp);
|
||||
DBufFree(&LineBuffer);
|
||||
CurLine = DBufValue(&LineBuffer);
|
||||
}
|
||||
|
||||
FreshLine = 1;
|
||||
if (DebugFlag & DB_ECHO_LINE) OutputLine(ErrFp);
|
||||
return OK;
|
||||
}
|
||||
@@ -204,16 +270,18 @@ static int ReadLineFromFile()
|
||||
/* ShouldCache is 1, cache the file */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int OpenFile(const char *fname)
|
||||
#else
|
||||
int OpenFile(fname)
|
||||
char *fname;
|
||||
#endif
|
||||
int OpenFile(char const *fname)
|
||||
{
|
||||
CachedFile *h = CachedFiles;
|
||||
int r;
|
||||
|
||||
if (PurgeMode) {
|
||||
if (PurgeFP != NULL && PurgeFP != stdout) {
|
||||
fclose(PurgeFP);
|
||||
}
|
||||
PurgeFP = NULL;
|
||||
}
|
||||
|
||||
/* Assume we own the file for now */
|
||||
RunDisabled &= ~RUN_NOTOWNER;
|
||||
|
||||
@@ -221,14 +289,15 @@ char *fname;
|
||||
|
||||
while (h) {
|
||||
if (!strcmp(fname, h->filename)) {
|
||||
if (DebugFlag & DB_TRACE_FILES) {
|
||||
fprintf(ErrFp, "Reading `%s': Found in cache\n", fname);
|
||||
}
|
||||
CLine = h->cache;
|
||||
STRSET(FileName, fname);
|
||||
LineNo = 0;
|
||||
#ifdef UNIX
|
||||
if (!h->ownedByMe) {
|
||||
RunDisabled |= RUN_NOTOWNER;
|
||||
}
|
||||
#endif
|
||||
if (FileName) return OK; else return E_NO_MEM;
|
||||
}
|
||||
h = h->next;
|
||||
@@ -237,8 +306,20 @@ char *fname;
|
||||
/* If it's a dash, then it's stdin */
|
||||
if (!strcmp(fname, "-")) {
|
||||
fp = stdin;
|
||||
if (PurgeMode) {
|
||||
PurgeFP = stdout;
|
||||
}
|
||||
if (DebugFlag & DB_TRACE_FILES) {
|
||||
fprintf(ErrFp, "Reading `-': Reading stdin\n");
|
||||
}
|
||||
} else {
|
||||
fp = fopen(fname, "r");
|
||||
if (DebugFlag & DB_TRACE_FILES) {
|
||||
fprintf(ErrFp, "Reading `%s': Opening file on disk\n", fname);
|
||||
}
|
||||
if (PurgeMode) {
|
||||
OpenPurgeFile(fname, "w");
|
||||
}
|
||||
}
|
||||
if (!fp || !CheckSafety()) return E_CANT_OPEN;
|
||||
CLine = NULL;
|
||||
@@ -252,8 +333,10 @@ char *fname;
|
||||
if (strcmp(fname, "-")) {
|
||||
fp = fopen(fname, "r");
|
||||
if (!fp || !CheckSafety()) return E_CANT_OPEN;
|
||||
if (PurgeMode) OpenPurgeFile(fname, "w");
|
||||
} else {
|
||||
fp = stdin;
|
||||
if (PurgeMode) PurgeFP = stdout;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -270,23 +353,25 @@ char *fname;
|
||||
/* Returns an indication of success or failure. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int CacheFile(const char *fname)
|
||||
#else
|
||||
static int CacheFile(fname)
|
||||
char *fname;
|
||||
#endif
|
||||
static int CacheFile(char const *fname)
|
||||
{
|
||||
int r;
|
||||
CachedFile *cf;
|
||||
CachedLine *cl;
|
||||
char *s;
|
||||
char const *s;
|
||||
|
||||
if (DebugFlag & DB_TRACE_FILES) {
|
||||
fprintf(ErrFp, "Caching file `%s' in memory\n", fname);
|
||||
}
|
||||
cl = NULL;
|
||||
/* Create a file header */
|
||||
cf = NEW(CachedFile);
|
||||
if (!cf) {
|
||||
ShouldCache = 0;
|
||||
FCLOSE(fp);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
cf->cache = NULL;
|
||||
if (!cf) { ShouldCache = 0; FCLOSE(fp); return E_NO_MEM; }
|
||||
cf->filename = StrDup(fname);
|
||||
if (!cf->filename) {
|
||||
ShouldCache = 0;
|
||||
@@ -295,13 +380,12 @@ char *fname;
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
#ifdef UNIX
|
||||
if (RunDisabled & RUN_NOTOWNER) {
|
||||
cf->ownedByMe = 0;
|
||||
} else {
|
||||
cf->ownedByMe = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Read the file */
|
||||
while(fp) {
|
||||
r = ReadLineFromFile();
|
||||
@@ -313,7 +397,7 @@ char *fname;
|
||||
}
|
||||
/* Skip blank chars */
|
||||
s = DBufValue(&LineBuffer);
|
||||
while (isspace(*s)) s++;
|
||||
while (isempty(*s)) s++;
|
||||
if (*s && *s!=';' && *s!='#') {
|
||||
/* Add the line to the cache */
|
||||
if (!cl) {
|
||||
@@ -357,17 +441,33 @@ char *fname;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* NextChainedFile - move to the next chained file in a glob */
|
||||
/* list. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static int NextChainedFile(IncludeStruct *i)
|
||||
{
|
||||
while(i->chain) {
|
||||
FilenameChain *cur = i->chain;
|
||||
i->chain = i->chain->next;
|
||||
if (OpenFile(cur->filename) == OK) {
|
||||
return OK;
|
||||
} else {
|
||||
Eprint("%s: %s", ErrMsg[E_CANT_OPEN], cur->filename);
|
||||
}
|
||||
}
|
||||
return E_EOF;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* PopFile - we've reached the end. Pop up to the previous */
|
||||
/* file, or return E_EOF */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int PopFile(void)
|
||||
#else
|
||||
int PopFile()
|
||||
#endif
|
||||
static int PopFile(void)
|
||||
{
|
||||
IncludeStruct *i;
|
||||
|
||||
@@ -376,8 +476,21 @@ int PopFile()
|
||||
|
||||
if (!Hush && NumIfs) Eprint("%s", ErrMsg[E_MISS_ENDIF]);
|
||||
if (!IStackPtr) return E_EOF;
|
||||
i = &IStack[IStackPtr-1];
|
||||
|
||||
if (i->chain) {
|
||||
int oldRunDisabled = RunDisabled;
|
||||
if (NextChainedFile(i) == OK) {
|
||||
return OK;
|
||||
}
|
||||
RunDisabled = oldRunDisabled;
|
||||
}
|
||||
|
||||
if (IStackPtr <= 1) {
|
||||
return E_EOF;
|
||||
}
|
||||
|
||||
IStackPtr--;
|
||||
i = &IStack[IStackPtr];
|
||||
|
||||
LineNo = i->LineNo;
|
||||
IfFlags = i->IfFlags;
|
||||
@@ -385,23 +498,23 @@ int PopFile()
|
||||
CLine = i->CLine;
|
||||
fp = NULL;
|
||||
STRSET(FileName, i->filename);
|
||||
#ifdef UNIX
|
||||
if (!i->ownedByMe) {
|
||||
RunDisabled |= RUN_NOTOWNER;
|
||||
}
|
||||
#endif
|
||||
if (!CLine && (i->offset != -1L)) {
|
||||
/* We must open the file, then seek to specified position */
|
||||
if (strcmp(i->filename, "-")) {
|
||||
fp = fopen(i->filename, "r");
|
||||
if (!fp || !CheckSafety()) return E_CANT_OPEN;
|
||||
if (PurgeMode) OpenPurgeFile(i->filename, "a");
|
||||
} else {
|
||||
fp = stdin;
|
||||
if (PurgeMode) PurgeFP = stdout;
|
||||
}
|
||||
if (fp != stdin)
|
||||
(void) fseek(fp, i->offset, 0); /* Trust that it works... */
|
||||
}
|
||||
free(i->filename);
|
||||
free((char *) i->filename);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -412,19 +525,14 @@ int PopFile()
|
||||
/* The INCLUDE command. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoInclude(ParsePtr p)
|
||||
#else
|
||||
int DoInclude(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
{
|
||||
int DoInclude(ParsePtr p)
|
||||
{
|
||||
DynamicBuffer buf;
|
||||
int r, e;
|
||||
|
||||
DBufInit(&buf);
|
||||
if ( (r=ParseToken(p, &buf)) ) return r;
|
||||
e = VerifyEoln(p);
|
||||
e = VerifyEoln(p);
|
||||
if (e) Eprint("%s", ErrMsg[e]);
|
||||
if ( (r=IncludeFile(DBufValue(&buf))) ) {
|
||||
DBufFree(&buf);
|
||||
@@ -436,6 +544,126 @@ ParsePtr p;
|
||||
return OK;
|
||||
}
|
||||
|
||||
#ifdef HAVE_GLOB
|
||||
static int SetupGlobChain(char const *dirname, IncludeStruct *i)
|
||||
{
|
||||
DynamicBuffer pattern;
|
||||
char *dir;
|
||||
size_t l;
|
||||
int r;
|
||||
glob_t glob_buf;
|
||||
DirectoryFilenameChain *dc = CachedDirectoryChains;
|
||||
|
||||
i->chain = NULL;
|
||||
if (!*dirname) return E_CANT_OPEN;
|
||||
|
||||
dir = StrDup(dirname);
|
||||
if (!dir) return E_NO_MEM;
|
||||
|
||||
/* Strip trailing slashes off directory */
|
||||
l = strlen(dir);
|
||||
while(l) {
|
||||
if (*(dir+l-1) == '/') {
|
||||
l--;
|
||||
*(dir+l) = 0;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Repair root directory :-) */
|
||||
if (!l) {
|
||||
*dir = '/';
|
||||
}
|
||||
|
||||
/* Check the cache */
|
||||
while(dc) {
|
||||
if (!strcmp(dc->dirname, dir)) {
|
||||
if (DebugFlag & DB_TRACE_FILES) {
|
||||
fprintf(ErrFp, "Found cached directory listing for `%s'\n",
|
||||
dir);
|
||||
}
|
||||
free(dir);
|
||||
i->chain = dc->chain;
|
||||
return OK;
|
||||
}
|
||||
dc = dc->next;
|
||||
}
|
||||
|
||||
if (DebugFlag & DB_TRACE_FILES) {
|
||||
fprintf(ErrFp, "Scanning directory `%s' for *.rem files\n", dir);
|
||||
}
|
||||
|
||||
if (ShouldCache) {
|
||||
dc = malloc(sizeof(DirectoryFilenameChain));
|
||||
if (dc) {
|
||||
dc->dirname = StrDup(dir);
|
||||
if (!dc->dirname) {
|
||||
free(dc);
|
||||
dc = NULL;
|
||||
}
|
||||
}
|
||||
if (dc) {
|
||||
if (DebugFlag & DB_TRACE_FILES) {
|
||||
fprintf(ErrFp, "Caching directory `%s' listing\n", dir);
|
||||
}
|
||||
|
||||
dc->chain = NULL;
|
||||
dc->next = CachedDirectoryChains;
|
||||
CachedDirectoryChains = dc;
|
||||
}
|
||||
}
|
||||
|
||||
DBufInit(&pattern);
|
||||
DBufPuts(&pattern, dir);
|
||||
DBufPuts(&pattern, "/*.rem");
|
||||
free(dir);
|
||||
|
||||
r = glob(DBufValue(&pattern), 0, NULL, &glob_buf);
|
||||
DBufFree(&pattern);
|
||||
|
||||
if (r == GLOB_NOMATCH) {
|
||||
globfree(&glob_buf);
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (r != 0) {
|
||||
globfree(&glob_buf);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Add the files to the chain backwards to preserve sort order */
|
||||
for (r=glob_buf.gl_pathc-1; r>=0; r--) {
|
||||
FilenameChain *ch = malloc(sizeof(FilenameChain));
|
||||
if (!ch) {
|
||||
globfree(&glob_buf);
|
||||
FreeChain(i->chain);
|
||||
i->chain = NULL;
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
/* TODO: stat the file and only add if it's a plain file and
|
||||
readable by us */
|
||||
ch->filename = StrDup(glob_buf.gl_pathv[r]);
|
||||
if (!ch->filename) {
|
||||
globfree(&glob_buf);
|
||||
FreeChain(i->chain);
|
||||
i->chain = NULL;
|
||||
free(ch);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
ch->next = i->chain;
|
||||
i->chain = ch;
|
||||
}
|
||||
if (dc) {
|
||||
dc->chain = i->chain;
|
||||
}
|
||||
|
||||
globfree(&glob_buf);
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* IncludeFile */
|
||||
@@ -444,34 +672,33 @@ ParsePtr p;
|
||||
/* inclusion. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int IncludeFile(const char *fname)
|
||||
#else
|
||||
int IncludeFile(fname)
|
||||
char *fname;
|
||||
#endif
|
||||
int IncludeFile(char const *fname)
|
||||
{
|
||||
IncludeStruct *i;
|
||||
int r;
|
||||
int oldRunDisabled;
|
||||
struct stat statbuf;
|
||||
|
||||
FreshLine = 1;
|
||||
if (IStackPtr+1 >= INCLUDE_NEST) return E_NESTED_INCLUDE;
|
||||
i = &IStack[IStackPtr];
|
||||
|
||||
i->filename = StrDup(FileName);
|
||||
if (!i->filename) return E_NO_MEM;
|
||||
if (FileName) {
|
||||
i->filename = StrDup(FileName);
|
||||
if (!i->filename) return E_NO_MEM;
|
||||
} else {
|
||||
i->filename = NULL;
|
||||
}
|
||||
i->LineNo = LineNo;
|
||||
i->NumIfs = NumIfs;
|
||||
i->IfFlags = IfFlags;
|
||||
i->CLine = CLine;
|
||||
i->offset = -1L;
|
||||
#ifdef UNIX
|
||||
i->chain = NULL;
|
||||
if (RunDisabled & RUN_NOTOWNER) {
|
||||
i->ownedByMe = 0;
|
||||
} else {
|
||||
i->ownedByMe = 1;
|
||||
}
|
||||
#endif
|
||||
if (fp) {
|
||||
i->offset = ftell(fp);
|
||||
FCLOSE(fp);
|
||||
@@ -479,15 +706,52 @@ char *fname;
|
||||
|
||||
IStackPtr++;
|
||||
|
||||
#ifdef HAVE_GLOB
|
||||
/* If it's a directory, set up the glob chain here. */
|
||||
if (stat(fname, &statbuf) == 0) {
|
||||
FilenameChain *fc;
|
||||
if (S_ISDIR(statbuf.st_mode)) {
|
||||
if (SetupGlobChain(fname, i) == OK) { /* Glob succeeded */
|
||||
if (!i->chain) { /* Oops... no matching files */
|
||||
if (!Hush) {
|
||||
Eprint("%s: %s", fname, ErrMsg[E_NO_MATCHING_REMS]);
|
||||
}
|
||||
PopFile();
|
||||
return E_NO_MATCHING_REMS;
|
||||
}
|
||||
while(i->chain) {
|
||||
fc = i->chain;
|
||||
i->chain = i->chain->next;
|
||||
|
||||
/* Munch first file */
|
||||
oldRunDisabled = RunDisabled;
|
||||
if (!OpenFile(fc->filename)) {
|
||||
return OK;
|
||||
}
|
||||
Eprint("%s: %s", ErrMsg[E_CANT_OPEN], fc->filename);
|
||||
RunDisabled = oldRunDisabled;
|
||||
}
|
||||
/* Couldn't open anything... bail */
|
||||
return PopFile();
|
||||
} else {
|
||||
if (!Hush) {
|
||||
Eprint("%s: %s", fname, ErrMsg[E_NO_MATCHING_REMS]);
|
||||
}
|
||||
}
|
||||
return E_NO_MATCHING_REMS;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
oldRunDisabled = RunDisabled;
|
||||
/* Try to open the new file */
|
||||
if (!OpenFile(fname)) {
|
||||
return OK;
|
||||
}
|
||||
RunDisabled = oldRunDisabled;
|
||||
/* Ugh! We failed! */
|
||||
if ( (r=PopFile()) ) return r;
|
||||
Eprint("%s: %s", ErrMsg[E_CANT_OPEN], fname);
|
||||
/* Ugh! We failed! */
|
||||
PopFile();
|
||||
return E_CANT_OPEN;
|
||||
}
|
||||
|
||||
@@ -496,22 +760,13 @@ char *fname;
|
||||
/* GetAccessDate - get the access date of a file. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int GetAccessDate(char *file)
|
||||
#else
|
||||
int GetAccessDate(file)
|
||||
char *file;
|
||||
#endif
|
||||
int GetAccessDate(char const *file)
|
||||
{
|
||||
struct stat statbuf;
|
||||
struct tm *t1;
|
||||
|
||||
if (stat(file, &statbuf)) return -1;
|
||||
#ifdef __TURBOC__
|
||||
t1 = localtime( (time_t *) &(statbuf.st_atime) );
|
||||
#else
|
||||
t1 = localtime(&(statbuf.st_atime));
|
||||
#endif
|
||||
|
||||
if (t1->tm_year + 1900 < BASE)
|
||||
return 0;
|
||||
@@ -519,71 +774,6 @@ char *file;
|
||||
return Julian(t1->tm_year+1900, t1->tm_mon, t1->tm_mday);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* SetAccessDate */
|
||||
/* */
|
||||
/* Used only by DOS to set access date after we close the */
|
||||
/* file. Not needed for UNIX. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#if defined(__MSDOS__)
|
||||
/*
|
||||
* WARNING WARNING WARNING WARNING
|
||||
* In the version of Turbo C which I have, there is a bug in the
|
||||
* stdio.h file. The following lines correct the bug. YOU MAY
|
||||
* HAVE TO REMOVE THESE LINES FOR LATER VERSIONS OF TURBOC
|
||||
*/
|
||||
#ifdef __TURBOC__
|
||||
#ifndef fileno
|
||||
#define fileno(f) ((f)->fd)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int SetAccessDate(char *fname, int jul)
|
||||
#else
|
||||
int SetAccessDate(fname, jul)
|
||||
char *fname;
|
||||
int jul;
|
||||
#endif
|
||||
{
|
||||
|
||||
#ifdef __TURBOC__
|
||||
int y, m, d;
|
||||
struct ftime ft;
|
||||
FILE *f;
|
||||
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
ft.ft_tsec = 0;
|
||||
ft.ft_min = 0;
|
||||
ft.ft_hour = 12; /* Arbitrarily set time to noon. */
|
||||
ft.ft_day = (unsigned int) d;
|
||||
ft.ft_month = (unsigned int) m+1;
|
||||
ft.ft_year = (unsigned int) (y - 1980);
|
||||
|
||||
f = fopen(fname, "r");
|
||||
if (!f || setftime(fileno(f) , &ft)) {
|
||||
|
||||
#else /* Must be MSC */
|
||||
if (utime(fname, (struct utimbuf *) NULL)) {
|
||||
#endif
|
||||
fprintf(ErrFp, ErrMsg[M_CANTSET_ACCESS], fname);
|
||||
|
||||
#ifdef __TURBOC__
|
||||
if (f) FCLOSE(f);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef __TURBOC__
|
||||
FCLOSE(f);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* __MSDOS__ */
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DestroyCache */
|
||||
@@ -591,19 +781,14 @@ int jul;
|
||||
/* Free all the memory used by a cached file. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void DestroyCache(CachedFile *cf)
|
||||
#else
|
||||
static void DestroyCache(cf)
|
||||
CachedFile *cf;
|
||||
#endif
|
||||
static void DestroyCache(CachedFile *cf)
|
||||
{
|
||||
CachedLine *cl, *cnext;
|
||||
CachedFile *temp;
|
||||
if (cf->filename) free(cf->filename);
|
||||
if (cf->filename) free((char *) cf->filename);
|
||||
cl = cf->cache;
|
||||
while (cl) {
|
||||
if (cl->text) free (cl->text);
|
||||
if (cl->text) free ((char *) cl->text);
|
||||
cnext = cl->next;
|
||||
free(cl);
|
||||
cl = cnext;
|
||||
@@ -629,13 +814,9 @@ CachedFile *cf;
|
||||
/* Returns 1 if current file is top level, 0 otherwise. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int TopLevel(void)
|
||||
#else
|
||||
int TopLevel()
|
||||
#endif
|
||||
int TopLevel(void)
|
||||
{
|
||||
return !IStackPtr;
|
||||
return IStackPtr <= 1;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -649,13 +830,8 @@ int TopLevel()
|
||||
/* who we're running as. */
|
||||
/* As a side effect, if we don't own the file, we disable RUN */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int CheckSafety(void)
|
||||
#else
|
||||
static int CheckSafety()
|
||||
#endif
|
||||
static int CheckSafety(void)
|
||||
{
|
||||
#ifdef UNIX
|
||||
struct stat statbuf;
|
||||
|
||||
if (fp == stdin) {
|
||||
@@ -695,6 +871,5 @@ static int CheckSafety()
|
||||
RunDisabled |= RUN_NOTOWNER;
|
||||
}
|
||||
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
2473
src/funcs.c
2473
src/funcs.c
File diff suppressed because it is too large
Load Diff
@@ -8,16 +8,15 @@
|
||||
/* globals.h and err.h */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: globals.c,v 1.3 1999-04-05 17:34:50 dfs Exp $";
|
||||
|
||||
#include <stdio.h> /* For defintion of FILE - sigh! */
|
||||
#include "types.h"
|
||||
#include "custom.h"
|
||||
#define MK_GLOBALS
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
/* MK_GLOBALS. Also contains useful macro definitions. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: globals.h,v 1.6 1999-04-05 17:34:50 dfs Exp $ */
|
||||
|
||||
#ifdef MK_GLOBALS
|
||||
#undef EXTERN
|
||||
#define EXTERN
|
||||
@@ -24,6 +21,8 @@
|
||||
#define INIT(var, val) var
|
||||
#endif
|
||||
|
||||
#define MINUTES_PER_DAY 1440
|
||||
|
||||
#define DaysInYear(y) (((y) % 4) ? 365 : ((!((y) % 100) && ((y) % 400)) ? 365 : 366 ))
|
||||
#define IsLeapYear(y) (((y) % 4) ? 0 : ((!((y) % 100) && ((y) % 400)) ? 0 : 1 ))
|
||||
#define DaysInMonth(m, y) ((m) != 1 ? MonthDays[m] : 28 + IsLeapYear(y))
|
||||
@@ -37,29 +36,33 @@ EXTERN int CurMon;
|
||||
EXTERN int CurYear;
|
||||
EXTERN int LineNo;
|
||||
EXTERN int FreshLine;
|
||||
EXTERN INIT( char *MsgCommand, NULL);
|
||||
EXTERN INIT( char const *MsgCommand, NULL);
|
||||
EXTERN INIT( int ShowAllErrors, 0);
|
||||
EXTERN INIT( int DebugFlag, 0);
|
||||
EXTERN INIT( int DoCalendar, 0);
|
||||
EXTERN INIT( int DoSimpleCalendar, 0);
|
||||
EXTERN INIT( int DoSimpleCalDelta, 0);
|
||||
EXTERN INIT( int DoPrefixLineNo, 0);
|
||||
EXTERN INIT( int MondayFirst, 0);
|
||||
EXTERN INIT( int Iterations, 1);
|
||||
EXTERN INIT( int PsCal, 0);
|
||||
EXTERN INIT( int CalWidth, 80);
|
||||
EXTERN INIT( int CalWidth, -1);
|
||||
EXTERN INIT( int CalWeeks, 0);
|
||||
EXTERN INIT( int CalMonths, 0);
|
||||
EXTERN INIT( int Hush, 0);
|
||||
EXTERN INIT( int NextMode, 0);
|
||||
EXTERN INIT( int InfiniteDelta, 0);
|
||||
EXTERN INIT( int DeltaOffset, 0);
|
||||
EXTERN INIT( int RunDisabled, 0);
|
||||
EXTERN INIT( int IgnoreOnce, 0);
|
||||
EXTERN INIT( int SortByTime, 0);
|
||||
EXTERN INIT( int SortByDate, 0);
|
||||
EXTERN INIT( int SortByPrio, 0);
|
||||
EXTERN INIT( int UntimedBeforeTimed, 0);
|
||||
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
|
||||
EXTERN INIT( long SysTime, -1L);
|
||||
|
||||
EXTERN char *InitialFile;
|
||||
EXTERN char const *InitialFile;
|
||||
EXTERN int FileAccessDate;
|
||||
|
||||
EXTERN INIT( int DontFork, 0);
|
||||
@@ -67,25 +70,42 @@ EXTERN INIT( int DontQueue, 0);
|
||||
EXTERN INIT( int NumQueued, 0);
|
||||
EXTERN INIT( int DontIssueAts, 0);
|
||||
EXTERN INIT( int Daemon, 0);
|
||||
|
||||
|
||||
EXTERN INIT( char DateSep, DATESEP);
|
||||
EXTERN INIT( char TimeSep, TIMESEP);
|
||||
EXTERN INIT( char DateTimeSep, DATETIMESEP);
|
||||
EXTERN INIT( int DefaultColorR, -1);
|
||||
EXTERN INIT( int DefaultColorB, -1);
|
||||
EXTERN INIT( int DefaultColorG, -1);
|
||||
EXTERN INIT( int SynthesizeTags, 0);
|
||||
EXTERN INIT( int ScFormat, SC_AMPM);
|
||||
EXTERN INIT( int MaxSatIter, 150);
|
||||
EXTERN INIT( int MaxStringLen, MAX_STR_LEN);
|
||||
EXTERN INIT( char *FileName, NULL);
|
||||
EXTERN INIT( int UseStdin, 0);
|
||||
EXTERN INIT( int PurgeMode, 0);
|
||||
EXTERN INIT( int PurgeIncludeDepth, 0);
|
||||
EXTERN FILE *ErrFp;
|
||||
EXTERN INIT( FILE *PurgeFP, NULL);
|
||||
EXTERN INIT( int NumIfs, 0);
|
||||
EXTERN INIT( unsigned int IfFlags, 0);
|
||||
EXTERN INIT( int LastTriggerDate, 0);
|
||||
EXTERN INIT( int LastTrigValid, 0);
|
||||
EXTERN Trigger LastTrigger;
|
||||
EXTERN TimeTrig LastTimeTrig;
|
||||
EXTERN INIT( int LastTriggerDate, 0);
|
||||
EXTERN INIT( int LastTriggerTime, 0);
|
||||
EXTERN INIT( int ShouldCache, 0);
|
||||
EXTERN char *CurLine;
|
||||
EXTERN char const *CurLine;
|
||||
EXTERN INIT( int NumTriggered, 0);
|
||||
EXTERN int ArgC;
|
||||
EXTERN char **ArgV;
|
||||
EXTERN char const **ArgV;
|
||||
EXTERN INIT( int CalLines, CAL_LINES);
|
||||
EXTERN INIT( int CalPad, 1);
|
||||
EXTERN INIT( int UseVTChars, 0);
|
||||
EXTERN INIT( int UseUTF8Chars, 0);
|
||||
EXTERN INIT( int UseVTColors, 0);
|
||||
EXTERN INIT( int Use256Colors, 0);
|
||||
EXTERN INIT( int UseTrueColors, 0);
|
||||
EXTERN INIT( int TerminalBackground, TERMINAL_BACKGROUND_UNKNOWN);
|
||||
|
||||
/* Latitude and longitude */
|
||||
EXTERN INIT( int LatDeg, LAT_DEG);
|
||||
@@ -171,12 +191,3 @@ EXTERN int MonthIndex[2][12]
|
||||
#endif
|
||||
;
|
||||
|
||||
#if defined(__OS2__)
|
||||
#if defined(_MSC_VER) || defined(__EMX__)
|
||||
#define OS2MODE (_osmode == OS2_MODE)
|
||||
#define DOSMODE (_osmode == DOS_MODE)
|
||||
#else
|
||||
#define OS2MODE 1
|
||||
#define DOSMODE 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
97
src/hbcal.c
97
src/hbcal.c
@@ -5,8 +5,7 @@
|
||||
/* Support for the Hebrew calendar */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/* Derived from code written by Amos Shapir in 1978; revised */
|
||||
/* 1985. */
|
||||
@@ -14,7 +13,6 @@
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: hbcal.c,v 1.3 1999-04-05 17:34:50 dfs Exp $";
|
||||
|
||||
#include <stdio.h> /* For FILE used by protos.h - sigh. */
|
||||
#include "types.h"
|
||||
@@ -56,7 +54,7 @@ static char const RCSID[] = "$Id: hbcal.c,v 1.3 1999-04-05 17:34:50 dfs Exp $";
|
||||
#define ADAR2ADARA 1
|
||||
#define ADAR2BOTH 2
|
||||
|
||||
static char *HebMonthNames[] = {
|
||||
static char const *HebMonthNames[] = {
|
||||
"Tishrey", "Heshvan", "Kislev", "Tevet", "Shvat", "Adar A", "Adar B",
|
||||
"Nisan", "Iyar", "Sivan", "Tamuz", "Av", "Elul", "Adar"};
|
||||
|
||||
@@ -64,7 +62,7 @@ static char MaxMonLen[] = {
|
||||
30, 30, 30, 29, 30, 30, 29, 30, 29, 30, 29, 30, 29, 29};
|
||||
|
||||
static char HebIsLeap[] = {0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1};
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* RoshHashana */
|
||||
@@ -73,12 +71,7 @@ static char HebIsLeap[] = {0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1};
|
||||
/* Hebrew year. (ie, 5751, not 1990) */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int RoshHashana(int i)
|
||||
#else
|
||||
int RoshHashana(i)
|
||||
int i;
|
||||
#endif
|
||||
int RoshHashana(int i)
|
||||
{
|
||||
long j;
|
||||
j = DaysToHebYear(i-3744) - CORRECTION;
|
||||
@@ -93,12 +86,7 @@ int i;
|
||||
/* from new moon before Tishrey 1 5701. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC long DaysToHebYear(int y)
|
||||
#else
|
||||
long DaysToHebYear(y)
|
||||
int y;
|
||||
#endif
|
||||
long DaysToHebYear(int y)
|
||||
{
|
||||
long m, nm, dw, s, l;
|
||||
|
||||
@@ -131,12 +119,7 @@ int y;
|
||||
/* */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DaysInHebYear(int y)
|
||||
#else
|
||||
int DaysInHebYear(y)
|
||||
int y;
|
||||
#endif
|
||||
int DaysInHebYear(int y)
|
||||
{
|
||||
long thisyear, nextyear;
|
||||
|
||||
@@ -153,15 +136,10 @@ int y;
|
||||
/* given the LENGTH of the Hebrew year. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *DaysInHebMonths(int ylen)
|
||||
#else
|
||||
char *DaysInHebMonths(ylen)
|
||||
int ylen;
|
||||
#endif
|
||||
char const *DaysInHebMonths(int ylen)
|
||||
{
|
||||
static char monlen[13] =
|
||||
{30, 29, 30, 29, 30, 0, 29, 30, 29, 30, 29, 30, 29};
|
||||
static char monlen[14] =
|
||||
{30, 29, 30, 29, 30, 0, 29, 30, 29, 30, 29, 30, 29, 29};
|
||||
|
||||
|
||||
if (ylen > 355) {
|
||||
@@ -184,15 +162,10 @@ int ylen;
|
||||
/* non-leap-years. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int HebToJul(int hy, int hm, int hd)
|
||||
#else
|
||||
int HebToJul(hy, hm, hd)
|
||||
int hy, hm, hd;
|
||||
#endif
|
||||
int HebToJul(int hy, int hm, int hd)
|
||||
{
|
||||
int ylen;
|
||||
char *monlens;
|
||||
char const *monlens;
|
||||
int rh;
|
||||
int m;
|
||||
|
||||
@@ -222,17 +195,12 @@ int hy, hm, hd;
|
||||
/* non-leap-years. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void JulToHeb(int jul, int *hy, int *hm, int *hd)
|
||||
#else
|
||||
void JulToHeb(jul, hy, hm, hd)
|
||||
int jul, *hy, *hm, *hd;
|
||||
#endif
|
||||
void JulToHeb(int jul, int *hy, int *hm, int *hd)
|
||||
{
|
||||
int y, m, d;
|
||||
int rh;
|
||||
int ylen;
|
||||
char *monlen;
|
||||
char const *monlen;
|
||||
/* Get the common year */
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
y += 3763; /* Over-estimate a bit to be on the safe side below... */
|
||||
@@ -263,12 +231,7 @@ int jul, *hy, *hm, *hd;
|
||||
/* year. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int HebNameToNum(const char *mname)
|
||||
#else
|
||||
int HebNameToNum(mname)
|
||||
char *mname;
|
||||
#endif
|
||||
int HebNameToNum(char const *mname)
|
||||
{
|
||||
int i;
|
||||
int m=-1;
|
||||
@@ -290,12 +253,7 @@ char *mname;
|
||||
/* year. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *HebMonthName(int m, int y)
|
||||
#else
|
||||
char *HebMonthName(m, y)
|
||||
int m, y;
|
||||
#endif
|
||||
char const *HebMonthName(int m, int y)
|
||||
{
|
||||
if (m != ADARA && m != ADARB) return HebMonthNames[m];
|
||||
|
||||
@@ -331,15 +289,10 @@ int m, y;
|
||||
/* Change 30 Adar A to 30 Shvat in nonleap */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int GetValidHebDate(int yin, int min, int din, int adarbehave,
|
||||
int GetValidHebDate(int yin, int min, int din, int adarbehave,
|
||||
int *mout, int *dout, int jahr)
|
||||
#else
|
||||
int GetValidHebDate(yin, min, din, adarbehave, mout, dout, jahr)
|
||||
int yin, min, din, adarbehave, *mout, *dout, jahr;
|
||||
#endif
|
||||
{
|
||||
char *monlen;
|
||||
char const *monlen;
|
||||
int ylen;
|
||||
|
||||
*mout = min;
|
||||
@@ -436,13 +389,8 @@ int yin, min, din, adarbehave, *mout, *dout, jahr;
|
||||
/* Returns 0 for success, non-zero for failure. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int GetNextHebrewDate(int julstart, int hm, int hd,
|
||||
int GetNextHebrewDate(int julstart, int hm, int hd,
|
||||
int jahr, int adarbehave, int *ans)
|
||||
#else
|
||||
int GetNextHebrewDate(julstart, hm, hd, jahr, adarbehave, ans)
|
||||
int julstart, hm, hd, jahr, adarbehave, *ans;
|
||||
#endif
|
||||
{
|
||||
int r, yout, mout, dout, jul=1;
|
||||
int adarflag = adarbehave;
|
||||
@@ -497,14 +445,9 @@ int julstart, hm, hd, jahr, adarbehave, *ans;
|
||||
/* Given a date of death, compute the value to use for jahr. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ComputeJahr(int y, int m, int d, int *ans)
|
||||
#else
|
||||
int ComputeJahr(y, m, d, ans)
|
||||
int y, m, d, *ans;
|
||||
#endif
|
||||
int ComputeJahr(int y, int m, int d, int *ans)
|
||||
{
|
||||
char *monlen;
|
||||
char const *monlen;
|
||||
int len;
|
||||
|
||||
*ans = JAHR_NONE;
|
||||
|
||||
475
src/init.c
475
src/init.c
@@ -7,44 +7,28 @@
|
||||
/* in normal mode. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "version.h"
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: init.c,v 1.11 1999-04-12 19:45:27 dfs Exp $";
|
||||
|
||||
#define L_IN_INIT 1
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
#include "err.h"
|
||||
#include "version.h"
|
||||
#include "globals.h"
|
||||
|
||||
/***************************************************************
|
||||
@@ -55,9 +39,12 @@ static char const RCSID[] = "$Id: init.c,v 1.11 1999-04-12 19:45:27 dfs Exp $";
|
||||
* simple calendar format.
|
||||
* -r = Disallow RUN mode
|
||||
* -c[n] = Produce a calendar for n months (default = 1)
|
||||
* -@[n,m] = Colorize n=0 VT100 n=1 85 n=2 True m=0 dark terminal m=1 light
|
||||
* -w[n,n,n] = Specify output device width, padding and spacing
|
||||
* -s[n] = Produce calendar in "simple calendar" format
|
||||
* -p[n] = Produce calendar in format compatible with rem2ps
|
||||
* -l = Prefix simple calendar lines with a comment containing
|
||||
* their trigger line numbers and filenames
|
||||
* -v = Verbose mode
|
||||
* -o = Ignore ONCE directives
|
||||
* -a = Don't issue timed reminders which will be queued
|
||||
@@ -66,13 +53,14 @@ static char const RCSID[] = "$Id: init.c,v 1.11 1999-04-12 19:45:27 dfs Exp $";
|
||||
* -h = Hush mode
|
||||
* -f = Do not fork
|
||||
* -dchars = Debugging mode: Chars are:
|
||||
* f = Trace file openings
|
||||
* e = Echo input lines
|
||||
* x = Display expression evaluation
|
||||
* t = Display trigger dates
|
||||
* v = Dump variables at end
|
||||
* l = Display entire line in error messages
|
||||
* -e = Send messages normally sent to stderr to stdout instead
|
||||
* -z[n] = Daemon mode waking up every n (def 5) minutes.
|
||||
* -z[n] = Daemon mode waking up every n (def 1) minutes.
|
||||
* -bn = Time format for cal (0, 1, or 2)
|
||||
* -xn = Max. number of iterations for SATISFY
|
||||
* -uname = Run as user 'name' - only valid when run by root. If run
|
||||
@@ -80,9 +68,13 @@ static char const RCSID[] = "$Id: init.c,v 1.11 1999-04-12 19:45:27 dfs Exp $";
|
||||
* -kcmd = Run 'cmd' for MSG-type reminders instead of printing to stdout
|
||||
* -iVAR=EXPR = Initialize and preserve VAR.
|
||||
* -m = Start calendar with Monday instead of Sunday.
|
||||
* -j[n] = Purge all junk from reminder files (n = INCLUDE depth)
|
||||
* 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 */
|
||||
#define PARSENUM(var, s) \
|
||||
@@ -93,13 +85,41 @@ while (isdigit(*(s))) { \
|
||||
s++; \
|
||||
}
|
||||
|
||||
#ifdef UNIX
|
||||
PRIVATE void ChgUser ARGS((char *uname));
|
||||
#endif
|
||||
static void ChgUser(char const *u);
|
||||
static void InitializeVar(char const *str);
|
||||
|
||||
PRIVATE void InitializeVar ARGS ((char *str));
|
||||
static char const *BadDate = "Illegal date on command line\n";
|
||||
|
||||
static char *BadDate = "Illegal date on command line\n";
|
||||
static DynamicBuffer default_filename_buf;
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DefaultFilename */
|
||||
/* */
|
||||
/* If we're invoked as "rem" rather than "remind", use a */
|
||||
/* default filename. Use $DOTREMINDERS or $HOME/.reminders */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
static char const *DefaultFilename(void)
|
||||
{
|
||||
char const *s;
|
||||
|
||||
DBufInit(&default_filename_buf);
|
||||
|
||||
s = getenv("DOTREMINDERS");
|
||||
if (s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
s = getenv("HOME");
|
||||
if (!s) {
|
||||
fprintf(stderr, "HOME environment variable not set. Unable to determine reminder file.\n");
|
||||
exit(1);
|
||||
}
|
||||
DBufPuts(&default_filename_buf, s);
|
||||
DBufPuts(&default_filename_buf, "/.reminders");
|
||||
return DBufValue(&default_filename_buf);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -108,19 +128,37 @@ static char *BadDate = "Illegal date on command line\n";
|
||||
/* Initialize the system - called only once at beginning! */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void InitRemind(int argc, char *argv[])
|
||||
#else
|
||||
void InitRemind(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
#endif
|
||||
void InitRemind(int argc, char const *argv[])
|
||||
{
|
||||
char *arg;
|
||||
char const *arg;
|
||||
int i;
|
||||
int y, m, d, rep;
|
||||
Token tok;
|
||||
int InvokedAsRem = 0;
|
||||
char const *s;
|
||||
int weeks;
|
||||
int x;
|
||||
int jul;
|
||||
|
||||
#if defined(__APPLE__)
|
||||
rkrphgvba(0);
|
||||
#elif defined(__CYGWIN__)
|
||||
rkrphgvba(1);
|
||||
#endif
|
||||
|
||||
jul = NO_DATE;
|
||||
|
||||
/* If stdout is a terminal, initialize $FormWidth to terminal width-8,
|
||||
but clamp to [20, 500] */
|
||||
if (isatty(STDOUT_FILENO)) {
|
||||
struct winsize w;
|
||||
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) == 0) {
|
||||
FormWidth = w.ws_col - 8;
|
||||
if (FormWidth < 20) FormWidth = 20;
|
||||
if (FormWidth > 500) FormWidth = 500;
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize global dynamic buffers */
|
||||
DBufInit(&Banner);
|
||||
DBufInit(&LineBuffer);
|
||||
@@ -128,14 +166,14 @@ char *argv[];
|
||||
|
||||
DBufPuts(&Banner, L_BANNER);
|
||||
|
||||
PurgeFP = NULL;
|
||||
|
||||
/* Make sure remind is not installed set-uid or set-gid */
|
||||
#ifdef UNIX
|
||||
if (getgid() != getegid() ||
|
||||
getuid() != geteuid()) {
|
||||
fprintf(ErrFp, "\nRemind should not be installed set-uid or set-gid.\nCHECK YOUR SYSTEM SECURITY.\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
y = NO_YR;
|
||||
m = NO_MON;
|
||||
@@ -150,21 +188,22 @@ char *argv[];
|
||||
JulianToday = RealToday;
|
||||
FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
|
||||
|
||||
#if !defined(HAVE_QUEUED)
|
||||
DontFork = 1;
|
||||
DontQueue = 1;
|
||||
NumQueued = 0;
|
||||
DontIssueAts = 0;
|
||||
Daemon = 0;
|
||||
#elif defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
DontFork = 1;
|
||||
#elif defined(__OS2__) && defined (__MSDOS__)
|
||||
if (DOSMODE)
|
||||
DontFork = 1;
|
||||
#endif
|
||||
/* See if we were invoked as "rem" rather than "remind" */
|
||||
if (argv[0]) {
|
||||
s = strrchr(argv[0], '/');
|
||||
if (!s) {
|
||||
s = argv[0];
|
||||
} else {
|
||||
s++;
|
||||
}
|
||||
if (!strcmp(s, "rem")) {
|
||||
InvokedAsRem = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse the command-line options */
|
||||
i = 1;
|
||||
|
||||
while (i < argc) {
|
||||
arg = argv[i];
|
||||
if (*arg != '-') break; /* Exit the loop if it's not an option */
|
||||
@@ -179,19 +218,45 @@ char *argv[];
|
||||
while (*arg) {
|
||||
switch(*arg++) {
|
||||
|
||||
case '@':
|
||||
UseVTColors = 1;
|
||||
if (*arg) {
|
||||
PARSENUM(x, arg);
|
||||
if (x == 1) {
|
||||
Use256Colors = 1;
|
||||
} else if (x == 2) {
|
||||
UseTrueColors = 1;
|
||||
}
|
||||
}
|
||||
if (*arg == ',') {
|
||||
arg++;
|
||||
PARSENUM(x, arg);
|
||||
if (x == 0) {
|
||||
TerminalBackground = TERMINAL_BACKGROUND_DARK;
|
||||
} else if (x == 1) {
|
||||
TerminalBackground = TERMINAL_BACKGROUND_LIGHT;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'j':
|
||||
case 'J':
|
||||
PurgeMode = 1;
|
||||
if (*arg) {
|
||||
PARSENUM(PurgeIncludeDepth, arg);
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
case 'I':
|
||||
InitializeVar(arg);
|
||||
while(*arg) arg++;
|
||||
break;
|
||||
|
||||
|
||||
case 'n':
|
||||
case 'N':
|
||||
NextMode = 1;
|
||||
#ifdef HAVE_QUEUED
|
||||
DontQueue = 1;
|
||||
Daemon = 0;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
@@ -209,11 +274,22 @@ char *argv[];
|
||||
IgnoreOnce = 1;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
case 'T':
|
||||
InfiniteDelta = 1;
|
||||
case 'y':
|
||||
case 'Y':
|
||||
SynthesizeTags = 1;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
case 'T':
|
||||
if (!*arg) {
|
||||
InfiniteDelta = 1;
|
||||
} else {
|
||||
PARSENUM(DeltaOffset, arg);
|
||||
if (DeltaOffset < 0) {
|
||||
DeltaOffset = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'e':
|
||||
case 'E':
|
||||
ErrFp = stdout;
|
||||
@@ -229,6 +305,7 @@ char *argv[];
|
||||
SortByDate = SORT_ASCEND;
|
||||
SortByTime = SORT_ASCEND;
|
||||
SortByPrio = SORT_ASCEND;
|
||||
UntimedBeforeTimed = 0;
|
||||
if (*arg) {
|
||||
if (*arg == 'D' || *arg == 'd')
|
||||
SortByDate = SORT_DESCEND;
|
||||
@@ -244,36 +321,37 @@ char *argv[];
|
||||
SortByPrio = SORT_DESCEND;
|
||||
arg++;
|
||||
}
|
||||
if (*arg) {
|
||||
if (*arg == 'D' || *arg == 'd')
|
||||
UntimedBeforeTimed = 1;
|
||||
arg++;
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(UNIX) && defined(WANT_U_OPTION)
|
||||
case 'u':
|
||||
case 'U':
|
||||
ChgUser(arg);
|
||||
RunDisabled = RUN_CMDLINE;
|
||||
while (*arg) arg++;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_QUEUED
|
||||
case 'z':
|
||||
case 'Z':
|
||||
DontFork = 1;
|
||||
if (*arg == '0') {
|
||||
PARSENUM(Daemon, arg);
|
||||
if (Daemon == 0) Daemon = -1;
|
||||
else if (Daemon < 5) Daemon = 5;
|
||||
else if (Daemon < 1) Daemon = 1;
|
||||
else if (Daemon > 60) Daemon = 60;
|
||||
} else {
|
||||
PARSENUM(Daemon, arg);
|
||||
if (Daemon<5) Daemon=5;
|
||||
if (Daemon<1) Daemon=1;
|
||||
else if (Daemon>60) Daemon=60;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'a':
|
||||
case 'A':
|
||||
DontIssueAts = 1;
|
||||
DontIssueAts++;
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
@@ -285,12 +363,41 @@ char *argv[];
|
||||
case 'F':
|
||||
DontFork = 1;
|
||||
break;
|
||||
#endif
|
||||
case 'c':
|
||||
case 'C':
|
||||
DoCalendar = 1;
|
||||
if (*arg == '+') {
|
||||
arg++;
|
||||
weeks = 0;
|
||||
/* Parse the flags */
|
||||
while(*arg) {
|
||||
if (*arg == 'a' ||
|
||||
*arg == 'A') {
|
||||
DoSimpleCalDelta = 1;
|
||||
arg++;
|
||||
continue;
|
||||
}
|
||||
if (*arg == '+') {
|
||||
weeks = 1;
|
||||
arg++;
|
||||
continue;
|
||||
}
|
||||
if (*arg == 'l' || *arg == 'L') {
|
||||
UseVTChars = 1;
|
||||
arg++;
|
||||
continue;
|
||||
}
|
||||
if (*arg == 'u' || *arg == 'U') {
|
||||
UseUTF8Chars = 1;
|
||||
arg++;
|
||||
continue;
|
||||
}
|
||||
if (*arg == 'c' || *arg == 'C') {
|
||||
UseVTColors = 1;
|
||||
arg++;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (weeks) {
|
||||
PARSENUM(CalWeeks, arg);
|
||||
if (!CalWeeks) CalWeeks = 1;
|
||||
} else {
|
||||
@@ -302,8 +409,21 @@ char *argv[];
|
||||
case 's':
|
||||
case 'S':
|
||||
DoSimpleCalendar = 1;
|
||||
if (*arg == '+') {
|
||||
arg++;
|
||||
weeks = 0;
|
||||
while(*arg) {
|
||||
if (*arg == 'a' || *arg == 'A') {
|
||||
DoSimpleCalDelta = 1;
|
||||
arg++;
|
||||
continue;
|
||||
}
|
||||
if (*arg == '+') {
|
||||
arg++;
|
||||
weeks = 1;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (weeks) {
|
||||
PARSENUM(CalWeeks, arg);
|
||||
if (!CalWeeks) CalWeeks = 1;
|
||||
} else {
|
||||
@@ -315,16 +435,40 @@ char *argv[];
|
||||
case 'p':
|
||||
case 'P':
|
||||
DoSimpleCalendar = 1;
|
||||
PsCal = 1;
|
||||
PsCal = PSCAL_LEVEL1;
|
||||
while (*arg == 'a' || *arg == 'A' ||
|
||||
*arg == 'p' || *arg == 'P') {
|
||||
if (*arg == 'a' || *arg == 'A') {
|
||||
DoSimpleCalDelta = 1;
|
||||
} else if (*arg == 'p' || *arg == 'P') {
|
||||
/* JSON interchange formats always include
|
||||
file and line number info */
|
||||
DoPrefixLineNo = 1;
|
||||
if (PsCal == PSCAL_LEVEL1) {
|
||||
PsCal = PSCAL_LEVEL2;
|
||||
} else {
|
||||
PsCal = PSCAL_LEVEL3;
|
||||
}
|
||||
}
|
||||
arg++;
|
||||
}
|
||||
PARSENUM(CalMonths, arg);
|
||||
if (!CalMonths) CalMonths = 1;
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
case 'L':
|
||||
DoPrefixLineNo = 1;
|
||||
break;
|
||||
|
||||
case 'w':
|
||||
case 'W':
|
||||
if (*arg != ',') {
|
||||
PARSENUM(CalWidth, arg);
|
||||
if (CalWidth < 71) CalWidth = 71;
|
||||
if (CalWidth != 0 && CalWidth < 71) CalWidth = 71;
|
||||
if (CalWidth == 0) {
|
||||
CalWidth = -1;
|
||||
}
|
||||
}
|
||||
if (*arg == ',') {
|
||||
arg++;
|
||||
@@ -344,11 +488,12 @@ char *argv[];
|
||||
case 'D':
|
||||
while (*arg) {
|
||||
switch(*arg++) {
|
||||
case 'e': case 'E': DebugFlag |= DB_ECHO_LINE; break;
|
||||
case 'x': case 'X': DebugFlag |= DB_PRTEXPR; break;
|
||||
case 't': case 'T': DebugFlag |= DB_PRTTRIG; break;
|
||||
case 'v': case 'V': DebugFlag |= DB_DUMP_VARS; break;
|
||||
case 'l': case 'L': DebugFlag |= DB_PRTLINE; break;
|
||||
case 'e': case 'E': DebugFlag |= DB_ECHO_LINE; break;
|
||||
case 'x': case 'X': DebugFlag |= DB_PRTEXPR; break;
|
||||
case 't': case 'T': DebugFlag |= DB_PRTTRIG; break;
|
||||
case 'v': case 'V': DebugFlag |= DB_DUMP_VARS; break;
|
||||
case 'l': case 'L': DebugFlag |= DB_PRTLINE; break;
|
||||
case 'f': case 'F': DebugFlag |= DB_TRACE_FILES; break;
|
||||
default:
|
||||
fprintf(ErrFp, ErrMsg[M_BAD_DB_FLAG], *(arg-1));
|
||||
}
|
||||
@@ -387,11 +532,15 @@ char *argv[];
|
||||
}
|
||||
|
||||
/* Get the filename. */
|
||||
if (i >= argc) {
|
||||
Usage();
|
||||
exit(1);
|
||||
if (!InvokedAsRem) {
|
||||
if (i >= argc) {
|
||||
Usage();
|
||||
exit(1);
|
||||
}
|
||||
InitialFile = argv[i++];
|
||||
} else {
|
||||
InitialFile = DefaultFilename();
|
||||
}
|
||||
InitialFile = argv[i++];
|
||||
|
||||
/* Get the date, if any */
|
||||
if (i < argc) {
|
||||
@@ -403,25 +552,37 @@ char *argv[];
|
||||
if (SysTime != -1L) Usage();
|
||||
else {
|
||||
SysTime = (long) tok.val * 60L;
|
||||
#ifdef HAVE_QUEUED
|
||||
DontQueue = 1;
|
||||
Daemon = 0;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
||||
case T_DateTime:
|
||||
if (SysTime != -1L) Usage();
|
||||
if (m != NO_MON || d != NO_DAY || y != NO_YR || jul != NO_DATE) Usage();
|
||||
SysTime = (tok.val % MINUTES_PER_DAY) * 60;
|
||||
DontQueue = 1;
|
||||
Daemon = 0;
|
||||
jul = tok.val / MINUTES_PER_DAY;
|
||||
break;
|
||||
|
||||
case T_Date:
|
||||
if (m != NO_MON || d != NO_DAY || y != NO_YR || jul != NO_DATE) Usage();
|
||||
jul = tok.val;
|
||||
break;
|
||||
|
||||
case T_Month:
|
||||
if (m != NO_MON) Usage();
|
||||
if (m != NO_MON || jul != NO_DATE) Usage();
|
||||
else m = tok.val;
|
||||
break;
|
||||
|
||||
case T_Day:
|
||||
if (d != NO_DAY) Usage();
|
||||
if (d != NO_DAY || jul != NO_DATE) Usage();
|
||||
else d = tok.val;
|
||||
break;
|
||||
|
||||
case T_Year:
|
||||
if (y != NO_YR) Usage();
|
||||
if (y != NO_YR || jul != NO_DATE) Usage();
|
||||
else y = tok.val;
|
||||
break;
|
||||
|
||||
@@ -430,7 +591,8 @@ char *argv[];
|
||||
else rep = tok.val;
|
||||
break;
|
||||
|
||||
default: Usage();
|
||||
default:
|
||||
Usage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -440,6 +602,9 @@ char *argv[];
|
||||
Daemon = 0;
|
||||
}
|
||||
|
||||
if (jul != NO_DATE) {
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
}
|
||||
/* Must supply date in the form: day, mon, yr OR mon, yr */
|
||||
if (m != NO_MON || y != NO_YR || d != NO_DAY) {
|
||||
if (m == NO_MON || y == NO_YR) {
|
||||
@@ -453,12 +618,12 @@ char *argv[];
|
||||
}
|
||||
if (d == NO_DAY) d=1;
|
||||
if (d > DaysInMonth(m, y)) {
|
||||
fprintf(ErrFp, BadDate);
|
||||
fprintf(ErrFp, "%s", BadDate);
|
||||
Usage();
|
||||
}
|
||||
JulianToday = Julian(y, m, d);
|
||||
if (JulianToday == -1) {
|
||||
fprintf(ErrFp, BadDate);
|
||||
fprintf(ErrFp, "%s", BadDate);
|
||||
Usage();
|
||||
}
|
||||
CurYear = y;
|
||||
@@ -470,7 +635,7 @@ char *argv[];
|
||||
}
|
||||
/* Figure out the offset from UTC */
|
||||
if (CalculateUTC)
|
||||
(void) CalcMinsFromUTC(JulianToday, SystemTime(1)/60,
|
||||
(void) CalcMinsFromUTC(JulianToday, SystemTime(0)/60,
|
||||
&MinsFromUTC, NULL);
|
||||
}
|
||||
|
||||
@@ -482,14 +647,9 @@ char *argv[];
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifndef L_USAGE_OVERRIDE
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1998 by David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "Copyright 1999 by Roaring Penguin Software Inc.\n");
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2020 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
@@ -497,29 +657,31 @@ void Usage()
|
||||
fprintf(ErrFp, "Options:\n");
|
||||
fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
|
||||
fprintf(ErrFp, " -r Disable RUN directives\n");
|
||||
fprintf(ErrFp, " -c[n] Produce a calendar for n (default 1) months\n");
|
||||
fprintf(ErrFp, " -c+[n] Produce a calendar for n (default 1) weeks\n");
|
||||
fprintf(ErrFp, " -@[n,m] Colorize COLOR reminders\n");
|
||||
fprintf(ErrFp, " -c[a][n] Produce a calendar for n (default 1) months\n");
|
||||
fprintf(ErrFp, " -c[a]+[n] Produce a calendar for n (default 1) weeks\n");
|
||||
fprintf(ErrFp, " -w[n[,p[,s]]] Specify width, padding and spacing of calendar\n");
|
||||
fprintf(ErrFp, " -s[+][n] Produce `simple calendar' for n (1) months (weeks)\n");
|
||||
fprintf(ErrFp, " -p[n] Same as -s, but input compatible with rem2ps\n");
|
||||
fprintf(ErrFp, " -s[a][+][n] Produce `simple calendar' for n (1) months (weeks)\n");
|
||||
fprintf(ErrFp, " -p[a][n] Same as -s, but input compatible with rem2ps\n");
|
||||
fprintf(ErrFp, " -l Prefix each simple calendar line with line number and filename comment\n");
|
||||
fprintf(ErrFp, " -v Verbose mode\n");
|
||||
fprintf(ErrFp, " -o Ignore ONCE directives\n");
|
||||
fprintf(ErrFp, " -t Trigger all future reminders regardless of delta\n");
|
||||
fprintf(ErrFp, " -t[n] Trigger all future (or those within `n' days)\n");
|
||||
fprintf(ErrFp, " -h `Hush' mode - be very quiet\n");
|
||||
#ifdef HAVE_QUEUED
|
||||
fprintf(ErrFp, " -a Don't trigger timed reminders immediately - just queue them\n");
|
||||
fprintf(ErrFp, " -q Don't queue timed reminders\n");
|
||||
fprintf(ErrFp, " -f Trigger timed reminders by staying in foreground\n");
|
||||
fprintf(ErrFp, " -z[n] Enter daemon mode, waking every n (5) minutes.\n");
|
||||
#endif
|
||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||
fprintf(ErrFp, " -z[n] Enter daemon mode, waking every n (1) minutes.\n");
|
||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline f=tracefiles\n");
|
||||
fprintf(ErrFp, " -e Divert messages normally sent to stderr to stdout\n");
|
||||
fprintf(ErrFp, " -b[n] Time format for cal: 0=am/pm, 1=24hr, 2=none\n");
|
||||
fprintf(ErrFp, " -x[n] Iteration limit for SATISFY clause (def=150)\n");
|
||||
fprintf(ErrFp, " -kcmd Run `cmd' for MSG-type reminders\n");
|
||||
fprintf(ErrFp, " -g[ddd] Sort reminders by date, time and priority before issuing\n");
|
||||
fprintf(ErrFp, " -g[dddd] Sort reminders by date, time, priority, and 'timedness'\n");
|
||||
fprintf(ErrFp, " -ivar=val Initialize var to val and preserve var\n");
|
||||
fprintf(ErrFp, " -m Start calendar with Monday rather than Sunday\n");
|
||||
fprintf(ErrFp, " -y Synthesize tags for tagless reminders\n");
|
||||
fprintf(ErrFp, " -j[n] Run in 'purge' mode. [n = INCLUDE depth]\n");
|
||||
exit(1);
|
||||
}
|
||||
#endif /* L_USAGE_OVERRIDE */
|
||||
@@ -533,18 +695,15 @@ void Usage()
|
||||
/* USER environment variables. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#if defined(UNIX) && defined(WANT_U_OPTION)
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void ChgUser(char *user)
|
||||
#else
|
||||
static void ChgUser(user)
|
||||
char *user;
|
||||
#endif /* HAVE_PROTOS */
|
||||
static void ChgUser(char const *user)
|
||||
{
|
||||
uid_t myuid;
|
||||
|
||||
struct passwd *pwent;
|
||||
static char *home, *shell, *username, *logname;
|
||||
static char *home;
|
||||
static char *shell;
|
||||
static char *username;
|
||||
static char *logname;
|
||||
|
||||
myuid = getuid();
|
||||
|
||||
@@ -567,7 +726,7 @@ char *user;
|
||||
|
||||
home = malloc(strlen(pwent->pw_dir) + 6);
|
||||
if (!home) {
|
||||
fprintf(ErrFp, ErrMsg[M_NOMEM_ENV]);
|
||||
fprintf(ErrFp, "%s", ErrMsg[M_NOMEM_ENV]);
|
||||
exit(1);
|
||||
}
|
||||
sprintf(home, "HOME=%s", pwent->pw_dir);
|
||||
@@ -575,7 +734,7 @@ char *user;
|
||||
|
||||
shell = malloc(strlen(pwent->pw_shell) + 7);
|
||||
if (!shell) {
|
||||
fprintf(ErrFp, ErrMsg[M_NOMEM_ENV]);
|
||||
fprintf(ErrFp, "%s", ErrMsg[M_NOMEM_ENV]);
|
||||
exit(1);
|
||||
}
|
||||
sprintf(shell, "SHELL=%s", pwent->pw_shell);
|
||||
@@ -584,22 +743,34 @@ char *user;
|
||||
if (pwent->pw_uid) {
|
||||
username = malloc(strlen(pwent->pw_name) + 6);
|
||||
if (!username) {
|
||||
fprintf(ErrFp, ErrMsg[M_NOMEM_ENV]);
|
||||
fprintf(ErrFp, "%s", ErrMsg[M_NOMEM_ENV]);
|
||||
exit(1);
|
||||
}
|
||||
sprintf(username, "USER=%s", pwent->pw_name);
|
||||
putenv(username);
|
||||
logname= malloc(strlen(pwent->pw_name) + 9);
|
||||
if (!logname) {
|
||||
fprintf(ErrFp, ErrMsg[M_NOMEM_ENV]);
|
||||
fprintf(ErrFp, "%s", ErrMsg[M_NOMEM_ENV]);
|
||||
exit(1);
|
||||
}
|
||||
sprintf(logname, "LOGNAME=%s", pwent->pw_name);
|
||||
putenv(logname);
|
||||
}
|
||||
}
|
||||
#endif /* UNIX && WANT_U_OPTION */
|
||||
|
||||
|
||||
static void
|
||||
DefineFunction(char const *str)
|
||||
{
|
||||
Parser p;
|
||||
int r;
|
||||
|
||||
CreateParser(str, &p);
|
||||
r = DoFset(&p);
|
||||
DestroyParser(&p);
|
||||
if (r != OK) {
|
||||
fprintf(ErrFp, "-i option: %s: %s\n", str, ErrMsg[r]);
|
||||
}
|
||||
}
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* InitializeVar */
|
||||
@@ -607,27 +778,34 @@ char *user;
|
||||
/* Initialize and preserve a variable */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void InitializeVar(char *str)
|
||||
#else
|
||||
static void InitializeVar(str)
|
||||
char *str;
|
||||
#endif
|
||||
static void InitializeVar(char const *str)
|
||||
{
|
||||
char *varname, *expr;
|
||||
char const *expr;
|
||||
char const *ostr = str;
|
||||
char varname[VAR_NAME_LEN+1];
|
||||
|
||||
Value val;
|
||||
|
||||
int r;
|
||||
|
||||
/* Scan for an '=' sign */
|
||||
varname = str;
|
||||
while (*str && *str != '=') str++;
|
||||
r = 0;
|
||||
while (*str && *str != '=') {
|
||||
if (r < VAR_NAME_LEN) {
|
||||
varname[r++] = *str;
|
||||
}
|
||||
if (*str == '(') {
|
||||
/* Do a function definition if we see a paren */
|
||||
DefineFunction(ostr);
|
||||
return;
|
||||
}
|
||||
str++;
|
||||
}
|
||||
varname[r] = 0;
|
||||
if (!*str) {
|
||||
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_EQ]);
|
||||
return;
|
||||
}
|
||||
*str = 0;
|
||||
if (!*varname) {
|
||||
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_VAR]);
|
||||
return;
|
||||
@@ -638,7 +816,7 @@ char *str;
|
||||
return;
|
||||
}
|
||||
|
||||
r=EvalExpr(&expr, &val);
|
||||
r=EvalExpr(&expr, &val, NULL);
|
||||
if (r) {
|
||||
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
|
||||
return;
|
||||
@@ -660,3 +838,46 @@ char *str;
|
||||
return;
|
||||
}
|
||||
|
||||
#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
|
||||
|
||||
1045
src/json.c
Normal file
1045
src/json.c
Normal file
File diff suppressed because it is too large
Load Diff
280
src/json.h
Normal file
280
src/json.h
Normal file
@@ -0,0 +1,280 @@
|
||||
/* vim: set et ts=3 sw=3 sts=3 ft=c:
|
||||
*
|
||||
* Copyright (C) 2012, 2013, 2014 James McLaughlin et al. All rights reserved.
|
||||
* https://github.com/udp/json-parser
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _JSON_H
|
||||
#define _JSON_H
|
||||
|
||||
#ifndef json_char
|
||||
#define json_char char
|
||||
#endif
|
||||
|
||||
#ifndef json_int_t
|
||||
#ifndef _MSC_VER
|
||||
#include <inttypes.h>
|
||||
#define json_int_t int64_t
|
||||
#else
|
||||
#define json_int_t __int64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <string.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned long max_memory;
|
||||
int settings;
|
||||
|
||||
/* Custom allocator support (leave null to use malloc/free)
|
||||
*/
|
||||
|
||||
void * (* mem_alloc) (size_t, int zero, void * user_data);
|
||||
void (* mem_free) (void *, void * user_data);
|
||||
|
||||
void * user_data; /* will be passed to mem_alloc and mem_free */
|
||||
|
||||
size_t value_extra; /* how much extra space to allocate for values? */
|
||||
|
||||
} json_settings;
|
||||
|
||||
#define json_enable_comments 0x01
|
||||
|
||||
typedef enum
|
||||
{
|
||||
json_none,
|
||||
json_object,
|
||||
json_array,
|
||||
json_integer,
|
||||
json_double,
|
||||
json_string,
|
||||
json_boolean,
|
||||
json_null
|
||||
|
||||
} json_type;
|
||||
|
||||
extern const struct _json_value json_value_none;
|
||||
|
||||
typedef struct _json_object_entry
|
||||
{
|
||||
json_char * name;
|
||||
unsigned int name_length;
|
||||
|
||||
struct _json_value * value;
|
||||
|
||||
} json_object_entry;
|
||||
|
||||
typedef struct _json_value
|
||||
{
|
||||
struct _json_value * parent;
|
||||
|
||||
json_type type;
|
||||
|
||||
union
|
||||
{
|
||||
int boolean;
|
||||
json_int_t integer;
|
||||
double dbl;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned int length;
|
||||
json_char * ptr; /* null terminated */
|
||||
|
||||
} string;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned int length;
|
||||
|
||||
json_object_entry * values;
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 201103L
|
||||
decltype(values) begin () const
|
||||
{ return values;
|
||||
}
|
||||
decltype(values) end () const
|
||||
{ return values + length;
|
||||
}
|
||||
#endif
|
||||
|
||||
} object;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned int length;
|
||||
struct _json_value ** values;
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 201103L
|
||||
decltype(values) begin () const
|
||||
{ return values;
|
||||
}
|
||||
decltype(values) end () const
|
||||
{ return values + length;
|
||||
}
|
||||
#endif
|
||||
|
||||
} array;
|
||||
|
||||
} u;
|
||||
|
||||
union
|
||||
{
|
||||
struct _json_value * next_alloc;
|
||||
void * object_mem;
|
||||
|
||||
} _reserved;
|
||||
|
||||
#ifdef JSON_TRACK_SOURCE
|
||||
|
||||
/* Location of the value in the source JSON
|
||||
*/
|
||||
unsigned int line, col;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Some C++ operator sugar */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
public:
|
||||
|
||||
inline _json_value ()
|
||||
{ memset (this, 0, sizeof (_json_value));
|
||||
}
|
||||
|
||||
inline const struct _json_value &operator [] (int index) const
|
||||
{
|
||||
if (type != json_array || index < 0
|
||||
|| ((unsigned int) index) >= u.array.length)
|
||||
{
|
||||
return json_value_none;
|
||||
}
|
||||
|
||||
return *u.array.values [index];
|
||||
}
|
||||
|
||||
inline const struct _json_value &operator [] (const char * index) const
|
||||
{
|
||||
if (type != json_object)
|
||||
return json_value_none;
|
||||
|
||||
for (unsigned int i = 0; i < u.object.length; ++ i)
|
||||
if (!strcmp (u.object.values [i].name, index))
|
||||
return *u.object.values [i].value;
|
||||
|
||||
return json_value_none;
|
||||
}
|
||||
|
||||
inline operator const char * () const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case json_string:
|
||||
return u.string.ptr;
|
||||
|
||||
default:
|
||||
return "";
|
||||
};
|
||||
}
|
||||
|
||||
inline operator json_int_t () const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case json_integer:
|
||||
return u.integer;
|
||||
|
||||
case json_double:
|
||||
return (json_int_t) u.dbl;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
inline operator bool () const
|
||||
{
|
||||
if (type != json_boolean)
|
||||
return false;
|
||||
|
||||
return u.boolean != 0;
|
||||
}
|
||||
|
||||
inline operator double () const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case json_integer:
|
||||
return (double) u.integer;
|
||||
|
||||
case json_double:
|
||||
return u.dbl;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} json_value;
|
||||
|
||||
json_value * json_parse (const json_char * json,
|
||||
size_t length);
|
||||
|
||||
#define json_error_max 128
|
||||
json_value * json_parse_ex (json_settings * settings,
|
||||
const json_char * json,
|
||||
size_t length,
|
||||
char * error);
|
||||
|
||||
void json_value_free (json_value *);
|
||||
|
||||
|
||||
/* Not usually necessary, unless you used a custom mem_alloc and now want to
|
||||
* use a custom mem_free.
|
||||
*/
|
||||
void json_value_free_ex (json_settings * settings,
|
||||
json_value *);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
12
src/lang.h
12
src/lang.h
@@ -5,16 +5,13 @@
|
||||
/* Header file for language support for various languages. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: lang.h,v 1.4 1999-04-05 17:34:51 dfs Exp $ */
|
||||
|
||||
/* I'm chauvinistic and name each language with its English name... */
|
||||
|
||||
#define ENGLISH 0 /* original by David F. Skoll */
|
||||
#define ENGLISH 0 /* original by Dianne Skoll */
|
||||
#define GERMAN 1 /* translated by Wolfgang Thronicke */
|
||||
#define DUTCH 2 /* translated by Willem Kasdorp and Erik-Jan Vens */
|
||||
#define FINNISH 3 /* translated by Mikko Silvonen */
|
||||
@@ -26,8 +23,9 @@
|
||||
#define ITALIAN 9 /* translated by Valerio Aimale */
|
||||
#define ROMANIAN 10 /* translated by Liviu Daia */
|
||||
#define SPANISH 11 /* translated by Rafa Couto */
|
||||
#define ICELANDIC 12 /* translated by Björn Davíðsson */
|
||||
|
||||
/* Add more languages here - but please e-mail aa775@freenet.carleton.ca
|
||||
/* Add more languages here - but please e-mail dianne@skoll.ca
|
||||
to have your favorite language assigned a number. If you add a
|
||||
language, please send me the header file, and permission to include
|
||||
it in future releases of Remind. Note that you'll get no remuneration
|
||||
@@ -69,6 +67,8 @@
|
||||
#include "langs/romanian.h"
|
||||
#elif LANG == SPANISH
|
||||
#include "langs/spanish.h"
|
||||
#elif LANG == ICELANDIC
|
||||
#include "langs/icelandic.h"
|
||||
|
||||
/* If no sensible language, choose English. I intended to use
|
||||
the #error directive here, but some C compilers barf. */
|
||||
|
||||
@@ -6,14 +6,11 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* REMIND is Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* This file is Copyright (C) 1993 by Mogens Lynnerup. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: danish.h,v 1.6 1999-04-05 17:35:05 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Danish"
|
||||
|
||||
@@ -102,12 +99,12 @@
|
||||
|
||||
#define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<5) ? " om natten" : " om formiddagen" : (hour > 17) ? " om aftenen" : " om eftermiddagen";
|
||||
#define L_ORDINAL_OVERRIDE plu = ".";
|
||||
#define L_A_OVER sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y);
|
||||
#define L_E_OVER sprintf(s, "den %02d%c%02d%c%04d", d, DATESEP, m+1, DATESEP, y);
|
||||
#define L_F_OVER sprintf(s, "den %02d%c%02d%c%04d", m+1, DATESEP, d, DATESEP, y);
|
||||
#define L_G_OVER sprintf(s, "%s %s, den %d. %s", L_ON, DayName[jul%7], d, MonthName[m]);
|
||||
#define L_H_OVER sprintf(s, "den %02d%c%02d", d, DATESEP, m+1);
|
||||
#define L_I_OVER sprintf(s, "den %02d%c%02d", m+1, DATESEP, d);
|
||||
#define L_A_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s %d", DayName[jul%7], d, MonthName[m], y); } else { sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y); }
|
||||
#define L_E_OVER sprintf(s, "den %02d%c%02d%c%04d", d, DateSep, m+1, DateSep, y);
|
||||
#define L_F_OVER sprintf(s, "den %02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
|
||||
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s", DayName[jul%7], d, MonthName[m]); } else { sprintf(s, "%s %s, den %d. %s", L_ON, DayName[jul%7], d, MonthName[m]); }
|
||||
#define L_H_OVER sprintf(s, "den %02d%c%02d", d, DateSep, m+1);
|
||||
#define L_I_OVER sprintf(s, "den %02d%c%02d", m+1, DateSep, d);
|
||||
#define L_U_OVER L_A_OVER
|
||||
#define L_V_OVER L_G_OVER
|
||||
|
||||
|
||||
@@ -6,18 +6,15 @@
|
||||
/* */
|
||||
/* Author: Willem Kasdorp */
|
||||
/* */
|
||||
/* Modified slightly by David Skoll */
|
||||
/* Modified slightly by Dianne Skoll */
|
||||
/* */
|
||||
/* Further corrections by Erik-Jan Vens */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: dutch.h,v 1.4 1999-04-05 17:35:06 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Dutch"
|
||||
|
||||
|
||||
@@ -5,13 +5,10 @@
|
||||
/* Support for the English language. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: english.h,v 1.4 1999-04-05 17:35:06 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "English"
|
||||
|
||||
|
||||
@@ -11,13 +11,10 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* This file is Copyright (C) 1993-1998 by Mikko Silvonen. */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* REMIND is Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: finnish.h,v 1.8 1999-04-12 19:45:41 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Finnish"
|
||||
|
||||
@@ -163,26 +160,19 @@
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
#define L_A_OVER sprintf(s, "%s%s %d. %s%s %d", DayName[jul%7], L_ON, d, \
|
||||
MonthName[m], L_PARTIT, y);
|
||||
#define L_C_OVER 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_F_OVER sprintf(s, "%02d%c%02d%c%04d", m+1, DATESEP, d, DATESEP, y);
|
||||
#define L_G_OVER sprintf(s, "%s%s %d. %s%s", DayName[jul%7], L_ON, d, \
|
||||
MonthName[m], L_PARTIT);
|
||||
#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_J_OVER sprintf(s, "%s%s %sn %d%s %d", DayName[jul%7], L_ON, \
|
||||
MonthName[m], d, plu, y);
|
||||
#define L_K_OVER sprintf(s, "%s%s %sn %d%s", DayName[jul%7], L_ON, \
|
||||
MonthName[m], d, plu);
|
||||
#define L_L_OVER sprintf(s, "%04d%c%02d%c%02d", y, DATESEP, m+1, DATESEP, d);
|
||||
#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_E_OVER sprintf(s, "%02d%c%02d%c%04d", d, DateSep, m+1, DateSep, y);
|
||||
#define L_F_OVER sprintf(s, "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, 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%s", DayName[jul%7], L_ON, d, MonthName[m], L_PARTIT); }
|
||||
#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_J_OVER if (altmode == '*') { sprintf(s, "%s %sn %d%s %d", DayName[jul%7], MonthName[m], d, plu, y); } else { sprintf(s, "%s%s %sn %d%s %d", DayName[jul%7], L_ON, MonthName[m], d, plu, y); }
|
||||
#define L_K_OVER if (altmode == '*') { sprintf(s, "%s %sn %d%s", DayName[jul%7], MonthName[m], d, plu); } else { sprintf(s, "%s%s %sn %d%s", DayName[jul%7], L_ON, MonthName[m], d, plu); }
|
||||
#define L_L_OVER sprintf(s, "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
|
||||
#define L_Q_OVER sprintf(s, "n");
|
||||
#define L_U_OVER sprintf(s, "%s%s %d%s %s%s %d", DayName[jul%7], L_ON, \
|
||||
d, plu, MonthName[m], L_PARTIT, y);
|
||||
#define L_V_OVER sprintf(s, "%s%s %d%s %s%s", DayName[jul%7], L_ON, d, \
|
||||
plu, MonthName[m], L_PARTIT);
|
||||
#define L_U_OVER if (altmode == '*') { sprintf(s, "%s %d%s %s %d", DayName[jul%7], d, plu, MonthName[m], y); } else { sprintf(s, "%s%s %d%s %s%s %d", DayName[jul%7], L_ON, d, plu, MonthName[m], L_PARTIT, y); }
|
||||
#define L_V_OVER if (altmode == '*') { sprintf(s, "%s %d%s %s", DayName[jul%7], d, plu, MonthName[m]); } else { sprintf(s, "%s%s %d%s %s%s", DayName[jul%7], L_ON, d, plu, MonthName[m], L_PARTIT); }
|
||||
#define L_1_OVER \
|
||||
if (tdiff == 0) \
|
||||
sprintf(s, "%s", L_NOW); \
|
||||
@@ -282,9 +272,9 @@ EXTERN char *ErrMsg[] =
|
||||
"Peruutusarvo annettu kahdesti",
|
||||
"ONCE-avainsanaa k\xE4ytetty kahdesti. (Hah.)",
|
||||
"AT-sanan per\xE4st\xE4 puuttuu aika",
|
||||
"UNTIL-sanaa k\xE4ytetty kahdesti",
|
||||
"THROUGH/UNTIL-sanaa k\xE4ytetty kahdesti",
|
||||
"Ep\xE4t\xE4ydellinen p\xE4iv\xE4ys",
|
||||
"SCANFROM-sanaa k\xE4ytetty kahdesti",
|
||||
"FROM/SCANFROM-sanaa k\xE4ytetty kahdesti",
|
||||
"Muuttuja",
|
||||
"Arvo",
|
||||
"*M\xC4\xC4RITTELEM\xC4T\xD6N*",
|
||||
@@ -308,7 +298,12 @@ EXTERN char *ErrMsg[] =
|
||||
"Ei viestej\xE4.",
|
||||
"%d viesti(\xE4) t\xE4m\xE4n p\xE4iv\xE4n jonossa.\n",
|
||||
"Numero puuttuu",
|
||||
"Virheellinen funktio WARN-lausekkeessa"
|
||||
"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"
|
||||
|
||||
#elif IBMEXTENDED
|
||||
"Ok",
|
||||
@@ -383,9 +378,9 @@ EXTERN char *ErrMsg[] =
|
||||
"Peruutusarvo annettu kahdesti",
|
||||
"ONCE-avainsanaa k\x84ytetty kahdesti. (Hah.)",
|
||||
"AT-sanan per\x84st\x84 puuttuu aika",
|
||||
"UNTIL-sanaa k\x84ytetty kahdesti",
|
||||
"THROUGH/UNTIL-sanaa k\x84ytetty kahdesti",
|
||||
"Ep\x84t\x84ydellinen p\x84iv\x84ys",
|
||||
"SCANFROM-sanaa k\x84ytetty kahdesti",
|
||||
"FROM/SCANFROM-sanaa k\x84ytetty kahdesti",
|
||||
"Muuttuja",
|
||||
"Arvo",
|
||||
"*M\x8E\x8ERITTELEM\x8ET\x99N*",
|
||||
@@ -409,7 +404,13 @@ EXTERN char *ErrMsg[] =
|
||||
"Ei viestej\x84.",
|
||||
"%d viesti(\x84) t\x84m\x84n p\x84iv\x84n jonossa.\n",
|
||||
"Numero puuttuu"
|
||||
"Virheellinen funktio WARN-lausekkeessa"
|
||||
"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 ']'",
|
||||
@@ -483,9 +484,9 @@ EXTERN char *ErrMsg[] =
|
||||
"Peruutusarvo annettu kahdesti",
|
||||
"ONCE-avainsanaa k{ytetty kahdesti. (Hah.)",
|
||||
"AT-sanan per{st{ puuttuu aika",
|
||||
"UNTIL-sanaa k{ytetty kahdesti",
|
||||
"THROUGH/UNTIL-sanaa k{ytetty kahdesti",
|
||||
"Ep{t{ydellinen p{iv{ys",
|
||||
"SCANFROM-sanaa k{ytetty kahdesti",
|
||||
"FROM/SCANFROM-sanaa k{ytetty kahdesti",
|
||||
"Muuttuja",
|
||||
"Arvo",
|
||||
"*M[[RITTELEM[T\\N*",
|
||||
@@ -509,7 +510,14 @@ EXTERN char *ErrMsg[] =
|
||||
"Ei viestej{.",
|
||||
"%d viesti({) t{m{n p{iv{n jonossa.\n",
|
||||
"Numero puuttuu",
|
||||
"Virheellinen funktio WARN-lausekkeessa"
|
||||
"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 */
|
||||
@@ -517,14 +525,9 @@ EXTERN char *ErrMsg[] =
|
||||
/* The following is only used in init.c */
|
||||
#ifdef L_IN_INIT
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1998 by David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "Copyright 1999 by Roaring Penguin Software Inc.\n");
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2020 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETAVERSIO <<<<\n");
|
||||
#endif
|
||||
|
||||
@@ -8,15 +8,12 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* REMIND is Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* This file is Copyright (C) 1993 by Laurent Duperval and */
|
||||
/* David F. Skoll. */
|
||||
/* Dianne Skoll. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: french.h,v 1.7 1999-04-12 19:45:42 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "French"
|
||||
|
||||
@@ -131,13 +128,9 @@ else if (tdiff < 0) { \
|
||||
sprintf(s, "dans %d heure%s et %d minute%s", hdiff, hplu, mdiff, mplu); \
|
||||
}
|
||||
|
||||
#define L_J_OVER \
|
||||
sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], \
|
||||
d, plu, MonthName[m], y);
|
||||
#define L_J_OVER if (altmode == '*') { sprintf(s, "%s, %d%s %s, %d", DayName[jul%7], d, plu, MonthName[m], y); } else { sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], d, plu, MonthName[m], y); }
|
||||
|
||||
#define L_K_OVER \
|
||||
sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], \
|
||||
d, plu, MonthName[m]);
|
||||
#define L_K_OVER if (altmode == '*') { sprintf(s, "%s, %d%s %s", DayName[jul%7], d, plu, MonthName[m]); } else { sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu, MonthName[m]); }
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
|
||||
@@ -219,9 +212,9 @@ EXTERN char *ErrMsg[] =
|
||||
"Valeur de retour sp\351cifi\351e deux fois",
|
||||
"Mot-cl\351 ONCE utilis\351 deux fois. (Hah.)",
|
||||
"Heure attendue apr\350s AT",
|
||||
"Mot-cl\351 UNTIL utilis\351 deux fois",
|
||||
"Mot-cl\351 THROUGH/UNTIL utilis\351 deux fois",
|
||||
"Sp\351cification de date incompl\350te",
|
||||
"Mot-cl\351 SCANFROM utilis\351 deux fois",
|
||||
"Mot-cl\351 FROM/SCANFROM utilis\351 deux fois",
|
||||
"Variable",
|
||||
"Valeur",
|
||||
"*NON-DEFINI*",
|
||||
@@ -245,7 +238,13 @@ EXTERN char *ErrMsg[] =
|
||||
"Pas de rappels.",
|
||||
"%d rappel(s) en file pour aujourd'hui.\n",
|
||||
"Nombre attendu",
|
||||
"Fonction ill\351gale apr\350s WARN"
|
||||
"Fonction ill\351gale apr\350s WARN",
|
||||
"Can't convert between time zones",
|
||||
"No files matching *.rem",
|
||||
"String too long",
|
||||
"Time specified twice",
|
||||
"Cannot specify DURATION without specifying AT"
|
||||
|
||||
#else /* ISOLATIN1 */
|
||||
"Ok",
|
||||
"']' manquant",
|
||||
@@ -319,9 +318,9 @@ EXTERN char *ErrMsg[] =
|
||||
"Valeur de retour specifiee deux fois",
|
||||
"Mot-cle ONCE utilise deux fois. (Hah.)",
|
||||
"Heure attendue apres AT",
|
||||
"Mot-cle UNTIL utilise deux fois",
|
||||
"Mot-cle THROUGH/UNTIL utilise deux fois",
|
||||
"Specification de date incomplete",
|
||||
"Mot-cle SCANFROM utilise deux fois",
|
||||
"Mot-cle FROM/SCANFROM utilise deux fois",
|
||||
"Variable",
|
||||
"Valeur",
|
||||
"*NON-DEFINI*",
|
||||
@@ -345,7 +344,12 @@ EXTERN char *ErrMsg[] =
|
||||
"Pas de rappels.",
|
||||
"%d rappel(s) en file pour aujourd'hui.\n",
|
||||
"Nombre attendu",
|
||||
"Fonction illegale apres WARN"
|
||||
"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 */
|
||||
@@ -353,14 +357,9 @@ EXTERN char *ErrMsg[] =
|
||||
/* The following is only used in init.c */
|
||||
#ifdef L_IN_INIT
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1998 by David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "Copyright 1999 by Roaring Penguin Software Inc.\n");
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2020 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
|
||||
@@ -9,13 +9,10 @@
|
||||
/* I don't speak German. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: german.h,v 1.5 1999-04-05 17:35:08 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "German"
|
||||
|
||||
@@ -95,8 +92,8 @@
|
||||
See the file dosubst.c for more info. */
|
||||
#define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<5) ? " nachts" : " vormittags" : (hour > 17) ? " abends" : " nachmittags";
|
||||
#define L_ORDINAL_OVERRIDE plu = ".";
|
||||
#define L_A_OVER sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y);
|
||||
#define L_G_OVER sprintf(s, "%s %s, den %d. %s", L_ON, DayName[jul%7], d, MonthName[m]);
|
||||
#define L_A_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s %d", DayName[jul%7], d, MonthName[m], y); } else { sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y); }
|
||||
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s", DayName[jul%7], d, MonthName[m]); } else { sprintf(s, "%s %s, den %d. %s", L_ON, DayName[jul%7], d, MonthName[m]); }
|
||||
#define L_U_OVER L_A_OVER
|
||||
#define L_V_OVER L_G_OVER
|
||||
|
||||
|
||||
83
src/langs/icelandic.h
Normal file
83
src/langs/icelandic.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* ICELANDIC.H */
|
||||
/* */
|
||||
/* Support for the Icelandic language. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* Translated by Björn Davíðsson (bjossi@snerpa.is) */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Icelandic"
|
||||
|
||||
/* Day names */
|
||||
#define L_SUNDAY "sunnudagur"
|
||||
#define L_MONDAY "mánudagur"
|
||||
#define L_TUESDAY "þriðjudagur"
|
||||
#define L_WEDNESDAY "miðvikudagur"
|
||||
#define L_THURSDAY "fimmtudagur"
|
||||
#define L_FRIDAY "föstudagur"
|
||||
#define L_SATURDAY "laugardagur"
|
||||
|
||||
/* Month names */
|
||||
#define L_JAN "janúar"
|
||||
#define L_FEB "febrúar"
|
||||
#define L_MAR "mars"
|
||||
#define L_APR "apríl"
|
||||
#define L_MAY "maí"
|
||||
#define L_JUN "júní"
|
||||
#define L_JUL "júlí"
|
||||
#define L_AUG "ágúst"
|
||||
#define L_SEP "september"
|
||||
#define L_OCT "október"
|
||||
#define L_NOV "nóvember"
|
||||
#define L_DEC "desember"
|
||||
|
||||
/* Today and tomorrow */
|
||||
#define L_TODAY "í dag"
|
||||
#define L_TOMORROW "á morgun"
|
||||
|
||||
/* The default banner */
|
||||
#define L_BANNER "Minnisatriði: %w, %d%s %m, %y%o:"
|
||||
|
||||
/* "am" and "pm" */
|
||||
#define L_AM "fh"
|
||||
#define L_PM "eh"
|
||||
|
||||
/*** The following are only used in dosubst.c ***/
|
||||
#ifdef L_IN_DOSUBST
|
||||
|
||||
/* Ago and from now */
|
||||
#define L_AGO "síðan"
|
||||
#define L_FROMNOW "frá því nú"
|
||||
|
||||
/* "in %d days' time" */
|
||||
#define L_INXDAYS "eftir %d daga"
|
||||
|
||||
/* "on" as in "on date..." */
|
||||
#define L_ON "þann"
|
||||
|
||||
/* Pluralizing - this is a problem for many languages and may require
|
||||
a more drastic fix */
|
||||
#define L_PLURAL "a"
|
||||
|
||||
/* Minutes, hours, at, etc */
|
||||
#define L_NOW "núna"
|
||||
#define L_AT "kl."
|
||||
#define L_MINUTE "mínútu"
|
||||
#define L_HOUR "klukkustund"
|
||||
#define L_IS "er"
|
||||
#define L_WAS "var"
|
||||
#define L_AND "og"
|
||||
/* What to add to make "hour" plural */
|
||||
#define L_HPLU "ir"
|
||||
/* What to add to make "minute" plural */
|
||||
#define L_MPLU "r"
|
||||
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
|
||||
#endif /* L_IN_DOSUBST */
|
||||
@@ -7,13 +7,10 @@
|
||||
/* This file is part of REMIND. */
|
||||
/* It is Copyright (C) 1996 by Valerio Aimale */
|
||||
/* */
|
||||
/* Remind is copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* Remind is copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: italian.h,v 1.5 1999-04-05 17:35:09 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Italian"
|
||||
|
||||
@@ -108,23 +105,23 @@
|
||||
MonthName[m], y);
|
||||
#define L_C_OVER sprintf(s, "%s", DayName[jul%7]);
|
||||
|
||||
#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);
|
||||
|
||||
#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_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, \
|
||||
MonthName[m], y);
|
||||
|
||||
#define L_K_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
|
||||
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, \
|
||||
MonthName[m], y);
|
||||
|
||||
@@ -6,13 +6,10 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* This file is Copyright (C) 1993 by Trygve Randen. */
|
||||
/* Remind is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* Remind is Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: norwgian.h,v 1.5 1999-04-05 17:35:09 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Norwegian"
|
||||
|
||||
@@ -103,8 +100,8 @@
|
||||
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
|
||||
See the file dosubst.c for more info. */
|
||||
#define L_ORDINAL_OVERRIDE plu = ".";
|
||||
#define L_A_OVER sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y);
|
||||
#define L_G_OVER sprintf(s, "%s %s, den %d. %s", L_ON, DayName[jul%7], d, MonthName[m]);
|
||||
#define L_A_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s %d", DayName[jul%7], d, MonthName[m], y); } else { sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y); }
|
||||
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s", DayName[jul%7], d, MonthName[m]); } else { sprintf(s, "%s %s, den %d. %s", L_ON, DayName[jul%7], d, MonthName[m]); }
|
||||
#define L_U_OVER L_A_OVER
|
||||
#define L_V_OVER L_G_OVER
|
||||
|
||||
|
||||
@@ -9,13 +9,10 @@
|
||||
/* Polish. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: polish.h,v 1.7 1999-04-12 19:45:43 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Polish"
|
||||
|
||||
@@ -143,8 +140,8 @@ ampm = (hour<12) ? \
|
||||
: " w nocy";
|
||||
#endif
|
||||
#define L_ORDINAL_OVERRIDE plu = "";
|
||||
#define L_A_OVER sprintf(s, "%s %s, %d. %s %d", L_ON, DayName[jul%7], d, MonthName[m], y);
|
||||
#define L_G_OVER sprintf(s, "%s %s, %d. %s", L_ON, DayName[jul%7], d, MonthName[m]);
|
||||
#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_U_OVER L_A_OVER
|
||||
#define L_V_OVER L_G_OVER
|
||||
|
||||
@@ -254,9 +251,9 @@ EXTERN char *ErrMsg[] =
|
||||
"Warto\266\346 cofni\352cia podana dw\363krotnie",
|
||||
"S\263owo ONCE u\277yte dw\363krotnie.",
|
||||
"Po AT oczekiwany jest czas",
|
||||
"S\263owo UNTIL u\277yte dw\363krotnie",
|
||||
"S\263owo THROUGH/UNTIL u\277yte dw\363krotnie",
|
||||
"Niekompletna specyfikacja daty",
|
||||
"S\263owo SCANFROM u\277yte dw\363krotnie",
|
||||
"S\263owo FROM/SCANFROM u\277yte dw\363krotnie",
|
||||
"Zmienna",
|
||||
"Warto\266\346",
|
||||
"*NIE ZDEFINIOWANE*",
|
||||
@@ -280,7 +277,12 @@ EXTERN char *ErrMsg[] =
|
||||
"Brak przypomnie\361.",
|
||||
"%d Przypomnienia zakolejkowane na p\363\274niej.\n",
|
||||
"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",
|
||||
"No files matching *.rem",
|
||||
"String too long",
|
||||
"Time specified twice",
|
||||
"Cannot specify DURATION without specifying AT"
|
||||
#else /* ISOLATIN1 */
|
||||
"OK",
|
||||
"Brakujacy ']'",
|
||||
@@ -354,9 +356,9 @@ EXTERN char *ErrMsg[] =
|
||||
"Wartosc cofniecia podana dwokrotnie",
|
||||
"Slowo ONCE uzyte dwokrotnie.",
|
||||
"Po AT oczekiwany jest czas",
|
||||
"Slowo UNTIL uzyte dwokrotnie",
|
||||
"Slowo THROUGH/UNTIL uzyte dwokrotnie",
|
||||
"Niekompletna specyfikacja daty",
|
||||
"Slowo SCANFROM uzyte dwokrotnie",
|
||||
"Slowo FROM/SCANFROM uzyte dwokrotnie",
|
||||
"Zmienna",
|
||||
"Wartosc",
|
||||
"*UNDEFINED*",
|
||||
@@ -380,7 +382,12 @@ EXTERN char *ErrMsg[] =
|
||||
"Brak przypomnien.",
|
||||
"%d Przypomnienia zakolejkowane na pozniej.\n",
|
||||
"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",
|
||||
"No files matching *.rem",
|
||||
"String too long",
|
||||
"Time specified twice",
|
||||
"Cannot specify DURATION without specifying AT"
|
||||
#endif /* ISOLATIN1 */
|
||||
};
|
||||
#endif /* MK_GLOBALS */
|
||||
@@ -388,14 +395,9 @@ EXTERN char *ErrMsg[] =
|
||||
/* The following is only used in init.c */
|
||||
#ifdef L_IN_INIT
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-1998 by David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "Copyright 1999 by Roaring Penguin Software Inc.\n");
|
||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2020 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||
#endif
|
||||
|
||||
@@ -8,15 +8,12 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* REMIND is Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* This file is Copyright (C) 1996 by Marco Paganini and */
|
||||
/* David F. Skoll. */
|
||||
/* Dianne Skoll. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: portbr.h,v 1.6 1999-04-12 19:45:43 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Brazilian Portuguese"
|
||||
|
||||
@@ -220,9 +217,9 @@ EXTERN char *ErrMsg[] =
|
||||
"Valor de Back especificado duas vezes",
|
||||
"ONCE usado duas vezes (Eheheh)",
|
||||
"Esperando hora apos AT",
|
||||
"Keyword UNTIL usada duas vezes",
|
||||
"Keyword THROUGH/UNTIL usada duas vezes",
|
||||
"Especificacao de data incompleta",
|
||||
"Keyword SCANFROM usada duas vezes",
|
||||
"Keyword FROM/SCANFROM usada duas vezes",
|
||||
"Variavel",
|
||||
"Valor",
|
||||
"*INDEFINIDO*",
|
||||
@@ -246,21 +243,21 @@ EXTERN char *ErrMsg[] =
|
||||
"Sem compromissos.",
|
||||
"%d compromisso(s) colocados na fila para mais tarde.\n",
|
||||
"Esperando numero",
|
||||
"Funcao ilegal na clausula WARN"
|
||||
"Funcao ilegal na clausula WARN",
|
||||
"Can't convert between time zones",
|
||||
"No files matching *.rem",
|
||||
"String too long",
|
||||
"Time specified twice",
|
||||
"Cannot specify DURATION without specifying AT"
|
||||
};
|
||||
#endif /* MK_GLOBALS */
|
||||
|
||||
/* The following is only used in init.c */
|
||||
#ifdef L_IN_INIT
|
||||
#define L_USAGE_OVERRIDE 1
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void Usage(void)
|
||||
#else
|
||||
void Usage()
|
||||
#endif /* HAVE_PROTOS */
|
||||
void Usage(void)
|
||||
{
|
||||
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-1998 by David F. Skoll\n", VERSION, L_LANGNAME);
|
||||
fprintf(ErrFp, "(C) 1999 by Roaring Penguin Software Inc.\n");
|
||||
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-2020 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||
#ifdef BETA
|
||||
fprintf(ErrFp, ">>>> VERSAO BETA <<<<\n");
|
||||
#endif
|
||||
|
||||
@@ -8,14 +8,11 @@
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* REMIND is Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* This file is Copyright (C) 1996-1998 by Liviu Daia */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: romanian.h,v 1.5 1999-04-05 17:35:10 dfs Exp $ */
|
||||
|
||||
/* The very first define in a language support file must be L_LANGNAME: */
|
||||
#define L_LANGNAME "Romanian"
|
||||
|
||||
|
||||
@@ -7,13 +7,10 @@
|
||||
/* Author: Rafa Couto <rafacouto@biogate.com> */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: spanish.h,v 1.2 1999-04-05 17:35:11 dfs Exp $ */
|
||||
|
||||
#define L_LANGNAME "Spanish"
|
||||
|
||||
/* Nombres de los di'as de la semana */
|
||||
@@ -44,7 +41,7 @@
|
||||
#define L_JUL "Julio"
|
||||
#define L_AUG "Agosto"
|
||||
#define L_SEP "Septiembre"
|
||||
#define L_OCT "Octuber"
|
||||
#define L_OCT "Octubre"
|
||||
#define L_NOV "Noviembre"
|
||||
#define L_DEC "Diciembre"
|
||||
|
||||
|
||||
20
src/lnk.bcc
20
src/lnk.bcc
@@ -1,20 +0,0 @@
|
||||
calendar.obj
|
||||
dorem.obj
|
||||
dosubst.obj
|
||||
expr.obj
|
||||
files.obj
|
||||
funcs.obj
|
||||
globals.obj
|
||||
hbcal.obj
|
||||
init.obj
|
||||
main.obj
|
||||
moon.obj
|
||||
omit.obj
|
||||
os2func.obj
|
||||
queue.obj
|
||||
sort.obj
|
||||
token.obj
|
||||
trigger.obj
|
||||
userfns.obj
|
||||
utils.obj
|
||||
var.obj
|
||||
23
src/lnk.msc
23
src/lnk.msc
@@ -1,23 +0,0 @@
|
||||
calendar.obj +
|
||||
dorem.obj +
|
||||
dosubst.obj +
|
||||
expr.obj +
|
||||
files.obj +
|
||||
funcs.obj +
|
||||
globals.obj +
|
||||
hbcal.obj +
|
||||
init.obj +
|
||||
main.obj +
|
||||
moon.obj +
|
||||
omit.obj +
|
||||
sort.obj +
|
||||
token.obj +
|
||||
trigger.obj +
|
||||
userfns.obj +
|
||||
utils.obj +
|
||||
var.obj
|
||||
remind.exe
|
||||
nul
|
||||
|
||||
|
||||
|
||||
19
src/lnk.tc
19
src/lnk.tc
@@ -1,19 +0,0 @@
|
||||
-eremind.exe
|
||||
calendar.obj
|
||||
dorem.obj
|
||||
dosubst.obj
|
||||
expr.obj
|
||||
files.obj
|
||||
funcs.obj
|
||||
globals.obj
|
||||
hbcal.obj
|
||||
init.obj
|
||||
main.obj
|
||||
moon.obj
|
||||
omit.obj
|
||||
sort.obj
|
||||
token.obj
|
||||
trigger.obj
|
||||
userfns.obj
|
||||
utils.obj
|
||||
var.obj
|
||||
755
src/main.c
755
src/main.c
File diff suppressed because it is too large
Load Diff
@@ -1,97 +0,0 @@
|
||||
# Makefile for REMIND for Borland C++
|
||||
# $Id: makefile.bcc,v 1.2 1998-03-01 20:43:56 dfs Exp $
|
||||
|
||||
VERSION= 03.00.19
|
||||
|
||||
MODEL=l
|
||||
|
||||
!if $d(__OS2__)
|
||||
CFLAGS= -DOS2_POPUP -w-pia -O2
|
||||
BINDIR= ..\OS2-EX
|
||||
DELFLAG= /f
|
||||
!else
|
||||
CFLAGS= -w-pia -O2 -m$(MODEL)
|
||||
BINDIR= ..\MSDOS-EX
|
||||
DELFLAG=
|
||||
!endif
|
||||
|
||||
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
|
||||
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \
|
||||
danish.h polish.h
|
||||
|
||||
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
|
||||
|
||||
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h danish.h \
|
||||
polish.h
|
||||
|
||||
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
|
||||
main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c \
|
||||
queue.c moon.c os2func.c
|
||||
|
||||
OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
|
||||
globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
|
||||
utils.obj userfns.obj var.obj hbcal.obj queue.obj moon.obj os2func.obj
|
||||
|
||||
all: exes test-rem.cmd test-rem.bat
|
||||
test-rem
|
||||
|
||||
clean:
|
||||
-del $(DELFLAG) *.obj
|
||||
-del $(DELFLAG) $(BINDIR)\*.exe
|
||||
|
||||
exes: $(BINDIR)\remind.exe $(BINDIR)\rem2ps.exe
|
||||
|
||||
..\os2-ex\remind.exe: $(OBJS)
|
||||
bcc -e..\os2-ex\remind @lnk.bcc -lap;Toe
|
||||
|
||||
..\msdos-ex\remind.exe: $(OBJS)
|
||||
bcc -e..\msdos-ex\remind -m$(MODEL) @lnk.bcc
|
||||
|
||||
..\os2-ex\rem2ps.exe: rem2ps.obj
|
||||
bcc -e..\os2-ex\rem2ps rem2ps.obj -lap;Toe
|
||||
|
||||
..\msdos-ex\rem2ps.exe: rem2ps.obj
|
||||
bcc -e..\msdos-ex\rem2ps -m$(MODEL) rem2ps.obj
|
||||
|
||||
.c.obj:
|
||||
bcc $(CFLAGS) -c {$< }
|
||||
|
||||
rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
|
||||
|
||||
calendar.obj: calendar.c $(STDHDRS) expr.h
|
||||
|
||||
dorem.obj: dorem.c $(STDHDRS) expr.h
|
||||
|
||||
dosubst.obj: dosubst.c $(STDHDRS) $(LANGHDRS)
|
||||
|
||||
expr.obj: expr.c $(STDHDRS) expr.h
|
||||
|
||||
files.obj: files.c $(STDHDRS)
|
||||
|
||||
funcs.obj: funcs.c $(STDHDRS) expr.h version.h
|
||||
|
||||
globals.obj: globals.c config.h types.h globals.h err.h lang.h
|
||||
|
||||
init.obj: init.c $(STDHDRS) expr.h version.h
|
||||
|
||||
main.obj: main.c $(STDHDRS) expr.h
|
||||
|
||||
moon.obj: moon.c $(STDHDRS) expr.h
|
||||
|
||||
omit.obj: omit.c $(STDHDRS)
|
||||
|
||||
os2func.obj: os2func.c $(STDHDRS)
|
||||
|
||||
queue.obj: queue.c $(STDHDRS)
|
||||
|
||||
sort.obj: sort.c $(STDHDRS)
|
||||
|
||||
token.obj: token.c $(STDHDRS)
|
||||
|
||||
trigger.obj: trigger.c $(STDHDRS) expr.h
|
||||
|
||||
userfns.obj: userfns.c $(STDHDRS) expr.h
|
||||
|
||||
utils.obj: utils.c $(STDHDRS)
|
||||
|
||||
var.obj: var.c $(STDHDRS) expr.h
|
||||
@@ -1,74 +0,0 @@
|
||||
# Makefile for REMIND for Microsoft C for MSDOS
|
||||
# $Id: makefile.msc,v 1.1 1998-01-15 02:50:32 dfs Exp $
|
||||
|
||||
OBJS= calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
|
||||
globals.obj init.obj main.obj omit.obj token.obj trigger.obj userfns.obj \
|
||||
utils.obj var.obj sort.obj hbcal.obj moon.obj
|
||||
|
||||
DEFINES= /D__MSDOS__ /D__MSC__
|
||||
|
||||
MODEL= /AM
|
||||
|
||||
calendar.obj: calendar.c
|
||||
cl /c $(DEFINES) $(MODEL) /Focalendar.obj calendar.c
|
||||
|
||||
dorem.obj: dorem.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fodorem.obj dorem.c
|
||||
|
||||
dosubst.obj: dosubst.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fodosubst.obj dosubst.c
|
||||
|
||||
expr.obj: expr.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foexpr.obj expr.c
|
||||
|
||||
hbcal.obj: hbcal.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fohbcal.obj hbcal.c
|
||||
|
||||
sort.obj: sort.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fosort.obj sort.c
|
||||
|
||||
files.obj: files.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fofiles.obj files.c
|
||||
|
||||
funcs.obj: funcs.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fofuncs.obj funcs.c
|
||||
|
||||
globals.obj: globals.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foglobals.obj globals.c
|
||||
|
||||
init.obj: init.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foinit.obj init.c
|
||||
|
||||
main.obj: main.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fomain.obj main.c
|
||||
|
||||
moon.obj: moon.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fomoon.obj moon.c
|
||||
|
||||
omit.obj: omit.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foomit.obj omit.c
|
||||
|
||||
token.obj: token.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fotoken.obj token.c
|
||||
|
||||
trigger.obj: trigger.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fotrigger.obj trigger.c
|
||||
|
||||
userfns.obj: userfns.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fouserfns.obj userfns.c
|
||||
|
||||
utils.obj: utils.c
|
||||
cl /c $(DEFINES) $(MODEL) /Foutils.obj utils.c
|
||||
|
||||
var.obj: var.c
|
||||
cl /c $(DEFINES) $(MODEL) /Fovar.obj var.c
|
||||
|
||||
remind.exe: $(OBJS)
|
||||
link /NOI @lnk.msc
|
||||
|
||||
rem2ps.obj: rem2ps.c
|
||||
cl /c $(DEFINES) $(MODEL) /Forem2ps.obj rem2ps.c
|
||||
|
||||
rem2ps.exe: rem2ps.obj
|
||||
link /NOI rem2ps,rem2ps.exe,,,
|
||||
|
||||
122
src/makefile.os2
122
src/makefile.os2
@@ -1,122 +0,0 @@
|
||||
# Makefile for REMIND
|
||||
#
|
||||
# $Id: makefile.os2,v 1.1 1998-01-15 02:50:32 dfs Exp $
|
||||
#
|
||||
# THIS IS OUT OF DATE!
|
||||
#
|
||||
# - for GNU gcc (emx 0.8g kit) [executables for OS/2 2.x or DOS (32-bit)]
|
||||
# - for Microsoft C 6.00A [executables for OS/2 or MSDOS (16-bit)]
|
||||
|
||||
# To use, enter "make -f Makefile.os2" (this makefile depends on its
|
||||
# name being "Makefile.os2").
|
||||
#
|
||||
# Tested with dmake 3.8 and GNU make 3.68 under OS/2
|
||||
|
||||
default:
|
||||
@echo "Enter $(MAKE) -f Makefile.os2 target "
|
||||
@echo " where 'target' is chosen from "
|
||||
@echo " msc OS/2 exe [Microsoft C 6.00a] "
|
||||
@echo " mscbnd OS/2 and DOS exe [Microsoft C 6.00a] "
|
||||
@echo " emx OS/2 and DOS 32-bit exe [EMX/gcc] "
|
||||
@echo " emxomf OS/2 32-bit exe w/DLL C library [EMX/gcc] "
|
||||
|
||||
|
||||
msc:
|
||||
$(MAKE) -f Makefile.os2 all \
|
||||
CC="cl -nologo -AM" O=".obj" \
|
||||
CFLAGS="-D__STDC__ -D__OS2__" \
|
||||
LFLAGS="-Lp" \
|
||||
LFLAGS2="setargv.obj remind.def -link /NOE"
|
||||
|
||||
mscbnd:
|
||||
$(MAKE) -f Makefile.os2 all \
|
||||
CC="cl -nologo -AM" O=".obj" \
|
||||
CFLAGS="-D__STDC__ -D__OS2__ -D__MSDOS__" \
|
||||
LFLAGS="-Lp" LBIND="-Fb" \
|
||||
LFLAGS2="setargv.obj remind.def -link /NOE" \
|
||||
BIND="bind remind /n DOSMAKEPIPE DOSCWAIT VIOENDPOPUP VIOPOPUP"
|
||||
|
||||
emx:
|
||||
$(MAKE) -f Makefile.os2 all \
|
||||
CC="gcc -O -s" O=".o" \
|
||||
CFLAGS="-D__OS2__ -D__MSDOS__" \
|
||||
LFLAGS=""
|
||||
|
||||
emxomf:
|
||||
$(MAKE) -f Makefile.os2 all \
|
||||
CC="gcc -Zomf -O -s" O=".obj" \
|
||||
CFLAGS="-D__OS2__" \
|
||||
LFLAGS="-Zcrtdll -Zstack 32" \
|
||||
LFLAGS2="remind.def"
|
||||
|
||||
|
||||
# OS2_POPUP enables Russ Herman's popup reminders
|
||||
#OS2_POPUP =
|
||||
OS2_POPUP = -DOS2_POPUP
|
||||
|
||||
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
|
||||
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \
|
||||
danish.h polish.h
|
||||
|
||||
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
|
||||
|
||||
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h danish.h \
|
||||
polish.h
|
||||
|
||||
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c hbcal.c \
|
||||
init.c main.c moon.c omit.c sort.c queue.c token.c trigger.c userfns.c \
|
||||
utils.c var.c os2func.c
|
||||
|
||||
MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
|
||||
remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
|
||||
makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
|
||||
defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
|
||||
tstlang.rem README.BCC lnk.bcc makefile.bcc os2func.c \
|
||||
test-rem.bat test-rem.cmd test1.cmp test2.cmp
|
||||
|
||||
|
||||
OBJS= $(SRCS:.c=$O)
|
||||
|
||||
all: remind.exe rem2ps.exe
|
||||
|
||||
.SUFFIXES: $O
|
||||
|
||||
.c$O:
|
||||
$(CC) -c $(CFLAGS) $(OS2_POPUP) $*.c
|
||||
|
||||
rem2ps.exe: rem2ps$O
|
||||
$(CC) $(LFLAGS) $(LBIND) -o $@ rem2ps$O $(LFLAGS2)
|
||||
|
||||
remind.exe: $(OBJS)
|
||||
$(CC) $(LFLAGS) -o $@ $(OBJS) $(LFLAGS2)
|
||||
$(BIND)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.obj *~ core *.bak
|
||||
|
||||
clobber:
|
||||
rm -f *.o *.obj *~ remind.exe rem2ps.exe test.out core *.bak
|
||||
|
||||
test:
|
||||
test-rem.cmd
|
||||
|
||||
rem2ps$O: rem2ps.c rem2ps.h lang.h config.h
|
||||
calendar$O: calendar.c $(STDHDRS) expr.h
|
||||
dorem$O: dorem.c $(STDHDRS) expr.h
|
||||
dosubst$O: dosubst.c $(STDHDRS) $(LANGHDRS)
|
||||
expr$O: expr.c $(STDHDRS) expr.h
|
||||
files$O: files.c $(STDHDRS)
|
||||
funcs$O: funcs.c $(STDHDRS) expr.h version.h
|
||||
globals$O: globals.c config.h types.h globals.h err.h lang.h $(LANGHDRS)
|
||||
hbcal$O: hbcal.c $(STDHDRS)
|
||||
init$O: init.c $(STDHDRS) expr.h version.h $(LANGHDRS)
|
||||
main$O: main.c $(STDHDRS) expr.h
|
||||
moon$O: moon.c $(STDHDRS)
|
||||
omit$O: omit.c $(STDHDRS)
|
||||
sort$O: sort.c $(STDHDRS)
|
||||
queue$O: queue.c $(STDHDRS)
|
||||
token$O: token.c $(STDHDRS)
|
||||
trigger$O: trigger.c $(STDHDRS) expr.h
|
||||
userfns$O: userfns.c $(STDHDRS) expr.h
|
||||
utils$O: utils.c $(STDHDRS)
|
||||
var$O: var.c $(STDHDRS) expr.h
|
||||
@@ -1,68 +0,0 @@
|
||||
# Makefile for REMIND for Turbo C for MSDOS
|
||||
# $Id: makefile.tc,v 1.2 1998-03-01 20:43:57 dfs Exp $
|
||||
|
||||
CC= tcc
|
||||
VERSION= 03.00.19
|
||||
|
||||
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
|
||||
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h \
|
||||
danish.h polish.h
|
||||
|
||||
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
|
||||
|
||||
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h danish.h \
|
||||
polish.h
|
||||
|
||||
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
|
||||
moon.c main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
|
||||
|
||||
OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
|
||||
globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
|
||||
utils.obj userfns.obj var.obj hbcal.obj
|
||||
|
||||
all: remind.exe rem2ps.exe
|
||||
|
||||
remind.exe: $(OBJS)
|
||||
$(CC) @lnk.tc
|
||||
|
||||
rem2ps.exe: rem2ps.obj
|
||||
$(CC) -erem2ps.exe rem2ps.obj
|
||||
|
||||
.c.obj:
|
||||
$(CC) -w-pia -c -O -mm {$< }
|
||||
|
||||
rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
|
||||
|
||||
calendar.obj: calendar.c $(STDHDRS) expr.h
|
||||
|
||||
dorem.obj: dorem.c $(STDHDRS) expr.h
|
||||
|
||||
dosubst.obj: dosubst.c $(STDHDRS) $(LANGHDRS)
|
||||
|
||||
expr.obj: expr.c $(STDHDRS) expr.h
|
||||
|
||||
files.obj: files.c $(STDHDRS)
|
||||
|
||||
funcs.obj: funcs.c $(STDHDRS) expr.h version.h
|
||||
|
||||
globals.obj: globals.c config.h types.h globals.h err.h lang.h
|
||||
|
||||
init.obj: init.c $(STDHDRS) expr.h version.h
|
||||
|
||||
main.obj: main.c $(STDHDRS) expr.h
|
||||
|
||||
moon.obj: moon.c $(STDHDRS) expr.h
|
||||
|
||||
omit.obj: omit.c $(STDHDRS)
|
||||
|
||||
sort.obj: sort.c $(STDHDRS)
|
||||
|
||||
token.obj: token.c $(STDHDRS)
|
||||
|
||||
trigger.obj: trigger.c $(STDHDRS) expr.h
|
||||
|
||||
userfns.obj: userfns.c $(STDHDRS) expr.h
|
||||
|
||||
utils.obj: utils.c $(STDHDRS)
|
||||
|
||||
var.obj: var.c $(STDHDRS) expr.h
|
||||
249
src/md5.c
Normal file
249
src/md5.c
Normal file
@@ -0,0 +1,249 @@
|
||||
/*
|
||||
* This code implements the MD5 message-digest algorithm.
|
||||
* The algorithm is due to Ron Rivest. This code was
|
||||
* written by Colin Plumb in 1993, no copyright is claimed.
|
||||
* This code is in the public domain; do with it what you wish.
|
||||
*
|
||||
* Equivalent code is available from RSA Data Security, Inc.
|
||||
* This code has been tested against that, and is equivalent,
|
||||
* except that you don't need to include two pages of legalese
|
||||
* with every copy.
|
||||
*
|
||||
* LIC: GPL
|
||||
*
|
||||
* To compute the message digest of a chunk of bytes, declare an
|
||||
* MD5Context structure, pass it to MD5Init, call MD5Update as
|
||||
* needed on buffers full of bytes, and then call MD5Final, which
|
||||
* will fill a supplied 16-byte array with the digest.
|
||||
*/
|
||||
#include <string.h> /* for memcpy() */
|
||||
#include "md5.h"
|
||||
|
||||
static void byteReverse(unsigned char *buf, unsigned longs);
|
||||
|
||||
/*
|
||||
* Note: this code is harmless on little-endian machines.
|
||||
*/
|
||||
static void
|
||||
byteReverse(unsigned char *buf, unsigned longs)
|
||||
{
|
||||
uint32 t;
|
||||
do {
|
||||
t = (uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
|
||||
((unsigned) buf[1] << 8 | buf[0]);
|
||||
*(uint32 *) buf = t;
|
||||
buf += 4;
|
||||
} while (--longs);
|
||||
}
|
||||
|
||||
/*
|
||||
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
|
||||
* initialization constants.
|
||||
*/
|
||||
void MD5Init(struct MD5Context *ctx)
|
||||
{
|
||||
ctx->buf[0] = 0x67452301;
|
||||
ctx->buf[1] = 0xefcdab89;
|
||||
ctx->buf[2] = 0x98badcfe;
|
||||
ctx->buf[3] = 0x10325476;
|
||||
|
||||
ctx->bits[0] = 0;
|
||||
ctx->bits[1] = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update context to reflect the concatenation of another buffer full
|
||||
* of bytes.
|
||||
*/
|
||||
void MD5Update(struct MD5Context *ctx, unsigned char const *buf, unsigned len)
|
||||
{
|
||||
uint32 t;
|
||||
|
||||
/* Update bitcount */
|
||||
|
||||
t = ctx->bits[0];
|
||||
if ((ctx->bits[0] = t + ((uint32) len << 3)) < t)
|
||||
ctx->bits[1]++; /* Carry from low to high */
|
||||
ctx->bits[1] += len >> 29;
|
||||
|
||||
t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
|
||||
|
||||
/* Handle any leading odd-sized chunks */
|
||||
|
||||
if (t) {
|
||||
unsigned char *p = (unsigned char *) ctx->in + t;
|
||||
|
||||
t = 64 - t;
|
||||
if (len < t) {
|
||||
memcpy(p, buf, len);
|
||||
return;
|
||||
}
|
||||
memcpy(p, buf, t);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
buf += t;
|
||||
len -= t;
|
||||
}
|
||||
/* Process data in 64-byte chunks */
|
||||
|
||||
while (len >= 64) {
|
||||
memcpy(ctx->in, buf, 64);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
buf += 64;
|
||||
len -= 64;
|
||||
}
|
||||
|
||||
/* Handle any remaining bytes of data. */
|
||||
|
||||
memcpy(ctx->in, buf, len);
|
||||
}
|
||||
|
||||
/*
|
||||
* Final wrapup - pad to 64-byte boundary with the bit pattern
|
||||
* 1 0* (64-bit count of bits processed, MSB-first)
|
||||
*/
|
||||
void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
|
||||
{
|
||||
unsigned count;
|
||||
unsigned char *p;
|
||||
|
||||
/* Compute number of bytes mod 64 */
|
||||
count = (ctx->bits[0] >> 3) & 0x3F;
|
||||
|
||||
/* Set the first char of padding to 0x80. This is safe since there is
|
||||
always at least one byte free */
|
||||
p = ctx->in + count;
|
||||
*p++ = 0x80;
|
||||
|
||||
/* Bytes of padding needed to make 64 bytes */
|
||||
count = 64 - 1 - count;
|
||||
|
||||
/* Pad out to 56 mod 64 */
|
||||
if (count < 8) {
|
||||
/* Two lots of padding: Pad the first block to 64 bytes */
|
||||
memset(p, 0, count);
|
||||
byteReverse(ctx->in, 16);
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
|
||||
/* Now fill the next block with 56 bytes */
|
||||
memset(ctx->in, 0, 56);
|
||||
} else {
|
||||
/* Pad block to 56 bytes */
|
||||
memset(p, 0, count - 8);
|
||||
}
|
||||
byteReverse(ctx->in, 14);
|
||||
|
||||
/* Append length in bits and transform */
|
||||
((uint32 *) ctx->in)[14] = ctx->bits[0];
|
||||
((uint32 *) ctx->in)[15] = ctx->bits[1];
|
||||
|
||||
MD5Transform(ctx->buf, (uint32 *) ctx->in);
|
||||
byteReverse((unsigned char *) ctx->buf, 4);
|
||||
memcpy(digest, ctx->buf, 16);
|
||||
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
|
||||
}
|
||||
|
||||
#ifndef ASM_MD5
|
||||
|
||||
/* The four core functions - F1 is optimized somewhat */
|
||||
|
||||
/* #define F1(x, y, z) (x & y | ~x & z) */
|
||||
#define F1(x, y, z) (z ^ (x & (y ^ z)))
|
||||
#define F2(x, y, z) F1(z, x, y)
|
||||
#define F3(x, y, z) (x ^ y ^ z)
|
||||
#define F4(x, y, z) (y ^ (x | ~z))
|
||||
|
||||
/* This is the central step in the MD5 algorithm. */
|
||||
#define MD5STEP(f, w, x, y, z, data, s) \
|
||||
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
|
||||
|
||||
/*
|
||||
* The core of the MD5 algorithm, this alters an existing MD5 hash to
|
||||
* reflect the addition of 16 longwords of new data. MD5Update blocks
|
||||
* the data and converts bytes into longwords for this routine.
|
||||
*/
|
||||
void MD5Transform(uint32 buf[4], uint32 const in[16])
|
||||
{
|
||||
register uint32 a, b, c, d;
|
||||
|
||||
a = buf[0];
|
||||
b = buf[1];
|
||||
c = buf[2];
|
||||
d = buf[3];
|
||||
|
||||
MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
|
||||
MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
|
||||
MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
|
||||
MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
|
||||
MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
|
||||
|
||||
MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
|
||||
MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
|
||||
MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
|
||||
MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
|
||||
MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
|
||||
|
||||
MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
|
||||
MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
|
||||
MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
|
||||
MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
|
||||
MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
|
||||
|
||||
MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
|
||||
MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
|
||||
MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
|
||||
MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
|
||||
MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
|
||||
|
||||
buf[0] += a;
|
||||
buf[1] += b;
|
||||
buf[2] += c;
|
||||
buf[3] += d;
|
||||
}
|
||||
|
||||
#endif
|
||||
34
src/md5.h
Normal file
34
src/md5.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef MD5_H
|
||||
#define MD5_H
|
||||
/*
|
||||
* LIC: GPL
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if SIZEOF_UNSIGNED_INT == 4
|
||||
typedef unsigned int uint32;
|
||||
#elif SIZEOF_UNSIGNED_LONG == 4
|
||||
typedef unsigned long uint32;
|
||||
#else
|
||||
# error Could not find a 32-bit integer type
|
||||
#endif
|
||||
|
||||
struct MD5Context {
|
||||
uint32 buf[4];
|
||||
uint32 bits[2];
|
||||
unsigned char in[64];
|
||||
};
|
||||
|
||||
void MD5Init(struct MD5Context *context);
|
||||
void MD5Update(struct MD5Context *context, unsigned char const *buf,
|
||||
unsigned len);
|
||||
void MD5Final(unsigned char digest[16], struct MD5Context *context);
|
||||
void MD5Transform(uint32 buf[4], uint32 const in[16]);
|
||||
|
||||
/*
|
||||
* This is needed to make RSAREF happy on some MS-DOS compilers.
|
||||
*/
|
||||
typedef struct MD5Context MD5_CTX;
|
||||
|
||||
#endif /* !MD5_H */
|
||||
114
src/moon.c
114
src/moon.c
@@ -5,13 +5,11 @@
|
||||
/* Calculations for figuring out moon phases. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: moon.c,v 1.4 1999-04-05 17:34:53 dfs Exp $";
|
||||
|
||||
/* All of these routines were adapted from the program "moontool"
|
||||
by John Walker, February 1988. Here's the blurb from moontool:
|
||||
@@ -61,10 +59,7 @@ static char const RCSID[] = "$Id: moon.c,v 1.4 1999-04-05 17:34:53 dfs Exp $";
|
||||
that credit and blame may be properly apportioned.
|
||||
|
||||
*/
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
@@ -75,14 +70,14 @@ static char const RCSID[] = "$Id: moon.c,v 1.4 1999-04-05 17:34:53 dfs Exp $";
|
||||
#include "err.h"
|
||||
|
||||
/* Function prototypes */
|
||||
PRIVATE long jdate ARGS((int y, int mon, int day));
|
||||
PRIVATE double jtime ARGS((int y, int mon, int day, int hour, int min, int sec));
|
||||
PRIVATE void jyear ARGS((double td, int *yy, int *mm, int *dd));
|
||||
PRIVATE void jhms ARGS((double j, int *h, int *m, int *s));
|
||||
PRIVATE double meanphase ARGS((double sdate, double phase, double *usek));
|
||||
PRIVATE double truephase ARGS((double k, double phase));
|
||||
PRIVATE double kepler ARGS((double m, double ecc));
|
||||
PRIVATE double phase ARGS((double, double *, double *, double *, double *, double *, double *));
|
||||
static long jdate (int y, int mon, int day);
|
||||
static double jtime (int y, int mon, int day, int hour, int min, int sec);
|
||||
static void jyear (double td, int *yy, int *mm, int *dd);
|
||||
static void jhms (double j, int *h, int *m, int *s);
|
||||
static double meanphase (double sdate, double phase, double *usek);
|
||||
static double truephase (double k, double phase);
|
||||
static double kepler (double m, double ecc);
|
||||
static double phase (double, double *, double *, double *, double *, double *, double *);
|
||||
|
||||
|
||||
/* Astronomical constants */
|
||||
@@ -151,12 +146,7 @@ PRIVATE double phase ARGS((double, double *, double *, double *, double *, doubl
|
||||
/* Convert a date and time to Julian day and fraction. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE long jdate(int y, int mon, int day)
|
||||
#else
|
||||
static long jdate(y, mon, day)
|
||||
int y, mon, day;
|
||||
#endif
|
||||
static long jdate(int y, int mon, int day)
|
||||
{
|
||||
long c, m;
|
||||
|
||||
@@ -180,12 +170,7 @@ int y, mon, day;
|
||||
/* i.e. Julian date plus day fraction, expressed as a double */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double jtime(int y, int mon, int day, int hour, int min, int sec)
|
||||
#else
|
||||
static double jtime(y, mon, day, hour, min, sec)
|
||||
int y, mon, day, hour, min, sec;
|
||||
#endif
|
||||
static double jtime(int y, int mon, int day, int hour, int min, int sec)
|
||||
{
|
||||
return (jdate(y, mon, day)-0.5) +
|
||||
(sec + 60L * (long) min + 3600L * (long) hour) / 86400.0;
|
||||
@@ -198,13 +183,7 @@ int y, mon, day, hour, min, sec;
|
||||
/* Convert a Julian date to year, month, day. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void jyear(double td, int *yy, int *mm, int *dd)
|
||||
#else
|
||||
static void jyear(td, yy, mm, dd)
|
||||
double td;
|
||||
int *yy, *mm, *dd;
|
||||
#endif
|
||||
static void jyear(double td, int *yy, int *mm, int *dd)
|
||||
{
|
||||
double j, d, y, m;
|
||||
|
||||
@@ -239,13 +218,7 @@ int *yy, *mm, *dd;
|
||||
/* Convert a Julian time to hour, minutes and seconds. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void jhms(double j, int *h, int *m, int *s)
|
||||
#else
|
||||
static void jhms(j, h, m, s)
|
||||
double j;
|
||||
int *h, *m, *s;
|
||||
#endif
|
||||
static void jhms(double j, int *h, int *m, int *s)
|
||||
{
|
||||
long ij;
|
||||
|
||||
@@ -273,13 +246,7 @@ int *h, *m, *s;
|
||||
/* than this calculation reveals. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double meanphase(double sdate, double phase, double *usek)
|
||||
#else
|
||||
static double meanphase(sdate, phase, usek)
|
||||
double sdate, phase;
|
||||
double *usek;
|
||||
#endif
|
||||
static double meanphase(double sdate, double phase, double *usek)
|
||||
{
|
||||
double k, t, t2, t3, nt1;
|
||||
|
||||
@@ -315,12 +282,7 @@ double *usek;
|
||||
/* the true, corrected phase time. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double truephase(double k, double phase)
|
||||
#else
|
||||
static double truephase(k, phase)
|
||||
double k, phase;
|
||||
#endif
|
||||
static double truephase(double k, double phase)
|
||||
{
|
||||
double t, t2, t3, pt, m, mprime, f;
|
||||
int apcor = 0;
|
||||
@@ -401,12 +363,7 @@ double k, phase;
|
||||
/* Solve the equation of Kepler. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double kepler(double m, double ecc)
|
||||
#else
|
||||
static double kepler(m, ecc)
|
||||
double m, ecc;
|
||||
#endif
|
||||
static double kepler(double m, double ecc)
|
||||
{
|
||||
double e, delta;
|
||||
#define EPSILON 1E-6
|
||||
@@ -434,24 +391,13 @@ double m, ecc;
|
||||
/* the centre of the Earth. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE double phase(double pdate,
|
||||
double *pphase,
|
||||
double *mage,
|
||||
double *dist,
|
||||
double *angdia,
|
||||
double *sudist,
|
||||
double *suangdia)
|
||||
#else
|
||||
static double phase(pdate, pphase, mage, dist, angdia, sudist, suangdia)
|
||||
double pdate;
|
||||
double *pphase; /* Illuminated fraction */
|
||||
double *mage; /* Age of moon in days */
|
||||
double *dist; /* Distance in kilometres */
|
||||
double *angdia; /* Angular diameter in degrees */
|
||||
double *sudist; /* Distance to Sun */
|
||||
double *suangdia; /* Sun's angular diameter */
|
||||
#endif
|
||||
static double phase(double pdate,
|
||||
double *pphase,
|
||||
double *mage,
|
||||
double *dist,
|
||||
double *angdia,
|
||||
double *sudist,
|
||||
double *suangdia)
|
||||
{
|
||||
|
||||
double Day, N, M, Ec, Lambdasun, ml, MM, MN, Ev, Ae, A3, MmP,
|
||||
@@ -564,12 +510,7 @@ double *suangdia; /* Sun's angular diameter */
|
||||
/* that date and time as a number from 0 to 360. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int MoonPhase(int date, int time)
|
||||
#else
|
||||
int MoonPhase(date, time)
|
||||
int date, time;
|
||||
#endif
|
||||
int MoonPhase(int date, int time)
|
||||
{
|
||||
int utcd, utct;
|
||||
int y, m, d;
|
||||
@@ -599,12 +540,7 @@ int date, time;
|
||||
/* 0 to 3 for new, 1stq, full, 3rdq */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void HuntPhase(int startdate, int starttim, int phas, int *date, int *time)
|
||||
#else
|
||||
void HuntPhase(startdate, starttim, phas, date, time)
|
||||
int startdate, starttim, phas, *date, *time;
|
||||
#endif
|
||||
void HuntPhase(int startdate, int starttim, int phas, int *date, int *time)
|
||||
{
|
||||
int utcd, utct;
|
||||
int y, m, d;
|
||||
|
||||
275
src/omit.c
275
src/omit.c
@@ -6,31 +6,23 @@
|
||||
/* the data structures for OMITted dates. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: omit.c,v 1.5 1999-04-05 17:34:54 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
#include "expr.h"
|
||||
|
||||
PRIVATE int BexistsIntArray ARGS ((int array[], int num, int key));
|
||||
PRIVATE void InsertIntoSortedArray ARGS ((int *array, int num, int key));
|
||||
static int BexistsIntArray (int array[], int num, int key);
|
||||
static void InsertIntoSortedArray (int *array, int num, int key);
|
||||
|
||||
/* Arrays for the global omits */
|
||||
static int FullOmitArray[MAX_FULL_OMITS];
|
||||
@@ -57,11 +49,7 @@ static OmitContext *SavedOmitContexts = NULL;
|
||||
/* Clear all the global OMIT context. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int ClearGlobalOmits(void)
|
||||
#else
|
||||
int ClearGlobalOmits()
|
||||
#endif
|
||||
int ClearGlobalOmits(void)
|
||||
{
|
||||
NumFullOmits = NumPartialOmits = 0;
|
||||
return OK;
|
||||
@@ -74,12 +62,7 @@ int ClearGlobalOmits()
|
||||
/* The command-line function CLEAR-OMIT-CONTEXT */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoClear(ParsePtr p)
|
||||
#else
|
||||
int DoClear(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int DoClear(ParsePtr p)
|
||||
{
|
||||
ClearGlobalOmits();
|
||||
return VerifyEoln(p);
|
||||
@@ -94,11 +77,7 @@ ParsePtr p;
|
||||
/* destroyed. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DestroyOmitContexts(void)
|
||||
#else
|
||||
int DestroyOmitContexts()
|
||||
#endif
|
||||
int DestroyOmitContexts(void)
|
||||
{
|
||||
OmitContext *c = SavedOmitContexts;
|
||||
OmitContext *d;
|
||||
@@ -123,12 +102,7 @@ int DestroyOmitContexts()
|
||||
/* Push the OMIT context on to the stack. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int PushOmitContext(ParsePtr p)
|
||||
#else
|
||||
int PushOmitContext(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int PushOmitContext(ParsePtr p)
|
||||
{
|
||||
register int i;
|
||||
OmitContext *context;
|
||||
@@ -139,18 +113,18 @@ ParsePtr p;
|
||||
|
||||
context->numfull = NumFullOmits;
|
||||
context->numpart = NumPartialOmits;
|
||||
context->fullsave = (int *) malloc(NumFullOmits * sizeof(int));
|
||||
context->fullsave = malloc(NumFullOmits * sizeof(int));
|
||||
if (NumFullOmits && !context->fullsave) {
|
||||
free(context);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
context->partsave = (int *) malloc(NumPartialOmits * sizeof(int));
|
||||
context->partsave = malloc(NumPartialOmits * sizeof(int));
|
||||
if (NumPartialOmits && !context->partsave) {
|
||||
free(context->fullsave);
|
||||
free(context);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
|
||||
/* Copy the context over */
|
||||
for (i=0; i<NumFullOmits; i++)
|
||||
*(context->fullsave + i) = FullOmitArray[i];
|
||||
@@ -171,12 +145,7 @@ ParsePtr p;
|
||||
/* Pop the OMIT context off of the stack. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int PopOmitContext(ParsePtr p)
|
||||
#else
|
||||
int PopOmitContext(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int PopOmitContext(ParsePtr p)
|
||||
{
|
||||
|
||||
register int i;
|
||||
@@ -208,31 +177,57 @@ ParsePtr p;
|
||||
/* */
|
||||
/* IsOmitted */
|
||||
/* */
|
||||
/* Return non-zero if date is OMITted, zero if it is not. */
|
||||
/* Set *omit to non-zero if date is omitted, else 0. Returns */
|
||||
/* OK or an error code. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int IsOmitted(int jul, int localomit)
|
||||
#else
|
||||
int IsOmitted(jul, localomit)
|
||||
int jul, localomit;
|
||||
#endif
|
||||
int IsOmitted(int jul, int localomit, char const *omitfunc, int *omit)
|
||||
{
|
||||
int y, m, d;
|
||||
|
||||
/* If we have an omitfunc, we *only* use it and ignore local/global
|
||||
OMITs */
|
||||
if (omitfunc && *omitfunc && UserFuncExists(omitfunc)) {
|
||||
char expr[VAR_NAME_LEN + 32];
|
||||
char const *s;
|
||||
int r;
|
||||
Value v;
|
||||
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
sprintf(expr, "%s('%04d-%02d-%02d')",
|
||||
omitfunc, y, m+1, d);
|
||||
s = expr;
|
||||
r = EvalExpr(&s, &v, NULL);
|
||||
if (r) return r;
|
||||
if (v.type == INT_TYPE && v.v.val != 0) {
|
||||
*omit = 1;
|
||||
} else {
|
||||
*omit = 0;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Is it omitted because of local omits? */
|
||||
if (localomit & (1 << (jul % 7))) return 1;
|
||||
if (localomit & (1 << (jul % 7))) {
|
||||
*omit = 1;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Is it omitted because of fully-specified omits? */
|
||||
if (BexistsIntArray(FullOmitArray, NumFullOmits, jul)) return 1;
|
||||
if (BexistsIntArray(FullOmitArray, NumFullOmits, jul)) {
|
||||
*omit = 1;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Get the syndrome */
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
if (BexistsIntArray(PartialOmitArray, NumPartialOmits, (m << 5) + d))
|
||||
return 1;
|
||||
if (BexistsIntArray(PartialOmitArray, NumPartialOmits, (m << 5) + d)) {
|
||||
*omit = 1;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* Not omitted */
|
||||
return 0;
|
||||
*omit = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -243,12 +238,7 @@ int jul, localomit;
|
||||
/* element is found, 0 otherwise. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int BexistsIntArray(int array[], int num, int key)
|
||||
#else
|
||||
static int BexistsIntArray(array, num, key)
|
||||
int array[], num, key;
|
||||
#endif
|
||||
static int BexistsIntArray(int array[], int num, int key)
|
||||
{
|
||||
int top=num-1, bot=0, mid;
|
||||
|
||||
@@ -269,12 +259,7 @@ int array[], num, key;
|
||||
/* room in the array for it. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void InsertIntoSortedArray(int *array, int num, int key)
|
||||
#else
|
||||
static void InsertIntoSortedArray(array, num, key)
|
||||
int *array, num, key;
|
||||
#endif
|
||||
static void InsertIntoSortedArray(int *array, int num, int key)
|
||||
{
|
||||
/* num is number of elements CURRENTLY in the array. */
|
||||
int *cur = array+num;
|
||||
@@ -286,6 +271,9 @@ int *array, num, key;
|
||||
*cur = key;
|
||||
}
|
||||
|
||||
static int DoThroughOmit(ParsePtr p, int y, int m, int d);
|
||||
static void DumpOmits(void);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DoOmit */
|
||||
@@ -293,26 +281,39 @@ int *array, num, key;
|
||||
/* Do a global OMIT command. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int DoOmit(ParsePtr p)
|
||||
#else
|
||||
int DoOmit(p)
|
||||
ParsePtr p;
|
||||
#endif
|
||||
int DoOmit(ParsePtr p)
|
||||
{
|
||||
int y = NO_YR, m = NO_MON, d = NO_DAY, r;
|
||||
Token tok;
|
||||
int parsing=1;
|
||||
int syndrome;
|
||||
int not_first_token = -1;
|
||||
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
/* Parse the OMIT. We need a month and day; year is optional. */
|
||||
while(parsing) {
|
||||
not_first_token++;
|
||||
if ( (r=ParseToken(p, &buf)) ) return r;
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
switch (tok.type) {
|
||||
case T_Dumpvars:
|
||||
if (not_first_token) return E_PARSE_ERR;
|
||||
DBufFree(&buf);
|
||||
r = VerifyEoln(p);
|
||||
if (r != OK) return r;
|
||||
DumpOmits();
|
||||
return OK;
|
||||
|
||||
case T_Date:
|
||||
DBufFree(&buf);
|
||||
if (y != NO_YR) return E_YR_TWICE;
|
||||
if (m != NO_MON) return E_MON_TWICE;
|
||||
if (d != NO_DAY) return E_DAY_TWICE;
|
||||
FromJulian(tok.val, &y, &m, &d);
|
||||
break;
|
||||
|
||||
case T_Year:
|
||||
DBufFree(&buf);
|
||||
if (y != NO_YR) return E_YR_TWICE;
|
||||
@@ -330,11 +331,16 @@ ParsePtr p;
|
||||
if (d != NO_DAY) return E_DAY_TWICE;
|
||||
d = tok.val;
|
||||
break;
|
||||
|
||||
|
||||
case T_Delta:
|
||||
DBufFree(&buf);
|
||||
break;
|
||||
|
||||
case T_Through:
|
||||
DBufFree(&buf);
|
||||
if (y == NO_YR || m == NO_MON || d == NO_DAY) return E_INCOMPLETE;
|
||||
return DoThroughOmit(p, y, m, d);
|
||||
|
||||
case T_Empty:
|
||||
case T_Comment:
|
||||
case T_RemType:
|
||||
@@ -373,7 +379,124 @@ ParsePtr p;
|
||||
NumFullOmits++;
|
||||
}
|
||||
}
|
||||
if (tok.type == T_RemType || tok.type == T_Priority) return E_PARSE_AS_REM;
|
||||
if (tok.type == T_Tag || tok.type == T_Duration || tok.type == T_RemType || tok.type == T_Priority) return E_PARSE_AS_REM;
|
||||
return OK;
|
||||
|
||||
}
|
||||
|
||||
static int
|
||||
DoThroughOmit(ParsePtr p, int ystart, int mstart, int dstart)
|
||||
{
|
||||
int yend = NO_YR, mend = NO_MON, dend = NO_DAY, r;
|
||||
int start, end, tmp;
|
||||
int parsing = 1;
|
||||
|
||||
Token tok;
|
||||
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
while(parsing) {
|
||||
if ( (r=ParseToken(p, &buf)) ) return r;
|
||||
FindToken(DBufValue(&buf), &tok);
|
||||
|
||||
switch(tok.type) {
|
||||
case T_Date:
|
||||
DBufFree(&buf);
|
||||
if (yend != NO_YR) return E_YR_TWICE;
|
||||
if (mend != NO_MON) return E_MON_TWICE;
|
||||
if (dend != NO_DAY) return E_DAY_TWICE;
|
||||
FromJulian(tok.val, ¥d, &mend, &dend);
|
||||
break;
|
||||
|
||||
case T_Year:
|
||||
DBufFree(&buf);
|
||||
if (yend != NO_YR) return E_YR_TWICE;
|
||||
yend = tok.val;
|
||||
break;
|
||||
|
||||
case T_Month:
|
||||
DBufFree(&buf);
|
||||
if (mend != NO_MON) return E_MON_TWICE;
|
||||
mend = tok.val;
|
||||
break;
|
||||
|
||||
case T_Day:
|
||||
DBufFree(&buf);
|
||||
if (dend != NO_DAY) return E_DAY_TWICE;
|
||||
dend = tok.val;
|
||||
break;
|
||||
|
||||
case T_Empty:
|
||||
case T_Comment:
|
||||
case T_RemType:
|
||||
case T_Priority:
|
||||
case T_Tag:
|
||||
case T_Duration:
|
||||
DBufFree(&buf);
|
||||
parsing = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
Eprint("%s: `%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN],
|
||||
DBufValue(&buf));
|
||||
DBufFree(&buf);
|
||||
return E_UNKNOWN_TOKEN;
|
||||
|
||||
}
|
||||
}
|
||||
if (yend == NO_YR || mend == NO_MON || dend == NO_DAY) return E_INCOMPLETE;
|
||||
if (dend > DaysInMonth(mend, yend)) return E_BAD_DATE;
|
||||
if (dstart > DaysInMonth(mstart, ystart)) return E_BAD_DATE;
|
||||
|
||||
start = Julian(ystart, mstart, dstart);
|
||||
end = Julian(yend, mend, dend);
|
||||
|
||||
if (end < start) {
|
||||
Eprint("Warning: Swapping dates on OMIT ... THROUGH ... line");
|
||||
tmp = start;
|
||||
start = end;
|
||||
end = tmp;
|
||||
}
|
||||
|
||||
tmp = end - start + 1;
|
||||
|
||||
/* Don't create any OMITs if there would be too many. */
|
||||
if (NumFullOmits + tmp >= MAX_FULL_OMITS) return E_2MANY_FULL;
|
||||
for (tmp = start; tmp <= end; tmp++) {
|
||||
if (!BexistsIntArray(FullOmitArray, NumFullOmits, tmp)) {
|
||||
InsertIntoSortedArray(FullOmitArray, NumFullOmits, tmp);
|
||||
NumFullOmits++;
|
||||
}
|
||||
}
|
||||
if (tok.type == T_Tag || tok.type == T_Duration || tok.type == T_RemType || tok.type == T_Priority) return E_PARSE_AS_REM;
|
||||
return OK;
|
||||
}
|
||||
|
||||
void
|
||||
DumpOmits(void)
|
||||
{
|
||||
int i;
|
||||
int y, m, d;
|
||||
printf("Global Full OMITs (%d of maximum allowed %d):\n", NumFullOmits, MAX_FULL_OMITS);
|
||||
if (!NumFullOmits) {
|
||||
printf("\tNone.\n");
|
||||
} else {
|
||||
for (i=0; i<NumFullOmits; i++) {
|
||||
FromJulian(FullOmitArray[i], &y, &m, &d);
|
||||
printf("\t%04d%c%02d%c%02d\n",
|
||||
y, DateSep, m+1, DateSep, d);
|
||||
}
|
||||
}
|
||||
printf("Global Partial OMITs (%d of maximum allowed %d):\n", NumPartialOmits, MAX_PARTIAL_OMITS);
|
||||
if (!NumPartialOmits) {
|
||||
printf("\tNone.\n");
|
||||
} else {
|
||||
for (i=0; i<NumPartialOmits; i++) {
|
||||
m = PartialOmitArray[i] >> 5 & 0xf;
|
||||
d = PartialOmitArray[i] & 0x1f;
|
||||
printf("\t%02d%c%02d\n", m+1, DateSep, d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
159
src/os2func.c
159
src/os2func.c
@@ -1,159 +0,0 @@
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* OS2FUNC.C */
|
||||
/* */
|
||||
/* Functions to support OS/2. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* */
|
||||
/* This file is Copyright (C) 1993 by Russ Herman. */
|
||||
/* REMIND is Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: os2func.c,v 1.3 1999-04-05 17:34:54 dfs Exp $";
|
||||
|
||||
#ifdef OS2_POPUP
|
||||
#define INCL_VIO
|
||||
#define INCL_KBD
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define INCL_DOSPROCESS
|
||||
#endif
|
||||
|
||||
#if defined(OS2_POPUP) || defined(_MSC_VER)
|
||||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
#ifdef OS2_POPUP
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef OS2DBG
|
||||
#include <dos.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include "globals.h"
|
||||
|
||||
/* EMX defines PS_TYPE, so we undefine it here to avoid
|
||||
a redefinition warning when we include "types.h" */
|
||||
#ifdef PS_TYPE
|
||||
#undef PS_TYPE
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
typedef USHORT APIRET;
|
||||
#endif
|
||||
|
||||
static APIRET apiret = 0;
|
||||
static KBDKEYINFO kbci;
|
||||
static char *pszPressAny = "\r\nPress any key to continue";
|
||||
static USHORT pflags = VP_WAIT; /* | VP_TRANSPARENT; */
|
||||
static HKBD hkbd = 0;
|
||||
static char VioSubstBuffer[SHELLSIZE + 1];
|
||||
|
||||
void StartPopUp()
|
||||
{
|
||||
if (OS2MODE)
|
||||
if (!(DebugFlag & DB_ECHO_LINE))
|
||||
VioPopUp(&pflags, 0);
|
||||
}
|
||||
|
||||
void EndPopUp()
|
||||
{
|
||||
if (DebugFlag & DB_ECHO_LINE)
|
||||
return;
|
||||
if (OS2MODE) {
|
||||
VioWrtTTY(pszPressAny, strlen(pszPressAny), 0);
|
||||
KbdCharIn(&kbci, IO_WAIT, hkbd);
|
||||
VioEndPopUp(0);
|
||||
}
|
||||
}
|
||||
|
||||
int PutsPopUp(char *s)
|
||||
{
|
||||
char c, *os = VioSubstBuffer;
|
||||
|
||||
if (DebugFlag & DB_ECHO_LINE)
|
||||
printf("%s", s);
|
||||
else {
|
||||
do {
|
||||
/* Convert \n to \r\n in auxiliary buffer for VIO */
|
||||
if ((c= *s++) == '\n')
|
||||
*os++ = '\r';
|
||||
*os++ = c;
|
||||
} while (c > 0);
|
||||
VioWrtTTY(VioSubstBuffer, strlen(VioSubstBuffer), 0);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
int PutlPopUp(char *s)
|
||||
{
|
||||
StartPopUp();
|
||||
PutsPopUp(s);
|
||||
if (DebugFlag & DB_ECHO_LINE)
|
||||
fputc('\n', stdout);
|
||||
else
|
||||
VioWrtTTY("\r\n", 2, 0);
|
||||
EndPopUp();
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int PutcPopUp(int c)
|
||||
{
|
||||
char *s = " ";
|
||||
|
||||
if (DebugFlag & DB_ECHO_LINE)
|
||||
fputc(c, stdout);
|
||||
else {
|
||||
switch (c) {
|
||||
case '\n':
|
||||
VioWrtTTY("\r\n", 2, 0);
|
||||
break;
|
||||
default:
|
||||
s[0] = c;
|
||||
VioWrtTTY(s, 1, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef OS2DBG
|
||||
#define DB_ECHO_LINE 16
|
||||
int DebugFlag = 0;
|
||||
void main(/* int argc, char **argv */)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = os2fputs("Test VIO PopUp Writing");
|
||||
if (ret)
|
||||
fprintf(stderr, "Test VIO PopUP Writing returned %d %ld",
|
||||
ret, apiret);
|
||||
exit(ret);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
unsigned sleep(unsigned sec)
|
||||
{
|
||||
return DosSleep(sec * 1000L);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __EMX__
|
||||
int fork()
|
||||
{
|
||||
return(-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
300
src/protos.h
300
src/protos.h
@@ -5,171 +5,159 @@
|
||||
/* Function Prototypes. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: protos.h,v 1.7 1999-04-05 17:34:54 dfs Exp $ */
|
||||
|
||||
#ifdef HAVE_PROTOS
|
||||
#define ARGS(x) x
|
||||
#else
|
||||
#define ARGS(x) ()
|
||||
#endif
|
||||
/* Suppress unused variable warnings */
|
||||
#define UNUSED(x) (void) x
|
||||
|
||||
/* Define a string assignment macro - be careful!!! */
|
||||
#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
|
||||
|
||||
/* Define a general malloc routine for creating pointers to objects */
|
||||
#define NEW(type) ((type *) malloc(sizeof(type)))
|
||||
#define NEW(type) (malloc(sizeof(type)))
|
||||
|
||||
/* Characters to ignore */
|
||||
#define isempty(c) (isspace(c) || ((c) == '\\'))
|
||||
|
||||
#include "dynbuf.h"
|
||||
|
||||
#ifndef HAVE_STRSTR
|
||||
char *strstr ARGS ((char *s1, char *s2));
|
||||
#endif
|
||||
int CallUserFunc (char const *name, int nargs, ParsePtr p);
|
||||
int DoFset (ParsePtr p);
|
||||
void ProduceCalendar (void);
|
||||
char const *SimpleTime (int tim);
|
||||
char const *CalendarTime (int tim, int duration);
|
||||
int DoRem (ParsePtr p);
|
||||
int DoFlush (ParsePtr p);
|
||||
void DoExit (ParsePtr p);
|
||||
int ParseRem (ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals);
|
||||
int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int jul);
|
||||
int ShouldTriggerReminder (Trigger *t, TimeTrig *tim, int jul, int *err);
|
||||
int DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode);
|
||||
int DoSubstFromString (char const *source, DynamicBuffer *dbuf, int jul, int tim);
|
||||
int ParseLiteralDate (char const **s, int *jul, int *tim);
|
||||
int ParseLiteralTime (char const **s, int *tim);
|
||||
int EvalExpr (char const **e, Value *v, ParsePtr p);
|
||||
int DoCoerce (char type, Value *v);
|
||||
void PrintValue (Value *v, FILE *fp);
|
||||
int CopyValue (Value *dest, const Value *src);
|
||||
int ReadLine (void);
|
||||
int OpenFile (char const *fname);
|
||||
int DoInclude (ParsePtr p);
|
||||
int IncludeFile (char const *fname);
|
||||
int GetAccessDate (char const *file);
|
||||
int SetAccessDate (char const *fname, int jul);
|
||||
int TopLevel (void);
|
||||
int CallFunc (BuiltinFunc *f, int nargs);
|
||||
void InitRemind (int argc, char const *argv[]);
|
||||
void Usage (void);
|
||||
int Julian (int year, int month, int day);
|
||||
void FromJulian (int jul, int *y, int *m, int *d);
|
||||
int ParseChar (ParsePtr p, int *err, int peek);
|
||||
int ParseToken (ParsePtr p, DynamicBuffer *dbuf);
|
||||
int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf);
|
||||
int EvaluateExpr (ParsePtr p, Value *v);
|
||||
int Evaluate (char const **s, Var *locals, ParsePtr p);
|
||||
int FnPopValStack (Value *val);
|
||||
void Eprint (char const *fmt, ...);
|
||||
void OutputLine (FILE *fp);
|
||||
void CreateParser (char const *s, ParsePtr p);
|
||||
void DestroyParser (ParsePtr p);
|
||||
int PushToken (char const *tok, ParsePtr p);
|
||||
long SystemTime (int realtime);
|
||||
int SystemDate (int *y, int *m, int *d);
|
||||
int DoIf (ParsePtr p);
|
||||
int DoElse (ParsePtr p);
|
||||
int DoEndif (ParsePtr p);
|
||||
int DoIfTrig (ParsePtr p);
|
||||
int ShouldIgnoreLine (void);
|
||||
int VerifyEoln (ParsePtr p);
|
||||
int DoDebug (ParsePtr p);
|
||||
int DoBanner (ParsePtr p);
|
||||
int DoRun (ParsePtr p);
|
||||
int DoErrMsg (ParsePtr p);
|
||||
int ClearGlobalOmits (void);
|
||||
int DoClear (ParsePtr p);
|
||||
int DestroyOmitContexts (void);
|
||||
int PushOmitContext (ParsePtr p);
|
||||
int PopOmitContext (ParsePtr p);
|
||||
int IsOmitted (int jul, int localomit, char const *omitfunc, int *omit);
|
||||
int DoOmit (ParsePtr p);
|
||||
int QueueReminder (ParsePtr p, Trigger *trig, TimeTrig *tim, char const *sched);
|
||||
void HandleQueuedReminders (void);
|
||||
char const *FindInitialToken (Token *tok, char const *s);
|
||||
void FindToken (char const *s, Token *tok);
|
||||
void FindNumericToken (char const *s, Token *t);
|
||||
int ComputeTrigger (int today, Trigger *trig, TimeTrig *tim, int *err, int save_in_globals);
|
||||
int ComputeTriggerNoAdjustDuration (int today, Trigger *trig, TimeTrig *tim, int *err, int save_in_globals, int duration_days);
|
||||
int AdjustTriggerForDuration(int today, int r, Trigger *trig, TimeTrig *tim, int save_in_globals);
|
||||
int ComputeScanStart(int today, Trigger *trig, TimeTrig *tt);
|
||||
char *StrnCpy (char *dest, char const *source, int n);
|
||||
int StrMatch (char const *s1, char const *s2, int n);
|
||||
int StrinCmp (char const *s1, char const *s2, int n);
|
||||
char *StrDup (char const *s);
|
||||
int StrCmpi (char const *s1, char const *s2);
|
||||
Var *FindVar (char const *str, int create);
|
||||
int DeleteVar (char const *str);
|
||||
int SetVar (char const *str, Value *val);
|
||||
int GetVarValue (char const *str, Value *val, Var *locals, ParsePtr p);
|
||||
int DoSet (Parser *p);
|
||||
int DoUnset (Parser *p);
|
||||
int DoDump (ParsePtr p);
|
||||
void DumpVarTable (void);
|
||||
void DestroyVars (int all);
|
||||
int PreserveVar (char const *name);
|
||||
int DoPreserve (Parser *p);
|
||||
int DoSatRemind (Trigger *trig, TimeTrig *tt, ParsePtr p);
|
||||
int DoMsgCommand (char const *cmd, char const *msg);
|
||||
int ParseNonSpaceChar (ParsePtr p, int *err, int peek);
|
||||
unsigned int HashVal (char const *str);
|
||||
int DateOK (int y, int m, int d);
|
||||
Operator *FindOperator (char const *name, Operator where[], int num);
|
||||
BuiltinFunc *FindFunc (char const *name, BuiltinFunc where[], int num);
|
||||
int InsertIntoSortBuffer (int jul, int tim, char const *body, int typ, int prio);
|
||||
void IssueSortedReminders (void);
|
||||
int UserFuncExists (char const *fn);
|
||||
void JulToHeb (int jul, int *hy, int *hm, int *hd);
|
||||
int HebNameToNum (char const *mname);
|
||||
char const *HebMonthName (int m, int y);
|
||||
int RoshHashana (int i);
|
||||
long DaysToHebYear (int y);
|
||||
int DaysInHebYear (int y);
|
||||
char const *DaysInHebMonths (int ylen);
|
||||
int HebToJul (int hy, int hm, int hd);
|
||||
int GetValidHebDate (int yin, int min, int din, int adarbehave, int *mout, int *dout, int yahr);
|
||||
int GetNextHebrewDate (int julstart, int hm, int hd, int yahr, int adarbehave, int *ans);
|
||||
int ComputeJahr (int y, int m, int d, int *ans);
|
||||
int GetSysVar (char const *name, Value *val);
|
||||
int SetSysVar (char const *name, Value *val);
|
||||
void DumpSysVarByName (char const *name);
|
||||
int CalcMinsFromUTC (int jul, int tim, int *mins, int *isdst);
|
||||
void FillParagraph (char const *s);
|
||||
void LocalToUTC (int locdate, int loctime, int *utcdate, int *utctime);
|
||||
void UTCToLocal (int utcdate, int utctime, int *locdate, int *loctime);
|
||||
int MoonPhase (int date, int time);
|
||||
void HuntPhase (int startdate, int starttim, int phas, int *date, int *time);
|
||||
int CompareRems (int dat1, int tim1, int prio1, int dat2, int tim2, int prio2, int bydate, int bytime, int byprio, int untimed_first);
|
||||
void SigIntHandler (int d);
|
||||
void GotSigInt (void);
|
||||
void PurgeEchoLine(char const *fmt, ...);
|
||||
void FreeTrig(Trigger *t);
|
||||
void AppendTag(DynamicBuffer *buf, char const *s);
|
||||
char const *SynthesizeTag(void);
|
||||
void ClearLastTriggers(void);
|
||||
void SaveLastTrigger(Trigger const *t);
|
||||
void SaveLastTimeTrig(TimeTrig const *t);
|
||||
void SaveAllTriggerInfo(Trigger const *t, TimeTrig const *tt, int trigdate, int trigtime, int valid);
|
||||
|
||||
int CallUserFunc ARGS ((char *name, int nargs));
|
||||
int DoFset ARGS ((ParsePtr p));
|
||||
void ProduceCalendar ARGS ((void));
|
||||
char *SimpleTime ARGS ((int tim));
|
||||
int DoRem ARGS ((ParsePtr p));
|
||||
int DoFlush ARGS ((ParsePtr p));
|
||||
void DoExit ARGS ((ParsePtr p));
|
||||
int ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim));
|
||||
#ifdef OS2_POPUP
|
||||
int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul,
|
||||
int AsPopUp));
|
||||
#else
|
||||
int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul));
|
||||
#endif
|
||||
int ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul));
|
||||
int DoSubst ARGS ((ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode));
|
||||
int DoSubstFromString ARGS ((char *source, DynamicBuffer *dbuf, int jul, int tim));
|
||||
int EvalExpr ARGS ((char **e, Value *v));
|
||||
int DoCoerce ARGS ((char type, Value *v));
|
||||
void PrintValue ARGS ((Value *v, FILE *fp));
|
||||
int CopyValue ARGS ((Value *dest, const Value *src));
|
||||
int ReadLine ARGS ((void));
|
||||
int OpenFile ARGS ((const char *fname));
|
||||
int PopFile ARGS ((void));
|
||||
int DoInclude ARGS ((ParsePtr p));
|
||||
int IncludeFile ARGS ((const char *fname));
|
||||
int GetAccessDate ARGS ((char *file));
|
||||
int SetAccessDate ARGS ((char *fname, int jul));
|
||||
int TopLevel ARGS ((void));
|
||||
int CallFunc ARGS ((Operator *f, int nargs));
|
||||
void InitRemind ARGS ((int argc, char *argv[]));
|
||||
void Usage ARGS ((void));
|
||||
int main ARGS ((int argc, char *argv[]));
|
||||
int Julian ARGS ((int year, int month, int day));
|
||||
void FromJulian ARGS ((int jul, int *y, int *m, int *d));
|
||||
int ParseChar ARGS ((ParsePtr p, int *err, int peek));
|
||||
int ParseToken ARGS ((ParsePtr p, DynamicBuffer *dbuf));
|
||||
int ParseIdentifier ARGS ((ParsePtr p, DynamicBuffer *dbuf));
|
||||
int EvaluateExpr ARGS ((ParsePtr p, Value *v));
|
||||
int Evaluate ARGS ((char **s, Var *locals));
|
||||
int FnPopValStack ARGS ((Value *val));
|
||||
void Eprint ARGS ((const char *fmt, ...));
|
||||
void OutputLine ARGS ((FILE *fp));
|
||||
void CreateParser ARGS ((char *s, ParsePtr p));
|
||||
void DestroyParser ARGS ((ParsePtr p));
|
||||
int PushToken ARGS ((const char *tok, ParsePtr p));
|
||||
long SystemTime ARGS ((int realtime));
|
||||
int SystemDate ARGS ((int *y, int *m, int *d));
|
||||
int DoIf ARGS ((ParsePtr p));
|
||||
int DoElse ARGS ((ParsePtr p));
|
||||
int DoEndif ARGS ((ParsePtr p));
|
||||
int DoIfTrig ARGS ((ParsePtr p));
|
||||
int ShouldIgnoreLine ARGS ((void));
|
||||
int VerifyEoln ARGS ((ParsePtr p));
|
||||
int DoDebug ARGS ((ParsePtr p));
|
||||
int DoBanner ARGS ((ParsePtr p));
|
||||
int DoRun ARGS ((ParsePtr p));
|
||||
int DoErrMsg ARGS ((ParsePtr p));
|
||||
int ClearGlobalOmits ARGS ((void));
|
||||
int DoClear ARGS ((ParsePtr p));
|
||||
int DestroyOmitContexts ARGS ((void));
|
||||
int PushOmitContext ARGS ((ParsePtr p));
|
||||
int PopOmitContext ARGS ((ParsePtr p));
|
||||
int IsOmitted ARGS ((int jul, int localomit));
|
||||
int DoOmit ARGS ((ParsePtr p));
|
||||
int QueueReminder ARGS ((ParsePtr p, Trigger *trig, TimeTrig *tim, const char *sched));
|
||||
void HandleQueuedReminders ARGS ((void));
|
||||
char *FindInitialToken ARGS ((Token *tok, char *s));
|
||||
void FindToken ARGS ((const char *s, Token *tok));
|
||||
void FindNumericToken ARGS ((const char *s, Token *t));
|
||||
int ComputeTrigger ARGS ((int today, Trigger *trig, int *err));
|
||||
char *StrnCpy ARGS ((char *dest, const char *source, int n));
|
||||
int StrMatch ARGS ((const char *s1, const char *s2, int n));
|
||||
int StrinCmp ARGS ((const char *s1, const char *s2, int n));
|
||||
char *StrDup ARGS ((const char *s));
|
||||
int StrCmpi ARGS ((const char *s1, const char *s2));
|
||||
Var *FindVar ARGS ((const char *str, int create));
|
||||
int DeleteVar ARGS ((const char *str));
|
||||
int SetVar ARGS ((const char *str, Value *val));
|
||||
int GetVarValue ARGS ((const char *str, Value *val, Var *locals));
|
||||
int DoSet ARGS ((Parser *p));
|
||||
int DoUnset ARGS ((Parser *p));
|
||||
int DoDump ARGS ((ParsePtr p));
|
||||
void DumpVarTable ARGS ((void));
|
||||
void DestroyVars ARGS ((int all));
|
||||
int PreserveVar ARGS ((char *name));
|
||||
int DoPreserve ARGS ((Parser *p));
|
||||
int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
|
||||
int DoMsgCommand ARGS ((char *cmd, char *msg));
|
||||
int ParseNonSpaceChar ARGS ((ParsePtr p, int *err, int peek));
|
||||
unsigned int HashVal ARGS ((const char *str));
|
||||
int DateOK ARGS ((int y, int m, int d));
|
||||
Operator *FindFunc ARGS ((char *name, Operator where[], int num));
|
||||
int InsertIntoSortBuffer ARGS ((int jul, int tim, char *body, int typ, int prio));
|
||||
void IssueSortedReminders ARGS ((void));
|
||||
int UserFuncExists ARGS ((char *fn));
|
||||
void JulToHeb ARGS((int jul, int *hy, int *hm, int *hd));
|
||||
int HebNameToNum ARGS((const char *mname));
|
||||
char *HebMonthName ARGS((int m, int y));
|
||||
int RoshHashana ARGS((int i));
|
||||
long DaysToHebYear ARGS((int y));
|
||||
int DaysInHebYear ARGS((int y));
|
||||
char *DaysInHebMonths ARGS((int ylen));
|
||||
int HebToJul ARGS((int hy, int hm, int hd));
|
||||
int GetValidHebDate ARGS((int yin, int min, int din, int adarbehave, int *mout, int *dout, int yahr));
|
||||
int GetNextHebrewDate ARGS((int julstart, int hm, int hd, int yahr, int adarbehave, int *ans));
|
||||
int ComputeJahr ARGS ((int y, int m, int d, int *ans));
|
||||
int GetSysVar ARGS ((const char *name, Value *val));
|
||||
int SetSysVar ARGS ((const char *name, Value *val));
|
||||
void DumpSysVarByName ARGS ((const char *name));
|
||||
int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
|
||||
#ifdef OS2_POPUP
|
||||
void FillParagraph ARGS ((char *s, int AsPopUp));
|
||||
#else
|
||||
void FillParagraph ARGS ((char *s));
|
||||
#endif
|
||||
void LocalToUTC ARGS ((int locdate, int loctime, int *utcdate, int *utctime));
|
||||
void UTCToLocal ARGS ((int utcdate, int utctime, int *locdate, int *loctime));
|
||||
int MoonPhase ARGS ((int date, int time));
|
||||
void HuntPhase ARGS ((int startdate, int starttim, int phas, int *date, int *time));
|
||||
int CompareRems ARGS ((int dat1, int tim1, int prio1, int dat2, int tim2, int prio2, int bydate, int bytime, int byprio));
|
||||
#ifdef __BORLANDC__
|
||||
void __cdecl SigIntHandler ARGS ((int d));
|
||||
#else
|
||||
RETSIGTYPE SigIntHandler ARGS ((int d));
|
||||
#endif
|
||||
void GotSigInt ARGS ((void));
|
||||
|
||||
#if defined(__OS2__)
|
||||
int fork ARGS ((void));
|
||||
#if defined(OS2_POPUP)
|
||||
void StartPopUp ARGS ((void));
|
||||
void EndPopUp ARGS ((void));
|
||||
int PutcPopUp ARGS ((int c));
|
||||
int PutlPopUp ARGS ((char *s));
|
||||
int PutsPopUp ARGS ((char *s));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
int SafePutChar ARGS ((int ch));
|
||||
int SafePutc ARGS ((int ch, FILE *fp));
|
||||
#endif
|
||||
void PerIterationInit(void);
|
||||
char const *Decolorize(int r, int g, int b);
|
||||
char const *Colorize(int r, int g, int b);
|
||||
void PrintJSONString(char const *s);
|
||||
void PrintJSONKeyPairInt(char const *name, int val);
|
||||
void PrintJSONKeyPairString(char const *name, char const *val);
|
||||
void PrintJSONKeyPairDate(char const *name, int jul);
|
||||
void PrintJSONKeyPairDateTime(char const *name, int dt);
|
||||
void PrintJSONKeyPairTime(char const *name, int t);
|
||||
void System(char const *cmd);
|
||||
|
||||
369
src/queue.c
369
src/queue.c
@@ -5,55 +5,31 @@
|
||||
/* Queue up reminders for subsequent execution. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: queue.c,v 1.10 1999-04-05 17:34:55 dfs Exp $";
|
||||
|
||||
/* Solaris needs this to get select() prototype */
|
||||
#ifdef __sun__
|
||||
#define __EXTENSIONS__ 1
|
||||
#undef _POSIX_SOURCE
|
||||
#endif
|
||||
|
||||
/* We only want object code generated if we have queued reminders */
|
||||
#ifdef HAVE_QUEUED
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <sys/select.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__OS2__) || defined(__MSDOS__)
|
||||
#include <io.h>
|
||||
#if defined(__BORLANDC__)
|
||||
#include <dos.h>
|
||||
#endif
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "err.h"
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
|
||||
@@ -63,9 +39,11 @@ typedef struct queuedrem {
|
||||
int typ;
|
||||
int RunDisabled;
|
||||
int ntrig;
|
||||
char *text;
|
||||
char const *text;
|
||||
char passthru[PASSTHRU_LEN+1];
|
||||
char sched[VAR_NAME_LEN+1];
|
||||
char tag[TAG_LEN+1];
|
||||
DynamicBuffer tags;
|
||||
Trigger t;
|
||||
TimeTrig tt;
|
||||
} QueuedRem;
|
||||
|
||||
@@ -75,12 +53,12 @@ static QueuedRem *QueueHead;
|
||||
static time_t FileModTime;
|
||||
static struct stat StatBuf;
|
||||
|
||||
PRIVATE void CheckInitialFile ARGS ((void));
|
||||
PRIVATE int CalculateNextTime ARGS ((QueuedRem *q));
|
||||
PRIVATE QueuedRem *FindNextReminder ARGS ((void));
|
||||
PRIVATE int CalculateNextTimeUsingSched ARGS ((QueuedRem *q));
|
||||
PRIVATE void DaemonWait ARGS ((unsigned int sleeptime));
|
||||
PRIVATE void reread ARGS((void));
|
||||
static void CheckInitialFile (void);
|
||||
static int CalculateNextTime (QueuedRem *q);
|
||||
static QueuedRem *FindNextReminder (void);
|
||||
static int CalculateNextTimeUsingSched (QueuedRem *q);
|
||||
static void DaemonWait (unsigned int sleeptime);
|
||||
static void reread (void);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -90,16 +68,8 @@ PRIVATE void reread ARGS((void));
|
||||
/* enabled. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int QueueReminder(ParsePtr p, Trigger *trig,
|
||||
TimeTrig *tim, const char *sched)
|
||||
#else
|
||||
int QueueReminder(p, trig, tim, sched)
|
||||
ParsePtr p;
|
||||
Trigger *trig,
|
||||
TimeTrig *tim;
|
||||
char *sched;
|
||||
#endif
|
||||
int QueueReminder(ParsePtr p, Trigger *trig,
|
||||
TimeTrig *tim, char const *sched)
|
||||
{
|
||||
QueuedRem *qelem;
|
||||
|
||||
@@ -118,15 +88,22 @@ char *sched;
|
||||
free(qelem);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
NumQueued++;
|
||||
qelem->typ = trig->typ;
|
||||
strcpy(qelem->passthru, trig->passthru);
|
||||
qelem->tt = *tim;
|
||||
qelem->t = *trig;
|
||||
DBufInit(&(qelem->t.tags));
|
||||
qelem->next = QueueHead;
|
||||
qelem->RunDisabled = RunDisabled;
|
||||
qelem->ntrig = 0;
|
||||
strcpy(qelem->sched, sched);
|
||||
strcpy(qelem->tag, trig->tag);
|
||||
DBufInit(&(qelem->tags));
|
||||
DBufPuts(&(qelem->tags), DBufValue(&(trig->tags)));
|
||||
if (SynthesizeTags) {
|
||||
AppendTag(&(qelem->tags), SynthesizeTag());
|
||||
}
|
||||
QueueHead = qelem;
|
||||
NumQueued++;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -137,14 +114,10 @@ char *sched;
|
||||
/* Handle the issuing of queued reminders in the background */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void HandleQueuedReminders(void)
|
||||
#else
|
||||
void HandleQueuedReminders()
|
||||
#endif
|
||||
void HandleQueuedReminders(void)
|
||||
{
|
||||
QueuedRem *q = QueueHead;
|
||||
long TimeToSleep;
|
||||
int TimeToSleep;
|
||||
unsigned SleepTime;
|
||||
Parser p;
|
||||
Trigger trig;
|
||||
@@ -177,20 +150,16 @@ void HandleQueuedReminders()
|
||||
Daemon = 0;
|
||||
} else FileModTime = StatBuf.st_mtime;
|
||||
}
|
||||
|
||||
|
||||
/* Initialize the queue - initialize all the entries time of issue */
|
||||
|
||||
|
||||
while (q) {
|
||||
q->tt.nexttime = (int) (SystemTime(0)/60 - 1);
|
||||
q->tt.nexttime = (int) (SystemTime(1)/60 - 1);
|
||||
q->tt.nexttime = CalculateNextTime(q);
|
||||
q = q->next;
|
||||
}
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
signal(SIGINT, SigIntHandler);
|
||||
#else
|
||||
if (!DontFork || Daemon) signal(SIGINT, SigIntHandler);
|
||||
#endif
|
||||
|
||||
/* Sit in a loop, issuing reminders when necessary */
|
||||
while(1) {
|
||||
@@ -202,18 +171,25 @@ void HandleQueuedReminders()
|
||||
if (Daemon && !q) {
|
||||
if (Daemon < 0) {
|
||||
/* Sleep until midnight */
|
||||
TimeToSleep = (long) 1440*60L - SystemTime(0);
|
||||
TimeToSleep = MINUTES_PER_DAY*60 - SystemTime(1);
|
||||
} else {
|
||||
TimeToSleep = (long) 60*Daemon;
|
||||
TimeToSleep = 60*Daemon;
|
||||
}
|
||||
} else {
|
||||
TimeToSleep = (long) q->tt.nexttime * 60L - SystemTime(0);
|
||||
TimeToSleep = q->tt.nexttime * 60L - SystemTime(1);
|
||||
}
|
||||
|
||||
while (TimeToSleep > 0L) {
|
||||
SleepTime = (unsigned) ((TimeToSleep > 30000L) ? 30000 : TimeToSleep);
|
||||
SleepTime = TimeToSleep;
|
||||
|
||||
if (Daemon > 0 && SleepTime > 60*Daemon) SleepTime = 60*Daemon;
|
||||
if (Daemon > 0 && SleepTime > (unsigned int) 60*Daemon) SleepTime = 60*Daemon;
|
||||
|
||||
/* Wake up once a minute to recalibrate sleep time in
|
||||
case of laptop hibernation */
|
||||
if (Daemon <= 0) {
|
||||
/* Wake up on the next exact minute */
|
||||
SleepTime = 60 - (SystemTime(1)%60);
|
||||
}
|
||||
|
||||
if (Daemon >= 0) {
|
||||
sleep(SleepTime);
|
||||
@@ -221,55 +197,70 @@ void HandleQueuedReminders()
|
||||
DaemonWait(SleepTime);
|
||||
}
|
||||
|
||||
if (Daemon> 0 && SleepTime) CheckInitialFile();
|
||||
/* If not in daemon mode and day has rolled around,
|
||||
exit -- not much we can do. */
|
||||
if (!Daemon) {
|
||||
int y, m, d;
|
||||
if (RealToday != SystemDate(&y, &m, &d)) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (Daemon > 0 && SleepTime) CheckInitialFile();
|
||||
|
||||
if (Daemon && !q) {
|
||||
if (Daemon < 0) {
|
||||
/* Sleep until midnight */
|
||||
TimeToSleep = (long) 1440*60L - SystemTime(0);
|
||||
TimeToSleep = MINUTES_PER_DAY*60 - SystemTime(1);
|
||||
} else {
|
||||
TimeToSleep = (long) 60*Daemon;
|
||||
TimeToSleep = 60*Daemon;
|
||||
}
|
||||
} else {
|
||||
TimeToSleep = (long) q->tt.nexttime * 60L - SystemTime(0);
|
||||
TimeToSleep = q->tt.nexttime * 60L - SystemTime(1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Trigger the reminder */
|
||||
CreateParser(q->text, &p);
|
||||
trig.typ = q->typ;
|
||||
RunDisabled = q->RunDisabled;
|
||||
if (Daemon < 0) {
|
||||
printf("NOTE reminder %s ",
|
||||
SimpleTime(q->tt.ttime));
|
||||
printf("%s ", SimpleTime(SystemTime(0)/60));
|
||||
if (!*q->tag) {
|
||||
printf("*");
|
||||
} else {
|
||||
printf("%s", q->tag);
|
||||
/* Do NOT trigger the reminder if tt.nexttime is more than a
|
||||
minute in the past. This can happen if the clock is
|
||||
changed or a laptop awakes from hibernation.
|
||||
However, DO triger if tt.nexttime == tt.ttime so all
|
||||
queued reminders are triggered at least once. */
|
||||
if ((SystemTime(1) - (q->tt.nexttime * 60) <= 60) ||
|
||||
(q->tt.nexttime == q->tt.ttime)) {
|
||||
/* Trigger the reminder */
|
||||
CreateParser(q->text, &p);
|
||||
trig.typ = q->typ;
|
||||
strcpy(trig.passthru, q->passthru);
|
||||
RunDisabled = q->RunDisabled;
|
||||
if (Daemon < 0) {
|
||||
printf("NOTE reminder %s",
|
||||
SimpleTime(q->tt.ttime));
|
||||
printf("%s", SimpleTime(SystemTime(1)/60));
|
||||
if (!*DBufValue(&q->tags)) {
|
||||
printf("*\n");
|
||||
} else {
|
||||
printf("%s\n", DBufValue(&(q->tags)));
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
/* Set up global variables so some functions like trigdate()
|
||||
and trigtime() work correctly */
|
||||
SaveAllTriggerInfo(&(q->t), &(q->tt), JulianToday, q->tt.ttime, 1);
|
||||
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
|
||||
if (Daemon < 0) {
|
||||
printf("NOTE endreminder\n");
|
||||
}
|
||||
fflush(stdout);
|
||||
DestroyParser(&p);
|
||||
}
|
||||
#ifdef OS2_POPUP
|
||||
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday, 1);
|
||||
#else
|
||||
(void) TriggerReminder(&p, &trig, &q->tt, JulianToday);
|
||||
#endif
|
||||
if (Daemon < 0) {
|
||||
printf("NOTE endreminder\n");
|
||||
}
|
||||
fflush(stdout);
|
||||
|
||||
|
||||
/* Calculate the next trigger time */
|
||||
q->tt.nexttime = CalculateNextTime(q);
|
||||
}
|
||||
#ifdef __BORLANDC__
|
||||
signal(SIGINT, SIG_DFL);
|
||||
#endif
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -282,12 +273,7 @@ void HandleQueuedReminders()
|
||||
/* fails, revert to AT with delta and rep. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int CalculateNextTime(QueuedRem *q)
|
||||
#else
|
||||
static int CalculateNextTime(q)
|
||||
QueuedRem *q;
|
||||
#endif
|
||||
static int CalculateNextTime(QueuedRem *q)
|
||||
{
|
||||
int tim = q->tt.ttime;
|
||||
int rep = q->tt.rep;
|
||||
@@ -301,8 +287,13 @@ QueuedRem *q;
|
||||
r = CalculateNextTimeUsingSched(q);
|
||||
if (r != NO_TIME) return r;
|
||||
}
|
||||
if (delta == NO_DELTA)
|
||||
if (tim < curtime) return NO_TIME; else return tim;
|
||||
if (delta == NO_DELTA) {
|
||||
if (tim < curtime) {
|
||||
return NO_TIME;
|
||||
} else {
|
||||
return tim;
|
||||
}
|
||||
}
|
||||
|
||||
tim -= delta;
|
||||
if (rep == NO_REP) rep = delta;
|
||||
@@ -319,11 +310,7 @@ QueuedRem *q;
|
||||
/* Find the next reminder to trigger */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE QueuedRem *FindNextReminder(void)
|
||||
#else
|
||||
static QueuedRem *FindNextReminder()
|
||||
#endif
|
||||
static QueuedRem *FindNextReminder(void)
|
||||
{
|
||||
QueuedRem *q = QueueHead;
|
||||
QueuedRem *ans = NULL;
|
||||
@@ -333,12 +320,12 @@ static QueuedRem *FindNextReminder()
|
||||
if (!ans) ans = q;
|
||||
else if (q->tt.nexttime < ans->tt.nexttime) ans = q;
|
||||
}
|
||||
|
||||
|
||||
q = q->next;
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -348,11 +335,7 @@ static QueuedRem *FindNextReminder()
|
||||
/* This will be necessary for OS/2 multithreaded. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
void GotSigInt(void)
|
||||
#else
|
||||
void GotSigInt()
|
||||
#endif
|
||||
{
|
||||
QueuedRem *q = QueueHead;
|
||||
|
||||
@@ -361,13 +344,16 @@ void GotSigInt()
|
||||
while (q) {
|
||||
if (q->tt.nexttime != NO_TIME) {
|
||||
printf("Trigger: %02d%c%02d Activate: %02d%c%02d Rep: %d Delta: %d Sched: %s",
|
||||
q->tt.ttime / 60, TIMESEP, q->tt.ttime % 60,
|
||||
q->tt.nexttime / 60, TIMESEP, q->tt.nexttime % 60,
|
||||
q->tt.ttime / 60, TimeSep, q->tt.ttime % 60,
|
||||
q->tt.nexttime / 60, TimeSep, q->tt.nexttime % 60,
|
||||
q->tt.rep, q->tt.delta, q->sched);
|
||||
if (*q->sched) printf("(%d)", q->ntrig+1);
|
||||
printf("%s", NL);
|
||||
printf("Text: %s %s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
|
||||
((q->typ == MSF_TYPE) ? "MSF" :"RUN")),
|
||||
printf("Text: %s %s%s%s%s%s", ((q->typ == MSG_TYPE) ? "MSG" :
|
||||
((q->typ == MSF_TYPE) ? "MSF" :
|
||||
((q->typ == RUN_TYPE) ? "RUN" : "SPECIAL"))),
|
||||
q->passthru,
|
||||
(*(q->passthru)) ? " " : "",
|
||||
q->text,
|
||||
NL, NL);
|
||||
}
|
||||
@@ -384,11 +370,7 @@ void GotSigInt()
|
||||
/* daemon. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void CheckInitialFile(void)
|
||||
#else
|
||||
static void CheckInitialFile()
|
||||
#endif
|
||||
static void CheckInitialFile(void)
|
||||
{
|
||||
/* If date has rolled around, or file has changed, spawn a new version. */
|
||||
time_t tim = FileModTime;
|
||||
@@ -408,17 +390,12 @@ static void CheckInitialFile()
|
||||
/* Call the scheduling function. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int CalculateNextTimeUsingSched(QueuedRem *q)
|
||||
#else
|
||||
static int CalculateNextTimeUsingSched(q)
|
||||
QueuedRem *q;
|
||||
#endif
|
||||
static int CalculateNextTimeUsingSched(QueuedRem *q)
|
||||
{
|
||||
/* Use LineBuffer for temp. string storage. */
|
||||
int r;
|
||||
Value v;
|
||||
char *s;
|
||||
char const *s;
|
||||
int LastTime = -1;
|
||||
int ThisTime;
|
||||
|
||||
@@ -433,16 +410,20 @@ QueuedRem *q;
|
||||
char exprBuf[VAR_NAME_LEN+32];
|
||||
sprintf(exprBuf, "%s(%d)", q->sched, q->ntrig);
|
||||
s = exprBuf;
|
||||
r = EvalExpr(&s, &v);
|
||||
r = EvalExpr(&s, &v, NULL);
|
||||
if (r) {
|
||||
q->sched[0] = 0;
|
||||
return NO_TIME;
|
||||
}
|
||||
if (v.type == TIM_TYPE) {
|
||||
if (v.type == TIME_TYPE) {
|
||||
ThisTime = v.v.val;
|
||||
} else if (v.type == INT_TYPE) {
|
||||
if (v.v.val > 0)
|
||||
ThisTime = q->tt.nexttime + v.v.val;
|
||||
if (v.v.val > 0)
|
||||
if (LastTime >= 0) {
|
||||
ThisTime = LastTime + v.v.val;
|
||||
} else {
|
||||
ThisTime = q->tt.nexttime + v.v.val;
|
||||
}
|
||||
else
|
||||
ThisTime = q->tt.ttime + v.v.val;
|
||||
|
||||
@@ -452,7 +433,11 @@ QueuedRem *q;
|
||||
return NO_TIME;
|
||||
}
|
||||
if (ThisTime < 0) ThisTime = 0; /* Can't be less than 00:00 */
|
||||
if (ThisTime > 1439) ThisTime = 1439; /* or greater than 11:59 */
|
||||
if (ThisTime > (MINUTES_PER_DAY-1)) ThisTime = (MINUTES_PER_DAY-1); /* or greater than 11:59 */
|
||||
if (DebugFlag & DB_PRTEXPR) {
|
||||
fprintf(ErrFp, "SCHED: Considering %02d%c%02d\n",
|
||||
ThisTime / 60, TimeSep, ThisTime % 60);
|
||||
}
|
||||
if (ThisTime > q->tt.nexttime) return ThisTime;
|
||||
if (ThisTime <= LastTime) {
|
||||
q->sched[0] = 0;
|
||||
@@ -463,6 +448,70 @@ QueuedRem *q;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dump the queue in JSON format */
|
||||
static void
|
||||
json_queue(QueuedRem const *q)
|
||||
{
|
||||
int done = 0;
|
||||
printf("[");
|
||||
while(q) {
|
||||
if (q->tt.nexttime == NO_TIME) {
|
||||
q = q->next;
|
||||
continue;
|
||||
}
|
||||
if (done) {
|
||||
printf(",");
|
||||
}
|
||||
done = 1;
|
||||
printf("{");
|
||||
switch(q->typ) {
|
||||
case NO_TYPE: PrintJSONKeyPairString("type", "NO_TYPE"); break;
|
||||
case MSG_TYPE: PrintJSONKeyPairString("type", "MSG_TYPE"); break;
|
||||
case RUN_TYPE: PrintJSONKeyPairString("type", "RUN_TYPE"); break;
|
||||
case CAL_TYPE: PrintJSONKeyPairString("type", "CAL_TYPE"); break;
|
||||
case SAT_TYPE: PrintJSONKeyPairString("type", "SAT_TYPE"); break;
|
||||
case PS_TYPE: PrintJSONKeyPairString("type", "PS_TYPE"); break;
|
||||
case PSF_TYPE: PrintJSONKeyPairString("type", "PSF_TYPE"); break;
|
||||
case MSF_TYPE: PrintJSONKeyPairString("type", "MSF_TYPE"); break;
|
||||
case PASSTHRU_TYPE: PrintJSONKeyPairString("type", "PASSTHRU_TYPE"); break;
|
||||
default: PrintJSONKeyPairString("type", "?"); break;
|
||||
}
|
||||
PrintJSONKeyPairInt("rundisabled", q->RunDisabled);
|
||||
PrintJSONKeyPairInt("ntrig", q->ntrig);
|
||||
PrintJSONKeyPairTime("ttime", q->tt.ttime);
|
||||
PrintJSONKeyPairTime("nextttime", q->tt.nexttime);
|
||||
PrintJSONKeyPairInt("delta", q->tt.delta);
|
||||
if (q->tt.rep != NO_TIME) {
|
||||
PrintJSONKeyPairInt("rep", q->tt.rep);
|
||||
}
|
||||
if (q->tt.duration != NO_TIME) {
|
||||
PrintJSONKeyPairInt("duration", q->tt.duration);
|
||||
}
|
||||
if (q->passthru[0]) {
|
||||
PrintJSONKeyPairString("passthru", q->passthru);
|
||||
}
|
||||
if (q->sched[0]) {
|
||||
PrintJSONKeyPairString("sched", q->sched);
|
||||
}
|
||||
if (DBufLen(&(q->tags))) {
|
||||
PrintJSONKeyPairString("tags", DBufValue(&(q->tags)));
|
||||
}
|
||||
|
||||
/* Last one is a special case - no trailing comma */
|
||||
printf("\"");
|
||||
PrintJSONString("body");
|
||||
printf("\":\"");
|
||||
if (q->text) {
|
||||
PrintJSONString(q->text);
|
||||
} else {
|
||||
PrintJSONString("");
|
||||
}
|
||||
printf("\"}");
|
||||
q = q->next;
|
||||
}
|
||||
printf("]\n");
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* DaemonWait */
|
||||
@@ -470,12 +519,7 @@ QueuedRem *q;
|
||||
/* Sleep or read command from stdin in "daemon -1" mode */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void DaemonWait(unsigned int sleeptime)
|
||||
#else
|
||||
static DaemonWait(sleeptime)
|
||||
unsigned int sleeptime
|
||||
#endif
|
||||
static void DaemonWait(unsigned int sleeptime)
|
||||
{
|
||||
fd_set readSet;
|
||||
struct timeval timeout;
|
||||
@@ -525,6 +569,38 @@ unsigned int sleeptime
|
||||
}
|
||||
printf("NOTE queued %d\n", nqueued);
|
||||
fflush(stdout);
|
||||
} else if (!strcmp(cmdLine, "QUEUE\n")) {
|
||||
printf("NOTE queue\n");
|
||||
QueuedRem *q = QueueHead;
|
||||
while (q) {
|
||||
if (q->tt.nexttime != NO_TIME) {
|
||||
switch (q->typ) {
|
||||
case NO_TYPE: printf("NO_TYPE "); break;
|
||||
case MSG_TYPE: printf("MSG_TYPE "); break;
|
||||
case RUN_TYPE: printf("RUN_TYPE "); break;
|
||||
case CAL_TYPE: printf("CAL_TYPE "); break;
|
||||
case SAT_TYPE: printf("SAT_TYPE "); break;
|
||||
case PS_TYPE: printf("PS_TYPE "); break;
|
||||
case PSF_TYPE: printf("PSF_TYPE "); break;
|
||||
case MSF_TYPE: printf("MSF_TYPE "); break;
|
||||
case PASSTHRU_TYPE: printf("PASSTHRU_TYPE "); break;
|
||||
default: printf("? "); break;
|
||||
}
|
||||
printf("RunDisabled=%d ntrig=%d ttime=%02d:%02d nexttime=%02d:%02d delta=%d rep=%d duration=%d ", q->RunDisabled, q->ntrig, q->tt.ttime/60, q->tt.ttime % 60, q->tt.nexttime / 60, q->tt.nexttime % 60, q->tt.delta, (q->tt.rep != NO_TIME ? q->tt.rep : -1), (q->tt.duration != NO_TIME ? q->tt.duration : -1));
|
||||
printf("%s %s %s\n",
|
||||
(q->passthru[0] ? q->passthru : "*"),
|
||||
(q->sched[0] ? q->sched : "*"),
|
||||
q->text ? q->text : "NULL");
|
||||
}
|
||||
q = q->next;
|
||||
}
|
||||
printf("NOTE endqueue\n");
|
||||
fflush(stdout);
|
||||
} else if (!strcmp(cmdLine, "JSONQUEUE\n")) {
|
||||
printf("NOTE JSONQUEUE\n");
|
||||
json_queue(QueueHead);
|
||||
printf("NOTE ENDJSONQUEUE\n");
|
||||
fflush(stdout);
|
||||
} else if (!strcmp(cmdLine, "REREAD\n")) {
|
||||
printf("NOTE reread\n");
|
||||
fflush(stdout);
|
||||
@@ -542,13 +618,8 @@ unsigned int sleeptime
|
||||
/* Restarts Remind if date rolls over or REREAD cmd received */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void reread(void)
|
||||
#else
|
||||
static reread()
|
||||
#endif
|
||||
static void reread(void)
|
||||
{
|
||||
execvp(ArgV[0], ArgV);
|
||||
execvp(ArgV[0], (char **) ArgV);
|
||||
}
|
||||
|
||||
#endif /* HAVE_QUEUED from way at the top */
|
||||
|
||||
721
src/rem2ps.c
721
src/rem2ps.c
File diff suppressed because it is too large
Load Diff
32
src/rem2ps.h
32
src/rem2ps.h
@@ -5,18 +5,15 @@
|
||||
/* Define the PostScript prologue */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2021 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: rem2ps.h,v 1.3 1999-04-05 17:34:56 dfs Exp $ */
|
||||
|
||||
char *PSProlog1[] =
|
||||
{
|
||||
"% This file was produced by Remind and Rem2PS, written by",
|
||||
"% David F. Skoll.",
|
||||
"% Remind and Rem2PS are Copyright 1992-1997 David F. Skoll.",
|
||||
"% Dianne Skoll.",
|
||||
"% Remind and Rem2PS are Copyright 1992-2021 Dianne Skoll.",
|
||||
"/ISOLatin1Encoding where { pop save true }{ false } ifelse",
|
||||
" /ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus",
|
||||
" StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute",
|
||||
@@ -178,16 +175,31 @@ char *PSProlog2[] =
|
||||
" /width exch def",
|
||||
" /xleft exch def",
|
||||
" /curline () def",
|
||||
" % The last two strings in the word array are actually the PostScript",
|
||||
" % code to execute before and after the entry is printed.",
|
||||
" dup dup",
|
||||
" length 1 sub",
|
||||
" get",
|
||||
" exch",
|
||||
" dup dup",
|
||||
" length 2 sub",
|
||||
" get",
|
||||
" dup length 0 gt",
|
||||
" {cvx exec} {pop} ifelse",
|
||||
" dup length 2 sub 0 exch getinterval",
|
||||
" {EnterOneWord} forall",
|
||||
" FinishFormatting",
|
||||
" dup length 0 gt",
|
||||
" {cvx exec} {pop} ifelse",
|
||||
" y",
|
||||
"} bind def",
|
||||
"% Variables for calendar boxes:",
|
||||
"% ytop - current top position",
|
||||
"% ymin - minimum y reached for current row",
|
||||
"% border ytop xleft width textarray daynum DoCalBox ybot",
|
||||
"% border ytop xleft width textarray daynum onright DoCalBox ybot",
|
||||
"% Do the entries for one calendar box. Returns lowest Y-coordinate reached",
|
||||
"/DoCalBox {",
|
||||
" /onright exch def",
|
||||
" /daynum exch def",
|
||||
" /textarr exch def",
|
||||
" /wid exch def",
|
||||
@@ -196,8 +208,10 @@ char *PSProlog2[] =
|
||||
" /border exch def",
|
||||
"% Do the day number",
|
||||
" /DayFont findfont DaySize scalefont setfont",
|
||||
" xl wid add border sub daynum stringwidth pop sub",
|
||||
" yt border sub DaySize sub moveto daynum show",
|
||||
" onright 1 eq",
|
||||
" {xl wid add border sub daynum stringwidth pop sub yt border sub DaySize sub moveto daynum show}",
|
||||
" {xl border add yt border sub DaySize sub moveto daynum show}",
|
||||
" ifelse",
|
||||
"% Do the text entries. Precharge the stack with current y pos.",
|
||||
" /ycur yt border sub DaySize sub DaySize sub 2 add def",
|
||||
" /EntryFont findfont EntrySize scalefont setfont",
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
NAME WINDOWCOMPAT NEWFILES
|
||||
@@ -1,94 +0,0 @@
|
||||
# $Id: smakefile,v 1.1 1998-01-15 02:50:36 dfs Exp $
|
||||
# Makefile for REMIND, suitable for SAS/C 6.50 under AmigaDOS
|
||||
# English version
|
||||
# THIS IS OUT OF DATE!
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# THINGS FOR YOU TO EDIT START BELOW
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Uncomment the next line if you are running on a SYSV system
|
||||
# SYSV= -DSYSV
|
||||
|
||||
# Uncomment the next line if you are running under UNIX (including SYSV!)
|
||||
#UNIX= -DUNIX
|
||||
|
||||
# Uncomment the next lines if you want to use gcc instead of default compiler
|
||||
# NOTE: Tempting as it may be, if you use 'cc' for the C compiler, do not
|
||||
# use 'ld' for the linker. It will probably work much better if you use
|
||||
# LD= cc rather than LD= ld.
|
||||
CC= SC
|
||||
LD= SC
|
||||
|
||||
# Put any additional flags for the C compiler or linker here - if you
|
||||
# are not using gcc, you probably want to remove '-ansi'.
|
||||
CFLAGS= OPT NOSTKCHK NOSINT MATH=IEEE
|
||||
CDEFS=
|
||||
LDFLAGS= LINK
|
||||
|
||||
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
|
||||
lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
|
||||
|
||||
STDHDRS= config.h types.h protos.h globals.h err.h lang.h
|
||||
|
||||
LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
|
||||
|
||||
SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c hbcal.c \
|
||||
init.c main.c moon.c omit.c sort.c queue.c token.c trigger.c userfns.c \
|
||||
utils.c var.c amiga.c
|
||||
|
||||
OBJS= calendar.o dorem.o dosubst.o expr.o files.o funcs.o globals.o hbcal.o \
|
||||
init.o main.o moon.o omit.o sort.o queue.o token.o trigger.o userfns.o \
|
||||
utils.o var.o amiga.o
|
||||
|
||||
MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
|
||||
remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
|
||||
makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
|
||||
defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1 \
|
||||
tstlang.rem README.BCC lnk.bcc makefile.bcc os2func.c \
|
||||
test-rem.bat test-rem.cmd test1.cmp test2.cmp
|
||||
|
||||
|
||||
all: remind rem2ps
|
||||
|
||||
.c.o:
|
||||
$(CC) $(UNIX) $(SYSV) $(CFLAGS) $(CDEFS) $*.c
|
||||
|
||||
rem2ps: rem2ps.o
|
||||
$(LD) MATH=IEEE $(LDFLAGS) PNAME=rem2ps rem2ps.o
|
||||
|
||||
remind: $(OBJS)
|
||||
$(LD) MATH=IEEE $(LDFLAGS) PNAME=remind $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -f *.o *~ core *.bak
|
||||
|
||||
clobber:
|
||||
rm -f *.o *~ remind rem2ps test.out core *.bak
|
||||
|
||||
test: remind
|
||||
sh test-rem
|
||||
|
||||
rem2ps.o: rem2ps.c rem2ps.h lang.h config.h
|
||||
calendar.o: calendar.c $(STDHDRS) expr.h
|
||||
dorem.o: dorem.c $(STDHDRS) expr.h
|
||||
dosubst.o: dosubst.c $(STDHDRS) $(LANGHDRS)
|
||||
expr.o: expr.c $(STDHDRS) expr.h
|
||||
files.o: files.c $(STDHDRS)
|
||||
funcs.o: funcs.c $(STDHDRS) expr.h version.h
|
||||
globals.o: globals.c config.h types.h globals.h err.h lang.h $(LANGHDRS)
|
||||
hbcal.o: hbcal.c $(STDHDRS)
|
||||
init.o: init.c $(STDHDRS) expr.h version.h lang.h $(LANGHDRS)
|
||||
main.o: main.c $(STDHDRS) expr.h
|
||||
moon.o: moon.c $(STDHDRS)
|
||||
omit.o: omit.c $(STDHDRS)
|
||||
sort.o: sort.c $(STDHDRS)
|
||||
queue.o: queue.c $(STDHDRS)
|
||||
token.o: token.c $(STDHDRS)
|
||||
trigger.o: trigger.c $(STDHDRS) expr.h
|
||||
userfns.o: userfns.c $(STDHDRS) expr.h
|
||||
utils.o: utils.c $(STDHDRS)
|
||||
var.o: var.c $(STDHDRS) expr.h
|
||||
|
||||
amiga.o: amiga.c
|
||||
$(CC) OBJNAME=amiga.o $(CFLAGS) amiga.c
|
||||
91
src/sort.c
91
src/sort.c
@@ -5,25 +5,16 @@
|
||||
/* Routines for sorting reminders by trigger date */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: sort.c,v 1.5 1999-04-05 17:34:56 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "protos.h"
|
||||
#include "expr.h"
|
||||
@@ -33,7 +24,7 @@ static char const RCSID[] = "$Id: sort.c,v 1.5 1999-04-05 17:34:56 dfs Exp $";
|
||||
/* The structure of a sorted entry */
|
||||
typedef struct sortrem {
|
||||
struct sortrem *next;
|
||||
char *text;
|
||||
char const *text;
|
||||
int trigdate;
|
||||
int trigtime;
|
||||
int typ;
|
||||
@@ -43,8 +34,8 @@ typedef struct sortrem {
|
||||
/* The sorted reminder queue */
|
||||
static Sortrem *SortedQueue = (Sortrem *) NULL;
|
||||
|
||||
PRIVATE Sortrem *MakeSortRem ARGS ((int jul, int tim, char *body, int typ, int prio));
|
||||
PRIVATE void IssueSortBanner ARGS ((int jul));
|
||||
static Sortrem *MakeSortRem (int jul, int tim, char const *body, int typ, int prio);
|
||||
static void IssueSortBanner (int jul);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -53,14 +44,7 @@ PRIVATE void IssueSortBanner ARGS ((int jul));
|
||||
/* Create a new Sortrem entry - return NULL on failure. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE Sortrem *MakeSortRem(int jul, int tim, char *body, int typ, int prio)
|
||||
#else
|
||||
static Sortrem *MakeSortRem(jul, tim, body, typ, prio)
|
||||
int jul, tim;
|
||||
char *body;
|
||||
int typ, prio;
|
||||
#endif
|
||||
static Sortrem *MakeSortRem(int jul, int tim, char const *body, int typ, int prio)
|
||||
{
|
||||
Sortrem *new = NEW(Sortrem);
|
||||
if (!new) return NULL;
|
||||
@@ -86,15 +70,7 @@ int typ, prio;
|
||||
/* Insert a reminder into the sort buffer */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int InsertIntoSortBuffer(int jul, int tim, char *body, int typ, int prio)
|
||||
#else
|
||||
int InsertIntoSortBuffer(jul, tim, body, typ, prio)
|
||||
int jul;
|
||||
int tim;
|
||||
char *body;
|
||||
int typ, prio;
|
||||
#endif
|
||||
int InsertIntoSortBuffer(int jul, int tim, char const *body, int typ, int prio)
|
||||
{
|
||||
Sortrem *new = MakeSortRem(jul, tim, body, typ, prio);
|
||||
Sortrem *cur = SortedQueue, *prev = NULL;
|
||||
@@ -106,6 +82,7 @@ int typ, prio;
|
||||
SortByDate = 0;
|
||||
SortByTime = 0;
|
||||
SortByPrio = 0;
|
||||
UntimedBeforeTimed = 0;
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
@@ -117,8 +94,8 @@ int typ, prio;
|
||||
while (cur) {
|
||||
ShouldGoAfter = CompareRems(new->trigdate, new->trigtime, new->priority,
|
||||
cur->trigdate, cur->trigtime, cur->priority,
|
||||
SortByDate, SortByTime, SortByPrio);
|
||||
|
||||
SortByDate, SortByTime, SortByPrio, UntimedBeforeTimed);
|
||||
|
||||
if (ShouldGoAfter <= 0) {
|
||||
prev = cur;
|
||||
cur = cur->next;
|
||||
@@ -147,11 +124,7 @@ int typ, prio;
|
||||
/* Issue all of the sorted reminders and free memory. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void IssueSortedReminders(void)
|
||||
#else
|
||||
void IssueSortedReminders()
|
||||
#endif
|
||||
void IssueSortedReminders(void)
|
||||
{
|
||||
Sortrem *cur = SortedQueue;
|
||||
Sortrem *next;
|
||||
@@ -173,19 +146,15 @@ void IssueSortedReminders()
|
||||
break;
|
||||
|
||||
case MSF_TYPE:
|
||||
#ifdef OS2_POPUP
|
||||
FillParagraph(cur->text, 0);
|
||||
#else
|
||||
FillParagraph(cur->text);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case RUN_TYPE:
|
||||
system(cur->text);
|
||||
System(cur->text);
|
||||
break;
|
||||
}
|
||||
|
||||
free(cur->text);
|
||||
free((char *) cur->text);
|
||||
free(cur);
|
||||
cur = next;
|
||||
}
|
||||
@@ -199,24 +168,19 @@ void IssueSortedReminders()
|
||||
/* defined to take one argument. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE void IssueSortBanner(int jul)
|
||||
#else
|
||||
static void IssueSortBanner(jul)
|
||||
int jul;
|
||||
#endif
|
||||
static void IssueSortBanner(int jul)
|
||||
{
|
||||
char BanExpr[64];
|
||||
int y, m, d;
|
||||
Value v;
|
||||
char *s = BanExpr;
|
||||
char const *s = BanExpr;
|
||||
DynamicBuffer buf;
|
||||
|
||||
if (UserFuncExists("sortbanner") != 1) return;
|
||||
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
sprintf(BanExpr, "sortbanner('%04d/%02d/%02d')", y, m+1, d);
|
||||
y = EvalExpr(&s, &v);
|
||||
y = EvalExpr(&s, &v, NULL);
|
||||
if (y) return;
|
||||
if (DoCoerce(STR_TYPE, &v)) return;
|
||||
DBufInit(&buf);
|
||||
@@ -237,26 +201,29 @@ int jul;
|
||||
/* sorting direction by date and time, resp. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC int CompareRems(int dat1, int tim1, int prio1,
|
||||
int dat2, int tim2, int prio2,
|
||||
int bydate, int bytime, int byprio)
|
||||
#else
|
||||
int CompareRems(dat1, tim1, prio1, dat2, tim2, prio2, bydate, bytime, byprio)
|
||||
int dat1, tim1, prio1, dat2, tim2, prio2, bydate, bytime, byprio;
|
||||
#endif
|
||||
int CompareRems(int dat1, int tim1, int prio1,
|
||||
int dat2, int tim2, int prio2,
|
||||
int bydate, int bytime, int byprio,
|
||||
int untimed_first)
|
||||
{
|
||||
int dafter, tafter, pafter;
|
||||
int dafter, tafter, pafter, uafter;
|
||||
|
||||
dafter = (bydate != SORT_DESCEND) ? 1 : -1;
|
||||
tafter = (bytime != SORT_DESCEND) ? 1 : -1;
|
||||
pafter = (byprio != SORT_DESCEND) ? 1 : -1;
|
||||
uafter = (untimed_first) ? -1 : 1;
|
||||
|
||||
if (dat1 < dat2) return dafter;
|
||||
if (dat1 > dat2) return -dafter;
|
||||
|
||||
if (tim1 == NO_TIME && tim2 != NO_TIME) return -1;
|
||||
if (tim1 != NO_TIME && tim2 == NO_TIME) return 1;
|
||||
if (tim1 == NO_TIME && tim2 != NO_TIME) {
|
||||
return -uafter;
|
||||
}
|
||||
|
||||
if (tim1 != NO_TIME && tim2 == NO_TIME) {
|
||||
return uafter;
|
||||
}
|
||||
|
||||
if (tim1 < tim2) return tafter;
|
||||
if (tim1 > tim2) return -tafter;
|
||||
|
||||
|
||||
11
src/test-all-languages.sh
Executable file
11
src/test-all-languages.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# Make sure Remind compiles with all supported languages; show
|
||||
# tstlang.rem output for each language.
|
||||
|
||||
ALL=`grep ^#define lang.h | grep -v '#define LANG' | awk '{print $2}'`
|
||||
|
||||
for i in $ALL ; do
|
||||
make clean all LANGDEF=-DLANG=$i || exit 1
|
||||
./remind -q -r ../tests/tstlang.rem
|
||||
done
|
||||
exit 0
|
||||
187
src/token.c
187
src/token.c
@@ -6,26 +6,17 @@
|
||||
/* classifying the tokens parsed. */
|
||||
/* */
|
||||
/* This file is part of REMIND. */
|
||||
/* Copyright (C) 1992-1998 by David F. Skoll */
|
||||
/* Copyright (C) 1999 by Roaring Penguin Software Inc. */
|
||||
/* Copyright (C) 1992-2020 by Dianne Skoll */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: token.c,v 1.8 1999-04-05 17:34:57 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "globals.h"
|
||||
#include "protos.h"
|
||||
@@ -42,70 +33,72 @@ while (isdigit(*(string))) { \
|
||||
string++; \
|
||||
}
|
||||
|
||||
#define UPPER(c) (islower(c) ? toupper(c) : c)
|
||||
|
||||
/* The big array holding all recognized (literal) tokens in reminder file.
|
||||
Keep this array sorted, or software will not work. */
|
||||
Token TokArray[] = {
|
||||
/* NAME MINLEN TYPE VALUE */
|
||||
|
||||
{ "after", 3, T_Skip, AFTER_SKIP },
|
||||
{ "after", 3, T_Skip, AFTER_SKIP },
|
||||
{ "april", 3, T_Month, 3 },
|
||||
{ "at", 2, T_At, 0 },
|
||||
{ "august", 3, T_Month, 7 },
|
||||
{ "banner", 3, T_Banner, 0 },
|
||||
{ "before", 3, T_Skip, BEFORE_SKIP },
|
||||
{ "cal", 3, T_RemType, CAL_TYPE },
|
||||
{ "before", 3, T_Skip, BEFORE_SKIP },
|
||||
{ "cal", 3, T_RemType, CAL_TYPE },
|
||||
{ "clear-omit-context", 5, T_Clr, 0 },
|
||||
{ "debug", 5, T_Debug, 0 },
|
||||
{ "december", 3, T_Month, 11 },
|
||||
{ "dumpvars", 4, T_Dumpvars, 0 },
|
||||
{ "duration", 3, T_Duration, 0 },
|
||||
{ "else", 4, T_Else, 0 },
|
||||
{ "endif", 5, T_EndIf, 0 },
|
||||
{ "else", 4, T_Else, 0 },
|
||||
{ "endif", 5, T_EndIf, 0 },
|
||||
{ "errmsg", 6, T_ErrMsg, 0 },
|
||||
{ "exit", 4, T_Exit, 0 },
|
||||
{ "february", 3, T_Month, 1 },
|
||||
{ "february", 3, T_Month, 1 },
|
||||
{ "flush", 5, T_Flush, 0 },
|
||||
{ "friday", 3, T_WkDay, 4 },
|
||||
{ "from", 4, T_Scanfrom, FROM_TYPE },
|
||||
{ "fset", 4, T_Fset, 0 },
|
||||
{ "if", 2, T_If, 0 },
|
||||
{ "iftrig", 6, T_IfTrig, 0 },
|
||||
{ "include", 3, T_Include, 0 },
|
||||
{ "january", 3, T_Month, 0 },
|
||||
{ "include", 3, T_Include, 0 },
|
||||
{ "january", 3, T_Month, 0 },
|
||||
{ "july", 3, T_Month, 6 },
|
||||
{ "june", 3, T_Month, 5 },
|
||||
{ "march", 3, T_Month, 2 },
|
||||
{ "may", 3, T_Month, 4 },
|
||||
{ "may", 3, T_Month, 4 },
|
||||
{ "maybe-uncomputable", 5, T_MaybeUncomputable, 0},
|
||||
{ "monday", 3, T_WkDay, 0 },
|
||||
{ "msf", 3, T_RemType, MSF_TYPE },
|
||||
{ "msg", 3, T_RemType, MSG_TYPE },
|
||||
{ "november", 3, T_Month, 10 },
|
||||
{ "october", 3, T_Month, 9 },
|
||||
{ "msg", 3, T_RemType, MSG_TYPE },
|
||||
{ "november", 3, T_Month, 10 },
|
||||
{ "october", 3, T_Month, 9 },
|
||||
{ "omit", 3, T_Omit, 0 },
|
||||
{ "once", 3, T_Once, 0 },
|
||||
{ "omitfunc", 8, T_OmitFunc, 0 },
|
||||
{ "once", 3, T_Once, 0 },
|
||||
{ "pop-omit-context", 3, T_Pop, 0 },
|
||||
{ "preserve", 8, T_Preserve, 0 },
|
||||
{ "priority", 8, T_Priority, 0 },
|
||||
{ "ps", 2, T_RemType, PS_TYPE },
|
||||
{ "psfile", 6, T_RemType, PSF_TYPE },
|
||||
{ "push-omit-context", 4, T_Push, 0 },
|
||||
{ "ps", 2, T_RemType, PS_TYPE },
|
||||
{ "psfile", 6, T_RemType, PSF_TYPE },
|
||||
{ "push-omit-context", 4, T_Push, 0 },
|
||||
{ "rem", 3, T_Rem, 0 },
|
||||
{ "run", 3, T_RemType, RUN_TYPE },
|
||||
{ "run", 3, T_RemType, RUN_TYPE },
|
||||
{ "satisfy", 7, T_RemType, SAT_TYPE },
|
||||
{ "saturday", 3, T_WkDay, 5 },
|
||||
{ "scanfrom", 4, T_Scanfrom, 0 },
|
||||
{ "scanfrom", 4, T_Scanfrom, SCANFROM_TYPE },
|
||||
{ "sched", 5, T_Sched, 0 },
|
||||
{ "september", 3, T_Month, 8 },
|
||||
{ "september", 3, T_Month, 8 },
|
||||
{ "set", 3, T_Set, 0 },
|
||||
{ "skip", 3, T_Skip, SKIP_SKIP },
|
||||
{ "skip", 3, T_Skip, SKIP_SKIP },
|
||||
{ "special", 7, T_RemType, PASSTHRU_TYPE },
|
||||
{ "sunday", 3, T_WkDay, 6 },
|
||||
{ "tag", 3, T_Tag, 0 },
|
||||
{ "through", 7, T_Through, 0 },
|
||||
{ "thursday", 3, T_WkDay, 3 },
|
||||
{ "tuesday", 3, T_WkDay, 1 },
|
||||
{ "unset", 5, T_UnSet, 0 },
|
||||
{ "until", 3, T_Until, 0 },
|
||||
{ "unset", 5, T_UnSet, 0 },
|
||||
{ "until", 3, T_Until, 0 },
|
||||
{ "warn", 4, T_Warn, 0 },
|
||||
{ "wednesday", 3, T_WkDay, 2 }
|
||||
};
|
||||
@@ -137,7 +130,7 @@ Token NonEnglishToks[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
PRIVATE int TokStrCmp ARGS((const Token *t, const char *s));
|
||||
static int TokStrCmp (Token const *t, char const *s);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -147,22 +140,16 @@ PRIVATE int TokStrCmp ARGS((const Token *t, const char *s));
|
||||
/* left square bracket, return a T_Illegal type. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *FindInitialToken(Token *tok, char *s)
|
||||
#else
|
||||
char *FindInitialToken(tok, s)
|
||||
Token *tok;
|
||||
char *s;
|
||||
#endif
|
||||
char const *FindInitialToken(Token *tok, char const *s)
|
||||
{
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
|
||||
tok->type = T_Illegal;
|
||||
|
||||
while (isspace(*s)) s++;
|
||||
while (isempty(*s)) s++;
|
||||
|
||||
while (*s && !isspace(*s)) {
|
||||
while (*s && !isempty(*s)) {
|
||||
if (DBufPutc(&buf, *s++) != OK) return s;
|
||||
}
|
||||
|
||||
@@ -171,7 +158,7 @@ char *s;
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -180,15 +167,9 @@ char *s;
|
||||
/* Given a string, which token is it? */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void FindToken(const char *s, Token *tok)
|
||||
#else
|
||||
void FindToken(s, tok)
|
||||
char *s;
|
||||
Token *tok;
|
||||
#endif
|
||||
void FindToken(char const *s, Token *tok)
|
||||
{
|
||||
register int top, bot, mid, r;
|
||||
int top, bot, mid, r, max;
|
||||
int l;
|
||||
|
||||
tok->type = T_Illegal;
|
||||
@@ -196,7 +177,7 @@ Token *tok;
|
||||
tok->type = T_Empty;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (*s == '#' || *s == ';') {
|
||||
tok->type = T_Comment;
|
||||
return;
|
||||
@@ -216,6 +197,7 @@ Token *tok;
|
||||
}
|
||||
bot = 0;
|
||||
top = sizeof(TokArray) / sizeof(TokArray[0]) - 1;
|
||||
max = sizeof(TokArray) / sizeof(TokArray[0]);
|
||||
|
||||
while(top >= bot) {
|
||||
mid = (top + bot) / 2;
|
||||
@@ -227,9 +209,13 @@ Token *tok;
|
||||
return;
|
||||
} else {
|
||||
while (mid && !TokStrCmp(&TokArray[mid-1],s)) mid--;
|
||||
while (!TokStrCmp(&TokArray[mid], s) && l < TokArray[mid].MinLen)
|
||||
while (mid < max &&
|
||||
!TokStrCmp(&TokArray[mid], s) &&
|
||||
l < TokArray[mid].MinLen) {
|
||||
mid++;
|
||||
if (!TokStrCmp(&TokArray[mid], s)) {
|
||||
}
|
||||
if (mid < max &&
|
||||
!TokStrCmp(&TokArray[mid], s)) {
|
||||
tok->type = TokArray[mid].type;
|
||||
tok->val = TokArray[mid].val;
|
||||
return;
|
||||
@@ -243,16 +229,16 @@ Token *tok;
|
||||
/* If language is other than English, search the DayNames[] and MonthNames[]
|
||||
array. */
|
||||
#if LANG != ENGLISH
|
||||
for (r=0; r<(sizeof(NonEnglishToks) / sizeof(Token)); r++) {
|
||||
if (l >= NonEnglishToks[r].MinLen &&
|
||||
!TokStrCmp(&NonEnglishToks[r], s)) {
|
||||
tok->type = NonEnglishToks[r].type;
|
||||
tok->val = NonEnglishToks[r].val;
|
||||
for (size_t x=0; x<(sizeof(NonEnglishToks) / sizeof(Token)); x++) {
|
||||
if (l >= NonEnglishToks[x].MinLen &&
|
||||
!TokStrCmp(&NonEnglishToks[x], s)) {
|
||||
tok->type = NonEnglishToks[x].type;
|
||||
tok->val = NonEnglishToks[x].val;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -268,29 +254,38 @@ Token *tok;
|
||||
/* Rep - *n */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC void FindNumericToken(const char *s, Token *t)
|
||||
#else
|
||||
void FindNumericToken(s, t)
|
||||
char *s;
|
||||
Token *t;
|
||||
#endif
|
||||
void FindNumericToken(char const *s, Token *t)
|
||||
{
|
||||
int mult = 1, hour, min;
|
||||
char const *s_orig = s;
|
||||
int ampm = 0;
|
||||
|
||||
t->type = T_Illegal;
|
||||
t->val = 0;
|
||||
if (isdigit(*s)) {
|
||||
PARSENUM(t->val, s);
|
||||
|
||||
/* If we hit a '-' or a '/', we may have a date or a datetime */
|
||||
if (*s == '-' || *s == '/') {
|
||||
char const *p = s_orig;
|
||||
int jul, tim;
|
||||
if (ParseLiteralDate(&p, &jul, &tim) == OK) {
|
||||
if (*p) return;
|
||||
if (tim == NO_TIME) {
|
||||
t->type = T_Date;
|
||||
t->val = jul;
|
||||
return;
|
||||
}
|
||||
t->type = T_DateTime;
|
||||
t->val = MINUTES_PER_DAY * jul + tim;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* If we hit a comma, swallow it. This allows stuff
|
||||
like Jan 6, 1998 */
|
||||
if (*s == ',') {
|
||||
s++;
|
||||
/* Special hack - convert years between 90 and
|
||||
99 to 1990 and 1999 */
|
||||
if (t->val >= 90 && t->val <= 99) t->val += 1900;
|
||||
|
||||
/* Classify the number we've got */
|
||||
if (t->val >= BASE && t->val <= BASE+YR_RANGE) t->type = T_Year;
|
||||
else if (t->val >= 1 && t->val <= 31) t->type = T_Day;
|
||||
@@ -298,13 +293,39 @@ Token *t;
|
||||
return;
|
||||
}
|
||||
/* If we hit a colon or a period, we've probably got a time hr:min */
|
||||
if (*s == ':' || *s == '.' || *s == TIMESEP) {
|
||||
if (*s == ':' || *s == '.' || *s == TimeSep) {
|
||||
s++;
|
||||
hour = t->val;
|
||||
PARSENUM(min, s);
|
||||
if (*s || hour > 23 || min > 59) return; /* Illegal time */
|
||||
if (min > 59) return; /* Illegal time */
|
||||
/* Check for p[m] or a[m] */
|
||||
if (*s == 'A' || *s == 'a' || *s == 'P' || *s == 'p') {
|
||||
ampm = tolower(*s);
|
||||
s++;
|
||||
if (*s == 'm' || *s == 'M') {
|
||||
s++;
|
||||
}
|
||||
}
|
||||
if (*s) return; /* Illegal time */
|
||||
if (ampm) {
|
||||
if (hour < 1 || hour > 12) return;
|
||||
if (ampm == 'a') {
|
||||
if (hour == 12) {
|
||||
hour = 0;
|
||||
}
|
||||
} else if (ampm == 'p') {
|
||||
if (hour < 12) {
|
||||
hour += 12;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
t->val = hour*60 + min; /* Convert to minutes past midnight */
|
||||
t->type = T_Time;
|
||||
if (hour <= 23) {
|
||||
t->type = T_Time;
|
||||
} else {
|
||||
t->type = T_LongTime;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -353,18 +374,12 @@ Token *t;
|
||||
/* Compare a token to a string. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PRIVATE int TokStrCmp(const Token *t, const char *s)
|
||||
#else
|
||||
static int TokStrCmp(t, s)
|
||||
Token *t;
|
||||
char *s;
|
||||
#endif
|
||||
static int TokStrCmp(Token const *t, char const *s)
|
||||
{
|
||||
register int r;
|
||||
char *tk = t->name;
|
||||
char const *tk = t->name;
|
||||
while(*tk && *s && !(*s == ',' && *(s+1) == 0)) {
|
||||
r = UPPER(*tk) - UPPER(*s);
|
||||
r = tolower(*tk) - tolower(*s);
|
||||
tk++;
|
||||
s++;
|
||||
if (r) return r;
|
||||
@@ -372,5 +387,5 @@ char *s;
|
||||
/* Ignore trailing commas on s */
|
||||
|
||||
if (!*s || (*s == ',' && !*(s+1))) return 0;
|
||||
return (*tk - *s);
|
||||
return (tolower(*tk) - tolower(*s));
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user