Compare commits

...

556 Commits

Author SHA1 Message Date
Dianne Skoll
988a94e669 Update WHATSNEW. 2023-01-16 09:23:34 -05:00
Dianne Skoll
ac7e93ac1c Allow REMIND_LANG to override language. 2023-01-15 21:09:54 -05:00
Dianne Skoll
bb7e9ee676 Add Greek holidays and language pack, courtesy of JeiEl <jarlaxl@freemail.gr> 2023-01-15 19:40:39 -05:00
Dianne Skoll
ac949ce7bd Proper definition for US tax day. 2023-01-14 14:26:38 -05:00
Dianne Skoll
0fa8eed11f Correct the US Tax Day calculation, courtesy of Tavis Ormandy 2023-01-14 12:38:25 -05:00
Dianne Skoll
df8694a128 Add orthodoxeaster function. 2023-01-09 15:12:18 -05:00
Dianne Skoll
13df3d96e5 Add JulianToGregorianOffset function. 2023-01-09 14:18:10 -05:00
Dianne Skoll
e345eb15f2 Update verison to 04.02.02 2023-01-01 16:54:23 -05:00
Dianne Skoll
e8b2872a87 Update docs 2023-01-01 16:52:52 -05:00
Dianne Skoll
2f196e3c9f Update copyright year. :) 2022-12-30 13:43:28 -05:00
Dianne Skoll
839b844a10 Correct some comments. 2022-12-26 16:26:07 -05:00
Dianne Skoll
0cea410529 Add a bunch of: "SPDX-License-Identifier: GPL-2.0-only" comments. 2022-12-26 14:24:33 -05:00
Dianne Skoll
90397ece64 Mark soleq as non-constant. 2022-12-26 11:54:24 -05:00
Dianne Skoll
0b95fc290c Tweak. 2022-12-25 10:01:18 -05:00
Dianne Skoll
9a4e8b6070 Better sorting. 2022-12-25 09:37:22 -05:00
Dianne Skoll
924fd16ade More pleaseing alignment. :) 2022-12-23 17:07:54 -05:00
Dianne Skoll
0815fe19cc Align astro output. 2022-12-23 15:43:09 -05:00
Dianne Skoll
7f445e1b66 Add more emojis 2022-12-23 13:56:00 -05:00
Dianne Skoll
31afc60af4 Set latitude and longitude in astro 2022-12-23 13:40:32 -05:00
Dianne Skoll
9d34a8aa42 Set $Latitude in astro 2022-12-23 13:39:19 -05:00
Dianne Skoll
91325ff489 Update "astro" example to include equinoxes and solstices. 2022-12-23 13:28:11 -05:00
Dianne Skoll
1f99d6df59 More docs on NOQUEUE 2022-12-23 13:06:58 -05:00
Dianne Skoll
8a608a06b8 Tweak man page. 2022-12-23 11:51:01 -05:00
Dianne Skoll
bb34474e59 Document return value of soleq() 2022-12-23 11:38:59 -05:00
Dianne Skoll
029c054489 Document soleq() and NOQUEUE. 2022-12-23 11:37:27 -05:00
Dianne Skoll
01400d0672 Test the one-arg form of soleq() 2022-12-23 11:14:49 -05:00
Dianne Skoll
a1eafb2c89 Add NOQUEUE modifier; reverse order of args to soleq and make second arg optional (defaults to today()) 2022-12-23 11:04:18 -05:00
Dianne Skoll
af88e393f9 Reverse oreder of soleq args. 2022-12-23 10:56:13 -05:00
Dianne Skoll
3a250ce765 Don't make tests depend on date they are run. 2022-12-22 22:12:14 -05:00
Dianne Skoll
d651ac40a8 Update comments. 2022-12-22 22:01:54 -05:00
Dianne Skoll
653324e220 Add include/seasons.rem 2022-12-22 21:51:45 -05:00
Dianne Skoll
e5c6703eaa Add function for solstice/equinox calculations. 2022-12-22 21:44:49 -05:00
Dianne Skoll
1596d9c76a Better comments. 2022-12-21 13:41:25 -05:00
Dianne Skoll
4aacf74e25 More renaming of jul -> dse 2022-12-21 13:35:12 -05:00
Dianne Skoll
ae58bc7c11 Better message. 2022-12-21 13:15:05 -05:00
Dianne Skoll
387125d983 Start fixing terminology: Julian becomes DSE
Remind's so-called "Julian" date is not a true Julian date.
It's really the number of days since the Remind Epoch, so rename
to DSE (Days Since Epoch)
2022-12-21 13:14:00 -05:00
Dianne Skoll
aa5f9297b2 Add tests for handling world-writable dirs and files. 2022-12-20 10:38:28 -05:00
Dianne Skoll
8c4a7e766f Don't read world-writable directories 2022-12-20 10:26:47 -05:00
Dianne Skoll
d7f32d3901 Better error indication if something goes wrong in ShowTodaysReminders. 2022-12-20 09:45:16 -05:00
Dianne Skoll
d4f09e2a31 Fix typo 2022-12-15 10:37:28 -05:00
Dianne Skoll
8b5fe4f2a0 Update WHATSNEW for 04.02.01 release. 2022-12-15 09:34:02 -05:00
Dianne Skoll
98fc4a917f Bump version to 04.02.01 2022-12-15 09:24:30 -05:00
Dianne Skoll
e633530a36 Fix stray %" 2022-11-15 08:24:52 -05:00
Dianne Skoll
bfea9915b9 Remove unnecessary %"...%" markers. 2022-11-14 12:37:17 -05:00
Clément Bœsch
d68ed6e75d Add French holidays courtesy of Clément Bœsch 2022-11-14 12:20:43 -05:00
Dianne Skoll
a22631d768 Document need for Noto Fonts in TkRemind. 2022-11-01 13:40:44 -04:00
Dianne Skoll
552bf84e33 Make test *not* depend on the current date... *sigh*. 2022-10-24 09:41:40 -04:00
Dianne Skoll
28d0251093 If we use "-m" in ExtraRemindArgs, set $MondayFirst in tkremind
Patch courtesy of Luís Henriques
2022-10-24 09:35:27 -04:00
Dianne Skoll
f3d969f658 Make sure we print the banner on each iteration of a command-line '*rep' 2022-10-20 18:21:57 -04:00
Dianne Skoll
2afe95d090 Fix typo in comment. 2022-10-18 17:25:59 -04:00
Dianne Skoll
3692a6b265 Avoid ambiguous local<->UTC conversions right around when the clocks change. 2022-10-17 09:58:32 -04:00
Dianne Skoll
8fc19358bb Double-up on "%" in a printf formatting string. 2022-10-17 08:29:38 -04:00
Dianne Skoll
c8f9773d83 Speed up FindFunc. 2022-10-14 13:53:50 -04:00
Dianne Skoll
e1091db82f Don't try to use -ffat-lto-objects with clang 2022-10-14 13:31:57 -04:00
Dianne Skoll
9f8ed13434 Remove a whole lot of unused / dead code. 2022-10-14 13:26:56 -04:00
Dianne Skoll
914f03d5eb Fix bad comment. 2022-10-14 11:45:04 -04:00
Dianne Skoll
a801f6d4ce Token names are already lower-case. 2022-10-14 11:43:36 -04:00
Dianne Skoll
fde5a7b4ca Can use strcmp rather than StrCmpI in FindOperator since they are not alphabetic 2022-10-14 11:41:11 -04:00
Dianne Skoll
0e1fff6339 Update WHATSNEW for release. 2022-10-14 11:06:27 -04:00
Dianne Skoll
60fdeac2e9 Add RPM dependencies. 2022-10-14 11:02:51 -04:00
Dianne Skoll
3b3f10d448 Document prereqs on Gentoo and Arch Linux. 2022-10-14 10:53:35 -04:00
Dianne Skoll
48a4314dd2 Remove "validate" field from system variables. It was never used. 2022-10-14 10:42:05 -04:00
Dianne Skoll
9beff3a24a Tweak demo 2022-10-13 15:36:26 -04:00
Dianne Skoll
1ef90c7a61 Fix comments. 2022-10-13 13:55:09 -04:00
Dianne Skoll
5c886d181e Make overline clearer. 2022-10-13 13:54:06 -04:00
Dianne Skoll
da4d830163 More effects. 2022-10-13 13:53:10 -04:00
Dianne Skoll
c7abb7986c Add ansitext demo 2022-10-13 13:51:51 -04:00
Dianne Skoll
5a3b3d8a06 Add standard include file with various ANSI text attribute-changing sequences. 2022-10-13 10:42:28 -04:00
Dianne Skoll
127cee03df Add gmon.out to gitignore 2022-10-13 10:42:12 -04:00
Dianne Skoll
7455748d54 Eliminate compiler warning. 2022-10-13 08:28:09 -04:00
Dianne Skoll
e278d0e768 Fix typo 2022-10-12 20:13:47 -04:00
Dianne Skoll
a5acc12239 Try a ridiculously long line to excercise dynamic-buffer resizing 2022-10-12 20:11:23 -04:00
Dianne Skoll
a25afb9771 Fix ancient logic error in dynamic buffer code. 2022-10-12 19:38:18 -04:00
Dianne Skoll
6252a472b5 Get rid of useless macro. 2022-10-12 19:21:35 -04:00
Dianne Skoll
dbe4c662c1 Add the "FUNSET" command to delete user-defined functions. 2022-10-12 14:12:13 -04:00
Dianne Skoll
b77a261c87 Add Jewish holidays to the list of standard holiday files. 2022-10-12 14:05:55 -04:00
Dianne Skoll
351c54cc50 Print today. 2022-10-12 13:48:15 -04:00
Dianne Skoll
72d0b13ad5 Make the CI setup run "make all" to catch possible errors compiling the Perl modules. 2022-10-12 11:32:37 -04:00
Dianne Skoll
bea2a6541c Fix docs. 2022-10-12 10:20:20 -04:00
Dianne Skoll
5258e98f54 Add translations for various astronomical events in German localization, courtesy of Gunther Reißig. 2022-10-12 08:39:02 -04:00
Dianne Skoll
af9d42721c Separate Sun from Moon output. 2022-10-11 15:44:19 -04:00
Dianne Skoll
8ed43f5c3e Update WHATSNEW 2022-10-11 14:19:32 -04:00
Dianne Skoll
ec02a87c2b Fix some bugs in US holidays. 2022-10-11 14:19:00 -04:00
Dianne Skoll
6c2ec04d40 Visual tweaks. 2022-10-11 13:57:00 -04:00
Dianne Skoll
9f91cdf0b9 Update WHATSNEW. 2022-10-11 13:23:55 -04:00
Dianne Skoll
8ada68ce54 Add the "columns(str)" variant. 2022-10-11 13:18:44 -04:00
Dianne Skoll
d7975634af Update WHATSNEW 2022-10-11 11:56:41 -04:00
Dianne Skoll
87be68fecf Document rows() and columns() 2022-10-11 11:54:52 -04:00
Dianne Skoll
b42d5fd412 Add rows() and columns() built-in function. 2022-10-11 11:52:35 -04:00
Dianne Skoll
603228b944 Update prerequisite list. 2022-10-11 10:41:57 -04:00
Dianne Skoll
c62f676813 Diagnose unterminated %{...} sequence 2022-10-11 10:35:31 -04:00
Dianne Skoll
c7654c27a6 Update WHATSNEW. 2022-10-11 09:16:04 -04:00
Dianne Skoll
b00bf05fea Add test for %{custom} substitution. 2022-10-11 09:14:47 -04:00
Dianne Skoll
29bd07d4ef Document %{name} substitution sequences. 2022-10-11 09:11:12 -04:00
Dianne Skoll
b7047da89e Allow user-defined substitutions of the form: %{name} or %*{name} that call subst_name. 2022-10-11 09:07:08 -04:00
Dianne Skoll
f26334e25f Add doc about %_ to insert a blank line if $AddBlankLines is 0. 2022-10-11 08:31:13 -04:00
Dianne Skoll
b80bc5f788 Test that ending a reminder with %_ does add a blank line. 2022-10-11 08:30:17 -04:00
Dianne Skoll
91549e18ce Make use of $AddBlankLines 2022-10-10 22:52:48 -04:00
Dianne Skoll
07fd975935 Add the $AddBlankLines system variable. 2022-10-10 22:49:28 -04:00
Dianne Skoll
f9d968cf68 Fix CI script. 2022-10-10 17:31:14 -04:00
Dianne Skoll
6a7e696a60 Minor doc tweak 2022-10-10 17:17:31 -04:00
Dianne Skoll
6734fae1db Update docs/WHATSNEW 2022-10-10 17:15:21 -04:00
Dianne Skoll
481fbc20a1 Bump version to 04.02.00 2022-10-10 17:05:00 -04:00
Dianne Skoll
3c120bf561 Avoid compiler warning. 2022-10-10 17:04:51 -04:00
Dianne Skoll
ee65e04974 Top-level test does not depend on top-level all. 2022-10-10 17:04:35 -04:00
Dianne Skoll
4ee6bb0eca Add test for embedded %_ in MSF reminders. 2022-10-10 11:12:47 -04:00
Dianne Skoll
b9839421f2 make "MSF" correctly wrap UTF-8 text. 2022-10-10 11:05:38 -04:00
Dianne Skoll
67601507fa More robust handling of ANSI color escape sequences. 2022-10-09 22:00:06 -04:00
Dianne Skoll
c2e5534462 Make "REM ... MSF ..." handle ANSI color escape sequences correctly. 2022-10-09 21:55:09 -04:00
Dianne Skoll
f4ea3af6fc Update test output. 2022-10-09 21:32:04 -04:00
Dianne Skoll
e0998a3991 Implement trigtags() 2022-10-09 21:31:24 -04:00
Dianne Skoll
d67e580d0a More tweaks 2022-10-09 18:24:49 -04:00
Dianne Skoll
d6ce54eea4 Tweak astro example script. 2022-10-09 18:22:56 -04:00
Dianne Skoll
8b9ec43029 Add "astro" example script. 2022-10-09 18:21:03 -04:00
Dianne Skoll
9d68134f0f Make PrintValue escape only byte values < 32 2022-10-09 17:53:40 -04:00
Dianne Skoll
3d91371870 Correct and clarify man page. 2022-10-09 17:53:21 -04:00
Dianne Skoll
d1c0ef63b0 Fix inconsistency in man page. 2022-10-09 17:34:09 -04:00
Dianne Skoll
2a59da61e1 Update man page. 2022-10-09 13:40:21 -04:00
Dianne Skoll
2bc5e21627 Document ansicolor and the new color-related special variables. 2022-10-09 13:36:41 -04:00
Dianne Skoll
7d77bfd12a Add tests for invalid ansicolor() calls. 2022-10-09 13:10:28 -04:00
Dianne Skoll
0ff589c288 Merge branch 'utf8' into 'master'
Convert files to UTF-8
2022-10-09 17:02:45 +00:00
Dianne Skoll
f3cca092be Add tests for ansicolors function and new $Use...Colors variables. 2022-10-09 12:59:52 -04:00
Dianne Skoll
7218d55f08 Add $TerminalBackground special variable. 2022-10-09 12:40:48 -04:00
Dianne Skoll
ec72c74016 Add $Use256Colors, $UseBGVTColors, $UseTrueColors and $UseVTColors special variables. 2022-10-09 12:16:33 -04:00
Dianne Skoll
c946f08235 Fix spelling error. 2022-10-07 18:55:07 -04:00
Dianne Skoll
a8543ac349 Fix regression test. 2022-10-06 17:53:01 -04:00
Dianne Skoll
dd3c0e14ed Make wording more consistent. 2022-10-06 17:52:19 -04:00
Dianne Skoll
a2bc0acd3c Use English day names in "OMIT DUMP" 2022-10-06 15:20:37 -04:00
Dianne Skoll
a34266741a Clarify that we use the union of globally- and locally-omitted weekdays. 2022-10-06 08:40:05 -04:00
Dianne Skoll
dedb9766c9 Make a SATISFY-type reminder with ADDOMIT but no MSG actually add to the omits.
Previously, something like: REM 1 May ADDOMIT SATISFY 1
would not add to the global OMIT list.
2022-10-06 08:35:50 -04:00
Dianne Skoll
aedd759f50 Tweak wording. 2022-10-05 16:39:18 -04:00
Dianne Skoll
a24c2f6905 Refactor code. 2022-10-05 16:36:08 -04:00
Dianne Skoll
fac31a10b8 Add the timezone() built-in function. 2022-10-05 16:28:38 -04:00
Dianne Skoll
fba9f139ed Add global OMIT of the form:
OMIT wkday [wkday...]

For example:  OMIT Saturday Sunday
2022-10-05 14:12:53 -04:00
Dianne Skoll
588d9debe8 Simplify American Independence Day example. 2022-10-05 11:12:21 -04:00
Dianne Skoll
805c2e0c69 Implement the utctolocal and localtoutc functions. 2022-10-04 16:23:45 -04:00
Dianne Skoll
2c2b1440b3 Make tests work in non-utf-8 locale. 2022-09-27 21:49:33 -04:00
Jochen Sprickerhof
6973f62d74 Convert files to UTF-8 2022-09-26 20:03:05 +02:00
Dianne Skoll
f547c1e714 Update release notes. 2022-09-26 12:08:49 -04:00
Dianne Skoll
f8ea124b1f Add OS error message if we can't open file. 2022-09-24 10:57:32 -04:00
Dianne Skoll
820e2aec4d Document that "-wcol" also sets $FormWidth 2022-09-24 10:48:43 -04:00
Dianne Skoll
01ce6b2d8f Clamp min CalWidth at 71. 2022-09-24 10:40:04 -04:00
Dianne Skoll
b39e0eab7e Get rid of ComputeCalWidth - it's obsolete 2022-09-24 10:39:05 -04:00
Dianne Skoll
d6fc451d74 Refactor code. 2022-09-24 10:34:05 -04:00
Dianne Skoll
ac91556fc2 Make '-wn' initialize FormWidth as well. 2022-09-24 10:29:23 -04:00
Dianne Skoll
ccf639efe6 Make '-wt' accept FormWidth as well as CalWidth 2022-09-24 10:27:19 -04:00
Dianne Skoll
a8aa3b328b Add "-wt" option to size calendar according to terminal window. 2022-09-24 10:26:06 -04:00
Dianne Skoll
74a3b3e73d Yet more doc fixes. 2022-09-24 09:56:16 -04:00
Dianne Skoll
c0e68b57ea Fix pod 2022-09-24 09:53:11 -04:00
Dianne Skoll
0ad4ea26eb Properly set version and release date in man pages for rem2html and rem2pdf 2022-09-24 09:50:15 -04:00
Dianne Skoll
ea7aafaf5e Refactor code to reduce copy-paste coding. 2022-09-24 09:16:50 -04:00
Dianne Skoll
18043080ba Properly detect missing quote after escape sequence. 2022-09-23 20:42:57 -04:00
Dianne Skoll
7cd8cf3a77 Dump strings more sensibly in PrintValue. 2022-09-23 19:10:36 -04:00
Dianne Skoll
21da52ec36 Update unit tests. 2022-09-23 19:05:51 -04:00
Dianne Skoll
7a0c164843 Dump strings more sensibly. 2022-09-23 19:05:26 -04:00
Dianne Skoll
5cf4961f19 More clarification. 2022-09-23 08:38:00 -04:00
Dianne Skoll
68926d145b Fix innacuracy in how string constants are described. 2022-09-23 08:32:12 -04:00
Dianne Skoll
fdc3e4d23d Update WHATSNEW 2022-09-22 15:00:30 -04:00
Dianne Skoll
f179c837e1 Update regression tests. 2022-09-22 08:56:58 -04:00
Dianne Skoll
740bb44956 Don't consider IFTRIG true if we could not compute a trigger date.
Bug noted by Gunther Reißig
2022-09-22 08:48:19 -04:00
Dianne Skoll
5b953769fe Obey $DefaultColor in a SATISFY-type reminder.
Bug found by Gunther Reißig.
2022-09-22 08:37:37 -04:00
Dianne Skoll
1ae00ce778 No need to reset NumTriggered. 2022-09-21 19:11:30 -04:00
Dianne Skoll
a01e05c1db Fix bug introduced in commit 98c5bf511e:
Don't print a banner when issuing a queued reminder.
2022-09-21 18:17:25 -04:00
Dianne Skoll
63fb3e99f3 Make "test" depend on "all" rather than just "remind" 2022-09-19 13:56:11 -04:00
Dianne Skoll
6cf7f5d2d8 Merge branch 'add_ci' into 'master'
Add ci

See merge request dskoll/remind!2
2022-09-19 17:54:45 +00:00
Jochen Sprickerhof
316eb43303 Add Gitlab CI 2022-09-19 19:51:15 +02:00
Dianne Skoll
576112a39a Merge branch 'drop_fgrep' into 'master'
Replace deprecated fgrep by grep

See merge request dskoll/remind!1
2022-09-19 17:50:03 +00:00
Jochen Sprickerhof
6607223abb Replace deprecated fgrep by grep -F 2022-09-19 19:49:20 +02:00
Dianne Skoll
9e85b1932d Mark today in bold iff "remind -c" color output is enabled. 2022-09-19 11:32:10 -04:00
Dianne Skoll
4ba7f5b1f2 Only embolden today if stdout is a tty 2022-09-19 10:44:21 -04:00
Dianne Skoll
fc93ae890a Allow NULL pointers to be supplied to FromJulian if we are not interested in specific values 2022-09-17 23:04:34 -04:00
Dianne Skoll
8051d01945 Document change in Makefile install/install-stripped targets. 2022-09-17 09:07:27 -04:00
Dianne Skoll
63430c59f7 Make "make install" *not* strip debugging symbols; add "make install-stripped" target to strip them. 2022-09-17 09:04:45 -04:00
Dianne Skoll
c646bfc63f Make today's date bold in -c mode. 2022-09-16 21:01:10 -04:00
Dianne Skoll
58dea8f69b Support greyscale version of SHADE. 2022-09-16 20:44:59 -04:00
Dianne Skoll
f1c82dcb37 Update docs; bump version to 04.01.00. 2022-09-16 19:54:04 -04:00
Dianne Skoll
b984b66819 Put a space before the "***" representing today in -c mode. 2022-09-16 16:15:01 -04:00
Dianne Skoll
44bdae302b Allow 2 (=TERMINAL_BACKGROUND_UNKNOWN) for m in -@n,m,b 2022-09-16 15:58:51 -04:00
Dianne Skoll
8eb6b250fb Add support for the WEEK speical. 2022-09-16 15:08:53 -04:00
Dianne Skoll
d838c41bf2 Add tests for stdout() function. 2022-09-16 14:14:06 -04:00
Dianne Skoll
f9dbf36496 Don't backgroundize the row with day numbers. 2022-09-16 13:53:33 -04:00
Dianne Skoll
fe1427db28 Finalize support for SPECIAL SHADE in "remind -c" 2022-09-16 13:50:23 -04:00
Dianne Skoll
2621ad5604 Tweak calendar column-to-day handling. 2022-09-16 13:43:20 -04:00
Dianne Skoll
efecf2e1ea Make "remind -c" optionally support the SPECIAL SHADE 2022-09-16 11:41:18 -04:00
Dianne Skoll
8666e6357e Start working on support for SHADE in remind -c output. 2022-09-16 08:42:20 -04:00
Dianne Skoll
ae7069c9cb Gotta use the right sscanf format. :( 2022-09-15 18:43:58 -04:00
Dianne Skoll
0c6ab3e607 Properly parse args to MOON special 2022-09-15 18:37:46 -04:00
Dianne Skoll
17d6a60c0a Fix moon-phase-in-terminal printing and add tests. 2022-09-15 18:23:03 -04:00
Dianne Skoll
e3e0a541dc Print moon phases in terminal if terminal supports UTF-8 2022-09-15 18:18:05 -04:00
Jochen Sprickerhof
712aa08fbc make test depend on all 2022-09-08 16:32:04 +02:00
Dianne Skoll
98c5bf511e Print banner prior to first MSG-type reminder. 2022-09-06 09:14:55 -04:00
Dianne Skoll
1f9281628f Add home page to rem2pdf.1 and rem2html.1 2022-08-27 11:21:24 -04:00
Dianne Skoll
8fb15aed17 Do a sanity-check to make sure we pick up a release date. 2022-08-27 10:26:51 -04:00
Dianne Skoll
a24c3a8542 Remove generated man pages when running "make clean" 2022-08-27 10:24:29 -04:00
Dianne Skoll
8f8059e3f3 Generate man files from *.in versions to include release date and version number. 2022-08-27 10:22:31 -04:00
Dianne Skoll
24bb462199 Rename *.1 to *.1.in 2022-08-27 10:14:16 -04:00
Dianne Skoll
38e914f171 Get release date. 2022-08-27 10:06:02 -04:00
Dianne Skoll
4a02c54e8d Add home page to man pages. 2022-08-26 16:33:39 -04:00
Dianne Skoll
5fe169438a Document behavior of DO and filedir() with respect to symbolic links. 2022-08-22 09:19:30 -04:00
Dianne Skoll
a7ef6e851a Fix error in Makefile - remove duplicate clean: definition 2022-08-21 10:24:30 -04:00
Dianne Skoll
4d57b9d0aa Pass CFLAGS at link-time
Thanks to Zoltan Puskas for suggestion.
2022-08-21 10:23:16 -04:00
Dianne Skoll
5a7452d9f6 Add install-nostripped top-level target.
Thanks to Zoltan Puskas for suggestion.
2022-08-21 10:22:58 -04:00
Dianne Skoll
3916887aff Update change log. 2022-08-16 09:24:51 -04:00
Dianne Skoll
f84f59fa91 Bump version to 04.00.03. 2022-08-15 14:48:59 -04:00
Dianne Skoll
1032f8908e Don't create mysterious files named '&1' when creating new reminders. Sigh. 2022-08-11 11:32:59 -04:00
Dianne Skoll
6c2e8fc608 Document calendar_body and plain_body. 2022-08-08 11:49:06 -04:00
Dianne Skoll
012e527fb5 Fix parsing of old-style output. 2022-08-06 12:06:09 -04:00
Dianne Skoll
62198c9807 Use the new calendar_body/plain_body fields. 2022-08-06 11:54:32 -04:00
Dianne Skoll
de95224d62 Use new calendar_body / plain_body elements. 2022-08-06 11:49:35 -04:00
Dianne Skoll
be374a0464 Update test suite for new JSON output. 2022-08-06 09:09:06 -04:00
Dianne Skoll
fe9b3186d7 Add plain_body and calendar_body keys to JSON output. 2022-08-06 09:06:54 -04:00
Dianne Skoll
8405ea6c53 Add note about how to kill remind in queue mode. 2022-08-06 08:34:16 -04:00
Dianne Skoll
4274d05e10 Fix man page typo 2022-08-05 22:09:36 -04:00
Dianne Skoll
4e80ce1159 Don't make SIGINT kill a background process; don't call printf from a signal-handler; use sigaction instead of signal 2022-08-05 22:04:44 -04:00
Dianne Skoll
52f473f2af Update .gitignore 2022-08-04 10:34:45 -04:00
Dianne Skoll
1d6ca51bf9 Update docs. 2022-08-02 14:58:15 -04:00
Dianne Skoll
e662d0b3dd Bump version to 04.00.02 2022-08-02 14:51:00 -04:00
Dianne Skoll
b910d557d1 Document new form of OMIT command. 2022-07-27 15:16:23 -04:00
Dianne Skoll
a4ad0a9e97 Rename error constant. 2022-07-27 15:06:04 -04:00
Dianne Skoll
07f67e7dd7 Better error messages 2022-07-27 15:03:48 -04:00
Dianne Skoll
d6575773fb Don't let THROUGH date be before START date in OMIT. 2022-07-27 14:55:34 -04:00
Dianne Skoll
ac1303886e Add another test. 2022-07-27 14:47:11 -04:00
Dianne Skoll
1569992184 Add test for more flexible OMIT 2022-07-27 14:43:54 -04:00
Dianne Skoll
55a1f1d746 Implement more flexible OMIT. We can do things like:
OMIT May       - equivalent to "OMIT May 1" ... "OMIT May 31"
    OMIT Nov 20 THROUGH Dec 4
    OMIT Apr THROUGH May
    OMIT 2023-12-25 THROUGH 2024-01-06
2022-07-27 14:39:43 -04:00
Dianne Skoll
ef7742a3cc Add GitHub README 2022-07-19 10:12:46 -04:00
Dianne Skoll
ef48c2020b Fix typo 2022-07-12 20:44:57 -04:00
Dianne Skoll
6dcb25073b Make $T behave as documented: If trigger date is not valid, should return 0. 2022-07-04 14:23:39 -04:00
Dianne Skoll
4824b07ec8 Document inotifywait 2022-07-03 19:47:06 -04:00
Dianne Skoll
a8f1228fb7 Update TkRemind man page. 2022-07-03 19:13:05 -04:00
Dianne Skoll
80e51d1d0f Make calendar with 6 rows in a month handle resizing properly.
Fixes https://github.com/dfskoll/remind/issues/1
2022-07-01 16:45:25 -04:00
Dianne Skoll
80e30638a5 Update changelog 2022-06-03 16:22:19 -04:00
Dianne Skoll
dd2fc30364 Add test for $SuppressLRM 2022-05-29 17:28:45 -04:00
Dianne Skoll
a5865fb5fe Add $SuppressLRM system variable; bump version to 04.00.01. 2022-05-27 12:22:26 -04:00
Dianne Skoll
aca2f28341 Add liberapay button. 2022-05-19 13:58:03 -04:00
Dianne Skoll
7a3f5f7ac9 Add github action to run tests. 2022-05-19 09:46:32 -04:00
Dianne Skoll
1731710ef2 Minor reformatting of source. 2022-05-19 09:01:11 -04:00
Dianne Skoll
dc2a8f48bf Update man page. 2022-04-07 11:53:20 -04:00
Dianne Skoll
5e16179bfa Update docs for 04.04.00 release. 2022-04-04 09:36:08 -04:00
Dianne Skoll
a7c1bc81b2 Remove a bug from man page. 2022-04-03 12:59:25 -04:00
Dianne Skoll
5f5ec8ef19 More intelligent handling of --prefix wrt ExtUtils::MakeMaker. 2022-04-03 12:23:28 -04:00
Dianne Skoll
712ff56792 Update docs 2022-04-01 12:11:04 -04:00
Dianne Skoll
99af1f964c Fix bug that broke "-m" option to tkreminder. 2022-04-01 12:08:25 -04:00
Dianne Skoll
de5d1347e5 Make the operator stack static 2022-03-26 19:05:18 -04:00
Dianne Skoll
5e07fbde6d Fix formatting. 2022-03-26 18:03:31 -04:00
Dianne Skoll
c523c7f3b3 Allow a subst_N or subst_Nx function to return 0 to indicate "use the normal substitution" 2022-03-26 18:02:39 -04:00
Dianne Skoll
6b3c6b0ec7 Fix a couple of typos. 2022-03-26 10:11:17 -04:00
Dianne Skoll
62b94ab065 Update WHATSNEW. 2022-03-25 16:08:33 -04:00
Dianne Skoll
49c7399599 Add "pad" function 2022-03-25 16:07:17 -04:00
Dianne Skoll
5fa9297aba Bump version to 04.00.00 2022-03-25 15:52:07 -04:00
Dianne Skoll
4ada31798b Document language packs. 2022-03-25 15:14:59 -04:00
Dianne Skoll
e78f953e90 Document "pad" function. 2022-03-25 14:47:42 -04:00
Dianne Skoll
af7a9ad8b5 Use Eprint instead of Wprint 2022-03-25 14:20:40 -04:00
Dianne Skoll
35eae045a6 Fix up test file. 2022-03-25 14:18:12 -04:00
Dianne Skoll
98a20ae058 Better call-stack printing. 2022-03-25 14:17:43 -04:00
Dianne Skoll
df9ef6e13a Print call stack if an error occurs in a user-defined function. 2022-03-25 14:03:06 -04:00
Dianne Skoll
10f5802069 Add callstack-management functions. 2022-03-25 13:56:00 -04:00
Dianne Skoll
780044219f Store the filename / lineno at which a user-defined function is defined. 2022-03-25 13:40:07 -04:00
Dianne Skoll
d015c061e7 Add site/ subdir and README. 2022-03-25 11:26:42 -04:00
Dianne Skoll
6f6326d433 Add another pad() test. 2022-03-25 11:13:51 -04:00
Dianne Skoll
9488e7ca13 Don't let pad function make over-long strings. 2022-03-25 11:08:43 -04:00
Dianne Skoll
71c11672c2 Add null "en.rem" 2022-03-25 10:59:51 -04:00
Dianne Skoll
0acefa800e Add Spanish language pack. 2022-03-25 10:58:57 -04:00
Dianne Skoll
d45cee4712 Add Romanian language pack. 2022-03-25 10:53:20 -04:00
Dianne Skoll
c026aa05e2 Warn if a substitution expression evaluates incorrectly. 2022-03-25 10:53:08 -04:00
Dianne Skoll
50076c74fa Implement Portuguese language pack. 2022-03-25 08:54:13 -04:00
Dianne Skoll
1563d77c06 More extensive tests. 2022-03-24 18:53:55 -04:00
Dianne Skoll
ed72ef8629 Use built-in "pad" function 2022-03-24 17:34:08 -04:00
Dianne Skoll
06c5996086 Add tests for pad function 2022-03-24 17:33:16 -04:00
Dianne Skoll
570ca857a0 Add "pad" function; make compare-language-mods.pl quiet. 2022-03-24 17:31:37 -04:00
Dianne Skoll
f8f20b7afc Add Polish language pack 2022-03-24 16:33:48 -04:00
Dianne Skoll
f55ef7ff20 Add Norwegian language pack. 2022-03-24 16:04:54 -04:00
Dianne Skoll
79220a74cf Add Italian language pack. 2022-03-24 15:49:25 -04:00
Dianne Skoll
77111ef628 Convert to utf-8 2022-03-24 15:01:37 -04:00
Dianne Skoll
bf96063311 Convert is.rem to utf-8 2022-03-24 14:45:57 -04:00
Dianne Skoll
58a201fceb Fix typo 2022-03-24 14:42:01 -04:00
Dianne Skoll
47cecb210b Add an auto.rem file to pick language file based on locale. 2022-03-24 14:39:18 -04:00
Dianne Skoll
bfbf744b0a Implement Icelandic language pack. 2022-03-24 14:14:42 -04:00
Dianne Skoll
0cf56ac1de Error-check -@ values. 2022-03-24 14:07:07 -04:00
Dianne Skoll
2880a718f4 Fix bug in compiled Dutch language support. 2022-03-24 12:34:58 -04:00
Dianne Skoll
da0dd0f7c6 Tweak nl language pack. 2022-03-24 12:32:43 -04:00
Dianne Skoll
c456d3e0ff More extensive testing. 2022-03-24 12:30:04 -04:00
Dianne Skoll
59059736e6 Add remembrance day 2022-03-24 11:42:45 -04:00
Dianne Skoll
f5cf2ab832 Working version of Finnish language pack! 2022-03-24 11:22:15 -04:00
Dianne Skoll
cc4ff2582d More work on getting Finnish language pack working properly. 2022-03-24 11:05:58 -04:00
Dianne Skoll
90f5fde3bb Progress on Finnish language pack. 2022-03-24 10:38:03 -04:00
Dianne Skoll
9fbe9f5132 Add more tests. 2022-03-23 17:30:28 -04:00
Dianne Skoll
f05661fa6c Fix typo 2022-03-23 17:22:47 -04:00
Dianne Skoll
d6882c3378 Add more tests. 2022-03-23 17:20:13 -04:00
Dianne Skoll
e32cab937e Install everything under include/ in $SysInclude 2022-03-23 16:43:15 -04:00
Dianne Skoll
14bb939977 Add US holidays. 2022-03-23 15:44:23 -04:00
Dianne Skoll
13e830782d Port over NL 2022-03-23 15:37:49 -04:00
Dianne Skoll
f39bb5e2d9 Tweaks 2022-03-23 14:53:28 -04:00
Dianne Skoll
8b795e81b7 Port Danish to da.rem 2022-03-23 14:47:22 -04:00
Dianne Skoll
aef7eeda5a Make "de" runtime localization match compiled version. 2022-03-23 12:04:54 -04:00
Dianne Skoll
0641a6f8f1 Add support for the "subst_#x" functions to simplify language customization. 2022-03-23 11:52:51 -04:00
Dianne Skoll
4fdf7b706b More work on making run-time language module match compile-time module. 2022-03-23 11:47:00 -04:00
Dianne Skoll
0653b9420a Add "q" suboption to "-p" to not suppress quote markers. 2022-03-23 11:02:16 -04:00
Dianne Skoll
27ede1ce37 Start working on runtime language files; make sure they give
the same tstlang.rem output as compiled language files.
2022-03-23 10:16:59 -04:00
Dianne Skoll
a303fb9cba Tweak configure script to use autoconf macros 2022-03-22 10:40:41 -04:00
Dianne Skoll
92af4e9c3e Only use -flto=auto and -ffat-lto-objects if C compiler supports them. 2022-03-22 10:33:36 -04:00
Dianne Skoll
abc4f45fed Compile with link-time optimization enabled if we're using gcc 2022-03-22 09:18:28 -04:00
Dianne Skoll
e651f92bd9 Make tests pass even if we use LTO. 2022-03-22 09:17:31 -04:00
Dianne Skoll
b2d3d98d72 Update de.rem 2022-03-20 14:22:15 -04:00
Dianne Skoll
cb8b7f85af Language tweaks 2022-03-20 14:20:01 -04:00
Dianne Skoll
d30f347a0b More language work. 2022-03-20 13:05:24 -04:00
Dianne Skoll
5e9b1e7464 Fix compilation errors for non-English languages. 2022-03-20 10:49:37 -04:00
Dianne Skoll
58085470c5 Install fr.rem 2022-03-20 10:31:53 -04:00
Dianne Skoll
8f0de805d5 More work on fr.rem 2022-03-20 10:27:04 -04:00
Dianne Skoll
3f879a1b97 Add subst_ampm and subst_ordinal 2022-03-20 10:20:50 -04:00
Dianne Skoll
94270c3d98 Add sys vars 2022-03-20 10:01:31 -04:00
Dianne Skoll
bb8a689186 Add a whole slew of system variables to customize language. 2022-03-20 09:53:31 -04:00
Dianne Skoll
a7e73cdac8 Remove IN_DOSUBST guards. 2022-03-20 09:44:42 -04:00
Dianne Skoll
d38c324340 Start making language stuff dynamic. 2022-03-20 09:42:24 -04:00
Dianne Skoll
fade38d522 Add $SysInclude system variable. 2022-03-20 08:56:01 -04:00
Dianne Skoll
858a7601aa Add support for "subst_X" functions to modify dosubst. 2022-03-19 15:53:21 -04:00
Dianne Skoll
37e3d3d1d1 Add $Today and $Tomorrow system variables. 2022-03-19 15:17:18 -04:00
Dianne Skoll
ff67ab3c86 We only need 6 digits of precision. 2022-03-17 17:37:40 -04:00
Dianne Skoll
ad7faa8ad9 Don't check errno 2022-03-17 17:33:50 -04:00
Dianne Skoll
c927166a8a Accept but warn if $Latitude/$Longituded uses locale decimal separator instead of "." 2022-03-17 11:29:27 -04:00
Dianne Skoll
9d22fba842 Document that decimal separator for $Latitude and $Longitude is always "." 2022-03-17 11:23:16 -04:00
Dianne Skoll
3d5adf6c42 Always interpret $Latitude and $Longitude values in the C locale. 2022-03-17 11:21:27 -04:00
Dianne Skoll
5ba862cbd7 Don't define RET as 'remind-indent-line 2022-03-17 10:22:13 -04:00
Dianne Skoll
6f20e056c9 Allow day numbers to be anchored to left, center or right.
Based on a patch from Paulo <qsmodo *AT* tutanota.com>
2022-03-16 17:30:06 -04:00
Dianne Skoll
878ab1a8bc Fix a bunch of spelling mistakes found by Jens Schleusener 2022-03-15 14:40:46 -04:00
Dianne Skoll
4d17494371 Bump copyright date. 2022-03-14 21:12:20 -04:00
Dianne Skoll
65763b9522 Document release date. 2022-03-14 17:37:03 -04:00
Dianne Skoll
52840d40de Update docs. 2022-03-14 17:07:04 -04:00
Dianne Skoll
6892e7a805 Better mode name. 2022-03-13 16:59:27 -04:00
Dianne Skoll
24d0264f92 Improve remind-conf-mode syntax highlighting to make it case-insensitive. 2022-03-13 16:56:47 -04:00
Dianne Skoll
56c37e4e05 Bump version. 2022-03-13 16:26:44 -04:00
Dianne Skoll
86c99102b5 Update remind-conf-mode.el with new keywords, built-in variables and functions 2022-03-13 16:25:58 -04:00
Dianne Skoll
de4a23ee1e Add DO keyword to remind.vim 2022-03-13 16:09:06 -04:00
Dianne Skoll
6a9f7c186a Refactor code to reduce cut-n-paste. 2022-03-13 09:15:48 -04:00
Dianne Skoll
eaed22a42b Fix typo 2022-03-13 09:11:03 -04:00
Dianne Skoll
f47cf2320e Catch expression-pasting errors on all REM commands. 2022-03-12 15:51:30 -05:00
Dianne Skoll
eb100e57e2 Parse untriggered reminder lines to catch expression-pasting errors. 2022-03-12 15:48:31 -05:00
Dianne Skoll
948548c73f Update docs. 2022-03-12 12:57:24 -05:00
Dianne Skoll
7495ae1e05 Uniquify lines in error message to avoid overwhelming. 2022-03-12 11:32:26 -05:00
Dianne Skoll
51ae17bd0a Improve the way TkRemind handles errors in the reminder script. 2022-03-12 11:23:54 -05:00
Dianne Skoll
61d665ef7d Turn a bunch of Eprint calls into Wprint calls to indicate warnings instead of errors. 2022-03-12 10:27:58 -05:00
Dianne Skoll
5aaf19ffdb Send LRM sequence in PrintLeft and PrintCentered. 2022-03-12 09:39:28 -05:00
Dianne Skoll
2eb672e380 Add LRM marks in UTF-8 locales. 2022-03-12 09:33:16 -05:00
Dianne Skoll
4a59bf686b Check for langinfo.h 2022-03-12 09:26:41 -05:00
Dianne Skoll
f98ab6f686 Document special behavior of "-cu" 2022-03-11 23:31:04 -05:00
Dianne Skoll
3600cd95cd Add LRM char if we're using Unicode drawing chars 2022-03-11 23:28:03 -05:00
Dianne Skoll
f8bd79fbb2 Fix bug in calendar formatting 2022-03-11 23:18:38 -05:00
Dianne Skoll
4c403047eb Tweaks 2022-03-11 23:10:37 -05:00
Dianne Skoll
25009de417 Update defs.rem 2022-03-11 23:06:24 -05:00
Dianne Skoll
c4588654ec Clean up cruft in defs.rem 2022-03-11 23:02:37 -05:00
Dianne Skoll
c1e5279272 Tweak meeting reminder. 2022-03-11 22:55:51 -05:00
Dianne Skoll
cda8396690 Update copyright date. 2022-03-11 22:52:29 -05:00
Dianne Skoll
c0f79d1e69 Bump mininum remind version. 2022-03-11 22:52:05 -05:00
Dianne Skoll
375a0fb7a2 Update examples to use syntactic sugar. 2022-03-11 22:51:22 -05:00
Dianne Skoll
2069114ef1 More wrap testing. 2022-03-11 22:39:29 -05:00
Dianne Skoll
f6d9e8724d Make test to test wrapping of wide chars 2022-03-11 22:37:40 -05:00
Dianne Skoll
8e55438200 Minor tweak 2022-03-11 22:36:52 -05:00
Dianne Skoll
1ca6feb112 Fix formatting bug when printing calendar with wide spaces. 2022-03-11 22:31:40 -05:00
Dianne Skoll
732ce8283f Update docs. 2022-03-11 21:47:50 -05:00
Dianne Skoll
122bd3e07e Add comment 2022-03-11 21:27:33 -05:00
Dianne Skoll
0ac5cbb837 Properly cope with two of the same moon phase in a given month. 2022-03-11 21:26:22 -05:00
Dianne Skoll
7f3d4812a8 Add Lastday and Lastworkday syntactic sugar 2022-03-11 21:11:16 -05:00
Dianne Skoll
e1fa11c94c Add the First/Second/Third/Fourth/Last syntactic sugar and the
~N/~~N forms of "back"
2022-03-11 20:53:52 -05:00
Dianne Skoll
c06c65acf1 Properly apply options in the right order. 2022-03-11 19:57:20 -05:00
Dianne Skoll
a84fa0bc8f Add canned "Light Theme" and "Dark Theme" buttons. 2022-03-11 19:46:40 -05:00
Dianne Skoll
054648e02b More display tweakage. 2022-03-11 14:35:39 -05:00
Dianne Skoll
9548041334 Tweak display; make keyboard traversal better. 2022-03-11 14:29:07 -05:00
Dianne Skoll
da306f2900 Tweak wording 2022-03-11 13:46:43 -05:00
Dianne Skoll
26587aea02 Give more control over TkRemind colors. 2022-03-11 13:38:11 -05:00
Dianne Skoll
adc86e0f00 Allow setting of "Today" highlight color. 2022-03-10 11:53:00 -05:00
Dianne Skoll
a9ed5f075e Document that trig() and SATISFY should not be mixed. 2022-03-05 11:35:55 -05:00
Dianne Skoll
21e30c980e Test multiple-argument version of trig() 2022-03-04 17:29:23 -05:00
Dianne Skoll
a657b2e55a Update man page. 2022-03-04 15:40:39 -05:00
Dianne Skoll
ff8c55b8b6 Rename "wouldtrig" to just "trig" 2022-03-04 15:38:07 -05:00
Dianne Skoll
eb36c5bca0 Allow wouldtrig() to take an arbitrary number of args; document it. 2022-03-04 15:24:52 -05:00
Dianne Skoll
89173ce1ee Allow logical operators to accept any non-string operands.
Make wouldtrig() return a date.
2022-03-04 14:59:17 -05:00
Dianne Skoll
5d115ba3e3 Document actual behavior of IF command. 2022-03-04 14:58:49 -05:00
Dianne Skoll
7e3adeb9c9 Make wouldtrig return the trigger date (as an INT, coercable to a date)
Update man page.
2022-03-04 12:28:13 -05:00
Dianne Skoll
080cda86fa Document new || and && return values. 2022-03-04 12:12:49 -05:00
Dianne Skoll
6274cbad52 Make || return first true val and && return last val if first val is true. 2022-03-04 12:11:25 -05:00
Dianne Skoll
85c4ad821d Add note about Remind lacking short-circuit logical operators. 2022-03-04 11:45:37 -05:00
Dianne Skoll
b758a2fea8 Tweak formatting. 2022-03-04 11:40:46 -05:00
Dianne Skoll
6619cc7ca4 Add wouldtrig tests. 2022-03-04 11:33:03 -05:00
Dianne Skoll
961f7a8a62 Document wouldtrig() 2022-03-04 11:21:14 -05:00
Dianne Skoll
905287901f Add zero-argument form of wouldtrig. 2022-03-04 11:16:33 -05:00
Dianne Skoll
669be7bf57 Add wouldtrig function. 2022-03-04 11:00:09 -05:00
Dianne Skoll
9b8eb2dc4c Support calling EvalExpr recursively 2022-03-04 10:49:20 -05:00
Dianne Skoll
00ab7b196d Set default of $MaxSatIter to 1000 instead of 150.
Computers are much faster than when Remind was first written;
we can handle a much higher limit.
2022-03-04 08:18:49 -05:00
Dianne Skoll
f616be4bdd Add comment about operator precedence. 2022-03-04 08:16:58 -05:00
Dianne Skoll
8ae9ce8523 Tweak man page. 2022-03-02 15:30:56 -05:00
Dianne Skoll
6d2bbbd7e2 Another diagnostic message. 2022-03-02 15:25:27 -05:00
Dianne Skoll
1453be83b2 Add more diagnostics for bad UNTIL dates. 2022-03-02 15:17:03 -05:00
Dianne Skoll
8659131be2 Use proper keyword in error message. 2022-03-02 14:43:11 -05:00
Dianne Skoll
0276ce322d Diagnose if UNTIL is earlier than start date unless there is a nonconst expr 2022-03-02 09:11:01 -05:00
Dianne Skoll
b36c99a34b Move successful exit to one spot. 2022-03-02 09:01:33 -05:00
Dianne Skoll
ad575f1485 Proper check for overfull box. 2022-03-01 16:15:00 -05:00
Dianne Skoll
a9162f1472 Proper calculation for warning of overfull box. 2022-03-01 16:12:55 -05:00
Dianne Skoll
221e2554a9 Prep for 03.04.01 release. 2022-02-23 11:09:39 -05:00
Dianne Skoll
04ec6c3695 Update TodayDay, TodayMonth and TodayYear in Initialize, in case date has rolled over 2022-02-15 10:04:30 -05:00
Dianne Skoll
b1594980fc Add --disable-perl-build-artifacts flag to configure. 2022-02-13 10:42:50 -05:00
Dianne Skoll
024a8ef38d Double-check that chosen font size for small calendars won't overflow box. 2022-02-13 10:33:21 -05:00
Dianne Skoll
b281051421 Don't overflow small calendar box. 2022-02-12 23:30:08 -05:00
Dianne Skoll
aa1b275b51 Support INSTALL_BASE 2022-02-11 10:55:59 -05:00
Dianne Skoll
c22ca68857 Support INSTALL_BASE env var 2022-02-11 10:39:31 -05:00
Dianne Skoll
3804ce3fe3 Prep for 03.04.00 release. 2022-02-10 17:15:01 -05:00
Dianne Skoll
0977f1db04 Don't export the 'php' directory. 2022-02-10 10:07:41 -05:00
Dianne Skoll
83c97934c9 Fix typo 2022-02-09 09:43:11 -05:00
Dianne Skoll
44c9d74caa Preserve #include "custom.h" in config.h.in. Patch due to Jochen Sprickerhof 2022-02-09 09:10:47 -05:00
Dianne Skoll
172f56754a Fix groff errors - patch from Jochen Sprickerhof 2022-02-09 08:59:58 -05:00
Dianne Skoll
dc184cc713 Don't fail "make clean" in src - patch from Jochen Sprickerhof. 2022-02-09 08:58:47 -05:00
Dianne Skoll
2c30088553 Update docs. 2022-02-08 13:31:11 -05:00
Dianne Skoll
6f0c189afb Edit proper file 2022-02-08 13:23:29 -05:00
Dianne Skoll
0e2996c3e1 Update "See also" 2022-02-08 13:22:32 -05:00
Dianne Skoll
ce8040dd1f Add generated file to .gitignore 2022-02-08 13:19:07 -05:00
Dianne Skoll
a8fd2d463d Update man pages 2022-02-08 13:18:48 -05:00
Dianne Skoll
237813127c Document how to highlight "today" in rem2html 2022-02-08 13:10:15 -05:00
Dianne Skoll
3e6259532f Support the old-style "REM ... SPECIAL SHADE grey" variant. 2022-02-03 19:34:09 -05:00
Dianne Skoll
c015441130 Don't barf if libcairo is too old. 2022-02-03 17:27:31 -05:00
Dianne Skoll
9661455fee Set default heading size to 12 instead of 14. 2022-02-03 16:27:38 -05:00
Dianne Skoll
df983b4123 Make sure all system variables are accessible. 2022-02-03 16:16:28 -05:00
Dianne Skoll
068d5429eb Fix variable sort order 2022-02-03 16:12:13 -05:00
Dianne Skoll
6c593fe849 Update docs. 2022-02-02 11:43:27 -05:00
Dianne Skoll
6a7bdb2ec7 Note the defalt font is Sans 2022-02-01 20:02:09 -05:00
Dianne Skoll
a4aead18dd Default font to "Sans" instead of "Helvetica" in rem2pdf... gives better output 2022-02-01 20:01:00 -05:00
Dianne Skoll
d277154d9f Update WHATSNEW 2022-02-01 19:56:51 -05:00
Dianne Skoll
d2662fb026 Remove unused macro and misleading comment. 2022-02-01 19:52:48 -05:00
Dianne Skoll
2f522ea705 Remove unused macro SIZEOF_UNSIGNED_SHORT 2022-02-01 19:51:45 -05:00
Dianne Skoll
cd68041312 Get rid of obsolete PutChar and Putc macros. 2022-02-01 16:05:06 -05:00
Dianne Skoll
9c2556f16d Remove some old cruft; increase number of full OMITs from 500 to 1000. 2022-01-31 14:43:44 -05:00
Dianne Skoll
b80b938d3d Take values from build.tk 2022-01-31 14:38:28 -05:00
Dianne Skoll
0bd6278050 Fix typo. 2022-01-31 14:37:47 -05:00
Dianne Skoll
b2746f28db Include seconds in lat/lon settings. 2022-01-31 14:35:47 -05:00
Dianne Skoll
cfd3698b53 Remove extraneous spaces. 2022-01-31 09:03:56 -05:00
Dianne Skoll
6b5150d30e Update docs. 2022-01-31 09:01:10 -05:00
Dianne Skoll
b011adf94e Fix build.tk 2022-01-31 09:00:02 -05:00
Dianne Skoll
d09b725710 Create proper custom.h 2022-01-31 08:55:34 -05:00
Dianne Skoll
2f1e3524df Replace the various LAT_ and LONG_ macros with DEFAULT_LATITUDE and DEFAULT_LONGITUDE 2022-01-31 08:52:18 -05:00
Dianne Skoll
2de47cfa51 Update docs 2022-01-30 14:42:01 -05:00
Dianne Skoll
15a778075d Update whatsnew. 2022-01-30 14:36:07 -05:00
Dianne Skoll
2502191982 Fix up display_len vs len 2022-01-30 14:22:52 -05:00
Dianne Skoll
47af91d136 Fix PrintCentered. 2022-01-30 14:19:36 -05:00
Dianne Skoll
e249fe3a17 Bump version to 03.04.00. 2022-01-30 14:03:48 -05:00
Dianne Skoll
72838a07f3 Make rem2pdf take a -v option. 2022-01-30 14:02:34 -05:00
Dianne Skoll
c098acc659 Update man pages. 2022-01-30 13:58:33 -05:00
Dianne Skoll
15ee32b5bd Update rem2ps man page. 2022-01-30 13:43:36 -05:00
Dianne Skoll
5a059d9b09 Missed one 2022-01-30 12:35:05 -05:00
Dianne Skoll
77516dbdff Remove a few more files in "make distclean" 2022-01-30 12:34:36 -05:00
Dianne Skoll
835af9ad6a Fix various UTF-8 handling bugs; properly re-space month and day names. 2022-01-30 12:31:38 -05:00
Dianne Skoll
4c30db06c0 Allow spaces in month and day names 2022-01-30 12:02:08 -05:00
Dianne Skoll
3aee12073e Start allowing spaces in month and day names (convert to _ on -p output) 2022-01-30 12:00:57 -05:00
Dianne Skoll
654fd78ee7 Replace spaces in day names with '_' 2022-01-30 11:54:13 -05:00
Dianne Skoll
b8126d3a85 Add POD to Entry.pm 2022-01-30 11:06:50 -05:00
Dianne Skoll
3054091688 Add POD to PDF.pm 2022-01-30 11:00:36 -05:00
Dianne Skoll
6e0fd7ea5f Fix manpage cross-references. 2022-01-30 10:13:10 -05:00
Dianne Skoll
bbb82029d2 Make TkRemind support PDF output iff rem2pdf is installed. 2022-01-29 23:02:06 -05:00
Dianne Skoll
716d7bcc92 Tweak test file. 2022-01-29 22:29:34 -05:00
Dianne Skoll
e7a6bf0e19 Avoid "wide char" error. 2022-01-29 22:29:28 -05:00
Dianne Skoll
27c17252e7 Tweak 2022-01-29 22:23:43 -05:00
Dianne Skoll
940254bec6 Add another feature demo 2022-01-29 22:23:16 -05:00
Dianne Skoll
79952d52f1 Add note about invalid markup 2022-01-29 22:22:09 -05:00
Dianne Skoll
e58545d3f6 Finish rem2pdf man page. 2022-01-29 22:20:01 -05:00
Dianne Skoll
b7c9643a05 Also handle -ppp output. 2022-01-29 21:32:44 -05:00
Dianne Skoll
c2be6c348a Fix incorrect logic. 2022-01-29 21:30:32 -05:00
Dianne Skoll
0161f81389 Support old-style -p format as well. 2022-01-29 16:03:56 -05:00
Dianne Skoll
2a2df322dc More consistent error messages. 2022-01-28 18:30:01 -05:00
Dianne Skoll
b276b5fdce Start on man page. 2022-01-28 17:11:28 -05:00
Dianne Skoll
b5f7dabf10 Set default paper size correctly. 2022-01-28 16:42:58 -05:00
Dianne Skoll
307f8a07e0 Don't bother doing work if we set a system variable to the same as existing. 2022-01-28 13:14:14 -05:00
Dianne Skoll
3fe5e2becd More pango test tweaks. 2022-01-28 12:09:47 -05:00
Dianne Skoll
e8a4acf517 Fix height calculation. 2022-01-28 11:51:26 -05:00
Dianne Skoll
9ba28c01e7 Tweak test file to exercise dayname display. 2022-01-28 11:33:58 -05:00
Dianne Skoll
ff3b04f46d Add --help; properly grab first char of day name 2022-01-28 11:25:58 -05:00
Dianne Skoll
9f6f452b18 Don't make rem2pdf.in executable 2022-01-28 11:20:00 -05:00
Dianne Skoll
9b4e35841e Make rem2pdf executable 2022-01-28 11:16:36 -05:00
Dianne Skoll
927e260f5b Generate rem2pdf/bin/rem2pdf so we can embed VERSION 2022-01-28 11:15:07 -05:00
Dianne Skoll
949156f77c Add usage() 2022-01-28 10:40:56 -05:00
Dianne Skoll
cc59fcac58 Fix edge-case with small calendar placement. 2022-01-27 21:51:15 -05:00
Dianne Skoll
db624d8a8a Better error messages. 2022-01-27 21:41:12 -05:00
Dianne Skoll
ae90243352 Don't emit bogus PDF if there's an input error. 2022-01-27 21:37:33 -05:00
Dianne Skoll
ff58c7f699 Don't rebuild Makefile from Makefile.PL unnecessarily 2022-01-27 21:32:36 -05:00
Dianne Skoll
bd9738f6f4 Update test file. 2022-01-27 20:17:13 -05:00
Dianne Skoll
47e5c63290 Obey --small-cal-font option 2022-01-27 18:47:25 -05:00
Dianne Skoll
2abdcac15c Fix scaling of small calendars 2022-01-27 18:46:16 -05:00
Dianne Skoll
f0f12e4099 Refuse to read from a tty 2022-01-27 18:01:22 -05:00
Dianne Skoll
b1720317a4 Revert accidental deletion of lines from .gitignore. 2022-01-27 17:57:28 -05:00
Dianne Skoll
d90f466b53 Proper installation; 2022-01-27 17:56:33 -05:00
Dianne Skoll
fec84a5efc Ignore a generated file. 2022-01-27 17:47:26 -05:00
Dianne Skoll
1f3f869983 Fix up class names 2022-01-27 17:47:06 -05:00
Dianne Skoll
a6bd6f44bf Remove unneeded file. 2022-01-27 17:44:45 -05:00
Dianne Skoll
78aac61fe1 Ignore generated file 2022-01-27 17:42:50 -05:00
Dianne Skoll
8d735f0410 Build/install rem2pdf if prereqs are present 2022-01-27 17:42:22 -05:00
Dianne Skoll
de014732c6 Add more stuff to the script-testing. 2022-01-27 17:22:23 -05:00
Dianne Skoll
aae6511394 More-or-less working version of rem2pdf 2022-01-27 17:10:06 -05:00
Dianne Skoll
d973439b4f More pango-ization. 2022-01-27 15:12:24 -05:00
Dianne Skoll
32adce2de8 Support Pango markup with PANGO special. 2022-01-27 13:29:20 -05:00
Dianne Skoll
2ac6378fea More work on PDF rendering. 2022-01-27 12:41:24 -05:00
Dianne Skoll
153b7df5fc Get moons working. 2022-01-27 11:39:33 -05:00
Dianne Skoll
9d9bdabf79 More work 2022-01-27 10:23:30 -05:00
Dianne Skoll
2f8eaeacf0 More updates. 2022-01-27 09:18:41 -05:00
Dianne Skoll
dc07a3cf32 More work on Pango-ized rem2pdf 2022-01-26 21:11:48 -05:00
Dianne Skoll
b775e60d1b Start on rem2pdf via Cairo/Pango 2022-01-26 20:59:27 -05:00
Dianne Skoll
7290bccfd7 Start working on Remind -> PDF converter using Pango and Cairo 2022-01-26 16:38:49 -05:00
Dianne Skoll
a1d884ec3f Convert finnish.h and german.h to UTF-8 2022-01-26 10:16:23 -05:00
Dianne Skoll
cc05d88618 Convert danish.h to UTF-8 2022-01-26 10:09:48 -05:00
Dianne Skoll
2675fa53df Convert norwgian.h to UTF-8 2022-01-26 10:07:35 -05:00
Dianne Skoll
59ee9198e2 Convert polish.h to UTF-8 2022-01-26 10:01:05 -05:00
Dianne Skoll
5235936e7b Convert French file to UTF-8 2022-01-26 09:49:42 -05:00
Dianne Skoll
03ab44ea10 Don't allow $MonthName or $DayName system variables to be set to a value containing a space. 2022-01-25 22:35:21 -05:00
Dianne Skoll
b8c2d2b39b Bail if argv[0] == NULL. 2022-01-25 22:21:20 -05:00
Dianne Skoll
6ae7e71fbf Document the alternate %*-form of substitutions 2022-01-25 22:13:11 -05:00
Dianne Skoll
c49740ed81 Remove support for character sets other than UTF-8. 2022-01-25 22:08:20 -05:00
Dianne Skoll
16c0a819a9 Fix to language code. 2022-01-25 22:03:34 -05:00
Dianne Skoll
4a61fe73de Convert Italian to UTF-8 2022-01-25 21:55:13 -05:00
Dianne Skoll
a76feebe45 Convert languages to UTF-8 2022-01-25 21:52:09 -05:00
Dianne Skoll
3a52eadeb1 Handle custom day names in calendars. 2022-01-25 21:34:11 -05:00
Dianne Skoll
dd56b7c385 Add system variables for dynamically changing day and month names. 2022-01-25 19:18:59 -05:00
Dianne Skoll
f6f201085c Start adding support for dynamic month and day names. 2022-01-25 18:47:25 -05:00
Dianne Skoll
daf09d9d4e Fix doc bug. 2022-01-24 17:49:00 -05:00
Dianne Skoll
511cdb2784 Document changes to dynamic buffers. 2022-01-24 10:23:49 -05:00
Dianne Skoll
a567a9b777 Document that strlen() can return E_2HIGH 2022-01-22 18:42:11 -05:00
Dianne Skoll
05bc3af03d Use size_t rather than int to track dynamic buffer size.
This lets use create dynamic buffers larger than 2GB.
2022-01-22 18:40:27 -05:00
Dianne Skoll
7a048d1702 Document update to shell() 2022-01-22 18:26:22 -05:00
Dianne Skoll
8d7f9bcb8b Make shell() obey MaxStringLen 2022-01-22 18:24:38 -05:00
Dianne Skoll
9fd8b0f890 Update change to rem2html 2022-01-22 18:11:50 -05:00
Dianne Skoll
86873d0725 Use JSON::MaybeXS instead of JSON (courtesy of Ethan Rooke) 2022-01-22 18:09:02 -05:00
Dianne Skoll
b22438b489 Bump version to 03.03.12. 2022-01-22 09:21:02 -05:00
Dianne Skoll
683b38a7ab 3.3.12 will go out in 2022, not 2021. 2022-01-22 09:19:14 -05:00
Dianne Skoll
d6b4fdd6d3 Always clean up. 2022-01-20 20:10:39 -05:00
Dianne Skoll
c996649954 Update docs. 2022-01-20 19:52:29 -05:00
Dianne Skoll
d59ad77893 Document DO better. 2022-01-20 19:48:49 -05:00
Dianne Skoll
e637c20dee Don't try to do filedir() shenanigans for "DO /absolute/path" 2022-01-20 19:47:04 -05:00
Dianne Skoll
19dc588319 Update regression test file 2022-01-20 19:39:26 -05:00
Dianne Skoll
dc53ef2e71 Document DO 2022-01-20 19:39:12 -05:00
Dianne Skoll
e51d7f3c6d Add "DO file" command which is equivalent to "INCLUDE [filedir()]/file" 2022-01-20 19:30:10 -05:00
Dianne Skoll
5a7e86e443 Update WHATSNEW 2022-01-20 12:41:58 -05:00
Dianne Skoll
7f4edae006 Update test output comparison file. 2022-01-20 09:53:08 -05:00
Dianne Skoll
2f4e1462e3 Document -tt[N] and $DefaultTDelta 2022-01-20 09:52:57 -05:00
Dianne Skoll
54f5d81a8c Properly check for repeated tdelta 2022-01-20 09:52:46 -05:00
Dianne Skoll
d33c27289a Implement $DefaultTDelta system variable and -tt[N] command-line option. 2022-01-20 09:44:17 -05:00
Dianne Skoll
1675fdb499 Keep config file in $XDG_CONFIG_HOME/tkremindrc in preference to ~/.tkremindrc 2021-12-31 16:16:16 -05:00
Dianne Skoll
9321109691 Remove code that annoyed people on Windows or Mac OS X.
I think I've made my point, and the MICROSOFT-AND-APPLE file still exists.
2021-12-31 15:33:43 -05:00
Dianne Skoll
e6a4f939a3 Add brackets. 2021-12-29 20:51:01 -05:00
Dianne Skoll
c7ae214853 Remove comment. 2021-12-29 20:44:46 -05:00
Dianne Skoll
68a9cc047e Add tests for deprecation messages. 2021-12-29 10:42:30 -05:00
Dianne Skoll
1f2b25f852 Write options to a temporary file and then rename 2021-12-28 21:14:33 -05:00
Dianne Skoll
20040c8857 Update WHATSNEW 2021-12-28 21:05:13 -05:00
Dianne Skoll
ac64b0c11f Fix option descriptor. 2021-12-28 21:03:30 -05:00
Dianne Skoll
ba47ce7ca8 Make TkRemind remember printer settings. 2021-12-28 21:02:33 -05:00
Dianne Skoll
be1ab4ea36 Properly support '-i$Latitude="x.yyy"' 2021-12-28 17:56:31 -05:00
Dianne Skoll
13cd9f3d04 Fix memory leak. 2021-12-28 17:53:41 -05:00
Dianne Skoll
8e1f82de5f Get rid of _back function definition (not needed) 2021-12-28 16:59:19 -05:00
Dianne Skoll
8631ad3122 Sort function names alphabetically. 2021-12-28 15:31:03 -05:00
Dianne Skoll
90e6aef9d7 Set default location in custom.h 2021-12-28 15:26:59 -05:00
Dianne Skoll
698190fb72 Set default location right on Parliament Hill. 2021-12-28 15:25:32 -05:00
Dianne Skoll
27cfaa9404 Refactor common code in setting latitude/longitude vars 2021-12-28 14:02:07 -05:00
Dianne Skoll
9f296fe76d Update docs 2021-12-28 10:47:21 -05:00
Dianne Skoll
d0112adb08 Sleep with higher precision in -z0 mode. 2021-12-28 10:32:06 -05:00
123 changed files with 15087 additions and 4385 deletions

3
.gitattributes vendored
View File

@@ -1,4 +1,5 @@
.gitignore export-ignore
.gitattributes export-ignore
remind.php export-ignore
sync-to-dianne-git export-ignore
sync-to-dianne-git export-ignore
php export-ignore

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
liberapay: dskoll

7
.github/README.md vendored Normal file
View File

@@ -0,0 +1,7 @@
# Remind has moved
For various reasons, I have decided to move Remind off GitHub. This repo
will be archived. To create merge requests or issues, please visit
Remind's new home at https://salsa.debian.org/dskoll/remind
-- Dianne Skoll

29
.github/workflows/github-action.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
# language: bash
---
name: Remind unit tests
on:
push
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Remind
uses: actions/checkout@v2
- name: Add test user
run: |
sudo adduser --home /home/testuser --gecos 'Test User' --disabled-password testuser
- name: Fix ownership
run: |
sudo chown -R testuser .
- name: Build
run: |
sudo su -c './configure && make' testuser
- name: Run Tests
run: |
sudo su -c 'make test' testuser
- name: Fix up permissions so GitHub does not complain
run: |
sudo chmod -R a+rwX .

17
.gitignore vendored
View File

@@ -2,16 +2,33 @@
*.o
*~
.gitignore
MYMETA.json
MYMETA.yml
Makefile
TAGS
autom4te.cache
blib/
config.log
config.status
man/rem.1
man/rem2ps.1
man/remind.1
man/tkremind.1
pm_to_blib
rem2html/Makefile
rem2html/rem2html.1
rem2pdf/Makefile.PL
rem2pdf/Makefile.old
rem2pdf/Makefile.top
rem2pdf/bin/rem2pdf
set-irc-topic
src/*.tar.gz*
src/Makefile
src/config.h
src/rem2ps
src/remind
src/test-*.out
src/version.h
tests/test.out
www/Makefile
gmon.out

13
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,13 @@
tests:
image: 'debian:stable-slim'
before_script:
- apt update && apt-get -y install gcc make
- useradd --create-home testuser
- chown -R testuser .
- chmod -R go-w .
script:
- LANG=C.UTF-8 su testuser -c './configure && make all && make test'
artifacts:
when: always
paths:
- tests/test.out

View File

@@ -3,7 +3,7 @@ THE REMIND COPYRIGHT
1. REMIND refers to the entire set of files and documentation in the
REMIND package.
2. REMIND is Copyright 1992-2021 Dianne Skoll, except where noted in
2. REMIND is Copyright 1992-2023 Dianne Skoll, except where noted in
individual files.
3. DISTRIBUTION AND USE

View File

@@ -1,4 +1,5 @@
# Top-level Makefile for Remind.
# SPDX-License-Identifier: GPL-2.0-only
all: src/Makefile
@echo ""
@@ -9,27 +10,41 @@ all: src/Makefile
@echo "*******************"
@echo ""
@cd src && $(MAKE) all LANGDEF=$(LANGDEF)
@$(MAKE) -C rem2pdf -f Makefile.top
install:
@echo ""
@echo "*********************"
@echo "* *"
@echo "* Installing REMIND *"
@echo "* *"
@echo "*********************"
@echo "**********************************"
@echo "* *"
@echo "* Installing REMIND (unstripped) *"
@echo "* *"
@echo "**********************************"
@echo ""
@$(MAKE) -C src install
@$(MAKE) -C rem2html install
@$(MAKE) -C rem2pdf -f Makefile.top install INSTALL_BASE=$(INSTALL_BASE)
clean:
find . -name '*~' -exec rm {} \;
cd src && $(MAKE) clean
-rm man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1
-$(MAKE) -C src clean
-$(MAKE) -C rem2pdf clean
install-stripped:
@echo ""
@echo "********************************"
@echo "* *"
@echo "* Installing REMIND (stripped) *"
@echo "* *"
@echo "**********************************"
@echo ""
@$(MAKE) -C src install-stripped
@$(MAKE) -C rem2html install
@$(MAKE) -C rem2pdf -f Makefile.top install INSTALL_BASE=$(INSTALL_BASE)
test:
@cd src && $(MAKE) -s test
@$(MAKE) -C src -s test
distclean: clean
rm -f config.cache config.log config.status src/Makefile src/config.h tests/test.out www/Makefile
rm -f config.cache config.log config.status src/Makefile src/config.h tests/test.out www/Makefile rem2pdf/Makefile.top rem2pdf/Makefile.old rem2pdf/Makefile rem2pdf/Makefile.PL rem2pdf/bin/rem2pdf
src/Makefile: src/Makefile.in
./configure

40
README
View File

@@ -34,5 +34,45 @@ If you do NOT have Tcl/Tk or are NOT running X Windows:
5) Type: "make install" -- you may need to be root to do this.
PREREQUISITES:
--------------
Remind and rem2ps have no prerequisites beyond the standard C library and
the standard math library.
Rem2HTML requires the JSON::MaybeXS Perl module.
Rem2PDF requires the JSON::MaybeXS, Pango and Cairo Perl modules.
- On Debian-like systems, these prerequisites may be installed with:
apt install libjson-maybexs-perl libpango-perl libcairo-perl
- On RPM-based systems, you need perl-Pango, perl-Cairo and perl-JSON-MaybeXS
- On Gentoo, you need dev-perl/Pango, dev-perl/Cairo and dev-perl/JSON-MaybeXS.
- On Arch linux, you need pango-perl, cairo-perl and perl-json-maybexs
TkRemind requires Tcl/Tk and the tcllib library.
- On Debian-like systems, install with:
apt install tcl tk tcllib
- On RPM-based systems, you need tcl, tk and tcllib
- On Arch Linux, you need tk and tcllib. The latter is available at
https://aur.archlinux.org/packages/tcllib
If the little arrows for "Previous Month" and "Next Month" do not display
correctly in TkRemind, you may need to install the Noto Fonts. Install
all of your distribution's Nonto Font-related packages.
- On Debian-like systems, install with:
apt install fonts-noto-core fonts-noto-color-emoji \
fonts-noto-extra fonts-noto-ui-core fonts-noto-ui-extra
==========================================================================
Contact info: mailto:dianne@skoll.ca
Home page: https://dianne.skoll.ca/projects/remind/

View File

@@ -1,5 +1,6 @@
#!/bin/sh
# -*-Mode: TCL;-*-
# SPDX-License-Identifier: GPL-2.0-only
#--------------------------------------------------------------
# BUILD.TK
@@ -27,16 +28,14 @@ proc SetConfigDefaults {} {
global Config
set Config(LAT_DEG) 45
set Config(LAT_MIN) 24
set Config(LAT_SEC) 14
set Config(LON_DEG) 75
set Config(LON_MIN) 39
set Config(LON_SEC) 23
set Config(LOCATION) "Ottawa"
set Config(DEFAULT_PAGE) "Letter"
set Config(DATESEP) "-"
set Config(TIMESEP) ":"
set Config(ISOLATIN1) 0
set Config(IBMEXTENDED) 0
set Config(ISOLATIN2) 0
set Config(IBM852) 0
set Config(NORTHERN_HEMISPHERE) 1
set Config(WESTERN_HEMISPHERE) 1
set Config(LANGUAGE) "English"
@@ -161,10 +160,14 @@ proc CreateLocationDialog { w } {
-from 0 -to 89 -length 300 -variable Config(LAT_DEG)
scale $w.latmin -label "Latitude (minutes)" -orient horizontal \
-from 0 -to 59 -length 300 -variable Config(LAT_MIN)
scale $w.latsec -label "Latitude (seconds)" -orient horizontal \
-from 0 -to 59 -length 300 -variable Config(LAT_SEC)
scale $w.londeg -label "Longitude (degrees)" -orient horizontal \
-from 0 -to 179 -length 300 -variable Config(LON_DEG)
scale $w.lonmin -label "Longtude (minutes)" -orient horizontal \
-from 0 -to 59 -length 300 -variable Config(LON_MIN)
scale $w.lonsec -label "Longitude (seconds)" -orient horizontal \
-from 0 -to 59 -length 300 -variable Config(LON_SEC)
radiobutton $w.north -text "Northern Hemisphere" \
-variable Config(NORTHERN_HEMISPHERE) -value 1
@@ -180,8 +183,10 @@ proc CreateLocationDialog { w } {
$w.location insert end $Config(LOCATION)
grid $w.latdeg -
grid $w.latmin -
grid $w.latsec -
grid $w.londeg -
grid $w.lonmin -
grid $w.lonsec -
grid $w.north $w.west
grid $w.south $w.east
@@ -233,19 +238,6 @@ proc CreateOptionsDialog { w } {
grid configure $w.timelabel -row 2 -column 0 -sticky e
grid configure $w.time -row 2 -column 1 -sticky nsew
label $w.charlabel -text "Character set: "
menubutton $w.char -text "ISO 8859-1" -indicatoron 1 -relief raised \
-menu $w.char.menu
menu $w.char.menu -tearoff 0
$w.char.menu add command -label "ISO 8859-1" -command "$w.char configure -text {ISO 8859-1}"
$w.char.menu add command -label "ISO 8859-2" -command "$w.char configure -text {ISO 8859-2}"
$w.char.menu add command -label "IBM Extended" -command "$w.char configure -text {IBM Extended}"
$w.char.menu add command -label "IBM CPI-852" -command "$w.char configure -text {ISO 8859-2}"
$w.char.menu add command -label "Plain ASCII" -command "$w.char configure -text {Plain ASCII}"
grid configure $w.charlabel -row 3 -column 0 -sticky e
grid configure $w.char -row 3 -column 1 -sticky nsew
label $w.langlabel -text "Language: "
menubutton $w.lang -text $Config(LANGUAGE) -indicatoron 1 -relief raised \
-menu $w.lang.menu
@@ -268,8 +260,8 @@ proc CreateOptionsDialog { w } {
$w.lang.menu add command -label $lang -command [list $w.lang configure -text $lang]
}
grid configure $w.langlabel -row 4 -column 0 -sticky e
grid configure $w.lang -row 4 -column 1 -sticky nsew
grid configure $w.langlabel -row 3 -column 0 -sticky e
grid configure $w.lang -row 3 -column 1 -sticky nsew
}
@@ -364,7 +356,7 @@ proc RunCommand { cmd } {
# %RETURNS:
# Nothing
# %DESCRIPTION:
# Reads characters from command pipelin and appends them to .msg.
# Reads characters from command pipeline and appends them to .msg.
#***********************************************************************
proc CommandReadable { f } {
global CmdDone
@@ -423,15 +415,19 @@ proc CreateCustomH {} {
# modify them willy-nilly
set LAT_DEG $Config(LAT_DEG)
set LAT_MIN $Config(LAT_MIN)
set LAT_SEC $Config(LAT_SEC)
set LON_DEG $Config(LON_DEG)
set LON_MIN $Config(LON_MIN)
set LON_SEC $Config(LON_SEC)
if {!$Config(NORTHERN_HEMISPHERE)} {
set LAT_DEG "-$LAT_DEG"
set LAT_MIN "-$LAT_MIN"
set LAT_SEC "-$LAT_SEC"
}
if {!$Config(WESTERN_HEMISPHERE)} {
set LON_DEG "-$LON_DEG"
set LON_MIN "-$LON_MIN"
set LON_SEC "-$LON_SEC"
}
set Config(LOCATION) [$Loc.location get]
@@ -446,38 +442,17 @@ proc CreateCustomH {} {
set Config(DATESEP) [$Options.date cget -text]
set Config(TIMESEP) [$Options.time cget -text]
switch -- [$Options.char cget -text] {
"ISO 8859-1" {
set Config(ISOLATIN1) 1
}
"ISO 8859-2" {
set Config(ISOLATIN2) 1
}
"IBM CPI-852" {
set Config(IBM852) 1
}
"IBM Extended" {
set Config(IBMEXTENDED) 1
}
}
while {[gets $in line] != -1} {
switch -glob -- $line {
"#define LAT_DEG *" {
puts $out "#define LAT_DEG $LAT_DEG"
.msgs insert end "#define LAT_DEG $LAT_DEG\n"
"#define DEFAULT_LATITUDE *" {
set lat [expr $LAT_DEG + ($LAT_MIN/60.0) + ($LAT_SEC/3600.0)];
puts $out "#define DEFAULT_LATITUDE $lat"
.msgs insert end "#define DEFAULT_LATITUDE $lat"
}
"#define LAT_MIN *" {
puts $out "#define LAT_MIN $LAT_MIN"
.msgs insert end "#define LAT_MIN $LAT_MIN\n"
}
"#define LON_DEG *" {
puts $out "#define LON_DEG $LON_DEG"
.msgs insert end "#define LON_DEG $LON_DEG\n"
}
"#define LON_MIN *" {
puts $out "#define LON_MIN $LON_MIN"
.msgs insert end "#define LON_MIN $LON_MIN\n"
"#define DEFAULT_LONGITUDE *" {
set lon [expr -1.0 * ($LON_DEG + ($LON_MIN/60.0) + ($LON_SEC/3600.0))]
puts $out "#define DEFAULT_LONGITUDE $lon"
.msgs insert end "#define DEFAULT_LONGITUDE $lon"
}
"#define LOCATION *" {
puts $out "#define LOCATION \"$Config(LOCATION)\""
@@ -495,22 +470,6 @@ proc CreateCustomH {} {
puts $out "#define TIMESEP '$Config(TIMESEP)'"
.msgs insert end "#define TIMESEP '$Config(TIMESEP)'\n"
}
"#define ISOLATIN1 *" {
puts $out "#define ISOLATIN1 $Config(ISOLATIN1)"
.msgs insert end "#define ISOLATIN1 $Config(ISOLATIN1)\n"
}
"#define ISOLATIN2 *" {
puts $out "#define ISOLATIN2 $Config(ISOLATIN2)"
.msgs insert end "#define ISOLATIN2 $Config(ISOLATIN2)\n"
}
"#define IBM852 *" {
puts $out "#define IBM852 $Config(IBM852)"
.msgs insert end "#define IBM852 $Config(IBM852)\n"
}
"#define IBMEXTENDED *" {
puts $out "#define IBMEXTENDED $Config(IBMEXTENDED)"
.msgs insert end "#define IBMEXTENDED $Config(IBMEXTENDED)\n"
}
default {
puts $out $line
}
@@ -806,14 +765,17 @@ proc SetConfigFromRemind {} {
# Query Remind for the rest
QueryRemind $rem LAT_DEG {$LatDeg}
QueryRemind $rem LAT_MIN {$LatMin}
QueryRemind $rem LAT_SEC {$LatSec}
QueryRemind $rem LON_DEG {$LongDeg}
QueryRemind $rem LON_MIN {$LongMin}
QueryRemind $rem LON_SEC {$LongSec}
QueryRemind $rem LOCATION {$Location}
QueryRemind $rem DATESEP {$DateSep}
QueryRemind $rem TIMESEP {$TimeSep}
QueryRemind $rem LANGUAGE {language()}
set $Config(LAT_MIN) [expr abs($Config(LAT_MIN))]
set $Config(LAT_SEC) [expr abs($Config(LAT_SEC))]
if {$Config(LAT_DEG) >= 0} {
set Config(NORTHERN_HEMISPHERE) 1
} else {
@@ -822,6 +784,7 @@ proc SetConfigFromRemind {} {
}
set $Config(LON_MIN) [expr abs($Config(LON_MIN))]
set $Config(LON_SEC) [expr abs($Config(LON_SEC))]
if {$Config(LON_DEG) >= 0} {
set Config(WESTERN_HEMISPHERE) 1
} else {

127
configure vendored
View File

@@ -622,6 +622,8 @@ ac_includes_default="\
ac_header_list=
ac_subst_vars='LTLIBOBJS
LIBOBJS
RELEASE_DATE
PERLARTIFACTS
VERSION
EGREP
GREP
@@ -681,6 +683,7 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_perl_build_artifacts
'
ac_precious_vars='build_alias
host_alias
@@ -1305,6 +1308,13 @@ if test -n "$ac_init_help"; then
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-perl-build-artifacts
Disable perllocal.pod and .packlist generation
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
@@ -2292,35 +2302,15 @@ EOF
ac_config_headers="$ac_config_headers src/config.h"
if test "`uname -s`" = "Darwin" ; then
trap 'echo Be patient...' INT TERM
cat <<'EOF'
Please don't use Apple products. This script will continue in 30 seconds
if you insist on compiling Remind on Mac OS X.
EOF
for i in 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 ; do
sleep 1
done
trap - INT
trap - TERM
# Check whether --enable-perl-build-artifacts was given.
if test "${enable_perl_build_artifacts+set}" = set; then :
enableval=$enable_perl_build_artifacts; ac_cv_perlartifacts=$enableval
else
ac_cv_perlartifacts=yes
fi
if uname -s | grep -i -q 'cygwin' ; then
trap 'echo Be patient...' INT TERM
cat <<'EOF'
Please don't use Microsoft products. This script will continue in 30
seconds if you insist on compiling Remind on Cygwin.
EOF
for i in 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 ; do
sleep 1
done
trap - INT
trap - TERM
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -3317,7 +3307,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5
$as_echo_n "checking for sqrt in -lm... " >&6; }
if ${ac_cv_lib_m_sqrt+:} false; then :
@@ -3761,39 +3750,6 @@ fi
done
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
# This bug is HP SR number 8606223364.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short" >&5
$as_echo_n "checking size of unsigned short... " >&6; }
if ${ac_cv_sizeof_unsigned_short+:} false; then :
$as_echo_n "(cached) " >&6
else
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short))" "ac_cv_sizeof_unsigned_short" "$ac_includes_default"; then :
else
if test "$ac_cv_type_unsigned_short" = yes; then
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot compute sizeof (unsigned short)
See \`config.log' for more details" "$LINENO" 5; }
else
ac_cv_sizeof_unsigned_short=0
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short" >&5
$as_echo "$ac_cv_sizeof_unsigned_short" >&6; }
cat >>confdefs.h <<_ACEOF
#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short
_ACEOF
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -3861,7 +3817,7 @@ _ACEOF
for ac_header in sys/types.h sys/file.h glob.h wctype.h locale.h
for ac_header in sys/types.h sys/file.h glob.h wctype.h locale.h langinfo.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -4018,8 +3974,45 @@ fi
if test "$GCC" = yes; then
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
# Check for link-time optimization support
f=-flto=auto
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $f" >&5
$as_echo_n "checking whether $CC supports $f... " >&6; }
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
CFLAGS="$CFLAGS $f"
f=-ffat-lto-objects
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $f" >&5
$as_echo_n "checking whether $CC supports $f... " >&6; }
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
CFLAGS="$CFLAGS $f"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test "$ac_cv_perlartifacts" = "yes" ; then
PERLARTIFACTS=
else
PERLARTIFACTS='NO_PACKLIST=1 NO_PERLLOCAL=1'
fi
RELEASE_DATE=`grep '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]' docs/WHATSNEW | head -n 1 | awk '{print $NF}'`
# Sanity-check release date
echo "$RELEASE_DATE" | grep '^....-..-..$' > /dev/null 2>&1
if test "$?" != 0 ; then
echo "*** COULD NOT DETERMINE RELEASE DATE: docs/WHATSNEW is incorrect!"
exit 1
fi
for ac_func in setenv unsetenv glob mbstowcs setlocale initgroups
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
@@ -4032,10 +4025,12 @@ _ACEOF
fi
done
VERSION=03.03.11
VERSION=04.02.02
ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h rem2html/Makefile"
ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -4732,6 +4727,13 @@ do
"www/Makefile") CONFIG_FILES="$CONFIG_FILES www/Makefile" ;;
"src/version.h") CONFIG_FILES="$CONFIG_FILES src/version.h" ;;
"rem2html/Makefile") CONFIG_FILES="$CONFIG_FILES rem2html/Makefile" ;;
"rem2pdf/Makefile.PL") CONFIG_FILES="$CONFIG_FILES rem2pdf/Makefile.PL" ;;
"rem2pdf/Makefile.top") CONFIG_FILES="$CONFIG_FILES rem2pdf/Makefile.top" ;;
"rem2pdf/bin/rem2pdf") CONFIG_FILES="$CONFIG_FILES rem2pdf/bin/rem2pdf" ;;
"man/rem.1") CONFIG_FILES="$CONFIG_FILES man/rem.1" ;;
"man/rem2ps.1") CONFIG_FILES="$CONFIG_FILES man/rem2ps.1" ;;
"man/remind.1") CONFIG_FILES="$CONFIG_FILES man/remind.1" ;;
"man/tkremind.1") CONFIG_FILES="$CONFIG_FILES man/tkremind.1" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@@ -5318,3 +5320,4 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
chmod a+x rem2pdf/bin/rem2pdf

View File

@@ -14,35 +14,11 @@ EOF
AC_CONFIG_HEADER(src/config.h)
if test "`uname -s`" = "Darwin" ; then
trap 'echo Be patient...' INT TERM
cat <<'EOF'
AC_ARG_ENABLE(perl-build-artifacts,
[ --disable-perl-build-artifacts
Disable perllocal.pod and .packlist generation], ac_cv_perlartifacts=$enableval, ac_cv_perlartifacts=yes)
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
AH_BOTTOM([#include <custom.h>])
dnl Checks for programs.
AC_PROG_CC
@@ -52,17 +28,14 @@ AC_PROG_MAKE_SET
AC_PATH_PROG([PERL], [perl])
dnl Checks for libraries.
dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, sqrt)
dnl Integer sizes
AC_CHECK_SIZEOF(unsigned short)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(unsigned long)
dnl Checks for header files.
AC_CHECK_HEADERS(sys/types.h sys/file.h glob.h wctype.h locale.h)
AC_CHECK_HEADERS(sys/types.h sys/file.h glob.h wctype.h locale.h langinfo.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_STRUCT_TM
@@ -73,10 +46,44 @@ AC_HEADER_TIME
if test "$GCC" = yes; then
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
# Check for link-time optimization support
f=-flto=auto
AC_MSG_CHECKING([whether $CC supports $f])
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS $f"
f=-ffat-lto-objects
AC_MSG_CHECKING([whether $CC supports $f])
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS $f"
else
AC_MSG_RESULT([no])
fi
else
AC_MSG_RESULT([no])
fi
fi
if test "$ac_cv_perlartifacts" = "yes" ; then
PERLARTIFACTS=
else
PERLARTIFACTS='NO_PACKLIST=1 NO_PERLLOCAL=1'
fi
RELEASE_DATE=`grep '[[0-9]][[0-9]][[0-9]][[0-9]]-[[0-9]][[0-9]]-[[0-9]][[0-9]]' docs/WHATSNEW | head -n 1 | awk '{print $NF}'`
# Sanity-check release date
echo "$RELEASE_DATE" | grep '^....-..-..$' > /dev/null 2>&1
if test "$?" != 0 ; then
echo "*** COULD NOT DETERMINE RELEASE DATE: docs/WHATSNEW is incorrect!"
exit 1
fi
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
VERSION=03.03.11
VERSION=04.02.02
AC_SUBST(VERSION)
AC_SUBST(PERL)
AC_OUTPUT(src/Makefile www/Makefile src/version.h rem2html/Makefile)
AC_SUBST(PERLARTIFACTS)
AC_SUBST(RELEASE_DATE)
AC_OUTPUT(src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1)
chmod a+x rem2pdf/bin/rem2pdf

View File

@@ -32,7 +32,7 @@
# version 0.5 2007-03-21
# - Add more help options
# - --project-lead-time option
# - Supress printing of heading if there are no todos to print
# - Suppress printing of heading if there are no todos to print
# version 0.4
# - Version 0.4 changes all written or inspired by, and thanks to Mark Stosberg
# - Change to GetOptions
@@ -84,7 +84,7 @@ How may days in advance to start getting reminders about the events. Defaults to
ical2rem.pl --no-todos
If you don't care about the ToDos the calendar, this will surpress
If you don't care about the ToDos the calendar, this will suppress
printing of the ToDo heading, as well as skipping ToDo processing.
=head2 --heading

View File

@@ -141,7 +141,7 @@ appear with exactly the text and exactly the same duration (including
one VEVENT object, that will have a RFC2445 C<RDATE> property.
B<rem2ics> is not yet smart enough to derive an C<RRULE> based
recurrance. If you really want that feature, either implement it and
recurrence. If you really want that feature, either implement it and
send in a patch, or contact the author and convince him to do it.
=head2 Other iCalendar Properties
@@ -164,7 +164,7 @@ runs.
=head2 Other iCalendar Perl objects
Why does't B<rem2ics> use any of the iCalendar Perl stuff in CPAN?
Why doesn't B<rem2ics> use any of the iCalendar Perl stuff in CPAN?
Because I don't trust them, and they are too big for this app. One
links to a binary library. Another hasn't been maintained since 1991,
and is full of notes as to how buggy and incomplete it is. And so
@@ -218,7 +218,7 @@ Bug fix, error message for non-recurring events
Bug fix,
rem2ics 0.91 chokes on timed reminders with
duration using `remind -s` as it functions in remind-03.01.03.
Remind 3.01 changed how the -s data is formated for events that have a duration
Remind 3.01 changed how the -s data is formatted for events that have a duration
Patch by Paul Hinze E<lt>paul dot t dot hinze at gmail dot comE<gt>
and Michael Schultz E<lt>mjschultz at gmail dot comE<gt>
@@ -376,7 +376,7 @@ foreach $v (@events) {
my(%grovel);
# if the user doesnt want recurrance detection
# if the user doesn't want recurrence detection
unless ($options{norecurr}) {
# then dont put events in the grovel hash
@@ -393,7 +393,7 @@ unless ($options{norecurr}) {
$v = ${$grovel{$k}}[0];
$v->{recurlist} = \@{$grovel{$k}};
foreach my $v0 (@{$grovel{$k}}) {
$v0->{is_recurrance} = $v;
$v0->{is_recurrence} = $v;
}
}
}
@@ -409,12 +409,12 @@ unless ($options{norecurr}) {
# might have a problem if a recurring event has two instances both on
# the first day.
# Every event that is recurring has a "is_recurrance" property.
# Every event that is recurring has a "is_recurrence" property.
# Additionally, (hopefully) the first/earliest event in a set of
# recurrances has a "recurlist" property. The "recurlist" is a
# recurrences has a "recurlist" property. The "recurlist" is a
# reference to a list of references to each of the events. The first
# one on that list will be the same event that has the "recurlist"
# property. The "is_recurrance" property is a reference back to the
# property. The "is_recurrence" property is a reference back to the
# event that has the "recurlist" property.
foreach my $k (keys %grovel) {
@@ -466,8 +466,8 @@ foreach my $k (keys %grovel) {
}
foreach $v (@events) {
# for recurrant events, skip those that arnt the "head"
next if ($v->{is_recurrance} and (not $v->{recurlist}));
# for recurrent events, skip those that arnt the "head"
next if ($v->{is_recurrence} and (not $v->{recurlist}));
if (${$v->{sf}}[4] eq "*") { # no time was given
$v->{i_dtstart} = sprintf("DTSTART:%s", $v->{dts});
@@ -485,7 +485,7 @@ foreach $v (@events) {
}
if (${$v->{sf}}[3] ne "*") { # a duration was given
# It's convienient that RFC2445 defines DURATION, thus we
# It's convenient that RFC2445 defines DURATION, thus we
# don't need to calculate DTEND, with awkward figuring out
# crossing hours, days, months, year, etc. Instead we
# will let the iCalendar consuming application worry about it.
@@ -501,8 +501,8 @@ print "BEGIN:VCALENDAR\015\012"
# output each vevent
foreach $v (@events) {
# for recurrant events, only output the "head", skip the others
next if ($v->{is_recurrance} and (not $v->{recurlist}));
# for recurrent events, only output the "head", skip the others
next if ($v->{is_recurrence} and (not $v->{recurlist}));
print "BEGIN:VEVENT\015\012";
my $tag = ${$v->{sf}}[2];

View File

@@ -5,7 +5,7 @@
;; Author: Shelagh Manton <shelagh.manton@gmail.com> with help from
;; Dianne Skoll
;; Keywords: remind configure convenience
;; Version: 0.14
;; Version: 0.15-dfs2
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
@@ -91,7 +91,6 @@
(define-key remind-conf-mode-map "\C-c\C-x" 'rem-tomorrow)
(define-key remind-conf-mode-map "\C-c\C-a" 'rem-days-away)
(define-key remind-conf-mode-map "\M-j" 'remind-indent-line)
(define-key remind-conf-mode-map (kbd "RET") 'remind-indent-line)
(define-key remind-conf-mode-map "\C-c\C-c" 'rem-save-file)
;; syntax-table
@@ -111,12 +110,18 @@
(defconst remind-keywords
(sort
(list "RUN" "REM" "ONCE" "SATISFY" "BEFORE" "UNSET" "OMIT" "FIRST" "SATISFY"
"OMIT" "DATE" "SKIP" "ONCE" "AFTER" "WARN" "PRIORITY" "AT" "SCHED" "IF" "ELSE" "ENDIF"
"WARN" "UNTIL" "THROUGH" "SCANFROM" "DURATION" "TAG" "MSG" "MSF" "CAL" "SPECIAL" "IFTRIG"
"PS" "PSFILE" "BANNER" "INCLUDE" "PUSH-OMIT-CONTEXT" "DEBUG" "DUMPVARS" "PUSH" "CLEAR" "POP"
"CLEAR-OMIT-CONTEXT" "POP-OMIT-CONTEXT" "SET" "ERRMSG" "FSET" "DUMP" "BAN" "INC" "SCAN"
"EXIT" "FLUSH" "PRESERVE" "MOON" "COLOR" "UNSET")
(list "ADDOMIT" "AFTER" "AT" "BANNER" "BEFORE"
"CAL" "CLEAR-OMIT-CONTEXT" "DEBUG" "DO" "DUMPVARS"
"DURATION" "ELSE" "ENDIF" "ERRMSG" "EXIT" "FIRST"
"FLUSH" "FOURTH" "FROM" "FSET" "IF" "IFTRIG" "IN"
"INCLUDE" "INCLUDECMD" "LAST" "LASTDAY"
"LASTWORKDAY" "MAYBE-UNCOMPUTABLE" "MSF"
"MSG" "OMIT" "OMITFUNC" "ONCE"
"POP-OMIT-CONTEXT" "PRESERVE" "PRIORITY" "PS" "PSFILE"
"PUSH-OMIT-CONTEXT" "REM" "RUN" "SATISFY" "SCANFROM"
"SCHED" "SECOND" "SET" "SKIP" "SPECIAL"
"TAG" "THIRD" "THROUGH" "UNSET" "UNTIL"
"WARN")
#'(lambda (a b) (> (length a) (length b)))))
@@ -127,12 +132,20 @@
(defconst remind-builtin-variables
(sort
(list "$CalcUTC" "$CalMode" "$Daemon" "$DateSep" "$DefaultPrio" "$DontFork" "$DontTrigAts" "$DontQueue"
"$EndSent" "$EndSentIg" "$NumTrig" "$FirstIndent" "$FoldYear" "$FormWidth" "$HushMode"
"$IgnoreOnce" "$InfDelta" "$NextMode" "$NumQueued" "$NumTrig" "$PrefixLineNo" "$PSCal" "$RunOff"
"$SimpleCal" "$SortByDate" "$SortByPrio" "$MinsFromUTC" "$LatDeg" "$LatMin" "$LatSec" "$EndSent"
"$EndSentIg" "$Location" "$LongDeg" "$LongMin" "$LongSec" "$MaxSatIter" "$SubsIndent" "$T" "$Td"
"$Tm" "$Tw" "$Ty" "$TimeSep" "$UntimedFirst" "$U" "$Ud" "$Um" "$Uw" "$Uy")
(list "$Ago" "$Am" "$And" "$April" "$At" "$August" "$CalcUTC" "$CalMode" "$Daemon" "$DateSep"
"$DateTimeSep" "$December" "$DefaultColor" "$DefaultPrio"
"$DefaultTDelta" "$DeltaOffset" "$DontFork" "$DontQueue"
"$DontTrigAts" "$EndSent" "$EndSentIg" "$February" "$FirstIndent"
"$FoldYear" "$FormWidth" "$Friday" "$Fromnow" "$Hour" "$Hplu" "$HushMode" "$IgnoreOnce"
"$InfDelta" "$IntMax" "$IntMin" "$Is" "$January" "$July" "$June" "$LatDeg"
"$Latitude" "$LatMin" "$LatSec" "$Location" "$LongDeg" "$Longitude"
"$LongMin" "$LongSec" "$March" "$MaxSatIter" "$MaxStringLen" "$May"
"$MinsFromUTC" "$Minute" "$Monday" "$Mplu" "$NextMode" "$November" "$Now" "$NumQueued"
"$NumTrig" "$October" "$On" "$Pm" "$PrefixLineNo" "$PSCal" "$RunOff" "$Saturday"
"$September" "$SimpleCal" "$SortByDate" "$SortByPrio" "$SortByTime"
"$SubsIndent" "$Sunday" "$SysInclude" "$T" "$Td" "$Thursday" "$TimeSep" "$Tm"
"$Today" "$Tomorrow" "$Tuesday" "$Tw" "$Ty" "$U" "$Ud" "$Um" "$UntimedFirst" "$Uw" "$Uy"
"$Was" "$Wednesday")
#'(lambda (a b) (> (length a) (length b)))))
@@ -147,15 +160,22 @@
(defconst remind-builtin-functions
(sort
(list "abs" "access" "args" "asc" "baseyr" "char" "choose" "coerce" "current" "date" "datetime" "datepart"
"dawn" "day" "daysinmon" "defined" "dosubst" "dusk" "easter" "easterdate" "evaltrig" "filedate"
"filedatetime" "filedir" "filename" "getenv" "hebdate" "hebday" "hebmon" "hebyear" "hour" "iif" "index" "isdst"
"isleap" "isomitted" "language" "lower" "max" "min" "minute" "minsfromutc" "mon" "monnum" "moondate" "moondatetime"
"moonphase" "moontime" "msgprefix" "msgsuffix" "nonomitted" "now" "ord" "ostype" "plural"
"psmoon" "psshade" "realcurrent" "realnow" "realtoday" "sgn" "shell" "slide" "strlen" "substr" "sunrise" "sunset" "time" "timepart"
"thisyear" "today" "trigdate" "trigdatetime" "trigger" "trigger" "trigtime" "trigvalid" "typeof" "tzconvert" "upper" "value"
"version" "weekno" "wkday" "wkdaynum" "year"
)
(list "abs" "access" "adawn" "adusk" "ampm" "args" "asc" "baseyr" "char"
"choose" "coerce" "current" "date" "datepart" "datetime" "dawn" "day"
"daysinmon" "defined" "dosubst" "dusk" "easterdate" "evaltrig"
"filedate" "filedatetime" "filedir" "filename" "getenv" "hebdate"
"hebday" "hebmon" "hebyear" "hour" "iif" "index" "isany" "isdst"
"isleap" "isomitted" "language" "lower" "max" "min" "minsfromutc"
"minute" "mon" "monnum" "moondate" "moondatetime" "moonphase"
"moontime" "ndawn" "ndusk" "nonomitted" "now" "ord" "ostype" "pad" "plural"
"psmoon" "psshade" "realcurrent" "realnow" "realtoday" "sgn" "shell"
"shellescape" "slide" "strlen" "substr" "sunrise" "sunset" "time"
"timepart" "today" "trig" "trigback" "trigdate" "trigdatetime"
"trigdelta" "trigduration" "trigeventduration" "trigeventstart"
"trigfrom" "trigger" "trigpriority" "trigrep" "trigscanfrom"
"trigtime" "trigtimedelta" "trigtimerep" "triguntil" "trigvalid"
"typeof" "tzconvert" "upper" "value" "version" "weekno" "wkday"
"wkdaynum" "year")
#'(lambda (a b) (> (length a) (length b)))))
;;; faces
@@ -244,12 +264,35 @@
:group 'remind-conf
)
(defconst remind-keywords-regex (regexp-opt remind-keywords 'words))
(defconst remind-type-keywords-regex (regexp-opt remind-type-keywords 'words))
(defconst remind-builtin-variables-regex (regexp-opt remind-builtin-variables 'words))
(defconst remind-builtin-functions-regex (regexp-opt remind-builtin-functions 'words))
(defconst remind-time-words-regex (regexp-opt remind-time-words 'words))
;; Case-insensitive matching functions
(defun remind-keywords-matcher (limit)
(let ((case-fold-search t))
(re-search-forward remind-keywords-regex limit 'no-error)))
(defun remind-type-keywords-matcher (limit)
(let ((case-fold-search t))
(re-search-forward remind-type-keywords-regex limit 'no-error)))
(defun remind-builtin-variables-matcher (limit)
(let ((case-fold-search t))
(re-search-forward remind-builtin-variables-regex limit 'no-error)))
(defun remind-builtin-functions-matcher (limit)
(let ((case-fold-search t))
(re-search-forward remind-builtin-functions-regex limit 'no-error)))
(defun remind-time-words-matcher (limit)
(let ((case-fold-search t))
(re-search-forward remind-time-words-regex limit 'no-error)))
;; keywords
(defconst remind-conf-font-lock-keywords-1
(list
'("^[\;\#]\\s-+.*$" . remind-comment-face)
(cons (regexp-opt remind-keywords 'words) remind-conf-keyword-face)
'(remind-keywords-matcher . remind-conf-keyword-face)
'("%[\"_]" . font-lock-warning-face)
'("\\(%[a-mops-w]\\)" . remind-conf-substitutes-face)
'("\"[^\"]*\"" . remind-string-face))
@@ -258,15 +301,15 @@
(defconst remind-conf-font-lock-keywords-2
(append remind-conf-font-lock-keywords-1
(list
(cons (regexp-opt remind-time-words 'words) remind-time-face)
(cons (regexp-opt remind-builtin-functions 'words) remind-conf-command-face)
'(remind-time-words-matcher . remind-time-face)
'(remind-builtin-functions-matcher . remind-conf-command-face)
'("%$" . remind-conf-endline-face)))
"Additional commands to highlight in `remind-conf-mode'.")
(defconst remind-conf-font-lock-keywords-3
(append remind-conf-font-lock-keywords-2
(list
(cons (regexp-opt remind-type-keywords 'words) remind-conf-type-face)
'(remind-type-keywords-matcher . remind-conf-type-face)
'("\[[a-zA-Z]\\{3,6\\}\]" . remind-conf-color-face)
'("\\s-+\\([12][0-9]\\|3[01]\\|0?[0-9]\\)\\s-+" . remind-conf-substitutes-face);better date regexp
'("\\s-+\\([12][09][0-9][0-9][-/]\\(0[1-9]\\|1[0-2]\\)[-/]\\([12][0-9]\\|0[1-9]\\|3[01]\\)\\)\\s-+" . remind-time-face) ;; pseudo ISO 8601 date format.
@@ -274,7 +317,7 @@
'("\\s-+\\(\\(?:20\\|19\\)[0-9][0-9]\\)\\s-+" . remind-conf-substitutes-face);years
'("\\s-+\\(2[0-4]\\|[01]?[0-9][.:][0-5][0-9]\\)\\s-+" . remind-conf-substitutes-face);24hour clock, more precise
'("\\s-+\\([+-][+-]?[1-9][0-9]*\\)\\s-+" 1 remind-conf-delta-face prepend)
(cons (regexp-opt remind-builtin-variables 'words) remind-conf-variable-face)))
'(remind-builtin-variables-matcher . remind-conf-variable-face)))
"The ultimate in highlighting experiences for `remind-conf-mode'.")
;;YYYY-MM-DD@hh:mm, YYYY-MM-DD@hh.mm, YYYY/MM/DD@hh:mm and YYYY/MM/DD@hh.mm
@@ -462,12 +505,11 @@ Acts on the region or places point where it needs to be."
;; finally the derived mode.
;;;###autoload
(define-derived-mode remind-conf-mode text-mode "REM"
(define-derived-mode remind-conf-mode text-mode "Remind Conf Mode"
"Major mode for editing remind calendar configuration files.
\\{remind-conf-mode-map}"
:syntax-table remind-conf-syntax-table
(set (make-local-variable 'font-lock-keywords-case-fold-search) t) ;this is not working atm 2009-04-13
(set (make-local-variable 'font-lock-defaults) '(remind-conf-font-lock-keywords))
(set (make-local-variable 'comment-start) ";")
(set (make-local-variable 'comment-start) "#")

View File

@@ -69,6 +69,8 @@ know! Here are the basic guidelines:
- You can test your language file with the script "tests/tstlang.rem"
- Your localized strings must be encoded using UTF-8.
RELEASE NOTES -- miscellaneous info that couldn't go anywhere else!
1. POPUP REMINDERS

View File

@@ -1,16 +1,479 @@
CHANGES TO REMIND
* VERSION 4.2 Patch 3 - 2023-??-??
- NEW FEATURE: Remind: add the orthodoxeaster() function to return the
date of Orthodox Easter.
- IMPROVEMENT: Add Greek language support courtesy of JeiEl.
- IMPROVEMENT: Add Greek holiday file courtesy of JeiEl.
- BUG FIX: examples/defs.rem: Fix the calculation of US Tax Day as per
Tavis Ormandy and Tim Chase.
* VERSION 4.2 Patch 2 - 2023-01-01
- NEW FEATURE: Remind: Add the NOQUEUE modifier to the REM statement for
explicitly telling Remind not to queue a timed reminder.
- NEW FEATURE: Remind: Add soleq() function to return the DATETIME of
solstices and equinoxes. See $SysInclude/seasons.rem for an example
of how to use the function.
- MINOR IMPROVEMENT: Update examples/astro to include solstices and equinoxes.
- BUG FIX: TkRemind: Provide better error indication if showing today's
reminders fails on startup.
- BUG FIX: Remind: Refuse to read world-writable directories.
- BUG FIX: Tests depended on the actual date of the test run. This has
been fixed.
- INTERNAL CHANGE: Remind: Change inappropriately-named "Julian" variables
to "DSE" (= Days Since Epoch) since they weren't really holding true
Julian dates.
- INTERNAL CHANGE: Add "SPDX-License-Identifier" tags to most files.
* VERSION 4.2 Patch 1 - 2022-12-15
- MINOR IMPROVEMENT: TkRemind: If "Extra Remind Options" contains -m, make
TkRemind start the calendar with Monday instead of Sunday.
- MINOR IMPROVEMENT: Sample files: Add French holidays courtesy of
Clément Bœsch.
- MINOR IMPROVEMENT: A few performance fixes, likely not even noticeable in
most cases.
- MINOR FIXES: Fix misleading comments in the source code.
- MINOR FIX: Remove a bunch of dead code in the moon-phase routines.
- MINOR FIX: Remove unnecessary %"...%" markers in holidays/us.rem
- MINOR FIX: Don't use the -ffat-lto-objects command-line option if we're
compiling with Clang.
- MINOR FIX: Remind: Fix a broken printf-format string (need to double up on %
to get a literal % in the output.)
- BUG FIX: Make test suite pass regardless of the date on which it is run.
D'oh!!!
- BUG FIX: Make sure the banner gets printed each time through a "*N"
command-line option loop.
* VERSION 4.2 Patch 0 - 2022-10-14
- NEW FEATURE: remind: Allow weekdays to be globally-omitted. For example:
OMIT Saturday Sunday
globally-omits all Saturdays and Sundays.
- NEW FEATURE: remind: Add ansicolor() built-in function to make it easier
to colorize reminders on the terminal. Suggested by Tim Chase.
- NEW FEATURE: remind: Add several special variables related to the color
mode: $UseVTColors, $UseBGVTColors, $Use256Colors, $UseTrueColors and
$TerminalBackground. Based on a suggestion by Tim Chase.
- NEW FEATURE: remind: Add utctolocal() and localtoutc() built-in functions.
- NEW FEATURE: remind: Add timezone() built-in function.
- NEW FEATURE: remind: Add trigtags() function per suggestion from Tim Chase.
- NEW FEATURE: remind: The $AddBlankLines system variable controls whether or
not a blank line is added after each reminder.
- NEW FEATURE: remind: The built-in functions columns() and rows() return the
width and height of the terminal (in character positions) respectively.
- NEW FEATURE: remind: The built-in function columns("string") returns the
number of columns occupied by "string" on the terminal, taking into account
double-width Unicode characters and zero-width ANSI escape sequences.
- NEW FEATURE: remind: You can add custom substitution sequences of the form
%{name} or %*{name} that end up calling the function subst_name and using
its return value as the replacement for the substitution sequence.
- NEW FEATURE: remind: Add the FUNSET command to undefine a user-defined
function.
- NEW FILES: Add standard include files holidays/jewish.rem and
ansitext.rem (the latter defines standard ANSI escape codes for
changing text attributes such as bold, underline, etc.)
- NEW EXAMPLES: add examples/alignmemt.rem, examples/ansitext and
examples/astro
- BUG FIX: remind: Make MSF correctly format UTF-8 text and text with
embedded ANSI color-changing codes.
- BUG FIX: remind: Make ADDOMIT actually work correctly in a SATISFY-type
REM command. Bug found by Gunther Reißig
- BUG FIX: Convert documentation files and src/lang.h to UTF-8. Patch
from Jochen Sprickerhof.
- BUG FIX: Fix tests in non-UTF-8 locales.
- BUG FIX: Fix a few problems with the include/holidays/us.rem file.
- BUG FIX: remind: Fix an ancient logic error in DBufPutc that hurt
performance.
- MINOR IMPROVEMENT: Clean up code and remove some dead code.
* VERSION 4.1 Patch 0 - 2022-09-25
- NEW FEATURE: remind: "remind -c" now supports the MOON special, printing
the moon phases in the calendar if the locale supports UTF-8 encoding.
- NEW FEATURE: remind: "remind -c" now supports the SHADE special. Works
best with the 256-color extended XTerm palette or 24-bit true-color
terminal escape sequences.
- NEW FEATURE: remind: "remind -c" now supports the WEEK special.
- NEW FEATURE: remind: The new "stdout()" function returns a string describing
where stdout is going. Examples of return values are "TTY" if remind's
output is going to terminal, "FILE" if it's redirected to a plain file,
or "PIPE" if it's going to a pipe. See the man page for all the details.
- NEW FEATURE: Add the "-wt" option to set the calendar width to the terminal
width even if standard output is a pipe. Useful for situations like this:
remind -wt -c .reminders | less -R
- CHANGE: "make install" now no longer strips debugging symbols from the
remind and rem2ps executables. Use "make install-stripped" if you want
them stripped.
- CHANGE: remind: "remind -c" highlights today's date in bold, if
colors are enabled.
- CHANGE: Dump string values with control characters escaped.
- DOCUMENTATION FIX: Document behavior of DO and filedir() with respect
to symbolic links.
- DOCUMENTATION FIX: Add home page link to man pages. Suggested by Ian! D.
Allen.
- DOCUMENTATION FIX: Make date in man pages actually be the release date.
Include Remind version in man pages. Also suggested by Ian! D. Allen.
- DOCUMENTATION FIX: Fix inaccuracy in how string constants were documented.
- BUG FIX: Makefiles: Pass CFLAGS at link-time so link-time optimization
actually happens. Pointed out by Zoltan Puskas.
- BUG FIX: If the first REM command to trigger was a RUN command, the banner
would not print. This has been fixed.
- BUG FIX: replace deprecated 'fgrep' with 'grep -F' (Jochen Sprickerhof)
- BUG FIX: make "make test" depend on "make all" (Jochen Sprickerhof)
- BUG FIX: make "REM ... SATISFY ... MSG foo" respect $DefaultColor. Bug
reported by Gunther Reißig.
- BUG FIX: Don't consider IFTRIG true if we could not compute a trigger date.
Bug noted by Gunther Reißig.
* VERSION 4.0 Patch 3 - 2022-08-16
- IMPROVEMENT: remind: add plain_body and calendar_body JSON keys in -pp...
output.
- BUG FIX: tkremind: Don't create empty files called '&1' when creating
a new reminder.
- BUG FIX: remind: Don't call signal-unsafe functions from signal handler
* VERSION 4.0 Patch 2 - 2022-08-02
- IMPROVEMENT: remind: Allow more forms of OMIT as per Ian! D. Allen's request:
OMIT Month [THROUGH Month]
OMIT Day Month [THROUGH Day Month]
OMIT Day Month Year [THROUGH Day Month Year]
- BUG FIX: Make $T behave as documented, exactly like trigdate(). $T would
return '1989-12-31' rather than 0 if the trigger date was not valid.
- BUG FIX: TkRemind: Fix resizing bug for a calendar with 6 rows.
- DOCUMENTATION IMPROVEMENT: Improve TkRemind documentation; document use
of inotifywait if available.
* VERSION 4.0 Patch 1 - 2022-06-03
- IMPROVEMENT: Add $SuppressLRM system variable to suppress the UTF-8
Left-to-Right mark in "remind -c" output.
- DOCUMENTATION FIX: Document the "q" sub-option to the "-p" option.
* VERSION 4.0 Patch 0 - 2022-04-04
- MAJOR NEW FEATURE: remind: Remind output can effectively be
translated into other languages at run-time. A number of system
variables let you translate English words to another language, and a
mechanism for altering the substitution filter at run-time lets you
translate its output so the results are idiomatic. See the man page
sections "RUN-TIME SUPPORT FOR OTHER LANGUAGES", "RUN-TIME
MODIFICATION OF THE SUBSTITUTION FILTER" and "LANGUAGE PACKS".
- NEW FEATURE: remind: Add the pad() built-in function
- NEW FEATURE: tkremind: Day numbers can be displayed left-aligned,
centered or right-aligned.
- IMPROVEMENT: contrib/remind-conf-mode: The Emacs syntax-highlighter
has been updated with the latest system variables and functions
and has been made case-insensitive.
- IMPROVEMENT: remind, rem2ps: Use link-time optimization with gcc if
possible.
- IMPROVEMENT: remind: Print better diagnostics when errors occur inside
a user-defined function. We now show the stack trace to make it easier
to figure out where the error actually is.
- CHANGE: Add a "q" sub-option to the "-p", "-pp", and "-ppp" options.
This causes Remind *not* to remove the %"...%" marker sequence from
remind bodies.
- BUG FIX: rem2pdf: Make rem2pdf respect the --prefix ./configure flag.
Loosely based on patch by Jonathan Kamens.
- BUG FIX: tkremind: Fix the "-m" flag, which was broken in 03.04.00.
- BUG FIX: Fix the overflow-detection functions so they work with link-time
optimization. The previous versions would be optimized away.
- BUG FIX: Warn if the arguments to the "-@" option are out of range.
Problem noted by Ian! D. Allen.
- BUG FIX: Always interpret $Latitude and $Longitude input values in the
"C" locale. (We do accept localized input, but warn.)
- BUG FIX: Fix many spelling mistakes caught by Jens Schleusener
* VERSION 3.4 Patch 2 - 2022-03-14
- NEW FEATURE: remind: Add syntactic sugar to simplify some common
types of reminders. See "SYNTACTIC SUGAR FOR REM" in the remind
man page. Based on suggestions from Ian! D. Allen.
- CHANGE: examples/defs.rem: The examples file has been updated to use
the newer syntactic sugar.
- CHANGE: remind: Always parse the body of REM statements to catch
expression errors. In the past, something like:
REM 2025-01-02 MSG [1/0]
would not cause a division-by-zero error except on 2025-01-02. Now,
the error is always caught. NOTE POTENTIAL INCOMPATIBILITY: There may
be edge-cases when formerly-valid remind scripts now trigger errors.
However, this is pretty unlikely.
- NEW FEATURE: remind: Add the "trig" function to allow more
expressiveness when creating triggers. See man page for details.
- IMPROVEMENT: tkremind: Tweak the calendar display; improve ability to
customize colors, including supplying two built-in themes. Based on
patch and suggestion from Paulo (last name unknown).
- IMPROVEMENT: tkremind: TkRemind handles errors in reminders scripts
much more unobtrusively. Instead of popping up a modal dialog box
with almost-unreadable error output, it discreetly notifies you of
errors with a button that lets you view the specific error messages
in a more readable format.
- IMPROVEMENT: examples/remind.vim: Update list of keywords in vim syntax
highlighting file.
- IMPROVEMENT: contrib/remind-conf-mode: Update the list of keywords,
functions and variables in the Emacs syntax-highlighting file. Also make
it match them case-insensitively.
- CHANGE: remind: Increase $MaxSatIter default to 1000 instead of 150.
Computers are much faster than when I first wrote remind and they
can handle this higher limit easily. The higher limit also enables
certain reasonable reminders that failed in the past because of the
low SATISFY iteration limit.
- CHANGE: remind: The "||" operator now returns the value of the first
non-zero operand rather than just returning 1 or 0. Similarly, "&&"
returns 0 if either operand is false or the value of the last
operand if both operands are true.
NOTE POTENTIAL INCOMPATIBILITY: Remind scripts that depend on ||
and && always returning exactly one of 1 or 0 may need
adjustment.
- CHANGE: The || and && operators can accept any non-STRING type as long
as both operands have the same type. The "false" values are defined
as follows; true values are any other value:
INT: 0
TIME: 00:00
DATE: '1990-01-01' (the Remind epoch)
DATETIME: '1990-01-01@00:00' (the Remind epoch)
- IMPROVEMENT: remind: Issue diagnostics if an UNTIL or THROUGH date
is earlier than any possible trigger date, as well as an UNTIL date
with a fully-specified date and no repeat ("*N"). Suggestion from
Ian! D. Allen.
- BUG FIX: tkremind: If the same moon phase appeared twice in a month,
TkRemind would not display the first occurrence correctly. This has
been fixed.
- BUG FIX: rem2pdf: Fix typos in the man page.
- BUG FIX: remind: The IF command documentation didn't reflect how it
actually worked; now it does.
- BUG FIX: remind: Use correct UNTIL/THROUGH keyword in error message.
- BUG FIX: rem2pdf: Correct the calculation that warns about an over-full
calendar box. Problem noted by Jonathan Kamens.
- BUG FIX: remind: The "remind -c" output would sometimes be incorrect if
scripts with double-wide characters were used. This has been fixed.
- BUG FIX: remind: The "remind -c" output would sometimes be incorrect
if right-to-left scripts were used in reminders. This has been fixed.
* VERSION 3.4 Patch 1 - 2022-02-23
- MINOR IMPROVEMENT: Support the INSTALL_BASE environment variable for
installing rem2pdf in a non-standard location like your home directory.
This is passed in to rem2pdf's Makefile at build and install time.
- MINOR IMPROVEMENT: ./configure: Add --disable-perl-build-artifacts flag
to avoid installation of perllocal.pod and .packlist files.
- BUG FIX: tkremind: If the system date rolls over, update the display
to correctly highlight the current date. This worked in older versions
of Remind, but was broken by 03.04.00.
- BUG FIX: rem2pdf: The small calendar font would sometimes be scaled
incorrectly so the small calendar overflowed the box. This has been
fixed.
* VERSION 3.4 Patch 0 - 2022-02-10
- MAJOR CHANGE: Remind and its helpers (except for rem2ps) fully support
UTF-8. If your system locale is a UTF-8 locale and your terminal
can handle UTF-8 encoding, you can enjoy full Unicode support in Remind.
- NEW FEATURE: Added a rem2pdf Remind-to-PDF converter. It can handle
the full UTF-8 character set and features a new PANGO special reminder
type that lets you format the text in the PDF calendar (by changing the
font size, color, underlining, etc.)
rem2pdf requires the Pango and Cairo Perl modules. On Debian or
Debian-derived systems, these may be installed with:
apt install libpango-perl libcairo-perl
Unlike rem2ps, the default font in rem2pdf is "Sans" rather than
"Helvetica", as Sans seems to be typeset better by the Pango library.
- NEW FEATURE: remind: New system variables $Sunday through $Saturday
and $January through $December let you set weekday and month names
to whatever you like, permitting you to produce calendars in your
local language, even if it's not one of the languages Remind supports
by default.
- NEW FEATURE: tkremind: If rem2pdf installed, TkRemind offers you the
choice of PDF or PostScript output in the Print dialog.
- CHANGE: remind: Increase the number of allowed "full OMITs" from 500
to 1000.
- CHANGE: Remove the annoying code that slowed compilation and running
on Windows and Mac OS X. I believe the point has been made and free
OSes have enough of a critical mass that the annoyances are
counter-productive.
- CLEANUP: remind: C source code: Replace the LAT_DEG, LAT_MIN,
LAT_SEC and LON_DEG, LON_MIN, LON_SEC macros with DEFAULT_LATITUDE
and DEFAULT_LONGITUDE.
- CLEANUP: remind: C source code: Remove various unused or obsolete macros.
- BUG FIXES: Minor fixups to groff source and Makefiles courtesy of
Jochen Sprickerhof.
- BUG FIX: Properly support formatting of double-wide characters in the
terminal mode "remind -c" calendar.
- BUG FIX: rem2html: Document how to highlight today with a red border
- BUG FIX: rem2html: Generate and install a man page for rem2html
- BUG FIX: remind: Get rid of LAT_DEG/LAT_MIN/LAT_SEC and
LON_DEG/LON_MIN/LON_SEC macros in favour of DEFAULT_LATITUDE and
DEFAULT_LONGITUDE.
- IMPROVEMENT: All localized languages now use UTF-8 exclusively.
Support for old character encodings like ISO-8859-1 and ISO-8859-2
has been dropped since modern UNIXes have pretty much standardized
on UTF-8.
- CHANGE: remind: Non-English versions of remind *no longer* accept
non-English month- and weekday-names in trigger specifications. This
was a misfeature. NOTE INCOMPATIBILITY.
* VERSION 3.3 Patch 12 - 2022-01-24
- UPDATE: rem2html: Use JSON::MaybeXS instead of JSON::Any, since JSON::Any
is deprecated. NOTE INCOMPATIBILITY: If you don't have JSON::MaybeXS
installed, you'll need to install it before trying to install or update
rem2html
- NEW FEATURE: Add a DO command. This is just like INCLUDE, but relative
paths are interpreted relative to the directory containing the current
file. That is:
DO somefile.rem
is equivalent to:
INCLUDE [filedir()]/somefile.rem
- NEW FEATURE: Add the $DefaultTDelta system variable and associated
-tt[N] command-line option to set a default time delta for timed
reminder without an explicit +N delta.
- IMPROVEMENT: TkRemind: Store .tkremindrc in $XDG_CONFIG_HOME/tkremindrc
or $HOME/.config/tkremindrc as per the XDG Base Directory Specification.
- BUG FIX: remind: Make the shell() built-in function respect
$MaxStringLen
- BUG FIX: Use size_t to track the size of dynamic buffers rather than int.
This permits Remind to read in files with lines longer than 1GB and to
consume more than 1GB of output from the shell() command, both of which
will surely be massively useful. (The old limit was 1GB rather than 2GB
because of details of the dynamic buffer resizing algorithm.)
* VERSION 3.3 Patch 11 - 2021-12-30
- IMPROVEMENT: TkRemind: Save the print dialog settings so they persist.
- IMPROVEMENT: TkRemind: Show queue in sorted order.
- NEW FUNCTION: Remind: Add the isany() built-in function.
- IMPROVEMENT: rem2html: Add class names indicating number of rows in calendar
- IMPROVEMENT: rem2html: Coalesce table.rem-cal CSS into one block. Thanks
to Ian! D. Allen for pointing this out.
- IMPROVEMENT: TkRemind: Pass "-r" flag to inotifywait
- IMPROVEMENT: TkRemind: Draw moon phases with Tk canvas items rather than
@@ -21,6 +484,16 @@ CHANGES TO REMIND
them; fire up the editor with either Button-1 or Button-3 for
non-TkRemind-generated reminders.
- NEW FUNCTION: Remind: Add the isany() built-in function.
- IMPROVEMENT: rem2html: Add class names indicating number of rows in calendar
- IMPROVEMENT: remind: In -z0 mode, sleep with higher precision to ensure we
wake as close to possible to each 1-minute boundary.
- IMPROVEMENT: rem2html: Coalesce table.rem-cal CSS into one block. Thanks
to Ian! D. Allen for pointing this out.
- IMPROVEMENT: examples/defs.rem: Modernize the examples and get rid of some
cruft.
@@ -780,7 +1253,7 @@ CHANGES TO REMIND
- 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.
- Added support for the Icelandic language, courtesy of Björn Davíðsson.
+ BUG FIXES
@@ -927,7 +1400,7 @@ CHANGES TO REMIND
- Made parser _very_ forgiving -- the type of reminder now defaults
to MSG. This lets you have lines in the reminder file like this:
Feb 9, 1998 Meeting with Joe.
Feb 9, 1998 Meeting with Joe.
But I don't recommend abusing it. It's mostly to ease migration from
UNIX calendar(1) files.
@@ -1457,7 +1930,7 @@ CHANGES TO REMIND
of Mikko Silvonen.
- Changed the date conversion routines to greatly speed up conversion from
Julian to yyyy/mm/dd form.
Days-since-epoch to yyyy/mm/dd form.
+ BUG FIXES:
@@ -1518,7 +1991,7 @@ CHANGES TO REMIND
- Removed identifiers in the C source beginning with "_" to conform
to ANSI practice.
- Fixed a bug in the -u option which resulted in environment variables
SHELL and USER not being set correctly. Also made -u set the LOGNAME
environment variable.
@@ -1591,7 +2064,7 @@ CHANGES TO REMIND
- Fixed all the source files to include "config.h" first.
- Changed the way triggers are calculated so that trigger dates are
- Changed the way triggers are calculated so that trigger dates are
always valid if year, month and day are specified, and there is no
UNTIL clause. See MAN page section "DETAILS ABOUT TRIGVALID()."
@@ -1733,6 +2206,3 @@ CHANGES TO REMIND
* Version 1.0
- never publicly released.

19
examples/alignment.rem Normal file
View File

@@ -0,0 +1,19 @@
# Demo the columns() function
#
# Run as: remind -@2 alignment.rem
# SPDX-License-Identifier: GPL-2.0-only
SET $AddBlankLines 0
BANNER %
FSET center(x) pad("", " ", (columns() - columns(x))/2) + x
FSET right(x) pad("", " ", columns() - columns(x)) + x
MSG This is left-aligned.
MSG [ansicolor(0,255,0)]This is also left-aligned.[ansicolor("")]
MSG [center("This is centered.")]
MSG [ansicolor(255,255,0) + center("🌕 🌕 🌕 🌕 This is also centered. ") + ansicolor("")]
msg [right("This is right-aligned.")]
msg [ansicolor(255,0,0) + right("This is also right-aligned. 🌕 🌕 🌕") + ansicolor("")]

36
examples/ansitext Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/sh
#
# A little demo script that displays ANSI text attributes
# Not all attributes work on all terminals... your mileage may vary.
# SPDX-License-Identifier: GPL-2.0-only
remind -@2 - <<'EOF'
SET $AddBlankLines 0
BANNER %
INCLUDE [$SysInclude]/ansitext.rem
MSG This file shows off some ANSI text attributes and colors.
MSG Not all attributes work on all terminals.%_
MSG This is [ansi_bold]bold.[ansi_normal]
MSG This is [ansi_faint]faint.[ansi_normal]
MSG This is [ansi_italic]italic.[ansi_normal]
MSG This is [ansi_underline]underline.[ansi_normal]
MSG This is [ansi_underline2]underline2.[ansi_normal]%_
MSG This is [ansi_reverse]reverse.[ansi_normal]%_
MSG This is [ansi_strikeout]strikeout.[ansi_normal]%_
MSG This is [ansi_overline]overline.[ansi_normal]%_
MSG This is [ansicolor(255,0,0)]red.[ansicolor("")]
MSG This is [ansicolor(0,255,0)]green.[ansicolor("")]
MSG This is [ansicolor(0,0,255)]blue.[ansicolor("")]
MSG This is [ansicolor(255,255,0)]yellow.[ansicolor("")]
MSG This is [ansicolor(255,0,255)]magenta.[ansicolor("")]
MSG This is [ansicolor(0,255,255)]cyan.[ansicolor("")]%_
# You can combine attributes
MSG This is [ansicolor(0,255,0)][ansicolor(0,0,96,1)][ansi_italic][ansi_bold]Green-Bold-Italic-on-Blue[ansi_normal][ansicolor("")]
EOF
exit 0

70
examples/astro Executable file
View File

@@ -0,0 +1,70 @@
#!/bin/sh
#
# A little demo script that displays astronomical events
#
# Best used in a UTF-8 environment.
# SPDX-License-Identifier: GPL-2.0-only
# Set this variable to 1 if your terminal has a dark background or 0 if
# it: light.
bg_dark=1
# Set your latitude and longitude correctly for Sunrise/Sunset/Equinox/Solstice
#
# The values below are for Ottawa, Ontario, Canada
latitude="45.420556"
longitude="-75.689722"
remind -g -ibg_dark="$bg_dark" "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
SET $AddBlankLines 0
BANNER %
INCLUDE [$SysInclude]/ansitext.rem
MSG Today is [ansi_bold][$T][ansi_normal], being the [ord($T-date(year($T),1,1)+1)] day of [year($T)].%_
IF bg_dark
SPECIAL COLOR 255 255 0 Sunrise: 🌅 [sunrise()] today and [sunrise($T+1)] tomorrow
SPECIAL COLOR 255 128 0 Sunset: 🌇 [sunset()] today and [sunset($T+1)] tomorrow%_
ENDIF
EOF
remind -g -ibg_dark="$bg_dark" "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
SET $AddBlankLines 0
BANNER %
IF bg_dark
REM [moondatetime(0)] +60 SPECIAL COLOR 255 255 0 New moon: 🌑 [$T] %3 (%b)
REM [moondatetime(1)] +60 SPECIAL COLOR 255 255 128 First Quarter: 🌓 [$T] %3 (%b)
REM [moondatetime(2)] +60 SPECIAL COLOR 255 255 255 Full moon: 🌕 [$T] %3 (%b)
REM [moondatetime(3)] +60 SPECIAL COLOR 255 255 128 Last Quarter: 🌗 [$T] %3 (%b)
ELSE
SPECIAL COLOR 128 128 0 Sunrise: 🌅 [sunrise()] today and [sunrise($T+1)] tomorrow
SPECIAL COLOR 128 32 0 Sunset: 🌇 [sunset()] today and [sunset($T+1)] tomorrow%_
REM [moondatetime(0)] +60 SPECIAL COLOR 128 128 0 New moon: 🌑 [$T] %3 (%b)
REM [moondatetime(1)] +60 SPECIAL COLOR 128 128 64 First Quarter: 🌓 [$T] %3 (%b)
REM [moondatetime(2)] +60 SPECIAL COLOR 0 0 0 Full moon: 🌕 [$T] %3 (%b)
REM [moondatetime(3)] +60 SPECIAL COLOR 128 128 64 Last Quarter: 🌗 [$T] %3 (%b)
ENDIF
EOF
echo ""
remind -g -ibg_dark="$bg_dark" "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
SET $AddBlankLines 0
BANNER %
IF $LatDeg >= 0
REM [soleq(0)] +366 MSG Next Vernal Equinox: 🌼 [$T] %3 (%b)
REM [soleq(1)] +366 MSG Next Summer Solstice: 😎 [$T] %3 (%b)
REM [soleq(2)] +366 MSG Next Autumnal Equinox: 🍂 [$T] %3 (%b)
REM [soleq(3)] +366 MSG Next Winter Solstice: ❄️ [$T] %3 (%b)
ELSE
REM [soleq(0)] +366 MSG Next Autumnal Equinox: 🍂 [$T] %3 (%b)
REM [soleq(1)] +366 MSG Next Winter Solstice: ❄️ [$T] %3 (%b)
REM [soleq(2)] +366 MSG Next Vernal Equinox: 🌼 [$T] %3 (%b)
REM [soleq(3)] +366 MSG Next Summer Solstice: 😎 [$T] %3 (%b)
ENDIF
EOF

View File

@@ -16,7 +16,8 @@
# "#PSSTUFF" for nifty PostScript examples #
# #
# This file is part of REMIND. #
# Copyright (C) 1992-2018 Dianne Skoll #
# Copyright (C) 1992-2023 Dianne Skoll #
# SPDX-License-Identifier: GPL-2.0-only
# #
#############################################################################
@@ -25,76 +26,24 @@ RUN OFF
################################################
# Ensure required version of remind is used... #
################################################
IF version() < "03.01.10"
IF version() < "03.04.02"
ERRMSG This file requires at least version 03.01.10 of Remind.%
ERRMSG This version is version [version()].
EXIT
ENDIF
######################################
# Symbolic constants for weekdays... #
######################################
SET Sunday 0
SET Monday 1
SET Tuesday 2
SET Wednesday 3
SET Thursday 4
SET Friday 5
SET Saturday 6
SET Sun 0
SET Mon 1
SET Tue 2
SET Wed 3
SET Thu 4
SET Fri 5
SET Sat 6
#########################################
# Symbolic constants for month names... #
#########################################
SET Jan 1
SET Feb 2
SET Mar 3
SET Apr 4
SET May 5
SET Jun 6
SET Jul 7
SET Aug 8
SET Sep 9
SET Oct 10
SET Nov 11
SET Dec 12
SET January 1
SET February 2
SET March 3
SET April 4
SET May 5
SET June 6
SET July 7
SET August 8
SET September 9
SET October 10
SET November 11
SET December 12
###########################################################
# Other symbolic constants and functions for "pasting"... #
# Symbolic constants and functions for "pasting"... #
###########################################################
SET Quote CHAR(34)
# Handy constants/function for specifing week of month...
# Handy constants/function for specifying week of month...
SET Week_1 1
SET Week_2 8
SET Week_3 15
SET Week_4 22
FSET _last(mo) "1 " + MON((mo%12)+1) + " --7"
# Handy function to provide SCANFROM dates...
FSET _back(days) $U-days
#################################################################
# Function that removes a single leading zero from a string... #
#################################################################
@@ -122,50 +71,23 @@ REM 1 MSG John's [_mo_num(11, 1984)] 'monthly' anniversary
# Here's a tricky problem: The 4th of July is a holiday in the U.S.
# However, if it falls on a Saturday, the previous Friday is a holiday.
# If it falls on a Sunday, the next Monday is a holiday. Here's how
# to do it. NOTE that the following procedure makes the OMIT context
# dependent upon the current date. SInce it only depends on the current
# year, which is not likely to change while producing a calendar, we
# are fairly safe. However, reminders with huge DELTA or BACK components
# may not operate as expected. In general, any time you make OMIT
# dependent upon the current date, it's tricky and results may not be
# what you expect. You should try to make sure that the OMIT context
# "near" any current reminders will not change during a calendar run.
# The SCANFROM clause will make these OMITs safe.
# to do it.
#
# For those reminders that update the OMIT context with ADDOMIT, we use
# SCANFROM -7 for safety; see the man page about moveable OMITs.
############################################################################
# Calculate the weekday of the holiday.
REM 4 July SCANFROM [_back(7)] SATISFY 1
# If it falls on a Saturday, bump to previous Friday
REM 3 JULY SCANFROM -7 ADDOMIT SATISFY [$Tw == 5] MSG Independence day (observed)
SET iday $T
IF WKDAYNUM(iday) == Sat
REM [iday] MSG Independence day (actual)
OMIT [iday-1] MSG Independence day (observed)
ELSE
IF WKDAYNUM(iday) == Sun
REM [iday] MSG Independence day (actual)
OMIT [iday+1] MSG Independence day (observed)
ELSE
OMIT [iday] MSG Independence day
ENDIF
ENDIF
# If it falls on a Sunday, bump to following Monday
REM 5 July SCANFROM -7 ADDOMIT SATISFY [$Tw == 1] MSG Independence day (observed)
############################################################################
# A meeting on the first Monday of every month which is moved to the #
# second Monday in the event of a holiday. #
############################################################################
# If it falls on Sat or Sun, note the actual day
REM 4 July SCANFROM -7 ADDOMIT SATISFY [$Tw == 0 || $Tw == 6] MSG Independence day (actual)
# First, the normal meeting. However, the SKIP keyword means this
# one won't be triggered if the first Monday is a holiday
REM Mon 1 SKIP MSG Meeting
# Now, calculate the "potential" delayed meeting
REM Mon 8 SATISFY 1
# But only actually trigger the delayed meeting if the previous
# Monday was a holiday
IF ISOMITTED($T-7)
REM [$T] MSG Delayed meeting
ENDIF
# Otherwise observed and actual is on the 4th
REM 4 July SCANFROM -7 ADDOMIT SATISFY [$Tw >= 1 && $Tw <= 5] MSG Independence Day
##########################################################################
# #
@@ -216,43 +138,59 @@ 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.
# You'll need the _back() function and the Week_n variables defined
# way up in the file.
# which ones are omitted - use the general forms shown below. You'll
# need the Week_n variables defined way up in the file.
OMIT Jan 1 MSG %"New Year's%" Day
REM Mon Jan [Week_3] MSG Martin Luther King - %"MLK Day%"
OMIT Jan 1 MSG %"New Year's Day%"
REM Third Monday in Jan MSG Martin Luther King - %"MLK Day%"
REM Feb 2 MSG %"Ground Hog Day%"
REM Feb 14 MSG %"Valentine's%" Day
REM Mon Feb [Week_3] SCANFROM [_back(7)] ADDOMIT MSG %"President's Day%"
REM Mar 17 MSG %"St. Patrick's%" Day
REM Feb 14 MSG %"Valentine's Day%"
REM Third Monday in Feb SCANFROM -7 ADDOMIT MSG %"President's Day%"
REM Mar 17 MSG %"St. Patrick's Day%"
# The DST rules are accurate for most locations in
# North America
REM Sun Apr 1 ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
REM Sun Mar 8 ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
REM Sun [_last(Oct)] ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
REM Sun 1 Nov ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
REM Last Sunday in October ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
REM First Sunday in November ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST ends%" %b
REM Apr 1 MSG %"April Fool's%" Day
REM Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
# US Tax Day
PUSH-OMIT-CONTEXT
# Normal case: 16 April falls Mon-Fri
REM 16 Apr SCANFROM -7 ADDOMIT SATISFY [$Tw >= 1 && $Tw <= 5] MSG Emancipation Day
# 16 April falls on Saturday: Observe on the 15th
REM 15 Apr SCANFROM -7 ADDOMIT SATISFY [$Tw == 5] MSG Emancipation Day (observed)
# 16 April falls on Sunday: Observe on the 17th
REM 17 Apr SCANFROM -7 ADDOMIT SATISFY [$Tw == 1] MSG Emancipation Day (observed)
# If you live in Maine or Massachussetts, uncomment the next line
# REM Third Monday in April SCANFROM -7 ADDOMIT MSG Patriots Day
REM Apr 15 OMIT Sat Sun AFTER MSG Tax Day
POP-OMIT-CONTEXT
REM May 5 MSG %"Cinco de Mayo%"
REM Sat May [Week_1] MSG %"Kentucky Derby%"
REM Sun May [Week_2] MSG %"Mother's Day%"
REM Sat May [Week_3] MSG %"Armed Forces Day%"
REM Mon [_last(May)] SCANFROM [_back(7)] ADDOMIT MSG %"Memorial Day%"
REM First Sat in May MSG %"Kentucky Derby%"
REM Second Sun in May MSG %"Mother's Day%"
REM Third Sat in May MSG %"Armed Forces Day%"
REM Last Monday in May SCANFROM -7 ADDOMIT MSG %"Memorial Day%"
REM Jun 14 MSG %"Flag Day%"
REM Sun Jun [Week_3] MSG %"Father's Day%"
REM Mon Sep [Week_1] SCANFROM [_back(7)] ADDOMIT MSG %"Labor Day%"
REM Mon Oct [Week_2] MSG %"Columbus Day%"
REM Third Sun in June MSG %"Father's Day%"
REM First Mon in Sep SCANFROM -7 ADDOMIT MSG %"Labor Day%"
REM Second Mon in Oct MSG %"Columbus Day%"
REM Nov 11 MSG %"Veterans Day%"
REM Oct 30 MSG %"Mischief Night%"
REM Oct 31 MSG %"Halloween%"
REM Tue Nov 2 SCANFROM [_back(7)] SATISFY [($Ty % 4) == 0] MSG %"Election Day%"
REM Thu Nov [Week_4] SCANFROM [_back(7)] ADDOMIT MSG %"Thanksgiving Day%"
REM Fri Nov [Week_4+1] SCANFROM [_back(7)] ADDOMIT MSG %"Thanksgiving (cont.)%"
REM Tue Nov 2 SCANFROM -7 SATISFY [($Ty % 4) == 0] MSG %"Election Day%"
REM Last Thu in Nov SCANFROM -7 ADDOMIT MSG %"Thanksgiving Day%"
REM Fri Nov [Week_4+1] SCANFROM -7 ADDOMIT MSG %"Thanksgiving (cont.)%"
OMIT Dec 24 MSG %"Christmas Eve%"
OMIT Dec 25 MSG %"Christmas%" Day
@@ -266,6 +204,24 @@ if $NumTrig > SaveTrig
REM SPECIAL SHADE 220
endif
############################################################################
# A meeting on the first Monday of every month which is moved to the #
# second Monday in the event of a holiday. #
############################################################################
# First, the normal meeting. However, the SKIP keyword means this
# one won't be triggered if the first Monday is a holiday
REM First Monday SKIP MSG Meeting
# Now, calculate the "potential" delayed meeting
REM Second Monday SATISFY 1
# But only actually trigger the delayed meeting if the previous
# Monday was a holiday
IF ISOMITTED($T-7)
REM [$T] MSG Delayed meeting
ENDIF
#PSSTUFF2
##########################################################################
# #
@@ -282,10 +238,10 @@ REM PS Border Border moveto \
([hebday($U)] [hebmon($U)]) show
# Fill in the phases of the moon on the PostScript calendar
[moondate(0)] SPECIAL MOON 0
[moondate(1)] SPECIAL MOON 1
[moondate(2)] SPECIAL MOON 2
[moondate(3)] SPECIAL MOON 3
REM [moondate(0)] SPECIAL MOON 0
REM [moondate(1)] SPECIAL MOON 1
REM [moondate(2)] SPECIAL MOON 2
REM [moondate(3)] SPECIAL MOON 3
# The following example puts sunrise and sunset times in PostScript in the
# calendar - the sizes are hard-coded, however, and work best in landscape.

View File

@@ -1,9 +1,9 @@
" Vim syntax file
" Language: Remind
" Maintainer: Davide Alberani <alberanid@libero.it>
" Last Change: 18 Sep 2009
" Version: 0.5
" URL: http://erlug.linux.it/~da/vim/syntax/remind.vim
" Maintainer: Davide Alberani <da@erlug.linux.it>
" Last Change: 02 Nov 2015 + 13 Mar 2022 by Dianne Skoll <dianne@skoll.ca>
" Version: 0.7+dianne1
" URL: http://ismito.it/vim/syntax/remind.vim
"
" remind is a sophisticated reminder service
" you can download remind from:
@@ -23,7 +23,7 @@ syn keyword remindExpiry UNTIL FROM SCANFROM SCAN WARN SCHED THROUGH
syn keyword remindTag PRIORITY TAG
syn keyword remindTimed AT DURATION
syn keyword remindMove ONCE SKIP BEFORE AFTER
syn keyword remindSpecial INCLUDE INC BANNER PUSH-OMIT-CONTEXT PUSH CLEAR-OMIT-CONTEXT CLEAR POP-OMIT-CONTEXT POP COLOR COLOUR
syn keyword remindSpecial INCLUDE INC BANNER PUSH-OMIT-CONTEXT PUSH CLEAR-OMIT-CONTEXT CLEAR POP-OMIT-CONTEXT POP COLOR COLOUR DO
syn keyword remindRun MSG MSF RUN CAL SATISFY SPECIAL PS PSFILE SHADE MOON
syn keyword remindConditional IF ELSE ENDIF IFTRIG
syn keyword remindDebug DEBUG DUMPVARS DUMP ERRMSG FLUSH PRESERVE

35
include/ansitext.rem Normal file
View File

@@ -0,0 +1,35 @@
# Global variables for various ANSI escape-code sequences
# Not all sequences are supported by all terminals.
# This file is part of REMIND
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# SPDX-License-Identifier: GPL-2.0-only
if !defined("ansi_bold")
# Disable ANSI attributes in calandar mode
if $CalMode
set ansi_normal ""
set ansi_bold ""
set ansi_faint ""
set ansi_italic ""
set ansi_underline ""
set ansi_reverse ""
set ansi_strikeout ""
set ansi_underline2 ""
set ansi_overline ""
else
set ansi_normal char(27) + "[0m"
set ansi_bold char(27) + "[1m"
set ansi_faint char(27) + "[2m"
set ansi_italic char(27) + "[3m"
set ansi_underline char(27) + "[4m"
set ansi_reverse char(27) + "[7m"
set ansi_strikeout char(27) + "[9m"
set ansi_underline2 char(27) + "[21m"
set ansi_overline char(27) + "[53m"
endif
preserve ansi_normal ansi_bold ansi_faint ansi_italic ansi_underline2 ansi_reverse ansi_strikeout ansi_underline2 ansi_overline
endif
# Example: REM MSG I must [ansi_bold]emphasize[ansi_normal] \
# the [ansi_italic]severity[ansi_normal] of the situation!

30
include/holidays/ca.rem Normal file
View File

@@ -0,0 +1,30 @@
# Canadian holidays
# SPDX-License-Identifier: GPL-2.0-only
OMIT 1 Jan MSG New Year's Day
# This varies by province
REM Third Monday in Feb SCANFROM -7 ADDOMIT MSG Family Day
# This varies by province
OMIT [easterdate($Uy) - 2] MSG Good Friday
# This varies by province
OMIT [easterdate($Uy) + 1] MSG Easter Monday
REM Mon 18 May SCANFROM -7 ADDOMIT MSG Victoria Day
OMIT 1 July MSG Canada Day
# This varies by province
REM First Monday in Aug SCANFROM -7 ADDOMIT MSG Civic Holiday
REM First Monday in Sep SCANFROM -7 ADDOMIT MSG Labour Day
REM Second Monday in Oct SCANFROM -7 ADDOMIT MSG Thanksgiving Day
REM 11 November MSG Remembrance Day
OMIT 25 Dec MSG Christmas
OMIT 26 Dec MSG Boxing Day

20
include/holidays/fr.rem Normal file
View File

@@ -0,0 +1,20 @@
#
# France Holidays
#
# Source: Article L3133-1
# https://www.legifrance.gouv.fr/codes/section_lc/LEGITEXT000006072050/LEGISCTA000006178007/2016-08-10/
#
SET easter EASTERDATE($Uy)
REM Jan 1 MSG %"Jour de l'an%"
REM [easter+1] MSG %"Lundi de Pâques%"
REM May 1 MSG %"Fête du Travail%"
REM May 8 MSG %"Victoire des alliés%"
REM [easter+39] MSG %"Jeudi de l'Ascension%"
REM [easter+50] MSG %"Lundi de Pentecôte%"
REM Jul 14 MSG %"Fête nationale%"
REM Aug 15 MSG %"Assomption%"
REM Nov 1 MSG %"La Toussaint%"
REM Nov 11 MSG %"Armistice%"
REM Dec 25 MSG %"Noël%"

39
include/holidays/gr.rem Normal file
View File

@@ -0,0 +1,39 @@
# Greek national holidays
# ΑΡΓΙΕΣ (για όλους)
# fixed
REM 1 Jan MSG ΠΡΩΤΟΧΡΟΝΙΑ
REM 6 Jan MSG ΤΑ ΦΩΤΑ/ ΘΕΟΦΑΝΕΙΑ
REM 25 Mar MSG η 25η Μαρτίου
REM 15 Aug MSG 15Αύγουστος
REM 28 Oct MSG ΟΧΙ
REM 25 Dec MSG ΧΡΙΣΤΟΥΓΕΝΝΑ
REM 26 Dec MSG ΧΡΙΣΤΟΥΓΕΝΝΑ2
REM [orthodoxeaster($Uy)+1] ΔΕΥΤΕΡΑ ΤΟΥ ΠΑΣΧΑ
# May first is a national holiday except if Sunday, day of great week (week before easter) or Monday after easter, then
# minister decides moving that holiday. Here is a likely assumption of how this day might be moved.
# Uncomment following lines to enable.
set PM date($Uy,5,1)
# IF PM>=orthodoxeaster($Uy)-7 && PM<=orthodoxeaster($Uy)+1
# IF PM<orthodoxeaster($Uy)-3
# REM orthodoxeaster($Uy) -8 MSG πιθανόν ΕΡΓΑΤΙΚΗ Πρωτομαγιά
# ELSE
# REM [plusfunc(2)] MSG πιθανόν ΕΡΓΑΤΙΚΗ Πρωτομαγιά
# ENDIF
# ENDIF
# REM [PM] OMIT Sun AFTER MSG Πρωτομαγιά
REM 1 May MSG Πρωτομαγιά
# end of May 1 speculations
# The following are main national holidays per custom (observed by most but not all)
REM [orthodoxeaster($Uy)] -48 MSG Καθαρά Δευτέρα
REM [orthodoxeaster($Uy)] -2 MSG Μεγάλη Παρασκευή
REM [orthodoxeaster($Uy)] -1 MSG Μεγάλο Σάββατο
REM [orthodoxeaster($Uy)+50] MSG Αγίου Πνεύματος

112
include/holidays/jewish.rem Normal file
View File

@@ -0,0 +1,112 @@
# Major Jewish Holidays
# SPDX-License-Identifier: GPL-2.0-only
# Set the variable InIsrael to 1 if you live in Israel. Otherwise,
# you get the Diaspora versions of Jewish holidays
SET InIsrael value("InIsrael", 0)
# Set the variable Reform to 1 if you want the Reform version of the
# Jewish calendar. Otherwise, you get the traditional version
SET Reform value("Reform", 0)
# Convenient function definition to save typing
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 _BackTwoFri(x, y) IIF(WKDAYNUM(_h2(x,y))!=5, _h2(x,y), _h2(x,y)-2)
FSET _BackTwoSat(x, y) IIF(WKDAYNUM(_h2(x,y))!=6, _h2(x,y), _h2(x,y)-2)
# Default values in case InIsrael and Reform are not set
SET InIsrael VALUE("InIsrael", 0)
SET Reform VALUE("Reform", 0)
[_h(1, "Tishrey")] ++4 MSG %"Rosh Hashana 1%" is %b.
# No RH-2 or Tzom Gedalia in Reform
IF !Reform
[_h(2, "Tishrey")] ++4 MSG %"Rosh Hashana 2%" is %b.
[_PastSat(3, "Tishrey")] ++4 MSG %"Tzom Gedalia%" is %b.
ENDIF
[_h(10, "Tishrey")] ++4 MSG %"Yom Kippur%" is %b.
[_h(15, "Tishrey")] ++4 MSG %"Sukkot 1%" is %b.
IF !InIsrael
[_h(16, "Tishrey")] MSG %"Sukkot 2%"
ENDIF
[_h(21, "Tishrey")] ++4 MSG %"Hoshana Rabba%" is %b.
[_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b.
IF InIsrael
[_h(22, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
ELSE
[_h(23, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
ENDIF
# Because Kislev can change length, we must be more careful about Chanukah
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%"
[_chan(4)] MSG %"Chanukah 4%"
[_chan(5)] MSG %"Chanukah 5%"
[_chan(6)] MSG %"Chanukah 6%"
[_chan(7)] MSG %"Chanukah 7%"
[_chan(8)] MSG %"Chanukah 8%"
# Not sure about Reform's position on the next one.
IF !Reform
# 10 Tevet will never be a Saturday, so whether or not to
# move it is moot. (Thanks to Art Werschulz.)
[_h(10, "Tevet")] MSG %"Tzom Tevet%" is %b.
ENDIF
[_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b.
[_h(14, "Adar A")] ++4 MSG %"Purim Katan%" is %b.
# If Purim is on Sunday, then Fast of Esther is 11 Adar.
IF WKDAYNUM(_h2(13, "Adar")) != 6
REM [_h2(13, "Adar")] ++4 MSG %"Fast of Esther%" is %b.
ELSE
REM [_h2(11, "Adar")] ++4 MSG %"Fast of Esther%" is %b.
ENDIF
[_h(14, "Adar")] ++4 MSG %"Purim%" is %b.
[_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b.
IF !InIsrael
[_h(16, "Nisan")] MSG %"Pesach 2%"
ENDIF
[_h(21, "Nisan")] MSG %"Pesach 7%"
IF !InIsrael && !Reform
[_h(22, "Nisan")] MSG %"Pesach 8%"
ENDIF
[_h(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
[_BackTwoFri(4, "Iyar")] ++4 MSG %"Yom HaZikaron%" is %b.
[_BackTwoSat(5, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
# Not sure about Reform's position on Lag B'Omer
IF !Reform
[_h(18, "Iyar")] ++4 MSG %"Lag B'Omer%" is %b.
ENDIF
[_h(28, "Iyar")] ++4 MSG %"Yom Yerushalayim%" is %b.
[_h(6, "Sivan")] ++4 MSG %"Shavuot%" is %b.
IF !InIsrael && !Reform
[_h(7, "Sivan")] MSG %"Shavuot 2%"
ENDIF
# Fairly sure Reform Jews don't observe the next two
IF !Reform
# Tzom Tamuz and Tish'a B'Av are moved to Sunday if they normally
# fall on a Saturday
[_PastSat(17, "Tamuz")] ++4 MSG %"Tzom Tammuz%" is %b.
[_PastSat(9, "Av")] ++4 MSG %"Tish'a B'Av%" is %b.
ENDIF
# Clean up
FUNSET _h _h2 _PastSat _BackTwoFri _BackTwoSat _chan

55
include/holidays/us.rem Normal file
View File

@@ -0,0 +1,55 @@
# US holidays
# This file is part of REMIND.
# Copyright (C) 1992-2023 Dianne Skoll
# SPDX-License-Identifier: GPL-2.0-only
REM [easterdate($Uy)-46] MSG Ash Wednesday
REM [easterdate($Uy)-7] MSG Palm Sunday
OMIT [easterdate($Uy)-2] MSG Good Friday
OMIT [easterdate($Uy)] MSG %"Easter%" Sunday
REM [easterdate($Uy)+39] MSG Ascension Day
REM [easterdate($Uy)+49] MSG Pentecost
# Some holidays are omitted, some are not. You may want to change
# which ones are omitted.
OMIT Jan 1 MSG New Year's Day
REM Third Monday in Jan MSG Martin Luther King - %"MLK Day%"
REM Feb 2 MSG Ground Hog Day
REM Feb 14 MSG Valentine's Day
REM Third Monday in Feb SCANFROM -7 ADDOMIT MSG President's Day
REM Mar 17 MSG St. Patrick's Day
# These are accurate for most places in North America
REM MAYBE-UNCOMPUTABLE Sun November SATISFY [isdst($T) != isdst($T+1)] MSG Daylight Saving Time Ends
REM MAYBE-UNCOMPUTABLE Sun March SATISFY [isdst($T) != isdst($T+1)] MSG Daylight Saving Time Starts
REM Apr 1 MSG %"April Fool's%" Day
REM Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
REM May 5 MSG Cinco de Mayo
REM First Sat in May MSG Kentucky Derby
REM Second Sun in May MSG Mother's Day
REM Third Sat in May MSG Armed Forces Day
REM Last Monday in May SCANFROM -7 ADDOMIT MSG Memorial Day
REM Jun 14 MSG Flag Day
REM July 4 SCANFROM -7 ADDOMIT MSG Independence Day
REM July 3 SCANFROM -7 ADDOMIT SATISFY [$Tw == 5] MSG Independence Day (observed)
REM July 5 SCANFROM -7 ADDOMIT SATISFY [$Tw == 1] MSG Independence Day (observed)
REM Third Sun in June MSG Father's Day
REM First Mon in Sep SCANFROM -7 ADDOMIT MSG Labor Day
REM Second Mon in Oct MSG Columbus Day / Indigenous Peoples' Day
REM Nov 11 MSG Veterans Day
REM Oct 30 MSG Mischief Night
REM Oct 31 MSG Halloween
REM Tue Nov 2 SCANFROM -7 SATISFY [($Ty % 4) == 0] MSG Election Day
REM Thu 22 Nov SCANFROM -7 ADDOMIT MSG Thanksgiving Day
REM Fri 23 Nov SCANFROM -7 ADDOMIT MSG Thanksgiving (cont.)
REM Dec 24 MSG Christmas Eve
OMIT Dec 25 MSG %"Christmas%" Day

24
include/lang/auto.rem Normal file
View File

@@ -0,0 +1,24 @@
# SPDX-License-Identifier: GPL-2.0-only
SET autolang getenv("REMIND_LANG")
IF autolang == ""
SET autolang getenv("LC_ALL")
ENDIF
IF autolang == ""
SET autolang getenv("LANGUAGE")
ENDIF
IF autolang == ""
SET autolang getenv("LANG")
ENDIF
IF autolang != ""
IF access($SysInclude + "/lang/" + lower(substr(autolang, 1, 5)) + ".rem", "r") == 0
INCLUDE [$SysInclude]/lang/[lower(substr(autolang, 1, 5))].rem
ELSE
IF access($SysInclude + "/lang/" + lower(substr(autolang, 1, 2)) + ".rem", "r") == 0
INCLUDE [$SysInclude]/lang/[lower(substr(autolang, 1, 2))].rem
ENDIF
ENDIF
ENDIF
UNSET autolang

69
include/lang/da.rem Normal file
View File

@@ -0,0 +1,69 @@
# Support for the Danish language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Mogens Lynnerup.
SET $Sunday "Søndag"
SET $Monday "Mandag"
SET $Tuesday "Tirsdag"
SET $Wednesday "Onsdag"
SET $Thursday "Torsdag"
SET $Friday "Fredag"
SET $Saturday "Lørdag"
SET $January "Januar"
SET $February "Februar"
SET $March "Marts"
SET $April "April"
SET $May "Maj"
SET $June "Juni"
SET $July "Juli"
SET $August "August"
SET $September "September"
SET $October "Oktober"
SET $November "November"
SET $December "December"
SET $Today "i dag"
SET $Tomorrow "i morgen"
BANNER Påmindelse for %w, %d. %m, %y%o:
SET $Am "am"
SET $Pm "pm"
SET $Ago "siden"
SET $Fromnow "fra nu"
SET $On "på"
SET $Now "nu"
SET $At "kl."
SET $Minute "minut"
SET $Hour "time"
SET $Is "er"
SET $Was "var"
SET $And "og"
SET $Hplu "r"
SET $Mplu "ter"
FSET subst_ampm(h) iif(h<5, " om natten", h < 12, " om formiddagen", h < 18, " om eftermiddagen", " om aftenen")
FSET subst_ordinal(d) "."
FSET subst_p(alt, d, t) iif(d==today()+1, "", "e")
FSET zeropad(s, len) pad(s, "0", len)
FSET subst_a_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d) + " " + year(d)
FSET subst_ax(alt, d, t) iif(alt, subst_a_alt(d), $On + " " + subst_a_alt(d))
FSET subst_bx(a, d, t) "om " + (d-today()) + " dage"
FSET subst_ex(alt, d, t) "den " + zeropad(day(d), 2) + $DateSep + zeropad(monnum(d), 2) + $DateSep + zeropad(year(d), 4)
FSET subst_fx(alt, d, t) "den " + zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2) + $DateSep + zeropad(year(d), 4)
FSET subst_g_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d)
FSET subst_gx(alt, d, t) iif(alt, subst_g_alt(d), $On + " " + subst_g_alt(d))
FSET subst_hx(alt, d, t) "den " + zeropad(day(d), 2) + $DateSep + zeropad(monnum(d), 2)
FSET subst_ix(alt, d, t) "den " + zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2)
FSET subst_ux(alt, d, t) subst_ax(alt, d, t)
FSET subst_vx(alt, d, t) subst_gx(alt, d, t)

89
include/lang/de.rem Normal file
View File

@@ -0,0 +1,89 @@
# Support for the German language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Wolfgang Thronicke
# Day names
SET $Sunday "Sonntag"
SET $Monday "Montag"
SET $Tuesday "Dienstag"
SET $Wednesday "Mittwoch"
SET $Thursday "Donnerstag"
SET $Friday "Freitag"
SET $Saturday "Samstag"
# Month names
SET $January "Januar"
SET $February "Februar"
SET $March "März"
SET $April "April"
SET $May "Mai"
SET $June "Juni"
SET $July "Juli"
SET $August "August"
SET $September "September"
SET $October "Oktober"
SET $November "November"
SET $December "Dezember"
SET $Today "heute"
SET $Tomorrow "morgen"
# Banner
BANNER Termine für %w, den %d. %m %y%o:
SET $Am "am"
SET $Pm "pm"
SET $On "am"
SET $Hplu "n"
SET $Mplu "n"
SET $Now "jetzt"
SET $At "um"
SET $Minute "Minute"
SET $Hour "Stunde"
SET $Is "ist"
SET $Was "war"
SET $And "und"
SET $Ago "vorher"
SET $Fromnow "von heute"
FSET subst_ampm(h) iif(h<5, " nachts", h<12, " vormittags", h<=17, " nachmittags", " abends")
FSET subst_ordinal(d) "."
FSET subst_a_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d) + " " + year(d)
FSET subst_ax(alt, d, t) iif(alt, subst_a_alt(d), $On + " " + subst_a_alt(d))
FSET subst_bx(a, d, t) "in " + (d-today()) + " Tagen"
FSET subst_g_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d)
FSET subst_gx(alt, d, t) iif(alt, subst_g_alt(d), $On + " " + subst_g_alt(d))
FSET subst_ux(alt, d, t) subst_ax(alt, d, t)
FSET subst_vx(alt, d, t) subst_gx(alt, d, t)
FSET subst_p(alt, d, t) iif(d == today()+1, "", "en")
# Localization of various astronomical events
# Perihelion
SET earthseasons_Perihelion_str "Perihel"
# Vernal equinox
SET earthseasons_EquinoxMar_str "Frühlingsanfang"
# Summer solstice
SET earthseasons_SolsticeJun_str "Sommeranfang"
# Aphelion
SET earthseasons_Aphelion_str "Aphel"
# Autumnal Equinox
SET earthseasons_EquinoxSep_str "Herbstanfang"
# Winter Solstice
SET earthseasons_SolsticeDec_str "Winteranfang"
# Daylight saving time starts
SET daylightST_starts_str "Beginn Sommerzeit"
# Daylight saving time ends
SET daylightST_ends_str "Ende Sommerzeit"

4
include/lang/en.rem Normal file
View File

@@ -0,0 +1,4 @@
# Support for the English language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# Nothing to do for English since it is the default.

48
include/lang/es.rem Normal file
View File

@@ -0,0 +1,48 @@
# Support for the Spanish language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Rafa Couto <rafacouto@biogate.com>
SET $Sunday "Domingo"
SET $Monday "Lunes"
SET $Tuesday "Martes"
SET $Wednesday "Miércoles"
SET $Thursday "Jueves"
SET $Friday "Viernes"
SET $Saturday "Sábado"
SET $January "Enero"
SET $February "Febrero"
SET $March "Marzo"
SET $April "Abril"
SET $May "Mayo"
SET $June "Junio"
SET $July "Julio"
SET $August "Agosto"
SET $September "Septiembre"
SET $October "Octubre"
SET $November "Noviembre"
SET $December "Diciembre"
SET $Today "hoy"
SET $Tomorrow "mañana"
BANNER Agenda para el %w, %d%s %m, %y%o:
SET $Am "am"
SET $Pm "pm"
SET $Ago "hace"
SET $Fromnow "desde hoy"
SET $On "el día"
SET $Now "ahora"
SET $At "a las"
SET $Minute "minuto"
SET $Hour "hora"
SET $Is "es"
SET $Was "fue"
SET $And "y"
SET $Hplu "s"
SET $Mplu "s"
FSET subst_bx(a, d, t) "dentro de " + (d-today()) + " días"

94
include/lang/fi.rem Normal file
View File

@@ -0,0 +1,94 @@
# Support for the Finnish language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Mikko Silvonen
SET $Sunday "sunnuntai"
SET $Monday "maanantai"
SET $Tuesday "tiistai"
SET $Wednesday "keskiviikko"
SET $Thursday "torstai"
SET $Friday "perjantai"
SET $Saturday "lauantai"
SET $January "tammikuu"
SET $February "helmikuu"
SET $March "maaliskuu"
SET $April "huhtikuu"
SET $May "toukokuu"
SET $June "kesäkuu"
SET $July "heinäkuu"
SET $August "elokuu"
SET $September "syyskuu"
SET $October "lokakuu"
SET $November "marraskuu"
SET $December "joulukuu"
SET $Today "tänään"
SET $Tomorrow "huomenna"
BANNER Viestit %wna %d. %mta %y%o:
SET $Am " ap."
SET $Pm " ip."
SET $ago "sitten"
SET $Fromnow "kuluttua"
SET $On "na"
SET $Now "nyt"
SET $At "klo"
SET $Minute "minuutti"
SET $Hour "tunti"
SET $Is "on"
SET $Was "oli"
SET $And "ja"
SET $Hplu "a"
SET $Mplu "a"
FSET zeropad(s, len) pad(s, "0", len)
FSET subst_ordinal(d) iif(d==1, ":senä", d==2, ":sena", (d%10)==2||(d%10)==3||(d%10)==6||(d%10)==8, ":ntena", ":ntenä")
FSET subst_a_alt(d, o, p) wkday(d) + o + " " + day(d) + ". " + mon(d) + p + " " + year(d)
FSET subst_ax(a, d, t) iif(a, subst_a_alt(d, "", ""), subst_a_alt(d, $On, "ta"))
FSET subst_bx(a, d, t) (d-today()) + " päivän kuluttua"
FSET subst_cx(a, d, t) iif(a, wkday(d), wkday(d) + $On)
FSET subst_ex(a, d, t) zeropad(day(d), 2) + $DateSep + zeropad(monnum(d), 2) + $DateSep + zeropad(year(d), 4)
FSET subst_fx(a, d, t) zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2) + $DateSep + zeropad(year(d), 4)
FSET subst_g_alt(d, o, p) wkday(d) + o + " " + day(d) + ". " + mon(d) + p
FSET subst_gx(a, d, t) iif(a, subst_g_alt(d, "", ""), subst_g_alt(d, $On, "ta"))
FSET subst_hx(a, d, t) zeropad(day(d), 2) + $DateSep + zeropad(monnum(d), 2)
FSET subst_ix(a, d, t) zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2)
FSET subst_j_alt(d, o) wkday(d) + o + " " + mon(d) + "n " + day(d) + subst_ordinal(day(d)) + " " + year(d)
FSET subst_jx(a, d, t) iif(a, subst_j_alt(d, ""), subst_j_alt(d, $On))
FSET subst_k_alt(d, o) wkday(d) + o + " " + mon(d) + "n " + day(d) + subst_ordinal(day(d))
FSET subst_kx(a, d, t) iif(a, subst_k_alt(d, ""), subst_k_alt(d, $On))
FSET subst_lx(a, d, t) zeropad(year(d), 4) + $DateSep + zeropad(monnum(d), 2) + $DateSep + zeropad(day(d), 2)
FSET subst_p(a, d, t) iif(d==today()+1, "", "ä")
FSET subst_qx(a, d, t) "n"
FSET subst_u_alt(d, o, p) wkday(d) + o + " " + day(d) + subst_ordinal(day(d)) + " " + mon(d) + p + " " + year(d)
FSET subst_ux(a, d, t) iif(a, subst_u_alt(d, "", ""), subst_u_alt(d, $On, "ta"))
FSET subst_v_alt(d, o, p) wkday(d) + o + " " + day(d) + subst_ordinal(day(d)) + " " + mon(d) + p
FSET subst_vx(a, d, t) iif(a, subst_v_alt(d, "", ""), subst_v_alt(d, $On, "ta"))
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst1_past(now()-t), subst1_future(t-now()))
FSET subst1_past(mins) subst_hour_past(mins/60) + subst_min_past(mins%60) + $Ago
FSET subst1_future(mins) subst_hour_future(mins/60) + subst_min_future(mins%60) + $Fromnow
FSET subst_hour_past(h) iif(h==0, "", h + " " + $Hour + iif(h==1, " ", $Hplu + " "))
FSET subst_min_past(m) iif(m==0, "", m + " " + $Minute + iif(m==1, " ", $Mplu + " "))
FSET subst_hour_future(h) iif(h==0, "", h + " tunnin ")
FSET subst_min_future(m) iif(m==0, "", m + " minuutin ")

62
include/lang/fr.rem Normal file
View File

@@ -0,0 +1,62 @@
# Support for the French language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Laurent Duperval
SET $Sunday "dimanche"
SET $Monday "lundi"
SET $Tuesday "mardi"
SET $Wednesday "mercredi"
SET $Thursday "jeudi"
SET $Friday "vendredi"
SET $Saturday "samedi"
SET $January "janvier"
SET $February "février"
SET $March "mars"
SET $April "avril"
SET $May "mai"
SET $June "juin"
SET $July "juillet"
SET $August "août"
SET $September "septembre"
SET $October "octobre"
SET $November "novembre"
SET $December "décembre"
SET $Today "aujourd'hui"
SET $Tomorrow "demain"
SET $On "le"
SET $At "à"
SET $Now "maintenant"
SET $Minute "minute"
SET $Hour "heure"
SET $Is "est"
SET $Was "était"
SET $And "et"
SET $Hplu "s"
SET $Mplu "s"
SET $Ago "il y a"
SET $Fromnow "dans"
# Banner
BANNER Rappels pour %w, %d%s %m, %y%o:
# Ordinal for a day (English would be "st", "nd", "rd", "th")
FSET subst_ordinal(d) iif(d == 1, "er", "")
# "%d hours", "%d minutes", or "%d hours and %d minutes"
FSET subst_tdiff(hdiff, mdiff) iif(hdiff==0&&mdiff==0, $Now, \
hdiff==0, mdiff + plural(mdiff, " minute"), \
mdiff==0, hdiff + plural(hdiff, " heure"), \
hdiff + plural(hdiff, " heure") + " et " + mdiff + plural(mdiff, " minute"))
FSET subst_1(alt, date, time) iif(time == now(), "maintenant", \
time > now(), "dans " + subst_tdiff((time-now())/60, (time-now())%60), \
"il y a " + subst_tdiff ((now()-time)/60, (now()-time)%60))
FSET subst_bx(alt, date, time) "dans " + (date-today()) + " jours"
FSET subst_j_alt(date) wkday(date) + ", " + day(date) + subst_ordinal(day(date)) + " " + mon(date) + ", " + year(date)
FSET subst_jx(alt, date, time) iif(alt, subst_j_alt(date), $On + " " + subst_j_alt(date))
FSET subst_k_alt(date) wkday(date) + ", " + day(date) + subst_ordinal(day(date)) + " " + mon(date)
FSET subst_kx(alt, date, time) iif(alt, subst_k_alt(date), $On + " " + subst_k_alt(date))

83
include/lang/gr.rem Normal file
View File

@@ -0,0 +1,83 @@
# Support for the Hellenic (Greek) language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by jarlaxl lamat (jarlaxl@freemail.gr)
SET $Sunday "Κυριακή"
SET $Monday "Δευτέρα"
SET $Tuesday "Τρίτη"
SET $Wednesday "Τετάρτη"
SET $Thursday "Πέμπτη"
SET $Friday "Παρασκευή"
SET $Saturday "Σάββατο"
SET $January "Ιανουάρ."
SET $February "Φεβρουάρ."
SET $March "Μάρτ."
SET $April "Απρίλ."
SET $May "Μαι."
SET $June "Ιούν."
SET $July "Ιούλ."
SET $August "Αυγουστ."
SET $September "Σεπτέμβρ."
SET $October "Οκτώβρ."
SET $November "Νοέμβρ."
SET $December "Δεκέμβρ."
SET $Today "σήμερα"
SET $Tomorrow "αύριο"
BANNER Υπενθυμίσεις: %w, %d %m, %y%o:
SET $Am "πμ"
SET $Pm "μμ"
SET $Ago "πριν"
SET $Fromnow "από τώρα"
SET $On "την"
SET $Now "τώρα"
SET $At "στις"
SET $Minute "λεπτά"
SET $Hour "ώρες"
SET $Is "είναι"
SET $Was "ήταν"
SET $And "και"
SET $Hplu ""
SET $Mplu ""
FSET subst_bx(a, d, t) "σε " + (d - today()) + " ημέρες"
FSET subst_ordinal(d) "."
FSET subst_a_alt(d) wkday(d) + ", " + day(d) + ". " + mon(d) + " " + year(d)
FSET subst_ax(alt, d, t) iif(alt, subst_a_alt(d), $On + " " + subst_a_alt(d))
FSET subst_g_alt(d) wkday(d) + ", " + day(d) + ". " + mon(d)
FSET subst_gx(alt, d, t) iif(alt, subst_g_alt(d), $On + " " + subst_g_alt(d))
FSET subst_ux(alt, d, t) subst_ax(alt, d, t)
FSET subst_vx(alt, d, t) subst_gx(alt, d, t)
# Localization of various astronomical events
# Perihelion
SET earthseasons_Perihelion_str "Περιήλιον"
# Vernal equinox
SET earthseasons_EquinoxMar_str "Εαρινή ισημερία"
# Summer solstice
SET earthseasons_SolsticeJun_str "Θερινό ηλιοστάσιο"
# Aphelion
SET earthseasons_Aphelion_str "Αφήλιον"
# Autumnal Equinox
SET earthseasons_EquinoxSep_str "Φθινοπωρινή ισημερία"
# Winter Solstice
SET earthseasons_SolsticeDec_str "Χειμερινό ηλιοστάσιο"
# Daylight saving time starts
SET daylightST_starts_str "Έναρξη θέρους"
# Daylight saving time ends
SET daylightST_ends_str "Τέλος θέρους"

51
include/lang/is.rem Normal file
View File

@@ -0,0 +1,51 @@
# Support for the Icelanding language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Björn Davíðsson (bjossi@snerpa.is)
SET $Sunday "sunnudagur"
SET $Monday "mánudagur"
SET $Tuesday "þriðjudagur"
SET $Wednesday "miðvikudagur"
SET $Thursday "fimmtudagur"
SET $Friday "föstudagur"
SET $Saturday "laugardagur"
SET $January "janúar"
SET $February "febrúar"
SET $March "mars"
SET $April "apríl"
SET $May "maí"
SET $June "júní"
SET $July "júlí"
SET $August "ágúst"
SET $September "september"
SET $October "október"
SET $November "nóvember"
SET $December "desember"
SET $Today "í dag"
SET $Tomorrow "á morgun"
BANNER Minnisatriði: %w, %d%s %m, %y%o:
SET $Am "fh"
SET $Pm "eh"
SET $Ago "síðan"
SET $Fromnow "frá því nú"
SET $On "þann"
SET $Now "núna"
SET $At "kl."
SET $Minute "mínútu"
SET $Hour "klukkustund"
SET $Is "er"
SET $Was "var"
SET $And "og"
SET $Hplu "ir"
SET $Mplu "r"
FSET subst_bx(a, d, t) "eftir " + (d - today()) + " daga"
fset subst_p(a, d, t) iif(d == today()+1, "", "a")

67
include/lang/it.rem Normal file
View File

@@ -0,0 +1,67 @@
# Support for the Italian language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Valerio Aimale
SET $Sunday "Domenica"
SET $Monday "Lunedí"
SET $Tuesday "Martedí"
SET $Wednesday "Mercoledí"
SET $Thursday "Giovedí"
SET $Friday "Venerdí"
SET $Saturday "Sabato"
SET $January "Gennaio"
SET $February "Febbraio"
SET $March "Marzo"
SET $April "Aprile"
SET $May "Maggio"
SET $June "Giugno"
SET $July "Luglio"
SET $August "Agosto"
SET $September "Settembre"
SET $October "Ottobre"
SET $November "Novembre"
SET $December "Dicembre"
SET $Today "oggi"
SET $Tomorrow "domani"
BANNER Promemoria per %w, %d %m %y%o:
SET $Am "am"
SET $Pm "pm"
SET $Ago "fa"
SET $Fromnow "da oggi"
SET $On ""
SET $Now "ora"
SET $At "alle"
SET $Minute "minuto"
SET $Hour "ora"
SET $Is "é"
SET $Was "era"
SET $And "e"
SET $Hplu "a"
SET $Mplu "i"
FSET subst_bx(a, d, t) "fra " + (d-today()) + " giorni"
FSET subst_p(a, d, t) iif(d==today()+1, "o", "i")
FSET subst_q(a, d, t) iif(d==today()+1, "a", "e")
FSET subst_ax(a, d, t) wkday(d) + ", " + day(d) + " " + mon(d) + " " + year(d)
FSET subst_jx(a, d, t) subst_ax(a, d, t)
FSET subst_kx(a, d, t) wkday(d) + ", " + day(d) + " " + mon(d)
FSET subst_ux(a, d, t) subst_ax(a, d, t)
FSET subst_vx(a, d, t) subst_kx(a, d, t)
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst_1a(now()-t, $Ago), subst_1a(t-now(), $Fromnow))
FSET subst_1a(diff, when) subst_1b(diff/60, diff%60) + " " + when
FSET subst_1b(hdiff, mdiff) iif(hdiff==0, subst_minutes(mdiff), mdiff==0, subst_hours(hdiff), subst_hours(hdiff) + " " + $And + " " + subst_minutes(mdiff))
FSET subst_minutes(m) iif(m==1, "1 minuto", m + " minuti")
FSET subst_hours(h) iif(h==1, "1 ora", h + " ore")
FSET subst_0(a, d, t) iif(abs(now()-t)/60==1, "a", "e")
FSET subst_9(a, d, t) iif(abs(now()-t)%60==1, "o", "i")

56
include/lang/nl.rem Normal file
View File

@@ -0,0 +1,56 @@
# Support for the Dutch language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Willem Kasdorp and Erik-Jan Vens
SET $Sunday "zondag"
SET $Monday "maandag"
SET $Tuesday "dinsdag"
SET $Wednesday "woensdag"
SET $Thursday "donderdag"
SET $Friday "vrijdag"
SET $Saturday "zaterdag"
SET $January "januari"
SET $February "februari"
SET $March "maart"
SET $April "april"
SET $May "mei"
SET $June "juni"
SET $July "juli"
SET $August "augustus"
SET $September "september"
SET $October "oktober"
SET $November "november"
SET $December "december"
SET $Today "vandaag"
SET $Tomorrow "morgen"
BANNER Herinneringen voor %w, %d%s %m, %y%o:
SET $Am "am"
SET $Pm "pm"
SET $Ago "geleden"
SET $Fromnow "vanaf nu"
SET $On "op"
SET $Now "nu"
SET $At "op"
SET $Minute "minuut"
SET $Hour "uur"
SET $Is "is"
SET $Was "was"
SET $And "en"
SET $Hplu "en"
SET $Mplu "en"
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst_1a(now()-t, $Ago), subst_1a(t-now(), $Fromnow))
FSET subst_1a(diff, when) subst_1b(diff/60, diff%60) + " " + when
FSET subst_1b(hdiff, mdiff) iif(hdiff==0, subst_minutes(mdiff), mdiff==0, subst_hours(hdiff), subst_hours(hdiff) + " " + $And + " " + subst_minutes(mdiff))
FSET subst_minutes(m) iif(m==1, "1 minuut", m + " minuten")
FSET subst_hours(h) iif(h==1, "1 uur", h + " uren")
FSET subst_bx(a, d, t) "over " + (d-today()) + " dagen"

58
include/lang/no.rem Normal file
View File

@@ -0,0 +1,58 @@
# Support for the Norwegian language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Trygve Randen
SET $Sunday "Søndag"
SET $Monday "Mandag"
SET $Tuesday "Tirsdag"
SET $Wednesday "Onsdag"
SET $Thursday "Torsdag"
SET $Friday "Fredag"
SET $Saturday "Lørdag"
SET $January "Januar"
SET $February "Februar"
SET $March "Mars"
SET $April "April"
SET $May "Mai"
SET $June "Juni"
SET $July "Juli"
SET $August "August"
SET $September "September"
SET $October "Oktober"
SET $November "November"
SET $December "Desember"
SET $Today "i dag"
SET $Tomorrow "i morgen"
BANNER Påminnelse for %w, %d. %m, %y%o:
SET $Am "am"
SET $Pm "pm"
SET $Ago "siden"
SET $Fromnow "fra nå"
SET $On "den"
SET $Now "nå"
SET $At "kl."
SET $Minute "minutt"
SET $Hour "time"
SET $Is "er"
SET $Was "var"
SET $And "og"
SET $Hplu "r"
SET $Mplu "er"
FSET subst_bx(a, d, t) "om " + (d-today()) + " dager"
FSET subst_ordinal(d) "."
FSET subst_ax(a, d, t) iif(a, subst_a_alt(d), $On + " " + subst_a_alt(d))
FSET subst_a_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d) + " " + year(d)
FSET subst_gx(a, d, t) iif(a, subst_g_alt(d), $On + " " + subst_g_alt(d))
FSET subst_g_alt(d) wkday(d) + ", den " + day(d) + ". " + mon(d)
FSET subst_ux(a, d, t) subst_ax(a, d, t)
FSET subst_vx(a, d, t) subst_gx(a, d, t)
FSET subst_p(a, d, t) iif(d==today()+1, "", "er")

69
include/lang/pl.rem Normal file
View File

@@ -0,0 +1,69 @@
# Support for the Polish language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Jerzy Sobczyk
SET $Sunday "Niedziela"
SET $Monday "Poniedziałek"
SET $Tuesday "Wtorek"
SET $Wednesday "Środa"
SET $Thursday "Czwartek"
SET $Friday "Piątek"
SET $Saturday "Sobota"
SET $January "Styczeń"
SET $February "Luty"
SET $March "Marzec"
SET $April "Kwiecień"
SET $May "Maj"
SET $June "Czerwiec"
SET $July "Lipiec"
SET $August "Sierpień"
SET $September "Wrzesień"
SET $October "Październik"
SET $November "Listopad"
SET $December "Grudzień"
SET $Today "dzisiaj"
SET $Tomorrow "jutro"
BANNER Terminarz na %w, %d. %m %y%o:
SET $Am "am"
SET $Pm "pm"
SET $Ago "temu"
SET $Fromnow "od teraz"
SET $On "-"
SET $Now "teraz"
SET $At "o"
SET $Minute "minut"
SET $Hour "godzin"
SET $Is "będzie"
SET $Was "było"
SET $And "i"
SET $Hplu ""
SET $Mplu ""
FSET subst_pl_plu(n) iif(n==1, "ę", (n==12||n==13||n==14), "", (n%10==2||n%10==3||n%10==4), "y", "")
FSET subst_ampm(h) iif(h<5, " w nocy", h<10, " rano", h<12, " przed południem", h<18, " po południu", h<22, " wieczorem", " w nocy")
FSET subst_ordinal(d) ""
FSET subst_a_alt(d) wkday(d) + ", " + day(d) + ". " + mon(d) + " " + year(d)
FSET subst_ax(a, d, t) iif(a, subst_a_alt(d), $On + " " + subst_a_alt(d))
FSET subst_bx(a, d, t) "za " + (d-today()) + " dni"
FSET subst_g_alt(d) wkday(d) + ", " + day(d) + ". " + mon(d)
FSET subst_gx(a, d, t) iif(a, subst_g_alt(d), $On + " " + subst_g_alt(d))
FSET subst_ux(a, d, t) subst_ax(a, d, t)
FSET subst_vx(a, d, t) subst_gx(a, d, t)
FSET subst_p(a, d, t) ""
FSET subst_0(a, d, t) subst_pl_plu(abs(t-now())/60)
FSET subst_9(a, d, t) subst_pl_plu(abs(t-now())%60)
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst_1past(now()-t), subst_1future(t-now()))
FSET subst_1future(diff) "za " + iif(diff/60==0, subst_1min(diff%60), diff%60==0, subst_1h(diff/60), subst_1h(diff/60) + " " + $And + " " + subst_1min(diff%60))
FSET subst_1past(diff) iif(diff/60==0, subst_1min(diff%60), diff%60==0, subst_1h(diff/60), subst_1h(diff/60) + " " + $And + " " + subst_1min(diff%60)) + " temu"
FSET subst_1min(m) m + " " + $Minute + subst_pl_plu(m)
FSET subst_1h(h) h + " " + $Hour + subst_pl_plu(h)

69
include/lang/pt.rem Normal file
View File

@@ -0,0 +1,69 @@
# Support for the (Brazilian) Portuguese language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Marco Paganini
SET $Sunday "domingo"
SET $Monday "segunda"
SET $Tuesday "terça"
SET $Wednesday "quarta"
SET $Thursday "quinta"
SET $Friday "sexta"
SET $Saturday "sábado"
SET $January "janeiro"
SET $February "fevereiro"
SET $March "março"
SET $April "abril"
SET $May "maio"
SET $June "junho"
SET $July "julho"
SET $August "agosto"
SET $September "setembro"
SET $October "outubro"
SET $November "novembro"
SET $December "dezembro"
SET $Today "hoje"
SET $Tomorrow "amanhã"
BANNER Avisos para %w, %d de %m de %y%o:
SET $Am "am"
SET $Pm "pm"
SET $Ago "atrás"
SET $Fromnow "adiante"
SET $On "em"
SET $Now "agora"
SET $At "as"
SET $Minute "minuto"
SET $Hour "hora"
SET $Is "é"
SET $Was "foi"
SET $And "e"
SET $Hplu "s"
SET $Mplu "s"
FSET subst_ordinal(d) ""
FSET subst_on_wd(d) iif(wkdaynum(d) == 1 || wkdaynum(d) == 2, "no", "na")
FSET subst_a_alt(d) wkday(d) + ", " + day(d) + " de " + mon(d) + " de " + year(d)
FSET subst_bx(a, d, t) "em " + (d-today()) + " dias"
FSET subst_c_alt(d) wkday(d)
FSET subst_g_alt(d) wkday(d) + ", " + day(d) + " " + mon(d)
FSET subst_ax(a, d, t) iif(a, subst_a_alt(d), subst_on_wd(d) + " " + subst_a_alt(d))
FSET subst_cx(a, d, t) iif(a, subst_c_alt(d), subst_on_wd(d) + " " + subst_c_alt(d))
FSET subst_gx(a, d, t) iif(a, subst_g_alt(d), subst_on_wd(d) + " " + subst_g_alt(d))
FSET subst_jx(a, d, t) subst_ax(a, d, t)
FSET subst_k_alt(d) wkday(d) + ", " + day(d) + " de " + mon(d)
FSET subst_kx(a, d, t) iif(a, subst_k_alt(d), subst_on_wd(d) + " " + subst_k_alt(d))
FSET subst_ux(a, d, t) subst_ax(a, d, t)
FSET subst_vx(a, d, t) subst_kx(a, d, t)
FSET subst_1(a, d, t) iif(t==now(), $Now, t>now(), "em " + subst_1help(t-now()), subst_1help(now()-t) + " " + $Ago)
FSET subst_1help(diff) iif(diff/60==0, subst_mplu(diff%60), diff%60==0, subst_hplu(diff/60), subst_hplu(diff/60) + " " + $And + " " + subst_mplu(diff%60))
FSET subst_mplu(m) iif(m==1, "1 " + $Minute, m + " " + $Minute + $Mplu)
FSET subst_hplu(h) iif(h==1, "1 " + $Hour, h + " " + $Hour + $Hplu)

68
include/lang/ro.rem Normal file
View File

@@ -0,0 +1,68 @@
# Support for the Romanian language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
# This file is derived from a translation by Liviu Daia
SET $Sunday "Duminică"
SET $Monday "Luni"
SET $Tuesday "Marți"
SET $Wednesday "Miercuri"
SET $Thursday "Joi"
SET $Friday "Vineri"
SET $Saturday "Sâmbătă"
SET $January "Ianuarie"
SET $February "Februarie"
SET $March "Martie"
SET $April "Aprilie"
SET $May "Mai"
SET $June "Iunie"
SET $July "Iulie"
SET $August "August"
SET $September "Septembrie"
SET $October "Octombrie"
SET $November "Noiembrie"
SET $December "Decembrie"
SET $Today "astăzi"
SET $Tomorrow "mâine"
BANNER Reamintiri pentru %w, %d %m %y%o:
SET $Am "am"
SET $Pm "pm"
SET $Ago "acum"
SET $Fromnow "peste"
SET $On "pe"
SET $Now "acum"
SET $At "la ora"
SET $Minute "minut"
SET $Hour "or"
SET $Is "este"
SET $Was "a fost"
SET $Mplu "e"
SET $Hplu "e"
SET $And "şi"
FSET subst_bx(a, d, t) "peste " + (d-today()) + " zile"
FSET subst_ampm(h) iif(h<4, " noaptea", h<12, " dimineaţa", h<18, " după-amiaza", " seara")
FSET subst_ordinal(d) ""
FSET subst_ax(a, d, t) wkday(d) + ", " + day(d) + " " + mon(d) + " " + year(d)
FSET subst_cx(a, d, t) wkday(d)
FSET subst_gx(a, d, t) wkday(d) + ", " + day(d) + " " + mon(d)
FSET subst_jx(a, d, t) wkday(d) + ", " + mon(d) + " " + day(d) + ", " + year(d)
FSET subst_kx(a, d, t) wkday(d) + ", " + mon(d) + " " + day(d)
FSET subst_ux(a, d, t) subst_ax(a, d, t)
FSET subst_vx(a, d, t) subst_gx(a, d, t)
FSET subst_p(a, d, t) iif(d==today()+1, "", "le")
FSET subst_1(a, d, t) iif(t==now(), $Now, t<now(), subst_1helper(now()-t, "acum "), subst_1helper(t-now(), "peste "))
FSET subst_1helper(diff, when) when + iif(diff%60==0, subst_1h(diff/60), diff/60==0, subst_1m(diff%60), subst_1h(diff/60) + " " + $And + " " + subst_1m(diff%60))
FSET subst_1h(h) iif(h==1, "1 oră", h + " ore")
FSET subst_1m(m) iif(m==1, "1 minut", m + " minute")
FSET subst_0(a, d, t) iif(abs(t-now())/60==1, "ă", "e")

16
include/seasons.rem Normal file
View File

@@ -0,0 +1,16 @@
# Equinoxes and solstices
# SPDX-License-Identifier: GPL-2.0-only
IF $LatDeg >= 0
# Northern Hemisphere
REM NOQUEUE [soleq(0)] MSG %"Vernal Equinox%" is %3.
REM NOQUEUE [soleq(1)] MSG %"Summer Solstice%" is %3.
REM NOQUEUE [soleq(2)] MSG %"Autumnal Equinox%" is %3.
REM NOQUEUE [soleq(3)] MSG %"Winter Solstice%" is %3.
ELSE
# Southern Hemisphere
REM NOQUEUE [soleq(0)] MSG %"Autumnal Equinox%" is %3.
REM NOQUEUE [soleq(1)] MSG %"Winter Solstice%" is %3.
REM NOQUEUE [soleq(2)] MSG %"Vernal Equinox%" is %3.
REM NOQUEUE [soleq(3)] MSG %"Summer Solstice%" is %3.
ENDIF

2
include/site/README Normal file
View File

@@ -0,0 +1,2 @@
This directory is for system administrators to install site-wide
Remind scripts that are useful to their user-base.

View File

@@ -1,4 +1,4 @@
.TH REM 1 "1 January 2021"
.TH REM 1 "@RELEASE_DATE@" "User Commands" "VERSION @VERSION@"
.UC 4
.SH NAME
rem \- Invoke Remind with a default filename
@@ -16,5 +16,7 @@ the filename $HOME/.reminders
.PP
.SH AUTHOR
Remind was written by Dianne Skoll <dianne@skoll.ca>
.SH HOME PAGE
https://dianne.skoll.ca/projects/remind/
.SH SEE ALSO
\fBremind\fR

View File

@@ -1,4 +1,4 @@
.TH REM2PS 1 "5 January 2021"
.TH REM2PS 1 "@RELEASE_DATE@" "User Commands" "VERSION @VERSION@"
.UC 4
.SH NAME
rem2ps \- draw a PostScript calendar from Remind output
@@ -12,6 +12,10 @@ emits PostScript code (which draws a calendar) to the standard output.
See the section "Rem2PS Input Format" for details about the \fB\-p\fR
data. This may be useful if you wish to create other \fBRemind\fR
back-ends.
.PP
Note that \fBRem2PS\fR does not handle UTF-8 input. If you need to
render characters outside the ASCII character set, see
\fBrem2pdf\fR instead.
.SH OPTIONS
.TP
@@ -61,7 +65,9 @@ there is room and otherwise follows \fIn\fR=2 yields the same results as
.TP
.B \-i
Use ISO 8859-1 standard encoding for the PostScript fonts. If you do
not use this option, the default encoding is used.
not use this option, the default encoding is used. If you use this option,
you probably also need to convert Remind's output (typically UTF-8)
to ISO-8859-1 using \fBiconv\fR(1).
.TP
.B \-e
Make the calendar fill the entire page. By default, the calendar is
@@ -340,6 +346,10 @@ month (0 = Sunday, 1 = Monday, 6 = Saturday.) And \fImonday_first\fR is
1 if the \fB\-m\fR flag was supplied to \fBRemind\fR, or 0 if it was not.
All this information is supplied so back-ends don't need any date calculation
facilities.
Note that all spaces in \fImonth_name\fR will be replaced with
underscores. Back-ends should undo this replacement.
.TP
\fIsun mon tue wed thu fri sat\fR
This line consists of
@@ -347,6 +357,9 @@ space-separated names of days in whatever language \fBRemind\fR was
compiled for. This information can be used by back-ends to annotate
calendars, and means they don't have to be created for a specific
language.
Note that all spaces in day names will be replaced with
underscores. Back-ends should undo this replacement.
.TP
\fInext_mon next_days\fR
The name of the next month and the number of days in it.
@@ -573,6 +586,18 @@ For a SHADE or COLOR special, the blue color component.
.B body \fIbody\fR
The body of the reminder to issue. Always present.
.TP
.B calendar_body \fIbody\fR
The text appropriate to include in a calendar. Only present if the
original body contains %"...%" sequences and the "q" modifier was used
with Remind's "-pp..." flag.
.TP
.B plain_body \fIbody\fR
The "plain" body of the reminder with any %"...%" sequences removed.
If your back-end is designed to draw a calendar, then it should
use the \fBcalendar_body\fR if present. If not, then it
should use the \fBplain_body\fR if present, and if not, then it
should fall back on the \fBbody\fR.
.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
@@ -661,5 +686,8 @@ resulting PostScript output will probably not work.
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 HOME PAGE
https://dianne.skoll.ca/projects/remind/
.SH SEE ALSO
\fBremind\fR
\fBremind\fR, \fBrem2pdf\fR, \fBrem2html\fR, \fBtkremind\fR.

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
.TH TKREMIND 1 "15 January 2021"
.TH TKREMIND 1 "@RELEASE_DATE@" "User Commands" "VERSION @VERSION@"
.UC 4
.SH NAME
tkremind \- graphical front-end to Remind calendar program
@@ -18,13 +18,13 @@ as well as the tcllib extension. It also requires a \fBwish\fR
binary. If you are using Tcl/Tk 8.5, you may also need either the Img
or the tkpng extension to handle PNG images.
.SH OPTIONS
\fBTkRemind\fR itself has no options. However, it passes certain options
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.
.SH COMMAND-LINE OPTIONS
\fBTkRemind\fR itself has no command-line options. However, it passes
certain options 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
@@ -44,8 +44,14 @@ include the line:
.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.
its options. If it is omitted, it defaults to \fI$HOME/.config/tkremindrc\fR.
.PP
If \fB$HOME/.reminders\fR is a \fIdirectory\fR, then \fBTkRemind\fR defaults to
reading \fB$HOME/.reminders\fR and writing new reminders to
\fB$HOME/.reminders/100-tkremind.rem\fR. If you want to keep your
reminders in a directory \fB$HOME/.reminders\fR, you should create that
directory before starting \fBTkRemind\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
@@ -115,6 +121,8 @@ edit the reminder, thereby gaining access to advanced features of
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.
(If you have \fBrem2pdf\fR installed, you can choose to produce
PDF output rather than PostScript.)
Select the print destination by choosing either \fBTo file:\fR or
\fBTo command:\fR in the print dialog. Press \fBBrowse...\fR to bring
@@ -131,12 +139,13 @@ the directory.
Select the appropriate paper size and orientation. Activate
\fBFill page\fR if you want the calendar to fill the page. This should
be the normal case unless you have many reminders in a particular
day. (See the \fBRem2PS\fR documentation.)
day. (See the \fBRem2PS\fR or \fBrem2pdf\fR documentation.)
Finally, click \fBPrint\fR to print or \fBCancel\fR to cancel. Note
that during printing, \fBRemind\fR is called with the
\fB-itkremind=1\fR option and also an additional \fB-itkprint=1\fR
option.
option. If you are producing PDF output, then the option \fB-itkpdf=1\fR
is also supplied to \fBRemind\fR.
.SH EDITING REMINDERS
@@ -170,6 +179,13 @@ it will be underlined when you move the cursor over it, and
you can edit it in a text editor by either left- or right-clicking
on the reminder.
.SH ERRORS
If there are any errors in your reminder file, the "Queue..." button
changes to "Errors...". Click on "Errors..." to see the Remind error
output. Click "OK" to close the error window; this makes the button
in the main TkRemind window to revert to "Queue..."
.SH BACKGROUND REMINDERS
If you create "timed" reminders, \fBTkRemind\fR will queue them in
@@ -264,7 +280,7 @@ Similar to Change entry font, but applies to calendar heading
.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
to put them into effect and save them in $HOME/.config/tkremindrc, or
\fBCancel\fR to cancel any changes you made.
.SH KEYBOARD SHORTCUTS
@@ -283,6 +299,19 @@ Next Month
.B Home
Today
.SH IMMEDIATE UPDATES
If you are running \fBTkRemind\fR on Linux and have the
\fBinotifywait\fR program installed (part of the \fBinotify-tools\fR
or similar package), then \fBTkRemind\fR redraws the calendar window
\fIimmediately\fR if \fB$HOME/.reminders\fR changes (or, if it is a
directory, any files in that directory change.)
.PP
This lets \fBTkRemind\fR react immediately to hand-edited reminders or
to reminder files that are imported from another calendar system (for example,
you may have a cron job that periodically imports your Google Calendar
entries into Remind format.)
.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,
@@ -313,8 +342,7 @@ You can use this to activate certain reminders in different ways
for \fBTkRemind\fR (for example).
.PP
\fBTkRemind\fR uses tags to keep track of reminders in the
script file. It also places special comments in the reminder
file to store additional state. You can certainly mix
script file. You can certainly mix
"hand-crafted" reminders with reminders created by \fBTkRemind\fR
if you are aware of the following rules and limitations:
.TP
@@ -324,15 +352,16 @@ 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
lines in between. You can move such lines, but be careful to move
them as a single block.
.TP
o
Hand-crafted reminders cannot be edited with \fBTkRemind\fR, and
for hand-crafted timed reminders, you will not be presented with
the "Don't remind me again" option when they pop up.
.PP
However, rather than mixing hand-edited files with \fBTkRemind\fR-generated
ones, it is better to make \fB$HOME/.reminders\fR a directory and keep
your hand-edited files in a separate \fB*.rem\fR file than \fBTkRemind\fR's
\fB100-tkremind.rem\fR file.
.SH SERVER MODE
\fBRemind\fR has a special mode for interacting with programs like
@@ -390,13 +419,16 @@ This line is emitted in response to a \fBSTATUS\fR command. The number
.SH AUTHOR
TkRemind was written by Dianne Skoll <dianne@skoll.ca>
\fBTkRemind\fR is Copyright 1996-2020 by Dianne Skoll.
\fBTkRemind\fR is Copyright 1996-2023 by Dianne Skoll.
.SH FILES
$HOME/.reminders -- default reminder file.
$HOME/.reminders -- default reminder file or directory.
$HOME/.tkremindrc -- \fBTkRemind\fR saved options.
$HOME/.config/tkremindrc -- \fBTkRemind\fR saved options.
.SH HOME PAGE
https://dianne.skoll.ca/projects/remind/
.SH SEE ALSO
remind, rem2ps
\fBremind\fR, \fBrem2ps\fR, \fBrem2pdf\fR, \fBrem2html\fR

View File

@@ -7,7 +7,7 @@ bindir=@bindir@
datadir=@datadir@
datarootdir=@datarootdir@
PERL=@PERL@
PERLMODS_NEEDED=JSON::Any Getopt::Long
PERLMODS_NEEDED=JSON::MaybeXS Getopt::Long
all:
true
@@ -19,6 +19,7 @@ install:
$(PERL) -M$$m -e 1 > /dev/null 2>&1; \
if test $$? != 0 ; then echo "Not installing rem2html; missing $$m"; exit 0; fi; \
done; \
pod2man --center "VERSION @VERSION@" --date "@RELEASE_DATE@" rem2html > rem2html.1 && mkdir -p $(DESTDIR)$(mandir)/man1 && cp rem2html.1 $(DESTDIR)$(mandir)/man1/rem2html.1 || true; \
echo "Installing rem2html in $(DESTDIR)$(bindir)"; \
mkdir -p $(DESTDIR)$(bindir) && sed -e 's|^#!perl|#!$(PERL)|' < rem2html > $(DESTDIR)$(bindir)/rem2html && chmod 755 $(DESTDIR)$(bindir)/rem2html && exit 0; \
exit 1;

View File

@@ -1,10 +1,11 @@
#!perl
# SPDX-License-Identifier: GPL-2.0-only
use strict;
use warnings;
use Getopt::Long;
use JSON::Any;
use JSON::MaybeXS;
my %Options;
@@ -68,7 +69,7 @@ and newmoon.png, which are expected to live in C<--imgbase>.
=item --stylesheet I<url.css>
Use I<url.css> as the stylesheet. If this option is used,
I<url.css> is interpreted relative to B<imgbase> I<unless> it start
I<url.css> is interpreted relative to B<imgbase> I<unless> it starts
with a "/".
=item --nostyle
@@ -96,11 +97,47 @@ Insert I<html_text> right before the E<lt>/bodyE<gt> tag.
=back
=head1 SPECIALS SUPPORTED
The rem2html back-end supports the following SPECIAL reminders:
=over
=item HTML
Add an HTML reminder to the calendar. All HTML tags are available.
=item HTMLCLASS
Add a CSS class to the box representing the trigger date. See
"HIGHLIGHTING TODAY" for an example
=item WEEK, MOON, SHARE, COLOR
The standard SPECIALs supported by all back-ends
=back
=head1 HIGHLIGHTING TODAY
Older versions of rem2html used to highlight today's date with a red outline.
The current version does not do that by default. If you wish to highlight
today's date, add the following reminder to your reminders file:
REM [realtoday()] SPECIAL HTMLCLASS rem-today
=head1 AUTHOR
rem2html was written by Dianne Skoll with much inspiration from an
earlier version by Don Schwarz.
=head1 HOME PAGE
L<https://dianne.skoll.ca/projects/remind/>
=head1 SEE ALSO
B<remind>, B<rem2ps>, B<rem2pdf>, B<tkremind>
=cut
sub usage
@@ -232,23 +269,30 @@ sub parse_input
chomp($line);
($Month, $Year, $Numdays, $Firstwkday, $Mondayfirst) = split(' ', $line);
$Month =~ s/_/ /g;
# Day names
$line = <STDIN>;
return 0 unless $line;
chomp($line);
@Daynames = split(' ', $line);
for (my $i=0; $i<7; $i++) {
$Daynames[$i] =~ s/_/ /g;
}
# Prevmon prevlen
$line = <STDIN>;
return 0 unless $line;
chomp($line);
($Prevmon, $Prevlen) = split(' ', $line);
$Prevmon =~ s/_/ /g;
# Nextmon nextlen
$line = <STDIN>;
return 0 unless $line;
chomp($line);
($Nextmon, $Nextlen) = split(' ', $line);
$Nextmon =~ s/_/ /g;
$found_data = 1;
my $class;
@@ -266,7 +310,7 @@ sub parse_input
($y, $m, $d, $special, $tag, $duration, $time, $body) =
($1, $2, $3, $4, $5, $6, $7, $8);
} elsif (/\{/) {
my $obj = JSON::Any->jsonToObj($_);
my $obj = decode_json($_);
next unless ($obj->{date} =~ /^(\d+)-(\d+)-(\d+)$/);
$y = $1;
$m = $2;
@@ -480,7 +524,7 @@ sub output_calendar
}
for (my $day=1; $day<=$Numdays; $day++) {
draw_day_cell($day, $number_of_rows);
draw_day_cell($day, $number_of_rows);
$col++;
if ($col == 7) {
$col = 0;

23
rem2pdf/Makefile.PL.in Normal file
View File

@@ -0,0 +1,23 @@
use ExtUtils::MakeMaker;
{
# Override pod2man options
package MY;
sub manifypods {
my ($self,%attribs) = @_;
my $result = $self->SUPER::manifypods(%attribs);
$result =~ s/^(POD2MAN_EXE\s*=\s*)(.+)$/$1$2 --center 'VERSION @VERSION@' --date '@RELEASE_DATE@'/m;
return $result;
}
}
WriteMakefile(
NAME => 'Remind::PDF',
AUTHOR => q{Dianne Skoll <dianne@skoll.ca>},
VERSION => '@VERSION@',
PREREQ_PM => {
'Getopt::Long' => 0,
'Cairo' => 0,
'Pango' => 0,
},
EXE_FILES => [ 'bin/rem2pdf' ]
);

48
rem2pdf/Makefile.top.in Normal file
View File

@@ -0,0 +1,48 @@
# Set by configure - don't touch.
srcdir=@srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
mandir=@mandir@
bindir=@bindir@
datadir=@datadir@
datarootdir=@datarootdir@
PERL=@PERL@
PERLMODS_NEEDED=Getopt::Long Cairo Pango
all: Makefile
@if test "$(PERL)" = "" ; then \
echo "Not building rem2pdf; Perl is required"; exit 0; fi; \
for m in $(PERLMODS_NEEDED) ; \
do \
$(PERL) -M$$m -e 1 > /dev/null 2>&1; \
if test $$? != 0 ; then echo "Not building rem2pdf; missing $$m"; exit 0; fi; \
done; \
$(MAKE) all && exit 0; \
exit 1;
install:
@if test "$(PERL)" = "" ; then \
echo "Not installing rem2pdf; Perl is required"; exit 0; fi; \
for m in $(PERLMODS_NEEDED) ; \
do \
$(PERL) -M$$m -e 1 > /dev/null 2>&1; \
if test $$? != 0 ; then echo "Not installing rem2pdf; missing $$m"; exit 0; fi; \
done; \
echo "Installing rem2pdf"; \
if test "$(INSTALL_BASE)" != "" ; then \
$(MAKE) install DESTDIR=$(DESTDIR) "INSTALL_BASE=$(INSTALL_BASE)" && exit 0; \
elif test "$(prefix)" = "/usr" ; then \
$(MAKE) install DESTDIR=$(DESTDIR) INSTALLDIRS=vendor && exit 0; \
elif test "$(prefix)" = "/usr/local" ; then \
$(MAKE) install DESTDIR=$(DESTDIR) && exit 0; \
else \
$(MAKE) install DESTDIR=$(DESTDIR) "INSTALL_BASE=$(prefix)" && exit 0; \
fi; \
exit 1;
Makefile: Makefile.PL
if test "$(prefix)" != "/usr" -a "$(prefix)" != "/usr/local" -a "$(INSTALL_BASE)" = "" ; then \
$(PERL) Makefile.PL @PERLARTIFACTS@ INSTALL_BASE=$(prefix) || true;\
else \
$(PERL) Makefile.PL @PERLARTIFACTS@ INSTALL_BASE=$(INSTALL_BASE) || true;\
fi

22
rem2pdf/README Normal file
View File

@@ -0,0 +1,22 @@
rem2pdf is a Perl program that takes the output of "remind -p" and
produces a PDF calendar. See "man rem2pdf" for details.
rem2pdf has the following Perl modules as prerequisites:
Pango - https://metacpan.org/pod/Pango
Cairo - https://metacpan.org/pod/Cairo
On Debian or Debian-derived systems, these can be installed with:
apt install libpango-perl libcairo-perl
On Red Hat or Red Hat-derived systems, you need to install the perl-Pango
and perl-Cairo RPMs, which may require adding other repos to your list of
RPM sources.
rem2pdf is built and installed in the usual Perl program way:
perl Makefile.PL && make && sudo make install
--
Dianne Skoll - <dianne@skoll.ca>

515
rem2pdf/bin/rem2pdf.in Normal file
View File

@@ -0,0 +1,515 @@
#!@PERL@
# SPDX-License-Identifier: GPL-2.0-only
use strict;
use warnings;
use lib '@prefix@/lib/perl5';
use Encode;
use Cairo;
use Pango;
use Getopt::Long;
my $VERSION = '@VERSION@';
use Remind::PDF;
my $media_to_size = {
"Letter" => [ 612, 792],
"Tabloid" => [ 792, 1224],
"Ledger" => [1224, 792],
"Legal" => [ 612, 1008],
"Statement" => [ 396, 612],
"Executive" => [ 540, 720],
"A3" => [ 842, 1190],
"A4" => [ 595, 842],
"A5" => [ 420, 595],
"B4" => [ 729, 1032],
"B5" => [ 519, 729],
"Folio" => [ 612, 936],
"Quarto" => [ 612, 780],
"10x14" => [ 720, 1008],
};
my $help = 0;
my $settings = {
landscape => 0,
numbers_on_left => 0,
small_calendars => 0,
fill_entire_page => 0,
media => 'Letter',
width => 0,
height => 0,
title_font => 'Sans',
header_font => 'Sans',
daynum_font => 'Sans Bold Oblique',
entry_font => 'Sans',
small_cal_font => 'Sans',
title_size => 14,
header_size => 12,
daynum_size => 14,
entry_size => 8,
border_size => 4,
line_thickness => 1,
margin_top => 36,
margin_bottom => 36,
margin_left => 36,
margin_right => 36,
verbose => 0,
};
my $me = $0;
$me =~ s/^.*\///;
set_default_media();
sub usage
{
print <<"EOF";
$me (version $VERSION): Convert Remind -pp output to a PDF calendar.
Usage: remind -pp [options] filename | $me [options] > out.pdf
Options:
--landscape, -l Print in landscape orientation
--small-calendars=N Choose location for small calendars
-cN Synonym for --small-calendars=N
--left-numbers, -x Print day numbers on the left
--fill-page, -e Fill the entire page
--media=MEDIA, -mMEDIA Size for specified media
--width=W, -wW Specify media width in 1/72nds of an inch
--height=H, -hH Specify media height in 1/72nds of an inch
--title-font=FONT Specify font for calendar title
--header-font=FONT Specify font for weekday names
--daynum-font=FONT Specify font for day numbers
--entry-font=FONT Specify font for calendar entries
--small-cal-font=FONT Specify font for small calendars
--title-size=S Specify size of font for calendar title in points
--header-size=S Specify size of font for weekday names
--daynum-size=S Specify size of font for day numbers
--entry-size=S Specify size of font for calendar entries
--border-size=S Specify size of gaps between items in 1/72nds of an inch
--line-thickness=S Specify line thickness in 1/72nds of an inch
--margin-top=S Specify top margin size in 1/72nds of an inch
--margin-bottom=S Specify bottom margin size in 1/72nds of an inch
--margin-left=S Specify left margin size in 1/72nds of an inch
--margin-right=S Specify right margin size in 1/72nds of an inch
--verbose, -v Print progress messages
--help Display this help
EOF
}
Getopt::Long::Configure('bundling_values');
my $ret = GetOptions('landscape|l' => \$settings->{landscape},
'small-calendars|c=i' => \$settings->{small_calendars},
'left-numbers|x' => \$settings->{numbers_on_left},
'fill-page|e' => \$settings->{fill_entire_page},
'media|m=s' => \$settings->{media},
'width|w=i' => \$settings->{width},
'height|h=i' => \$settings->{height},
'title-font=s' => \$settings->{title_font},
'header-font=s' => \$settings->{header_font},
'daynum-font=s' => \$settings->{daynum_font},
'entry-font=s' => \$settings->{entry_font},
'small-cal-font=s' => \$settings->{small_cal_font},
'title-size=f' => \$settings->{title_size},
'header-size=f' => \$settings->{header_size},
'daynum-size=f' => \$settings->{daynum_size},
'entry-size=f' => \$settings->{entry_size},
'border-size=f' => \$settings->{border_size},
'line-thickness=f' => \$settings->{line_thickness},
'margin-top=f' => \$settings->{margin_top},
'margin-bottom=f' => \$settings->{margin_bottom},
'margin-left=f' => \$settings->{margin_left},
'margin-right=f' => \$settings->{margin_right},
'verbose|v' => \$settings->{verbose},
'help' => \$help
);
if (!$ret) {
usage();
exit(1);
}
if ($help) {
usage();
exit(0);
}
if ($settings->{width} <= 0 ||
$settings->{height} <= 0) {
my $size = $media_to_size->{ucfirst($settings->{media})};
if (!$size) {
if (lc($settings->{media}) ne 'help') {
print STDERR "Unknown media " . $settings->{media} . "\n";
}
set_default_media();
printf("%-12s Size in 1/72 in\n", "Valid media:");
foreach my $m (sort { $a cmp $b } (keys(%$media_to_size))) {
if ($m eq $settings->{media}) {
print "* ";
} else {
print " ";
}
printf("%-12s %4d x %4d\n", $m,
$media_to_size->{$m}->[0],
$media_to_size->{$m}->[1]);
}
exit(1);
}
$settings->{width} = $size->[0];
$settings->{height} = $size->[1];
}
if ($settings->{landscape}) {
my $tmp = $settings->{width};
$settings->{width} = $settings->{height};
$settings->{height} = $tmp;
}
# Don't read from a terminal
if (-t STDIN) {
print STDERR "I can't read data from a terminal. Please run like this:\n";
print STDERR " remind -pp [options] filename | $me [options] > out.pdf\n";
exit(1);
}
my $done_one = 0;
my $errored_out = 0;
my $surface = Cairo::PdfSurface->create_for_stream(sub { print $_[1] unless $errored_out; }, undef,
$settings->{width}, $settings->{height});
# set_metadata not available in older versions of Cairo
eval { $surface->set_metadata('title', 'Calendar'); };
eval { $surface->set_metadata('author', 'Remind (https://dianne.skoll.ca/projects/remind/)'); };
eval { $surface->set_metadata('creator', 'rem2pdf (https://dianne.skoll.ca/projects/remind/)'); };
eval { $surface->set_metadata('subject', 'Calendar'); };
my $cr = Cairo::Context->create($surface);
$cr->set_line_width($settings->{line_thickness});
while(1) {
my ($obj, $err) = Remind::PDF->create_from_stream(*STDIN,
{color => 1,
shade => 1,
moon => 1,
pango => 1,
week => 1,});
if (!$obj) {
if (!$done_one) {
$errored_out = 1;
print STDERR "$me: $err\n";
exit(1);
}
last;
}
$done_one = 1;
$obj->render($cr, $settings);
}
$surface->finish();
sub set_default_media
{
my $paper;
$paper = $ENV{PAPERSIZE};
if ($paper && set_media(ucfirst($paper))) {
return 1;
}
if ($ENV{PAPERCONF}) {
if (set_media_from_file($ENV{PAPERCONF})) {
return 1;
}
}
if (set_media_from_file('/etc/papersize')) {
return 1;
}
return set_media('Letter');
}
sub set_media
{
my ($m) = @_;
return 0 unless $media_to_size->{$m};
$settings->{media} = $m;
return 1;
}
sub set_media_from_file
{
my ($fn) = @_;
if (!open(IN, '<', $fn)) {
return 0;
}
while(<IN>) {
chomp;
s/^\s+//;
s/\s+$//;
next if ($_ eq '');
next if ($_ =~ /^#/);
my $m = $_;
close(IN);
return set_media($m);
}
close(IN);
return 0;
}
__END__
=head1 NAME
rem2pdf - draw a PDF calendar from Remind output
=head1 SYNOPSIS
remind -pp [options] file | rem2pdf [options] > output.pdf
=head1 DESCRIPTION
B<rem2pdf> reads the standard input, which should be the results of
running B<remind> with the B<-p>, B<-pp> or B<-ppp> options. It emits
PDF code that draws a calendar to standard output.
B<rem2pdf> uses the Pango text formatting library (L<https://pango.gnome.org/>)
and the Cairo graphics library (L<https://www.cairographics.org/>) to produce
its output. The CPAN modules Pango (L<https://metacpan.org/pod/Pango>)
and Cairo (L<https://metacpan.org/pod/Cairo>) are prerequisites.
B<rem2pdf> assumes that its input stream is valid UTF-8. If this is not
the case, it may render output incorrectly or even fail to render
output at all.
=head1 OPTIONS
=over
=item --landscape, -l
Print the calendar in landscape orientation. Essentially, this swaps
the width and height of the output media.
=item --small-calendars=I<n>, -cI<n>
Control the inclusion of small calendars for the previous and next
month. Possible values for I<n> are:
=over
=item Z<>0
Do not draw any small calendares
=item Z<>1
Place the small calendars at the bottom-right if there is room;
otherwise, place them at the top-left.
=item Z<>2
Place the small calendars at the top-left if there is room; otherwise,
place them at the bottom-right.
=item Z<>3
Place the previous month's small calendar at the top-left and the next
month's at the bottom-right if there is room; otherwise, follow
I<n>=1. A moment's thought reveals that an option which splits the
calendars if there is room and otherwise follows I<n>=2 yields the
same results.
=back
=item --left-numbers, -x
Draw the day numbers in the top-left corner of each day's box rather than
the default top-right.
=item --fill-page, -e
Make the calendar fill the available space on the page.
=item --media=I<media>, -mI<media>
Specify the paper size (Letter, A4, etc.) For a list of valid media sizes,
run:
rem2pdf --media=help
The default media size will be marked with an asterisk.
=item --width=I<n>, -wI<n>, --height=I<m>, -hI<m>
Rather than specifying a named media size, directly specify the width
and height of the output in 1/72ths of an inch. You must specify both
width and height for the options to be respected.
=item --title-font=I<font>
Specify the font used for the calendar title. It can be any font that
the Pango library on your system can use. The default is Sans. If
you choose a font with spaces in its name, you may need to quote this
argument.
=item --header-font=I<font>
Specify the font used for the weekday names. The default is Sans.
=item --daynum-font=I<font>
Specify the font used for the day numbers. The default is
Sans Bold Oblique.
=item --entry-font=I<font>
Specify the font used for calendar entries. The default is Sans.
=item --small-cal-font=I<font>
Specify the font used for the small next- and previous-month
calendars. The default is Sans.
=item --title-size=I<n>
Specify the size of the title font in 1/72ths of an inch. The default
is 14. This size, and indeed all following sizes, may be specified as
floating-point numbers.
=item --header-size=I<n>
Specify the size of the header font in 1/72ths of an inch. The default is 14.
=item --daynum-size=I<n>
Specify the size of the day number font in 1/72ths of an inch. The
default is 14.
=item --entry-size=I<n>
Specify the size of the calendar entry font in 1/72ths of an inch.
The default is 8.
=item --border-size=I<n>
Specify the size of the blank border between the contents of a calendar
box and the centre of the lines surrounding it, in 1/72ths of an inch.
The default is 4.
=item --line-thickness=I<n>
Specify the thickness of the lines drawn on the calendar. The default is 1.
=item --margin-top=I<n>
The size of the margin at the top of the page in 1/72ths of an inch.
The default is 36.
=item --margin-bottom=I<n>
The size of the margin at the bottom of the page in 1/72ths of an inch.
The default is 36.
=item --margin-left=I<n>
The size of the margin at the left of the page in 1/72ths of an inch.
The default is 36.
=item --margin-right=I<n>
The size of the margin at the right of the page in 1/72ths of an inch.
The default is 36.
=item --verbose, -v
Print (on STDERR) the name of the month and year for each month that
is rendered.
=back
=head1 USAGE
To use B<rem2df>, pipe the output of B<remind> with one of the
B<-p>, B<-pp> or B<-ppp> options into B<rem2pdf>. The PDF output
will be sent to standard output. So for example, to print a 12-month
calendar for the year 2030, use:
remind -pp12 /dev/null Jan 2030 | rem2pdf -e -l -c3 | lpr
You can concatenate multiple B<remind> runs. For example, the following
will produce a PDF calendar for January through March of 2023, and
June of 2023 (for a total of four pages);
(remind -pp3 /dev/null Jan 2023 ; \
remind -pp /dev/null June 2023) | rem2pdf -e -l -c3 > cal.pdf
=head1 FORMATTED TEXT
B<rem2pdf> supports a B<SPECIAL> reminder type called B<PANGO>. This
lets you format text using the Pango markup language, described at
L<https://docs.gtk.org/Pango/pango_markup.html>. Here are some
examples:
REM Mon SPECIAL PANGO <b>Bold</b> and <i>italic</i>
REM Tue SPECIAL PANGO <span face="zapf chancery">Fancy</span>
REM Wed SPECIAL PANGO <span foreground="red"><b>Bold red</b></span>
Other back-ends such as B<rem2ps> and B<rem2html> will ignore PANGO
special reminders.
Neither B<remind> nor B<rem2pdf> will check the markup to ensure
it is syntactically correct. If you use invalid Pango markup, the
Pango library will print a warning and B<rem2pdf> will not render any
output for the invalid reminder.
=head1 ABSOLUTELY-POSITIONED TEXT
If your B<PANGO> special reminder starts with C<@I<x>,I<y>> where I<x>
and I<y> are floating-point numbers, then the Pango marked-up test is
positioned absolutely with respect to the day's box (and is not
counted when calculating the box's height.)
A positive I<x> value positions the left edge of the text I<x> points
to the right of the left side of the calendar box, while a negative
I<x> value positions the right edge of the text I<x> points to the left
of the right side of the calendar box.
A positive I<y> value positions the top edge of the text I<y> points
below the top of the calendar box, while a negative I<y> value
positions the bottom edge of the text I<y> points above the bottom of
the calendar box.
If you use absolutely-positioned text, it's up to you to make sure it
doesn't overlap other text; B<rem2pdf> takes no special precautions to
prevent this.
As an example, this places Sunrise and Sunset times at the bottom left
of each calendar box:
REM SPECIAL PANGO @1,-1 <span size="4800"><i>Rise [sunrise($U)] Set [sunset($U)]</i></span>
(Note that Pango expresses font sizes in 1024's of a point, so a size of
4800 works out to about 4.6 points.)
=head1 AUTHOR
B<Rem2PDF> was written by Dianne Skoll <dianne@skoll.ca>
=head1 HOME PAGE
L<https://dianne.skoll.ca/projects/remind/>
=head1 SEE ALSO
B<remind>, B<rem2ps>, B<rem2html>, B<tkremind>

971
rem2pdf/lib/Remind/PDF.pm Normal file
View File

@@ -0,0 +1,971 @@
package Remind::PDF;
# SPDX-License-Identifier: GPL-2.0-only
use strict;
use warnings;
use Cairo;
use Pango;
use Remind::PDF::Entry;
use Encode;
use JSON::MaybeXS;
=head1 NAME
Remind::PDF - Render a month's worth of Remind data to PDF
=head1 CLASS METHODS
=head2 Remind::PDF->create_from_stream($in, $specials_accepted)
This method reads data from an open file handle C<$in>. C<$specials_accepted>
is a hashref of SPECIAL reminder types to accept; the key is the name of the
SPECIAL (all lower-case) and the value should be 1. Any SPECIAL reminders
not in the hash are ignored.
This function returns a two-element array: C<($obj, $err)>. On success,
C<$obj> will be a C<Remind::PDF> object and C<$err> will be undef. On
failure, C<$obj> will be undef and C<$err> will be an error message.
=cut
sub create_from_stream
{
my ($class, $in, $specials_accepted) = @_;
while (<$in>) {
chomp;
if ($_ eq '# rem2ps begin' ||
$_ eq '# rem2ps2 begin') {
my $self = bless {}, $class;
return $self->read_one_month($in, $_, $specials_accepted);
} elsif ($_ eq '[') {
return Remind::PDF::Multi->create_from_stream($in, $specials_accepted);
}
}
return (undef, "Could not find any remind -p output anywhere");
}
=head2 Remind::PDF->create_from_hash($hash, $specials_accepted)
This method takes data from a hash C<$hash>, which must be one month's
worth of data from C<remind -ppp> output. C<$specials_accepted> is a
hashref of SPECIAL reminder types to accept; the key is the name of
the SPECIAL (all lower-case) and the value should be 1. Any SPECIAL
reminders not in the hash are ignored.
This function returns a two-element array: C<($obj, $err)>. On success,
C<$obj> will be a C<Remind::PDF> object and C<$err> will be undef. On
failure, C<$obj> will be undef and C<$err> will be an error message.
=cut
sub create_from_hash
{
my ($class, $hash, $specials_accepted) = @_;
bless $hash, $class;
my $filtered_entries = [];
for (my $i=0; $i<=31; $i++) {
$filtered_entries->[$i] = [];
}
foreach my $e (@{$hash->{entries}}) {
if ($hash->accept_special($e, $specials_accepted)) {
my $day = $e->{date};
$day =~ s/^\d\d\d\d-\d\d-//;
$day =~ s/^0//;
push(@{$filtered_entries->[$day]}, Remind::PDF::Entry->new_from_hash($e));
}
}
$hash->{entries} = $filtered_entries;
return $hash;
}
=head1 INSTANCE METHODS
=head2 read_one_month($in, $first_line, $specials_accepted)
This function reads one month's worth of data from the file handle
C<$in>. C<$first_line> is the line that was read from C<$in>
just before calling this function. C<$specials_accepted> is a
hashref as documented above.
The return value is the same C<($obj, $err)> two-element array
as C<create_from_stream> returns.
=cut
sub read_one_month
{
my ($self, $in, $first_line, $specials_accepted) = @_;
$self->{entries} = [];
$self->{daynames} = [];
$self->{monthname} = '';
$self->{year} = '';
$self->{daysinmonth} = 0;
$self->{firstwkday} = 0;
$self->{mondayfirst} = 0;
$self->{prevmonthname} = '';
$self->{nextmonthname} = '';
$self->{daysinprevmonth} = 0;
$self->{daysinnextmonth} = 0;
$self->{prevmonthyear} = 0;
$self->{nextmonthyear} = 0;
for (my $i=0; $i<=31; $i++) {
$self->{entries}->[$i] = [];
}
my $line = $in->getline();
chomp($line);
# Month Year Days FirstWkday MondayFirst
if ($line =~ /^(\S+) (\d+) (\d+) (\d+) (\d+)/) {
$self->{monthname} = $1;
$self->{year} = $2;
$self->{daysinmonth} = $3;
$self->{firstwkday} = $4;
$self->{mondayfirst} = $5;
} else {
return (undef, "Cannot interpret line: $line");
}
$self->{monthname} =~ s/_/ /g;
# Day names
$line = $in->getline();
chomp($line);
if ($line =~ /^\S+ \S+ \S+ \S+ \S+ \S+ \S+$/) {
@{$self->{daynames}} = map { s/_/ /g; $_; } (split(/ /, $line));
} else {
return (undef, "Cannot interpret line: $line");
}
# Prev month, num days
$line = $in->getline();
chomp($line);
if ($line =~ /^\S+ \d+$/) {
($self->{prevmonthname}, $self->{daysinprevmonth}) = split(/ /, $line);
} else {
return (undef, "Cannot interpret line: $line");
}
# Next month, num days
$line = $in->getline();
chomp($line);
if ($line =~ /^\S+ \d+$/) {
($self->{nextmonthname}, $self->{daysinnextmonth}) = split(/ /, $line);
} else {
return (undef, "Cannot interpret line: $line");
}
$self->{prevmonthname} =~ s/_/ /g;
$self->{nextmonthname} =~ s/_/ /g;
if ($first_line eq '# rem2ps2 begin') {
# remind -pp format
return $self->read_one_month_pp($in, $specials_accepted);
}
# Old-style "remind -p"
# TODO: Eventually support this?
return $self->read_one_month_p($in, $specials_accepted);
}
=head2 read_one_month_p($in, $specials_accepted)
This function reads one month's worth of data from the file handle
C<$in>, assuming the original "remind -p" format.
C<$specials_accepted> is a hashref as documented above.
The return value is the same C<($obj, $err)> two-element array
as C<create_from_stream> returns.
=cut
sub read_one_month_p
{
my ($self, $in, $specials_accepted) = @_;
my $line;
while ($line = $in->getline()) {
chomp($line);
if ($line eq '# rem2ps end') {
return ($self, undef);
}
# Ignore comments
next if $line =~ /^#/;
my $hash = $self->parse_oldstyle_line($line);
next unless $hash;
my $day = $hash->{date};
$day =~ s/^\d\d\d\d-\d\d-//;
$day =~ s/^0//;
if ($self->accept_special($hash, $specials_accepted)) {
push(@{$self->{entries}->[$day]}, Remind::PDF::Entry->new_from_hash($hash));
}
}
return (undef, "Missing # rem2ps end marker");
}
=head2 parse_oldstyle_line ($line)
This method parses an old-style "remind -p" line
and returns a hashref containing some or all of the
hash keys found in the newer "remind -pp" JSON output.
=cut
sub parse_oldstyle_line
{
my ($self, $line) = @_;
return undef unless $line =~ m|^(\d+)/(\d+)/(\d+) (\S+) (\S+) (\S+) (\S+) (.*)$|;
my $hash = {
date => "$1-$2-$3",
passthru => $4,
tags => $5,
duration => $6,
time => $7,
body => $8};
foreach my $key (qw(passthru tags time duration)) {
delete $hash->{$key} if $hash->{$key} eq '*';
}
if ($hash->{passthru}) {
if ($hash->{passthru} =~ /^(shade|color|colour)$/i) {
if ($hash->{body} =~ /^\s*(\d+)\s+(\d+)\s+(\d+)\s*(.*)/) {
$hash->{r} = $1;
$hash->{g} = $2;
$hash->{b} = $3;
$hash->{body} = $4;
} elsif ($hash->{body} =~ /^\s*(\d+)\s*(.*)/) {
$hash->{r} = $1;
$hash->{g} = $1;
$hash->{b} = $1;
$hash->{body} = $2;
}
}
}
return $hash;
}
=head2 read_one_month_pp($in, $specials_accepted)
This function reads one month's worth of data from the file handle
C<$in>, assuming the "remind -pp" partial-JSON format.
C<$specials_accepted> is a hashref as documented above.
The return value is the same C<($obj, $err)> two-element array
as C<create_from_stream> returns.
=cut
sub read_one_month_pp
{
my ($self, $in, $specials_accepted) = @_;
my $json = JSON::MaybeXS->new(utf8 => 0);
my $line;
while ($line = $in->getline()) {
chomp($line);
if ($line eq '# rem2ps2 end') {
return ($self, undef);
}
my $hash;
eval {
$hash = $json->decode($line);
};
if (!$hash) {
return (undef, "Unable to decode JSON: $@");
}
my $day = $hash->{date};
$day =~ s/^\d\d\d\d-\d\d-//;
$day =~ s/^0//;
if ($self->accept_special($hash, $specials_accepted)) {
push(@{$self->{entries}->[$day]}, Remind::PDF::Entry->new_from_hash($hash));
}
}
return (undef, "Missing # rem2ps2 end marker");
}
=head2 accept_special($hash, $specials_accepted)
Given a hashref C<$hash> consisting of one entry parsed
from the "remind -p" stream and a C<$specials_accepted> hash,
return 1 if we should include this entry in the calendar or
0 if not.
=cut
sub accept_special
{
my ($self, $hash, $specials_accepted) = @_;
return 1 unless exists($hash->{passthru});
return 1 if $specials_accepted->{lc($hash->{passthru})};
return 0;
}
=head2 find_last_special($special, $entries)
Given an array of Reminder entries, find the last
C<$special>-type SPECIAL in the array. Return
the entry if one was found or undef if not.
=cut
sub find_last_special
{
my ($self, $special, $entries) = @_;
my $class = "Remind::PDF::Entry::$special";
my $found = undef;
foreach my $e (@$entries) {
$found = $e if ($e->isa($class));
}
return $found;
}
=head2 render($cr, $settings)
Render a calendar for one month. C<$cr> is a Cairo
drawing context, and C<$settings> is a settings hash
passed in by the caller. See the source code of
C<rem2pdf> for the contents of C<$settings>
=cut
sub render
{
my ($self, $cr, $settings) = @_;
$self->{horiz_lines} = [];
$cr->set_line_cap('square');
my $so_far = $self->draw_title($cr, $settings);
# Top line
push(@{$self->{horiz_lines}}, $so_far);
my $top_line = $so_far;
$so_far = $self->draw_daynames($cr, $settings, $so_far);
# Line under the days
push(@{$self->{horiz_lines}}, $so_far);
# Remaining space on page
$self->{remaining_space} = $settings->{height} - $settings->{margin_bottom} - $so_far;
$self->{minimum_row_height} = $self->{remaining_space} / 9;
# First column
my $first_col = $self->{firstwkday};
if ($self->{mondayfirst}) {
$first_col--;
if ($first_col < 0) {
$first_col = 6;
}
}
# Last column
my $last_col = ($first_col + $self->{daysinmonth} - 1) % 7;
# Number of rows
my $rows = 1;
my $last_day_on_row = 7 - $first_col;
while ($last_day_on_row < $self->{daysinmonth}) {
$last_day_on_row += 7;
$rows++;
}
my $extra_row = 0;
# Add a row for small calendars if necessary
if (($settings->{small_calendars} != 0) && ($first_col == 0) && ($last_col == 6)) {
$rows++;
$extra_row++;
}
# Figure out where to draw the small calendars
my $prevcal_top = 0;
my $nextcal_top = 0;
my $prevcal_bottom = 0;
my $nextcal_bottom = 0;
if ($settings->{small_calendars} == 1) {
if ($last_col <= 4 || ($last_col == 6 && $extra_row)) {
$prevcal_bottom = 1;
$nextcal_bottom = 1;
} else {
$prevcal_top = 1;
$nextcal_top = 1;
}
} elsif ($settings->{small_calendars} == 2) {
if ($first_col >= 2) {
$prevcal_top = 1;
$nextcal_top = 1;
} else {
$prevcal_bottom = 1;
$nextcal_bottom = 1;
}
} elsif ($settings->{small_calendars} == 3) {
if ($first_col >= 1 && $last_col <= 5) {
$prevcal_top = 1;
$nextcal_bottom = 1;
} else {
if ($last_col <= 4 || ($last_col == 6 && $extra_row)) {
$prevcal_bottom = 1;
$nextcal_bottom = 1;
} else {
$prevcal_top = 1;
$nextcal_top = 1;
}
}
}
# Row height if we are filling the page
$self->{row_height} = $self->{remaining_space} / $rows;
my ($start_col, $start_day);
for (my $row = 0; $row < $rows; $row++) {
if ($row == 0) {
$start_day = 1;
$start_col = $first_col;
} else {
$start_col = 0;
}
my $old_so_far = $so_far;
$so_far = $self->draw_row($cr, $settings, $so_far, $row, $start_day, $start_col);
$start_day += 7 - $start_col;
push(@{$self->{horiz_lines}}, $so_far);
if ($row == 0) {
if ($prevcal_top) {
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($old_so_far, 0, $so_far - $old_so_far, $settings);
$self->draw_small_calendar($cr, $x1 + $settings->{border_size}, $y1 + $settings->{border_size},
$x2 - $x1 - 2*$settings->{border_size}, $y2 - $y1 - 2*$settings->{border_size},
$settings, $self->{prevmonthname}, $self->{daysinprevmonth}, ($first_col + 35 - $self->{daysinprevmonth}) % 7);
}
if ($nextcal_top) {
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($old_so_far, 1, $so_far - $old_so_far, $settings);
$self->draw_small_calendar($cr, $x1 + $settings->{border_size}, $y1 + $settings->{border_size},
$x2 - $x1 - 2*$settings->{border_size}, $y2 - $y1 - 2*$settings->{border_size},
$settings, $self->{nextmonthname}, $self->{daysinnextmonth}, ($last_col + 1) % 7);
}
} elsif ($row == $rows-1) {
if ($prevcal_bottom) {
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($old_so_far, 5, $so_far - $old_so_far, $settings);
$self->draw_small_calendar($cr, $x1 + $settings->{border_size}, $y1 + $settings->{border_size},
$x2 - $x1 - 2*$settings->{border_size}, $y2 - $y1 - 2*$settings->{border_size},
$settings, $self->{prevmonthname}, $self->{daysinprevmonth}, ($first_col + 35 - $self->{daysinprevmonth}) % 7);
}
if ($nextcal_bottom) {
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($old_so_far, 6, $so_far - $old_so_far, $settings);
$self->draw_small_calendar($cr, $x1 + $settings->{border_size}, $y1 + $settings->{border_size},
$x2 - $x1 - 2*$settings->{border_size}, $y2 - $y1 - 2*$settings->{border_size},
$settings, $self->{nextmonthname}, $self->{daysinnextmonth}, ($last_col + 1) % 7);
}
}
}
if ($so_far > $settings->{height} - $settings->{margin_bottom}) {
print STDERR "WARNING: overfull calendar box\n";
}
# The vertical lines
my $cell = ($settings->{width} - $settings->{margin_left} - $settings->{margin_right}) / 7;
for (my $i=0; $i<=7; $i++) {
$cr->move_to($settings->{margin_left} + $i * $cell, $top_line);
$cr->line_to($settings->{margin_left} + $i * $cell, $so_far);
$cr->stroke();
}
# And the horizontal lines
foreach my $y (@{$self->{horiz_lines}}) {
$cr->move_to($settings->{margin_left}, $y);
$cr->line_to($settings->{width} - $settings->{margin_right}, $y);
$cr->stroke();
}
if ($settings->{verbose}) {
print STDERR "remdp2f: Rendered " . $self->{monthname} . ' ' . $self->{year} . "\n";
}
# Done this page
$cr->show_page();
}
=head2 draw_row($cr, $settings, $so_far, $row, $start_day, $start_col)
Draw a single row in the calendar. C<$cr> is a Cairo drawing context
and C<$settings> is the settings hash passed to C<render>. C<$so_far>
is the Y-coordinate of the top of the row; drawing starts at this
coordinate. C<$start_day> is the day of the month at which the
row starts and C<$start> col is the column number (0-6) at which
to start drawing from C<$start_day>
Returns the Y coordinate at which to start drawing the I<next>
calendar row.
=cut
sub draw_row
{
my ($self, $cr, $settings, $so_far, $row, $start_day, $start_col) = @_;
my $col = $start_col;
my $day = $start_day;
my $height = 0;
# Preview them to figure out the row height...
if (!$settings->{fill_entire_page}) {
while ($col < 7) {
my $h = $self->draw_day($cr, $settings, $so_far, $day, $col, 0);
$height = $h if ($h > $height);
$day++;
$col++;
last if ($day > $self->{daysinmonth});
}
$col = $start_col;
$day = $start_day;
} else {
$height = $self->{row_height} - $settings->{border_size} * 2;
}
if (!$settings->{fill_entire_page} && $height < $self->{minimum_row_height}) {
$height = $self->{minimum_row_height};
}
# Now draw for real
while ($col < 7 && $day <= $self->{daysinmonth}) {
$self->draw_day($cr, $settings, $so_far, $day, $col, $height);
$day++;
$col++;
}
return $so_far + $height + $settings->{border_size};
}
=head2 col_box_coordinates($so_far, $col, $height, $settings)
Returns a four-element array C<($x1, $y1, $x2, $y2)> representing
the bounding box of the calendar box at column C<$col> (0-6). C<$height>
is the height of the box and C<$settings> is the settings hashref
passed to C<render>.
=cut
sub col_box_coordinates
{
my ($self, $so_far, $col, $height, $settings) = @_;
my $cell = ($settings->{width} - $settings->{margin_left} - $settings->{margin_right}) / 7;
return (
$settings->{margin_left} + $cell * $col,
$so_far,
$settings->{margin_left} + $cell * ($col + 1),
$so_far + $height + $settings->{border_size},
);
}
=head2 draw_day($cr, $settings, $so_far, $day, $col, $height)
Renders a single day's worth of reminders. C<$cr> is a Cairo
drawing context and C<$settings> is the settings hash passed
to C<render>. C<$so_far> is the Y-coordinate of the top
of the box and C<$col> is the column number.
C<$height> is the height of the box. If C<$height> is passed
in as zero, then do not actually render anything... instead,
compute how high the box should be. If C<$height> is non-zero,
then it is the height of the box.
Returns the height required for the calendar box.
=cut
sub draw_day
{
my ($self, $cr, $settings, $so_far, $day, $col, $height) = @_;
my $top = $so_far;
my ($x1, $y1, $x2, $y2) = $self->col_box_coordinates($so_far, $col, $height, $settings);
# Do shading if we're in "for real" mode
if ($height) {
my $shade = $self->find_last_special('shade', $self->{entries}->[$day]);
if ($shade) {
$cr->save;
$cr->set_source_rgb($shade->{r} / 255,
$shade->{g} / 255,
$shade->{b} / 255);
$cr->rectangle($x1, $y1, $x2 - $x1, $y2 - $y1);
$cr->fill();
$cr->restore;
}
}
# Draw the day number
my $layout = Pango::Cairo::create_layout($cr);
$layout->set_text($day);
my $desc = Pango::FontDescription->from_string($settings->{daynum_font} . ' ' . $settings->{daynum_size} . 'px');
$layout->set_font_description($desc);
my ($wid, $h) = $layout->get_pixel_size();
# Don't actually draw if we're just previewing to get the cell height
if ($height) {
$cr->save;
if ($settings->{numbers_on_left}) {
$cr->move_to($x1 + $settings->{border_size}, $so_far + $settings->{border_size});
} else {
$cr->move_to($x2 - $settings->{border_size} - $wid, $so_far + $settings->{border_size});
}
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
}
$so_far += $h + 2 * $settings->{border_size};
my $entry_height = 0;
my $done = 0;
foreach my $entry (@{$self->{entries}->[$day]}) {
# Moon and week should not adjust height
if ($entry->isa('Remind::PDF::Entry::moon') ||
$entry->isa('Remind::PDF::Entry::week')) {
$entry->render($self, $cr, $settings, $top, $day, $col, $height);
next;
}
# An absolutely-positioned Pango markup should not adjust height
# either
if ($entry->isa('Remind::PDF::Entry::pango') &&
defined($entry->{atx}) && defined($entry->{aty})) {
$entry->render($self, $cr, $settings, $top, $day, $col, $height);
next;
}
# Shade is done already
if ($entry->isa('Remind::PDF::Entry::shade')) {
next;
}
if ($done) {
$so_far += $settings->{border_size};
$entry_height += $settings->{border_size};
}
$done = 1;
my $h2 = $entry->render($self, $cr, $settings, $so_far, $day, $col, $height);
$entry_height += $h2;
$so_far += $h2;
}
if ($height) {
if ($h + $entry_height + 2 * $settings->{border_size} > $height) {
print STDERR "WARNING: overfull box at $day " . $self->{monthname} . ' ' . $self->{year} . "\n";
$entry_height = $height;
}
}
return $h + $entry_height + 2 * $settings->{border_size};
}
=head2 draw_daynames($cr, $settings, $so_far)
Draw the weekday names heading. C<$cr> is a Cairo drawing context
and C<$settings> is the settings hash passed to C<render>. C<$so_far>
is the Y-coordinate of the top of the row; drawing starts at this
coordinate.
Returns the Y coordinate at which to start drawing the first
calendar row.
=cut
sub draw_daynames
{
my ($self, $cr, $settings, $so_far) = @_;
my $w = $settings->{width} - $settings->{margin_left} - $settings->{margin_right};
my $cell = $w/7;
$so_far += $settings->{border_size};
my $height = 0;
for (my $i=0; $i<7; $i++) {
my $j;
if ($self->{mondayfirst}) {
$j = ($i + 1) % 7;
} else {
$j = $i;
}
my $layout = Pango::Cairo::create_layout($cr);
$layout->set_text(Encode::decode('UTF-8', $self->{daynames}->[$j]));
my $desc = Pango::FontDescription->from_string($settings->{header_font} . ' ' . $settings->{header_size} . 'px');
$layout->set_font_description($desc);
my ($wid, $h) = $layout->get_pixel_size();
$cr->save;
$cr->move_to($settings->{margin_left} + $i * $cell + $cell/2 - $wid/2, $so_far);
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
if ($h > $height) {
$height = $h;
}
}
return $so_far + $height + $settings->{border_size} * .75;
}
=head2 draw_title($cr, $settings)
Draw the title ("Monthname Year") at the top of the calendar.
C<$cr> is a Cairo drawing context
and C<$settings> is the settings hash passed to C<render>.
Returns the Y coordinate at which to start drawing the row
containing the weekday names.
=cut
sub draw_title
{
my ($self, $cr, $settings) = @_;
my $title = $self->{monthname} . ' ' . $self->{year};
# set_page_label not available in older versions of Cairo
eval { $cr->get_target()->set_page_label($title); };
my $layout = Pango::Cairo::create_layout($cr);
$layout->set_text(Encode::decode('UTF-8', $title));
my $desc = Pango::FontDescription->from_string($settings->{title_font} . ' ' . $settings->{title_size} . 'px');
$layout->set_font_description($desc);
my ($w, $h) = $layout->get_pixel_size();
$cr->save();
$cr->move_to($settings->{width}/2 - $w/2, $settings->{margin_top});
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
return $h + $settings->{margin_top} + $settings->{border_size};
}
=head2 draw_small_calendar($cr, $x, $y, $width, $height, $settings, $month, $days, $start_wkday)
Draw a small calendar on the Cairo context C<$cr>. The top left-hand
corner of the box is at C<($x, $y)> and the size of the box is
C<($width, $height>). $settings is the settings hashref passed to
C<render>. C<$month> is the name of the month to draw and C<$days> is
the number of days in the month. Finally, C<$start_wkday> is the
weekday (0=Sunday, 6=Saturday) on which the month starts
=cut
sub draw_small_calendar
{
my ($self, $cr, $x, $y, $width, $height, $settings, $month, $days, $start_wkday) = @_;
my $first_col = $start_wkday;
if ($self->{mondayfirst}) {
$first_col--;
if ($first_col < 0) {
$first_col = 6;
}
}
# Last column
my $last_col = ($first_col + $days - 1) % 7;
# Number of rows
my $rows = 1;
my $last_day_on_row = 7 - $first_col;
while ($last_day_on_row < $days) {
$last_day_on_row += 7;
$rows++;
}
my $font_size = $self->calculate_small_calendar_font_size($cr, $width, $height, $settings, $rows);
my $layout = Pango::Cairo::create_layout($cr);
my $desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
$layout->set_font_description($desc);
$layout->set_text('88 ');
my ($wid, $h) = $layout->get_pixel_size();
$h += 1;
# Month name
$layout = Pango::Cairo::create_layout($cr);
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
$layout->set_font_description($desc);
$layout->set_text(Encode::decode('UTF-8', $month));
my ($mw, $mh) = $layout->get_pixel_size();
$cr->save();
$cr->move_to($x + $width/2 - $mw/2, $y);
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
$y += $h;
# Day names
for (my $col=0; $col <7; $col++) {
my $j;
if ($self->{mondayfirst}) {
$j = ($col + 1) % 7;
} else {
$j = $col;
}
my $day = $self->{daynames}->[$j];
my $l = substr(Encode::decode('UTF-8', $day), 0, 1);
$layout = Pango::Cairo::create_layout($cr);
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
$layout->set_font_description($desc);
$layout->set_text($l);
$cr->save();
$cr->move_to($x + $col*$wid, $y);
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
}
$y += $h;
my $col = $start_wkday;
for (my $d=1; $d <= $days; $d++) {
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
$layout->set_font_description($desc);
$layout->set_text($d);
$cr->save();
$cr->move_to($x + $col*$wid, $y);
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
$col++;
if ($col > 6) {
$col = 0;
$y += $h;
}
}
}
sub calculate_small_calendar_font_size
{
my ($self, $cr, $width, $height, $settings, $rows) = @_;
my $layout = Pango::Cairo::create_layout($cr);
my $desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . '10px');
$layout->set_font_description($desc);
$layout->set_text('88 88 88 88 88 88 88');
my ($wid, $h) = $layout->get_pixel_size();
$h += 1;
$h *= ($rows + 2); # row for month name; row for day names
my $scale = $width / $wid;
if (($height / $h) < $scale) {
$scale = $height / $h;
}
my $font_size = int($scale * 10);
# Check
$desc = Pango::FontDescription->from_string($settings->{small_cal_font} . ' ' . $font_size . 'px');
$layout->set_font_description($desc);
$layout->set_text('88 88 88 88 88 88 88');
($wid, $h) = $layout->get_pixel_size();
$h += 1;
$h *= ($rows + 2); # row for month name; row for day names
$scale = $width / $wid;
if (($height / $h) < $scale) {
$scale = $height / $h;
}
if ($scale < 1) { # Font size is too big
$font_size--;
}
return $font_size;
}
package Remind::PDF::Multi;
=head1 NAME
Remind::PDF::Multi - A container for multiple months' worth of calendar data
=head1 DESCRIPTION
The C<remind -ppp> output consists of a JSON array with each element
representing one month's worth of reminders. C<Remind::PDF::Multi>
reads this output and returns an instance of itself containing
an array of C<Remind::PDF> objects, one object for each month.
=head1 CLASS METHODS
=head2 Remind::PDF::Multi->create_from_stream($in, $specials_accepted)
This method reads data from an open file handle C<$in>. C<$specials_accepted>
is a hashref of SPECIAL reminder types to accept; the key is the name of the
SPECIAL (all lower-case) and the value should be 1. Any SPECIAL reminders
not in the hash are ignored.
This function returns a two-element array: C<($obj, $err)>. On
success, C<$obj> will be a C<Remind::PDF::Multi> object and C<$err>
will be undef. On failure, C<$obj> will be undef and C<$err> will be
an error message.
=cut
sub create_from_stream
{
my ($class, $in, $specials_accepted) = @_;
my $json = "[\n";
my $right_bracket = 0;
my $right_curly = 0;
while(<$in>) {
$json .= $_;
chomp;
if ($_ eq ']') {
$right_bracket++;
if ($right_bracket == 2 && $right_curly == 1) {
return $class->create_from_json($json, $specials_accepted);
}
} elsif($_ eq '}') {
$right_curly++;
} else {
$right_bracket = 0;
$right_curly = 0;
}
}
return(undef, 'Unable to parse JSON stream');
}
=head2 Remind::PDF::Multi->create_from_stream($json, $specials_accepted)
This method takes data from a JSON string <$json>. C<$specials_accepted>
is a hashref of SPECIAL reminder types to accept; the key is the name of the
SPECIAL (all lower-case) and the value should be 1. Any SPECIAL reminders
not in the hash are ignored.
This function returns a two-element array: C<($obj, $err)>. On
success, C<$obj> will be a C<Remind::PDF::Multi> object and C<$err>
will be undef. On failure, C<$obj> will be undef and C<$err> will be
an error message.
=cut
sub create_from_json
{
my ($class, $json, $specials_accepted) = @_;
my $parser = JSON::MaybeXS->new(utf8 => 0);
my $array;
eval {
$array = $parser->decode($json);
};
if (!$array) {
return (undef, "Unable to decode JSON: $@");
}
if (ref($array) ne 'ARRAY') {
return (undef, "Expecting array; found " . ref($array));
}
my $self = bless { months => []}, $class;
foreach my $m (@$array) {
my ($e, $error) = Remind::PDF->create_from_hash($m, $specials_accepted);
if (!$e) {
return (undef, $error);
}
push(@{$self->{entries}}, $e);
}
return ($self, undef);
}
=head1 INSTANCE METHODS
=head2 render($cr, $settings)
Iterate through all the C<Remind::PDF> objects
and call their C<render> methods. This method
renders as many months worth of calendar data
as were read from the C<remind -ppp> stream
=cut
sub render
{
my ($self, $cr, $settings) = @_;
foreach my $e (@{$self->{entries}}) {
$e->render($cr, $settings);
}
}
1;

View File

@@ -0,0 +1,318 @@
package Remind::PDF::Entry;
# SPDX-License-Identifier: GPL-2.0-only
use strict;
use warnings;
use Cairo;
use Pango;
use Encode;
=head1 NAME
Remind::PDF::Entry - Representation of one calendar entry
=head1 DESCRIPTION
C<Remind::PDF::Entry> and its subclasses represent one calendar
entry. They can be normal reminder-type entries or SPECIAL reminders.
=head1 CLASS METHODS
=head2 Remind::PDF::Entry->new_from_hash($hash)
Create and return a new C<Remind::PDF::Entry> based on one reminder's
worth of data from C<remind -p>. Returns a C<Remind::PDF::Entry> object,
or in the case of SPECIAL reminders, a subclass of C<Remind::PDF::Entry>.
=cut
sub new_from_hash
{
my ($class, $hash) = @_;
if (exists($hash->{passthru})) {
my $special = lc($hash->{passthru});
if ($special =~ /^(html|htmlclass|week|moon|shade|color|colour|postscript|psfile|pango)$/) {
$special = 'color' if $special eq 'colour';
$class = 'Remind::PDF::Entry::' . $special;
} else {
$class = 'Remind::PDF::Entry::UNKNOWN';
}
}
bless $hash, $class;
$hash->_adjust();
return $hash;
}
# Base class: Set the color to black
sub _adjust
{
my ($self) = @_;
$self->{r} = 0;
$self->{g} = 0;
$self->{b} = 0;
}
=head1 INSTANCE METHODS
=head2 render($pdf, $cr, $settings, $so_far, $day, $col, $height)
Render a single entry. C<$pdf> is the parent C<Remind::PDF>
object. C<$cr> is a Cairo drawing context and C<$settings> is the
usual settings hash. C<$so_far> is the Y-coordinate at which
to start drawing. C<$day> is the month day and C<$col> is
the calendar column. C<$height> is the height of the calendar
box.
If C<$height> is zero, then nothing should actually be drawn,
but the height of the calendar entry should be computed.
Returns the height of the calendar entry.
=cut
sub render
{
my ($self, $pdf, $cr, $settings, $so_far, $day, $col, $height) = @_;
my ($x1, $y1, $x2, $y2) = $pdf->col_box_coordinates($so_far, $col, $height, $settings);
my $layout = Pango::Cairo::create_layout($cr);
$layout->set_width(1024 * ($x2 - $x1 - 2 * $settings->{border_size}));
$layout->set_wrap('word-char');
my $body;
if (exists($self->{calendar_body})) {
$body = $self->{calendar_body};
} elsif (exists($self->{plain_body})) {
$body = $self->{plain_body};
} else {
$body = $self->{body};
}
$layout->set_text(Encode::decode('UTF-8', $body));
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . $settings->{entry_size} . 'px');
$layout->set_font_description($desc);
my ($wid, $h) = $layout->get_pixel_size();
if ($height) {
$cr->save();
$cr->set_source_rgb($self->{r} / 255,
$self->{g} / 255,
$self->{b} / 255);
$cr->move_to($x1 + $settings->{border_size}, $so_far);
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
}
return $h;
}
package Remind::PDF::Entry::html;
use base 'Remind::PDF::Entry';
sub render {}
package Remind::PDF::Entry::htmlclass;
use base 'Remind::PDF::Entry';
sub render {}
package Remind::PDF::Entry::week;
use base 'Remind::PDF::Entry';
sub render
{
my ($self, $pdf, $cr, $settings, $so_far, $day, $col, $height) = @_;
# Do nothing in pre-render mode
return 0 unless $height;
# Render in small text at bottom-right
my ($x1, $y1, $x2, $y2) = $pdf->col_box_coordinates($so_far, $col, $height, $settings);
my $layout = Pango::Cairo::create_layout($cr);
$layout->set_text(Encode::decode('UTF-8', $self->{body}));
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . int(0.75 * $settings->{entry_size}) . 'px');
$layout->set_font_description($desc);
my ($wid, $h) = $layout->get_pixel_size();
$cr->save();
$cr->move_to($x2 - $settings->{border_size}/4 - $wid, $y2 - $settings->{border_size}/4 - $h);
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
return 0;
}
package Remind::PDF::Entry::moon;
use base 'Remind::PDF::Entry';
sub _adjust {
my ($self) = @_;
my ($phase, $size, $fontsize, $msg) = split(/\s+/, $self->{body}, 4);
$phase = '' unless defined($phase);
$size = -1 unless defined($size);
$fontsize = -1 unless defined($fontsize);
$msg = '' unless defined($msg);
$self->{phase} = $phase;
$self->{size} = $size;
$self->{fontsize} = $fontsize;
$self->{body} = $msg;
}
sub render
{
my ($self, $pdf, $cr, $settings, $so_far, $day, $col, $height) = @_;
# Do nothing in pre-render mode
return 0 unless $height;
my ($x1, $y1, $x2, $y2) = $pdf->col_box_coordinates($so_far, $col, $height, $settings);
my $layout;
my $bodywidth = 0;
if ($self->{fontsize} <= 0) {
$self->{fontsize} = $settings->{entry_size};
}
if ($self->{size} <= 0) {
$self->{size} = $settings->{daynum_size};
}
if ($self->{phase} !~ /^[0123]$/) {
# Invalid phase
return 0;
}
if ($self->{body} ne '') {
$layout = Pango::Cairo::create_layout($cr);
$layout->set_text(Encode::decode('UTF-8', $self->{body}));
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . $self->{fontsize} . 'px');
$layout->set_font_description($desc);
($bodywidth, undef) = $layout->get_pixel_size();
}
my ($xc, $yc);
if ($settings->{numbers_on_left}) {
$yc = $so_far + $settings->{border_size} + ($self->{size} / 2);
$xc = $x2 - $settings->{border_size} - ($self->{size} / 2);
if ($bodywidth) {
$xc -= ($bodywidth + $settings->{border_size});
}
} else {
$xc = $x1 + $settings->{border_size} + ($self->{size} / 2);
$yc = $so_far + $settings->{border_size} + ($self->{size} / 2);
}
$self->draw_moon($xc, $yc, $cr);
if ($layout) {
$cr->save();
$cr->move_to ($xc + ($self->{size}/2) + $settings->{border_size},
$yc + ($self->{size}/2) - $self->{fontsize} );
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
}
}
sub draw_moon
{
my ($self, $xc, $yc, $cr) = @_;
$cr->save();
$cr->new_path();
$cr->arc($xc, $yc, $self->{size}/2, 0, 2*3.1415926535);
if ($self->{phase} == 0) {
$cr->stroke_preserve();
$cr->fill();
} elsif ($self->{phase} == 1) {
$cr->stroke();
$cr->arc($xc, $yc, $self->{size}/2, 3.1415926535/2, 3 * 3.1415926535/2);
$cr->stroke_preserve();
$cr->fill();
} elsif ($self->{phase} == 2) {
$cr->stroke();
} elsif ($self->{phase} == 3) {
$cr->stroke();
$cr->arc($xc, $yc, $self->{size}/2, 3 * 3.1415926535/2, 3.1415926535/2);
$cr->stroke_preserve();
$cr->fill();
}
$cr->restore();
}
package Remind::PDF::Entry::shade;
use base 'Remind::PDF::Entry';
sub _adjust
{
my ($self) = @_;
if ($self->{body} =~ /^(\d+)\s+(\d+)\s+(\d+)/) {
$self->{r} = $1;
$self->{g} = $2;
$self->{b} = $3;
}
}
package Remind::PDF::Entry::color;
use base 'Remind::PDF::Entry';
# Nothing to do for COLOR-type reminder
sub _adjust
{
}
package Remind::PDF::Entry::postscript;
use base 'Remind::PDF::Entry';
sub render {}
package Remind::PDF::Entry::psfile;
use base 'Remind::PDF::Entry';
sub render {}
package Remind::PDF::Entry::pango;
use base 'Remind::PDF::Entry';
sub _adjust
{
my ($self) = @_;
if ($self->{body} =~ /^@([-0-9.]+),\s*([-0-9.]+)\s*(.*)/) {
$self->{atx} = $1;
$self->{aty} = $2;
$self->{body} = $3;
}
}
sub render
{
my ($self, $pdf, $cr, $settings, $so_far, $day, $col, $height) = @_;
my ($x1, $y1, $x2, $y2) = $pdf->col_box_coordinates($so_far, $col, $height, $settings);
my $layout = Pango::Cairo::create_layout($cr);
$layout->set_width(1024 * ($x2 - $x1 - 2 * $settings->{border_size}));
$layout->set_wrap('word-char');
$layout->set_markup(Encode::decode('UTF-8', $self->{body}));
if (($layout->get_text() // '') eq '') {
# Invalid markup
return 0;
}
my $desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . $settings->{entry_size} . 'px');
$layout->set_font_description($desc);
my ($wid, $h) = $layout->get_pixel_size();
if ($height) {
$cr->save();
if (defined($self->{atx}) && defined($self->{aty})) {
my ($x, $y);
if ($self->{atx} < 0) {
$x = $x2 + $self->{atx} - $wid;
} else {
$x = $x1 + $self->{atx};
}
if ($self->{aty} < 0) {
$y = $y2 + $self->{aty} - $h;
} else {
$y = $y1 + $self->{aty};
}
$cr->move_to($x, $y);
} else {
$cr->move_to($x1 + $settings->{border_size}, $so_far);
}
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
}
return $h;
}
package Remind::PDF::Entry::UNKNOWN;
use base 'Remind::PDF::Entry';
sub render {}
1;

File diff suppressed because it is too large Load Diff

View File

@@ -36,21 +36,21 @@ REMINDOBJS= $(REMINDSRCS:.c=.o)
all: remind rem2ps
test: remind
test: all
@sh ../tests/test-rem
.c.o:
@CC@ -c @CPPFLAGS@ @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -I. -I$(srcdir) $<
@CC@ -c @CPPFLAGS@ @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -DSYSDIR=$(datarootdir)/remind -I. -I$(srcdir) $<
$(REMINDOBJS): $(REMINDHDRS)
rem2ps: rem2ps.o dynbuf.o json.o
@CC@ @LDFLAGS@ $(LDEXTRA) -o rem2ps rem2ps.o dynbuf.o json.o -lm
@CC@ @CFLAGS@ @LDFLAGS@ $(LDEXTRA) -o rem2ps rem2ps.o dynbuf.o json.o -lm
remind: $(REMINDOBJS)
@CC@ @LDFLAGS@ $(LDEXTRA) -o remind $(REMINDOBJS) @LIBS@
@CC@ @CFLAGS@ @LDFLAGS@ $(LDEXTRA) -o remind $(REMINDOBJS) @LIBS@
install-nostripped: all
install: all
-mkdir -p $(DESTDIR)$(bindir) || true
for prog in $(PROGS) $(SCRIPTS) ; do \
$(INSTALL_PROGRAM) $$prog $(DESTDIR)$(bindir) || exit 1; \
@@ -61,8 +61,10 @@ install-nostripped: all
for man in $(MANS) ; do \
$(INSTALL_DATA) $$man $(DESTDIR)$(mandir)/man1 || exit 1; \
done
-mkdir -p $(DESTDIR)$(datarootdir)/remind || true
cp -R ../include/* $(DESTDIR)$(datarootdir)/remind
install: install-nostripped
install-stripped: install
strip $(DESTDIR)$(bindir)/remind || true
strip $(DESTDIR)$(bindir)/rem2ps || true

File diff suppressed because it is too large Load Diff

54
src/compare-language-mods.pl Executable file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/perl
use strict;
use warnings;
my $language_map = {
en => 'ENGLISH',
de => 'GERMAN',
nl => 'DUTCH',
fi => 'FINNISH',
fr => 'FRENCH',
'no' => 'NORWEGIAN',
da => 'DANISH',
pl => 'POLISH',
is => 'ICELANDIC',
pt => 'BRAZPORT',
it => 'ITALIAN',
ro => 'ROMANIAN',
es => 'SPANISH',
};
if (!$ARGV[0]) {
print STDERR "Usage: $0 lang_code\n";
exit(1);
}
my $lang = $ARGV[0];
if (!exists($language_map->{$lang})) {
print STDERR "$lang is not a valid language.\n";
exit(1);
}
my $flag = $language_map->{$lang};
print STDERR "Testing for: $lang - $flag.\n";
my_sys("make clean > /dev/null 2>&1") && die("make clean failed");
my_sys("make -j6 all LANGDEF=-DLANG=$flag > /dev/null 2>&1") && die("make all failed");
my_sys("./remind -q -r ../tests/tstlang.rem 2022-03-23 11:44 > test-$lang-compiled.out 2>&1");
my_sys("make clean > /dev/null 2>&1") && die("make clean failed");
my_sys("make -j6 all > /dev/null 2>&1") && die("make all failed");
my_sys("./remind -q -r -ii=\\\"../include/lang/$lang.rem\\\" ../tests/tstlang.rem 2022-03-23 11:44 > test-$lang-runtime.out 2>&1");
my $rc = my_sys("cmp test-$lang-compiled.out test-$lang-runtime.out > /dev/null 2>&1");
if ($rc == 0) {
print STDERR "Congrats! Compiled and runtime language output matches for $lang.\n";
} else {
print STDERR "Whoops. Compiled and runtime language output differs for $lang.\n"
}
exit(0);
sub my_sys
{
#print STDERR "Running: " . join(' ', @_) . "\n";
return system(@_);
}

View File

@@ -20,6 +20,8 @@
#undef HAVE_LOCALE_H
#undef HAVE_LANGINFO_H
#undef HAVE_GLOB
#undef HAVE_SETENV
@@ -38,7 +40,4 @@
/* The number of bytes in a unsigned long. */
#undef SIZEOF_UNSIGNED_LONG
/* The number of bytes in a unsigned short. */
#undef SIZEOF_UNSIGNED_SHORT
#include "custom.h"

View File

@@ -6,27 +6,24 @@
/* which you can customize. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
/*---------------------------------------------------------------------*/
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
/* DEFAULT_LATITUDE: Latitude of your location */
/* DEFAULT_LONGITUDE: Longitude of your location */
/* LOCATION: A string identifying your location. */
/* All latitude and longitude numbers should be positive for the */
/* northern and western hemisphere. If you live in the southern */
/* hemisphere, ALL latitude values should be negative. If you live */
/* in the eastern hemisphere, ALL longitude values should be negative. */
/* Latitude and longitude should be positive for the */
/* northern and eastern hemisphere and negative for the southern and */
/* western hemisphere. */
/* */
/* The default values are initially set to Ottawa, Ontario, Canada. */
/* The default values are initially set to the city hall in Ottawa, */
/* Ontario, Canada. */
/*---------------------------------------------------------------------*/
#define LAT_DEG 45
#define LAT_MIN 24
#define LAT_SEC 0
#define LON_DEG 75
#define LON_MIN 39
#define LON_SEC 0
#define DEFAULT_LATITUDE 45.420556
#define DEFAULT_LONGITUDE -75.689722
#define LOCATION "Ottawa"
/*---------------------------------------------------------------------*/
@@ -58,45 +55,6 @@
#define DATETIMESEP '@'
/* #define DATETIMESEP '/' */
/*---------------------------------------------------------------------*/
/* ISOLATIN1: define it to 1 if you use the */
/* ISO 8859-1 character set instead of ASCII. */
/*---------------------------------------------------------------------*/
#define ISOLATIN1 1
/*---------------------------------------------------------------------*/
/* ISOLATIN2: define it to 1 if you use the */
/* ISO 8859-2 character set instead of ASCII. */
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
/* then one are defined as 1, the results are unspecified. */
/*---------------------------------------------------------------------*/
#define ISOLATIN2 0
/*---------------------------------------------------------------------*/
/* IBMEXTENDED: define as 1 if your system uses the IBM extended */
/* character set. */
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
/* then one are defined as 1, the results are unspecified. */
/*---------------------------------------------------------------------*/
#define IBMEXTENDED 0
/*---------------------------------------------------------------------*/
/* IBM852: define as 1 if your system uses the IBM CPI-852 extended */
/* character set. */
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
/* then one are defined as 1, the results are unspecified. */
/*---------------------------------------------------------------------*/
#define IBM852 0
/*---------------------------------------------------------------------*/
/* WANT_U_OPTION: Comment out the next define to permanently disable */
/* the -u option. */
/*---------------------------------------------------------------------*/
#define WANT_U_OPTION 1
/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
@@ -114,16 +72,7 @@
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
/* characters to be escaped with a backslash for the -k option. */
/*---------------------------------------------------------------------*/
#if defined(UNIX)
#define WANT_SHELL_ESCAPING 1
#endif
/*---------------------------------------------------------------------*/
/* Some implementations have a broken 'putc' and 'putchar'. */
/*---------------------------------------------------------------------*/
#ifdef __SASC_60
#define BROKEN_PUTC
#endif
/*---------------------------------------------------------------------*/
/* BASE: The base year for date calculation. NOTE! January 1 of the */
@@ -168,7 +117,7 @@
/*---------------------------------------------------------------------*/
/* VAL_STACK_SIZE: The size of the operand stack for expr. parsing */
/*---------------------------------------------------------------------*/
#define VAL_STACK_SIZE 500
#define VAL_STACK_SIZE 1000
/*---------------------------------------------------------------------*/
/* INCLUDE_NEST: How many nested INCLUDES do we handle? */
@@ -189,7 +138,7 @@
/*---------------------------------------------------------------------*/
/* How many global omits of the form YYYY MM DD do we handle? */
/*---------------------------------------------------------------------*/
#define MAX_FULL_OMITS 500
#define MAX_FULL_OMITS 1000
/*---------------------------------------------------------------------*/
/* How many global omits of the form MM DD do we handle? */
@@ -223,14 +172,6 @@
#define PSBEGIN2 "# rem2ps2 begin"
#define PSEND2 "# rem2ps2 end"
#ifdef BROKEN_PUTC
#define Putc SafePutc
#define PutChar SafePutChar
#else
#define Putc putc
#define PutChar putchar
#endif
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
#define REM_USE_WCHAR 1
#else

View File

@@ -6,27 +6,24 @@
/* which you can customize. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
/*---------------------------------------------------------------------*/
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
/* DEFAULT_LATITUDE: Latitude of your location */
/* DEFAULT_LONGITUDE: Longitude of your location */
/* LOCATION: A string identifying your location. */
/* All latitude and longitude numbers should be positive for the */
/* northern and western hemisphere. If you live in the southern */
/* hemisphere, ALL latitude values should be negative. If you live */
/* in the eastern hemisphere, ALL longitude values should be negative. */
/* Latitude and longitude should be positive for the */
/* northern and eastern hemisphere and negative for the southern and */
/* western hemisphere. */
/* */
/* The default values are initially set to Ottawa, Ontario, Canada. */
/* The default values are initially set to the city hall in Ottawa, */
/* Ontario, Canada. */
/*---------------------------------------------------------------------*/
#define LAT_DEG 45
#define LAT_MIN 24
#define LAT_SEC 0
#define LON_DEG 75
#define LON_MIN 39
#define LON_SEC 0
#define DEFAULT_LATITUDE 45.420556
#define DEFAULT_LONGITUDE -75.689722
#define LOCATION "Ottawa"
/*---------------------------------------------------------------------*/
@@ -58,45 +55,6 @@
#define DATETIMESEP '@'
/* #define DATETIMESEP '/' */
/*---------------------------------------------------------------------*/
/* ISOLATIN1: define it to 1 if you use the */
/* ISO 8859-1 character set instead of ASCII. */
/*---------------------------------------------------------------------*/
#define ISOLATIN1 1
/*---------------------------------------------------------------------*/
/* ISOLATIN2: define it to 1 if you use the */
/* ISO 8859-2 character set instead of ASCII. */
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
/* then one are defined as 1, the results are unspecified. */
/*---------------------------------------------------------------------*/
#define ISOLATIN2 0
/*---------------------------------------------------------------------*/
/* IBMEXTENDED: define as 1 if your system uses the IBM extended */
/* character set. */
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
/* then one are defined as 1, the results are unspecified. */
/*---------------------------------------------------------------------*/
#define IBMEXTENDED 0
/*---------------------------------------------------------------------*/
/* IBM852: define as 1 if your system uses the IBM CPI-852 extended */
/* character set. */
/* NOT ALL LANGUAGE MODULES SUPPORT THIS. Note that at most one of */
/* ISOLATIN1, ISOLATIN2, IBMEXTENDED and IBM852 should be 1; if more */
/* then one are defined as 1, the results are unspecified. */
/*---------------------------------------------------------------------*/
#define IBM852 0
/*---------------------------------------------------------------------*/
/* WANT_U_OPTION: Comment out the next define to permanently disable */
/* the -u option. */
/*---------------------------------------------------------------------*/
#define WANT_U_OPTION 1
/**********************************************************************/
/**********************************************************************/
/**********************************************************************/
@@ -114,16 +72,7 @@
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
/* characters to be escaped with a backslash for the -k option. */
/*---------------------------------------------------------------------*/
#if defined(UNIX)
#define WANT_SHELL_ESCAPING 1
#endif
/*---------------------------------------------------------------------*/
/* Some implementations have a broken 'putc' and 'putchar'. */
/*---------------------------------------------------------------------*/
#ifdef __SASC_60
#define BROKEN_PUTC
#endif
/*---------------------------------------------------------------------*/
/* BASE: The base year for date calculation. NOTE! January 1 of the */
@@ -168,7 +117,7 @@
/*---------------------------------------------------------------------*/
/* VAL_STACK_SIZE: The size of the operand stack for expr. parsing */
/*---------------------------------------------------------------------*/
#define VAL_STACK_SIZE 500
#define VAL_STACK_SIZE 1000
/*---------------------------------------------------------------------*/
/* INCLUDE_NEST: How many nested INCLUDES do we handle? */
@@ -189,7 +138,7 @@
/*---------------------------------------------------------------------*/
/* How many global omits of the form YYYY MM DD do we handle? */
/*---------------------------------------------------------------------*/
#define MAX_FULL_OMITS 500
#define MAX_FULL_OMITS 1000
/*---------------------------------------------------------------------*/
/* How many global omits of the form MM DD do we handle? */
@@ -223,14 +172,6 @@
#define PSBEGIN2 "# rem2ps2 begin"
#define PSEND2 "# rem2ps2 end"
#ifdef BROKEN_PUTC
#define Putc SafePutc
#define PutChar SafePutChar
#else
#define Putc putc
#define PutChar putchar
#endif
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
#define REM_USE_WCHAR 1
#else

View File

@@ -7,7 +7,8 @@
/* commands. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -28,8 +29,8 @@ static int ParseTimeTrig (ParsePtr s, TimeTrig *tim, int save_in_globals);
static int ParseLocalOmit (ParsePtr s, Trigger *t);
static int ParseScanFrom (ParsePtr s, Trigger *t, int type);
static int ParsePriority (ParsePtr s, Trigger *t);
static int ParseUntil (ParsePtr s, Trigger *t);
static int ShouldTriggerBasedOnWarn (Trigger *t, int jul, int *err);
static int ParseUntil (ParsePtr s, Trigger *t, int type);
static int ShouldTriggerBasedOnWarn (Trigger *t, int dse, int *err);
static int ComputeTrigDuration(TimeTrig *t);
static int
@@ -55,7 +56,7 @@ int DoRem(ParsePtr p)
Trigger trig;
TimeTrig tim;
int r, err;
int jul;
int dse;
DynamicBuffer buf;
Token tok;
@@ -96,9 +97,13 @@ int DoRem(ParsePtr p)
FindToken(DBufValue(&buf), &tok);
DBufFree(&buf);
if (tok.type == T_Empty || tok.type == T_Comment) {
r = OK;
if (trig.addomit) {
r = AddGlobalOmit(LastTriggerDate);
}
DBufFree(&buf);
FreeTrig(&trig);
return OK;
return r;
}
if (tok.type != T_RemType || tok.val == SAT_TYPE) {
DBufFree(&buf);
@@ -120,14 +125,14 @@ int DoRem(ParsePtr p)
DBufFree(&buf);
}
trig.typ = tok.val;
jul = LastTriggerDate;
dse = LastTriggerDate;
if (!LastTrigValid || PurgeMode) {
FreeTrig(&trig);
return OK;
}
} else {
/* Calculate the trigger date */
jul = ComputeTrigger(trig.scanfrom, &trig, &tim, &r, 1);
dse = ComputeTrigger(trig.scanfrom, &trig, &tim, &r, 1);
if (r) {
if (PurgeMode) {
PurgeEchoLine("%s: %s\n", "#!P! Problem calculating trigger date", ErrMsg[r]);
@@ -143,14 +148,14 @@ int DoRem(ParsePtr p)
/* Add to global OMITs if so indicated */
if (trig.addomit) {
r = AddGlobalOmit(jul);
r = AddGlobalOmit(dse);
if (r) {
FreeTrig(&trig);
return r;
}
}
if (PurgeMode) {
if (trig.expired || jul < JulianToday) {
if (trig.expired || dse < DSEToday) {
if (p->expr_happened) {
if (p->nonconst_expr) {
PurgeEchoLine("%s\n", "#!P: Next line may have expired, but contains non-constant expression");
@@ -168,27 +173,37 @@ int DoRem(ParsePtr p)
FreeTrig(&trig);
return OK;
}
/* Queue the reminder, if necessary */
if (jul == JulianToday &&
/* Queue the reminder, if necessary */
if (dse == DSEToday &&
!(!IgnoreOnce &&
trig.once != NO_ONCE &&
FileAccessDate == JulianToday))
FileAccessDate == DSEToday))
QueueReminder(p, &trig, &tim, trig.sched);
/* If we're in daemon mode, do nothing over here */
/* If we're in daemon mode, do nothing over here */
if (Daemon) {
FreeTrig(&trig);
return OK;
}
if (ShouldTriggerReminder(&trig, &tim, jul, &err)) {
if ( (r=TriggerReminder(p, &trig, &tim, jul)) ) {
r = OK;
if (ShouldTriggerReminder(&trig, &tim, dse, &err)) {
if ( (r=TriggerReminder(p, &trig, &tim, dse)) ) {
FreeTrig(&trig);
return r;
}
} else {
/* Parse the rest of the line to catch any potential
expression-pasting errors */
while (ParseChar(p, &r, 0)) {
if (r != 0) {
break;
}
}
}
FreeTrig(&trig);
return OK;
return r;
}
/***************************************************************/
@@ -220,6 +235,7 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
trig->skip = NO_SKIP;
trig->once = NO_ONCE;
trig->addomit = 0;
trig->noqueue = 0;
trig->typ = NO_TYPE;
trig->scanfrom = NO_DATE;
trig->from = NO_DATE;
@@ -234,14 +250,18 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
DBufInit(&(trig->tags));
trig->passthru[0] = 0;
tim->ttime = NO_TIME;
tim->delta = NO_DELTA;
tim->delta = DefaultTDelta;
tim->rep = NO_REP;
tim->duration = NO_TIME;
trig->need_wkday = 0;
trig->adj_for_last = 0;
if (save_in_globals) {
LastTriggerTime = NO_TIME;
}
while(1) {
int parsing = 1;
while(parsing) {
/* Read space-delimited string */
r = ParseToken(s, &buf);
if (r) return r;
@@ -249,12 +269,31 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
/* Figure out what we've got */
FindToken(DBufValue(&buf), &tok);
switch(tok.type) {
case T_In:
/* Completely ignored */
DBufFree(&buf);
break;
case T_Ordinal:
DBufFree(&buf);
if (trig->d != NO_DAY) return E_DAY_TWICE;
if (tok.val < 0) {
if (trig->back != NO_BACK) return E_BACK_TWICE;
trig->back = -7;
trig->d = 1;
trig->adj_for_last = 1;
} else {
trig->d = 1 + 7 * tok.val;
}
trig->need_wkday = 1;
break;
case T_Date:
DBufFree(&buf);
if (trig->d != NO_DAY) return E_DAY_TWICE;
if (trig->m != NO_MON) return E_MON_TWICE;
if (trig->y != NO_YR) return E_YR_TWICE;
FromJulian(tok.val, &y, &m, &d);
FromDSE(tok.val, &y, &m, &d);
trig->y = y;
trig->m = m;
trig->d = d;
@@ -265,7 +304,7 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
if (trig->d != NO_DAY) return E_DAY_TWICE;
if (trig->m != NO_MON) return E_MON_TWICE;
if (trig->y != NO_YR) return E_YR_TWICE;
FromJulian(tok.val / MINUTES_PER_DAY, &y, &m, &d);
FromDSE(tok.val / MINUTES_PER_DAY, &y, &m, &d);
trig->y = y;
trig->m = m;
trig->d = d;
@@ -322,7 +361,6 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
DBufFree(&buf);
trig->typ = tok.val;
if (s->isnested) return E_CANT_NEST_RTYPE;
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
if (trig->typ == PASSTHRU_TYPE) {
r = ParseToken(s, &buf);
if (r) return r;
@@ -332,19 +370,20 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
}
StrnCpy(trig->passthru, DBufValue(&buf), PASSTHRU_LEN);
}
return OK;
parsing = 0;
break;
case T_Through:
DBufFree(&buf);
if (trig->rep != NO_REP) return E_REP_TWICE;
trig->rep = 1;
r = ParseUntil(s, trig);
r = ParseUntil(s, trig, tok.type);
if (r) return r;
break;
case T_Until:
DBufFree(&buf);
r=ParseUntil(s, trig);
r=ParseUntil(s, trig, tok.type);
if (r) return r;
break;
@@ -378,6 +417,15 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
trig->back = tok.val;
break;
case T_BackAdj:
DBufFree(&buf);
if (trig->back != NO_BACK) return E_BACK_TWICE;
if (trig->d != NO_DAY) return E_DAY_TWICE;
trig->back = tok.val;
trig->d = 1;
trig->adj_for_last = 1;
break;
case T_Once:
DBufFree(&buf);
if (trig->once != NO_ONCE) return E_ONCE_TWICE;
@@ -389,10 +437,15 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
trig->addomit = 1;
break;
case T_NoQueue:
DBufFree(&buf);
trig->noqueue = 1;
break;
case T_Omit:
DBufFree(&buf);
if (trig->omitfunc[0]) {
Eprint("Warning: OMIT is ignored if you use OMITFUNC");
Wprint("Warning: OMIT is ignored if you use OMITFUNC");
}
r = ParseLocalOmit(s, trig);
@@ -401,12 +454,12 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
case T_Empty:
DBufFree(&buf);
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
return OK;
parsing = 0;
break;
case T_OmitFunc:
if (trig->localomit) {
Eprint("Warning: OMIT is ignored if you use OMITFUNC");
Wprint("Warning: OMIT is ignored if you use OMITFUNC");
}
r=ParseToken(s, &buf);
if (r) return r;
@@ -428,7 +481,12 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
case T_Tag:
r = ParseToken(s, &buf);
if (r) return r;
if (strchr(DBufValue(&buf), ',')) {
DBufFree(&buf);
return E_PARSE_ERR;
}
AppendTag(&(trig->tags), DBufValue(&buf));
DBufFree(&buf);
break;
case T_Duration:
@@ -474,10 +532,58 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
DBufFree(&buf);
trig->typ = MSG_TYPE;
if (s->isnested) return E_CANT_NEST_RTYPE;
if (trig->scanfrom == NO_DATE) trig->scanfrom = JulianToday;
return OK;
parsing = 0;
break;
}
}
if (trig->need_wkday && trig->wd == NO_WD) {
Eprint("Weekday name(s) required");
return E_PARSE_ERR;
}
/* Adjust month and possibly year */
if (trig->adj_for_last) {
if (trig->m != NO_MON) {
trig->m++;
if (trig->m >= 12) {
trig->m = 0;
if (trig->y != NO_YR) {
trig->y++;
}
}
}
trig->adj_for_last = 0;
}
/* Check for some warning conditions */
if (!s->nonconst_expr) {
if (trig->y != NO_YR && trig->m != NO_MON && trig->d != NO_DAY && trig->until != NO_UNTIL) {
if (DSE(trig->y, trig->m, trig->d) > trig->until) {
Wprint("Warning: UNTIL/THROUGH date earlier than start date");
}
}
if (trig->from != NO_DATE) {
if (trig->until != NO_UNTIL && trig->until < trig->from) {
Wprint("Warning: UNTIL/THROUGH date earlier than FROM date");
}
} else if (trig->scanfrom != NO_DATE) {
if (trig->until != NO_UNTIL && trig->until < trig->scanfrom) {
Wprint("Warning: UNTIL/THROUGH date earlier than SCANFROM date");
}
}
}
if (trig->y != NO_YR && trig->m != NO_MON && trig->d != NO_DAY && trig->until != NO_UNTIL && trig->rep == NO_REP) {
Wprint("Warning: Useless use of UNTIL with fully-specified date and no *rep");
}
/* Set scanfrom to default if not set explicitly */
if (trig->scanfrom == NO_DATE) {
trig->scanfrom = DSEToday;
}
return OK;
}
/***************************************************************/
@@ -489,7 +595,7 @@ static int ParseTimeTrig(ParsePtr s, TimeTrig *tim, int save_in_globals)
{
Token tok;
int r;
int seen_delta = 0;
DynamicBuffer buf;
DBufInit(&buf);
@@ -506,8 +612,9 @@ static int ParseTimeTrig(ParsePtr s, TimeTrig *tim, int save_in_globals)
case T_Delta:
DBufFree(&buf);
if (tim->delta != NO_DELTA) return E_DELTA_TWICE;
tim->delta = (tok.val > 0) ? tok.val : -tok.val;
if (seen_delta) return E_DELTA_TWICE;
seen_delta = 1;
tim->delta = (tok.val >= 0) ? tok.val : -tok.val;
break;
case T_Rep:
@@ -567,12 +674,18 @@ static int ParseLocalOmit(ParsePtr s, Trigger *t)
/* ParseUntil - parse the UNTIL portion of a reminder */
/* */
/***************************************************************/
static int ParseUntil(ParsePtr s, Trigger *t)
static int ParseUntil(ParsePtr s, Trigger *t, int type)
{
int y = NO_YR,
m = NO_MON,
d = NO_DAY;
char const *which;
if (type == T_Until) {
which = "UNTIL";
} else {
which = "THROUGH";
}
Token tok;
int r;
DynamicBuffer buf;
@@ -588,7 +701,7 @@ static int ParseUntil(ParsePtr s, Trigger *t)
case T_Year:
DBufFree(&buf);
if (y != NO_YR) {
Eprint("UNTIL: %s", ErrMsg[E_YR_TWICE]);
Eprint("%s: %s", which, ErrMsg[E_YR_TWICE]);
return E_YR_TWICE;
}
y = tok.val;
@@ -597,7 +710,7 @@ static int ParseUntil(ParsePtr s, Trigger *t)
case T_Month:
DBufFree(&buf);
if (m != NO_MON) {
Eprint("UNTIL: %s", ErrMsg[E_MON_TWICE]);
Eprint("%s: %s", which, ErrMsg[E_MON_TWICE]);
return E_MON_TWICE;
}
m = tok.val;
@@ -606,7 +719,7 @@ static int ParseUntil(ParsePtr s, Trigger *t)
case T_Day:
DBufFree(&buf);
if (d != NO_DAY) {
Eprint("UNTIL: %s", ErrMsg[E_DAY_TWICE]);
Eprint("%s: %s", which, ErrMsg[E_DAY_TWICE]);
return E_DAY_TWICE;
}
d = tok.val;
@@ -615,23 +728,23 @@ static int ParseUntil(ParsePtr s, Trigger *t)
case T_Date:
DBufFree(&buf);
if (y != NO_YR) {
Eprint("UNTIL: %s", ErrMsg[E_YR_TWICE]);
Eprint("%s: %s", which, ErrMsg[E_YR_TWICE]);
return E_YR_TWICE;
}
if (m != NO_MON) {
Eprint("UNTIL: %s", ErrMsg[E_MON_TWICE]);
Eprint("%s: %s", which, ErrMsg[E_MON_TWICE]);
return E_MON_TWICE;
}
if (d != NO_DAY) {
Eprint("UNTIL: %s", ErrMsg[E_DAY_TWICE]);
Eprint("%s: %s", which, ErrMsg[E_DAY_TWICE]);
return E_DAY_TWICE;
}
FromJulian(tok.val, &y, &m, &d);
FromDSE(tok.val, &y, &m, &d);
break;
default:
if (y == NO_YR || m == NO_MON || d == NO_DAY) {
Eprint("UNTIL: %s", ErrMsg[E_INCOMPLETE]);
Eprint("%s: %s", which, ErrMsg[E_INCOMPLETE]);
DBufFree(&buf);
return E_INCOMPLETE;
}
@@ -639,7 +752,7 @@ static int ParseUntil(ParsePtr s, Trigger *t)
DBufFree(&buf);
return E_BAD_DATE;
}
t->until = Julian(y, m, d);
t->until = DSE(y, m, d);
PushToken(DBufValue(&buf), s);
DBufFree(&buf);
return OK;
@@ -718,7 +831,7 @@ static int ParseScanFrom(ParsePtr s, Trigger *t, int type)
Eprint("%s: %s", word, ErrMsg[E_DAY_TWICE]);
return E_DAY_TWICE;
}
FromJulian(tok.val, &y, &m, &d);
FromDSE(tok.val, &y, &m, &d);
break;
case T_Back:
@@ -742,7 +855,7 @@ static int ParseScanFrom(ParsePtr s, Trigger *t, int type)
if (tok.val < 0) {
tok.val = -tok.val;
}
FromJulian(JulianToday - tok.val, &y, &m, &d);
FromDSE(DSEToday - tok.val, &y, &m, &d);
break;
default:
@@ -755,11 +868,11 @@ static int ParseScanFrom(ParsePtr s, Trigger *t, int type)
DBufFree(&buf);
return E_BAD_DATE;
}
t->scanfrom = Julian(y, m, d);
t->scanfrom = DSE(y, m, d);
if (type == FROM_TYPE) {
t->from = t->scanfrom;
if (t->scanfrom < JulianToday) {
t->scanfrom = JulianToday;
if (t->scanfrom < DSEToday) {
t->scanfrom = DSEToday;
}
} else {
t->from = NO_DATE;
@@ -771,6 +884,8 @@ static int ParseScanFrom(ParsePtr s, Trigger *t, int type)
}
}
}
/***************************************************************/
/* */
/* TriggerReminder */
@@ -778,7 +893,7 @@ static int ParseScanFrom(ParsePtr s, Trigger *t, int type)
/* Trigger the reminder if it's a RUN or MSG type. */
/* */
/***************************************************************/
int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int dse)
{
int r, y, m, d;
char PrioExpr[VAR_NAME_LEN+25];
@@ -832,25 +947,26 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
}
/* If it's a MSG-type reminder, and no -k option was used, issue the banner. */
if ((t->typ == MSG_TYPE || t->typ == MSF_TYPE)
&& !NumTriggered && !NextMode && !MsgCommand) {
&& !DidMsgReminder && !NextMode && !MsgCommand) {
DidMsgReminder = 1;
if (!DoSubstFromString(DBufValue(&Banner), &buf,
JulianToday, NO_TIME) &&
DSEToday, NO_TIME) &&
DBufLen(&buf)) {
printf("%s\n", DBufValue(&buf));
}
printf("%s\n", DBufValue(&buf));
}
DBufFree(&buf);
}
/* If it's NextMode, process as a ADVANCE_MODE-type entry, and issue
simple-calendar format. */
if (NextMode) {
if ( (r=DoSubst(p, &buf, t, tim, jul, ADVANCE_MODE)) ) return r;
if ( (r=DoSubst(p, &buf, t, tim, dse, ADVANCE_MODE)) ) return r;
if (!DBufLen(&buf)) {
DBufFree(&buf);
DBufFree(&pre_buf);
return OK;
}
FromJulian(jul, &y, &m, &d);
FromDSE(dse, &y, &m, &d);
sprintf(tmpBuf, "%04d/%02d/%02d ", y, m+1, d);
if (DBufPuts(&calRow, tmpBuf) != OK) {
DBufFree(&calRow);
@@ -933,7 +1049,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
if (!r) {
if (!DoCoerce(STR_TYPE, &v)) {
if (is_color) {
DBufPuts(&buf, Colorize(red, green, blue));
DBufPuts(&buf, Colorize(red, green, blue, 0, 1));
}
if (DBufPuts(&buf, v.v.str) != OK) {
DBufFree(&buf);
@@ -947,9 +1063,9 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
}
if (is_color) {
DBufPuts(&buf, Colorize(red, green, blue));
DBufPuts(&buf, Colorize(red, green, blue, 0, 1));
}
if ( (r=DoSubst(p, &buf, t, tim, jul, NORMAL_MODE)) ) return r;
if ( (r=DoSubst(p, &buf, t, tim, dse, NORMAL_MODE)) ) return r;
if (t->typ != RUN_TYPE) {
if (UserFuncExists("msgsuffix") == 1) {
sprintf(PrioExpr, "msgsuffix(%d)", t->priority);
@@ -958,7 +1074,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
if (!r) {
if (!DoCoerce(STR_TYPE, &v)) {
if (is_color) {
DBufPuts(&buf, Colorize(red, green, blue));
DBufPuts(&buf, Colorize(red, green, blue, 0, 1));
}
if (DBufPuts(&buf, v.v.str) != OK) {
DBufFree(&buf);
@@ -972,7 +1088,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
}
if (is_color) {
DBufPuts(&buf, Decolorize(red, green, blue));
DBufPuts(&buf, Decolorize());
}
if ((!MsgCommand && t->typ == MSG_TYPE) || t->typ == MSF_TYPE) {
@@ -984,7 +1100,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
/* If we are sorting, just queue it up in the sort buffer */
if (SortByDate) {
if (InsertIntoSortBuffer(jul, tim->ttime, DBufValue(&buf),
if (InsertIntoSortBuffer(dse, tim->ttime, DBufValue(&buf),
t->typ, t->priority) == OK) {
DBufFree(&buf);
NumTriggered++;
@@ -1031,20 +1147,20 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
/* triggered. Sets *err non-zero in event of an error. */
/* */
/***************************************************************/
int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int jul, int *err)
int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int dse, int *err)
{
int r, omit;
*err = 0;
/* Handle the ONCE modifier in the reminder. */
if (!IgnoreOnce && t->once !=NO_ONCE && FileAccessDate == JulianToday)
if (!IgnoreOnce && t->once !=NO_ONCE && FileAccessDate == DSEToday)
return 0;
if (jul < JulianToday) return 0;
if (dse < DSEToday) return 0;
/* Don't trigger timed reminders if DontIssueAts is true, and if the
reminder is for today */
if (jul == JulianToday && DontIssueAts && tim->ttime != NO_TIME) {
if (dse == DSEToday && DontIssueAts && tim->ttime != NO_TIME) {
if (DontIssueAts > 1) {
/* If two or more -a options, then *DO* issue ats that are in the
future */
@@ -1058,7 +1174,7 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int jul, int *err)
/* Don't trigger "old" timed reminders */
/*** REMOVED...
if (jul == JulianToday &&
if (dse == DSEToday &&
tim->ttime != NO_TIME &&
tim->ttime < SystemTime(0) / 60) return 0;
*** ...UNTIL HERE */
@@ -1069,28 +1185,28 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int jul, int *err)
/* If there's a "warn" function, it overrides any deltas */
if (t->warn[0] != 0) {
if (DeltaOffset) {
if (jul <= JulianToday + DeltaOffset) {
if (dse <= DSEToday + DeltaOffset) {
return 1;
}
}
return ShouldTriggerBasedOnWarn(t, jul, err);
return ShouldTriggerBasedOnWarn(t, dse, err);
}
/* Move back by delta days, if any */
if (t->delta != NO_DELTA) {
if (t->delta < 0)
jul = jul + t->delta;
dse = dse + t->delta;
else {
int iter = 0;
int max = MaxSatIter;
r = t->delta;
if (max < r*2) max = r*2;
while(iter++ < max) {
if (!r || (jul <= JulianToday)) {
if (!r || (dse <= DSEToday)) {
break;
}
jul--;
*err = IsOmitted(jul, t->localomit, t->omitfunc, &omit);
dse--;
*err = IsOmitted(dse, t->localomit, t->omitfunc, &omit);
if (*err) return 0;
if (!omit) r--;
}
@@ -1103,7 +1219,7 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int jul, int *err)
}
/* Should we trigger the reminder? */
return (jul <= JulianToday + DeltaOffset);
return (dse <= DSEToday + DeltaOffset);
}
/***************************************************************/
@@ -1115,7 +1231,7 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int jul, int *err)
/***************************************************************/
int DoSatRemind(Trigger *trig, TimeTrig *tt, ParsePtr p)
{
int iter, jul, r, start;
int iter, dse, r, start;
Value v;
char const *s;
char const *t;
@@ -1124,25 +1240,25 @@ int DoSatRemind(Trigger *trig, TimeTrig *tt, ParsePtr p)
iter = 0;
start = trig->scanfrom;
while (iter++ < MaxSatIter) {
jul = ComputeTriggerNoAdjustDuration(start, trig, tt, &r, 1, 0);
dse = ComputeTriggerNoAdjustDuration(start, trig, tt, &r, 1, 0);
if (r) {
if (r == E_CANT_TRIG) return OK; else return r;
}
if (jul != start && trig->duration_days) {
jul = ComputeTriggerNoAdjustDuration(start, trig, tt, &r, 1, trig->duration_days);
if (dse != start && trig->duration_days) {
dse = ComputeTriggerNoAdjustDuration(start, trig, tt, &r, 1, trig->duration_days);
if (r) {
if (r == E_CANT_TRIG) return OK; else return r;
}
} else if (jul == start) {
} else if (dse == start) {
if (tt->ttime != NO_TIME) {
trig->eventstart = MINUTES_PER_DAY * r + tt->ttime;
if (tt->duration != NO_TIME) {
trig->eventduration = tt->duration;
}
}
SaveAllTriggerInfo(trig, tt, jul, tt->ttime, 1);
SaveAllTriggerInfo(trig, tt, dse, tt->ttime, 1);
}
if (jul == -1) {
if (dse == -1) {
return E_EXPIRED;
}
s = p->pos;
@@ -1152,15 +1268,15 @@ int DoSatRemind(Trigger *trig, TimeTrig *tt, ParsePtr p)
if (v.type != INT_TYPE && v.type != STR_TYPE) return E_BAD_TYPE;
if ((v.type == INT_TYPE && v.v.val) ||
(v.type == STR_TYPE && *v.v.str)) {
AdjustTriggerForDuration(trig->scanfrom, jul, trig, tt, 1);
AdjustTriggerForDuration(trig->scanfrom, dse, trig, tt, 1);
if (DebugFlag & DB_PRTTRIG) {
int y, m, d;
FromJulian(LastTriggerDate, &y, &m, &d);
FromDSE(LastTriggerDate, &y, &m, &d);
fprintf(ErrFp, "%s(%d): Trig(satisfied) = %s, %d %s, %d",
FileName, LineNo,
DayName[LastTriggerDate % 7],
get_day_name(LastTriggerDate % 7),
d,
MonthName[m],
get_month_name(m),
y);
if (tt->ttime != NO_TIME) {
fprintf(ErrFp, " AT %02d:%02d",
@@ -1177,10 +1293,10 @@ int DoSatRemind(Trigger *trig, TimeTrig *tt, ParsePtr p)
return OK;
}
p->pos = s;
if (jul+trig->duration_days < start) {
if (dse+trig->duration_days < start) {
start++;
} else {
start = jul+trig->duration_days+1;
start = dse+trig->duration_days+1;
}
}
p->pos = t;
@@ -1287,7 +1403,7 @@ finished:
/* function. */
/* */
/***************************************************************/
static int ShouldTriggerBasedOnWarn(Trigger *t, int jul, int *err)
static int ShouldTriggerBasedOnWarn(Trigger *t, int dse, int *err)
{
char buffer[VAR_NAME_LEN+32];
int i;
@@ -1299,7 +1415,7 @@ static int ShouldTriggerBasedOnWarn(Trigger *t, int jul, int *err)
/* If no proper function exists, barf... */
if (UserFuncExists(t->warn) != 1) {
Eprint("%s: `%s'", ErrMsg[M_BAD_WARN_FUNC], t->warn);
return (jul == JulianToday);
return (dse == DSEToday);
}
for (i=1; ; i++) {
sprintf(buffer, "%s(%d)", t->warn, i);
@@ -1308,28 +1424,28 @@ static int ShouldTriggerBasedOnWarn(Trigger *t, int jul, int *err)
if (r) {
Eprint("%s: `%s': %s", ErrMsg[M_BAD_WARN_FUNC],
t->warn, ErrMsg[r]);
return (jul == JulianToday);
return (dse == DSEToday);
}
if (v.type != INT_TYPE) {
DestroyValue(v);
Eprint("%s: `%s': %s", ErrMsg[M_BAD_WARN_FUNC],
t->warn, ErrMsg[E_BAD_TYPE]);
return (jul == JulianToday);
return (dse == DSEToday);
}
/* If absolute value of return is not monotonically
decreasing, exit */
if (i > 1 && abs(v.v.val) >= lastReturnVal) {
return (jul == JulianToday);
return (dse == DSEToday);
}
lastReturnVal = abs(v.v.val);
/* Positive values: Just subtract. Negative values:
skip omitted days. */
if (v.v.val >= 0) {
if (JulianToday + v.v.val == jul) return 1;
if (DSEToday + v.v.val == dse) return 1;
} else {
int j = jul;
int j = dse;
int iter = 0;
int max = MaxSatIter;
if (max < v.v.val * 2) max = v.v.val*2;
@@ -1346,7 +1462,7 @@ static int ShouldTriggerBasedOnWarn(Trigger *t, int jul, int *err)
Eprint("Delta: Bad OMITFUNC? %s", ErrMsg[E_CANT_TRIG]);
return 0;
}
if (j == JulianToday) return 1;
if (j == DSEToday) return 1;
}
}
}

View File

@@ -6,11 +6,13 @@
/* reminders are triggered. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
#include "config.h"
#include "expr.h"
#define L_IN_DOSUBST
#include <stdio.h>
#include <string.h>
@@ -29,9 +31,6 @@
#define NL "\n"
#endif
static char TODAY[] = L_TODAY;
static char TOMORROW[] = L_TOMORROW;
#define SHIP_OUT(s) if(DBufPuts(dbuf, s) != OK) return E_NO_MEM
/***************************************************************/
@@ -44,26 +43,34 @@ static char TOMORROW[] = L_TOMORROW;
/* If mode==ADVANCE_MODE, ignore %" but don't add newline */
/* */
/***************************************************************/
int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode)
int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse, int mode)
{
int diff = jul - JulianToday;
int diff = dse - DSEToday;
int curtime = SystemTime(0) / 60;
int err, done;
int c;
int d, m, y;
int tim = tt->ttime;
int h, min, hh, ch, cmin, chh;
int i;
char const *pm, *cpm;
int tdiff, adiff, mdiff, hdiff;
char const *mplu, *hplu, *when, *plu;
int has_quote = 0;
char *ss;
char const *expr;
char *os;
char s[256];
char uf[32];
char mypm[64];
char mycpm[64];
char myplu[64];
int origLen = DBufLen(dbuf);
int altmode;
int r;
Value v;
FromJulian(jul, &y, &m, &d);
FromDSE(dse, &y, &m, &d);
if (tim == NO_TIME) tim = curtime;
tdiff = tim - curtime;
@@ -74,16 +81,16 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_MPLU_OVER
L_MPLU_OVER
#else /* L_MPLU_OVER */
mplu = (mdiff == 1 ? "" : L_MPLU);
mplu = (mdiff == 1 ? "" : DynamicMplu);
#endif /* L_MPLU_OVER */
#ifdef L_HPLU_OVER
L_HPLU_OVER
#else /* L_HPLU_OVER */
hplu = (hdiff == 1 ? "" : L_HPLU);
hplu = (hdiff == 1 ? "" : DynamicHplu);
#endif /* L_HPLU_OVER */
when = (tdiff < 0 ? L_AGO : L_FROMNOW);
when = (tdiff < 0) ? DynamicAgo : DynamicFromnow;
h = tim / 60;
min = tim % 60;
@@ -91,7 +98,26 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_AMPM_OVERRIDE
L_AMPM_OVERRIDE (pm, h)
#else
pm = (h < 12) ? L_AM : L_PM;
r = -1;
if (UserFuncExists("subst_ampm") == 1) {
snprintf(s, sizeof(s), "subst_ampm(%d)", h);
expr = (char const *) s;
r = EvalExpr(&expr, &v, NULL);
if (r == OK) {
if (!DoCoerce(STR_TYPE, &v)) {
snprintf(mypm, sizeof(mypm), "%s", v.v.str);
pm = mypm;
} else {
r = -1;
}
DestroyValue(v);
} else {
Eprint("%s", ErrMsg[r]);
}
}
if (r != OK) {
pm = (h < 12) ? DynamicAm : DynamicPm;
}
#endif
hh = (h == 12) ? 12 : h % 12;
@@ -101,25 +127,60 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_AMPM_OVERRIDE
L_AMPM_OVERRIDE (cpm, ch)
#else
cpm = (ch < 12) ? L_AM : L_PM;
r = -1;
if (UserFuncExists("subst_ampm") == 1) {
snprintf(s, sizeof(s), "subst_ampm(%d)", ch);
expr = (char const *) s;
r = EvalExpr(&expr, &v, NULL);
if (r == OK) {
if (!DoCoerce(STR_TYPE, &v)) {
snprintf(mycpm, sizeof(mycpm), "%s", v.v.str);
cpm = mycpm;
} else {
r = -1;
}
} else {
Eprint("%s", ErrMsg[r]);
}
}
if (r != OK) {
cpm = (h < 12) ? DynamicAm : DynamicPm;
}
#endif
chh = (ch == 12) ? 12 : ch % 12;
#ifdef L_ORDINAL_OVERRIDE
L_ORDINAL_OVERRIDE
L_ORDINAL_OVERRIDE;
#else
switch(d) {
case 1:
case 21:
case 31: plu = "st"; break;
if (UserFuncExists("subst_ordinal") == 1) {
snprintf(s, sizeof(s), "subst_ordinal(%d)", d);
expr = (char const *) s;
r = EvalExpr(&expr, &v, NULL);
if (r == OK) {
if (!DoCoerce(STR_TYPE, &v)) {
snprintf(myplu, sizeof(myplu), "%s", v.v.str);
plu = myplu;
} else {
r = -1;
}
} else {
Eprint("%s", ErrMsg[r]);
}
}
if (r != OK) {
switch(d) {
case 1:
case 21:
case 31: plu = "st"; break;
case 2:
case 22: plu = "nd"; break;
case 2:
case 22: plu = "nd"; break;
case 3:
case 23: plu = "rd"; break;
case 3:
case 23: plu = "rd"; break;
default: plu = "th"; break;
default: plu = "th"; break;
}
}
#endif
@@ -131,8 +192,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
}
if (c == '\n') continue;
if (!c) {
if (mode != CAL_MODE && mode != ADVANCE_MODE &&
t->typ != RUN_TYPE && !MsgCommand) {
if (AddBlankLines &&
mode != CAL_MODE &&
mode != ADVANCE_MODE &&
t->typ != RUN_TYPE &&
!MsgCommand) {
if (DBufPutc(dbuf, '\n') != OK) return E_NO_MEM;
}
break;
@@ -162,7 +226,69 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
break;
}
}
if (c == '{') {
i = 0;
ss = s + snprintf(s, sizeof(s), "subst_");
while (1) {
c = ParseChar(p, &err, 0);
if (err) {
DBufFree(dbuf);
return err;
}
if (c == '}' || !c) {
break;
}
if (i < 64) {
*ss++ = c;
*ss = 0;
i++;
}
}
if (!c) {
Wprint("Warning: Unterminated %%{...} substitution sequence");
}
if (UserFuncExists(s) != 3) {
continue;
}
snprintf(ss, sizeof(s) - (ss-s), "(%d,'%04d-%02d-%02d',%02d:%02d)",
altmode ? 1 : 0, y, m+1, d, h, min);
expr = (char const *) s;
r = EvalExpr(&expr, &v, NULL);
if (r == OK) {
if (!DoCoerce(STR_TYPE, &v)) {
if (DBufPuts(dbuf, v.v.str) != OK) {
DestroyValue(v);
return E_NO_MEM;
}
}
DestroyValue(v);
}
continue;
}
done = 0;
snprintf(uf, sizeof(uf), "subst_%c", c);
if (UserFuncExists(uf) == 3) {
snprintf(s, sizeof(s), "subst_%c(%d,'%04d-%02d-%02d',%02d:%02d)",
c, altmode ? 1 : 0, y, m+1, d, h, min);
expr = (char const *) s;
r = EvalExpr(&expr, &v, NULL);
if (r == OK) {
if (v.type != INT_TYPE || v.v.val != 0) {
if (!DoCoerce(STR_TYPE, &v)) {
if (DBufPuts(dbuf, v.v.str) != OK) {
DestroyValue(v);
return E_NO_MEM;
}
}
DestroyValue(v);
continue;
}
DestroyValue(v);
} else {
Eprint("%s", ErrMsg[r]);
}
}
if (diff <= 1) {
switch(UPPER(c)) {
#ifndef L_NOTOMORROW_A
@@ -204,7 +330,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifndef L_NOTOMORROW_V
case 'V':
#endif
sprintf(s, "%s", (diff ? TOMORROW : TODAY));
snprintf(s, sizeof(s), "%s", (diff ? DynamicTomorrow: DynamicToday));
SHIP_OUT(s);
done = 1;
break;
@@ -213,17 +339,43 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
}
}
if (!done) {
snprintf(uf, sizeof(uf), "subst_%cx", c);
if (UserFuncExists(uf) == 3) {
snprintf(s, sizeof(s), "subst_%cx(%d,'%04d-%02d-%02d',%02d:%02d)",
c, altmode ? 1 : 0, y, m+1, d, h, min);
expr = (char const *) s;
r = EvalExpr(&expr, &v, NULL);
if (r == OK) {
if (v.type != INT_TYPE || v.v.val != 0) {
if (!DoCoerce(STR_TYPE, &v)) {
if (DBufPuts(dbuf, v.v.str) != OK) {
DestroyValue(v);
return E_NO_MEM;
}
}
DestroyValue(v);
continue;
}
DestroyValue(v);
} else {
Eprint("%s", ErrMsg[r]);
}
}
}
if (!done) switch(UPPER(c)) {
case 'A':
#ifdef L_A_OVER
L_A_OVER
#else
if (altmode == '*') {
sprintf(s, "%s, %d %s, %d", DayName[jul%7], d,
MonthName[m], y);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%s, %d %s, %d", get_day_name(dse%7), d,
get_month_name(m), y);
} else {
sprintf(s, "%s %s, %d %s, %d", L_ON, DayName[jul%7], d,
MonthName[m], y);
snprintf(s, sizeof(s), "%s %s, %d %s, %d", DynamicOn, get_day_name(dse%7), d,
get_month_name(m), y);
}
#endif
SHIP_OUT(s);
@@ -233,7 +385,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_B_OVER
L_B_OVER
#else
sprintf(s, L_INXDAYS, diff);
snprintf(s, sizeof(s), L_INXDAYS, diff);
#endif
SHIP_OUT(s);
break;
@@ -242,10 +394,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_C_OVER
L_C_OVER
#else
if (altmode == '*') {
sprintf(s, "%s", DayName[jul%7]);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%s", get_day_name(dse%7));
} else {
sprintf(s, "%s %s", L_ON, DayName[jul%7]);
snprintf(s, sizeof(s), "%s %s", DynamicOn, get_day_name(dse%7));
}
#endif
SHIP_OUT(s);
@@ -255,7 +407,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_D_OVER
L_D_OVER
#else
sprintf(s, "%d", d);
snprintf(s, sizeof(s), "%d", d);
#endif
SHIP_OUT(s);
break;
@@ -264,11 +416,11 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_E_OVER
L_E_OVER
#else
if (altmode == '*') {
sprintf(s, "%02d%c%02d%c%04d", d, DateSep,
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%02d%c%02d%c%04d", d, DateSep,
m+1, DateSep, y);
} else {
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, d, DateSep,
snprintf(s, sizeof(s), "%s %02d%c%02d%c%04d", DynamicOn, d, DateSep,
m+1, DateSep, y);
}
#endif
@@ -279,10 +431,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_F_OVER
L_F_OVER
#else
if (altmode == '*') {
sprintf(s, "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
} else {
sprintf(s, "%s %02d%c%02d%c%04d", L_ON, m+1, DateSep, d, DateSep, y);
snprintf(s, sizeof(s), "%s %02d%c%02d%c%04d", DynamicOn, m+1, DateSep, d, DateSep, y);
}
#endif
SHIP_OUT(s);
@@ -292,10 +444,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_G_OVER
L_G_OVER
#else
if (altmode == '*') {
sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%s, %d %s", get_day_name(dse%7), d, get_month_name(m));
} else {
sprintf(s, "%s %s, %d %s", L_ON, DayName[jul%7], d, MonthName[m]);
snprintf(s, sizeof(s), "%s %s, %d %s", DynamicOn, get_day_name(dse%7), d, get_month_name(m));
}
#endif
SHIP_OUT(s);
@@ -305,10 +457,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_H_OVER
L_H_OVER
#else
if (altmode == '*') {
sprintf(s, "%02d%c%02d", d, DateSep, m+1);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%02d%c%02d", d, DateSep, m+1);
} else {
sprintf(s, "%s %02d%c%02d", L_ON, d, DateSep, m+1);
snprintf(s, sizeof(s), "%s %02d%c%02d", DynamicOn, d, DateSep, m+1);
}
#endif
SHIP_OUT(s);
@@ -318,10 +470,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_I_OVER
L_I_OVER
#else
if (altmode == '*') {
sprintf(s, "%02d%c%02d", m+1, DateSep, d);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%02d%c%02d", m+1, DateSep, d);
} else {
sprintf(s, "%s %02d%c%02d", L_ON, m+1, DateSep, d);
snprintf(s, sizeof(s), "%s %02d%c%02d", DynamicOn, m+1, DateSep, d);
}
#endif
SHIP_OUT(s);
@@ -331,12 +483,12 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_J_OVER
L_J_OVER
#else
if (altmode == '*') {
sprintf(s, "%s, %s %d%s, %d", DayName[jul%7],
MonthName[m], d, plu, y);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%s, %s %d%s, %d", get_day_name(dse%7),
get_month_name(m), d, plu, y);
} else {
sprintf(s, "%s %s, %s %d%s, %d", L_ON, DayName[jul%7],
MonthName[m], d, plu, y);
snprintf(s, sizeof(s), "%s %s, %s %d%s, %d", DynamicOn, get_day_name(dse%7),
get_month_name(m), d, plu, y);
}
#endif
SHIP_OUT(s);
@@ -346,12 +498,12 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_K_OVER
L_K_OVER
#else
if (altmode == '*') {
sprintf(s, "%s, %s %d%s", DayName[jul%7],
MonthName[m], d, plu);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%s, %s %d%s", get_day_name(dse%7),
get_month_name(m), d, plu);
} else {
sprintf(s, "%s %s, %s %d%s", L_ON, DayName[jul%7],
MonthName[m], d, plu);
snprintf(s, sizeof(s), "%s %s, %s %d%s", DynamicOn, get_day_name(dse%7),
get_month_name(m), d, plu);
}
#endif
SHIP_OUT(s);
@@ -361,10 +513,10 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_L_OVER
L_L_OVER
#else
if (altmode == '*') {
sprintf(s, "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
} else {
sprintf(s, "%s %04d%c%02d%c%02d", L_ON, y, DateSep, m+1, DateSep, d);
snprintf(s, sizeof(s), "%s %04d%c%02d%c%02d", DynamicOn, y, DateSep, m+1, DateSep, d);
}
#endif
SHIP_OUT(s);
@@ -374,7 +526,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_M_OVER
L_M_OVER
#else
sprintf(s, "%s", MonthName[m]);
snprintf(s, sizeof(s), "%s", get_month_name(m));
#endif
SHIP_OUT(s);
break;
@@ -383,7 +535,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_N_OVER
L_N_OVER
#else
sprintf(s, "%d", m+1);
snprintf(s, sizeof(s), "%d", m+1);
#endif
SHIP_OUT(s);
break;
@@ -392,7 +544,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_O_OVER
L_O_OVER
#else
if (RealToday == JulianToday) sprintf(s, " (%s)", L_TODAY);
if (RealToday == DSEToday) snprintf(s, sizeof(s), " (%s)", DynamicToday);
else *s = 0;
#endif
SHIP_OUT(s);
@@ -402,7 +554,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_P_OVER
L_P_OVER
#else
sprintf(s, "%s", (diff == 1 ? "" : L_PLURAL));
snprintf(s, sizeof(s), "%s", (diff == 1 ? "" : L_PLURAL));
#endif
SHIP_OUT(s);
break;
@@ -411,7 +563,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_Q_OVER
L_Q_OVER
#else
sprintf(s, "%s", (diff == 1 ? "'s" : "s'"));
snprintf(s, sizeof(s), "%s", (diff == 1 ? "'s" : "s'"));
#endif
SHIP_OUT(s);
break;
@@ -420,7 +572,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_R_OVER
L_R_OVER
#else
sprintf(s, "%02d", d);
snprintf(s, sizeof(s), "%02d", d);
#endif
SHIP_OUT(s);
break;
@@ -429,7 +581,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_S_OVER
L_S_OVER
#else
sprintf(s, "%s", plu);
snprintf(s, sizeof(s), "%s", plu);
#endif
SHIP_OUT(s);
break;
@@ -438,7 +590,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_T_OVER
L_T_OVER
#else
sprintf(s, "%02d", m+1);
snprintf(s, sizeof(s), "%02d", m+1);
#endif
SHIP_OUT(s);
break;
@@ -447,12 +599,12 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_U_OVER
L_U_OVER
#else
if (altmode == '*') {
sprintf(s, "%s, %d%s %s, %d", DayName[jul%7], d,
plu, MonthName[m], y);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%s, %d%s %s, %d", get_day_name(dse%7), d,
plu, get_month_name(m), y);
} else {
sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[jul%7], d,
plu, MonthName[m], y);
snprintf(s, sizeof(s), "%s %s, %d%s %s, %d", DynamicOn, get_day_name(dse%7), d,
plu, get_month_name(m), y);
}
#endif
SHIP_OUT(s);
@@ -462,12 +614,12 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_V_OVER
L_V_OVER
#else
if (altmode == '*') {
sprintf(s, "%s, %d%s %s", DayName[jul%7], d, plu,
MonthName[m]);
if (altmode == '*' || !strcmp(DynamicOn, "")) {
snprintf(s, sizeof(s), "%s, %d%s %s", get_day_name(dse%7), d, plu,
get_month_name(m));
} else {
sprintf(s, "%s %s, %d%s %s", L_ON, DayName[jul%7], d, plu,
MonthName[m]);
snprintf(s, sizeof(s), "%s %s, %d%s %s", DynamicOn, get_day_name(dse%7), d, plu,
get_month_name(m));
}
#endif
SHIP_OUT(s);
@@ -477,7 +629,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_W_OVER
L_W_OVER
#else
sprintf(s, "%s", DayName[jul%7]);
snprintf(s, sizeof(s), "%s", get_day_name(dse%7));
#endif
SHIP_OUT(s);
break;
@@ -486,7 +638,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_X_OVER
L_X_OVER
#else
sprintf(s, "%d", diff);
snprintf(s, sizeof(s), "%d", diff);
#endif
SHIP_OUT(s);
break;
@@ -495,7 +647,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_Y_OVER
L_Y_OVER
#else
sprintf(s, "%d", y);
snprintf(s, sizeof(s), "%d", y);
#endif
SHIP_OUT(s);
break;
@@ -504,7 +656,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_Z_OVER
L_Z_OVER
#else
sprintf(s, "%d", y % 100);
snprintf(s, sizeof(s), "%d", y % 100);
#endif
SHIP_OUT(s);
break;
@@ -514,14 +666,14 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
L_1_OVER
#else
if (tdiff == 0)
sprintf(s, "%s", L_NOW);
snprintf(s, sizeof(s), "%s", DynamicNow);
else if (hdiff == 0)
sprintf(s, "%d %s%s %s", mdiff, L_MINUTE, mplu, when);
snprintf(s, sizeof(s), "%d %s%s %s", mdiff, DynamicMinute, mplu, when);
else if (mdiff == 0)
sprintf(s, "%d %s%s %s", hdiff, L_HOUR, hplu, when);
snprintf(s, sizeof(s), "%d %s%s %s", hdiff, DynamicHour, hplu, when);
else
sprintf(s, "%d %s%s %s %d %s%s %s", hdiff, L_HOUR, hplu,
L_AND, mdiff, L_MINUTE, mplu, when);
snprintf(s, sizeof(s), "%d %s%s %s %d %s%s %s", hdiff, DynamicHour, hplu,
DynamicAnd, mdiff, DynamicMinute, mplu, when);
#endif
SHIP_OUT(s);
break;
@@ -531,9 +683,9 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
L_2_OVER
#else
if (altmode == '*') {
sprintf(s, "%d%c%02d%s", hh, TimeSep, min, pm);
snprintf(s, sizeof(s), "%d%c%02d%s", hh, TimeSep, min, pm);
} else {
sprintf(s, "%s %d%c%02d%s", L_AT, hh, TimeSep, min, pm);
snprintf(s, sizeof(s), "%s %d%c%02d%s", DynamicAt, hh, TimeSep, min, pm);
}
#endif
SHIP_OUT(s);
@@ -545,9 +697,9 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#else
if (altmode == '*') {
sprintf(s, "%02d%c%02d", h, TimeSep, min);
snprintf(s, sizeof(s), "%02d%c%02d", h, TimeSep, min);
} else {
sprintf(s, "%s %02d%c%02d", L_AT, h, TimeSep, min);
snprintf(s, sizeof(s), "%s %02d%c%02d", DynamicAt, h, TimeSep, min);
}
#endif
SHIP_OUT(s);
@@ -557,7 +709,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_4_OVER
L_4_OVER
#else
sprintf(s, "%d", tdiff);
snprintf(s, sizeof(s), "%d", tdiff);
#endif
SHIP_OUT(s);
break;
@@ -566,7 +718,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_5_OVER
L_5_OVER
#else
sprintf(s, "%d", adiff);
snprintf(s, sizeof(s), "%d", adiff);
#endif
SHIP_OUT(s);
break;
@@ -575,7 +727,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_6_OVER
L_6_OVER
#else
sprintf(s, "%s", when);
snprintf(s, sizeof(s), "%s", when);
#endif
SHIP_OUT(s);
break;
@@ -584,7 +736,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_7_OVER
L_7_OVER
#else
sprintf(s, "%d", hdiff);
snprintf(s, sizeof(s), "%d", hdiff);
#endif
SHIP_OUT(s);
break;
@@ -593,7 +745,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_8_OVER
L_8_OVER
#else
sprintf(s, "%d", mdiff);
snprintf(s, sizeof(s), "%d", mdiff);
#endif
SHIP_OUT(s);
break;
@@ -602,7 +754,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_9_OVER
L_9_OVER
#else
sprintf(s, "%s", mplu);
snprintf(s, sizeof(s), "%s", mplu);
#endif
SHIP_OUT(s);
break;
@@ -611,7 +763,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_0_OVER
L_0_OVER
#else
sprintf(s, "%s", hplu);
snprintf(s, sizeof(s), "%s", hplu);
#endif
SHIP_OUT(s);
break;
@@ -620,7 +772,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_BANG_OVER
L_BANG_OVER
#else
sprintf(s, "%s", (tdiff >= 0 ? L_IS : L_WAS));
snprintf(s, sizeof(s), "%s", (tdiff >= 0 ? DynamicIs : DynamicWas));
#endif
SHIP_OUT(s);
break;
@@ -629,7 +781,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_AT_OVER
L_AT_OVER
#else
sprintf(s, "%d%c%02d%s", chh, TimeSep, cmin, cpm);
snprintf(s, sizeof(s), "%d%c%02d%s", chh, TimeSep, cmin, cpm);
#endif
SHIP_OUT(s);
break;
@@ -638,16 +790,16 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
#ifdef L_HASH_OVER
L_HASH_OVER
#else
sprintf(s, "%02d%c%02d", ch, TimeSep, cmin);
snprintf(s, sizeof(s), "%02d%c%02d", ch, TimeSep, cmin);
#endif
SHIP_OUT(s);
break;
case '_':
if (PsCal == PSCAL_LEVEL2 || PsCal == PSCAL_LEVEL3 || (mode != CAL_MODE && mode != ADVANCE_MODE && !MsgCommand)) {
sprintf(s, "%s", NL);
snprintf(s, sizeof(s), "%s", NL);
} else {
sprintf(s, " ");
snprintf(s, sizeof(s), " ");
}
SHIP_OUT(s);
break;
@@ -657,13 +809,13 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
break;
case '"':
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;
}
if (DontSuppressQuoteMarkers) {
if (DBufPutc(dbuf, '%') != OK) return E_NO_MEM;
if (DBufPutc(dbuf, c) != OK) return E_NO_MEM;
} else {
if (DBufPutc(dbuf, QUOTE_MARKER) != OK) return E_NO_MEM;
has_quote = 1;
}
break;
default:
@@ -734,21 +886,21 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
/* */
/***************************************************************/
int DoSubstFromString(char const *source, DynamicBuffer *dbuf,
int jul, int tim)
int dse, int tim)
{
Trigger tempTrig;
TimeTrig tempTime;
Parser tempP;
int r;
if (jul == NO_DATE) jul=JulianToday;
if (dse == NO_DATE) dse=DSEToday;
if (tim == NO_TIME) tim=SystemTime(0)/60;
CreateParser(source, &tempP);
tempP.allownested = 0;
tempTrig.typ = MSG_TYPE;
tempTime.ttime = tim;
r = DoSubst(&tempP, dbuf, &tempTrig, &tempTime, jul, NORMAL_MODE);
r = DoSubst(&tempP, dbuf, &tempTrig, &tempTime, dse, NORMAL_MODE);
DestroyParser(&tempP);
return r;
}

View File

@@ -6,7 +6,8 @@
/* buffers. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -27,11 +28,11 @@
Doubles the size of dynamic buffer until it has room for at least
'n' characters, not including trailing '\0'
**********************************************************************/
static int DBufMakeRoom(DynamicBuffer *dbuf, int n)
static int DBufMakeRoom(DynamicBuffer *dbuf, size_t n)
{
/* Double size until it's greater than n (strictly > to leave room
for trailing '\0' */
int size = dbuf->allocatedLen;
size_t size = dbuf->allocatedLen;
char *buf;
if (size > n) return OK;

View File

@@ -5,7 +5,8 @@
/* Declaration of functions for manipulating dynamic buffers */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -17,8 +18,8 @@
#define DBUF_STATIC_SIZE 128
typedef struct {
char *buffer;
int len;
int allocatedLen;
size_t len;
size_t allocatedLen;
char staticBuf[DBUF_STATIC_SIZE];
} DynamicBuffer;
@@ -31,6 +32,8 @@ 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)
#define DBufPutc(dbuf, c) ( ( (dbuf)->allocatedLen <= (dbuf)->len+1 ) ? \
DBufPutcFN( (dbuf), c) : \
( (dbuf)->buffer[(dbuf)->len++] = c, (dbuf)->buffer[(dbuf)->len] = 0, OK) )
#endif /* DYNBUF_H */

View File

@@ -5,7 +5,8 @@
/* Error definitions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -70,7 +71,7 @@
#define E_MON_TWICE 51
#define E_DAY_TWICE 52
#define E_UNKNOWN_TOKEN 53
#define E_SPEC_MON_DAY 54
#define E_SPEC_MON 54
#define E_2MANY_PART 55
#define E_2MANY_FULL 56
#define E_PUSH_NOPOP 57
@@ -187,7 +188,7 @@ EXTERN char *ErrMsg[]
"Month specified twice",
"Day specified twice",
"Unknown token",
"Must specify month and day in OMIT command",
"Must specify month in OMIT command",
"Too many partial OMITs",
"Too many full OMITs",
"Warning: PUSH-OMIT-CONTEXT without matching POP-OMIT-CONTEXT",

View File

@@ -5,7 +5,8 @@
/* This file contains routines to parse and evaluate */
/* expressions. */
/* */
/* Copyright 1992-2021 by Dianne Skoll */
/* Copyright 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -44,21 +45,32 @@ static int MakeValue (char const *s, Value *v, Var *locals, ParsePtr p);
/* Binary operators - all left-associative */
/* Operator precedence:
* Highest: Unary - Unary !
* / %
* + -
* < <= > >=
* == !=
* &&
* Lowest: ||
*
*/
/* Make SURE they are sorted lexically... this may die on an EBCDIC
system... */
Operator BinOp[] = {
{ "!=", 15, BIN_OP, NotEqual },
{ "%", 20, BIN_OP, Mod },
{ "%", 20, BIN_OP, Mod },
{ "&&", 14, BIN_OP, LogAND },
{ "*", 20, BIN_OP, Multiply },
{ "+", 18, BIN_OP, Add },
{ "-", 18, BIN_OP, Subtract },
{ "/", 20, BIN_OP, Divide },
{ "<", 16, BIN_OP, LessThan },
{ "*", 20, BIN_OP, Multiply },
{ "+", 18, BIN_OP, Add },
{ "-", 18, BIN_OP, Subtract },
{ "/", 20, BIN_OP, Divide },
{ "<", 16, BIN_OP, LessThan },
{ "<=", 16, BIN_OP, LessOrEqual },
{ "==", 15, BIN_OP, EqualTo },
{ ">", 16, BIN_OP, GreaterThan },
{ ">", 16, BIN_OP, GreaterThan },
{ ">=", 16, BIN_OP, GreaterOrEqual },
{ "||", 12, BIN_OP, LogOR },
};
@@ -66,16 +78,19 @@ Operator BinOp[] = {
/* These ones must be sorted too. */
Operator UnOp[] = {
{ "!", 22, UN_OP, LogNot },
{ "-", 22, UN_OP, UnMinus },
{ "!", 22, UN_OP, LogNot },
{ "-", 22, UN_OP, UnMinus },
};
#define NUM_UN_OPS (sizeof(UnOp) / sizeof(Operator))
extern BuiltinFunc Func[];
Operator OpStack[OP_STACK_SIZE];
Value ValStack[VAL_STACK_SIZE];
int OpStackPtr, ValStackPtr;
static Operator OpStack[OP_STACK_SIZE];
static int OpStackPtr = 0;
/* ValStack can't be static - needed by funcs.c */
Value ValStack[VAL_STACK_SIZE];
int ValStackPtr = 0;
/***************************************************************/
/* */
@@ -101,7 +116,7 @@ static int DebugPerform(Operator *op)
fprintf(ErrFp, " => ");
if (!r) {
PrintValue(&ValStack[ValStackPtr-1], ErrFp);
Putc('\n', ErrFp);
putc('\n', ErrFp);
} else {
fprintf(ErrFp, "%s\n", ErrMsg[r]);
}
@@ -115,12 +130,13 @@ static int DebugPerform(Operator *op)
/* Clean the stack after an error occurs. */
/* */
/***************************************************************/
static void CleanStack(void)
static void CleanStack(int old_op_stack_ptr, int old_val_stack_ptr)
{
int i;
for (i=0; i<ValStackPtr; i++) DestroyValue(ValStack[i]);
ValStackPtr = 0;
for (i=old_val_stack_ptr; i<ValStackPtr; i++) DestroyValue(ValStack[i]);
ValStackPtr = old_val_stack_ptr;
OpStackPtr = old_op_stack_ptr;
}
/***************************************************************/
@@ -238,6 +254,10 @@ static int ParseExprToken(DynamicBuffer *buf, char const **in)
DBufFree(buf);
return E_NO_MEM;
}
if (!**in) {
DBufFree(buf);
return E_MISS_QUOTE;
}
continue;
}
c = *(*in)++;
@@ -306,8 +326,8 @@ int EvalExpr(char const **e, Value *v, ParsePtr p)
{
int r;
OpStackPtr = 0;
ValStackPtr = 0;
int old_op_stack_ptr = OpStackPtr;
int old_val_stack_ptr = ValStackPtr;
r = Evaluate(e, NULL, p);
@@ -316,11 +336,15 @@ int EvalExpr(char const **e, Value *v, ParsePtr p)
DBufFree(&ExprBuf);
if (r) {
CleanStack();
CleanStack(old_op_stack_ptr, old_val_stack_ptr);
/* fprintf(stderr, "O=%d V=%d\n", OpStackPtr, ValStackPtr); */
return r;
}
*v = *ValStack;
ValStack[0].type = ERR_TYPE;
OpStackPtr = old_op_stack_ptr;
ValStackPtr = old_val_stack_ptr;
*v = ValStack[old_val_stack_ptr];
ValStack[old_val_stack_ptr].type = ERR_TYPE;
/* fprintf(stderr, "O=%d V=%d\n", OpStackPtr, ValStackPtr); */
return r;
}
@@ -580,7 +604,7 @@ static int MakeValue(char const *s, Value *v, Var *locals, ParsePtr p)
if (! (DebugFlag & DB_PRTEXPR)) return r;
if (r == OK) {
PrintValue(v, ErrFp);
Putc('\n', ErrFp);
putc('\n', ErrFp);
}
return r;
} else { /* Must be a symbol */
@@ -591,7 +615,7 @@ static int MakeValue(char const *s, Value *v, Var *locals, ParsePtr p)
if (! (DebugFlag & DB_PRTEXPR)) return r;
if (r == OK) {
PrintValue(v, ErrFp);
Putc('\n', ErrFp);
putc('\n', ErrFp);
}
return r;
}
@@ -639,13 +663,13 @@ int DoCoerce(char type, Value *v)
case TIME_TYPE: sprintf(coerce_buf, "%02d%c%02d", v->v.val / 60,
TimeSep, v->v.val % 60);
break;
case DATE_TYPE: FromJulian(v->v.val, &y, &m, &d);
case DATE_TYPE: FromDSE(v->v.val, &y, &m, &d);
sprintf(coerce_buf, "%04d%c%02d%c%02d",
y, DateSep, m+1, DateSep, d);
break;
case DATETIME_TYPE:
i = v->v.val / MINUTES_PER_DAY;
FromJulian(i, &y, &m, &d);
FromDSE(i, &y, &m, &d);
k = v->v.val % MINUTES_PER_DAY;
h = k / 60;
i = k % 60;
@@ -766,12 +790,11 @@ static int Add(void)
/* If both are ints, just add 'em */
if (v2.type == INT_TYPE && v1.type == INT_TYPE) {
int old = v1.v.val;
v1.v.val += v2.v.val;
/* Check for overflow */
if (_private_add_overflow(v1.v.val, v2.v.val, old)) {
if (_private_add_overflow(v1.v.val, v2.v.val)) {
return E_2HIGH;
}
v1.v.val += v2.v.val;
PushValStack(v1);
return OK;
}
@@ -779,9 +802,8 @@ static int Add(void)
/* If it's a date plus an int, add 'em */
if ((v1.type == DATE_TYPE && v2.type == INT_TYPE) ||
(v1.type == INT_TYPE && v2.type == DATE_TYPE)) {
int old = v1.v.val;
if (_private_add_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
v1.v.val += v2.v.val;
if (_private_add_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
if (v1.v.val < 0) return E_DATE_OVER;
v1.type = DATE_TYPE;
PushValStack(v1);
@@ -791,9 +813,8 @@ static int Add(void)
/* If it's a datetime plus an int or a time, add 'em */
if ((v1.type == DATETIME_TYPE && (v2.type == INT_TYPE || v2.type == TIME_TYPE)) ||
((v1.type == INT_TYPE || v1.type == TIME_TYPE) && v2.type == DATETIME_TYPE)) {
int old = v1.v.val;
if (_private_add_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
v1.v.val += v2.v.val;
if (_private_add_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
if (v1.v.val < 0) return E_DATE_OVER;
v1.type = DATETIME_TYPE;
PushValStack(v1);
@@ -805,9 +826,8 @@ static int Add(void)
if ((v1.type == TIME_TYPE && v2.type == INT_TYPE) ||
(v1.type == INT_TYPE && v2.type == TIME_TYPE) ||
(v1.type == TIME_TYPE && v2.type == TIME_TYPE)) {
int old = v1.v.val;
if (_private_add_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
v1.v.val += v2.v.val;
if (_private_add_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
v1.v.val = v1.v.val % MINUTES_PER_DAY;
if (v1.v.val < 0) v1.v.val += MINUTES_PER_DAY;
v1.type = TIME_TYPE;
@@ -828,7 +848,7 @@ static int Add(void)
v3.type = STR_TYPE;
l1 = strlen(v1.v.str);
l2 = strlen(v2.v.str);
if (MaxStringLen && (l1 + l2 > (size_t) MaxStringLen)) {
if (MaxStringLen > 0 && (l1 + l2 > (size_t) MaxStringLen)) {
DestroyValue(v1); DestroyValue(v2);
return E_STRING_TOO_LONG;
}
@@ -868,18 +888,16 @@ static int Subtract(void)
/* If they're both INTs, do subtraction */
if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
int old = v1.v.val;
if (_private_sub_overflow(v1.v.val, v2.v.val)) return E_2HIGH;
v1.v.val -= v2.v.val;
if (_private_sub_overflow(v1.v.val, v2.v.val, old)) return E_2HIGH;
PushValStack(v1);
return OK;
}
/* If it's a date minus an int, do subtraction, checking for underflow */
if (v1.type == DATE_TYPE && v2.type == INT_TYPE) {
int old = v1.v.val;
if (_private_sub_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
v1.v.val -= v2.v.val;
if (_private_sub_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
if (v1.v.val < 0) return E_DATE_OVER;
PushValStack(v1);
return OK;
@@ -888,9 +906,8 @@ static int Subtract(void)
/* If it's a datetime minus an int or a time, do subtraction,
* checking for underflow */
if (v1.type == DATETIME_TYPE && (v2.type == INT_TYPE || v2.type == TIME_TYPE)) {
int old = v1.v.val;
if (_private_sub_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
v1.v.val -= v2.v.val;
if (_private_sub_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
if (v1.v.val < 0) return E_DATE_OVER;
PushValStack(v1);
return OK;
@@ -908,9 +925,8 @@ static int Subtract(void)
if ((v1.type == TIME_TYPE && v2.type == TIME_TYPE) ||
(v1.type == DATETIME_TYPE && v2.type == DATETIME_TYPE) ||
(v1.type == DATE_TYPE && v2.type == DATE_TYPE)) {
int old = v1.v.val;
if (_private_sub_overflow(v1.v.val, v2.v.val)) return E_DATE_OVER;
v1.v.val -= v2.v.val;
if (_private_sub_overflow(v1.v.val, v2.v.val, old)) return E_DATE_OVER;
v1.type = INT_TYPE;
PushValStack(v1);
return OK;
@@ -945,11 +961,8 @@ static int Multiply(void)
(v1.v.val == -1 && v2.v.val == INT_MIN)) {
return E_2HIGH;
}
int old = v1.v.val;
if (_private_mul_overflow(v1.v.val, v2.v.val)) return E_2HIGH;
v1.v.val *= v2.v.val;
if (v2.v.val != 0) {
if (_private_div(v1.v.val, v2.v.val) != old) return E_2HIGH;
}
PushValStack(v1);
return OK;
}
@@ -1108,13 +1121,16 @@ static int LogOR(void)
return r;
}
if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
v1.v.val = (v1.v.val || v2.v.val) ? 1 : 0;
PushValStack(v1);
return OK;
if (v1.type != v2.type || v1.type == STR_TYPE || v2.type == STR_TYPE) {
DestroyValue(v1); DestroyValue(v2);
return E_BAD_TYPE;
}
DestroyValue(v1); DestroyValue(v2);
return E_BAD_TYPE;
if (v1.v.val == 0) {
v1.v.val = v2.v.val;
}
PushValStack(v1);
return OK;
}
/***************************************************************/
@@ -1135,13 +1151,15 @@ static int LogAND(void)
return r;
}
if (v1.type == INT_TYPE && v2.type == INT_TYPE) {
v1.v.val = (v1.v.val && v2.v.val) ? 1 : 0;
PushValStack(v1);
return OK;
if (v1.type != v2.type || v1.type == STR_TYPE || v2.type == STR_TYPE) {
DestroyValue(v1); DestroyValue(v2);
return E_BAD_TYPE;
}
DestroyValue(v1); DestroyValue(v2);
return E_BAD_TYPE;
if (v1.v.val != 0) {
v1.v.val = v2.v.val;
}
PushValStack(v1);
return OK;
}
/***************************************************************/
@@ -1155,9 +1173,8 @@ static int UnMinus(void)
{
Value *v = &ValStack[ValStackPtr-1];
if (v->type != INT_TYPE) return E_BAD_TYPE;
int old = v->v.val;
if (v->v.val == INT_MIN) return E_2HIGH;
v->v.val = -v->v.val;
if (_private_unminus_overflow(old, v->v.val)) return E_2HIGH;
return OK;
}
@@ -1178,9 +1195,9 @@ static int LogNot(void)
/***************************************************************/
/* */
/* FindFunc */
/* FindOperator */
/* */
/* Find a function. */
/* Find an operator. */
/* */
/***************************************************************/
Operator *FindOperator(char const *name, Operator where[], int num)
@@ -1189,7 +1206,7 @@ Operator *FindOperator(char const *name, Operator where[], int num)
int mid, r;
while (top >= bot) {
mid = (top + bot) / 2;
r = StrCmpi(name, where[mid].name);
r = strcmp(name, where[mid].name);
if (!r) return &where[mid];
else if (r > 0) bot = mid+1;
else top = mid-1;
@@ -1197,6 +1214,20 @@ Operator *FindOperator(char const *name, Operator where[], int num)
return NULL;
}
/* Compare two strings case-insensitively, where we KNOW
that the second string is definitely lower-case */
static int strcmp_lcfirst(char const *s1, char const *s2)
{
int r;
while (*s1 && *s2) {
r = tolower(*s1) - *s2;
if (r) return r;
s1++;
s2++;
}
return tolower(*s1) - *s2;
}
/***************************************************************/
/* */
/* FindFunc */
@@ -1210,7 +1241,7 @@ BuiltinFunc *FindFunc(char const *name, BuiltinFunc where[], int num)
int mid, r;
while (top >= bot) {
mid = (top + bot) / 2;
r = StrCmpi(name, where[mid].name);
r = strcmp_lcfirst(name, where[mid].name);
if (!r) return &where[mid];
else if (r > 0) bot = mid+1;
else top = mid-1;
@@ -1228,24 +1259,43 @@ BuiltinFunc *FindFunc(char const *name, BuiltinFunc where[], int num)
void PrintValue (Value *v, FILE *fp)
{
int y, m, d;
char const *s;
unsigned char const *s;
if (v->type == STR_TYPE) {
s=v->v.str;
Putc('"', fp);
for (y=0; y<MAX_PRT_LEN && *s; y++) Putc(*s++, fp);
Putc('"',fp);
s = (unsigned char const *) v->v.str;
putc('"', fp);
for (y=0; y<MAX_PRT_LEN && *s; y++) {
switch(*s) {
case '\a': fprintf(ErrFp, "\\a"); break;
case '\b': fprintf(ErrFp, "\\b"); break;
case '\f': fprintf(ErrFp, "\\f"); break;
case '\n': fprintf(ErrFp, "\\n"); break;
case '\r': fprintf(ErrFp, "\\r"); break;
case '\t': fprintf(ErrFp, "\\t"); break;
case '\v': fprintf(ErrFp, "\\v"); break;
case '"': fprintf(ErrFp, "\\\""); break;
case '\\': fprintf(ErrFp, "\\\\"); break;
default:
if (*s < 32) {
fprintf(ErrFp, "\\x%02x", (unsigned int) *s);
} else {
putc(*s, ErrFp); break;
}
}
s++;
}
putc('"',fp);
if (*s) fprintf(fp, "...");
}
else if (v->type == INT_TYPE) fprintf(fp, "%d", v->v.val);
else if (v->type == TIME_TYPE) fprintf(fp, "%02d%c%02d", v->v.val / 60,
TimeSep, v->v.val % 60);
else if (v->type == DATE_TYPE) {
FromJulian(v->v.val, &y, &m, &d);
FromDSE(v->v.val, &y, &m, &d);
fprintf(fp, "%04d%c%02d%c%02d", y, DateSep, m+1, DateSep, d);
}
else if (v->type == DATETIME_TYPE) {
FromJulian(v->v.val / MINUTES_PER_DAY, &y, &m, &d);
FromDSE(v->v.val / MINUTES_PER_DAY, &y, &m, &d);
fprintf(fp, "%04d%c%02d%c%02d%c%02d%c%02d", y, DateSep, m+1, DateSep, d, DateTimeSep,
(v->v.val % MINUTES_PER_DAY) / 60, TimeSep, (v->v.val % MINUTES_PER_DAY) % 60);
}
@@ -1318,11 +1368,11 @@ int ParseLiteralTime(char const **s, int *tim)
/* */
/* ParseLiteralDate */
/* */
/* Parse a literal date or datetime. Return result in jul */
/* Parse a literal date or datetime. Return result in dse */
/* and tim; update s. */
/* */
/***************************************************************/
int ParseLiteralDate(char const **s, int *jul, int *tim)
int ParseLiteralDate(char const **s, int *dse, int *tim)
{
int y, m, d;
int r;
@@ -1352,7 +1402,7 @@ int ParseLiteralDate(char const **s, int *jul, int *tim)
}
if (!DateOK(y, m, d)) return E_BAD_DATE;
*jul = Julian(y, m, d);
*dse = DSE(y, m, d);
/* Do we have a time part as well? */
if (**s == ' ' || **s == '@' || **s == 'T' || **s == 't') {

View File

@@ -5,7 +5,8 @@
/* Contains a few definitions used by expression evaluator. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -58,7 +59,7 @@ else \
in various arithmetic operators. They have to be in separate
functions with extern linkage to defeat compiler optimizations
that would otherwise break the overflow checks. */
extern int _private_div(int a, int b);
extern int _private_add_overflow(int result, int b, int old);
extern int _private_sub_overflow(int result, int b, int old);
extern int _private_unminus_overflow(int a, int b);
extern int _private_mul_overflow(int a, int b);
extern int _private_add_overflow(int a, int b);
extern int _private_sub_overflow(int a, int b);

View File

@@ -7,7 +7,8 @@
/* files. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -96,6 +97,7 @@ static int ReadLineFromFile (int use_pclose);
static int CacheFile (char const *fname, int use_pclose);
static void DestroyCache (CachedFile *cf);
static int CheckSafety (void);
static int CheckSafetyAux (struct stat *statbuf);
static int PopFile (void);
static int IncludeCmd(char const *);
static void OpenPurgeFile(char const *fname, char const *mode)
@@ -163,6 +165,7 @@ int ReadLine(void)
LineNo = CLine->LineNo;
CLine = CLine->next;
FreshLine = 1;
clear_callstack();
if (DebugFlag & DB_ECHO_LINE) OutputLine(ErrFp);
return OK;
}
@@ -263,6 +266,7 @@ static int ReadLineFromFile(int use_pclose)
}
FreshLine = 1;
clear_callstack();
if (DebugFlag & DB_ECHO_LINE) OutputLine(ErrFp);
return OK;
}
@@ -557,23 +561,68 @@ static int PopFile(void)
/* The INCLUDE command. */
/* */
/***************************************************************/
int DoInclude(ParsePtr p)
int DoInclude(ParsePtr p, enum TokTypes tok)
{
DynamicBuffer buf;
DynamicBuffer fullname;
DynamicBuffer path;
int r, e;
r = OK;
char const *s;
DBufInit(&buf);
DBufInit(&fullname);
DBufInit(&path);
if ( (r=ParseToken(p, &buf)) ) return r;
e = VerifyEoln(p);
if (e) Eprint("%s", ErrMsg[e]);
if ( (r=IncludeFile(DBufValue(&buf))) ) {
DBufFree(&buf);
return r;
if (tok == T_IncludeR && *(DBufValue(&buf)) != '/') {
/* Relative include: Include relative to dir
containing current file */
if (DBufPuts(&path, FileName) != OK) {
r = E_NO_MEM;
goto bailout;
}
if (DBufLen(&path) == 0) {
s = DBufValue(&buf);
} else {
char *t = DBufValue(&path) + DBufLen(&path) - 1;
while (t > DBufValue(&path) && *t != '/') t--;
if (*t == '/') {
*t = 0;
if (DBufPuts(&fullname, DBufValue(&path)) != OK) {
r = E_NO_MEM;
goto bailout;
}
if (DBufPuts(&fullname, "/") != OK) {
r = E_NO_MEM;
goto bailout;
}
if (DBufPuts(&fullname, DBufValue(&buf)) != OK) {
r = E_NO_MEM;
goto bailout;
}
s = DBufValue(&fullname);
} else {
s = DBufValue(&buf);
}
}
} else {
s = DBufValue(&buf);
}
DBufFree(&buf);
if ( (r=IncludeFile(s)) ) {
goto bailout;
}
NumIfs = 0;
IfFlags = 0;
return OK;
bailout:
DBufFree(&buf);
DBufFree(&path);
DBufFree(&fullname);
return r;
}
/***************************************************************/
@@ -773,6 +822,7 @@ static int IncludeCmd(char const *cmd)
int old_flag;
FreshLine = 1;
clear_callstack();
if (IStackPtr+1 >= INCLUDE_NEST) return E_NESTED_INCLUDE;
i = &IStack[IStackPtr];
@@ -890,6 +940,7 @@ int IncludeFile(char const *fname)
struct stat statbuf;
FreshLine = 1;
clear_callstack();
if (IStackPtr+1 >= INCLUDE_NEST) return E_NESTED_INCLUDE;
i = &IStack[IStackPtr];
@@ -922,6 +973,11 @@ int IncludeFile(char const *fname)
if (stat(fname, &statbuf) == 0) {
FilenameChain *fc;
if (S_ISDIR(statbuf.st_mode)) {
/* Check safety */
if (!CheckSafetyAux(&statbuf)) {
PopFile();
return E_NO_MATCHING_REMS;
}
if (SetupGlobChain(fname, i) == OK) { /* Glob succeeded */
if (!i->chain) { /* Oops... no matching files */
if (!Hush) {
@@ -982,7 +1038,7 @@ int GetAccessDate(char const *file)
if (t1->tm_year + 1900 < BASE)
return 0;
else
return Julian(t1->tm_year+1900, t1->tm_mon, t1->tm_mday);
return DSE(t1->tm_year+1900, t1->tm_mon, t1->tm_mday);
}
/***************************************************************/
@@ -1035,8 +1091,8 @@ int TopLevel(void)
/* CheckSafety */
/* */
/* Returns 1 if current file is safe to read; 0 otherwise. */
/* Currently only meaningful for UNIX. If we are running as */
/* root, we refuse to open files not owned by root. */
/* If we are running as root, we refuse to open files not */
/* owned by root. */
/* We also reject world-writable files, no matter */
/* who we're running as. */
/* As a side effect, if we don't own the file, or it's not */
@@ -1056,25 +1112,44 @@ static int CheckSafety(void)
return 0;
}
if (!CheckSafetyAux(&statbuf)) {
fclose(fp);
fp = NULL;
return 0;
}
return 1;
}
/***************************************************************/
/* */
/* CheckSafetyAux */
/* */
/* Returns 1 if file whos info is in statbuf is safe to read; */
/* 0 otherwise. If we are running as */
/* root, we refuse to open files not owned by root. */
/* We also reject world-writable files, no matter */
/* who we're running as. */
/* As a side effect, if we don't own the file, or it's not */
/* owned by a trusted user, we disable RUN */
/***************************************************************/
static int CheckSafetyAux(struct stat *statbuf)
{
/* Under UNIX, take extra precautions if running as root */
if (!geteuid()) {
/* Reject files not owned by root or group/world writable */
if (statbuf.st_uid != 0) {
fprintf(ErrFp, "SECURITY: Won't read non-root-owned file when running as root!\n");
fclose(fp);
fp = NULL;
if (statbuf->st_uid != 0) {
fprintf(ErrFp, "SECURITY: Won't read non-root-owned file or directory when running as root!\n");
return 0;
}
}
/* Sigh... /dev/null is usually world-writable, so ignore devices,
FIFOs, sockets, etc. */
if (!S_ISREG(statbuf.st_mode)) {
if (!S_ISREG(statbuf->st_mode) && !S_ISDIR(statbuf->st_mode)) {
return 1;
}
if ((statbuf.st_mode & S_IWOTH)) {
fprintf(ErrFp, "SECURITY: Won't read world-writable file!\n");
fclose(fp);
fp = NULL;
if ((statbuf->st_mode & S_IWOTH)) {
fprintf(ErrFp, "SECURITY: Won't read world-writable file or directory!\n");
return 0;
}
@@ -1082,13 +1157,13 @@ static int CheckSafety(void)
/* Assume unsafe */
RunDisabled |= RUN_NOTOWNER;
if (statbuf.st_uid == geteuid()) {
if (statbuf->st_uid == geteuid()) {
/* Owned by me... safe */
RunDisabled &= ~RUN_NOTOWNER;
} else {
int i;
for (i=0; i<NumTrustedUsers; i++) {
if (statbuf.st_uid == TrustedUsers[i]) {
if (statbuf->st_uid == TrustedUsers[i]) {
/* Owned by a trusted user... safe */
RunDisabled &= ~RUN_NOTOWNER;
break;

File diff suppressed because it is too large Load Diff

View File

@@ -8,15 +8,17 @@
/* globals.h and err.h */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
#include "config.h"
#include <stdio.h> /* For defintion of FILE - sigh! */
#include <stdio.h> /* For definition of FILE - sigh! */
#include "types.h"
#include "custom.h"
#define MK_GLOBALS
#include "lang.h"
#define MK_GLOBALS 1
#include "globals.h"
#include "err.h"

View File

@@ -8,9 +8,11 @@
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
#ifdef MK_GLOBALS
#undef EXTERN
#define EXTERN
@@ -24,6 +26,10 @@
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
EXTERN FILE *ErrFp;
#include "dynbuf.h"
#include "lang.h"
#define MAX_TRUSTED_USERS 20
@@ -35,7 +41,7 @@
#define DestroyValue(x) (void) (((x).type == STR_TYPE && (x).v.str) ? (free((x).v.str),(x).type = ERR_TYPE) : 0)
EXTERN int JulianToday;
EXTERN int DSEToday;
EXTERN int RealToday;
EXTERN int CurDay;
EXTERN int CurMon;
@@ -53,14 +59,16 @@ EXTERN INIT( int DoSimpleCalendar, 0);
EXTERN INIT( int DoSimpleCalDelta, 0);
EXTERN INIT( int DoPrefixLineNo, 0);
EXTERN INIT( int MondayFirst, 0);
EXTERN INIT( int AddBlankLines, 1);
EXTERN INIT( int Iterations, 1);
EXTERN INIT( int PsCal, 0);
EXTERN INIT( int CalWidth, -1);
EXTERN INIT( int CalWidth, 80);
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 DefaultTDelta, 0);
EXTERN INIT( int DeltaOffset, 0);
EXTERN INIT( int RunDisabled, 0);
EXTERN INIT( int IgnoreOnce, 0);
@@ -74,6 +82,8 @@ EXTERN INIT( long SysTime, -1L);
EXTERN char const *InitialFile;
EXTERN int FileAccessDate;
EXTERN INIT( int WeekdayOmits, 0);
EXTERN INIT( int DontSuppressQuoteMarkers, 0);
EXTERN INIT( int DontFork, 0);
EXTERN INIT( int DontQueue, 0);
EXTERN INIT( int NumQueued, 0);
@@ -87,13 +97,12 @@ EXTERN INIT( int DefaultColorB, -1);
EXTERN INIT( int DefaultColorG, -1);
EXTERN INIT( int SynthesizeTags, 0);
EXTERN INIT( int ScFormat, SC_AMPM);
EXTERN INIT( int MaxSatIter, 150);
EXTERN INIT( int MaxSatIter, 1000);
EXTERN INIT( int MaxStringLen, MAX_STR_LEN);
EXTERN INIT( char *FileName, NULL);
EXTERN INIT( int UseStdin, 0);
EXTERN INIT( int PurgeMode, 0);
EXTERN INIT( int PurgeIncludeDepth, 0);
EXTERN FILE *ErrFp;
EXTERN INIT( FILE *PurgeFP, NULL);
EXTERN INIT( int NumIfs, 0);
EXTERN INIT( unsigned int IfFlags, 0);
@@ -105,11 +114,13 @@ EXTERN INIT( int LastTriggerTime, 0);
EXTERN INIT( int ShouldCache, 0);
EXTERN char const *CurLine;
EXTERN INIT( int NumTriggered, 0);
EXTERN INIT( int DidMsgReminder, 0);
EXTERN int ArgC;
EXTERN char const **ArgV;
EXTERN INIT( int CalLines, CAL_LINES);
EXTERN INIT( int CalPad, 1);
EXTERN INIT( int UseVTChars, 0);
EXTERN INIT( int UseBGVTColors, 0);
EXTERN INIT( int UseUTF8Chars, 0);
EXTERN INIT( int UseVTColors, 0);
EXTERN INIT( int Use256Colors, 0);
@@ -117,14 +128,14 @@ EXTERN INIT( int UseTrueColors, 0);
EXTERN INIT( int TerminalBackground, TERMINAL_BACKGROUND_UNKNOWN);
/* Latitude and longitude */
EXTERN INIT( int LatDeg, LAT_DEG);
EXTERN INIT( int LatMin, LAT_MIN);
EXTERN INIT( int LatSec, LAT_SEC);
EXTERN INIT( int LongDeg, LON_DEG);
EXTERN INIT( int LongMin, LON_MIN);
EXTERN INIT( int LongSec, LON_SEC);
EXTERN INIT( double Longitude, -999.0);
EXTERN INIT( double Latitude, -999.0);
EXTERN INIT( int LatDeg, 0);
EXTERN INIT( int LatMin, 0);
EXTERN INIT( int LatSec, 0);
EXTERN INIT( int LongDeg, 0);
EXTERN INIT( int LongMin, 0);
EXTERN INIT( int LongSec, 0);
EXTERN INIT( double Longitude, DEFAULT_LONGITUDE);
EXTERN INIT( double Latitude, DEFAULT_LATITUDE);
EXTERN INIT( char *Location, LOCATION);
@@ -140,11 +151,6 @@ EXTERN INIT( int SubsIndent, 0);
EXTERN INIT( char *EndSent, ".?!");
EXTERN INIT( char *EndSentIg, "\"')]}>");
/* We need the language stuff here... */
#include "lang.h"
#include "dynbuf.h"
EXTERN DynamicBuffer Banner;
EXTERN DynamicBuffer LineBuffer;
EXTERN DynamicBuffer ExprBuf;
@@ -167,6 +173,17 @@ EXTERN char *MonthName[]
;
#endif
EXTERN char *DynamicMonthName[]
#ifdef MK_GLOBALS
#if LANG == ENGLISH
= {"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"}
#else
= {L_JAN, L_FEB, L_MAR, L_APR, L_MAY, L_JUN,
L_JUL, L_AUG, L_SEP, L_OCT, L_NOV, L_DEC}
#endif
#endif
;
EXTERN char *EnglishDayName[]
#ifdef MK_GLOBALS
= {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
@@ -185,6 +202,18 @@ EXTERN char *DayName[]
;
#endif
EXTERN char *DynamicDayName []
#ifdef MK_GLOBALS
#if LANG == ENGLISH
= {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
"Saturday", "Sunday"}
#else
= {L_MONDAY, L_TUESDAY, L_WEDNESDAY, L_THURSDAY, L_FRIDAY,
L_SATURDAY, L_SUNDAY}
#endif
#endif
;
EXTERN int MonthDays[]
#ifdef MK_GLOBALS
= {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
@@ -203,3 +232,98 @@ EXTERN int MonthIndex[2][12]
#endif
;
EXTERN char *DynamicAgo
#ifdef MK_GLOBALS
= L_AGO
#endif
;
EXTERN char *DynamicAm
#ifdef MK_GLOBALS
= L_AM
#endif
;
EXTERN char *DynamicAnd
#ifdef MK_GLOBALS
= L_AND
#endif
;
EXTERN char *DynamicAt
#ifdef MK_GLOBALS
= L_AT
#endif
;
EXTERN char *DynamicFromnow
#ifdef MK_GLOBALS
= L_FROMNOW
#endif
;
EXTERN char *DynamicHour
#ifdef MK_GLOBALS
= L_HOUR
#endif
;
EXTERN char *DynamicHplu
#ifdef MK_GLOBALS
= L_HPLU
#endif
;
EXTERN char *DynamicIs
#ifdef MK_GLOBALS
= L_IS
#endif
;
EXTERN char *DynamicMinute
#ifdef MK_GLOBALS
= L_MINUTE
#endif
;
EXTERN char *DynamicMplu
#ifdef MK_GLOBALS
= L_MPLU
#endif
;
EXTERN char *DynamicNow
#ifdef MK_GLOBALS
= L_NOW
#endif
;
EXTERN char *DynamicOn
#ifdef MK_GLOBALS
= L_ON
#endif
;
EXTERN char *DynamicPm
#ifdef MK_GLOBALS
= L_PM
#endif
;
EXTERN char *DynamicToday
#ifdef MK_GLOBALS
= L_TODAY
#endif
;
EXTERN char *DynamicTomorrow
#ifdef MK_GLOBALS
= L_TOMORROW
#endif
;
EXTERN char *DynamicWas
#ifdef MK_GLOBALS
= L_WAS
#endif
;
#define XSTR(x) #x
#define STRSYSDIR(x) XSTR(x)
EXTERN char *SysDir
#ifdef MK_GLOBALS
= STRSYSDIR(SYSDIR)
#endif
;
EXTERN int SuppressLRM
#ifdef MK_GLOBALS
= 0
#endif
;

View File

@@ -5,7 +5,8 @@
/* Support for the Hebrew calendar */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/* Derived from code written by Amos Shapir in 1978; revised */
/* 1985. */
@@ -67,7 +68,7 @@ static char HebIsLeap[] = {0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1};
/* */
/* RoshHashana */
/* */
/* Return the Julian date for Rosh Hashana of specified */
/* Return DSE date for Rosh Hashana of specified */
/* Hebrew year. (ie, 5751, not 1990) */
/* */
/***************************************************************/
@@ -155,14 +156,14 @@ char const *DaysInHebMonths(int ylen)
/***************************************************************/
/* */
/* HebToJul */
/* HebToDSE */
/* */
/* Convert a Hebrew date to Julian. */
/* Convert a Hebrew date to DSE. */
/* Hebrew months range from 0-12, but Adar A has 0 length in */
/* non-leap-years. */
/* */
/***************************************************************/
int HebToJul(int hy, int hm, int hd)
int HebToDSE(int hy, int hm, int hd)
{
int ylen;
char const *monlens;
@@ -188,39 +189,39 @@ int HebToJul(int hy, int hm, int hd)
/***************************************************************/
/* */
/* JulToHeb */
/* DSEToHeb */
/* */
/* Convert a Julian date to Hebrew. */
/* Convert a DSE to Hebrew. */
/* Hebrew months range from 0-12, but Adar A has 0 length in */
/* non-leap-years. */
/* */
/***************************************************************/
void JulToHeb(int jul, int *hy, int *hm, int *hd)
void DSEToHeb(int dse, int *hy, int *hm, int *hd)
{
int y, m, d;
int rh;
int ylen;
char const *monlen;
/* Get the common year */
FromJulian(jul, &y, &m, &d);
FromDSE(dse, &y, &m, &d);
y += 3763; /* Over-estimate a bit to be on the safe side below... */
/* Find the RH just before desired date */
while ((rh=RoshHashana(y))>jul) y--;
while ((rh=RoshHashana(y))>dse) y--;
/* Got the year - now find the month */
jul -= rh;
dse -= rh;
ylen = DaysInHebYear(y);
monlen = DaysInHebMonths(ylen);
m = 0;
while((jul >= monlen[m]) || !monlen[m]) {
jul -= monlen[m];
while((dse >= monlen[m]) || !monlen[m]) {
dse -= monlen[m];
m++;
}
*hy = y;
*hm = m;
*hd = jul+1;
*hd = dse+1;
}
/***************************************************************/
@@ -389,20 +390,20 @@ int GetValidHebDate(int yin, int min, int din, int adarbehave,
/* Returns 0 for success, non-zero for failure. */
/* */
/***************************************************************/
int GetNextHebrewDate(int julstart, int hm, int hd,
int GetNextHebrewDate(int dsestart, int hm, int hd,
int jahr, int adarbehave, int *ans)
{
int r, yout, mout, dout, jul=1;
int r, yout, mout, dout, dse=1;
int adarflag = adarbehave;
/* I initialize jul above to stop gcc from complaining about
/* I initialize dse above to stop gcc from complaining about
possible use of uninitialized variable. You can take it
out if the small inefficiency really bothers you. */
/* If adarbehave == ADAR2BOTH, set adarflag to ADAR2ADARA for now */
if (adarbehave == ADAR2BOTH) adarflag = ADAR2ADARA;
JulToHeb(julstart, &yout, &mout, &dout);
DSEToHeb(dsestart, &yout, &mout, &dout);
r = 1;
while(r) {
@@ -419,9 +420,9 @@ int GetNextHebrewDate(int julstart, int hm, int hd,
} else yout++;
continue;
}
jul = HebToJul(yout, mout, dout);
if (jul < 0) return E_DATE_OVER;
if (jul >= julstart) break;
dse = HebToDSE(yout, mout, dout);
if (dse < 0) return E_DATE_OVER;
if (dse >= dsestart) break;
else {
if (adarbehave == ADAR2BOTH && hm == ADAR) {
if (adarflag == ADAR2ADARA) {
@@ -434,7 +435,7 @@ int GetNextHebrewDate(int julstart, int hm, int hd,
r=1; /* Force loop to continue */
}
}
*ans = jul;
*ans = dse;
return OK;
}

View File

@@ -7,7 +7,8 @@
/* in normal mode. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -21,6 +22,10 @@
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <pwd.h>
#include <unistd.h>
#include <sys/ioctl.h>
@@ -30,10 +35,10 @@
#endif
#include "types.h"
#include "globals.h"
#include "protos.h"
#include "expr.h"
#include "err.h"
#include "globals.h"
/***************************************************************
*
@@ -43,7 +48,8 @@
* 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
* -@[n,m,b]= Colorize n=0 VT100 n=1 85 n=2 True m=0 dark terminal m=1 light
* b=0 ignore SHADE b=1 respect SHADE
* -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
@@ -76,9 +82,6 @@
* 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) \
@@ -97,6 +100,25 @@ static void AddTrustedUser(char const *username);
static DynamicBuffer default_filename_buf;
static void
InitCalWidthAndFormWidth(int fd)
{
struct winsize w;
if (!isatty(fd)) {
return;
}
if (ioctl(fd, TIOCGWINSZ, &w) == 0) {
CalWidth = w.ws_col;
if (CalWidth < 71) {
CalWidth = 71;
}
FormWidth = w.ws_col - 8;
if (FormWidth < 20) FormWidth = 20;
if (FormWidth > 500) FormWidth = 500;
}
}
/***************************************************************/
/* */
/* DefaultFilename */
@@ -143,27 +165,15 @@ void InitRemind(int argc, char const *argv[])
char const *s;
int weeks;
int x;
int jul;
int dse;
int ttyfd;
#if defined(__APPLE__)
rkrphgvba(0);
#elif defined(__CYGWIN__)
rkrphgvba(1);
#endif
jul = NO_DATE;
dse = 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;
}
}
InitCalWidthAndFormWidth(STDOUT_FILENO);
/* Initialize global dynamic buffers */
DBufInit(&Banner);
DBufInit(&LineBuffer);
@@ -190,8 +200,11 @@ void InitRemind(int argc, char const *argv[])
fprintf(ErrFp, ErrMsg[M_BAD_SYS_DATE], BASE);
exit(EXIT_FAILURE);
}
JulianToday = RealToday;
FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
DSEToday = RealToday;
FromDSE(DSEToday, &CurYear, &CurMon, &CurDay);
/* Initialize Latitude and Longitude */
set_components_from_lat_and_long();
/* See if we were invoked as "rem" rather than "remind" */
if (argv[0]) {
@@ -204,6 +217,9 @@ void InitRemind(int argc, char const *argv[])
if (!strcmp(s, "rem")) {
InvokedAsRem = 1;
}
} else {
fprintf(stderr, "Invoked with a NULL argv[0]; bailing because that's just plain bizarre.\n");
exit(1);
}
/* Parse the command-line options */
@@ -235,17 +251,37 @@ void InitRemind(int argc, char const *argv[])
Use256Colors = 1;
} else if (x == 2) {
UseTrueColors = 1;
}
} else if (x != 0) {
fprintf(ErrFp, "%s: -@n,m,b: n must be 0, 1 or 2 (assuming 0)\n",
argv[0]);
}
}
if (*arg == ',') {
arg++;
PARSENUM(x, arg);
if (x == 0) {
TerminalBackground = TERMINAL_BACKGROUND_DARK;
} else if (x == 1) {
TerminalBackground = TERMINAL_BACKGROUND_LIGHT;
}
if (*arg != ',') {
PARSENUM(x, arg);
if (x == 0) {
TerminalBackground = TERMINAL_BACKGROUND_DARK;
} else if (x == 1) {
TerminalBackground = TERMINAL_BACKGROUND_LIGHT;
} else if (x == 2) {
TerminalBackground = TERMINAL_BACKGROUND_UNKNOWN;
} else {
fprintf(ErrFp, "%s: -@n,m,b: m must be 0, 1 or 2 (assuming 2)\n",
argv[0]);
}
}
}
if (*arg == ',') {
arg++;
PARSENUM(x, arg);
if (x != 0 && x != 1) {
fprintf(ErrFp, "%s: -@n,m,b: b must be 0 or 1 (assuming 0)\n",
argv[0]);
x = 0;
}
UseBGVTColors = x;
}
break;
case 'j':
@@ -290,7 +326,19 @@ void InitRemind(int argc, char const *argv[])
case 't':
case 'T':
if (!*arg) {
if (*arg == 'T' || *arg == 't') {
arg++;
if (!*arg) {
DefaultTDelta = 5;
} else {
PARSENUM(DefaultTDelta, arg);
if (DefaultTDelta < 0) {
DefaultTDelta = 0;
} else if (DefaultTDelta > 1440) {
DefaultTDelta = 1440;
}
}
} else if (!*arg) {
InfiniteDelta = 1;
} else {
PARSENUM(DeltaOffset, arg);
@@ -450,6 +498,7 @@ void InitRemind(int argc, char const *argv[])
DoSimpleCalendar = 1;
PsCal = PSCAL_LEVEL1;
while (*arg == 'a' || *arg == 'A' ||
*arg == 'q' || *arg == 'Q' ||
*arg == 'p' || *arg == 'P') {
if (*arg == 'a' || *arg == 'A') {
DoSimpleCalDelta = 1;
@@ -462,7 +511,9 @@ void InitRemind(int argc, char const *argv[])
} else {
PsCal = PSCAL_LEVEL3;
}
}
} else if (*arg == 'q' || *arg == 'Q') {
DontSuppressQuoteMarkers = 1;
}
arg++;
}
PARSENUM(CalMonths, arg);
@@ -477,11 +528,27 @@ void InitRemind(int argc, char const *argv[])
case 'w':
case 'W':
if (*arg != ',') {
PARSENUM(CalWidth, arg);
if (CalWidth != 0 && CalWidth < 71) CalWidth = 71;
if (CalWidth == 0) {
CalWidth = -1;
}
if (*arg == 't') {
arg++;
/* -wt means get width from /dev/tty */
ttyfd = open("/dev/tty", O_RDONLY);
if (!ttyfd) {
fprintf(stderr, "%s: `-wt': Cannot open /dev/tty: %s\n",
argv[0], strerror(errno));
} else {
InitCalWidthAndFormWidth(ttyfd);
close(ttyfd);
}
} else {
PARSENUM(CalWidth, arg);
if (CalWidth != 0 && CalWidth < 71) CalWidth = 71;
if (CalWidth == 0) {
CalWidth = -1;
}
FormWidth = CalWidth - 8;
if (FormWidth < 20) FormWidth = 20;
if (FormWidth > 500) FormWidth = 500;
}
}
if (*arg == ',') {
arg++;
@@ -572,30 +639,30 @@ void InitRemind(int argc, char const *argv[])
case T_DateTime:
if (SysTime != -1L) Usage();
if (m != NO_MON || d != NO_DAY || y != NO_YR || jul != NO_DATE) Usage();
if (m != NO_MON || d != NO_DAY || y != NO_YR || dse != NO_DATE) Usage();
SysTime = (tok.val % MINUTES_PER_DAY) * 60;
DontQueue = 1;
Daemon = 0;
jul = tok.val / MINUTES_PER_DAY;
dse = 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;
if (m != NO_MON || d != NO_DAY || y != NO_YR || dse != NO_DATE) Usage();
dse = tok.val;
break;
case T_Month:
if (m != NO_MON || jul != NO_DATE) Usage();
if (m != NO_MON || dse != NO_DATE) Usage();
else m = tok.val;
break;
case T_Day:
if (d != NO_DAY || jul != NO_DATE) Usage();
if (d != NO_DAY || dse != NO_DATE) Usage();
else d = tok.val;
break;
case T_Year:
if (y != NO_YR || jul != NO_DATE) Usage();
if (y != NO_YR || dse != NO_DATE) Usage();
else y = tok.val;
break;
@@ -615,8 +682,8 @@ void InitRemind(int argc, char const *argv[])
Daemon = 0;
}
if (jul != NO_DATE) {
FromJulian(jul, &y, &m, &d);
if (dse != NO_DATE) {
FromDSE(dse, &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) {
@@ -634,23 +701,22 @@ void InitRemind(int argc, char const *argv[])
fprintf(ErrFp, "%s", BadDate);
Usage();
}
JulianToday = Julian(y, m, d);
if (JulianToday == -1) {
DSEToday = DSE(y, m, d);
if (DSEToday == -1) {
fprintf(ErrFp, "%s", BadDate);
Usage();
}
CurYear = y;
CurMon = m;
CurDay = d;
if (JulianToday != RealToday) IgnoreOnce = 1;
if (DSEToday != RealToday) IgnoreOnce = 1;
}
}
set_lat_and_long_from_components();
/* Figure out the offset from UTC */
if (CalculateUTC)
(void) CalcMinsFromUTC(JulianToday, SystemTime(0)/60,
(void) CalcMinsFromUTC(DSEToday, SystemTime(0)/60,
&MinsFromUTC, NULL);
}
@@ -664,7 +730,7 @@ void InitRemind(int argc, char const *argv[])
#ifndef L_USAGE_OVERRIDE
void Usage(void)
{
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
#ifdef BETA
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
#endif
@@ -672,7 +738,7 @@ void Usage(void)
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, " -@[n,m] Colorize COLOR reminders\n");
fprintf(ErrFp, " -@[n,m,b] Colorize COLOR/SHADE 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");
@@ -690,7 +756,7 @@ void Usage(void)
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline f=tracefiles\n");
fprintf(ErrFp, " -e Divert messages normally sent to stderr to stdout\n");
fprintf(ErrFp, " -b[n] Time format for cal: 0=am/pm, 1=24hr, 2=none\n");
fprintf(ErrFp, " -x[n] Iteration limit for SATISFY clause (def=150)\n");
fprintf(ErrFp, " -x[n] Iteration limit for SATISFY clause (def=1000)\n");
fprintf(ErrFp, " -kcmd Run `cmd' for MSG-type reminders\n");
fprintf(ErrFp, " -g[dddd] Sort reminders by date, time, priority, and 'timedness'\n");
fprintf(ErrFp, " -ivar=val Initialize var to val and preserve var\n");
@@ -848,6 +914,7 @@ static void InitializeVar(char const *str)
if (*varname == '$') {
r=SetSysVar(varname+1, &val);
DestroyValue(val);
if (r) fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
return;
}
@@ -881,46 +948,3 @@ AddTrustedUser(char const *username)
NumTrustedUsers++;
}
#if defined(__APPLE__) || defined(__CYGWIN__)
static char const pmsg1[] = {
0x4c, 0x62, 0x68, 0x20, 0x6e, 0x63, 0x63, 0x72, 0x6e, 0x65, 0x20,
0x67, 0x62, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x68, 0x61, 0x61, 0x76,
0x61, 0x74, 0x20, 0x45, 0x72, 0x7a, 0x76, 0x61, 0x71, 0x20, 0x62,
0x61, 0x20, 0x6e, 0x61, 0x20, 0x4e, 0x63, 0x63, 0x79, 0x72, 0x20,
0x63, 0x65, 0x62, 0x71, 0x68, 0x70, 0x67, 0x2e, 0x20, 0x20, 0x56,
0x27, 0x71, 0x20, 0x65, 0x6e, 0x67, 0x75, 0x72, 0x65, 0x20, 0x67,
0x75, 0x6e, 0x67, 0x0a, 0x6c, 0x62, 0x68, 0x20, 0x71, 0x76, 0x71,
0x61, 0x27, 0x67, 0x2e, 0x20, 0x20, 0x45, 0x72, 0x7a, 0x76, 0x61,
0x71, 0x20, 0x72, 0x6b, 0x72, 0x70, 0x68, 0x67, 0x76, 0x62, 0x61,
0x20, 0x6a, 0x76, 0x79, 0x79, 0x20, 0x70, 0x62, 0x61, 0x67, 0x76,
0x61, 0x68, 0x72, 0x20, 0x7a, 0x62, 0x7a, 0x72, 0x61, 0x67, 0x6e,
0x65, 0x76, 0x79, 0x6c, 0x2e, 0x0a, 0x00
};
static char const pmsg2[] = {
0x4c, 0x62, 0x68, 0x20, 0x6e, 0x63, 0x63, 0x72, 0x6e, 0x65, 0x20,
0x67, 0x62, 0x20, 0x6f, 0x72, 0x20, 0x65, 0x68, 0x61, 0x61, 0x76,
0x61, 0x74, 0x20, 0x45, 0x72, 0x7a, 0x76, 0x61, 0x71, 0x20, 0x62,
0x61, 0x20, 0x6e, 0x20, 0x5a, 0x76, 0x70, 0x65, 0x62, 0x66, 0x62,
0x73, 0x67, 0x20, 0x66, 0x6c, 0x66, 0x67, 0x72, 0x7a, 0x2e, 0x20,
0x20, 0x56, 0x27, 0x71, 0x20, 0x65, 0x6e, 0x67, 0x75, 0x72, 0x65,
0x20, 0x67, 0x75, 0x6e, 0x67, 0x0a, 0x6c, 0x62, 0x68, 0x20, 0x71,
0x76, 0x71, 0x61, 0x27, 0x67, 0x2e, 0x20, 0x20, 0x45, 0x72, 0x7a,
0x76, 0x61, 0x71, 0x20, 0x72, 0x6b, 0x72, 0x70, 0x68, 0x67, 0x76,
0x62, 0x61, 0x20, 0x6a, 0x76, 0x79, 0x79, 0x20, 0x70, 0x62, 0x61,
0x67, 0x76, 0x61, 0x68, 0x72, 0x20, 0x7a, 0x62, 0x7a, 0x72, 0x61,
0x67, 0x6e, 0x65, 0x76, 0x79, 0x6c, 0x2e, 0x0a, 0x00
};
static void
rkrphgvba(int x)
{
char const *s = (x ? pmsg2 : pmsg1);
while(*s) {
int c = (int) *s++;
c=isalpha(c)?tolower(c)<0x6e?c+13:c-13:c;
putchar(c);
}
sleep(5);
}
#endif

View File

@@ -5,7 +5,8 @@
/* Header file for language support for various languages. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -23,7 +24,7 @@
#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 */
#define ICELANDIC 12 /* translated by Björn Davíðsson */
/* Add more languages here - but please e-mail dianne@skoll.ca
to have your favorite language assigned a number. If you add a

View File

@@ -6,8 +6,9 @@
/* */
/* This file is part of REMIND. */
/* */
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
/* This file is Copyright (C) 1993 by Mogens Lynnerup. */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -15,21 +16,13 @@
#define L_LANGNAME "Danish"
/* Day names */
#if ISOLATIN1
# define L_SUNDAY "S\370ndag"
#else
# define L_SUNDAY "Soendag"
#endif
#define L_SUNDAY "Søndag"
#define L_MONDAY "Mandag"
#define L_TUESDAY "Tirsdag"
#define L_WEDNESDAY "Onsdag"
#define L_THURSDAY "Torsdag"
#define L_FRIDAY "Fredag"
#if ISOLATIN1
# define L_SATURDAY "L\370rdag"
#else
# define L_SATURDAY "Loerdag"
#endif
#define L_SATURDAY "Lørdag"
/* Month names */
#define L_JAN "Januar"
@@ -50,19 +43,12 @@
#define L_TOMORROW "i morgen"
/* The default banner */
#if ISOLATIN1
# define L_BANNER "P\345mindelse for %w, %d. %m, %y%o:"
#else
# define L_BANNER "Paamindelse for %w, %d. %m, %y%o:"
#endif
#define L_BANNER "Påmindelse for %w, %d. %m, %y%o:"
/* "am" and "pm" */
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "siden"
#define L_FROMNOW "fra nu"
@@ -71,11 +57,7 @@
#define L_INXDAYS "om %d dage"
/* "on" as in "on date..." */
#if ISOLATIN1
# define L_ON "p\345"
#else
# define L_ON "paa"
#endif
#define L_ON "på"
/* Pluralizing - this is a problem for many languages and may require
a more drastic fix */
@@ -99,13 +81,11 @@
#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 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_A_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s %d", DayName[dse%7], d, MonthName[m], y); } else { sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[dse%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_G_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s", DayName[dse%7], d, MonthName[m]); } else { sprintf(s, "%s %s, den %d. %s", L_ON, DayName[dse%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
#endif /* L_IN_DOSUBST */

View File

@@ -11,7 +11,8 @@
/* Further corrections by Erik-Jan Vens */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -52,9 +53,6 @@
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "geleden"
#define L_FROMNOW "vanaf nu"
@@ -91,15 +89,14 @@ if (tdiff == 0) \
sprintf(s, L_NOW); \
else if (hdiff == 0) \
sprintf(s, "%d %s %s", mdiff, \
(mdiff == 1 ? "minuut" : "minuten"), when); \
((mdiff == 1) ? "minuut" : "minuten"), when); \
else if (mdiff == 0) \
sprintf(s, "%d %s %s", hdiff, \
(mdiff == 1 ? "uur" : "uren"), when); \
else sprintf(s, "%d %s %s %d %s %s", hdiff, \
(hdiff == 1 ? "uur" : "uren"), \
L_AND, mdiff, \
(mdiff == 1 ? "minuut" : "minuten"), \
when);
((hdiff == 1) ? "uur" : "uren"), when); \
else sprintf(s, "%d %s %s %d %s %s", hdiff, \
(hdiff == 1 ? "uur" : "uren"), \
L_AND, mdiff, \
(mdiff == 1 ? "minuut" : "minuten"), \
when);
#endif /* L_IN_DOSUBST */

View File

@@ -5,7 +5,8 @@
/* Support for the English language. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -46,9 +47,6 @@
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "ago"
#define L_FROMNOW "from now"
@@ -72,11 +70,9 @@
#define L_WAS "was"
#define L_AND "and"
/* What to add to make "hour" plural */
#define L_HPLU "s"
#define L_HPLU "s"
/* What to add to make "minute" plural */
#define L_MPLU "s"
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
See the file dosubst.c for more info. */
#endif /* L_IN_DOSUBST */

View File

@@ -11,7 +11,8 @@
/* */
/* This file is part of REMIND. */
/* This file is Copyright (C) 1993-1998 by Mikko Silvonen. */
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -33,16 +34,8 @@
#define L_MAR "maaliskuu"
#define L_APR "huhtikuu"
#define L_MAY "toukokuu"
#if ISOLATIN1
#define L_JUN "kes\xE4kuu"
#define L_JUL "hein\xE4kuu"
#elif IBMEXTENDED
#define L_JUN "kes\x84kuu"
#define L_JUL "hein\x84kuu"
#else
#define L_JUN "kes{kuu"
#define L_JUL "hein{kuu"
#endif
#define L_JUN "kesäkuu"
#define L_JUL "heinäkuu"
#define L_AUG "elokuu"
#define L_SEP "syyskuu"
#define L_OCT "lokakuu"
@@ -50,13 +43,7 @@
#define L_DEC "joulukuu"
/* Today and tomorrow */
#if ISOLATIN1
#define L_TODAY "t\xE4n\xE4\xE4n"
#elif IBMEXTENDED
#define L_TODAY "t\x84n\x84\x84n"
#else
#define L_TODAY "t{n{{n"
#endif
#define L_TODAY "tänään"
#define L_TOMORROW "huomenna"
/* The default banner */
@@ -66,21 +53,12 @@
#define L_AM " ap."
#define L_PM " ip."
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "sitten"
#define L_FROMNOW "kuluttua"
/* "in %d days' time" */
#if ISOLATIN1
#define L_INXDAYS "%d p\xE4iv\xE4n kuluttua"
#elif IBMEXTENDED
#define L_INXDAYS "%d p\x84iv\x84n kuluttua"
#else
#define L_INXDAYS "%d p{iv{n kuluttua"
#endif
#define L_INXDAYS "%d päivän kuluttua"
/* "on" as in "on date...", but in Finnish it is a case ending;
L_PARTIT is the partitive ending appended to -kuu and -tai */
@@ -90,13 +68,7 @@
/* Pluralizing - this is a problem for many languages and may require
a more drastic fix */
/* The partitive ending of "day" */
#if ISOLATIN1
#define L_PLURAL "\xE4"
#elif IBMEXTENDED
#define L_PLURAL "\x84"
#else
#define L_PLURAL "{"
#endif
#define L_PLURAL "ä"
/* Minutes, hours, at, etc */
#define L_NOW "nyt"
@@ -120,9 +92,8 @@
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
See the file dosubst.c for more info. */
#if ISOLATIN1
#define L_ORDINAL_OVERRIDE switch(d) { \
case 1: plu = ":sen\xE4"; break; \
case 1: plu = ":senä"; break; \
case 2: plu = ":sena"; break; \
default: \
switch(d%10) { \
@@ -130,49 +101,22 @@
case 3: \
case 6: \
case 8: plu = ":ntena"; break; \
default: plu = ":nten\xE4"; break; \
default: plu = ":ntenä"; break; \
} \
}
#elif IBMEXTENDED
#define L_ORDINAL_OVERRIDE switch(d) { \
case 1: plu = ":sen\x84"; break; \
case 2: plu = ":sena"; break; \
default: \
switch(d%10) { \
case 2: \
case 3: \
case 6: \
case 8: plu = ":ntena"; break; \
default: plu = ":nten\x84"; break; \
} \
}
#else
#define L_ORDINAL_OVERRIDE switch(d) { \
case 1: plu = ":sen{"; break; \
case 2: plu = ":sena"; break; \
default: \
switch(d%10) { \
case 2: \
case 3: \
case 6: \
case 8: plu = ":ntena"; break; \
default: plu = ":nten{"; break; \
} \
}
#endif
#define L_A_OVER if (altmode == '*') { sprintf(s, "%s %d. %s %d", DayName[jul%7], d, MonthName[m], y); } else { sprintf(s, "%s%s %d. %s%s %d", DayName[jul%7], L_ON, d, MonthName[m], L_PARTIT, y); }
#define L_C_OVER if (altmode == '*') { sprintf(s, "%s", DayName[jul%7]); } else { sprintf(s, "%s%s", DayName[jul%7], L_ON); }
#define L_A_OVER if (altmode == '*') { sprintf(s, "%s %d. %s %d", DayName[dse%7], d, MonthName[m], y); } else { sprintf(s, "%s%s %d. %s%s %d", DayName[dse%7], L_ON, d, MonthName[m], L_PARTIT, y); }
#define L_C_OVER if (altmode == '*') { sprintf(s, "%s", DayName[dse%7]); } else { sprintf(s, "%s%s", DayName[dse%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_G_OVER if (altmode == '*') { sprintf(s, "%s %d. %s", DayName[dse%7], d, MonthName[m]); } else { sprintf(s, "%s%s %d. %s%s", DayName[dse%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_J_OVER if (altmode == '*') { sprintf(s, "%s %sn %d%s %d", DayName[dse%7], MonthName[m], d, plu, y); } else { sprintf(s, "%s%s %sn %d%s %d", DayName[dse%7], L_ON, MonthName[m], d, plu, y); }
#define L_K_OVER if (altmode == '*') { sprintf(s, "%s %sn %d%s", DayName[dse%7], MonthName[m], d, plu); } else { sprintf(s, "%s%s %sn %d%s", DayName[dse%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 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_U_OVER if (altmode == '*') { sprintf(s, "%s %d%s %s %d", DayName[dse%7], d, plu, MonthName[m], y); } else { sprintf(s, "%s%s %d%s %s%s %d", DayName[dse%7], L_ON, d, plu, MonthName[m], L_PARTIT, y); }
#define L_V_OVER if (altmode == '*') { sprintf(s, "%s %d%s %s", DayName[dse%7], d, plu, MonthName[m]); } else { sprintf(s, "%s%s %d%s %s%s", DayName[dse%7], L_ON, d, plu, MonthName[m], L_PARTIT); }
#define L_1_OVER \
if (tdiff == 0) \
sprintf(s, "%s", L_NOW); \
@@ -192,111 +136,109 @@ else { \
} \
sprintf(s + strlen(s), when); \
}
#endif /* L_IN_DOSUBST */
/* The next ones are used only when MK_GLOBALS is set */
#ifdef MK_GLOBALS
#define L_ERR_OVERRIDE 1
EXTERN char *ErrMsg[] =
{
#if ISOLATIN1
"Ok",
"Puuttuva ']'",
"Puuttuva lainausmerkki",
"Liian monimutkainen lauseke - liikaa operaattoreita",
"Liian monimutkainen lauseke - liikaa operandeja",
"Puuttuva ')'",
"M\xE4\xE4rittelem\xE4t\xF6n funktio",
"Määrittelemätön funktio",
"Virheellinen merkki",
"Kaksipaikkainen operaattori puuttuu",
"Muisti loppui",
"Virheellinen luku",
"Operaattoripino tyhj\xE4 - sis\xE4inen virhe",
"Muuttujapino tyhj\xE4 - sis\xE4inen virhe",
"Operaattoripino tyhjä - sisäinen virhe",
"Muuttujapino tyhjä - sisäinen virhe",
"Tyyppimuunnos ei onnistu",
"Virheellinen tyyppi",
"Liian suuri p\xE4iv\xE4ys",
"Pinovirhe - sis\xE4inen virhe",
"Liian suuri päiväys",
"Pinovirhe - sisäinen virhe",
"Jako nollalla",
"M\xE4\xE4rittelem\xE4t\xF6n funktio",
"Määrittelemätön funktio",
"Odottamaton rivin loppu",
"Odottamaton tiedoston loppu",
"Sy\xF6tt\xF6- tai tulostusvirhe",
"Liian pitk\xE4 rivi",
"Sis\xE4inen virhe",
"Virheellinen p\xE4iv\xE4ys",
"Liian v\xE4h\xE4n argumentteja",
"Syöttö- tai tulostusvirhe",
"Liian pitkä rivi",
"Sisäinen virhe",
"Virheellinen päiväys",
"Liian vähän argumentteja",
"Liian paljon argumentteja",
"Virheellinen aika",
"Liian suuri luku",
"Liian pieni luku",
"Tiedoston avaus ei onnistu",
"Liian monta sis\xE4kk\xE4ist\xE4 INCLUDEa",
"J\xE4sennysvirhe",
"Liian monta sisäkkäistä INCLUDEa",
"Jäsennysvirhe",
"Laukaisuhetken laskenta ei onnistu",
"Liian monta sis\xE4kk\xE4ist\xE4 IF-lausetta",
"Liian monta sisäkkäistä IF-lausetta",
"ELSE ilman IF-lausetta",
"ENDIF ilman IF-lausetta",
"Kaikkia viikonp\xE4ivi\xE4 ei voi j\xE4tt\xE4\xE4 pois",
"Ylim\xE4\xE4r\xE4isi\xE4 merkkej\xE4 rivill\xE4",
"Kaikkia viikonpäiviä ei voi jättää pois",
"Ylimääräisiä merkkejä rivillä",
"POP-OMIT-CONTEXT ilman PUSH-OMIT-CONTEXTia",
"RUN-lauseen k\xE4ytt\xF6 estetty",
"RUN-lauseen käyttö estetty",
"Arvoaluevirhe",
"Virheellinen tunniste",
"Rekursiivinen funktiokutsu havaittu",
"",
"J\xE4rjestelm\xE4muuttujan muuttaminen ei onnistu",
"C-kirjastofunktio ei pysty esitt\xE4m\xE4\xE4n p\xE4iv\xE4yst\xE4 tai aikaa",
"Sis\xE4isen funktion m\xE4\xE4ritelm\xE4\xE4 yritettiin muuttaa",
"Lausekkeessa ei voi olla sis\xE4kk\xE4isi\xE4 funktiom\xE4\xE4ritelmi\xE4",
"P\xE4iv\xE4yksen t\xE4ytyy olla t\xE4ydellinen toistokertoimessa",
"Järjestelmämuuttujan muuttaminen ei onnistu",
"C-kirjastofunktio ei pysty esittämään päiväystä tai aikaa",
"Sisäisen funktion määritelmää yritettiin muuttaa",
"Lausekkeessa ei voi olla sisäkkäisiä funktiomääritelmiä",
"Päiväyksen täytyy olla täydellinen toistokertoimessa",
"Vuosi annettu kahdesti",
"Kuukausi annettu kahdesti",
"P\xE4iv\xE4 annettu kahdesti",
"Päivä annettu kahdesti",
"Tuntematon sana tai merkki",
"OMIT-komennossa on annettava kuukausi ja p\xE4iv\xE4",
"OMIT-komennossa on annettava kuukausi",
"Liian monta osittaista OMIT-komentoa",
"Liian monta t\xE4ydellist\xE4 OMIT-komentoa",
"Liian monta täydellistä OMIT-komentoa",
"Varoitus: PUSH-OMIT-CONTEXT ilman POP-OMIT-CONTEXTia",
"Virhe tiedoston luvussa",
"Pilkku puuttuu",
"Virheellinen juutalainen p\xE4iv\xE4ys",
"IIF vaatii parittoman m\xE4\xE4r\xE4n argumentteja",
"Virheellinen juutalainen päiväys",
"IIF vaatii parittoman määrän argumentteja",
"Varoitus: puuttuva ENDIF",
"Pilkku puuttuu",
"Viikonp\xE4iv\xE4 annettu kahdesti",
"K\xE4yt\xE4 vain yht\xE4 komennoista BEFORE, AFTER ja SKIP",
"Sis\xE4kk\xE4isi\xE4 MSG-, MSF- ja RUN-lauseita ei voi k\xE4ytt\xE4\xE4 lausekkeessa",
"Viikonpäivä annettu kahdesti",
"Käytä vain yhtä komennoista BEFORE, AFTER ja SKIP",
"Sisäkkäisiä MSG-, MSF- ja RUN-lauseita ei voi käyttää lausekkeessa",
"Toistokerroin annettu kahdesti",
"Delta-arvo annettu kahdesti",
"Peruutusarvo annettu kahdesti",
"ONCE-avainsanaa k\xE4ytetty kahdesti. (Hah.)",
"AT-sanan per\xE4st\xE4 puuttuu aika",
"THROUGH/UNTIL-sanaa k\xE4ytetty kahdesti",
"Ep\xE4t\xE4ydellinen p\xE4iv\xE4ys",
"FROM/SCANFROM-sanaa k\xE4ytetty kahdesti",
"ONCE-avainsanaa käytetty kahdesti. (Hah.)",
"AT-sanan perästä puuttuu aika",
"THROUGH/UNTIL-sanaa käytetty kahdesti",
"Epätäydellinen päiväys",
"FROM/SCANFROM-sanaa käytetty kahdesti",
"Muuttuja",
"Arvo",
"*M\xC4\xC4RITTELEM\xC4T\xD6N*",
"Siirryt\xE4\xE4n funktioon",
"*MÄÄRITTELEMÄTÖN*",
"Siirrytään funktioon",
"Poistutaan funktiosta",
"Vanhentunut",
"fork() ep\xE4onnistui - jonomuistutukset eiv\xE4t toimi",
"fork() epäonnistui - jonomuistutukset eivät toimi",
"Tiedoston avaus ei onnistu",
"Virheellinen j\xE4rjestelm\xE4p\xE4iv\xE4ys: vuosi on v\xE4hemm\xE4n kuin %d\n",
"Tuntematon virheenetsint\xE4tarkenne '%c'\n",
"Virheellinen järjestelmäpäiväys: vuosi on vähemmän kuin %d\n",
"Tuntematon virheenetsintätarkenne '%c'\n",
"Tuntematon tarkenne '%c'\n",
"Tuntematon k\xE4ytt\xE4j\xE4 '%s'\n",
"Ryhm\xE4numeron vaihto %d:ksi ei onnistunut\n",
"K\xE4ytt\xE4j\xE4numeron vaihto %d:ksi ei onnistunut\n",
"Muisti ei riit\xE4 ymp\xE4rist\xF6lle\n",
"Tuntematon käyttäjä '%s'\n",
"Ryhmänumeron vaihto %d:ksi ei onnistunut\n",
"Käyttäjänumeron vaihto %d:ksi ei onnistunut\n",
"Muisti ei riitä ympäristölle\n",
"Puuttuva '='-merkki",
"Puuttuva muuttujanimi",
"Puuttuva lauseke",
"P\xE4iv\xE4n asetus %s:ksi ei onnitus\n",
"Päivän asetus %s:ksi ei onnitus\n",
"Remind: tarkenne '-i': %s\n",
"Ei viestej\xE4.",
"%d viesti(\xE4) t\xE4m\xE4n p\xE4iv\xE4n jonossa.\n",
"Ei viestejä.",
"%d viesti(ä) tämän päivän jonossa.\n",
"Numero puuttuu",
"Virheellinen funktio WARN-lausekkeessa",
"Can't convert between time zones",
@@ -304,221 +246,6 @@ EXTERN char *ErrMsg[] =
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
#elif IBMEXTENDED
"Ok",
"Puuttuva ']'",
"Puuttuva lainausmerkki",
"Liian monimutkainen lauseke - liikaa operaattoreita",
"Liian monimutkainen lauseke - liikaa operandeja",
"Puuttuva ')'",
"M\x84\x84rittelem\x84t\x94n funktio",
"Virheellinen merkki",
"Kaksipaikkainen operaattori puuttuu",
"Muisti loppui",
"Virheellinen luku",
"Operaattoripino tyhj\x84 - sis\x84inen virhe",
"Muuttujapino tyhj\x84 - sis\x84inen virhe",
"Tyyppimuunnos ei onnistu",
"Virheellinen tyyppi",
"Liian suuri p\x84iv\x84ys",
"Pinovirhe - sis\x84inen virhe",
"Jako nollalla",
"M\x84\x84rittelem\x84t\x94n funktio",
"Odottamaton rivin loppu",
"Odottamaton tiedoston loppu",
"Sy\x94tt\x94- tai tulostusvirhe",
"Liian pitk\x84 rivi",
"Sis\x84inen virhe",
"Virheellinen p\x84iv\x84ys",
"Liian v\x84h\x84n argumentteja",
"Liian paljon argumentteja",
"Virheellinen aika",
"Liian suuri luku",
"Liian pieni luku",
"Tiedoston avaus ei onnistu",
"Liian monta sis\x84kk\x84ist\x84 INCLUDEa",
"J\x84sennysvirhe",
"Laukaisuhetken laskenta ei onnistu",
"Liian monta sis\x84kk\x84ist\x84 IF-lausetta",
"ELSE ilman IF-lausetta",
"ENDIF ilman IF-lausetta",
"Kaikkia viikonp\x84ivi\x84 ei voi j\x84tt\x84\x84 pois",
"Ylim\x84\x84r\x84isi\x84 merkkej\x84 rivill\x84",
"POP-OMIT-CONTEXT ilman PUSH-OMIT-CONTEXTia",
"RUN-lauseen k\x84ytt\x94 estetty",
"Arvoaluevirhe",
"Virheellinen tunniste",
"Rekursiivinen funktiokutsu havaittu",
"",
"J\x84rjestelm\x84muuttujan muuttaminen ei onnistu",
"C-kirjastofunktio ei pysty esitt\x84m\x84\x84n p\x84iv\x84yst\x84 tai aikaa",
"Sis\x84isen funktion m\x84\x84ritelm\x84\x84 yritettiin muuttaa",
"Lausekkeessa ei voi olla sis\x84kk\x84isi\x84 funktiom\x84\x84ritelmi\x84",
"P\x84iv\x84yksen t\x84ytyy olla t\x84ydellinen toistokertoimessa",
"Vuosi annettu kahdesti",
"Kuukausi annettu kahdesti",
"P\x84iv\x84 annettu kahdesti",
"Tuntematon sana tai merkki",
"OMIT-komennossa on annettava kuukausi ja p\x84iv\x84",
"Liian monta osittaista OMIT-komentoa",
"Liian monta t\x84ydellist\x84 OMIT-komentoa",
"Varoitus: PUSH-OMIT-CONTEXT ilman POP-OMIT-CONTEXTia",
"Virhe tiedoston luvussa",
"Pilkku puuttuu",
"Virheellinen juutalainen p\x84iv\x84ys",
"IIF vaatii parittoman m\x84\x84r\x84n argumentteja",
"Varoitus: puuttuva ENDIF",
"Pilkku puuttuu",
"Viikonp\x84iv\x84 annettu kahdesti",
"K\x84yt\x84 vain yht\x84 komennoista BEFORE, AFTER ja SKIP",
"Sis\x84kk\x84isi\x84 MSG-, MSF- ja RUN-lauseita ei voi k\x84ytt\x84\x84 lausekkeessa",
"Toistokerroin annettu kahdesti",
"Delta-arvo annettu kahdesti",
"Peruutusarvo annettu kahdesti",
"ONCE-avainsanaa k\x84ytetty kahdesti. (Hah.)",
"AT-sanan per\x84st\x84 puuttuu aika",
"THROUGH/UNTIL-sanaa k\x84ytetty kahdesti",
"Ep\x84t\x84ydellinen p\x84iv\x84ys",
"FROM/SCANFROM-sanaa k\x84ytetty kahdesti",
"Muuttuja",
"Arvo",
"*M\x8E\x8ERITTELEM\x8ET\x99N*",
"Siirryt\x84\x84n funktioon",
"Poistutaan funktiosta",
"Vanhentunut",
"fork() ep\x84onnistui - jonomuistutukset eiv\x84t toimi",
"Tiedoston avaus ei onnistu",
"Virheellinen j\x84rjestelm\x84p\x84iv\x84ys: vuosi on v\x84hemm\x84n kuin %d\n",
"Tuntematon virheenetsint\x84tarkenne '%c'\n",
"Tuntematon tarkenne '%c'\n",
"Tuntematon k\x84ytt\x84j\x84 '%s'\n",
"Ryhm\x84numeron vaihto %d:ksi ei onnistunut\n",
"K\x84ytt\x84j\x84numeron vaihto %d:ksi ei onnistunut\n",
"Muisti ei riit\x84 ymp\x84rist\x94lle\n",
"Puuttuva '='-merkki",
"Puuttuva muuttujanimi",
"Puuttuva lauseke",
"P\x84iv\x84n asetus %s:ksi ei onnitus\n",
"Remind: tarkenne '-i': %s\n",
"Ei viestej\x84.",
"%d viesti(\x84) t\x84m\x84n p\x84iv\x84n jonossa.\n",
"Numero puuttuu"
"Virheellinen funktio WARN-lausekkeessa",
"Can't convert between time zones",
"No files matching *.rem",
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
#else
"Ok",
"Puuttuva ']'",
"Puuttuva lainausmerkki",
"Liian monimutkainen lauseke - liikaa operaattoreita",
"Liian monimutkainen lauseke - liikaa operandeja",
"Puuttuva ')'",
"M{{rittelem{t|n funktio",
"Virheellinen merkki",
"Kaksipaikkainen operaattori puuttuu",
"Muisti loppui",
"Virheellinen luku",
"Operaattoripino tyhj{ - sis{inen virhe",
"Muuttujapino tyhj{ - sis{inen virhe",
"Tyyppimuunnos ei onnistu",
"Virheellinen tyyppi",
"Liian suuri p{iv{ys",
"Pinovirhe - sis{inen virhe",
"Jako nollalla",
"M{{rittelem{t|n funktio",
"Odottamaton rivin loppu",
"Odottamaton tiedoston loppu",
"Sy|tt|- tai tulostusvirhe",
"Liian pitk{ rivi",
"Sis{inen virhe",
"Virheellinen p{iv{ys",
"Liian v{h{n argumentteja",
"Liian paljon argumentteja",
"Virheellinen aika",
"Liian suuri luku",
"Liian pieni luku",
"Tiedoston avaus ei onnistu",
"Liian monta sis{kk{ist{ INCLUDEa",
"J{sennysvirhe",
"Laukaisuhetken laskenta ei onnistu",
"Liian monta sis{kk{ist{ IF-lausetta",
"ELSE ilman IF-lausetta",
"ENDIF ilman IF-lausetta",
"Kaikkia viikonp{ivi{ ei voi j{tt{{ pois",
"Ylim{{r{isi{ merkkej{ rivill{",
"POP-OMIT-CONTEXT ilman PUSH-OMIT-CONTEXTia",
"RUN-lauseen k{ytt| estetty",
"Arvoaluevirhe",
"Virheellinen tunniste",
"Rekursiivinen funktiokutsu havaittu",
"",
"J{rjestelm{muuttujan muuttaminen ei onnistu",
"C-kirjastofunktio ei pysty esitt{m{{n p{iv{yst{ tai aikaa",
"Sis{isen funktion m{{ritelm{{ yritettiin muuttaa",
"Lausekkeessa ei voi olla sis{kk{isi{ funktiom{{ritelmi{",
"P{iv{yksen t{ytyy olla t{ydellinen toistokertoimessa",
"Vuosi annettu kahdesti",
"Kuukausi annettu kahdesti",
"P{iv{ annettu kahdesti",
"Tuntematon sana tai merkki",
"OMIT-komennossa on annettava kuukausi ja p{iv{",
"Liian monta osittaista OMIT-komentoa",
"Liian monta t{ydellist{ OMIT-komentoa",
"Varoitus: PUSH-OMIT-CONTEXT ilman POP-OMIT-CONTEXTia",
"Virhe tiedoston luvussa",
"Pilkku puuttuu",
"Virheellinen juutalainen p{iv{ys",
"IIF vaatii parittoman m{{r{n argumentteja",
"Varoitus: puuttuva ENDIF",
"Pilkku puuttuu",
"Viikonp{iv{ annettu kahdesti",
"K{yt{ vain yht{ komennoista BEFORE, AFTER ja SKIP",
"Sis{kk{isi{ MSG-, MSF- ja RUN-lauseita ei voi k{ytt{{ lausekkeessa",
"Toistokerroin annettu kahdesti",
"Delta-arvo annettu kahdesti",
"Peruutusarvo annettu kahdesti",
"ONCE-avainsanaa k{ytetty kahdesti. (Hah.)",
"AT-sanan per{st{ puuttuu aika",
"THROUGH/UNTIL-sanaa k{ytetty kahdesti",
"Ep{t{ydellinen p{iv{ys",
"FROM/SCANFROM-sanaa k{ytetty kahdesti",
"Muuttuja",
"Arvo",
"*M[[RITTELEM[T\\N*",
"Siirryt{{n funktioon",
"Poistutaan funktiosta",
"Vanhentunut",
"fork() ep{onnistui - jonomuistutukset eiv{t toimi",
"Tiedoston avaus ei onnistu",
"Virheellinen j{rjestelm{p{iv{ys: vuosi on v{hemm{n kuin %d\n",
"Tuntematon virheenetsint{tarkenne '%c'\n",
"Tuntematon tarkenne '%c'\n",
"Tuntematon k{ytt{j{ '%s'\n",
"Ryhm{numeron vaihto %d:ksi ei onnistunut\n",
"K{ytt{j{numeron vaihto %d:ksi ei onnistunut\n",
"Muisti ei riit{ ymp{rist|lle\n",
"Puuttuva '='-merkki",
"Puuttuva muuttujanimi",
"Puuttuva lauseke",
"P{iv{n asetus %s:ksi ei onnitus\n",
"Remind: tarkenne '-i': %s\n",
"Ei viestej{.",
"%d viesti({) t{m{n p{iv{n jonossa.\n",
"Numero puuttuu",
"Virheellinen funktio WARN-lausekkeessa",
"Can't convert between time zones",
"No files matching *.rem",
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
#endif
};
#endif /* MK_GLOBALS */
@@ -527,97 +254,37 @@ EXTERN char *ErrMsg[] =
#define L_USAGE_OVERRIDE 1
void Usage(void)
{
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
#ifdef BETA
fprintf(ErrFp, ">>>> BETAVERSIO <<<<\n");
#endif
#if ISOLATIN1
fprintf(ErrFp, "K\xE4ytt\xF6: remind [tarkenteet] tiedosto [p\xE4iv\xE4ys] [aika] [*toisto]\n");
fprintf(ErrFp, "Käyttö: remind [tarkenteet] tiedosto [päiväys] [aika] [*toisto]\n");
fprintf(ErrFp, "Tarkenteet:\n");
fprintf(ErrFp, " -n Tulosta viestien seuraavat esiintymiskerrat yksink. muodossa\n");
fprintf(ErrFp, " -r Est\xE4 RUN-lauseiden k\xE4ytt\xF6\n");
fprintf(ErrFp, " -r Estä RUN-lauseiden käyttö\n");
fprintf(ErrFp, " -c[n] Tulosta n:n kuukauden kalenteri (oletus 1)\n");
fprintf(ErrFp, " -c+[n] Tulosta n:n viikon kalenteri (oletus 1)\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Aseta kalenterin leveys, tasaus ja v\xE4lit\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Aseta kalenterin leveys, tasaus ja välit\n");
fprintf(ErrFp, " -s[+][n] Tulosta n:n kuukauden (viikon) 'yksink. kalenteri' (oletus 1)\n");
fprintf(ErrFp, " -p[n] Kuten -s, mutta tulosta rem2ps:lle sopivassa muodossa\n");
fprintf(ErrFp, " -v Laveat tulostukset\n");
fprintf(ErrFp, " -o \xC4l\xE4 noudata ONCE-lauseita\n");
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta v\xE4litt\xE4m\xE4tt\xE4\n");
fprintf(ErrFp, " -o Älä noudata ONCE-lauseita\n");
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta välittämättä\n");
fprintf(ErrFp, " -h Suppeat tulostukset\n");
#ifdef HAVE_QUEUED
fprintf(ErrFp, " -a \xC4l\xE4 laukaise viestej\xE4 heti - lis\xE4\xE4 ne jonoon\n");
fprintf(ErrFp, " -q \xC4l\xE4 lis\xE4\xE4 viestej\xE4 jonoon\n");
fprintf(ErrFp, " -a Älä laukaise viestejä heti - lisää ne jonoon\n");
fprintf(ErrFp, " -q Älä lisää viestejä jonoon\n");
fprintf(ErrFp, " -f Laukaise viestit, pysy etualalla\n");
fprintf(ErrFp, " -z[n] K\xE4ynnisty demonina, her\xE4tys n:n (5:n) minuutin v\xE4lein\n");
fprintf(ErrFp, " -z[n] Käynnisty demonina, herätys n:n (5:n) minuutin välein\n");
#endif
fprintf(ErrFp, " -d... Virheenetsint\xE4: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
fprintf(ErrFp, " -d... Virheenetsintä: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
fprintf(ErrFp, " -e Ohjaa virhetulostus stdout-vuohon\n");
fprintf(ErrFp, " -b[n] Ajan ilmaisu: 0=ap/ip, 1=24 tuntia, 2=ei aikoja\n");
fprintf(ErrFp, " -x[n] SATISFY-lauseen toistoraja (oletus 150)\n");
fprintf(ErrFp, " -x[n] SATISFY-lauseen toistoraja (oletus 1000)\n");
fprintf(ErrFp, " -kcmd Suorita 'cmd' MSG-tyyppisille viesteille\n");
fprintf(ErrFp, " -g[ddd] Lajittele viestit p\xE4iv\xE4yksen, ajan ja t\xE4rkeyden mukaan\n");
fprintf(ErrFp, " -ivar=val Alusta muuttuja var arvolla val ja s\xE4ilyt\xE4 var\n");
fprintf(ErrFp, " -m Aloita kalenteri maanantaista eik\xE4 sunnuntaista\n");
fprintf(ErrFp, " -g[ddd] Lajittele viestit päiväyksen, ajan ja tärkeyden mukaan\n");
fprintf(ErrFp, " -ivar=val Alusta muuttuja var arvolla val ja säilytä var\n");
fprintf(ErrFp, " -m Aloita kalenteri maanantaista eikä sunnuntaista\n");
exit(1);
#elif IBMEXTENDED
fprintf(ErrFp, "K\x84ytt\x94: remind [tarkenteet] tiedosto [p\x84iv\x84ys] [aika] [*toisto]\n");
fprintf(ErrFp, "Tarkenteet:\n");
fprintf(ErrFp, " -n Tulosta viestien seuraavat esiintymiskerrat yksink. muodossa\n");
fprintf(ErrFp, " -r Est\x84 RUN-lauseiden k\x84ytt\x94\n");
fprintf(ErrFp, " -c[n] Tulosta n:n kuukauden kalenteri (oletus 1)\n");
fprintf(ErrFp, " -c+[n] Tulosta n:n viikon kalenteri (oletus 1)\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Aseta kalenterin leveys, tasaus ja v\x84lit\n");
fprintf(ErrFp, " -s[+][n] Tulosta n:n kuukauden (viikon) 'yksink. kalenteri' (oletus 1)\n");
fprintf(ErrFp, " -p[n] Kuten -s, mutta tulosta rem2ps:lle sopivassa muodossa\n");
fprintf(ErrFp, " -v Laveat tulostukset\n");
fprintf(ErrFp, " -o \x8El\x84 noudata ONCE-lauseita\n");
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta v\x84litt\x84m\x84tt\x84\n");
fprintf(ErrFp, " -h Suppeat tulostukset\n");
#ifdef HAVE_QUEUED
fprintf(ErrFp, " -a \x8El\x84 laukaise viestej\x84 heti - lis\x84\x84 ne jonoon\n");
fprintf(ErrFp, " -q \x8El\x84 lis\x84\x84 viestej\x84 jonoon\n");
fprintf(ErrFp, " -f Laukaise viestit, pysy etualalla\n");
fprintf(ErrFp, " -z[n] K\x84ynnisty demonina, her\x84tys n:n (5:n) minuutin v\x84lein\n");
#endif
fprintf(ErrFp, " -d... Virheenetsint\x84: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
fprintf(ErrFp, " -e Ohjaa virhetulostus stdout-vuohon\n");
fprintf(ErrFp, " -b[n] Ajan ilmaisu: 0=ap/ip, 1=24 tuntia, 2=ei aikoja\n");
fprintf(ErrFp, " -x[n] SATISFY-lauseen toistoraja (oletus 150)\n");
fprintf(ErrFp, " -kcmd Suorita 'cmd' MSG-tyyppisille viesteille\n");
fprintf(ErrFp, " -g[ddd] Lajittele viestit p\x84iv\x84yksen, ajan ja t\x84rkeyden mukaan\n");
fprintf(ErrFp, " -ivar=val Alusta muuttuja var arvolla val ja s\x84ilyt\x84 var\n");
fprintf(ErrFp, " -m Aloita kalenteri maanantaista eik\x84 sunnuntaista\n");
exit(1);
#else
fprintf(ErrFp, "K{ytt|: remind [tarkenteet] tiedosto [p{iv{ys] [aika] [*toisto]\n");
fprintf(ErrFp, "Tarkenteet:\n");
fprintf(ErrFp, " -n Tulosta viestien seuraavat esiintymiskerrat yksink. muodossa\n");
fprintf(ErrFp, " -r Est{ RUN-lauseiden k{ytt|\n");
fprintf(ErrFp, " -c[n] Tulosta n:n kuukauden kalenteri (oletus 1)\n");
fprintf(ErrFp, " -c+[n] Tulosta n:n viikon kalenteri (oletus 1)\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Aseta kalenterin leveys, tasaus ja v{lit\n");
fprintf(ErrFp, " -s[+][n] Tulosta n:n kuukauden (viikon) 'yksink. kalenteri' (oletus 1)\n");
fprintf(ErrFp, " -p[n] Kuten -s, mutta tulosta rem2ps:lle sopivassa muodossa\n");
fprintf(ErrFp, " -v Laveat tulostukset\n");
fprintf(ErrFp, " -o [l{ noudata ONCE-lauseita\n");
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta v{litt{m{tt{\n");
fprintf(ErrFp, " -h Suppeat tulostukset\n");
#ifdef HAVE_QUEUED
fprintf(ErrFp, " -a [l{ laukaise viestej{ heti - lis{{ ne jonoon\n");
fprintf(ErrFp, " -q [l{ lis{{ viestej{ jonoon\n");
fprintf(ErrFp, " -f Laukaise viestit, pysy etualalla\n");
fprintf(ErrFp, " -z[n] K{ynnisty demonina, her{tys n:n (5:n) minuutin v{lein\n");
#endif
fprintf(ErrFp, " -d... Virheenetsint{: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
fprintf(ErrFp, " -e Ohjaa virhetulostus stdout-vuohon\n");
fprintf(ErrFp, " -b[n] Ajan ilmaisu: 0=ap/ip, 1=24 tuntia, 2=ei aikoja\n");
fprintf(ErrFp, " -x[n] SATISFY-lauseen toistoraja (oletus 150)\n");
fprintf(ErrFp, " -kcmd Suorita 'cmd' MSG-tyyppisille viesteille\n");
fprintf(ErrFp, " -g[ddd] Lajittele viestit p{iv{yksen, ajan ja t{rkeyden mukaan\n");
fprintf(ErrFp, " -ivar=val Alusta muuttuja var arvolla val ja s{ilyt{ var\n");
fprintf(ErrFp, " -m Aloita kalenteri maanantaista eik{ sunnuntaista\n");
exit(1);
#endif
}
#endif /* L_IN_INIT */

View File

@@ -8,9 +8,10 @@
/* */
/* This file is part of REMIND. */
/* */
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
/* This file is Copyright (C) 1993 by Laurent Duperval and */
/* Dianne Skoll. */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -28,29 +29,18 @@
/* Month names */
#define L_JAN "janvier"
#if ISOLATIN1
#define L_FEB "f\351vrier"
#else
#define L_FEB "fevrier"
#endif
#define L_FEB "février"
#define L_MAR "mars"
#define L_APR "avril"
#define L_MAY "mai"
#define L_JUN "juin"
#define L_JUL "juillet"
#if ISOLATIN1
#define L_AUG "ao\373t"
#else
#define L_AUG "aout"
#endif
#define L_AUG "août"
#define L_SEP "septembre"
#define L_OCT "octobre"
#define L_NOV "novembre"
#if ISOLATIN1
#define L_DEC "d\351cembre"
#else
#define L_DEC "decembre"
#endif
#define L_DEC "décembre"
/* Today and tomorrow */
#define L_TODAY "aujourd'hui"
#define L_TOMORROW "demain"
@@ -62,9 +52,6 @@
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "il y a"
#define L_FROMNOW "dans"
@@ -81,22 +68,14 @@
/* Minutes, hours, at, etc */
#define L_NOW "maintenant"
#if ISOLATIN1
#define L_AT "\340"
#else
#define L_AT "a"
#endif
#define L_AT "à"
#define L_MINUTE "minute"
#define L_HOUR "heure"
#define L_IS "est"
#if ISOLATIN1
#define L_WAS "\351tait"
#else
#define L_WAS "etait"
#endif
#define L_WAS "était"
#define L_AND "et"
/* What to add to make "hour" plural */
#define L_HPLU "s"
#define L_HPLU "s"
/* What to add to make "minute" plural */
#define L_MPLU "s"
@@ -128,229 +107,119 @@ else if (tdiff < 0) { \
sprintf(s, "dans %d heure%s et %d minute%s", hdiff, hplu, mdiff, mplu); \
}
#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_J_OVER if (altmode == '*') { sprintf(s, "%s, %d%s %s, %d", DayName[dse%7], d, plu, MonthName[m], y); } else { sprintf(s, "%s %s, %d%s %s, %d", L_ON, DayName[dse%7], d, plu, MonthName[m], y); }
#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 */
#define L_K_OVER if (altmode == '*') { sprintf(s, "%s, %d%s %s", DayName[dse%7], d, plu, MonthName[m]); } else { sprintf(s, "%s %s, %d%s %s", L_ON, DayName[dse%7], d, plu, MonthName[m]); }
/* The next ones are used only when MK_GLOBALS is set */
#ifdef MK_GLOBALS
#define L_ERR_OVERRIDE 1
EXTERN char *ErrMsg[] =
{
#if ISOLATIN1
"Ok",
"']' manquant",
"Apostrophe manquant",
"Expression trop complexe - trop d'op\351rateurs",
"Expression trop complexe - trop d'op\351randes",
"Expression trop complexe - trop d'opérateurs",
"Expression trop complexe - trop d'opérandes",
"')' manquante",
"Fonction non-d\351finie",
"Caract\350re ill\351gal",
"Op\351rateur binaire attendu",
"Manque de m\351moire",
"Nombre mal form\351",
"Erreur interne - 'underflow' de la pile d'op\351rateurs",
"Fonction non-définie",
"Caractère illégal",
"Opérateur binaire attendu",
"Manque de mémoire",
"Nombre mal formé",
"Erreur interne - 'underflow' de la pile d'opérateurs",
"Erreur interne - 'underflow' de la pile de variables",
"Impossible de convertir",
"Types non-\351quivalents",
"D\351bordement de date",
"Types non-équivalents",
"Débordement de date",
"Erreur interne - erreur de pile",
"Division par z\351ro",
"Variable non d\351finie",
"Division par zéro",
"Variable non définie",
"Fin de ligne non attendue",
"Fin de fichier non attendue",
"Erreur I/O",
"Ligne trop longue",
"Erreur interne",
"Mauvaise date sp\351cifi\351e",
"Mauvaise date spécifiée",
"Pas assez d'arguments",
"Trop d'arguments",
"Heure mal form\351e",
"Nombre trop \351lev\351",
"Heure mal formée",
"Nombre trop élevé",
"Nombre trop bas",
"Impossible d'ouvrir le fichier",
"Trop d'INCLUDE imbriqu\351s",
"Trop d'INCLUDE imbriqués",
"Erreur d'analyse",
"Impossible de calculer le d\351clenchement",
"Trop de IF imbriqu\351s",
"Impossible de calculer le déclenchement",
"Trop de IF imbriqués",
"ELSE sans IF correspondant",
"ENDIF sans IF correspondant",
"Impossible d'omettre (OMIT) tous les jours",
"El\351ment(s) \351tranger(s) sur la ligne",
"Elément(s) étranger(s) sur la ligne",
"POP-OMIT-CONTEXT sans PUSH-OMIT-CONTEXT correspondant",
"RUN d\351activ\351",
"RUN déactivé",
"Erreur de domaine",
"Identificateur invalide",
"Appel r\351cursif d\351tect\351",
"Appel récursif détecté",
"",
"Impossible de modifier une variable syst\350me",
"Fonction de la librairie C ne peut repr\351senter la date/l'heure",
"Tentative de red\351finition d'une fonction intrins\350que",
"Impossible d'imbriquer une d\351finition de fonction dans une expression",
"Pour utiliser le facteur de r\351p\351tition la date doit \352tre sp\351cifi\351e au complet",
"Ann\351e sp\351cifi\351e deux fois",
"Mois sp\351cifi\351 deux fois",
"Jour sp\351cifi\351 deux fois",
"El\351ment inconnu",
"Mois et jour doivent \352tre sp\351cifi\351s dans commande OMIT",
"Impossible de modifier une variable système",
"Fonction de la librairie C ne peut représenter la date/l'heure",
"Tentative de redéfinition d'une fonction intrinsèque",
"Impossible d'imbriquer une définition de fonction dans une expression",
"Pour utiliser le facteur de répétition la date doit être spécifiée au complet",
"Année spécifiée deux fois",
"Mois spécifié deux fois",
"Jour spécifié deux fois",
"Elément inconnu",
"Mois et jour doivent être spécifiés dans commande OMIT",
"Trop de OMITs partiels",
"Trop de OMITs complets",
"Attention: PUSH-OMIT-CONTEXT sans POP-OMIT-CONTEXT correspondant",
"Erreur \340 la lecture du fichier",
"Erreur à la lecture du fichier",
"Fin de ligne attendue",
"Date h\351breuse invalide",
"Date hébreuse invalide",
"IIF demande nombre d'arguments impair",
"Attention: ENDIF manquant",
"Virgule attendue",
"Jour de la semaine sp\351cifi\351 deux fois",
"Jour de la semaine spécifié deux fois",
"Utiliser un seul parmi BEFORE, AFTER ou SKIP",
"Impossible d'imbriquer MSG, MSF, RUN, etc. dans une expression",
"Valeur de r\351p\351tition sp\351cifi\351e deux fois",
"Valeur delta sp\351cifi\351e deux fois",
"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 THROUGH/UNTIL utilis\351 deux fois",
"Sp\351cification de date incompl\350te",
"Mot-cl\351 FROM/SCANFROM utilis\351 deux fois",
"Valeur de répétition spécifiée deux fois",
"Valeur delta spécifiée deux fois",
"Valeur de retour spécifiée deux fois",
"Mot-clé ONCE utilisé deux fois. (Hah.)",
"Heure attendue après AT",
"Mot-clé THROUGH/UNTIL utilisé deux fois",
"Spécification de date incomplète",
"Mot-clé FROM/SCANFROM utilisé deux fois",
"Variable",
"Valeur",
"*NON-DEFINI*",
"Entr\351e dans UserFN",
"Entrée dans UserFN",
"Sortie de UserFN",
"Expir\351",
"fork() \351chou\351 - impossible de faire les appels en queue",
"Impossible d'acc\351der au fichier",
"Date syst\350me ill\351gale: Ann\351e est inf\351rieure \340 %d\n",
"Option de d\351verminage inconnue '%c'\n",
"Expiré",
"fork() échoué - impossible de faire les appels en queue",
"Impossible d'accéder au fichier",
"Date système illégale: Année est inférieure à %d\n",
"Option de déverminage inconnue '%c'\n",
"Option inconnue '%c'\n",
"Usager inconnu '%s'\n",
"Impossible de changer gid pour %d\n",
"Impossible de changer uid pour %d\n",
"Manque de m\351moire pour environnement\n",
"Manque de mémoire pour environnement\n",
"Signe '=' manquant",
"Nom de variable absent",
"Expression absente",
"Impossible de changer la date d'acc\350s de %s\n",
"Impossible de changer la date d'accès de %s\n",
"Remind: '-i' option: %s\n",
"Pas de rappels.",
"%d rappel(s) en file pour aujourd'hui.\n",
"Nombre attendu",
"Fonction ill\351gale apr\350s WARN",
"Fonction illégale après 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",
"Apostrophe manquant",
"Expression trop complexe - trop d'operateurs",
"Expression trop complexe - trop d'operandes",
"')' manquante",
"Fonction non-definie",
"Caractere illegal",
"Operateur binaire attendu",
"Manque de memoire",
"Nombre mal forme",
"Erreur interne - 'underflow' de la pile d'operateurs",
"Erreur interne - 'underflow' de la pile de variables",
"Impossible de convertir",
"Types non-equivalents",
"Debordement de date",
"Erreur interne - erreur de pile",
"Division par zero",
"Variable non definie",
"Fin de ligne non attendue",
"Fin de fichier non attendue",
"Erreur I/O",
"Ligne trop longue",
"Erreur interne",
"Mauvaise date specifiee",
"Pas assez d'arguments",
"Trop d'arguments",
"Heure mal formee",
"Nombre trop eleve",
"Nombre trop bas",
"Impossible d'ouvrir le fichier",
"Trop d'INCLUDE imbriques",
"erreur d'analyse",
"Impossible de calculer le declenchement",
"Trop de IF imbriques",
"ELSE sans IF correspondant",
"ENDIF sans IF correspondant",
"Impossible d'omettre (OMIT) tous les jours",
"Element(s) etranger(s) sur la ligne",
"POP-OMIT-CONTEXT sans PUSH-OMIT-CONTEXT correspondant",
"RUN desactive",
"Erreur de domaine",
"Identificateur invalide",
"Appel recursif detecte",
"",
"Impossible de modifier une variable systeme",
"Fonction de la librairie C ne peut representer la date/l'heure",
"Tentative de redefinition d'une fonction intrinseque",
"Impossible d'imbriquer une definition de fonction dans une expression",
"Pour utiliser le facteur de repetition la date doit etre specifiee au complet",
"Annee specifiee deux fois",
"Mois specifie deux fois",
"Jour specifie deux fois",
"Element inconnu",
"Mois et jour doivent etre specifies dans commande OMIT",
"Trop de OMITs partiels",
"Trop de OMITs complets",
"Attention: PUSH-OMIT-CONTEXT sans POP-OMIT-CONTEXT correspondant",
"Erreur a la lecture du fichier",
"Fin de ligne attendue",
"Date hebreuse invalide",
"IIF demande nombre d'arguments impair",
"Attention: ENDIF manquant",
"Virgule attendue",
"Jour de la semaine specifie deux fois",
"Utiliser un seul parmi BEFORE, AFTER ou SKIP",
"Impossible d'imbriquer MSG, MSF, RUN, etc. dans une expression",
"Valeur de repetition specifiee deux fois",
"Valeur delta specifiee deux fois",
"Valeur de retour specifiee deux fois",
"Mot-cle ONCE utilise deux fois. (Hah.)",
"Heure attendue apres AT",
"Mot-cle THROUGH/UNTIL utilise deux fois",
"Specification de date incomplete",
"Mot-cle FROM/SCANFROM utilise deux fois",
"Variable",
"Valeur",
"*NON-DEFINI*",
"Entree dans UserFN",
"Sortie de UserFN",
"Expire",
"fork() echoue - impossible de faire les appels en queue",
"Impossible d'acceder au fichier",
"Date systeme illegale: Annee est inferieure a %d\n",
"Option de deverminage inconnue '%c'\n",
"Option inconnue '%c'\n",
"Usager inconnu '%s'\n",
"Impossible de changer gid pour %d\n",
"Impossible de changer uid pour %d\n",
"Manque de memoire pour environnement\n",
"Signe '=' manquant",
"Nom de variable absent",
"Expression absente",
"Impossible de changer la date d'acces de %s\n",
"Remind: '-i' option: %s\n",
"Pas de rappels.",
"%d rappel(s) en file pour aujourd'hui.\n",
"Nombre attendu",
"Fonction illegale apres WARN",
"Can't convert between time zones",
"No files matching *.rem",
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
#endif /* ISOLATIN1 */
};
#endif /* MK_GLOBALS */
@@ -359,67 +228,37 @@ EXTERN char *ErrMsg[] =
#define L_USAGE_OVERRIDE 1
void Usage(void)
{
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
#ifdef BETA
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
#endif
#if ISOLATIN1
fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [heure] [*r\351p\351tition]\n");
fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [heure] [*répétition]\n");
fprintf(ErrFp, "Options:\n");
fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
fprintf(ErrFp, " -r D\351sactiver les instructions RUN\n");
fprintf(ErrFp, " -c[n] Produire un calendrier pour n (d\351faut 1) mois\n");
fprintf(ErrFp, " -c+[n] Produire un calendrier pour n (d\351faut 1) semaines\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Sp\351cifier largeur, remplissage et espacement du calendrier\n");
fprintf(ErrFp, " -r Désactiver les instructions RUN\n");
fprintf(ErrFp, " -c[n] Produire un calendrier pour n (défaut 1) mois\n");
fprintf(ErrFp, " -c+[n] Produire un calendrier pour n (défaut 1) semaines\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Spécifier largeur, remplissage et espacement du calendrier\n");
fprintf(ErrFp, " -s[+][n] Produire un 'calendrier simple' pour n (1) mois (semaines)\n");
fprintf(ErrFp, " -p[n] Comme -s, mais avec entr\351e compatible avec rem2ps\n");
fprintf(ErrFp, " -p[n] Comme -s, mais avec entrée compatible avec rem2ps\n");
fprintf(ErrFp, " -v Mode verbeux\n");
fprintf(ErrFp, " -o Ignorer instructions ONCE\n");
fprintf(ErrFp, " -t D\351clencher tous les rappels peu importe le delta\n");
fprintf(ErrFp, " -t Déclencher tous les rappels peu importe le delta\n");
fprintf(ErrFp, " -h Mode silencieux\n");
#ifdef HAVE_QUEUED
fprintf(ErrFp, " -a Ne pas d\351clencher les rappels minut\351s imm\351diatement - les mettre en file\n");
fprintf(ErrFp, " -q Ne pas mettre les rappels minut\351s en file\n");
fprintf(ErrFp, " -f D\351clencher les rappels minut\351s imm\351diatement en restant en avant-plan\n");
fprintf(ErrFp, " -z[n] Entrer en mode 'daemon', r\351veil chaque n (5) minutes\n");
fprintf(ErrFp, " -a Ne pas déclencher les rappels minutés immédiatement - les mettre en file\n");
fprintf(ErrFp, " -q Ne pas mettre les rappels minutés en file\n");
fprintf(ErrFp, " -f Déclencher les rappels minutés immédiatement en restant en avant-plan\n");
fprintf(ErrFp, " -z[n] Entrer en mode 'daemon', réveil chaque n (5) minutes\n");
#endif
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
fprintf(ErrFp, " -e Envoyer les messages de stderr \340 stdout\n");
fprintf(ErrFp, " -e Envoyer les messages de stderr à stdout\n");
fprintf(ErrFp, " -b[n] Formats de l'heure pour le calendrier: 0=am/pm, 1=24hr, 2=aucun\n");
fprintf(ErrFp, " -x[n] Limite d'it\351rations pour la clause SATISFY (def=150)\n");
fprintf(ErrFp, " -kcmd Ex\351cuter 'cmd' pour les rappels de type MSG\n");
fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorit\351 avant d'\351mettre\n");
fprintf(ErrFp, " -ivar=val Initialiser var \340 val et conserver var\n");
fprintf(ErrFp, " -m Commencer le calendrier avec lundi plut\364t que dimanche\n");
#else /* ISOLATIN1 */
fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [heure] [*repetition]\n");
fprintf(ErrFp, "Options:\n");
fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
fprintf(ErrFp, " -r Desactiver les instructions RUN\n");
fprintf(ErrFp, " -c[n] Produire un calendrier pour n (defaut 1) mois\n");
fprintf(ErrFp, " -c+[n] Produire un calendrier pour n (defaut 1) semaines\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Specifier largeur, remplissage et espacement du calendrier\n");
fprintf(ErrFp, " -s[+][n] Produire un 'calendrier simple' pour n (1) mois (semaines)\n");
fprintf(ErrFp, " -p[n] Comme -s, mais avec entree compatible avec rem2ps\n");
fprintf(ErrFp, " -v Mode verbeux\n");
fprintf(ErrFp, " -o Ignorer instructions ONCE\n");
fprintf(ErrFp, " -t Declencher tous les rappels peu importe le delta\n");
fprintf(ErrFp, " -h Mode silencieux\n");
#ifdef HAVE_QUEUED
fprintf(ErrFp, " -a Ne pas declencher les rappels minutes immediatement - les mettre en file\n");
fprintf(ErrFp, " -q Ne pas mettre les rappels minutes en file\n");
fprintf(ErrFp, " -f Declencher les rappels minutes immediatement en restant en avant-plan\n");
fprintf(ErrFp, " -z[n] Entrer en mode 'daemon', reveil chaque n (5) minutes\n");
#endif
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
fprintf(ErrFp, " -e Envoyer les messages de stderr a stdout\n");
fprintf(ErrFp, " -b[n] Formats de l'heure pour le calendrier: 0=am/pm, 1=24hr, 2=aucun\n");
fprintf(ErrFp, " -x[n] Limite d'iterations pour la clause SATISFY (def=150)\n");
fprintf(ErrFp, " -kcmd Executer 'cmd' pour les rappels de type MSG\n");
fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorite avant d'emettre\n");
fprintf(ErrFp, " -ivar=val Initialiser var a val et conserver var\n");
fprintf(ErrFp, " -m Commencer le calendrier avec lundi plutot que dimanche\n");
#endif /* ISOLATIN1 */
fprintf(ErrFp, " -x[n] Limite d'itérations pour la clause SATISFY (def=1000)\n");
fprintf(ErrFp, " -kcmd Exécuter 'cmd' pour les rappels de type MSG\n");
fprintf(ErrFp, " -g[ddd] Trier les rappels par date, heure et priorité avant d'émettre\n");
fprintf(ErrFp, " -ivar=val Initialiser var à val et conserver var\n");
fprintf(ErrFp, " -m Commencer le calendrier avec lundi plutôt que dimanche\n");
exit(1);
}
#endif /* L_IN_INIT */

View File

@@ -9,7 +9,8 @@
/* I don't speak German. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -28,11 +29,7 @@
/* Month names */
#define L_JAN "Januar"
#define L_FEB "Februar"
#if ISOLATIN1
# define L_MAR "M\344rz"
#else
# define L_MAR "Maerz"
#endif
#define L_MAR "März"
#define L_APR "April"
#define L_MAY "Mai"
#define L_JUN "Juni"
@@ -48,19 +45,12 @@
#define L_TOMORROW "morgen"
/* The default banner */
#if ISOLATIN1
# define L_BANNER "Termine f\374r %w, den %d. %m %y%o:"
#else
# define L_BANNER "Termine fuer %w, den %d. %m %y%o:"
#endif
#define L_BANNER "Termine für %w, den %d. %m %y%o:"
/* "am" and "pm" */
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "vorher"
#define L_FROMNOW "von heute"
@@ -92,9 +82,7 @@
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 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_A_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s %d", DayName[dse%7], d, MonthName[m], y); } else { sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[dse%7], d, MonthName[m], y); }
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s", DayName[dse%7], d, MonthName[m]); } else { sprintf(s, "%s %s, den %d. %s", L_ON, DayName[dse%7], d, MonthName[m]); }
#define L_U_OVER L_A_OVER
#define L_V_OVER L_G_OVER
#endif /* L_IN_DOSUBST */

View File

@@ -5,8 +5,9 @@
/* Support for the Icelandic language. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Translated by Björn Davíðsson (bjossi@snerpa.is) */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* Translated by Björn Davíðsson (bjossi@snerpa.is) */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -15,59 +16,56 @@
/* Day names */
#define L_SUNDAY "sunnudagur"
#define L_MONDAY "mánudagur"
#define L_TUESDAY "þriðjudagur"
#define L_WEDNESDAY "miðvikudagur"
#define L_MONDAY "mánudagur"
#define L_TUESDAY "þriðjudagur"
#define L_WEDNESDAY "miðvikudagur"
#define L_THURSDAY "fimmtudagur"
#define L_FRIDAY "föstudagur"
#define L_FRIDAY "föstudagur"
#define L_SATURDAY "laugardagur"
/* Month names */
#define L_JAN "janúar"
#define L_FEB "febrúar"
#define L_JAN "janúar"
#define L_FEB "febrúar"
#define L_MAR "mars"
#define L_APR "apríl"
#define L_MAY "maí"
#define L_JUN "júní"
#define L_JUL "júlí"
#define L_AUG "ágúst"
#define L_APR "apríl"
#define L_MAY "maí"
#define L_JUN "júní"
#define L_JUL "júlí"
#define L_AUG "ágúst"
#define L_SEP "september"
#define L_OCT "október"
#define L_NOV "nóvember"
#define L_OCT "október"
#define L_NOV "nóvember"
#define L_DEC "desember"
/* Today and tomorrow */
#define L_TODAY "í dag"
#define L_TOMORROW "á morgun"
#define L_TODAY "í dag"
#define L_TOMORROW "á morgun"
/* The default banner */
#define L_BANNER "Minnisatriði: %w, %d%s %m, %y%o:"
#define L_BANNER "Minnisatriði: %w, %d%s %m, %y%o:"
/* "am" and "pm" */
#define L_AM "fh"
#define L_PM "eh"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "síðan"
#define L_FROMNOW "frá því nú"
#define L_AGO "síðan"
#define L_FROMNOW "frá því nú"
/* "in %d days' time" */
#define L_INXDAYS "eftir %d daga"
/* "on" as in "on date..." */
#define L_ON "þann"
#define L_ON "þann"
/* Pluralizing - this is a problem for many languages and may require
a more drastic fix */
#define L_PLURAL "a"
/* Minutes, hours, at, etc */
#define L_NOW "núna"
#define L_NOW "núna"
#define L_AT "kl."
#define L_MINUTE "mínútu"
#define L_MINUTE "mínútu"
#define L_HOUR "klukkustund"
#define L_IS "er"
#define L_WAS "var"
@@ -79,5 +77,3 @@
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
See the file dosubst.c for more info. */
#endif /* L_IN_DOSUBST */

View File

@@ -7,7 +7,8 @@
/* This file is part of REMIND. */
/* It is Copyright (C) 1996 by Valerio Aimale */
/* */
/* Remind is copyright (C) 1992-2021 by Dianne Skoll */
/* Remind is copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -15,23 +16,13 @@
#define L_LANGNAME "Italian"
/* Day names */
#if ISOLATIN1
#define L_SUNDAY "Domenica"
#define L_MONDAY "Luned\354"
#define L_TUESDAY "Marted\354"
#define L_WEDNESDAY "Mercoled\354"
#define L_THURSDAY "Gioved\354"
#define L_FRIDAY "Venerd\354"
#define L_MONDAY "Lunedí"
#define L_TUESDAY "Martedí"
#define L_WEDNESDAY "Mercoledí"
#define L_THURSDAY "Giovedí"
#define L_FRIDAY "Venerdí"
#define L_SATURDAY "Sabato"
#else /* ISOLATIN1 */
#define L_SUNDAY "Domenica"
#define L_MONDAY "Lunedi`"
#define L_TUESDAY "Martedi`"
#define L_WEDNESDAY "Mercoledi`"
#define L_THURSDAY "Giovedi`"
#define L_FRIDAY "Venerdi`"
#define L_SATURDAY "Sabato"
#endif /* ISOLATIN */
/* Month names */
#define L_JAN "Gennaio"
@@ -59,9 +50,6 @@
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "fa"
#define L_FROMNOW "da oggi"
@@ -76,58 +64,51 @@
a more drastic fix */
/* Minutes, hours, at, etc */
#define L_NOW "ora"
#define L_NOW "ora"
#define L_AT "alle"
#define L_MINUTE "minut"
#define L_HOUR "or"
#if ISOLATIN1
#define L_IS "\350"
#else /* ISOLATIN1 */
#define L_IS "e`"
#endif/* ISOLATIN1 */
#define L_IS "é"
#define L_WAS "era"
#define L_AND "e"
/* What to add to make "hour" plural */
#define L_HPLU "s"
#define L_HPLU "s"
/* What to add to make "minute" plural */
#define L_MPLU "s"
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
See the file dosubst.c for more info. */
#define L_P_OVER sprintf(s, (diff == 1 ? "o" : "i"));
#define L_Q_OVER sprintf(s, (diff == 1 ? "a" : "e"));
#define L_P_OVER sprintf(s, (diff == 1 ? "o" : "i"));
#define L_Q_OVER sprintf(s, (diff == 1 ? "a" : "e"));
#define L_HPLU_OVER hplu = (hdiff == 1 ? "a" : "e");
#define L_MPLU_OVER mplu = (mdiff == 1 ? "o" : "i");
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d,\
MonthName[m], y);
#define L_C_OVER sprintf(s, "%s", DayName[jul%7]);
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[dse%7], d,\
MonthName[m], y);
#define L_C_OVER sprintf(s, "%s", DayName[dse%7]);
#define L_E_OVER sprintf(s, "%02d%c%02d%c%04d", d, DateSep,\
m+1, DateSep, y);
m+1, DateSep, y);
#define L_F_OVER sprintf(s, "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
#define L_F_OVER sprintf(s, "%02d%c%02d%c%04d", m+1, DateSep, d, DateSep, y);
#define L_G_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
#define L_G_OVER sprintf(s, "%s, %d %s", DayName[dse%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_J_OVER sprintf(s, "%s, %d %s %d", DayName[dse%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_K_OVER sprintf(s, "%s, %d %s", DayName[dse%7], d, \
MonthName[m]);
#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);
#define L_U_OVER sprintf(s, "%s, %d %s %d", DayName[dse%7], d, \
MonthName[m], y);
#define L_V_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, \
MonthName[m]);
#endif /* L_IN_DOSUBST */
#define L_V_OVER sprintf(s, "%s, %d %s", DayName[dse%7], d, \
MonthName[m]);

View File

@@ -6,7 +6,8 @@
/* */
/* This file is part of REMIND. */
/* This file is Copyright (C) 1993 by Trygve Randen. */
/* Remind is Copyright (C) 1992-2021 by Dianne Skoll */
/* Remind is Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -14,21 +15,13 @@
#define L_LANGNAME "Norwegian"
/* Day names */
#if ISOLATIN1
# define L_SUNDAY "S\370ndag"
#else
# define L_SUNDAY "Soendag"
#endif
#define L_SUNDAY "Søndag"
#define L_MONDAY "Mandag"
#define L_TUESDAY "Tirsdag"
#define L_WEDNESDAY "Onsdag"
#define L_THURSDAY "Torsdag"
#define L_FRIDAY "Fredag"
#if ISOLATIN1
# define L_SATURDAY "L\370rdag"
#else
# define L_SATURDAY "Loerdag"
#endif
#define L_SATURDAY "Lørdag"
/* Month names */
#define L_JAN "Januar"
@@ -49,26 +42,15 @@
#define L_TOMORROW "i morgen"
/* The default banner */
#if ISOLATIN1
# define L_BANNER "P\345minnelse for %w, %d. %m, %y%o:"
#else
# define L_BANNER "Paaminnelse for %w, %d. %m, %y%o:"
#endif
#define L_BANNER "Påminnelse for %w, %d. %m, %y%o:"
/* "am" and "pm" */
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "siden"
#if ISOLATIN1
# define L_FROMNOW "fra n\345"
#else
# define L_FROMNOW "fra naa"
#endif
#define L_FROMNOW "fra nå"
/* "in %d days' time" */
#define L_INXDAYS "om %d dager"
@@ -81,11 +63,7 @@
#define L_PLURAL "er"
/* Minutes, hours, at, etc */
#if ISOLATIN1
# define L_NOW "n\345"
#else
# define L_NOW "naa"
#endif
#define L_NOW "nå"
#define L_AT "kl."
#define L_MINUTE "minutt"
#define L_HOUR "time"
@@ -93,17 +71,14 @@
#define L_WAS "var"
#define L_AND "og"
/* What to add to make "hour" plural */
#define L_HPLU "r"
#define L_HPLU "r"
/* What to add to make "minute" plural */
#define L_MPLU "er"
/* 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 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_A_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s %d", DayName[dse%7], d, MonthName[m], y); } else { sprintf(s, "%s %s, den %d. %s %d", L_ON, DayName[dse%7], d, MonthName[m], y); }
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, den %d. %s", DayName[dse%7], d, MonthName[m]); } else { sprintf(s, "%s %s, den %d. %s", L_ON, DayName[dse%7], d, MonthName[m]); }
#define L_U_OVER L_A_OVER
#define L_V_OVER L_G_OVER
#endif /* L_IN_DOSUBST */

View File

@@ -9,7 +9,8 @@
/* Polish. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -17,52 +18,27 @@
#define L_LANGNAME "Polish"
/* Day names */
#if ISOLATIN1
# define L_SUNDAY "Niedziela"
# define L_MONDAY "Poniedzia\263ek"
# define L_MONDAY "Poniedziałek"
# define L_TUESDAY "Wtorek"
# define L_WEDNESDAY "\246roda"
# define L_WEDNESDAY "Środa"
# define L_THURSDAY "Czwartek"
# define L_FRIDAY "Pi\261tek"
# define L_FRIDAY "Piątek"
# define L_SATURDAY "Sobota"
#else
# define L_SUNDAY "Niedziela"
# define L_MONDAY "Poniedzialek"
# define L_TUESDAY "Wtorek"
# define L_WEDNESDAY "Sroda"
# define L_THURSDAY "Czwartek"
# define L_FRIDAY "Piatek"
# define L_SATURDAY "Sobota"
#endif
/* Month names */
#if ISOLATIN1
# define L_JAN "Stycze\361"
# define L_JAN "Styczeń"
# define L_FEB "Luty"
# define L_MAR "Marzec"
# define L_APR "Kwiecie\361"
# define L_APR "Kwiecień"
# define L_MAY "Maj"
# define L_JUN "Czerwiec"
# define L_JUL "Lipiec"
# define L_AUG "Sierpie\361"
# define L_SEP "Wrzesie\361"
# define L_OCT "Pa\274dziernik"
# define L_AUG "Sierpień"
# define L_SEP "Wrzesień"
# define L_OCT "Październik"
# define L_NOV "Listopad"
# define L_DEC "Grudzie\361"
#else
# define L_JAN "Styczen"
# define L_FEB "Luty"
# define L_MAR "Marzec"
# define L_APR "Kwiecien"
# define L_MAY "Maj"
# define L_JUN "Czerwiec"
# define L_JUL "Lipiec"
# define L_AUG "Sierpien"
# define L_SEP "Wrzesien"
# define L_OCT "Pazdziernik"
# define L_NOV "Listopad"
# define L_DEC "Grudzien"
#endif
# define L_DEC "Grudzień"
/* Today and tomorrow */
#define L_TODAY "dzisiaj"
@@ -75,9 +51,6 @@
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "temu"
#define L_FROMNOW "od teraz"
@@ -97,80 +70,61 @@
#define L_AT "o"
#define L_MINUTE "minut"
#define L_HOUR "godzin"
#if ISOLATIN1
# define L_IS "b\352dzie"
# define L_WAS "by\263o"
#else
# define L_IS "bedzie"
# define L_WAS "bylo"
#endif
# define L_IS "będzie"
# define L_WAS "było"
#define L_AND "i"
#define L_HPLU ""
#define L_MPLU ""
/* What to add to make "hour" or "minute" plural */
#if ISOLATIN1
#define L_NPLU( N ) ((N == 1) ? "\352" : ((N==12) || (N==13) || (N==14)) ? "" : \
#define L_NPLU( N ) ((N == 1) ? "ę" : ((N==12) || (N==13) || (N==14)) ? "" : \
((N%10==2) || (N%10==3) || (N%10==4)) ? "y" : "" )
#else
#define L_NPLU( N ) ((N == 1) ? "e" : ((N==12) || (N==13) || (N==14)) ? "" : \
((N%10==2) || (N%10==3) || (N%10==4)) ? "y" : "" )
#endif
/* What to add to make "hour" plural */
#define L_HPLU L_NPLU( hdiff )
#define L_HPLU_OVER hplu = L_NPLU( hdiff );
/* What to add to make "minute" plural */
#define L_MPLU L_NPLU( mdiff )
#define L_MPLU_OVER mplu = L_NPLU( mdiff );
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
See the file dosubst.c for more info. */
#if ISOLATIN1
#define L_AMPM_OVERRIDE(ampm, hour) \
ampm = (hour<12) ? \
(hour<5) ? " w nocy" \
: (hour<10) ? " rano" \
: " przed po\263udniem" \
: (hour<18) ? " po po\263udniu" \
: " przed południem" \
: (hour<18) ? " po południu" \
: (hour<22) ? " wieczorem" \
: " w nocy";
#else
#define L_AMPM_OVERRIDE(ampm, hour) \
ampm = (hour<12) ? \
(hour<5) ? " w nocy" \
: (hour<10) ? " rano" \
: " przed poludniem" \
: (hour<18) ? " po poludniu" \
: (hour<22) ? " wieczorem" \
: " w nocy";
#endif
#define L_ORDINAL_OVERRIDE plu = "";
#define L_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_A_OVER if (altmode == '*') { sprintf(s, "%s, %d. %s %d", DayName[dse%7], d, MonthName[m], y); } else { sprintf(s, "%s %s, %d. %s %d", L_ON, DayName[dse%7], d, MonthName[m], y); }
#define L_G_OVER if (altmode == '*') { sprintf(s, "%s, %d. %s", DayName[dse%7], d, MonthName[m]); } else { sprintf(s, "%s %s, %d. %s", L_ON, DayName[dse%7], d, MonthName[m]); }
#define L_U_OVER L_A_OVER
#define L_V_OVER L_G_OVER
#endif /* L_IN_DOSUBST */
#define L_0_OVER sprintf(s, L_HPLU);
#define L_9_OVER sprintf(s, L_MPLU);
#define L_0_OVER sprintf(s, L_NPLU(hdiff));
#define L_9_OVER sprintf(s, L_NPLU(mdiff));
#define L_1_OVER \
if (tdiff == 0) \
sprintf(s, L_NOW); \
else if (tdiff > 0) \
{ \
if (hdiff == 0) \
sprintf(s, "za %d %s%s", mdiff, L_MINUTE, L_MPLU); \
sprintf(s, "za %d %s%s", mdiff, L_MINUTE, L_NPLU(mdiff)); \
else if (mdiff == 0) \
sprintf(s, "za %d %s%s", hdiff, L_HOUR, L_HPLU); \
sprintf(s, "za %d %s%s", hdiff, L_HOUR, L_NPLU(hdiff)); \
else \
sprintf(s, "za %d %s%s %s %d %s%s", hdiff, L_HOUR, L_HPLU, \
L_AND, mdiff, L_MINUTE, L_MPLU); \
sprintf(s, "za %d %s%s %s %d %s%s", hdiff, L_HOUR, L_NPLU(hdiff), \
L_AND, mdiff, L_MINUTE, L_NPLU(mdiff)); \
} \
else \
{ \
if (hdiff == 0) \
sprintf(s, "%d %s%s temu", mdiff, L_MINUTE, L_MPLU); \
sprintf(s, "%d %s%s temu", mdiff, L_MINUTE, L_NPLU(mdiff)); \
else if (mdiff == 0) \
sprintf(s, "%d %s%s temu", hdiff, L_HOUR, L_HPLU); \
sprintf(s, "%d %s%s temu", hdiff, L_HOUR, L_NPLU(hdiff)); \
else \
sprintf(s, "%d %s%s %s %d %s%s temu", hdiff, L_HOUR, L_HPLU, \
L_AND, mdiff, L_MINUTE, L_MPLU); \
sprintf(s, "%d %s%s %s %d %s%s temu", hdiff, L_HOUR, L_NPLU(hdiff), \
L_AND, mdiff, L_MINUTE, L_NPLU(mdiff)); \
}
/* The next ones are used only when MK_GLOBALS is set */
@@ -178,104 +132,103 @@ else \
#define L_ERR_OVERRIDE 1
EXTERN char *ErrMsg[] =
{
#if ISOLATIN1
"OK",
"Brakuj\261cy ']'",
"Brakuj\261cy nawias",
"Zbyt skomplikowane wyra\277enie - za du\277o operator\363w",
"Zbyt skomplikowane wyra\277enie - za du\277o argument\363w",
"Brakuj\261cy ')'",
"Brakujący ']'",
"Brakujący nawias",
"Zbyt skomplikowane wyrażenie - za dużo operatorów",
"Zbyt skomplikowane wyrażenie - za dużo argumentów",
"Brakujący ')'",
"Nie zdefiniowana funkcja",
"Nielegalny znak",
"Spodziewany operator binarny",
"Brak pami\352ci",
"Brak pamięci",
"Niepoprawny numer",
"Pusty stos operator\363w - b\263\261d wewn\352trzny",
"Pusty stos zmiennych - b\263\261d wewn\352trzny",
"Niemo\277liwa konwersja",
"B\263\261d typu",
"Pusty stos operatorów - błąd wewnętrzny",
"Pusty stos zmiennych - błąd wewnętrzny",
"Niemożliwa konwersja",
"Błąd typu",
"Nadmiar daty",
"B\263\261d stosu - b\263\261d wewn\352trzny",
"Błąd stosu - błąd wewnętrzny",
"Dzielenie przez zero",
"Niezdefiniowana zmienna",
"Niespodziewany koniec linii",
"Niespodziewany koniec pliku",
"B\263\261d wejscia/wyjscia",
"Za d\263uga linia",
"B\263\261d wewn\352trzny",
"Z\263a specyfikacja daty",
"Za ma\263o argument\363w",
"Za du\277o argument\363w",
"Nieprawid\263owy czas",
"Liczba za du\277a",
"Liczba za ma\263a",
"Nie mog\352 otworzy\346 pliku",
"Zbyt zagnie\277d\277one INCLUDE",
"B\263\261d sk\263adniowy",
"Nie mog\352 obliczy\346 przypomnienia",
"Zbyt zagnie\277d\277one IF",
"Błąd wejscia/wyjscia",
"Za długa linia",
"Błąd wewnętrzny",
"Zła specyfikacja daty",
"Za mało argumentów",
"Za dużo argumentów",
"Nieprawidłowy czas",
"Liczba za duża",
"Liczba za mała",
"Nie mogę otworzyć pliku",
"Zbyt zagnieżdżone INCLUDE",
"Błąd składniowy",
"Nie mogę obliczyć przypomnienia",
"Zbyt zagnieżdżone IF",
"ELSE bez IF do pary",
"ENDIF bez IF do pary",
"Nie mog\352 omin\261\346 (OMIT) wszystkich dni",
"Nie mogę ominąć (OMIT) wszystkich dni",
"Niespodziewany wyraz w lini",
"POP-OMIT-CONTEXT bez PUSH-OMIT-CONTEXT",
"Komenda RUN zablokowana",
"B\263\261d dziedziny",
"Błąd dziedziny",
"Niepoprawny identyfikator",
"Wykryto rekursywne wywo\263anie funkcji",
"Wykryto rekursywne wywołanie funkcji",
"",
"Nie mog\352 zmieni\346 zmiennej systemowej",
"Funkcja biblioteki C nie mo\277e reprezentowac daty/czasu",
"Pr\363ba redefinicji funkcji wbudowanej",
"Nie wolno zagnie\277d\277a\346 definicji funkcji w wyra\277eniu",
"Aby u\277yc powt\363rzenia trzeba w pe\263ni wyspecyfikowa\346 dat\352",
"Rok podany dw\363krotnie",
"Miesi\261c podany dw\363krotnie",
"Dzie\361 podany dw\363krotnie",
"Nieznane s\263owo",
"W komendzie OMIT trzeba poda\346 miesi\261c i dzie\361",
"Za du\277o cz\352\266ciowych komend OMIT",
"Za du\277o pe\263nych komend OMIT",
"Ostrze\277enie: PUSH-OMIT-CONTEXT bez POP-OMIT-CONTEXT",
"B\263\261d odczytu pliku",
"Nie mogę zmienić zmiennej systemowej",
"Funkcja biblioteki C nie może reprezentowac daty/czasu",
"Próba redefinicji funkcji wbudowanej",
"Nie wolno zagnieżdżać definicji funkcji w wyrażeniu",
"Aby użyc powtórzenia trzeba w pełni wyspecyfikować datę",
"Rok podany dwókrotnie",
"Miesiąc podany dwókrotnie",
"Dzień podany dwókrotnie",
"Nieznane słowo",
"W komendzie OMIT trzeba podać miesiąc",
"Za dużo częściowych komend OMIT",
"Za dużo pełnych komend OMIT",
"Ostrzeżenie: PUSH-OMIT-CONTEXT bez POP-OMIT-CONTEXT",
"Błąd odczytu pliku",
"Oczekiwany koniec linii",
"B\263\352dna data hebrajska",
"IIF wymaga nieparzystej liczby argument\363w",
"Ostrze\277enie: Brakujacy ENDIF",
"Błędna data hebrajska",
"IIF wymaga nieparzystej liczby argumentów",
"Ostrzeżenie: Brakujacy ENDIF",
"Oczekiwany przecinek",
"Dzie\361 tygodnia podany dw\363krotnie",
"Dzień tygodnia podany dwókrotnie",
"Dozwolone tylko jedno z: BEFORE, AFTER i SKIP",
"Nie mo\277na zagnie\277d\277a\346 MSG, MSF, RUN, itp. w wyra\277eniu",
"Warto\266\346 powtorzenia podana dw\363krotnie",
"Warto\266\346 r\363\277nicy podana dw\363krotnie",
"Warto\266\346 cofni\352cia podana dw\363krotnie",
"S\263owo ONCE u\277yte dw\363krotnie.",
"Nie można zagnieżdżać MSG, MSF, RUN, itp. w wyrażeniu",
"Wartość powtorzenia podana dwókrotnie",
"Wartość różnicy podana dwókrotnie",
"Wartość cofnięcia podana dwókrotnie",
"Słowo ONCE użyte dwókrotnie.",
"Po AT oczekiwany jest czas",
"S\263owo THROUGH/UNTIL u\277yte dw\363krotnie",
"Słowo THROUGH/UNTIL użyte dwókrotnie",
"Niekompletna specyfikacja daty",
"S\263owo FROM/SCANFROM u\277yte dw\363krotnie",
"Słowo FROM/SCANFROM użyte dwókrotnie",
"Zmienna",
"Warto\266\346",
"Wartość",
"*NIE ZDEFINIOWANE*",
"Pocz\261tek UserFN",
"Początek UserFN",
"Koniec UserFN",
"Przemine\263o",
"Niepowodzenie w funkcji fork() - nie mog\352 kolejkowa\346 przypomnie\361",
"Nie ma dost\352pu do pliku",
"B\263\352dna data systemowa: Rok mniejszy ni\277 %d\n",
"Przemineło",
"Niepowodzenie w funkcji fork() - nie mogę kolejkować przypomnień",
"Nie ma dostępu do pliku",
"Błędna data systemowa: Rok mniejszy niż %d\n",
"Nieznana flaga odpluskwiania '%c'\n",
"Nieznana opcja '%c'\n",
"Nieznany u\277ytkownik '%s'\n",
"Nie mog\352 zmieni\346 gid na %d\n",
"Nie mog\352 zmieni\346 uid na %d\n",
"Brak pami\352ci na zmienne \266rodowiska\n",
"Nieznany użytkownik '%s'\n",
"Nie mogę zmienić gid na %d\n",
"Nie mogę zmienić uid na %d\n",
"Brak pamięci na zmienne środowiska\n",
"Brak znaku '='",
"Brak nazwy zmiennej",
"Brak wyra\277enia",
"Nie mog\352 zmieni\346 daty dost\352pu pliku %s\n",
"Brak wyrażenia",
"Nie mogę zmienić daty dostępu pliku %s\n",
"Remind: '-i' option: %s\n",
"Brak przypomnie\361.",
"%d Przypomnienia zakolejkowane na p\363\274niej.\n",
"Brak przypomnień.",
"%d Przypomnienia zakolejkowane na później.\n",
"Spodziewana liczba",
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)",
"Can't convert between time zones",
@@ -283,112 +236,6 @@ EXTERN char *ErrMsg[] =
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
#else /* ISOLATIN1 */
"OK",
"Brakujacy ']'",
"Brakujacy nawias",
"Zbyt skomplikowane wyrazenie - za duzo operatorow",
"Zbyt skomplikowane wyrazenie - za duzo argumentow",
"Brakujacy ')'",
"Niezdefiniowana funkcja",
"Nielegalny znak",
"Spodziewany operator binarny",
"Brak pamieci",
"Niepoprawny numer",
"Pusty stos operatorow - blad wewnetrzny",
"Pusty stos zmiennych - blad wewnetrzny",
"Niemozliwa konwersja",
"Blad typu",
"Nadmiar daty",
"Blad stosu - blad wewnetrzny",
"Dzielenie przez zero",
"Niezdefiniowana zmienna",
"Niespodziewany koniec linii",
"Niespodziewany koniec pliku",
"Blad wejscia/wyjscia",
"Za dluga linia",
"Blad wewnetrzny",
"Zla specyfikacja daty",
"Za malo argumentow",
"Za duzo argumentow",
"Nieprawidlowy czas",
"Liczba za duza",
"Liczba za mala",
"Nie moge otworzyc pliku",
"INCLUDE zbyt zagniezdzone",
"Blad skladniowy",
"Nie moge obliczyc przypomnienia",
"Zbyt zagniezdzone IF",
"ELSE bez IF do pary",
"ENDIF bez IF do pary",
"Nie moge ominac (OMIT) wszystkich dni",
"Niespodziewany wyraz w lini",
"POP-OMIT-CONTEXT bez PUSH-OMIT-CONTEXT",
"Komenda RUN zablokowana",
"Blad dziedziny",
"Niepoprawny identyfikator",
"Wykryto rekursywne wywolanie funkcji",
"",
"Nie moga zmienic zmiennej systemowej",
"Funkcja biblioteki C nie moze reprezentowac daty/czasu",
"Proba redefinicji funkcji wbudowanej",
"Nie wolno zagniezdzac definicji funkcji w wyrazeniu",
"Aby uzyc powtorzenia trzeba w pelni wyspecyfikowac date",
"Rok podany dwokrotnie",
"Miesiac podany dwokrotnie",
"Dzien podany dwokrotnie",
"Nieznane slowo",
"W komendzie OMIT trzeba podac miesiac i dzien",
"Za duzo czesciowych komend OMIT",
"Za duzo pelnych komend OMIT",
"ostrzezenie: PUSH-OMIT-CONTEXT bez POP-OMIT-CONTEXT",
"Blad odczytu pliku",
"Oczekiwany koniec linii",
"Bledna data hebrajska",
"IIF wymaga nieparzystej liczby argumentow",
"Ostrzezenie: Brakujacy ENDIF",
"Oczekiwany przecinek",
"Dzien tygodnia podany dwokrotnie",
"Dozwolone tylko jedno z: BEFORE, AFTER i SKIP",
"Nie mozna zagniezdzac MSG, MSF, RUN, itp. w wyrazeniu",
"Wartosc powtorzenia podana dwokrotnie",
"Wartosc roznicy podana dwokrotnie",
"Wartosc cofniecia podana dwokrotnie",
"Slowo ONCE uzyte dwokrotnie.",
"Po AT oczekiwany jest czas",
"Slowo THROUGH/UNTIL uzyte dwokrotnie",
"Niekompletna specyfikacja daty",
"Slowo FROM/SCANFROM uzyte dwokrotnie",
"Zmienna",
"Wartosc",
"*UNDEFINED*",
"Poczatek UserFN",
"Koniec UserFN",
"Przeminelo",
"niepowodzenie w funkcji fork() - nie moge kolejkowac przypomnien",
"Nie ma dostepu do pliku",
"Bledna data systemowa: Rok mniejszy niz %d\n",
"Nieznana flaga odpluskwiania '%c'\n",
"Nieznana opcja '%c'\n",
"Nieznany uzytkownik '%s'\n",
"Nie moge zmienic gid na %d\n",
"Nie moge zmienic uid na %d\n",
"Brak pamieci na zmienne srodowiska\n",
"Brak znaku '='",
"Brak nazwy zmiennej",
"Brak wyrazenia",
"Nie moge zmienic daty dostepu pliku %s\n",
"Remind: '-i' option: %s\n",
"Brak przypomnien.",
"%d Przypomnienia zakolejkowane na pozniej.\n",
"Spodziewana liczba",
"Illegal function in WARN clause (NEEDS TRANSLATION TO POLISH)",
"Can't convert between time zones",
"No files matching *.rem",
"String too long",
"Time specified twice",
"Cannot specify DURATION without specifying AT"
#endif /* ISOLATIN1 */
};
#endif /* MK_GLOBALS */
@@ -397,67 +244,37 @@ EXTERN char *ErrMsg[] =
#define L_USAGE_OVERRIDE 1
void Usage(void)
{
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
#ifdef BETA
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
#endif
#if ISOLATIN1
fprintf(ErrFp, "\nSpos\363b u\277ycia: remind [opcje] plik [data] [czas] [*powt\363rzenie]\n");
fprintf(ErrFp, "\nSposób użycia: remind [opcje] plik [data] [czas] [*powtórzenie]\n");
fprintf(ErrFp, "Opcje:\n");
fprintf(ErrFp, " -n Wypisz nast\352pne przypomnienia w prostym formacie\n");
fprintf(ErrFp, " -n Wypisz następne przypomnienia w prostym formacie\n");
fprintf(ErrFp, " -r Zablokuj dyrektywy RUN\n");
fprintf(ErrFp, " -c[n] Wypisz kalendarz na n (domy\266lnie 1) miesi\352cy\n");
fprintf(ErrFp, " -c+[n] Wypisz kalendarz na n (domy\266lnie 1) tygodni\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Ustaw szeroko\266\346, wype\263nienie i odst\352py w kalendarzu\n");
fprintf(ErrFp, " -s[+][n] Wypisz uproszczony kalendarz na n (1) miesi\352cy (tygodni)\n");
fprintf(ErrFp, " -c[n] Wypisz kalendarz na n (domyślnie 1) miesięcy\n");
fprintf(ErrFp, " -c+[n] Wypisz kalendarz na n (domyślnie 1) tygodni\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Ustaw szerokość, wypełnienie i odstępy w kalendarzu\n");
fprintf(ErrFp, " -s[+][n] Wypisz uproszczony kalendarz na n (1) miesięcy (tygodni)\n");
fprintf(ErrFp, " -p[n] To samo co -s, ale kompatybilne z rem2ps\n");
fprintf(ErrFp, " -v Obszerniejsze komentarze\n");
fprintf(ErrFp, " -o Ignoruj instrukcje ONCE\n");
fprintf(ErrFp, " -t Odpal wszystkie przysz\263e przypomnienia niezale\277nie od delty\n");
fprintf(ErrFp, " -t Odpal wszystkie przyszłe przypomnienia niezależnie od delty\n");
fprintf(ErrFp, " -h Praca bezszmerowa\n");
#ifdef HAVE_QUEUED
fprintf(ErrFp, " -a Nie odpalaj przyponie\361 czasowych - kolejkuj je\n");
fprintf(ErrFp, " -q Nie kolejkuj przyponie\361 czasowych\n");
fprintf(ErrFp, " -f Nie przechod\274 do pracy w tle\n");
fprintf(ErrFp, " -z[n] Pracuj jako demon, budz\261c si\352 co n (5) minut\n");
fprintf(ErrFp, " -a Nie odpalaj przyponień czasowych - kolejkuj je\n");
fprintf(ErrFp, " -q Nie kolejkuj przyponień czasowych\n");
fprintf(ErrFp, " -f Nie przechodź do pracy w tle\n");
fprintf(ErrFp, " -z[n] Pracuj jako demon, budząc się co n (5) minut\n");
#endif
fprintf(ErrFp, " -d... Odpluskwianie: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
fprintf(ErrFp, " -e Komunikaty o b\263\352dach skieruj na stdout\n");
fprintf(ErrFp, " -b[n] Format czasu: 0=am/pm, 1=24godz., 2=\277aden\n");
fprintf(ErrFp, " -x[n] Limit powt\363rze\361 klauzuli SATISFY (domy\266lnie=150)\n");
fprintf(ErrFp, " -kcmd Wywo\263aj 'cmd' dla przypomnie\361 typu MSG\n");
fprintf(ErrFp, " -g[ddd] Sortuj przypomnienia wed\263ug daty, czasu i priorytetu\n");
fprintf(ErrFp, " -ivar=val Zainicjuj zmienn\261 var warto\266cia val i zachowaj ja\n");
fprintf(ErrFp, " -m Rozpocznij kalendarz od poniedzia\263ku zamiast od niedzieli\n");
#else /* ISOLATIN1 */
fprintf(ErrFp, "\nSposob uzycia: remind [opcje] plik [data] [czas] [*powtorzenie]\n");
fprintf(ErrFp, "Opcje:\n");
fprintf(ErrFp, " -n Wypisz nastepne przypomnienia w prostym formacie\n");
fprintf(ErrFp, " -r Zablokuj dyrektywy RUN\n");
fprintf(ErrFp, " -c[n] Wypisz kalendarz na n (domyslnie 1) miesiecy\n");
fprintf(ErrFp, " -c+[n] Wypisz kalendarz na n (domyslnie 1) tygodni\n");
fprintf(ErrFp, " -w[n[,p[,s]]] Ustaw szerokosc, wypelnienie i odstepy w kalendarzu\n");
fprintf(ErrFp, " -s[+][n] Wypisz uproszczony kalendarz na n (1) miesiecy (tygodni)\n");
fprintf(ErrFp, " -p[n] To samo co -s, ale kompatybilne z rem2ps\n");
fprintf(ErrFp, " -v Obszerniejsze komentarze\n");
fprintf(ErrFp, " -o Ignoruj instrukcje ONCE\n");
fprintf(ErrFp, " -t Odpal wszystkie przyszle przypomnienia niezaleznie od delty\n");
fprintf(ErrFp, " -h Praca bezszmerowa\n");
#ifdef HAVE_QUEUED
fprintf(ErrFp, " -a Nie odpalaj przyponien czasowych - kolejkuj je\n");
fprintf(ErrFp, " -q Nie kolejkuj przyponien czasowych\n");
fprintf(ErrFp, " -f Nie przechodz do pracy w tle\n");
fprintf(ErrFp, " -z[n] Pracuj jako demon, budzac sie co n (5) minut\n");
#endif
fprintf(ErrFp, " -d... Odpluskwianie: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
fprintf(ErrFp, " -e Komunikaty o bledach skieruj na stdout\n");
fprintf(ErrFp, " -b[n] Format czasu: 0=am/pm, 1=24godz., 2=zaden\n");
fprintf(ErrFp, " -x[n] Limit powtorzen klauzuli SATISFY (domyslnie=150)\n");
fprintf(ErrFp, " -kcmd Wywolaj 'cmd' dla przypomnien typu MSG\n");
fprintf(ErrFp, " -g[ddd] Sortuj przypomnienia wedlug daty, czasu i priorytetu\n");
fprintf(ErrFp, " -ivar=val Zainicjuj zmienna var wartoscia val i zachowaj ja\n");
fprintf(ErrFp, " -m Rozpocznij kalendarz od poniedzialku zamiast od niedzieli\n");
#endif /* ISOLATIN1 */
fprintf(ErrFp, " -e Komunikaty o błędach skieruj na stdout\n");
fprintf(ErrFp, " -b[n] Format czasu: 0=am/pm, 1=24godz., 2=żaden\n");
fprintf(ErrFp, " -x[n] Limit powtórzeń klauzuli SATISFY (domyślnie=1000)\n");
fprintf(ErrFp, " -kcmd Wywołaj 'cmd' dla przypomnień typu MSG\n");
fprintf(ErrFp, " -g[ddd] Sortuj przypomnienia według daty, czasu i priorytetu\n");
fprintf(ErrFp, " -ivar=val Zainicjuj zmienną var wartościa val i zachowaj ja\n");
fprintf(ErrFp, " -m Rozpocznij kalendarz od poniedziałku zamiast od niedzieli\n");
exit(1);
}
#endif /* L_IN_INIT */

View File

@@ -8,9 +8,10 @@
/* */
/* This file is part of REMIND. */
/* */
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
/* This file is Copyright (C) 1996 by Marco Paganini and */
/* Dianne Skoll. */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -51,9 +52,6 @@
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Ago and from now */
#define L_AGO "atras"
#define L_FROMNOW "adiante"
@@ -91,26 +89,26 @@
#define _ON_WEEKDAY(x) ((x % 7) < 2) ? "no" : "na"
#define L_A_OVER \
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m], y);
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(dse), DayName[dse%7], d, MonthName[m], y);
#define L_C_OVER \
sprintf(s, "%s %s", _ON_WEEKDAY(jul), DayName[jul%7]);
sprintf(s, "%s %s", _ON_WEEKDAY(dse), DayName[dse%7]);
#define L_G_OVER \
sprintf(s, "%s %s, %d %s", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m]);
sprintf(s, "%s %s, %d %s", _ON_WEEKDAY(dse), DayName[dse%7], d, MonthName[m]);
#define L_J_OVER \
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m], y);
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(dse), DayName[dse%7], d, MonthName[m], y);
#define L_K_OVER \
sprintf(s, "%s %s, %d de %s", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m]);
sprintf(s, "%s %s, %d de %s", _ON_WEEKDAY(dse), DayName[dse%7], d, MonthName[m]);
/* Portuguese does not use some suffixes, some some %u and %j are the same */
#define L_U_OVER \
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m], y);
sprintf(s, "%s %s, %d de %s de %d", _ON_WEEKDAY(dse), DayName[dse%7], d, MonthName[m], y);
#define L_V_OVER \
sprintf(s, "%s %s, %d de %s", _ON_WEEKDAY(jul), DayName[jul%7], d, MonthName[m]);
sprintf(s, "%s %s, %d de %s", _ON_WEEKDAY(dse), DayName[dse%7], d, MonthName[m]);
#define L_1_OVER \
{ \
@@ -138,8 +136,6 @@
} \
}
#endif /* L_IN_DOSUBST */
/* The next ones are used only when MK_GLOBALS is set */
#ifdef MK_GLOBALS
#define L_ERR_OVERRIDE 1
@@ -199,7 +195,7 @@ EXTERN char *ErrMsg[] =
"Mes especificado duas vezes",
"Dia especificado duas vezes",
"Token desconhecido",
"Mes e dia devem ser especificados no comando OMIT",
"O mes deve ser especificados no comando OMIT",
"Muitos OMITs parciais",
"Muitos OMITs full",
"Aviso: PUSH-OMIT-CONTEXT sem POP-OMIT-CONTEXT correspondente",
@@ -257,7 +253,7 @@ EXTERN char *ErrMsg[] =
#define L_USAGE_OVERRIDE 1
void Usage(void)
{
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-2021 Dianne Skoll\n", VERSION, L_LANGNAME);
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
#ifdef BETA
fprintf(ErrFp, ">>>> VERSAO BETA <<<<\n");
#endif
@@ -283,7 +279,7 @@ void Usage(void)
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trigger v=dumpvars l=showline\n");
fprintf(ErrFp, " -e Desvia mensagens normalmente enviadas a stderr para stdout\n");
fprintf(ErrFp, " -b[n] Formato da hora para o cal: 0=am/pm, 1=24hr, 2=nenhum\n");
fprintf(ErrFp, " -x[n] Limite de iteracoes para a clausula SATISFY (default=150)\n");
fprintf(ErrFp, " -x[n] Limite de iteracoes para a clausula SATISFY (default=1000)\n");
fprintf(ErrFp, " -kcmd Executa `cmd' para os compromissos com MSG\n");
fprintf(ErrFp, " -g[ddd] Classifica compromissos por data, hora e prioridade antes de exibir\n");
fprintf(ErrFp, " -ivar=val Inicializa (e preserva) variavel var com val\n");

View File

@@ -8,8 +8,9 @@
/* */
/* This file is part of REMIND. */
/* */
/* REMIND is Copyright (C) 1992-2021 by Dianne Skoll */
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
/* This file is Copyright (C) 1996-1998 by Liviu Daia */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -17,39 +18,13 @@
#define L_LANGNAME "Romanian"
/* Day names */
#if ISOLATIN1
# define L_SUNDAY "Duminica"
# define L_SUNDAY "Duminică"
# define L_MONDAY "Luni"
# define L_TUESDAY "Marti"
# define L_TUESDAY "Marți"
# define L_WEDNESDAY "Miercuri"
# define L_THURSDAY "Joi"
# define L_FRIDAY "Vineri"
# define L_SATURDAY "S\342mbata"
#elif ISOLATIN2
# define L_SUNDAY "Duminic\343"
# define L_MONDAY "Luni"
# define L_TUESDAY "Mar\376i"
# define L_WEDNESDAY "Miercuri"
# define L_THURSDAY "Joi"
# define L_FRIDAY "Vineri"
# define L_SATURDAY "S\342mb\343t\343"
#elif IBM852
# define L_SUNDAY "Duminic\307"
# define L_MONDAY "Luni"
# define L_TUESDAY "Mar\316i"
# define L_WEDNESDAY "Miercuri"
# define L_THURSDAY "Joi"
# define L_FRIDAY "Vineri"
# define L_SATURDAY "S\203mb\307t\307"
#else
# define L_SUNDAY "Duminica"
# define L_MONDAY "Luni"
# define L_TUESDAY "Marti"
# define L_WEDNESDAY "Miercuri"
# define L_THURSDAY "Joi"
# define L_FRIDAY "Vineri"
# define L_SATURDAY "Sambata"
#endif
# define L_SATURDAY "Sâmbătă"
/* Month names */
#define L_JAN "Ianuarie"
@@ -66,19 +41,8 @@
#define L_DEC "Decembrie"
/* Today and tomorrow */
#if ISOLATIN1
# define L_TODAY "astazi"
# define L_TOMORROW "m\342ine"
#elif ISOLATIN2
# define L_TODAY "ast\343zi"
# define L_TOMORROW "m\342ine"
#elif IBM852
# define L_TODAY "ast\307zi"
# define L_TOMORROW "m\203ine"
#else
# define L_TODAY "astazi"
# define L_TOMORROW "maine"
#endif
# define L_TODAY "astăzi"
# define L_TOMORROW "mâine"
/* The default banner */
#define L_BANNER "Reamintiri pentru %w, %d %m %y%o:"
@@ -87,9 +51,6 @@
#define L_AM "am"
#define L_PM "pm"
#ifdef L_IN_DOSUBST
/*** The following are only used in dosubst.c ***/
/* Ago and from now */
#define L_AGO "acum"
#define L_FROMNOW "peste"
@@ -113,41 +74,25 @@
#define L_WAS "a fost"
/* What to add to make "minute" plural */
#define L_MPLU "e"
#define L_HPLU "e"
#if ISOLATIN2
/* What to add to make "hour" plural */
# define L_HPLU_OVER hplu = (hdiff == 1 ? "\343" : "e");
# define L_AND "\272i"
#elif IBM852
/* What to add to make "hour" plural */
# define L_HPLU_OVER hplu = (hdiff == 1 ? "\307" : "e");
# define L_AND "\255i"
#else
/* What to add to make "hour" plural */
# define L_HPLU_OVER hplu = (hdiff == 1 ? "a" : "e");
# define L_AND "si"
#endif
/* What to add to make "hour" plural */
#define L_HPLU_OVER hplu = (hdiff == 1 ? "ă" : "e");
#define L_AND "şi"
/* Define any overrides here, such as L_ORDINAL_OVERRIDE, L_A_OVER, etc.
See the file dosubst.c for more info. */
#if ISOLATIN2
# define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " diminea\376a" : (hour > 17) ? " seara" : " dup\343-amiaza";
#elif IBM852
# define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " diminea\316a" : (hour > 17) ? " seara" : " dup\307-amiaza";
#else
# define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " dimineata" : (hour > 17) ? " seara" : " dupa-amiaza";
#endif
#define L_AMPM_OVERRIDE(ampm, hour) ampm = (hour < 12) ? (hour<4) ? " noaptea" : " dimineaţa" : (hour > 17) ? " seara" : " după-amiaza";
#define L_ORDINAL_OVERRIDE plu = "";
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, MonthName[m], y);
#define L_C_OVER sprintf(s, "%s", DayName[jul%7]);
#define L_G_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
#define L_J_OVER sprintf(s, "%s, %s %d, %d", DayName[jul%7], MonthName[m], d, y);
#define L_K_OVER sprintf(s, "%s, %s %d", DayName[jul%7], MonthName[m], d);
#define L_A_OVER sprintf(s, "%s, %d %s %d", DayName[dse%7], d, MonthName[m], y);
#define L_C_OVER sprintf(s, "%s", DayName[dse%7]);
#define L_G_OVER sprintf(s, "%s, %d %s", DayName[dse%7], d, MonthName[m]);
#define L_J_OVER sprintf(s, "%s, %s %d, %d", DayName[dse%7], MonthName[m], d, y);
#define L_K_OVER sprintf(s, "%s, %s %d", DayName[dse%7], MonthName[m], d);
#define L_S_OVER
#define L_U_OVER sprintf(s, "%s, %d %s %d", DayName[jul%7], d, MonthName[m], y);
#define L_V_OVER sprintf(s, "%s, %d %s", DayName[jul%7], d, MonthName[m]);
#define L_U_OVER sprintf(s, "%s, %d %s %d", DayName[dse%7], d, MonthName[m], y);
#define L_V_OVER sprintf(s, "%s, %d %s", DayName[dse%7], d, MonthName[m]);
#define L_1_OVER \
if (tdiff == 0) \
sprintf(s, L_NOW); \
@@ -158,5 +103,3 @@
else \
sprintf(s, "%s %d %s%s %s %d %s%s", when, hdiff, \
L_HOUR, hplu, L_AND, mdiff, L_MINUTE, mplu);
#endif /* L_IN_DOSUBST */

View File

@@ -7,7 +7,8 @@
/* Author: Rafa Couto <rafacouto@biogate.com> */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -17,19 +18,10 @@
#define L_SUNDAY "Domingo"
#define L_MONDAY "Lunes"
#define L_TUESDAY "Martes"
#if ISOLATIN1
#define L_WEDNESDAY "Mi\351rcoles"
#else
#define L_WEDNESDAY "Miercoles"
#endif
#define L_WEDNESDAY "Miércoles"
#define L_THURSDAY "Jueves"
#define L_FRIDAY "Viernes"
#if ISOLATIN1
#define L_SATURDAY "S\341bado"
#else
#define L_SATURDAY "Sabado"
#endif
#define L_SATURDAY "Sábado"
/* Nombres de los meses */
#define L_JAN "Enero"
@@ -47,11 +39,7 @@
/* Hoy y man~ana */
#define L_TODAY "hoy"
#if ISOLATIN1
#define L_TOMORROW "ma\361ana"
#else
#define L_TOMORROW "manana"
#endif
#define L_TOMORROW "mañana"
/* El titular habitual */
#define L_BANNER "Agenda para el %w, %d%s %m, %y%o:"
@@ -60,21 +48,13 @@
#define L_AM "am"
#define L_PM "pm"
/*** The following are only used in dosubst.c ***/
#ifdef L_IN_DOSUBST
/* Hace y desde hoy */
#define L_AGO "hace"
#define L_FROMNOW "desde hoy"
/* "dentro de %d di'as" */
#if ISOLATIN1
#define L_INXDAYS "dentro de %d d\355as"
#define L_ON "el d\355a"
#else
#define L_INXDAYS "dentro de %d di'as"
#define L_ON "el di'a"
#endif
#define L_INXDAYS "dentro de %d días"
#define L_ON "el día"
/* "el di'a..." */
@@ -92,5 +72,3 @@
#define L_HPLU "s"
#define L_MPLU "s"
#endif /* L_IN_DOSUBST */

View File

@@ -6,12 +6,15 @@
/* routines, etc. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
#define _XOPEN_SOURCE 600
#include "config.h"
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
@@ -35,6 +38,10 @@
#endif
#include <sys/types.h>
#ifdef REM_USE_WCHAR
#include <wctype.h>
#include <wchar.h>
#endif
#include "types.h"
#include "protos.h"
@@ -44,10 +51,6 @@
static void DoReminders(void);
/* Whooo... the putchar/Putchar/PutChar macros are a mess...
my apologies... */
#define Putchar(c) PutChar(c)
/***************************************************************/
/***************************************************************/
/** **/
@@ -71,6 +74,7 @@ int main(int argc, char *argv[])
ArgV = (char const **) argv;
InitRemind(argc, (char const **) argv);
DBufInit(&(LastTrigger.tags));
ClearLastTriggers();
if (DoCalendar || (DoSimpleCalendar && (!NextMode || PsCal))) {
@@ -128,7 +132,7 @@ int main(int argc, char *argv[])
}
if (Iterations) {
PerIterationInit();
JulianToday++;
DSEToday++;
}
}
return 0;
@@ -173,14 +177,16 @@ static void DoReminders(void)
Parser p;
int purge_handled;
DidMsgReminder = 0;
if (!UseStdin) {
FileAccessDate = GetAccessDate(InitialFile);
} else {
FileAccessDate = JulianToday;
FileAccessDate = DSEToday;
}
if (FileAccessDate < 0) {
fprintf(ErrFp, "%s: `%s'.\n", ErrMsg[E_CANTACCESS], InitialFile);
fprintf(ErrFp, "%s: `%s': %s.\n", ErrMsg[E_CANTACCESS], InitialFile, strerror(errno));
exit(1);
}
@@ -235,12 +241,13 @@ static void DoReminders(void)
case T_Else: r=DoElse(&p); break;
case T_EndIf: r=DoEndif(&p); break;
case T_Include:
case T_IncludeR:
/* In purge mode, include closes file, so we
need to echo it here! */
if (PurgeMode) {
PurgeEchoLine("%s\n", CurLine);
}
r=DoInclude(&p);
r=DoInclude(&p, tok.type);
purge_handled = 1;
break;
case T_IncludeCmd:
@@ -256,6 +263,7 @@ static void DoReminders(void)
case T_Flush: r=DoFlush(&p); break;
case T_Set: r=DoSet(&p); break;
case T_Fset: r=DoFset(&p); break;
case T_Funset: r=DoFunset(&p); break;
case T_UnSet: r=DoUnset(&p); break;
case T_Clr: r=DoClear(&p); break;
case T_Debug: r=DoDebug(&p); break;
@@ -310,13 +318,16 @@ static void DoReminders(void)
/***************************************************************/
/* */
/* Julian */
/* DSE */
/* */
/* Given day, month, year, return Julian date in days since */
/* DSE stands for "Days Since Epoch"; the Remind epoch is */
/* midnight on 1990-01-01 */
/* */
/* Given day, month, year, return DSE date in days since */
/* 1 January 1990. */
/* */
/***************************************************************/
int Julian(int year, int month, int day)
int DSE(int year, int month, int day)
{
int y1 = BASE-1, y2 = year-1;
@@ -330,14 +341,15 @@ int Julian(int year, int month, int day)
/***************************************************************/
/* */
/* FromJulian */
/* FromDSE */
/* */
/* Convert a Julian date to year, month, day. */
/* Convert a DSE date to year, month, day. You may supply */
/* NULL for y, m or d if you're not interested in that value */
/* */
/***************************************************************/
void FromJulian(int jul, int *y, int *m, int *d)
void FromDSE(int dse, int *y, int *m, int *d)
{
int try_yr = (jul / 365) + BASE;
int try_yr = (dse / 365) + BASE;
int try_mon = 0;
int t;
@@ -347,26 +359,49 @@ void FromJulian(int jul, int *y, int *m, int *d)
int y100 = (y2 / 100) - (y1 / 100); /* Don't count multiples of 100... */
int y400 = (y2 / 400) - (y1 / 400); /* ... but do count multiples of 400 */
int try_jul= 365 * (try_yr-BASE) + y4 - y100 + y400;
int try_dse= 365 * (try_yr-BASE) + y4 - y100 + y400;
while (try_jul > jul) {
while (try_dse > dse) {
try_yr--;
try_jul -= DaysInYear(try_yr);
try_dse -= DaysInYear(try_yr);
}
jul -= try_jul;
dse -= try_dse;
t = DaysInMonth(try_mon, try_yr);
while (jul >= t) {
jul -= t;
while (dse >= t) {
dse -= t;
try_mon++;
t = DaysInMonth(try_mon, try_yr);
}
*y = try_yr;
*m = try_mon;
*d = jul + 1;
if (y) {
*y = try_yr;
}
if (m) {
*m = try_mon;
}
if (d) {
*d = dse + 1;
}
return;
}
int JulianToGregorianOffset(int y, int m)
{
int offset = 13;
int centuries;
int four_centuries;
if (y >= 2100) {
centuries = (y - 2000) / 100;
four_centuries = (y - 2000) / 400;
offset += centuries - four_centuries;
if (!(y%100) && (y % 400)) {
if (m < 2) {
offset--; /* Offset increments in March */
}
}
}
return offset;
}
/***************************************************************/
/* */
/* ParseChar */
@@ -571,6 +606,29 @@ int EvaluateExpr(ParsePtr p, Value *v)
return OK;
}
/***************************************************************/
/* */
/* Wprint - print a warning message. */
/* */
/***************************************************************/
void Wprint(char const *fmt, ...)
{
va_list argptr;
if (FileName) {
if (strcmp(FileName, "-"))
(void) fprintf(ErrFp, "%s(%d): ", FileName, LineNo);
else
(void) fprintf(ErrFp, "-stdin-(%d): ", LineNo);
}
va_start(argptr, fmt);
(void) vfprintf(ErrFp, fmt, argptr);
(void) fputc('\n', ErrFp);
va_end(argptr);
return;
}
/***************************************************************/
/* */
/* Eprint - print an error message. */
@@ -585,13 +643,23 @@ void Eprint(char const *fmt, ...)
if (FreshLine && FileName) {
FreshLine = 0;
if (strcmp(FileName, "-"))
if (strcmp(FileName, "-")) {
(void) fprintf(ErrFp, "%s(%d): ", FileName, LineNo);
else
if (print_callstack(ErrFp)) {
(void) fprintf(ErrFp, ": ");
}
} else {
(void) fprintf(ErrFp, "-stdin-(%d): ", LineNo);
if (print_callstack(ErrFp)) {
(void) fprintf(ErrFp, ": ");
}
}
if (DebugFlag & DB_PRTLINE) OutputLine(ErrFp);
} else if (FileName) {
fprintf(ErrFp, " ");
if (print_callstack(ErrFp)) {
(void) fprintf(ErrFp, ": ");
}
}
va_start(argptr, fmt);
@@ -615,11 +683,11 @@ void OutputLine(FILE *fp)
char c = 0;
while (*s) {
if (*s == '\n') Putc('\\', fp);
Putc(*s, fp);
if (*s == '\n') putc('\\', fp);
putc(*s, fp);
c = *s++;
}
if (c != '\n') Putc('\n', fp);
if (c != '\n') putc('\n', fp);
}
/***************************************************************/
@@ -702,7 +770,7 @@ long SystemTime(int realtime)
/* */
/* SystemDate */
/* */
/* Obtains today's date. Returns Julian date or -1 for */
/* Obtains today's date. Returns DSE date or -1 for */
/* failure. (Failure happens if sys date is before BASE */
/* year.) */
/* */
@@ -719,7 +787,7 @@ int SystemDate(int *y, int *m, int *d)
*m = t->tm_mon;
*y = t->tm_year + 1900;
return Julian(*y, *m, *d);
return DSE(*y, *m, *d);
}
@@ -812,7 +880,7 @@ int DoIfTrig(ParsePtr p)
unsigned syndrome;
Trigger trig;
TimeTrig tim;
int jul;
int dse;
if ((size_t) NumIfs >= IF_NEST) return E_NESTED_IF;
@@ -820,26 +888,26 @@ int DoIfTrig(ParsePtr p)
else {
if ( (r=ParseRem(p, &trig, &tim, 1)) ) return r;
if (trig.typ != NO_TYPE) return E_PARSE_ERR;
jul = ComputeTrigger(trig.scanfrom, &trig, &tim, &r, 1);
dse = ComputeTrigger(trig.scanfrom, &trig, &tim, &r, 1);
if (r) {
if (r != E_CANT_TRIG || !trig.maybe_uncomputable) {
if (!Hush || r != E_RUN_DISABLED) {
Eprint("%s", ErrMsg[r]);
}
}
syndrome = IF_TRUE | BEFORE_ELSE;
syndrome = IF_FALSE | BEFORE_ELSE;
}
else {
if (ShouldTriggerReminder(&trig, &tim, jul, &err)) {
if (ShouldTriggerReminder(&trig, &tim, dse, &err)) {
syndrome = IF_TRUE | BEFORE_ELSE;
} else {
syndrome = IF_FALSE | BEFORE_ELSE;
if (PurgeMode) {
PurgeEchoLine("%s\n", "#!P: The next IFTRIG did not trigger.");
PurgeEchoLine("%s\n", "#!P: REM statements in IFTRIG block not checked for purging.");
}
}
}
if (syndrome == (IF_FALSE | BEFORE_ELSE) && PurgeMode) {
PurgeEchoLine("%s\n", "#!P: The next IFTRIG did not trigger.");
PurgeEchoLine("%s\n", "#!P: REM statements in IFTRIG block not checked for purging.");
}
FreeTrig(&trig);
}
NumIfs++;
@@ -1094,7 +1162,7 @@ int DoErrMsg(ParsePtr p)
DBufInit(&buf);
t.typ = MSG_TYPE;
tt.ttime = SystemTime(0) / 60;
if ( (r=DoSubst(p, &buf, &t, &tt, JulianToday, NORMAL_MODE)) ) {
if ( (r=DoSubst(p, &buf, &t, &tt, DSEToday, NORMAL_MODE)) ) {
return r;
}
s = DBufValue(&buf);
@@ -1115,8 +1183,8 @@ int DoErrMsg(ParsePtr p)
/* The array FoldArray[2][7] contains sample years which begin
on the specified weekday. For example, FoldArray[0][2] is a
non-leapyear beginning on Wednesday, and FoldArray[1][5] is a
leapyear beginning on Saturday. Used to fold back dates which
non-leap year beginning on Wednesday, and FoldArray[1][5] is a
leap year beginning on Saturday. Used to fold back dates which
are too high for the standard Unix representation.
NOTE: This implies that you cannot set BASE > 2001!!!!! */
static int FoldArray[2][7] = {
@@ -1124,28 +1192,30 @@ static int FoldArray[2][7] = {
{2024, 2008, 2020, 2004, 2016, 2000, 2012}
};
int CalcMinsFromUTC(int jul, int tim, int *mins, int *isdst)
int CalcMinsFromUTC(int dse, int tim, int *mins, int *isdst)
{
/* Convert jul and tim to an Unix tm struct */
/* Convert dse and tim to an Unix tm struct */
int yr, mon, day;
int tdiff;
struct tm local, utc, *temp;
time_t loc_t, utc_t;
int isdst_tmp;
FromJulian(jul, &yr, &mon, &day);
FromDSE(dse, &yr, &mon, &day);
/* If the year is greater than 2037, some Unix machines have problems.
Fold it back to a "similar" year and trust that the UTC calculations
are still valid... */
if (FoldYear && yr>2037) {
jul = Julian(yr, 0, 1);
yr = FoldArray[IsLeapYear(yr)][jul%7];
dse = DSE(yr, 0, 1);
yr = FoldArray[IsLeapYear(yr)][dse%7];
}
local.tm_sec = 0;
local.tm_min = tim % 60;
local.tm_hour = tim / 60;
local.tm_mday = day;
local.tm_mon = mon;
local.tm_year = yr-1900;
@@ -1174,6 +1244,144 @@ int CalcMinsFromUTC(int jul, int tim, int *mins, int *isdst)
return 0;
}
static char const *OutputEscapeSequences(char const *s, int print)
{
while (*s == 0x1B && *(s+1) == '[') {
if (print) putchar(*s);
s++;
if (print) putchar(*s);
s++;
while (*s && (*s < 0x40 || *s > 0x7E)) {
if (print) putchar(*s);
s++;
}
if (*s) {
if (print) putchar(*s);
s++;
}
}
return s;
}
#ifdef REM_USE_WCHAR
#define ISWBLANK(c) (iswspace(c) && (c) != '\n')
static wchar_t const *OutputEscapeSequencesWS(wchar_t const *s, int print)
{
while (*s == 0x1B && *(s+1) == '[') {
if (print) PutWideChar(*s);
s++;
if (print) PutWideChar(*s);
s++;
while (*s && (*s < 0x40 || *s > 0x7E)) {
if (print) PutWideChar(*s);
s++;
}
if (*s) {
if (print) PutWideChar(*s);
s++;
}
}
return s;
}
static void
FillParagraphWCAux(wchar_t const *s)
{
int line = 0;
int i, j;
int doublespace = 1;
int pendspace;
int len;
wchar_t const *t;
int roomleft;
/* Start formatting */
while(1) {
/* If it's a carriage return, output it and start new paragraph */
if (*s == '\n') {
putchar('\n');
s++;
line = 0;
while(ISWBLANK(*s)) s++;
continue;
}
if (!*s) {
return;
}
/* Over here, we're at the beginning of a line. Emit the correct
number of spaces */
j = line ? SubsIndent : FirstIndent;
for (i=0; i<j; i++) {
putchar(' ');
}
/* Calculate the amount of room left on this line */
roomleft = FormWidth - j;
pendspace = 0;
/* Emit words until the next one won't fit */
while(1) {
while(ISWBLANK(*s)) s++;
if (*s == '\n') break;
while(1) {
t = s;
s = OutputEscapeSequencesWS(s, 1);
if (s == t) break;
while(ISWBLANK(*s)) s++;
}
t = s;
len = 0;
while(*s && !iswspace(*s)) {
if (*s == 0x1B && *(s+1) == '[') {
s = OutputEscapeSequencesWS(s, 0);
continue;
}
len += wcwidth(*s);
s++;
}
if (s == t) {
return;
}
if (!pendspace || len+pendspace <= roomleft) {
for (i=0; i<pendspace; i++) {
putchar(' ');
}
while(t < s) {
PutWideChar(*t);
if (strchr(EndSent, *t)) doublespace = 2;
else if (!strchr(EndSentIg, *t)) doublespace = 1;
t++;
}
} else {
s = t;
putchar('\n');
line++;
break;
}
roomleft -= len+doublespace;
pendspace = doublespace;
}
}
}
static int
FillParagraphWC(char const *s)
{
size_t len;
wchar_t *buf;
len = mbstowcs(NULL, s, 0);
if (len == (size_t) -1) return E_NO_MEM;
buf = calloc(len+1, sizeof(wchar_t));
if (!buf) return E_NO_MEM;
(void) mbstowcs(buf, s, len+1);
FillParagraphWCAux(buf);
free(buf);
return OK;
}
#endif
/***************************************************************/
/* */
/* FillParagraph */
@@ -1200,18 +1408,24 @@ void FillParagraph(char const *s)
char const *t;
int roomleft;
if (!s || !*s) return;
/* Skip leading spaces */
while(ISBLANK(*s)) s++;
if (!*s) return;
#ifdef REM_USE_WCHAR
if (FillParagraphWC(s) == OK) {
return;
}
#endif
/* Start formatting */
while(1) {
/* If it's a carriage return, output it and start new paragraph */
if (*s == '\n') {
Putchar('\n');
putchar('\n');
s++;
line = 0;
while(ISBLANK(*s)) s++;
@@ -1224,7 +1438,7 @@ void FillParagraph(char const *s)
number of spaces */
j = line ? SubsIndent : FirstIndent;
for (i=0; i<j; i++) {
Putchar(' ');
putchar(' ');
}
/* Calculate the amount of room left on this line */
@@ -1235,25 +1449,38 @@ void FillParagraph(char const *s)
while(1) {
while(ISBLANK(*s)) s++;
if (*s == '\n') break;
while(1) {
t = s;
s = OutputEscapeSequences(s, 1);
if (s == t) break;
while(ISBLANK(*s)) s++;
}
t = s;
while(*s && !isspace(*s)) s++;
len = s - t;
if (!len) {
len = 0;
while(*s && !isspace(*s)) {
if (*s == 0x1B && *(s+1) == '[') {
s = OutputEscapeSequences(s, 0);
continue;
}
s++;
len++;
}
if (s == t) {
return;
}
if (!pendspace || len+pendspace <= roomleft) {
for (i=0; i<pendspace; i++) {
Putchar(' ');
putchar(' ');
}
while(t < s) {
Putchar(*t);
putchar(*t);
if (strchr(EndSent, *t)) doublespace = 2;
else if (!strchr(EndSentIg, *t)) doublespace = 1;
t++;
}
} else {
s = t;
Putchar('\n');
putchar('\n');
line++;
break;
}
@@ -1327,13 +1554,23 @@ void UTCToLocal(int utcdate, int utctime, int *locdate, int *loctime)
/* command-line flag is supplied. */
/* */
/***************************************************************/
static sig_atomic_t got_sigint = 0;
void SigIntHandler(int d)
void
SigIntHandler(int d)
{
UNUSED(d);
signal(SIGINT, SigIntHandler);
GotSigInt();
exit(0);
got_sigint = 1;
}
int
GotSigInt(void)
{
if (got_sigint) {
got_sigint = 0;
return 1;
}
return 0;
}
void
@@ -1374,6 +1611,7 @@ ClearLastTriggers(void)
LastTrigger.warn[0] = 0;
LastTrigger.omitfunc[0] = 0;
LastTrigger.passthru[0] = 0;
DBufFree(&(LastTrigger.tags));
LastTimeTrig.ttime = NO_TIME;
LastTimeTrig.delta = NO_DELTA;
@@ -1394,8 +1632,10 @@ SaveAllTriggerInfo(Trigger const *t, TimeTrig const *tt, int trigdate, int trigt
void
SaveLastTrigger(Trigger const *t)
{
DBufFree(&(LastTrigger.tags));
memcpy(&LastTrigger, t, sizeof(LastTrigger));
DBufInit(&(LastTrigger.tags));
DBufPuts(&(LastTrigger.tags), DBufValue(&(t->tags)));
}
void
@@ -1414,3 +1654,23 @@ System(char const *cmd)
r = 1;
}
}
char const *
get_day_name(int wkday)
{
if (wkday < 0 || wkday > 6) {
return "INVALID_WKDAY";
}
if (DynamicDayName[wkday]) return DynamicDayName[wkday];
return DayName[wkday];
}
char const *
get_month_name(int mon)
{
if (mon < 0 || mon > 11) {
return "INVALID_MON";
}
if (DynamicMonthName[mon]) return DynamicMonthName[mon];
return MonthName[mon];
}

View File

@@ -5,7 +5,8 @@
/* Calculations for figuring out moon phases. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -143,7 +144,7 @@ static double phase (double, double *, double *, double *, double *, double *, d
/* */
/* jdate */
/* */
/* Convert a date and time to Julian day and fraction. */
/* Convert a date and time to DSE day and fraction. */
/* */
/***************************************************************/
static long jdate(int y, int mon, int day)
@@ -400,8 +401,8 @@ static double phase(double pdate,
double *suangdia)
{
double Day, N, M, Ec, Lambdasun, ml, MM, MN, Ev, Ae, A3, MmP,
mEc, A4, lP, V, lPP, NP, y, x, Lambdamoon,
double Day, N, M, Ec, Lambdasun, ml, MM, Ev, Ae, A3, MmP,
mEc, A4, lP, V, lPP,
MoonAge, MoonPhase,
MoonDist, MoonDFrac, MoonAng,
F, SunDist, SunAng;
@@ -431,9 +432,6 @@ static double phase(double pdate,
/* Moon's mean anomaly */
MM = fixangle(ml - 0.1114041 * Day - mmlongp);
/* Moon's ascending node mean longitude */
MN = fixangle(mlnode - 0.0529539 * Day);
/* Evection */
Ev = 1.2739 * sin(torad(2 * (ml - Lambdasun) - MM));
@@ -461,19 +459,6 @@ static double phase(double pdate,
/* 1 longitude */
lPP = lP + V;
/* Corrected longitude of the node */
NP = MN - 0.16 * sin(torad(M));
/* Y inclination coordinate */
y = sin(torad(lPP - NP)) * cos(torad(minc));
/* X inclination coordinate */
x = cos(torad(lPP - NP));
/* Ecliptic longitude */
Lambdamoon = todeg(atan2(y, x));
Lambdamoon += NP;
/* Calculation of the phase of the Moon */
/* Age of the Moon in degrees */
@@ -520,10 +505,10 @@ int MoonPhase(int date, int time)
LocalToUTC(date, time, &utcd, &utct);
/* Convert from Remind representation to year/mon/day */
FromJulian(utcd, &y, &m, &d);
FromDSE(utcd, &y, &m, &d);
/* Convert to a true Julian date -- sorry for the name clashes! */
jd = jtime(y, m, d, (utct / 60), (utct % 60), 0);
/* Convert to a Julian date */
jd = jtime(y, m, d, (utct / 60), (utct % 60), 0);
/* Calculate moon phase */
mp = 360.0 * phase(jd, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -553,8 +538,8 @@ void HuntPhase(int startdate, int starttim, int phas, int *date, int *time)
LocalToUTC(startdate, starttim, &utcd, &utct);
/* Convert from Remind representation to year/mon/day */
FromJulian(utcd, &y, &m, &d);
/* Convert to a true Julian date -- sorry for the name clashes! */
FromDSE(utcd, &y, &m, &d);
/* Convert to a true Julian date */
jdorig = jtime(y, m, d, (utct / 60), (utct % 60), 0);
jd = jdorig - 45.0;
nt1 = meanphase(jd, 0.0, &k1);
@@ -572,7 +557,7 @@ void HuntPhase(int startdate, int starttim, int phas, int *date, int *time)
jyear(jd, &y, &m, &d);
jhms(jd, &h, &min, &s);
d1 = Julian(y, m, d);
d1 = DSE(y, m, d);
t1 = h*60 + min;
UTCToLocal(d1, t1, date, time);
}

View File

@@ -6,7 +6,8 @@
/* the data structures for OMITted dates. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -28,6 +29,8 @@ static void InsertIntoSortedArray (int *array, int num, int key);
static int FullOmitArray[MAX_FULL_OMITS];
static int PartialOmitArray[MAX_PARTIAL_OMITS];
/* WeekdayOmits is declared in global.h */
/* How many of each omit types do we have? */
static int NumFullOmits, NumPartialOmits;
@@ -37,6 +40,7 @@ typedef struct omitcontext {
int numfull, numpart;
int *fullsave;
int *partsave;
int weekdaysave;
} OmitContext;
/* The stack of saved omit contexts */
@@ -52,6 +56,7 @@ static OmitContext *SavedOmitContexts = NULL;
int ClearGlobalOmits(void)
{
NumFullOmits = NumPartialOmits = 0;
WeekdayOmits = 0;
return OK;
}
@@ -113,6 +118,7 @@ int PushOmitContext(ParsePtr p)
context->numfull = NumFullOmits;
context->numpart = NumPartialOmits;
context->weekdaysave = WeekdayOmits;
context->fullsave = malloc(NumFullOmits * sizeof(int));
if (NumFullOmits && !context->fullsave) {
free(context);
@@ -154,6 +160,7 @@ int PopOmitContext(ParsePtr p)
if (!c) return E_POP_NO_PUSH;
NumFullOmits = c->numfull;
NumPartialOmits = c->numpart;
WeekdayOmits = c->weekdaysave;
/* Copy the context over */
for (i=0; i<NumFullOmits; i++)
@@ -181,7 +188,7 @@ int PopOmitContext(ParsePtr p)
/* OK or an error code. */
/* */
/***************************************************************/
int IsOmitted(int jul, int localomit, char const *omitfunc, int *omit)
int IsOmitted(int dse, int localomit, char const *omitfunc, int *omit)
{
int y, m, d;
@@ -193,7 +200,7 @@ int IsOmitted(int jul, int localomit, char const *omitfunc, int *omit)
int r;
Value v;
FromJulian(jul, &y, &m, &d);
FromDSE(dse, &y, &m, &d);
sprintf(expr, "%s('%04d-%02d-%02d')",
omitfunc, y, m+1, d);
s = expr;
@@ -208,18 +215,24 @@ int IsOmitted(int jul, int localomit, char const *omitfunc, int *omit)
}
/* Is it omitted because of local omits? */
if (localomit & (1 << (jul % 7))) {
if (localomit & (1 << (dse % 7))) {
*omit = 1;
return OK;
}
/* Is it omitted because of global weekday omits? */
if (WeekdayOmits & (1 << (dse % 7))) {
*omit = 1;
return OK;
}
/* Is it omitted because of fully-specified omits? */
if (BexistsIntArray(FullOmitArray, NumFullOmits, jul)) {
if (BexistsIntArray(FullOmitArray, NumFullOmits, dse)) {
*omit = 1;
return OK;
}
FromJulian(jul, &y, &m, &d);
FromDSE(dse, &y, &m, &d);
if (BexistsIntArray(PartialOmitArray, NumPartialOmits, (m << 5) + d)) {
*omit = 1;
return OK;
@@ -271,7 +284,6 @@ static void InsertIntoSortedArray(int *array, int num, int key)
*cur = key;
}
static int DoThroughOmit(ParsePtr p, int y, int m, int d);
static void DumpOmits(void);
/***************************************************************/
@@ -283,11 +295,16 @@ static void DumpOmits(void);
/***************************************************************/
int DoOmit(ParsePtr p)
{
int y = NO_YR, m = NO_MON, d = NO_DAY, r;
int y[2] = {NO_YR, NO_YR}, m[2] = {NO_MON, NO_MON}, d[2] = {NO_DAY, NO_DAY}, r;
Token tok;
int parsing=1;
int parsing = 1;
int seen_through = 0;
int syndrome;
int not_first_token = -1;
int start, end, tmp;
int wd = 0;
int mc, dc;
DynamicBuffer buf;
DBufInit(&buf);
@@ -298,9 +315,15 @@ int DoOmit(ParsePtr p)
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;
case T_WkDay:
DBufFree(&buf);
if (wd & (1 << tok.val)) return E_WD_TWICE;
wd |= (1 << tok.val);
break;
case T_Dumpvars:
DBufFree(&buf);
if (not_first_token) return E_PARSE_ERR;
r = VerifyEoln(p);
if (r != OK) return r;
DumpOmits();
@@ -308,28 +331,28 @@ int DoOmit(ParsePtr p)
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);
if (y[seen_through] != NO_YR) return E_YR_TWICE;
if (m[seen_through] != NO_MON) return E_MON_TWICE;
if (d[seen_through] != NO_DAY) return E_DAY_TWICE;
FromDSE(tok.val, &y[seen_through], &m[seen_through], &d[seen_through]);
break;
case T_Year:
DBufFree(&buf);
if (y != NO_YR) return E_YR_TWICE;
y = tok.val;
if (y[seen_through] != NO_YR) return E_YR_TWICE;
y[seen_through] = tok.val;
break;
case T_Month:
DBufFree(&buf);
if (m != NO_MON) return E_MON_TWICE;
m = tok.val;
if (m[seen_through] != NO_MON) return E_MON_TWICE;
m[seen_through] = tok.val;
break;
case T_Day:
DBufFree(&buf);
if (d != NO_DAY) return E_DAY_TWICE;
d = tok.val;
if (d[seen_through] != NO_DAY) return E_DAY_TWICE;
d[seen_through] = tok.val;
break;
case T_Delta:
@@ -338,8 +361,10 @@ int DoOmit(ParsePtr p)
case T_Through:
DBufFree(&buf);
if (y == NO_YR || m == NO_MON || d == NO_DAY) return E_INCOMPLETE;
return DoThroughOmit(p, y, m, d);
if (wd) return E_PARSE_ERR;
if (seen_through) return E_UNTIL_TWICE;
seen_through = 1;
break;
case T_Empty:
case T_Comment:
@@ -358,131 +383,113 @@ int DoOmit(ParsePtr p)
return E_UNKNOWN_TOKEN;
}
}
if (m == NO_MON || d == NO_DAY) return E_SPEC_MON_DAY;
if (y == NO_YR) {
if (NumPartialOmits == MAX_PARTIAL_OMITS) return E_2MANY_PART;
if (wd) {
if (y[0] != NO_YR || m[0] != NO_MON || d[0] != NO_DAY) {
return E_PARSE_ERR;
}
if ((WeekdayOmits | wd) == 0x7F) {
return E_2MANY_LOCALOMIT;
}
WeekdayOmits |= wd;
if (tok.type == T_Tag || tok.type == T_Duration || tok.type == T_RemType || tok.type == T_Priority) return E_PARSE_AS_REM;
return OK;
}
if (d > MonthDays[m]) return E_BAD_DATE;
syndrome = (m<<5) + d;
if (!BexistsIntArray(PartialOmitArray, NumPartialOmits, syndrome)) {
InsertIntoSortedArray(PartialOmitArray, NumPartialOmits, syndrome);
NumPartialOmits++;
}
if (!seen_through) {
/* We must have at least a month */
if (m[0] == NO_MON) return E_SPEC_MON;
m[1] = m[0];
y[1] = y[0];
if (d[0] == NO_DAY) {
d[0] = 1;
if (y[0] == NO_YR) {
d[1] = MonthDays[m[0]];
} else {
d[1] = DaysInMonth(m[0], y[0]);
}
} else {
d[1] = d[0];
m[1] = m[0];
y[1] = y[0];
}
} else {
if (d > DaysInMonth(m, y)) return E_BAD_DATE;
syndrome = Julian(y, m, d);
r = AddGlobalOmit(syndrome);
if (r) {
return r;
if (m[0] == NO_MON) return E_SPEC_MON;
if (m[1] == NO_MON) return E_SPEC_MON;
if ((y[0] != NO_YR && y[1] == NO_YR) ||
(y[0] == NO_YR && y[1] != NO_YR)) {
return E_BAD_DATE;
}
if (d[0] == NO_DAY) d[0] = 1;
if (d[1] == NO_DAY) {
if (y[1] == NO_YR) {
d[1] = MonthDays[m[1]];
} else {
d[1] = DaysInMonth(m[1], y[1]);
}
}
}
if (y[0] == NO_YR) {
/* Partial OMITs */
if (d[0] > MonthDays[m[0]]) return E_BAD_DATE;
if (d[1] > MonthDays[m[1]]) return E_BAD_DATE;
dc = d[0];
mc = m[0];
while(1) {
syndrome = (mc<<5) + dc;
if (!BexistsIntArray(PartialOmitArray, NumPartialOmits, syndrome)) {
InsertIntoSortedArray(PartialOmitArray, NumPartialOmits, syndrome);
NumPartialOmits++;
}
if (mc == m[1] && dc == d[1]) {
break;
}
dc++;
if (dc > MonthDays[mc]) {
dc = 1;
mc++;
if (mc > 11) {
mc = 0;
}
}
}
} else {
/* Full OMITs */
if (d[0] > DaysInMonth(m[0], y[0])) return E_BAD_DATE;
if (d[1] > DaysInMonth(m[1], y[1])) return E_BAD_DATE;
start = DSE(y[0], m[0], d[0]);
end = DSE(y[1], m[1], d[1]);
if (end < start) {
Eprint("Error: THROUGH date earlier than start date");
return E_BAD_DATE;
}
for (tmp = start; tmp <= end; tmp++) {
if (!BexistsIntArray(FullOmitArray, NumFullOmits, tmp)) {
if (NumFullOmits >= MAX_FULL_OMITS) return E_2MANY_FULL;
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;
}
int
AddGlobalOmit(int jul)
AddGlobalOmit(int dse)
{
if (NumFullOmits == MAX_FULL_OMITS) return E_2MANY_FULL;
if (!BexistsIntArray(FullOmitArray, NumFullOmits, jul)) {
InsertIntoSortedArray(FullOmitArray, NumFullOmits, jul);
if (!BexistsIntArray(FullOmitArray, NumFullOmits, dse)) {
InsertIntoSortedArray(FullOmitArray, NumFullOmits, dse);
NumFullOmits++;
}
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, &yend, &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)
{
@@ -493,7 +500,7 @@ DumpOmits(void)
printf("\tNone.\n");
} else {
for (i=0; i<NumFullOmits; i++) {
FromJulian(FullOmitArray[i], &y, &m, &d);
FromDSE(FullOmitArray[i], &y, &m, &d);
printf("\t%04d%c%02d%c%02d\n",
y, DateSep, m+1, DateSep, d);
}
@@ -508,5 +515,15 @@ DumpOmits(void)
printf("\t%02d%c%02d\n", m+1, DateSep, d);
}
}
printf("Global Weekday OMITs:\n");
if (WeekdayOmits == 0) {
printf("\tNone.\n");
} else {
for (i=0; i<7; i++) {
if (WeekdayOmits & (1<<i)) {
printf("\t%s\n", EnglishDayName[i]);
}
}
}
}

View File

@@ -5,7 +5,8 @@
/* Function Prototypes. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -22,9 +23,11 @@
#define isempty(c) (isspace(c) || ((c) == '\\'))
#include "dynbuf.h"
#include <ctype.h>
int CallUserFunc (char const *name, int nargs, ParsePtr p);
int DoFset (ParsePtr p);
int DoFunset (ParsePtr p);
void ProduceCalendar (void);
char const *SimpleTime (int tim);
char const *CalendarTime (int tim, int duration);
@@ -32,11 +35,11 @@ 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 TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int dse);
int ShouldTriggerReminder (Trigger *t, TimeTrig *tim, int dse, int *err);
int DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse, int mode);
int DoSubstFromString (char const *source, DynamicBuffer *dbuf, int dse, int tim);
int ParseLiteralDate (char const **s, int *dse, int *tim);
int ParseLiteralTime (char const **s, int *tim);
int EvalExpr (char const **e, Value *v, ParsePtr p);
int DoCoerce (char type, Value *v);
@@ -44,17 +47,18 @@ 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 DoInclude (ParsePtr p, enum TokTypes tok);
int DoIncludeCmd (ParsePtr p);
int IncludeFile (char const *fname);
int GetAccessDate (char const *file);
int SetAccessDate (char const *fname, int jul);
int SetAccessDate (char const *fname, int dse);
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 DSE (int year, int month, int day);
void FromDSE (int dse, int *y, int *m, int *d);
int JulianToGregorianOffset(int y, int m);
int ParseChar (ParsePtr p, int *err, int peek);
int ParseToken (ParsePtr p, DynamicBuffer *dbuf);
int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf);
@@ -62,6 +66,7 @@ int EvaluateExpr (ParsePtr p, Value *v);
int Evaluate (char const **s, Var *locals, ParsePtr p);
int FnPopValStack (Value *val);
void Eprint (char const *fmt, ...);
void Wprint (char const *fmt, ...);
void OutputLine (FILE *fp);
void CreateParser (char const *s, ParsePtr p);
void DestroyParser (ParsePtr p);
@@ -83,7 +88,7 @@ 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 IsOmitted (int dse, 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);
@@ -117,24 +122,24 @@ 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);
int InsertIntoSortBuffer (int dse, 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);
void DSEToHeb (int dse, 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 HebToDSE (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 GetNextHebrewDate (int dsestart, 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);
int CalcMinsFromUTC (int dse, 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);
@@ -142,7 +147,7 @@ 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);
int GotSigInt (void);
void PurgeEchoLine(char const *fmt, ...);
void FreeTrig(Trigger *t);
void AppendTag(DynamicBuffer *buf, char const *s);
@@ -153,16 +158,31 @@ void SaveLastTimeTrig(TimeTrig const *t);
void SaveAllTriggerInfo(Trigger const *t, TimeTrig const *tt, int trigdate, int trigtime, int valid);
void PerIterationInit(void);
char const *Decolorize(int r, int g, int b);
char const *Colorize(int r, int g, int b);
char const *Decolorize(void);
char const *Colorize(int r, int g, int b, int bg, int clamp);
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 PrintJSONKeyPairDate(char const *name, int dse);
void PrintJSONKeyPairDateTime(char const *name, int dt);
void PrintJSONKeyPairTime(char const *name, int t);
void System(char const *cmd);
int ShellEscape(char const *in, DynamicBuffer *out);
int AddGlobalOmit(int jul);
int AddGlobalOmit(int dse);
void set_lat_and_long_from_components(void);
void set_components_from_lat_and_long(void);
char const *get_day_name(int wkday);
char const *get_month_name(int mon);
int push_call(char const *filename, char const *func, int lineno);
void clear_callstack(void);
int have_callstack(void);
int print_callstack(FILE *fp);
void pop_call(void);
#ifdef REM_USE_WCHAR
#define _XOPEN_SOURCE 600
#include <wctype.h>
#include <wchar.h>
void PutWideChar(wchar_t const wc);
#endif

View File

@@ -5,7 +5,8 @@
/* Queue up reminders for subsequent execution. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -57,8 +58,9 @@ 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 DaemonWait (struct timeval *sleep_tv);
static void reread (void);
static void PrintQueue(void);
/***************************************************************/
/* */
@@ -74,6 +76,7 @@ int QueueReminder(ParsePtr p, Trigger *trig,
QueuedRem *qelem;
if (DontQueue ||
trig->noqueue ||
tim->ttime == NO_TIME ||
trig->typ == CAL_TYPE ||
tim->ttime < SystemTime(0) / 60 ||
@@ -121,9 +124,12 @@ void HandleQueuedReminders(void)
unsigned SleepTime;
Parser p;
Trigger trig;
struct timeval tv;
struct timeval sleep_tv;
struct sigaction sa;
/* Suppress the BANNER from being issued */
NumTriggered = 1;
DidMsgReminder = 1;
/* Turn off sorting -- otherwise, TriggerReminder has no effect! */
SortByDate = 0;
@@ -159,7 +165,11 @@ void HandleQueuedReminders(void)
q = q->next;
}
if (!DontFork || Daemon) signal(SIGINT, SigIntHandler);
if (!DontFork || Daemon) {
sa.sa_handler = SigIntHandler;
sa.sa_flags = 0;
(void) sigaction(SIGINT, &sa, NULL);
}
/* Sit in a loop, issuing reminders when necessary */
while(1) {
@@ -182,20 +192,30 @@ void HandleQueuedReminders(void)
while (TimeToSleep > 0L) {
SleepTime = TimeToSleep;
if (Daemon > 0 && SleepTime > (unsigned int) 60*Daemon) SleepTime = 60*Daemon;
if (Daemon > 0 && SleepTime > (unsigned int) 60*Daemon) {
SleepTime = 60*Daemon;
}
/* Wake up once a minute to recalibrate sleep time in
case of laptop hibernation */
if (Daemon <= 0) {
if (Daemon < 0) {
/* Wake up on the next exact minute */
SleepTime = 60 - (SystemTime(1)%60);
}
if (Daemon >= 0) {
sleep(SleepTime);
gettimeofday(&tv, NULL);
sleep_tv.tv_sec = 60 - (tv.tv_sec % 60);
if (tv.tv_usec != 0 && sleep_tv.tv_sec != 0) {
sleep_tv.tv_sec--;
sleep_tv.tv_usec = 1000000 - tv.tv_usec;
} else {
sleep_tv.tv_usec = 0;
}
DaemonWait(&sleep_tv);
} else {
DaemonWait(SleepTime);
}
sleep(SleepTime);
}
if (GotSigInt()) {
PrintQueue();
}
/* If not in daemon mode and day has rolled around,
exit -- not much we can do. */
@@ -224,7 +244,7 @@ void HandleQueuedReminders(void)
/* Do NOT trigger the reminder if tt.nexttime is more than a
minute in the past. This can happen if the clock is
changed or a laptop awakes from hibernation.
However, DO triger if tt.nexttime == tt.ttime so all
However, DO trigger if tt.nexttime == tt.ttime so all
queued reminders are triggered at least once. */
if ((SystemTime(1) - (q->tt.nexttime * 60) <= 60) ||
(q->tt.nexttime == q->tt.ttime)) {
@@ -246,8 +266,8 @@ void HandleQueuedReminders(void)
/* 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);
SaveAllTriggerInfo(&(q->t), &(q->tt), DSEToday, q->tt.ttime, 1);
(void) TriggerReminder(&p, &trig, &q->tt, DSEToday);
if (Daemon < 0) {
printf("NOTE endreminder\n");
}
@@ -329,13 +349,13 @@ static QueuedRem *FindNextReminder(void)
/***************************************************************/
/* */
/* GotSigInt */
/* PrintQueue */
/* */
/* Split out what's done on a SIGINT from the SIGINT Handler. */
/* This will be necessary for OS/2 multithreaded. */
/* For debugging: Print queue contents to STDOUT */
/* */
/***************************************************************/
void GotSigInt(void)
static
void PrintQueue(void)
{
QueuedRem *q = QueueHead;
@@ -360,6 +380,7 @@ void GotSigInt(void)
q = q->next;
}
printf(NL);
printf("To terminate program, send SIGQUIT (probably Ctrl-\\ on the keyboard.)%s", NL);
}
/***************************************************************/
@@ -519,19 +540,16 @@ json_queue(QueuedRem const *q)
/* Sleep or read command from stdin in "daemon -1" mode */
/* */
/***************************************************************/
static void DaemonWait(unsigned int sleeptime)
static void DaemonWait(struct timeval *sleep_tv)
{
fd_set readSet;
struct timeval timeout;
int retval;
int y, m, d;
char cmdLine[256];
FD_ZERO(&readSet);
FD_SET(0, &readSet);
timeout.tv_sec = sleeptime;
timeout.tv_usec = 0;
retval = select(1, &readSet, NULL, NULL, &timeout);
retval = select(1, &readSet, NULL, NULL, sleep_tv);
/* If date has rolled around, restart */
if (RealToday != SystemDate(&y, &m, &d)) {

View File

@@ -5,7 +5,8 @@
/* Print a PostScript calendar. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -146,9 +147,9 @@ put_escaped_string(char const *s)
{
while(*s) {
if (*s == '\\' || *s == '(' || *s == ')') {
PutChar('\\');
putchar('\\');
}
PutChar(*s);
putchar(*s);
s++;
}
}
@@ -349,7 +350,7 @@ int main(int argc, char *argv[])
!strcmp(DBufValue(&buf), PSBEGIN2)) {
if (!validfile) {
if (Verbose) {
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-2021 by Dianne Skoll\n\n", VERSION);
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-2023 by Dianne Skoll\n\n", VERSION);
fprintf(stderr, "Generating PostScript calendar\n");
}
}
@@ -383,6 +384,7 @@ void DoPsCal(void)
int firstcol;
DynamicBuffer buf;
CalEntry *c, *d, *p;
char *s;
/* Read the month and year name, followed by # days in month and 1st day of
month */
@@ -391,12 +393,28 @@ void DoPsCal(void)
sscanf(DBufValue(&buf), "%s %s %d %d %d", month, year, &days, &wkday,
&MondayFirst);
/* Replace underscores in month name with spaces */
s = month;
while(*s) {
if (*s == '_') *s = ' ';
s++;
}
/* Get day names */
DBufGets(&buf, stdin);
sscanf(DBufValue(&buf), "%32s %32s %32s %32s %32s %32s %32s",
DayName[0], DayName[1], DayName[2], DayName[3],
DayName[4], DayName[5], DayName[6]);
/* Replace underscores in day names with spaces */
for (i=0; i<7; i++) {
s = DayName[i];
while(*s) {
if (*s == '_') *s = ' ';
s++;
}
}
/* We write the prolog here because it's only at this point that
MondayFirst is set correctly. */
if (validfile == 1) {
@@ -407,6 +425,19 @@ void DoPsCal(void)
sscanf(DBufValue(&buf), "%s %d", prevm, &prevdays);
DBufGets(&buf, stdin);
sscanf(DBufValue(&buf), "%s %d", nextm, &nextdays);
/* Replace underscores with spaces in names of next/prev month */
s = prevm;
while(*s) {
if (*s == '_') *s = ' ';
s++;
}
s = nextm;
while(*s) {
if (*s == '_') *s = ' ';
s++;
}
DBufFree(&buf);
MaxDay = days;
FirstWkDay = wkday;
@@ -595,7 +626,7 @@ void WriteProlog(void)
strcmp(SmallFont, DayFont) &&
strcmp(TitleFont, SmallFont) &&
strcmp(SmallFont, EntryFont)) printf(" %s", SmallFont);
PutChar('\n');
putchar('\n');
printf("%%%%Creator: Rem2PS\n");
printf("%%%%Pages: (atend)\n");
printf("%%%%Orientation: %s\n", PortraitMode ? "Portrait" : "Landscape");
@@ -775,20 +806,20 @@ void WriteOneEntry(CalEntry *c)
}
}
PutChar('(');
putchar('(');
while(*s) {
/* Use the "unsigned char" cast to fix problem on Solaris 2.5 */
/* which treated some latin1 characters as white space. */
ch = (unsigned char) *s++;
if (ch == '\\' || ch == '(' || ch == ')') PutChar('\\');
if (!isspace(ch)) PutChar(ch);
if (ch == '\\' || ch == '(' || ch == ')') putchar('\\');
if (!isspace(ch)) putchar(ch);
else {
PutChar(')');
putchar(')');
while(isspace((unsigned char)*s)) s++;
if (!*s) {
goto finish;
}
PutChar('(');
putchar('(');
}
}
printf(")\n");

View File

@@ -5,7 +5,8 @@
/* Define the PostScript prologue */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -13,7 +14,7 @@ char *PSProlog1[] =
{
"% This file was produced by Remind and Rem2PS, written by",
"% Dianne Skoll.",
"% Remind and Rem2PS are Copyright 1992-2021 Dianne Skoll.",
"% Remind and Rem2PS are Copyright 1992-2023 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",

View File

@@ -5,7 +5,8 @@
/* Routines for sorting reminders by trigger date */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2023 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -34,8 +35,8 @@ typedef struct sortrem {
/* The sorted reminder queue */
static Sortrem *SortedQueue = (Sortrem *) NULL;
static Sortrem *MakeSortRem (int jul, int tim, char const *body, int typ, int prio);
static void IssueSortBanner (int jul);
static Sortrem *MakeSortRem (int dse, int tim, char const *body, int typ, int prio);
static void IssueSortBanner (int dse);
/***************************************************************/
/* */
@@ -44,7 +45,7 @@ static void IssueSortBanner (int jul);
/* Create a new Sortrem entry - return NULL on failure. */
/* */
/***************************************************************/
static Sortrem *MakeSortRem(int jul, int tim, char const *body, int typ, int prio)
static Sortrem *MakeSortRem(int dse, int tim, char const *body, int typ, int prio)
{
Sortrem *new = NEW(Sortrem);
if (!new) return NULL;
@@ -55,7 +56,7 @@ static Sortrem *MakeSortRem(int jul, int tim, char const *body, int typ, int pri
return NULL;
}
new->trigdate = jul;
new->trigdate = dse;
new->trigtime = tim;
new->typ = typ;
new->priority = prio;
@@ -70,9 +71,9 @@ static Sortrem *MakeSortRem(int jul, int tim, char const *body, int typ, int pri
/* Insert a reminder into the sort buffer */
/* */
/***************************************************************/
int InsertIntoSortBuffer(int jul, int tim, char const *body, int typ, int prio)
int InsertIntoSortBuffer(int dse, int tim, char const *body, int typ, int prio)
{
Sortrem *new = MakeSortRem(jul, tim, body, typ, prio);
Sortrem *new = MakeSortRem(dse, tim, body, typ, prio);
Sortrem *cur = SortedQueue, *prev = NULL;
int ShouldGoAfter;
@@ -168,7 +169,7 @@ void IssueSortedReminders(void)
/* defined to take one argument. */
/* */
/***************************************************************/
static void IssueSortBanner(int jul)
static void IssueSortBanner(int dse)
{
char BanExpr[64];
int y, m, d;
@@ -178,13 +179,13 @@ static void IssueSortBanner(int jul)
if (UserFuncExists("sortbanner") != 1) return;
FromJulian(jul, &y, &m, &d);
FromDSE(dse, &y, &m, &d);
sprintf(BanExpr, "sortbanner('%04d/%02d/%02d')", y, m+1, d);
y = EvalExpr(&s, &v, NULL);
if (y) return;
if (DoCoerce(STR_TYPE, &v)) return;
DBufInit(&buf);
if (!DoSubstFromString(v.v.str, &buf, jul, NO_TIME)) {
if (!DoSubstFromString(v.v.str, &buf, dse, NO_TIME)) {
if (*DBufValue(&buf)) printf("%s\n", DBufValue(&buf));
DBufFree(&buf);
}

View File

@@ -4,8 +4,23 @@
ALL=`grep ^#define lang.h | grep -v '#define LANG' | awk '{print $2}'`
OUTPUT_COMPILED=lang-compiled.out
OUTPUT_RUNTIME=lang-runtime.out
cat /dev/null > $OUTPUT_COMPILED
cat /dev/null > $OUTPUT_RUNTIME
for i in $ALL ; do
make clean all LANGDEF=-DLANG=$i || exit 1
./remind -q -r ../tests/tstlang.rem
make clean
make -j`nproc` all LANGDEF=-DLANG=$i || exit 1
./remind -q -r ../tests/tstlang.rem >> $OUTPUT_COMPILED 2>&1
done
# Rebuild English version
make clean
make -j`nproc` all || exit 1
ALL=`ls ../include/lang/*.rem`
for i in $ALL; do
./remind -q -r "-ii=\"$i\"" ../tests/tstlang.rem >> $OUTPUT_RUNTIME 2>&1
done
exit 0

Some files were not shown because too many files have changed in this diff Show More