Compare commits

..

33 Commits

Author SHA1 Message Date
Dianne Skoll aef5b353cd Add a missing update.
Remind unit tests / tests (push) Successful in 28s
2025-01-06 10:40:25 -05:00
Dianne Skoll 8a99c29533 Update WHATSNEW in preparation for release.
Remind unit tests / tests (push) Successful in 33s
2025-01-05 12:14:04 -05:00
Dianne Skoll 0bf2b0772a Bump version to 05.02.02.
Remind unit tests / tests (push) Successful in 1m41s
2025-01-05 10:34:28 -05:00
Dianne Skoll a033a48acd Make rem2html support weekly calendars.
Remind unit tests / tests (push) Successful in 1m29s
rem2html is a mess and needs refactoring, but oh well... it works.
2025-01-04 18:10:34 -05:00
Dianne Skoll 0feb81c8cc Make "rem2html" accept "remind -ppp" as input (as well as -p and -pp) 2025-01-04 17:07:06 -05:00
Dianne Skoll 1850607542 Use hex constants for flags that are bitmasks.
Remind unit tests / tests (push) Successful in 37s
2024-12-31 15:26:18 -05:00
Dianne Skoll 213138a7b7 Split the "-ds" debug flag into "-ds" and "-dh"
-ds prints parsed expressions
   -dh dumps hash-table statistics on exit.
2024-12-31 12:50:15 -05:00
Dianne Skoll 562cec3dc8 Mass-update copyright date to 2025. 2024-12-29 13:47:07 -05:00
Dianne Skoll 18b57d26b4 Properly detect and handle requests for multi-page --svg or --eps output.
Remind unit tests / tests (push) Successful in 42s
2024-12-26 09:38:05 -05:00
Dianne Skoll c80d72f623 Add --weeks-per-page option.
Remind unit tests / tests (push) Successful in 44s
2024-12-25 13:29:51 -05:00
Dianne Skoll 2739a41651 If we ask for multiple weekly calendars, render then two weeks to a page. 2024-12-25 10:37:18 -05:00
Dianne Skoll 5a56f4c61b Pass in index and total number of calendars to "render". 2024-12-25 10:00:21 -05:00
Dianne Skoll 77080ff600 Make copyright notices consistent.
Remind unit tests / tests (push) Successful in 37s
2024-12-24 20:02:08 -05:00
Dianne Skoll c4aa21ff51 Remove unused functions. 2024-12-24 15:05:15 -05:00
Dianne Skoll 34c513ba3b Add $CalType system variable. 2024-12-24 14:45:57 -05:00
Dianne Skoll 35c16a060a Fix typo again.
Remind unit tests / tests (push) Successful in 1m26s
2024-12-24 13:20:19 -05:00
Dianne Skoll 69dedc577f Fix typo 2024-12-24 13:19:28 -05:00
Dianne Skoll a7d8f3c887 Support --verbose in weekly calendars 2024-12-24 13:18:19 -05:00
Dianne Skoll 800a4b15b2 Add support for weekly PDF calendars with "-p+n" Remind option. 2024-12-24 13:07:45 -05:00
Dianne Skoll 3e981fd8be Convert README file to Markdown. That is what all the cool kids use.
Remind unit tests / tests (push) Successful in 33s
2024-12-19 10:20:35 -05:00
Dianne Skoll 7c530d3068 Remove unnecesary .gitignore entry
Remind unit tests / tests (push) Successful in 1m27s
2024-12-18 11:19:45 -05:00
Dianne Skoll 58f9cf641b Remove some truly ancient docs. 2024-12-18 11:19:04 -05:00
Dianne Skoll 53906035fe Warn if a POP-OMIT-CONTEXT matches a PUSH-OMIT-CONTEXT in a different file.
Remind unit tests / tests (push) Successful in 37s
2024-12-17 17:26:51 -05:00
Dianne Skoll 4804325863 Merge branch 'fix_typo' into 'master'
Fix typo

See merge request dskoll/remind!9
2024-12-17 15:29:09 +00:00
Jochen Sprickerhof 5f5e7054f4 Fix typo 2024-12-17 09:22:42 +01:00
Dianne Skoll 078dba1e98 Prepare for 05.02.01 release.
Remind unit tests / tests (push) Successful in 28s
2024-12-16 19:37:31 -05:00
Dianne Skoll 8ebec9584c Fix incorrect comparison code. 2024-12-16 19:33:41 -05:00
Dianne Skoll 2504b39be2 Remove const qualifier.
Remind unit tests / tests (push) Successful in 32s
2024-12-16 17:10:45 -05:00
Dianne Skoll e394f402f8 Set release date.
Remind unit tests / tests (push) Successful in 32s
2024-12-16 09:31:02 -05:00
Dianne Skoll 5a2914f6c7 Start hash tables with 7 buckets instead of 17; print more detailed hash stats with -ds; consistently use ErrFp instead of stderr
Remind unit tests / tests (push) Successful in 32s
2024-12-14 11:52:16 -05:00
Dianne Skoll a19b009f7c Fix man page typo and cppcheck warnings.
Remind unit tests / tests (push) Successful in 32s
2024-12-13 15:22:46 -05:00
Dianne Skoll 6373ae8ca5 Update release notes. 2024-12-13 15:08:54 -05:00
Dianne Skoll b8c4786b33 Allow INCLUDE/DO/SYSINCLUDE to take a QuotedString argument. This allows for filenames with spaces in them. 2024-12-13 10:38:34 -05:00
91 changed files with 1137 additions and 595 deletions
-1
View File
@@ -23,7 +23,6 @@ rem2pdf/Makefile.old
rem2pdf/Makefile.top
rem2pdf/bin/rem2pdf
scripts/tkremind
set-irc-topic
src/*.tar.gz*
src/Makefile
src/config.h
+1 -1
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-2024 Dianne Skoll, except where noted in
2. REMIND is Copyright (C) 1992-2025 Dianne Skoll, except where noted in
individual files.
3. DISTRIBUTION AND USE
-78
View File
@@ -1,78 +0,0 @@
REMIND
Remind is a full-featured calendar/alarm program. Copying policy is
in the file "COPYRIGHT" in this directory.
Installation notes for various operating systems are in "docs". See
the appropriate README file for installation on your system.
Manual pages are in "man".
-----------------------------------------------------------------------------
Quick UNIX installation instructions for the very impatient:
If you have Tcl/Tk (wish 4.1 or higher) installed and are running X Windows:
--------------------------------------------------------------
1) Type: wish ./build.tk from this directory. Fill in the various
options and hit "Build Remind"
2) Type: "make install" -- you may need to be root to do this.
If you do NOT have Tcl/Tk or are NOT running X Windows:
-------------------------------------------------------
1) Edit the file "src/custom.h" according to your preferences.
2) Edit the file "src/lang.h" to choose a language.
3) Type: "./configure" (You can supply options; type "./configure --help"
for details.)
4) Type: "make"
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/
+63
View File
@@ -0,0 +1,63 @@
# REMIND
Remind is a full-featured calendar/alarm program. Copying policy is
in the file "COPYRIGHT" included with the source; Remind is licensed under
the GNU General Public License, Vesion 2.
## Prerequisites:
`remind` and `rem2ps` have no prerequisites beyond the standard C library and
the standard math library.
`rem2html` requires the `JSON::MaybeXS` Perl module and `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`
## Installation
Remind can be installed with the usual:
`./configure && make && make test && sudo make install`
You can edit `custom.h` to configure some aspects of Remind. Or, if
you have Tcl/Tk installed, you can use the graphical build tool to
edit `custom.h` on your behalf:
`wish ./build.tk`
---
Contact info: dianne@skoll.ca
Home page: [https://dianne.skoll.ca/projects/remind/](https://dianne.skoll.ca/projects/remind/)
+3 -3
View File
@@ -8,7 +8,7 @@
# A cheesy graphical front-end for building and installing REMIND.
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 Dianne Skoll
# Copyright (C) 1992-2025 Dianne Skoll
#
#--------------------------------------------------------------
@@ -487,7 +487,7 @@ proc CallMake {} {
# Michael McLennan, Bell Labs Innovations for Lucent Technologies
# Addison-Wesley Professional Computing Series
# ======================================================================
# Copyright (c) 1996-1997 Lucent Technologies Inc. and Mark Harrison
# Copyright (C) 1996-1997 Lucent Technologies Inc. and Mark Harrison
# ======================================================================
option add *Tabnotebook.tabs.background #666666 widgetDefault
@@ -601,7 +601,7 @@ proc tabnotebook_display {win name} {
# Michael McLennan, Bell Labs Innovations for Lucent Technologies
# Addison-Wesley Professional Computing Series
# ======================================================================
# Copyright (c) 1996-1997 Lucent Technologies Inc. and Mark Harrison
# Copyright (C) 1996-1997 Lucent Technologies Inc. and Mark Harrison
# ======================================================================
option add *Notebook.borderWidth 2 widgetDefault
Vendored
+9 -9
View File
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for remind 05.02.00.
# Generated by GNU Autoconf 2.71 for remind 05.02.02.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -608,8 +608,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='remind'
PACKAGE_TARNAME='remind'
PACKAGE_VERSION='05.02.00'
PACKAGE_STRING='remind 05.02.00'
PACKAGE_VERSION='05.02.02'
PACKAGE_STRING='remind 05.02.02'
PACKAGE_BUGREPORT=''
PACKAGE_URL='https://dianne.skoll.ca/projects/remind/'
@@ -1265,7 +1265,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures remind 05.02.00 to adapt to many kinds of systems.
\`configure' configures remind 05.02.02 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1327,7 +1327,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of remind 05.02.00:";;
short | recursive ) echo "Configuration of remind 05.02.02:";;
esac
cat <<\_ACEOF
@@ -1415,7 +1415,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
remind configure 05.02.00
remind configure 05.02.02
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1865,7 +1865,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by remind $as_me 05.02.00, which was
It was created by remind $as_me 05.02.02, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -4710,7 +4710,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by remind $as_me 05.02.00, which was
This file was extended by remind $as_me 05.02.02, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -4775,7 +4775,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
remind config.status 05.02.00
remind config.status 05.02.02
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
+1 -1
View File
@@ -1,6 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(remind, 05.02.00, , , https://dianne.skoll.ca/projects/remind/)
AC_INIT(remind, 05.02.02, , , https://dianne.skoll.ca/projects/remind/)
AC_CONFIG_SRCDIR([src/queue.c])
cat <<'EOF'
+2 -2
View File
@@ -130,8 +130,8 @@
(defconst remind-builtin-variables
(sort
(list " $AddBlankLines" "$Ago" "$Am" "$And" "$April" "$At" "$August"
"$CalcUTC" "$CalMode" "$Daemon" "$DateSep" "$DateTimeSep" "$December"
"$DedupeReminders" "$DefaultColor" "$DefaultDelta"
"$CalcUTC" "$CalMode" "$CalType" "$Daemon" "$DateSep" "$DateTimeSep"
"$December" "$DedupeReminders" "$DefaultColor" "$DefaultDelta"
"$DefaultPrio" "$DefaultTDelta" "$DeltaOverride"
"$DontFork" "$DontQueue" "$DontTrigAts" "$EndSent" "$EndSentIg"
"$ExpressionTimeLimit" "$February" "$FirstIndent" "$FoldYear"
+4 -79
View File
@@ -1,6 +1,6 @@
REMIND version 3.2 for UNIX
Remind for UNIX and Linux
REMIND is a sophisticated alarm/calendar program. Details are given
Remind is a sophisticated alarm/calendar program. Details are given
in the man page, "remind.1".
INSTALLING REMIND:
@@ -19,88 +19,13 @@ If you do NOT have Tcl/Tk or are NOT running X11:
1) Edit the file "src/custom.h" according to your preferences.
2) Edit the file "src/lang.h" to choose a language.
2) Type: "make"
3) Type: "make"
4) Type: "make install" -- you may need to be root to do this.
3) Type: "make install" -- you may need to be root to do this.
The subdirectory "www" contains scripts for making a nice calendar
web server. See the files README and Makefile in that directory.
The file "examples/defs.rem" has some sample Remind definitions and
commands, as well as U.S. and Jewish holidays.
OTHER LANGUAGE SUPPORT
Remind has support for languages other than English. See the file
"src/lang.h" for details. The language support may vary - you can change
only the substitution filter, or you can translate all of the usage
instructions and error messages as well. See "src/langs/french.h" for an
example of the latter.
To compile Remind for a non-english language, look at the constants
defined in "src/lang.h". Then, to compile Remind for Italian (as an
example), type:
make "LANGDEF=-DLANG=ITALIAN"
If you add support for a non-English language, Remind will accept both the
English and non-English names of months and weekdays in an input script.
However, you should not rely on this feature if you want to write portable
Remind scripts.
At a minimum, you should support month and day names in the foreign
language, and should modify the substitution filter appropriately.
If you are truly diligent, you can translate usage and error messages
too.
Take a look at the files "src/langs/english.h" and
"src/langs/german.h" if you want to add support for your favourite
language. If you do add another language to Remind, please let me
know! Here are the basic guidelines:
- Your language file should be called "src/langs/lxxx.h", where lxxx
is the first 8 characters of the ENGLISH name of your language.
- Your language file should define L_LANGNAME to be the full English
name of your language, with the first letter capitalized and the rest
lower-case.
- 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
If you're running under X11 and you have the Tcl tools, you can create
simple pop-up reminders by creating the following Tcl script called
'popup'. It pops a message on to the screen and waits for you to
press the 'OK' button. If you don't press the OK button within 15
seconds, it exits anyway. To use it, you can use the '-k' option for
Remind as follows:
remind "-kpopup '%s'&" .reminders
Or use the following in your Remind script:
REM AT 17:00 RUN popup 'Time to go home.' &
This Tcl script is a slightly modified version of one submitted by
Norman Walsh.
-------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
#!/usr/local/bin/wish
wm withdraw .
after 15000 { destroy . ; exit }
tk_messageBox -message Message -detail $argv -icon info -type ok
destroy .
exit
-------------- Cut Here ---------- Cut Here ---------- Cut Here -------------
--
Dianne Skoll <dianne@skoll.ca>
https://dianne.skoll.ca/projects/remind/
+40 -4
View File
@@ -1,10 +1,38 @@
CHANGES TO REMIND
* VERSION 5.2 Patch 0 - ????-??=??
* VERSION 5.2 Patch 2 - 2025-01-06
- NEW FEATURE: remind: The "-p+" option lets you produce weekly calendars;
so far, the rem2pdf and rem2html back-ends support rendering of weekly
calendars.
- NEW FEATURE: remind: The $CalType system variable indicates the type of
calendar being produced; its value is one of "monthly", "weekly",
or "none". "none" signifies agenda mode rather than calendar mode.
- IMPROVEMENT: remind: Warn if a POP-OMIT-CONTEXT matches a
PUSH-OMIT-CONTEXT that is in a different file.
- CHANGE: remind: Split the "-ds" debug option into two separate options:
"-ds" for debugging expression-parsing and "-dh" for printing hash
table statistics on exit.
* VERSION 5.2 Patch 1 - 2024-12-16
- BUG FIX: remind: Fix a logic error that only showed itself on big-endian
architectures. Found thanks to Debian testing and a notification from
Jochen Sprickerhof.
* VERSION 5.2 Patch 0 - 2024-12-16
- MAJOR NEW FEATURE: remind: Add the TRANSLATE command, the _()
built-in function and the %(...) substitution sequence. These allow
you to localize your reminder files more easily.
you to localize your reminder files more easily. The translation table
is also made available to back-ends like rem2pdf and tkremind,
which they can use as they see fit.
- MINOR FEATURE: tkremind, rem2html: Localize the names of the moon
phases.
- MAJOR CHANGE: remind: Remind used to support compile-time localization
into different languages (French, English, etc.) That compile-time
@@ -27,6 +55,10 @@ CHANGES TO REMIND
INCLUDE [$SysInclude]/foo/bar.rem
- MINOR IMPROVEMENT: Allow INCLUDE, DO and SYSINCLUDE to include files with
spaces in their names; in this case, you have to put the filename inside
double-quotes.
- IMPROVEMENT: remind: Refuse to open subdirectories named "*.rem"
under a top-level directory rather than trying and failing with a
confusing error.
@@ -43,8 +75,12 @@ CHANGES TO REMIND
- MINOR FIXES: remind: Fix typos in comments; use memcpy to copy OMIT
contexts internally.
- BUG FIX: Actually allow the documented 9 levels of INCLUDE rather than
8.
- BUG FIX: remind: Actually allow the documented 9 levels of INCLUDE
rather than 8.
- BUG FIX: remind: If an INCLUDE statement failed inside an IF statement,
Remind would print spurious errors about unmatched IF/ENDIF. This has
been fixed.
* VERSION 5.1 Patch 1 - 2024-11-18
+1 -1
View File
@@ -21,7 +21,7 @@
# "#PSSTUFF" for nifty PostScript examples #
# #
# This file is part of REMIND. #
# Copyright (C) 1992-2024 Dianne Skoll #
# Copyright (C) 1992-2025 Dianne Skoll #
# SPDX-License-Identifier: GPL-2.0-only
# #
#############################################################################
+1 -1
View File
@@ -2,7 +2,7 @@
# Not all sequences are supported by all terminals.
# This file is part of REMIND
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# SPDX-License-Identifier: GPL-2.0-only
if !defined("ansi_bold")
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Catalan language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file was created by Eloi Torrents <eloitor@disroot.org>
TRANSLATE "LANGID" "ca"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Danish language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Mogens Lynnerup.
TRANSLATE "LANGID" "da"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the German language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Wolfgang Thronicke
TRANSLATE "LANGID" "de"
+1 -1
View File
@@ -1,4 +1,4 @@
# Support for the English language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# Nothing to do for English since it is the default.
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Spanish language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Rafa Couto <rafacouto@biogate.com>
TRANSLATE "LANGID" "es"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Finnish language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Mikko Silvonen
TRANSLATE "LANGID" "fi"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the French language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Laurent Duperval
TRANSLATE "LANGID" "fr"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Hellenic (Greek) language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by jarlaxl lamat (jarlaxl@freemail.gr)
TRANSLATE "LANGID" "gr"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Icelanding language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Björn Davíðsson (bjossi@snerpa.is)
TRANSLATE "LANGID" "is"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Italian language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Valerio Aimale
TRANSLATE "LANGID" "it"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Dutch language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Willem Kasdorp and Erik-Jan Vens
TRANSLATE "LANGID" "nl"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Norwegian language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Trygve Randen
TRANSLATE "LANGID" "no"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Polish language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Jerzy Sobczyk
TRANSLATE "LANGID" "pl"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the (Brazilian) Portuguese language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Marco Paganini
TRANSLATE "LANGID" "pt"
+1 -1
View File
@@ -1,6 +1,6 @@
# Support for the Romanian language.
# This file is part of REMIND.
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
# REMIND is Copyright (C) 1992-2025 by Dianne Skoll
# This file is derived from a translation by Liviu Daia
TRANSLATE "LANGID" "ro"
+58 -28
View File
@@ -637,70 +637,100 @@ However, back-ends should keep reading until EOF in case more data for
subsequent months is forthcoming.
.PP
.SH REM2PS PURE JSON INPUT FORMAT (-PPP OPTION)
\fBRemind \-ppp\fR emits \fIpure JSON\fR output. The format is
as follows:
.SH REM2PS PURE JSON INPUT FORMAT (-PPP OR -P+ OPTION)
\fBRemind \-ppp\fR and \fBremind \-p+\fR emit \fIpure JSON\fR output.
The format is as follows:
.PP
\fBRemind\fR outputs a JSON array. Each element of the array is a
\fImonth descriptor\fR.
\fImonth descriptor\fR or a \fIweek descriptor\fR in the case of
\fBremind \-p+\fR.
.PP
Each month descriptor is a JSON object with the following elements:
Each descriptor is a JSON object with the following elements:
.TP
.B caltype \fItype\fR
The calendar type, either \fBmonthly\fR or \fBweekly\fR. Older versions
of \fBRemind\fR did not include a \fBcaltype\fR element, so a missing
\fBcaltype\fR should be treated as \fBmonthly\fR.
.TP
.B monthname \fIname\fR
The name of the month.
The name of the month. Present in monthly calendar types only.
.TP
.B year \fIyyyy\fR
The year.
The year. Present in monthly calendar types only.
.TP
.B daysinmonnth \fIn\fR
The number of days in the current month.
The number of days in the current month. Present in monthly calendar types only.
.TP
.B firstwkday \fIn\fR
The weekday of the first day of the month (0 = Sunday, 1 = Monday, 6 = Saturday).
The weekday of the first day of the month (0 = Sunday, 1 = Monday, 6 = Saturday). Present in monthly calendar types only.
.TP
.B mondayfirst \fIn\fR
An indicator of whether or not the calendar week should start with
Sunday (n=0) or Monday (n=1).
Sunday (n=0) or Monday (n=1). Present in monthly calendar types only.
.TP
.B daynames \fR[\fIdays\fR]
A seven-element array of day names; each element is a string representing
the names of the days from Sunday through Saturday.
the names of the days from Sunday through Saturday. Present in monthly calendar types only.
.TP
.B prevmonthname \fIname\fR
The name of the previous month.
The name of the previous month. Present in monthly calendar types only.
.TP
.B daysinprevmonth \fIn\fR
The number of days in the previous month.
The number of days in the previous month. Present in monthly calendar types only.
.TP
.B prevmonthyear \fIyyyy\fR
The year of the previous month. (The same as \fByear\fR unless the current
month is January.)
month is January.) Present in monthly calendar types only.
.TP
.B nextmonthname \fIname\fR
The name of the following month.
The name of the following month. Present in monthly calendar types only.
.TP
.B daysinnextmonth \fIn\fR
The number of days in the following month.
The number of days in the following month. Present in monthly calendar types only.
.TP
.B nextmonthyear \fIyyyy\fR
The year of the following month. (The same as \fByear\fR unless the
current month is December.)
current month is December.) Present in monthly calendar types only.
.TP
.B translations \fR{\fIobject\fR}
A complete dump of the Remind translation table. In output for multiple
months, the translation table is included only with the first month.
months or weeks, the translation table is included only with the first month
or week. Present in both weekly and monthly calendar types.
.TP
.B entries \fR[\fIarray\fR]
The \fBentries\fR key consists of an array of calendar entries; each
entry is a JSON object that has the same format as described in the
\fBCALENDAR ENTRIES\fR section in the \fB\-PP FORMAT\fR section,
\fIwith the following difference\fR: In \fB\-PP\fR mode, if a reminder
has \fB%"\fR markers, only the text between the markers
is included in the \fBbody\fR element. In \fB\-PPP\fR mode, the
entire text \fIincluding\fR the \fB%"\fR markers is included and it's up to
the back-end to extract the portion between the markers if that
is desired.
The \fBentries\fR key, present in both weekly and monthly calendar
types, consists of an array of calendar entries; each entry is a JSON
object that has the same format as described in the \fBCALENDAR
ENTRIES\fR section in the \fB\-PP FORMAT\fR section, \fIwith the
following difference\fR: In \fB\-PP\fR mode, if a reminder has
\fB%"\fR markers, only the text between the markers is included in the
\fBbody\fR element. In \fB\-PPP\fR mode, the entire text
\fIincluding\fR the \fB%"\fR markers is included and it's up to the
back-end to extract the portion between the markers if that is
desired.
.TP
.B dates \fR[\fIarray\fR]
The \fBdates\fR key, present in weekly calendar types only,
contains seven entries; one for each column in the weekly
calendar. Each entry is a JSON object containing the following
key/value pairs:
.RS
.TP
.B date \fR\fIYYYY-MM-DD\fR
The date of the column.
.TP
.B day \fR\fIDD\fR
The day number of the column.
.TP
.B dayname \fR\fIweekday_name\fR
The name of the weekday (possibly localized).
.TP
.B month \fR\fImonth_name\fR
The name of the month (possibly localized).
.TP
.B year \fR\fIYYYY\fR
The year.
.RE
.SH AUTHOR
rem2ps was written by Dianne Skoll <dianne@skoll.ca>
+32 -20
View File
@@ -182,12 +182,18 @@ If you immediately follow the \fBs\fR with the letter
day they actually occur \fIas well as\fR on any preceding days specified
by the reminder's \fIdelta\fR.
.TP
.B \-p\fR[\fBa\fR][\fBp\fR][\fBp\fR][\fBq\fR]\fIn\fR
.B \-p\fR[\fBa\fR][\fBp\fR][\fBp\fR][\fBq\fR][+]\fIn\fR
The \fB\-p\fR option is very similar to the \fB\-s\fR option, except
that the output contains additional information for use by the
that the output contains additional information for use by a back-end such as the
\fBRem2PS\fR program, which creates a PostScript calendar, and various
other back-end programs. For this
option, \fIn\fR cannot start with "+"; it must specify a number of months.
other back-end programs. If \fIn\fR starts with "+", then it specifies
a number of weeks rather than a number of months, and back-ends are expected
to produce weekly calendars. Note that not all back-ends support
weekly calendars; currently, only \fBrem2pdf\fR does. Specifying a weekly
calendar implicitly enables the pure JSON interchange format, similar
to \fB\-ppp\fR.
.RS
.PP
The format of the \fB\-p\fR output is described in the \fBrem2ps(1)\fR
man page. If you immediately follow the \fBp\fR with the letter
\fBa\fR, then \fBRemind\fR displays reminders on the calendar on the
@@ -200,7 +206,6 @@ three p's, as in \fB\-ppp\fR, then \fBRemind\fR uses a pure JSON
format, again documented in \fBrem2ps(1)\fR. If you include a \fBq\fR
letter with this option, then the normal calendar-mode substitution filter
is disabled and the %"...%" sequences are preserved in the output.
.RS
.PP
The \fB\-p\fR, \fB\-pp\fR and \fB\-ppp\fR options implicitly enable
the \fB\-o\fR option.
@@ -310,6 +315,9 @@ Trace the reading of reminder files
Trace expression parsing and display the internal expression node
tree. This is unlikely to be useful unless you are working on
\fBRemind\fR's expression evaluation engine.
.TP
.B h
Dump hash-table statistics on exit.
.RE
.TP
\fB\-g\fR[\fBa|d\fR[\fBa|d\fR[\fBa|d\fR[\fBa|d\fR]]]]
@@ -1927,19 +1935,18 @@ commands.
.SH THE DO, INCLUDE AND SYSINCLUDE COMMANDS
.PP
\fBRemind\fR allows you to include other files in your reminder script,
similar to the C preprocessor #include directive. For example, your
system administrator may maintain a file of holidays or system-wide
reminders. You can include these in your reminder script as follows:
similar to the C preprocessor #include directive. For example, you
might organize different reminders into different files like this:
.PP
.nf
INCLUDE /usr/share/remind/holidays
INCLUDE /usr/share/remind/reminders
INCLUDE holidays.rem
INCLUDE birthdays.rem
INCLUDE "quote files with spaces.rem"
.fi
.PP
(The actual pathnames vary from system to system - ask your system
administrator.)
.PP
\fBINCLUDE\fR files can be nested up to a depth of 8.
\fBINCLUDE\fR files can be nested up to a depth of 8. As shown above, if a
filename has spaces in it (not recommended!) you can use double-quotes
around the filename.
.PP
If you specify a filename of "-" in the \fBINCLUDE\fR command, \fBRemind\fR
will begin reading from standard input.
@@ -1983,7 +1990,7 @@ symbolic links to files.
.PP
The \fBSYSINCLUDE\fR command is similar to \fBDO\fR, but it looks for
relative pathnames under the system directory containing standard reminder
scripts. For thie version of \fBRemind\fR, the system directory is
scripts. For this version of \fBRemind\fR, the system directory is
"@prefix@/share/remind".
.PP
.SH THE RUN COMMAND
@@ -2514,7 +2521,7 @@ The following system variables are defined. Those marked
All system variables hold values of type \fBINT\fR, unless otherwise
specified.
.TP
.B $AddBlankLines
.B $AddBlankLines
If set to 1 (the default), then \fBRemind\fR normally prints a blank
line after the banner and each reminder. (This can be suppressed by
ending the reminder or banner with a single percent sign.) If
@@ -2535,12 +2542,17 @@ Universal Time Coordinated in the \fB$MinsFromUTC\fR system variable.
.B $CalMode (read-only)
If non-zero, then the \fB\-c\fR option was supplied on the command line.
.TP
.B $CalType (read-only, STRING type)
If the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR command-line options were
used, then this variable has the value "monthly". If \fB\-c+\fR,
\fB\-s+\fR or \fB\-p+\fR were used, then "weekly". Otherwise, "none".
.TP
.B $Daemon (read-only)
If "daemon mode" \fB\-z\fR was invoked, contains the number of
minutes between wakeups. If not running in daemon mode, contains
0. In server mode (either \fB-z0\fR or \fB-zj\fR), contains -1.
.TP
.B $DateSep
.B $DateSep (STRING type)
This variable can be set only to "/" or "-". It holds the character
used to separate portions of a date when \fBRemind\fR prints a DATE or
DATETIME value.
@@ -2595,7 +2607,7 @@ print "bar". The third will not trigger because it's a duplicate of the
first "foo".
.RE
.TP
.B $DefaultColor
.B $DefaultColor (STRING type)
This variable can be set to a string that has the form of three
space-separated numbers. Each number must be an integer from 0 to
255, or all three numbers must be -1. The default value of
@@ -2972,7 +2984,7 @@ Equivalent to \fByear(trigdate())\fR.
.B $Tt (read-only, TIME type)
Equivalent to \fBtrigtime()\fR.
.TP
.B $TimeSep
.B $TimeSep (STRING type)
This variable can be set only to ":" or ".". It holds the character
used to separate portions of a time when \fBRemind\fR prints a TIME or
DATETIME value.
@@ -3535,7 +3547,7 @@ clauses are \fInot\fR taken into account by this function.
Returns a \fBSTRING\fR naming the compiled-in language supported by
\fBRemind\fR. Remind used to support compiled-in support for other
languages, but now all localization is done at run-time. As such,
this function always returnes "English". However, the expression
this function always returns "English". However, the expression
\fB_("LANGID")\fR returns the two-character ISO 639 language code
of any language pack in effect, assuming the language pack author has
written the localization correctly!
+1 -1
View File
@@ -512,7 +512,7 @@ asynchronous status messages.
.SH AUTHOR
TkRemind was written by Dianne Skoll <dianne@skoll.ca>
\fBTkRemind\fR is Copyright 1996-2024 by Dianne Skoll.
\fBTkRemind\fR is Copyright (C) 1996-2025 by Dianne Skoll.
.SH FILES
+266 -67
View File
@@ -20,18 +20,20 @@ my($days, $shades, $moons, $classes, $Month, $Year, $Numdays, $Firstwkday, $Mond
my $TIDY_PROGNAME = $0;
$TIDY_PROGNAME =~ s|^.*/||;
# rem2html -- convert the output of "remind -pp" to HTML
# rem2html -- convert the output of "remind -pp" or "remind -ppp" to HTML
=head1 NAME
rem2html - Convert the output of "remind -pp" to HTML
rem2html - Convert the output of "remind -pp" or "remind -ppp" to HTML
=head1 SYNOPSIS
remind -ppp [remind_options] file | rem2html [options]
remind -pp [remind_options] file | rem2html [options]
You can also use the old interchange format as below, but the -pp
version is preferred.
or -ppp versions are preferred.
remind -p [remind_options] file | rem2html [options]
@@ -155,9 +157,10 @@ sub usage
$exit_status = 1;
}
print STDERR <<"EOM";
$TIDY_PROGNAME: Produce an HTML calendar from the output of "remind -pp"
$TIDY_PROGNAME: Produce an HTML calendar from the output of "remind -pp[p]"
Usage: remind -pp [remind_options] file | rem2html [options]
or: remind -ppp [remind_options] file | rem2html [options]
Options:
@@ -303,6 +306,9 @@ sub parse_input
my $found_data = 0;
while(<STDIN>) {
chomp;
if ($_ eq '[') {
return parse_input_ppp();
}
if (/# translations/) {
slurp_translations();
next;
@@ -418,6 +424,159 @@ sub parse_input
return $found_data;
}
sub parse_input_ppp
{
my $json = "[\n";
my $curlies = 0;
my $did_a_calendar = 0;
while(<STDIN>) {
$json .= $_;
$curlies++ if ($_ eq "{\n");
$curlies-- if ($_ eq "}\n");
$curlies-- if ($_ eq "},\n");
if ($_ eq "]\n" && !$curlies) {
my $array;
eval {
if ($Options{utf8}) {
$array = decode_json(encode('UTF-8', $json, Encode::FB_DEFAULT));
} else {
$array = decode_json($json);
}
};
if (!$array) {
print STDERR "Could not decode JSON.\n";
exit(1);
}
if (!$did_a_calendar) {
start_output();
$did_a_calendar = 1;
}
if (exists($array->[0]{caltype}) &&
$array->[0]{caltype} eq 'weekly') {
emit_ppp_calendars($array, 'weekly');
} else {
emit_ppp_calendars($array, 'monthly');
}
$json = '';
}
}
if (!$did_a_calendar) {
print STDERR "$TIDY_PROGNAME: Could not find any calendar data on STDIN.\n";
exit(1);
} else {
end_output();
exit(0);
}
}
sub emit_ppp_calendars
{
my ($array, $type) = @_;
foreach my $cal (@$array) {
emit_one_ppp_calendar($cal, $type);
}
}
sub emit_one_ppp_calendar
{
my ($c, $type) = @_;
undef $days;
undef $shades;
undef $moons;
undef $classes;
undef $weeks;
my $dates_to_day_index;
my $cols_to_date_info;
if (exists($c->{translations})) {
$Translations = $c->{translations};
}
if ($type eq 'monthly') {
$Month = $c->{monthname};
$Year = $c->{year};
$Numdays = $c->{daysinmonth};
$Firstwkday = $c->{firstwkday};
$Mondayfirst = $c->{mondayfirst};
@Daynames = @{$c->{daynames}};
$Prevmon = $c->{prevmonthname};
$Prevlen = $c->{daysinprevmonth};
$Nextmon = $c->{nextmonthname};
$Nextlen = $c->{daysinnextmonth};
} else {
my $idx = 0;
$Numdays = 7;
foreach my $date (@{$c->{dates}}) {
$Daynames[$idx] = $date->{dayname};
$dates_to_day_index->{$date->{date}} = $idx;
$cols_to_date_info->[$idx] = $date;
$idx++;
}
}
my $class;
if ($Options{nostyle}) {
$class = '';
} else {
$class = ' class="rem-entry"';
}
foreach my $obj (@{$c->{entries}}) {
next unless ($obj->{date} =~ /^(\d+)-(\d+)-(\d+)$/);
my $y = $1;
my $m = $2;
my $d = $3;
my $col;
if ($type eq 'weekly') {
$col = $dates_to_day_index->{$obj->{date}};
} else {
$col = $d;
$col =~ s/^0+//;
}
my $special = $obj->{passthru} || '*';
my $tag = $obj->{tags} || '*';
my $duration = $obj->{duration} || '*';
my $time = $obj->{time} || '*';
my $body = $obj->{body};
$special = uc($special);
if ($special eq 'HTML') {
push(@{$days->[$col]}, $body);
} elsif ($special eq 'HTMLCLASS') {
$classes->[$col] = $body;
} elsif ($special eq 'WEEK') {
$body =~ s/^\s+//;
$body =~ s/\s+$//;
$weeks->{$col} = $body;
} elsif ($special eq 'MOON') {
if ($body =~ /(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/) {
my ($phase, $moonsize, $fontsize, $msg) = ($1, $2, $3, $4);
$moons->[$col]->{'phase'} = $phase;
$moons->[$col]->{'msg'} = $msg;
} elsif ($body =~ /(\S+)/) {
$moons->[$col]->{'phase'} = $1;
$moons->[$col]->{'msg'} = '';
}
} elsif ($special eq 'SHADE') {
if ($body =~ /(\d+)\s+(\d+)\s+(\d+)/) {
$shades->[$col] = sprintf("#%02X%02X%02X",
($1 % 256), ($2 % 256), ($3 % 256));
} elsif ($body =~ /(\d+)/) {
$shades->[$col] = sprintf("#%02X%02X%02X",
($1 % 256), ($1 % 256), ($1 % 256));
}
} elsif ($special eq 'COLOR' || $special eq 'COLOUR') {
if ($body =~ /(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/s) {
my($r, $g, $b, $text) = ($1, $2, $3, $4);
my $color = sprintf("style=\"color: #%02X%02X%02X;\"",
$r % 256, $g % 256, $b % 256);
push(@{$days->[$col]}, "<p$class $color>" . fix_whitespace(escape_html($text)) . '</p>');
}
} elsif ($special eq '*') {
push(@{$days->[$col]}, "<p$class>" . fix_whitespace(escape_html($body)) . '</p>');
}
}
output_calendar($type, $cols_to_date_info);
}
sub fix_whitespace
{
my ($text) = @_;
@@ -523,23 +682,33 @@ sub small_calendar
sub output_calendar
{
# Which column is 1st of month in?
my $first_col = $Firstwkday;
if ($Mondayfirst) {
$first_col--;
if ($first_col < 0) {
$first_col = 6;
}
}
my ($type, $date_info) = @_;
# Last column
my $last_col = ($first_col + $Numdays - 1) % 7;
my ($first_col, $last_col, $number_of_rows);
# Figure out how many rows
my $number_of_rows = int(($first_col + $Numdays ) / 7 + 0.999);
if ($type eq 'monthly') {
$first_col = $Firstwkday;
if ($Mondayfirst) {
$first_col--;
if ($first_col < 0) {
$first_col = 6;
}
}
# Add a row for small calendars if necessary
if ($first_col == 0 && $last_col == 6) {
# Last column
$last_col = ($first_col + $Numdays - 1) % 7;
# Figure out how many rows
$number_of_rows = int(($first_col + $Numdays ) / 7 + 0.999);
# Add a row for small calendars if necessary
if ($first_col == 0 && $last_col == 6) {
$number_of_rows++;
}
} else {
$first_col = 0;
$last_col = 6;
$number_of_rows = 1;
}
# Start the table
@@ -550,22 +719,36 @@ sub output_calendar
print '<tr>';
$class = ' width="14%"';
} else {
print '<table class="rem-cal"><caption class="rem-cal-caption">' .
$Month . ' ' . $Year . '</caption>' . "\n";
if ($type eq 'monthly') {
print '<table class="rem-cal"><caption class="rem-cal-caption">' .
$Month . ' ' . $Year . '</caption>' . "\n";
} else {
print '<table class="rem-cal">' . "\n";
}
print '<tr class="rem-cal-hdr-row">';
$class = ' class="rem-cal-hdr"';
}
if (!$Mondayfirst) {
print "<th$class>" . $Daynames[0] . '</th>';
if ($type eq 'monthly') {
if (!$Mondayfirst) {
print "<th$class>" . $Daynames[0] . '</th>';
}
for (my $i=1; $i<7; $i++) {
print "<th$class>" . $Daynames[$i] . '</th>';
}
if ($Mondayfirst) {
print "<th$class>" . $Daynames[0] . '</th>';
}
} else {
for (my $i=0; $i<7; $i++) {
my $inf = $date_info->[$i];
print "<th$class>" . $inf->{dayname} . "<br>" .
$inf->{day} . '&nbsp;' .
$inf->{month} . '&nbsp;' .
$inf->{year} . '</th>';
}
}
for (my $i=1; $i<7; $i++) {
print "<th$class>" . $Daynames[$i] . '</th>';
}
if ($Mondayfirst) {
print "<th$class>" . $Daynames[0] . '</th>';
}
print "</tr>\n";
print "</tr>\n";
# Start the calendar rows
my $col = 0;
if ($Options{nostyle}) {
@@ -573,16 +756,18 @@ sub output_calendar
} else {
print "<tr class=\"rem-cal-row rem-cal-row-$number_of_rows-rows\">\n";
}
if ($first_col > 0) {
small_calendar($Prevmon, $Prevlen, $Options{backurl},
($Firstwkday - $Prevlen + 35) % 7);
$col++;
}
if ($type eq 'monthly') {
if ($first_col > 0) {
small_calendar($Prevmon, $Prevlen, $Options{backurl},
($Firstwkday - $Prevlen + 35) % 7);
$col++;
}
if ($last_col == 6 && $first_col > 0) {
small_calendar($Nextmon, $Nextlen, $Options{forwurl},
($Firstwkday + $Numdays) % 7);
$col++;
if ($last_col == 6 && $first_col > 0) {
small_calendar($Nextmon, $Nextlen, $Options{forwurl},
($Firstwkday + $Numdays) % 7);
$col++;
}
}
if ($Options{nostyle}) {
$class = ' width="14%"';
@@ -595,7 +780,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, $type);
$col++;
if ($col == 7) {
$col = 0;
@@ -610,32 +795,33 @@ sub output_calendar
}
}
if ($col) {
while ($col < 7) {
if ($col == 5) {
if ($first_col == 0) {
small_calendar($Prevmon, $Prevlen, $Options{backurl},
($Firstwkday - $Prevlen + 35) % 7);
} else {
print("<td$class>&nbsp;</td>\n");
}
} elsif ($col == 6) {
small_calendar($Nextmon, $Nextlen, $Options{forwurl},
($Firstwkday + $Numdays) % 7);
} else {
print("<td$class>&nbsp;</td>\n");
}
$col++;
}
print "</tr>\n";
}
if ($type eq 'monthly') {
if ($col) {
while ($col < 7) {
if ($col == 5) {
if ($first_col == 0) {
small_calendar($Prevmon, $Prevlen, $Options{backurl},
($Firstwkday - $Prevlen + 35) % 7);
} else {
print("<td$class>&nbsp;</td>\n");
}
} elsif ($col == 6) {
small_calendar($Nextmon, $Nextlen, $Options{forwurl},
($Firstwkday + $Numdays) % 7);
} else {
print("<td$class>&nbsp;</td>\n");
}
$col++;
}
print "</tr>\n";
}
# Add a row for small calendars if they were not yet done!
if ($first_col == 0 && $last_col == 6) {
# Add a row for small calendars if they were not yet done!
if ($first_col == 0 && $last_col == 6) {
if ($Options{nostyle}) {
print "<tr>\n";
print "<tr>\n";
} else {
print "<tr class=\"rem-cal-row rem-cal-row-$number_of_rows-rows\">\n";
print "<tr class=\"rem-cal-row rem-cal-row-$number_of_rows-rows\">\n";
}
small_calendar($Prevmon, $Prevlen, $Options{backurl},
($Firstwkday - $Prevlen + 35) % 7);
@@ -645,14 +831,18 @@ sub output_calendar
small_calendar($Nextmon, $Nextlen, $Options{forwurl},
($Firstwkday + $Numdays) % 7);
print("</tr>\n");
}
}
# End the table
print "</table>\n";
if ($type eq 'weekly') {
print "&nbsp;<br />\n";
}
}
sub draw_day_cell
{
my($day, $number_of_rows) = @_;
my($day, $number_of_rows, $type) = @_;
my $shade = $shades->[$day];
my $week = '';
if (exists($weeks->{$day})) {
@@ -724,11 +914,20 @@ sub draw_day_cell
}
}
if ($Options{nostyle}) {
print "<div style=\"float: right\">$day$week</div>\n";
print "<p>&nbsp;</p>\n";
if ($type eq 'monthly') {
if ($Options{nostyle}) {
print "<div style=\"float: right\">$day$week</div>\n";
print "<p>&nbsp;</p>\n";
} else {
print "<div class=\"rem-daynumber\">$day$week</div>\n";
}
} else {
print "<div class=\"rem-daynumber\">$day$week</div>\n";
if ($Options{nostyle}) {
print "<div style=\"float: right\">$week</div>\n";
print "<p>&nbsp;</p>\n";
} else {
print "<div class=\"rem-daynumber\">$week</div>\n";
}
}
if ($days->[$day]) {
print(join("\n", @{$days->[$day]}));
@@ -768,7 +967,7 @@ while(1) {
last if (!parse_input());
start_output() unless $found_something;
$found_something = 1;
output_calendar();
output_calendar('monthly', undef);
}
if ($found_something) {
end_output();
+29 -13
View File
@@ -64,6 +64,8 @@ my $settings = {
ps => 0,
eps => 0,
verbose => 0,
weeks_per_page => 1,
};
my $me = $0;
@@ -81,17 +83,18 @@ Usage: remind -pp [options] filename | $me [options] > out.pdf
Options:
--landscape, -l Print in landscape orientation
--small-calendars=N Choose location for small calendars
--small-calendars=N Location for small calendars (monthly calendars only)
--svg Output SVG instead of PDF
--ps Output PostScript instead of PDF
--eps Output encapsulated PostScript instead of PDF
-cN Synonym for --small-calendars=N
--left-numbers, -x Print day numbers on the left
--fill-page, -e Fill the entire page
--left-numbers, -x Print day numbers on the left (monthly calendars only)
--fill-page, -e Fill the entire page (monthly calendars only)
--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
--wrap, -y Make calendar fit in at most 5 rows
--wrap, -y Make calendar fit in 5 rows (monthly calendars only)
--weeks-per-page=N, -pN Number of weeks per page (weekly calendars only)
--title-font=FONT Specify font for calendar title
--header-font=FONT Specify font for weekday names
--daynum-font=FONT Specify font for day numbers
@@ -121,6 +124,7 @@ my $ret = GetOptions('landscape|l' => \$settings->{landscape},
'ps' => \$settings->{ps},
'eps' => \$settings->{eps},
'fill-page|e' => \$settings->{fill_entire_page},
'weeks-per-page|p=i' => \$settings->{weeks_per_page},
'media|m=s' => \$settings->{media},
'width|w=i' => \$settings->{width},
'wrap|y' => \$settings->{wrap_calendar},
@@ -153,6 +157,12 @@ if ($help) {
exit(0);
}
if ($settings->{weeks_per_page} < 1) {
$settings->{weeks_per_page} = 1;}
elsif ($settings->{weeks_per_page} > 4) {
$settings->{weeks_per_page} = 4;
}
if ($settings->{width} <= 0 ||
$settings->{height} <= 0) {
my $size = $media_to_size->{ucfirst($settings->{media})};
@@ -247,6 +257,7 @@ if ($settings->{ps} && $settings->{landscape}) {
}
my $warned = 0;
my $index = 0;
while(1) {
if ($settings->{ps}) {
$surface->dsc_begin_page_setup();
@@ -267,14 +278,8 @@ while(1) {
}
last;
}
if (($settings->{eps} || $settings->{svg}) && $done_one) {
if (!$warned) {
print STDERR "WARNING: --eps and --svg can only output one page; ignoring subsequent\nmonths in a multi-month calendar.\n";
$warned = 1;
}
next;
}
$obj->render($cr, $settings);
$index++;
$obj->render($cr, $settings, $index, -1);
$done_one = 1;
}
@@ -392,7 +397,7 @@ month. Possible values for I<n> are:
=item Z<>0
Do not draw any small calendares
Do not draw any small calendars
=item Z<>1
@@ -521,6 +526,11 @@ first row of the calendar, and adjust the small calendar positions
as needed. This results in a calendar that only requires 5 rows, but
with the last day or two appearing in the I<first> row.
=item --weeks-per-page=I<n>, -pI<n>.
This option is only used for weekly calendars. I<n> is the number of weeks
to print per page; it is an integer that can range from 1 to 4.
=item --verbose, -v
Print (on STDERR) the name of the month and year for each month that
@@ -563,6 +573,12 @@ 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 WEEKLY CALENDARS
B<rem2pdf> will produce weekly calendars if you invoke B<remind> with the
B<-p+> option. the B<--weeks-per-page> option specifies how many
weeks' worth of reminders to print per page, and can range from 1 to 4.
=head1 ABSOLUTELY-POSITIONED TEXT
If your B<PANGO> special reminder starts with C<@I<x>,I<y>> where I<x>
+260 -9
View File
@@ -62,6 +62,9 @@ sub create_from_hash
{
my ($class, $hash, $specials_accepted) = @_;
if (exists($hash->{caltype}) && ($hash->{caltype} eq 'weekly')) {
return Remind::PDF::Weekly->create_from_hash($hash, $specials_accepted);
}
bless $hash, $class;
my $filtered_entries = [];
@@ -463,8 +466,16 @@ C<rem2pdf> for the contents of C<$settings>
=cut
sub render
{
my ($self, $cr, $settings) = @_;
my ($self, $cr, $settings, $index, $total) = @_;
if ($settings->{svg} || $settings->{eps}) {
if ($index > 1) {
if ($index == 2) {
print STDERR "WARNING: --svg/--eps can only output one page; ignoring subsequent\nmonths in a multi-month calendar.\n";
}
return;
}
}
$self->setup_daymap($settings);
$self->{horiz_lines} = [];
$cr->set_line_cap('square');
@@ -525,7 +536,7 @@ sub render
}
if ($settings->{verbose}) {
print STDERR "remdp2f: Rendered " . $self->{monthname} . ' ' . $self->{year} . "\n";
print STDERR "rem2pdf: Rendered " . $self->{monthname} . ' ' . $self->{year} . "\n";
}
# Done this page
$cr->show_page();
@@ -1008,20 +1019,260 @@ as were read from the C<remind -ppp> stream
sub render
{
my ($self, $cr, $settings) = @_;
my $done = 0;
my $warned = 0;
my $index = 0;
my $total = scalar(@{$self->{entries}});
foreach my $e (@{$self->{entries}}) {
if ($settings->{svg} && $done) {
if (!$warned) {
print STDERR "WARNING: --svg can only output one page; ignoring subsequent\nmonths in a multi-month calendar.\n";
$warned = 1;
$index++;
$e->render($cr, $settings, $index, $total);
}
}
package Remind::PDF::Weekly;
use base qw(Remind::PDF);
=head1 NAME
Remind::PDF::Weekly - render a weekly calendar
=cut
sub render
{
my ($self, $cr, $settings, $index, $total) = @_;
if ($settings->{svg} || $settings->{eps}) {
if ($index > $settings->{weeks_per_page}) {
if ($index == $settings->{weeks_per_page}+1) {
print STDERR "WARNING: --svg/--eps can only output one page; ignoring subsequent pages.\n";
}
return;
}
}
$settings->{numbers_on_left} = 1;
# Set up bounding box
if ($settings->{weeks_per_page} == 1) {
$self->{bounding_box} = [
$settings->{margin_left},
$settings->{margin_top},
$settings->{width} - $settings->{margin_right},
$settings->{height} - $settings->{margin_bottom}]
} else {
my $total_height = $settings->{height} - $settings->{margin_top} - $settings->{margin_bottom};
my $week_height = $total_height / $settings->{weeks_per_page};
my $top_offset = (($index-1) % $settings->{weeks_per_page}) * $week_height;
my $bot_offset = $top_offset + $week_height;
$self->{bounding_box} =
$self->{bounding_box} = [
$settings->{margin_left},
$settings->{margin_top} + $top_offset,
$settings->{width} - $settings->{margin_right},
$settings->{margin_top} + $bot_offset];
if ($index != 1) {
$self->{bounding_box}[1] += 0.25 * $settings->{margin_top};
}
if ($index != $settings->{weeks_per_page}) {
$self->{bounding_box}[3] -= 0.25 * $settings->{margin_top};
}
}
$self->draw_headings($cr, $settings);
for (my $i=0; $i<7; $i++) {
$self->draw_entries($cr, $settings, $i);
}
$self->draw_lines($cr, $settings);
if ($index == $total || ($index % $settings->{weeks_per_page}) == 0) {
$cr->show_page();
}
if ($settings->{verbose}) {
print STDERR "rem2pdf: Rendered " . $self->{dates}->[0]->{date} . " to " . $self->{dates}->[6]->{date} . "\n";
}
}
sub draw_headings
{
my ($self, $cr, $settings) = @_;
my $ymax = 0;
my $cell = ($settings->{width} - $settings->{margin_left} - $settings->{margin_right})/7;
for (my $i=0; $i<7; $i++) {
my $date = $self->{dates}[$i];
my $month = $date->{month};
my $year = $date->{year};
my $day = $date->{day};
my $dayname = $date->{dayname};
my $layout = Pango::Cairo::create_layout($cr);
$layout->set_text(Encode::decode('UTF-8', $dayname));
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, $self->{bounding_box}[1]);
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
$layout = Pango::Cairo::create_layout($cr);
$layout->set_text(Encode::decode('UTF-8', $day . " " . $month . " " . $year));
my $es = $settings->{entry_size};
if ($es > 8) {
$es = 8;
}
$desc = Pango::FontDescription->from_string($settings->{entry_font} . ' ' . $es . 'px');
$layout->set_font_description($desc);
my ($wid2, $h2) = $layout->get_pixel_size();
$cr->save;
$cr->move_to($settings->{margin_left} + $i * $cell + $cell/2 - $wid2/2, $self->{bounding_box}[1] + $h);
Pango::Cairo::show_layout($cr, $layout);
$cr->restore();
if ($h + $h2 > $ymax) {
$ymax = $h + $h2;
}
}
$self->{heading_bottom_y} = $ymax + $self->{bounding_box}[1];
}
sub draw_entries
{
my ($self, $cr, $settings, $i) = @_;
my $cell = ($settings->{width} - $settings->{margin_left} - $settings->{margin_right})/7;
# Coordinates of box from line-to-line
my $l2l_box = [$i * $cell + $settings->{margin_left},
$self->{heading_bottom_y},
($i+1) * $cell + $settings->{margin_left},
$self->{bounding_box}[3]];
# Coordinates of drawing-space box
my $box = [$l2l_box->[0] + $settings->{border_size},
$l2l_box->[1] + $settings->{border_size},
$l2l_box->[2] - $settings->{border_size},
$l2l_box->[3] - $settings->{border_size}];
$self->{l2l_box} = $l2l_box;
$self->{box} = $box;
# Do shading, if any
my $shade = $self->find_last_special('shade', $self->{entries}->[$i]);
if ($shade) {
$cr->save;
$cr->set_source_rgb($shade->{r} / 255,
$shade->{g} / 255,
$shade->{b} / 255);
$cr->rectangle($l2l_box->[0], $l2l_box->[1],
$l2l_box->[2] - $l2l_box->[0],
$l2l_box->[3] - $l2l_box->[1]);
$cr->fill();
$cr->restore;
}
# Get the "day number" size to leave room for moon and week specials
my $layout = Pango::Cairo::create_layout($cr);
$layout->set_text("31");
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();
my $so_far = $box->[1] + $h + $settings->{border_size};
my $box_height = $box->[3] - $box->[1];
my $done = 0;
foreach my $entry (@{$self->{entries}->[$i]}) {
# 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, $box->[1], $i, $i, $box_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, $box->[1], $i, $i, $box_height);
next;
}
# Shade is done already
if ($entry->isa('Remind::PDF::Entry::shade')) {
next;
}
if ($done) {
$so_far += $settings->{border_size};
}
$done = 1;
$e->render($cr, $settings);
my $h2 = $entry->render($self, $cr, $settings, $so_far, $i, $i, $box_height);
$so_far += $h2;
}
}
sub col_box_coordinates
{
my ($self, $so_far, $col, $height, $settings) = @_;
return (@{$self->{l2l_box}});
}
sub draw_lines
{
my ($self, $cr, $settings) = @_;
# Top horizonal line
$cr->move_to($self->{bounding_box}[0], $self->{bounding_box}[1]);
$cr->line_to($self->{bounding_box}[2], $self->{bounding_box}[1]);
$cr->stroke();
# Horizontal line below headings
$cr->move_to($self->{bounding_box}[0], $self->{heading_bottom_y});
$cr->line_to($self->{bounding_box}[2], $self->{heading_bottom_y});
$cr->stroke();
# Bottom horizontal line
$cr->move_to($self->{bounding_box}[0], $self->{bounding_box}[3]);
$cr->line_to($self->{bounding_box}[2], $self->{bounding_box}[3]);
$cr->stroke();
# Vertical lines
my $w = ($settings->{width} - $settings->{margin_left} - $settings->{margin_right})/7;
for (my $i=0; $i<=7; $i++) {
my $x = $settings->{margin_left} + ($i * $w);
$cr->move_to($x, $self->{bounding_box}[1]);
$cr->line_to($x, $self->{bounding_box}[3]);
$cr->stroke();
}
}
sub create_from_hash
{
my ($class, $hash, $specials_accepted) = @_;
bless $hash, $class;
my $filtered_entries = [];
my $date_to_index;
for (my $i=0; $i<7; $i++) {
$date_to_index->{$hash->{dates}[$i]->{date}} = $i;
}
for (my $i=0; $i<7; $i++) {
$filtered_entries->[$i] = [];
}
foreach my $e (@{$hash->{entries}}) {
if ($hash->accept_special($e, $specials_accepted)) {
my $index = $date_to_index->{$e->{date}};
push(@{$filtered_entries->[$index]}, Remind::PDF::Entry->new_from_hash($e));
}
}
$hash->{entries} = $filtered_entries;
return $hash;
}
1;
+2 -2
View File
@@ -8,7 +8,7 @@
# A cheesy graphical front/back end for Remind using Tcl/Tk
#
# This file is part of REMIND.
# Copyright (C) 1992-2024 Dianne Skoll
# Copyright (C) 1992-2025 Dianne Skoll
#
#--------------------------------------------------------------
@@ -3086,7 +3086,7 @@ proc main {} {
global AppendFile HighestTagSoFar DayNames
catch {
puts "\nTkRemind Copyright (C) 1996-2024 Dianne Skoll"
puts "\nTkRemind Copyright (C) 1996-2025 Dianne Skoll"
}
catch { SetFonts }
Initialize
+51 -16
View File
@@ -5,7 +5,7 @@
/* The code for generating a calendar. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -274,6 +274,7 @@ static int ColToDay[7];
static int ColSpaces;
static int DidAMonth;
static int DidAWeek;
static int DidADay;
static void ColorizeEntry(CalEntry const *e, int clamp);
@@ -834,12 +835,33 @@ void ProduceCalendar(void)
WriteIntermediateCalLine();
}
while (CalWeeks--)
DidAWeek = 0;
if (PsCal == PSCAL_LEVEL3) {
printf("[\n");
}
while (CalWeeks--) {
DoCalendarOneWeek(CalWeeks);
DidAWeek = 1;
}
if (PsCal == PSCAL_LEVEL3) {
printf("\n]\n");
}
return;
}
}
static void
SendTranslationTable(int pslevel)
{
if (pslevel < PSCAL_LEVEL3) {
printf("# translations\n");
}
DumpTranslationTable(stdout, 1);
if (pslevel < PSCAL_LEVEL3) {
printf("\n");
}
}
/***************************************************************/
/* */
/* DoCalendarOneWeek */
@@ -870,9 +892,33 @@ static void DoCalendarOneWeek(int nleft)
/* Output the entries */
/* If it's "Simple Calendar" format, do it simply... */
if (DoSimpleCalendar) {
if (PsCal == PSCAL_LEVEL3) {
if (DidAWeek) {
printf(",\n");
}
printf("{\n\"caltype\":\"weekly\",");
if (!DidAWeek) {
printf("\"translations\":");
SendTranslationTable(PsCal);
printf(",");
}
printf("\"dates\":[");
for (i=0; i<7; i++) {
if (i != 0) {
printf(",");
}
FromDSE(OrigDse+i-wd, &y, &m, &d);
printf("{\"dayname\":\"%s\",\"date\":\"%04d-%02d-%02d\",\"year\":%d,\"month\":\"%s\",\"day\":%d}", get_day_name((OrigDse+i-wd)%7),y, m+1, d, y, get_month_name(m), d);
}
printf("],\"entries\":[");
}
DidADay = 0;
for (i=0; i<7; i++) {
WriteSimpleEntries(i, OrigDse+i-wd);
}
if (PsCal == PSCAL_LEVEL3) {
printf("\n]\n}");
}
return;
}
@@ -965,18 +1011,6 @@ static void DoCalendarOneWeek(int nleft)
}
}
static void
SendTranslationTable(int pslevel)
{
if (pslevel < PSCAL_LEVEL3) {
printf("# translations\n");
}
DumpTranslationTable(stdout, 1);
if (pslevel < PSCAL_LEVEL3) {
printf("\n");
}
}
/***************************************************************/
/* */
/* DoSimpleCalendarOneMonth */
@@ -1030,6 +1064,7 @@ static void DoSimpleCalendarOneMonth(void)
}
printf("\n");
} else {
PrintJSONKeyPairString("caltype", "monthly");
PrintJSONKeyPairString("monthname", get_month_name(m));
PrintJSONKeyPairInt("year", y);
PrintJSONKeyPairInt("daysinmonth", DaysInMonth(m, y));
@@ -1272,7 +1307,7 @@ static void PrintLeft(char const *s, int width, char pad)
buf = calloc(len+1, sizeof(wchar_t));
if (!buf) {
/* Uh-oh... cannot recover */
fprintf(stderr, "%s\n", GetErr(E_NO_MEM));
fprintf(ErrFp, "%s\n", GetErr(E_NO_MEM));
exit(EXIT_FAILURE);
}
}
@@ -1357,7 +1392,7 @@ static void PrintCentered(char const *s, int width, char *pad)
buf = calloc(len+1, sizeof(wchar_t));
if (!buf) {
/* Uh-oh... cannot recover */
fprintf(stderr, "%s\n", GetErr(E_NO_MEM));
fprintf(ErrFp, "%s\n", GetErr(E_NO_MEM));
exit(EXIT_FAILURE);
}
}
+1 -1
View File
@@ -6,7 +6,7 @@
/* which you can customize. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+1 -1
View File
@@ -6,7 +6,7 @@
/* which you can customize. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+4 -8
View File
@@ -5,7 +5,7 @@
/* Code to suppress duplicate reminders */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -167,17 +167,13 @@ InitDedupeTable(void)
if (hash_table_init(&DedupeTable,
offsetof(DedupeEntry, link),
DedupeHashFunc, CompareDedupes) < 0) {
fprintf(stderr, "Unable to initialize function hash table: Out of memory. Exiting.\n");
fprintf(ErrFp, "Unable to initialize function hash table: Out of memory. Exiting.\n");
exit(1);
}
}
void
get_dedupe_hash_stats(int *total, int *maxlen, double *avglen)
dump_dedupe_hash_stats(void)
{
struct hash_table_stats s;
hash_table_get_stats(&DedupeTable, &s);
*total = s.num_entries;
*maxlen = s.max_len;
*avglen = s.avg_len;
hash_table_dump_stats(&DedupeTable, ErrFp);
}
+1 -1
View File
@@ -7,7 +7,7 @@
/* commands. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+1 -1
View File
@@ -6,7 +6,7 @@
/* reminders are triggered. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+1 -1
View File
@@ -6,7 +6,7 @@
/* buffers. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+1 -1
View File
@@ -5,7 +5,7 @@
/* Declaration of functions for manipulating dynamic buffers */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+1 -1
View File
@@ -5,7 +5,7 @@
/* Error definitions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+5 -5
View File
@@ -12,7 +12,7 @@
/* evaluated. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -3088,10 +3088,10 @@ int DoCoerce(char type, Value *v)
/***************************************************************/
void print_expr_nodes_stats(void)
{
fprintf(stderr, " Expression nodes allocated: %d\n", ExprNodesAllocated);
fprintf(stderr, "Expression nodes high-water: %d\n", ExprNodesHighWater);
fprintf(stderr, " Expression nodes leaked: %d\n", ExprNodesUsed);
fprintf(stderr, " Parse level high-water: %d\n", parse_level_high_water);
fprintf(ErrFp, " Expression nodes allocated: %d\n", ExprNodesAllocated);
fprintf(ErrFp, "Expression nodes high-water: %d\n", ExprNodesHighWater);
fprintf(ErrFp, " Expression nodes leaked: %d\n", ExprNodesUsed);
fprintf(ErrFp, " Parse level high-water: %d\n", parse_level_high_water);
}
/* Return 1 if a value is "true" for its type, 0 if "false" */
+2 -2
View File
@@ -7,7 +7,7 @@
/* files. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -608,7 +608,7 @@ int DoInclude(ParsePtr p, enum TokTypes tok)
DBufInit(&buf);
DBufInit(&fullname);
DBufInit(&path);
if ( (r=ParseToken(p, &buf)) ) return r;
if ( (r=ParseTokenOrQuotedString(p, &buf)) ) return r;
e = VerifyEoln(p);
if (e) Eprint("%s", GetErr(e));
+4 -4
View File
@@ -6,7 +6,7 @@
/* expressions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -3265,11 +3265,11 @@ static int setenv(char const *varname, char const *val, int overwrite)
{
static char tzbuf[256];
if (strcmp(varname, "TZ")) {
fprintf(stderr, "built-in setenv can only be used with TZ\n");
fprintf(ErrFp, "built-in setenv can only be used with TZ\n");
abort();
}
if (!overwrite) {
fprintf(stderr, "built-in setenv must have overwrite=1\n");
fprintf(ErrFp, "built-in setenv must have overwrite=1\n");
abort();
}
@@ -3287,7 +3287,7 @@ static void unsetenv(char const *varname)
{
static char tzbuf[8];
if (strcmp(varname, "TZ")) {
fprintf(stderr, "built-in unsetenv can only be used with TZ\n");
fprintf(ErrFp, "built-in unsetenv can only be used with TZ\n");
abort();
}
sprintf(tzbuf, "%s", varname);
+1 -1
View File
@@ -8,7 +8,7 @@
/* globals.h and err.h */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+2 -1
View File
@@ -7,7 +7,7 @@
/* MK_GLOBALS. Also contains useful macro definitions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2021 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -68,6 +68,7 @@ EXTERN INIT( int PsCal, 0);
EXTERN INIT( int CalWidth, 80);
EXTERN INIT( int CalWeeks, 0);
EXTERN INIT( int CalMonths, 0);
EXTERN INIT( char const *CalType, "none");
EXTERN INIT( int Hush, 0);
EXTERN INIT( int NextMode, 0);
EXTERN INIT( int InfiniteDelta, 0);
+9 -28
View File
@@ -5,7 +5,7 @@
/* Implementation of hash table. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -63,7 +63,7 @@
* These are used as choices for the number of hash buckets in the table
*/
static size_t bucket_choices[] = {
17, 37, 79, 163, 331, 673, 1361, 2729, 5471, 10949, 21911, 43853, 87719,
7, 17, 37, 79, 163, 331, 673, 1361, 2729, 5471, 10949, 21911, 43853, 87719,
175447, 350899, 701819, 1403641, 2807303, 5614657, 11229331, 22458671,
44917381, 89834777, 179669557, 359339171, 718678369, 1437356741 };
@@ -108,6 +108,8 @@ hash_table_init(hash_table *t,
t->hashfunc = hashfunc;
t->compare = compare;
t->buckets = malloc(sizeof(void *) * bucket_choices[0]);
t->num_growths = 0;
t->num_shrinks = 0;
if (!t->buckets) {
return -1;
}
@@ -216,6 +218,11 @@ hash_table_resize(hash_table *t, int dir)
/* Out of memory... just don't resize? */
return 0;
}
if (dir == 1) {
t->num_growths++;
} else {
t->num_shrinks++;
}
for (size_t j=0; j<num_new_buckets; j++) {
new_buckets[j] = NULL;
}
@@ -305,32 +312,6 @@ hash_table_find(hash_table *t, void *candidate)
return NULL;
}
/**
* \brief Find the next item in a hash table
*
* \param t Pointer to a hash table object
* \param obj Pointer to an object that was perviously returned by
* hash_table_find() or hash_table_find_next().
*
* \return A pointer to the next object matching obj, or NULL if
* no more exist
*/
void *
hash_table_find_next(hash_table *t, void *obj)
{
if (!obj) {
return NULL;
}
void *ptr = LINK(t, obj)->next;
while(ptr) {
if (!t->compare(obj, ptr)) {
return ptr;
}
ptr = LINK(t, ptr)->next;
}
return NULL;
}
/**
* \brief Delete an item from a hash table
*
+5 -28
View File
@@ -5,7 +5,7 @@
/* Header file for hash-table related functions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -29,6 +29,8 @@ struct hash_link {
*/
typedef struct {
unsigned int bucket_choice_index; /**< Index into array of possible bucket counts */
size_t num_growths; /**< How many times have we grown the hash table? */
size_t num_shrinks; /**< How many times have we grown the hash table? */
size_t num_entries; /**< Number of entries in the hash table */
size_t hash_link_offset; /**< Offset of the struct hash_link in the container */
void **buckets; /**< Array of buckets */
@@ -45,6 +47,8 @@ struct hash_table_stats {
size_t num_nonempty_buckets; /**< Number of non-emptry buckets */
size_t max_len; /**< Length of longest chain in the hash table */
size_t min_len; /**< Length of the shortest chain in the hash table */
size_t num_growths; /**< How many times have we grown the hash table? */
size_t num_shrinks; /**< How many times have we grown the hash table? */
double avg_len; /**< Average chain length */
double avg_nonempty_len; /**< Average chain length of non-empty bucket */
double stddev; /**< Standard deviation of chain lengths */
@@ -60,7 +64,6 @@ size_t hash_table_num_buckets(hash_table *t);
size_t hash_table_chain_len(hash_table *t, size_t i);
int hash_table_insert(hash_table *t, void *item);
void *hash_table_find(hash_table *t, void *candidate);
void *hash_table_find_next(hash_table *t, void *obj);
int hash_table_delete(hash_table *t, void *item);
int hash_table_delete_no_resize(hash_table *t, void *item);
void *hash_table_next(hash_table *t, void *cur);
@@ -84,29 +87,3 @@ void hash_table_get_stats(hash_table *t, struct hash_table_stats *stat);
(item); \
(item) = hash_table_next((t), (item)))
/**
* \brief Iterate over all items in a hash table that match a candidate
*
* This macro iterates over all items in a hash table that match a
* candidate object. (In general, a hash table may contain multiple
* objects with the same key.) Here is an example assuming that the hash
* table holds objects of type struct int_object:
*
* struct int_object {
* int value;
* struct hash_link link;
* }
*
* hash_table tab;
* int_object candidate;
*
* candidate.value = 7;
* int_object *item;
* hash_table_for_each_matching(item, &candidate, &tab) {
* // Do something with item, which will match "7"
* }
*/
#define hash_table_for_each_matching(item, candidate, t) \
for ((item) = hash_table_find((t), (candidate)); \
(item); \
(item) = hash_table_find_next((t), (item)))
+6 -3
View File
@@ -5,7 +5,7 @@
/* Utility function to print hash table stats. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -33,14 +33,15 @@ hash_table_dump_stats(hash_table *t, FILE *fp)
{
struct hash_table_stats stat;
hash_table_get_stats(t, &stat);
fprintf(fp, "#Entries: %lu\n#Buckets: %lu\n#Non-empty Buckets: %lu\n",
fprintf(fp, " Entries: %lu; Buckets: %lu; Non-empty Buckets: %lu\n",
(unsigned long) stat.num_entries,
(unsigned long) stat.num_buckets,
(unsigned long) stat.num_nonempty_buckets);
fprintf(fp, "Max len: %lu\nMin len: %lu\nAvg len: %.4f\nStd dev: %.4f\nAvg nonempty len: %.4f\n",
fprintf(fp, " Maxlen: %lu; Minlen: %lu; Avglen: %.3f; Stddev: %.3f; Avg nonempty len: %.3f\n",
(unsigned long) stat.max_len,
(unsigned long) stat.min_len,
stat.avg_len, stat.stddev, stat.avg_nonempty_len);
fprintf(fp, " Growths: %lu; Shrinks: %lu\n", (unsigned long) stat.num_growths, (unsigned long) stat.num_shrinks);
}
/**
@@ -67,6 +68,8 @@ hash_table_get_stats(hash_table *t, struct hash_table_stats *stat)
stat->stddev = 0.0;
stat->num_nonempty_buckets = 0;
stat->avg_nonempty_len = 0.0;
stat->num_growths = t->num_growths;
stat->num_shrinks = t->num_shrinks;
double sum = 0.0;
double sumsq = 0.0;
+1 -1
View File
@@ -5,7 +5,7 @@
/* Support for the Hebrew calendar */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/* Derived from code written by Amos Shapir in 1978; revised */
+27 -10
View File
@@ -7,7 +7,7 @@
/* in normal mode. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -149,7 +149,7 @@ static char const *DefaultFilename(void)
s = getenv("HOME");
if (!s) {
fprintf(stderr, "HOME environment variable not set. Unable to determine reminder file.\n");
fprintf(ErrFp, "HOME environment variable not set. Unable to determine reminder file.\n");
exit(EXIT_FAILURE);
}
DBufPuts(&default_filename_buf, s);
@@ -237,7 +237,7 @@ void InitRemind(int argc, char const *argv[])
InvokedAsRem = 1;
}
} else {
fprintf(stderr, "Invoked with a NULL argv[0]; bailing because that's just plain bizarre.\n");
fprintf(ErrFp, "Invoked with a NULL argv[0]; bailing because that's just plain bizarre.\n");
exit(EXIT_FAILURE);
}
@@ -501,9 +501,11 @@ void InitRemind(int argc, char const *argv[])
break;
}
if (weeks) {
CalType = "weekly";
PARSENUM(CalWeeks, arg);
if (!CalWeeks) CalWeeks = 1;
} else {
CalType = "monthly";
PARSENUM(CalMonths, arg);
if (!CalMonths) CalMonths = 1;
}
@@ -528,9 +530,11 @@ void InitRemind(int argc, char const *argv[])
break;
}
if (weeks) {
CalType = "weekly";
PARSENUM(CalWeeks, arg);
if (!CalWeeks) CalWeeks = 1;
} else {
CalType = "monthly";
PARSENUM(CalMonths, arg);
if (!CalMonths) CalMonths = 1;
}
@@ -541,10 +545,14 @@ void InitRemind(int argc, char const *argv[])
DoSimpleCalendar = 1;
IgnoreOnce = 1;
PsCal = PSCAL_LEVEL1;
weeks = 0;
while (*arg == 'a' || *arg == 'A' ||
*arg == 'q' || *arg == 'Q' ||
*arg == '+' ||
*arg == 'p' || *arg == 'P') {
if (*arg == 'a' || *arg == 'A') {
if (*arg == '+') {
weeks = 1;
} else if (*arg == 'a' || *arg == 'A') {
DoSimpleCalDelta = 1;
} else if (*arg == 'p' || *arg == 'P') {
/* JSON interchange formats always include
@@ -560,8 +568,16 @@ void InitRemind(int argc, char const *argv[])
}
arg++;
}
PARSENUM(CalMonths, arg);
if (!CalMonths) CalMonths = 1;
if (weeks) {
CalType = "weekly";
PARSENUM(CalWeeks, arg);
if (!CalWeeks) CalWeeks = 1;
PsCal = PSCAL_LEVEL3;
} else {
CalType = "monthly";
PARSENUM(CalMonths, arg);
if (!CalMonths) CalMonths = 1;
}
break;
case 'l':
@@ -577,7 +593,7 @@ void InitRemind(int argc, char const *argv[])
/* -wt means get width from /dev/tty */
ttyfd = open("/dev/tty", O_RDONLY);
if (ttyfd < 0) {
fprintf(stderr, "%s: `-wt': Cannot open /dev/tty: %s\n",
fprintf(ErrFp, "%s: `-wt': Cannot open /dev/tty: %s\n",
argv[0], strerror(errno));
} else {
InitCalWidthAndFormWidth(ttyfd);
@@ -618,6 +634,7 @@ void InitRemind(int argc, char const *argv[])
while (*arg) {
switch(*arg++) {
case 's': case 'S': DebugFlag |= DB_PARSE_EXPR; break;
case 'h': case 'H': DebugFlag |= DB_HASHSTATS; break;
case 'e': case 'E': DebugFlag |= DB_ECHO_LINE; break;
case 'x': case 'X': DebugFlag |= DB_PRTEXPR; break;
case 't': case 'T': DebugFlag |= DB_PRTTRIG; break;
@@ -728,7 +745,7 @@ void InitRemind(int argc, char const *argv[])
default:
if (tok.type == T_Illegal && tok.val < 0) {
fprintf(stderr, "%s: `%s'\n", GetErr(-tok.val), arg);
fprintf(ErrFp, "%s: `%s'\n", GetErr(-tok.val), arg);
Usage();
}
Usage();
@@ -790,7 +807,7 @@ void InitRemind(int argc, char const *argv[])
#ifndef L_USAGE_OVERRIDE
void Usage(void)
{
fprintf(ErrFp, "\nREMIND %s Copyright 1992-2024 Dianne Skoll\n", VERSION);
fprintf(ErrFp, "\nREMIND %s Copyright (C) 1992-2025 Dianne Skoll\n", VERSION);
#ifdef BETA
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
#endif
@@ -1018,7 +1035,7 @@ AddTrustedUser(char const *username)
{
struct passwd *pwent;
if (NumTrustedUsers >= MAX_TRUSTED_USERS) {
fprintf(stderr, "Too many trusted users (%d max)\n",
fprintf(ErrFp, "Too many trusted users (%d max)\n",
MAX_TRUSTED_USERS);
exit(EXIT_FAILURE);
}
+43 -17
View File
@@ -6,7 +6,7 @@
/* routines, etc. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -60,19 +60,21 @@ exitfunc(void)
/* Kill any execution-time-limiter process */
unlimit_execution_time();
int maxlen, total;
double avglen;
if (DebugFlag & DB_PARSE_EXPR) {
if (DebugFlag & DB_HASHSTATS) {
fflush(stdout);
fflush(stderr);
get_var_hash_stats(&total, &maxlen, &avglen);
fprintf(stderr, " Var hash: total = %d; maxlen = %d; avglen = %.3f\n", total, maxlen, avglen);
get_userfunc_hash_stats(&total, &maxlen, &avglen);
fprintf(stderr, " Func hash: total = %d; maxlen = %d; avglen = %.3f\n", total, maxlen, avglen);
get_dedupe_hash_stats(&total, &maxlen, &avglen);
fprintf(stderr, "Dedup hash: total = %d; maxlen = %d; avglen = %.3f\n", total, maxlen, avglen);
get_translation_hash_stats(&total, &maxlen, &avglen);
fprintf(stderr, "Trans hash: total = %d; maxlen = %d; avglen = %.3f\n", total, maxlen, avglen);
fflush(ErrFp);
fprintf(ErrFp, "Variable hash table statistics:\n");
dump_var_hash_stats();
fprintf(ErrFp, "Function hash table statistics:\n");
dump_userfunc_hash_stats();
fprintf(ErrFp, "Dedupe hash table statistics:\n");
dump_dedupe_hash_stats();
fprintf(ErrFp, "Translation hash table statistics:\n");
dump_translation_hash_stats();
UnsetAllUserFuncs();
print_expr_nodes_stats();
}
@@ -128,7 +130,7 @@ int main(int argc, char *argv[])
sigemptyset(&act.sa_mask);
act.sa_flags = SA_RESTART;
if (sigaction(SIGALRM, &act, NULL) < 0) {
fprintf(stderr, "%s: sigaction() failed: %s\n",
fprintf(ErrFp, "%s: sigaction() failed: %s\n",
argv[0], strerror(errno));
exit(1);
}
@@ -137,7 +139,7 @@ int main(int argc, char *argv[])
act.sa_flags = SA_RESTART;
sigemptyset(&act.sa_mask);
if (sigaction(SIGXCPU, &act, NULL) < 0) {
fprintf(stderr, "%s: sigaction() failed: %s\n",
fprintf(ErrFp, "%s: sigaction() failed: %s\n",
argv[0], strerror(errno));
exit(1);
}
@@ -600,6 +602,24 @@ int ParseNonSpaceChar(ParsePtr p, int *err, int peek)
return ch;
}
/***************************************************************/
/* */
/* ParseTokenOrQuotedString */
/* */
/* Parse either a token or a double-quote-delimited string. */
/* */
/***************************************************************/
int ParseTokenOrQuotedString(ParsePtr p, DynamicBuffer *dbuf)
{
int c, err;
c = ParseNonSpaceChar(p, &err, 1);
if (err) return err;
if (c != '"') {
return ParseToken(p, dbuf);
}
return ParseQuotedString(p, dbuf);
}
/***************************************************************/
/* */
/* ParseQuotedString */
@@ -1253,6 +1273,12 @@ int DoDebug(ParsePtr p)
else DebugFlag &= ~DB_PARSE_EXPR;
break;
case 'h':
case 'H':
if (val) DebugFlag |= DB_HASHSTATS;
else DebugFlag &= ~DB_HASHSTATS;
break;
case 'x':
case 'X':
if (val) DebugFlag |= DB_PRTEXPR;
@@ -1980,7 +2006,7 @@ get_day_name(int wkday)
if (wkday < 0 || wkday > 6) {
return "INVALID_WKDAY";
}
return t(DayName[wkday]);
return tr(DayName[wkday]);
}
char const *
@@ -1989,7 +2015,7 @@ get_month_name(int mon)
if (mon < 0 || mon > 11) {
return "INVALID_MON";
}
return t(MonthName[mon]);
return tr(MonthName[mon]);
}
static int GetOnceDateFromFile(void)
+1 -1
View File
@@ -5,7 +5,7 @@
/* Calculations for figuring out moon phases. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+4 -1
View File
@@ -6,7 +6,7 @@
/* the data structures for OMITted dates. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -185,6 +185,9 @@ int PopOmitContext(ParsePtr p)
/* Remove the context from the stack */
SavedOmitContexts = c->next;
if (c->filename && FileName && strcmp(c->filename, FileName)) {
Wprint("POP-OMIT-CONTEXT at %s:%d matches PUSH-OMIT-CONTEXT in different file: %s:%d", FileName, LineNo, c->filename, c->lineno);
}
/* Free memory used by the saved context */
if (c->partsave) free(c->partsave);
if (c->fullsave) free(c->fullsave);
+6 -7
View File
@@ -5,7 +5,7 @@
/* Function Prototypes. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -88,6 +88,7 @@ int JulianToGregorianOffset(int y, int m);
int ParseChar (ParsePtr p, int *err, int peek);
int ParseToken (ParsePtr p, DynamicBuffer *dbuf);
int ParseQuotedString (ParsePtr p, DynamicBuffer *dbuf);
int ParseTokenOrQuotedString (ParsePtr p, DynamicBuffer *dbuf);
int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf);
expr_node * ParseExpr(ParsePtr p, int *r);
void print_expr_nodes_stats(void);
@@ -228,7 +229,6 @@ void set_cloexec(FILE *fp);
int push_call(char const *filename, char const *func, int lineno);
void clear_callstack(void);
int print_callstack(FILE *fp);
int have_callstack(void);
void pop_call(void);
void FixSpecialType(Trigger *trig);
void WriteJSONTrigger(Trigger const *t, int include_tags, int today);
@@ -255,10 +255,10 @@ void print_builtinfunc_tokens(void);
void print_remind_tokens(void);
/* Stats for -ds output */
void get_var_hash_stats(int *total, int *maxlen, double *avglen);
void get_userfunc_hash_stats(int *total, int *maxlen, double *avglen);
void get_dedupe_hash_stats(int *total, int *maxlen, double *avglen);
void get_translation_hash_stats(int *total, int *maxlen, double *avglen);
void dump_var_hash_stats(void);
void dump_userfunc_hash_stats(void);
void dump_dedupe_hash_stats(void);
void dump_translation_hash_stats(void);
/* Dedupe code */
int ShouldDedupe(int trigger_date, int trigger_time, char const *body);
@@ -271,6 +271,5 @@ void InitTranslationTable(void);
char const *GetTranslatedString(char const *orig);
int GetTranslatedStringTryingVariants(char const *orig, DynamicBuffer *out);
char const *GetErr(int r);
char const *t(char const *s);
char const *tr(char const *s);
void print_escaped_string(FILE *fp, char const *s);
+1 -1
View File
@@ -5,7 +5,7 @@
/* Queue up reminders for subsequent execution. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+2 -2
View File
@@ -5,7 +5,7 @@
/* Print a PostScript calendar. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -350,7 +350,7 @@ int main(int argc, char *argv[])
!strcmp(DBufValue(&buf), PSBEGIN2)) {
if (!validfile) {
if (Verbose) {
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-2024 by Dianne Skoll\n\n", VERSION);
fprintf(stderr, "Rem2PS: Version %s Copyright (C) 1992-2025 by Dianne Skoll\n\n", VERSION);
fprintf(stderr, "Generating PostScript calendar\n");
}
}
+2 -2
View File
@@ -5,7 +5,7 @@
/* Define the PostScript prologue */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -14,7 +14,7 @@ char *PSProlog1[] =
{
"% This file was produced by Remind and Rem2PS, written by",
"% Dianne Skoll.",
"% Remind and Rem2PS are Copyright 1992-2024 Dianne Skoll.",
"% Remind and Rem2PS are Copyright (C) 1992-2025 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",
+1 -1
View File
@@ -5,7 +5,7 @@
/* Routines for sorting reminders by trigger date */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+1 -1
View File
@@ -6,7 +6,7 @@
/* classifying the tokens parsed. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+5 -15
View File
@@ -6,7 +6,7 @@
/* the TRANSLATE keyword. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -202,7 +202,7 @@ InitTranslationTable(void)
{
if (hash_table_init(&TranslationTable, offsetof(XlateItem, link),
HashXlateItem, CompareXlateItems) < 0) {
fprintf(stderr, "Unable to initialize translation hash table: Out of memory. Exiting.\n");
fprintf(ErrFp, "Unable to initialize translation hash table: Out of memory. Exiting.\n");
exit(1);
}
InsertTranslation("LANGID", "en");
@@ -313,7 +313,7 @@ GetTranslatedStringTryingVariants(char const *orig, DynamicBuffer *out)
return 0;
}
char const *t(char const *orig)
char const *tr(char const *orig)
{
char const *n = GetTranslatedString(orig);
if (n) {
@@ -322,12 +322,6 @@ char const *t(char const *orig)
return orig;
}
/* If another "t" is in scope... */
char const *tr(char const *orig)
{
return t(orig);
}
int
DoTranslate(ParsePtr p)
{
@@ -392,12 +386,8 @@ DoTranslate(ParsePtr p)
}
void
get_translation_hash_stats(int *total, int *maxlen, double *avglen)
dump_translation_hash_stats(void)
{
struct hash_table_stats s;
hash_table_get_stats(&TranslationTable, &s);
*total = s.num_entries;
*maxlen = s.max_len;
*avglen = s.avg_len;
hash_table_dump_stats(&TranslationTable, ErrFp);
}
+1 -1
View File
@@ -5,7 +5,7 @@
/* Routines for figuring out the trigger date of a reminder */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
+21 -20
View File
@@ -5,7 +5,7 @@
/* Type definitions all dumped here. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -58,7 +58,7 @@ enum expr_node_type
N_SHORT_USER_FUNC,
N_USER_FUNC,
N_OPERATOR,
N_ERROR = 32767,
N_ERROR = 0x7FFF,
};
/* Structure for passing in Nargs and out RetVal from functions */
@@ -200,13 +200,14 @@ typedef Parser *ParsePtr; /* Pointer to parser structure */
#define NO_MAX 127
/* DEFINES for debugging flags */
#define DB_PRTLINE 1
#define DB_PRTEXPR 2
#define DB_PRTTRIG 4
#define DB_DUMP_VARS 8
#define DB_ECHO_LINE 16
#define DB_TRACE_FILES 32
#define DB_PARSE_EXPR 64
#define DB_PRTLINE 0x01
#define DB_PRTEXPR 0x02
#define DB_PRTTRIG 0x04
#define DB_DUMP_VARS 0x08
#define DB_ECHO_LINE 0x10
#define DB_TRACE_FILES 0x20
#define DB_PARSE_EXPR 0x40
#define DB_HASHSTATS 0x80
/* Enumeration of the tokens */
enum TokTypes
@@ -231,13 +232,13 @@ typedef struct {
} Token;
/* Flags for the state of the "if" stack */
#define IF_TRUE 0
#define IF_FALSE 1
#define BEFORE_ELSE 0
#define AFTER_ELSE 2
#define IF_MASK 3
#define IF_TRUE_MASK 1
#define IF_ELSE_MASK 2
#define IF_TRUE 0x00
#define IF_FALSE 0x01
#define BEFORE_ELSE 0x00
#define AFTER_ELSE 0x02
#define IF_MASK 0x03
#define IF_TRUE_MASK 0x01
#define IF_ELSE_MASK 0x02
/* Flags for the DoSubst function */
#define NORMAL_MODE 0
@@ -247,9 +248,9 @@ typedef struct {
#define QUOTE_MARKER 1 /* Unlikely character to appear in reminder */
/* Flags for disabling run */
#define RUN_CMDLINE 1
#define RUN_SCRIPT 2
#define RUN_NOTOWNER 4
#define RUN_CMDLINE 0x01
#define RUN_SCRIPT 0x02
#define RUN_NOTOWNER 0x04
/* Flags for the SimpleCalendar format */
#define SC_AMPM 0 /* Time shown as 3:00am, etc. */
@@ -286,7 +287,7 @@ typedef struct {
char const *name;
char modifiable;
int type;
void const *value;
void *value;
int min; /* Or const-value */
int max;
} SysVar;
+4 -8
View File
@@ -6,7 +6,7 @@
/* functions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -56,7 +56,7 @@ InitUserFunctions(void)
offsetof(UserFunc, link),
HashUserFunc,
CompareUserFuncs) < 0) {
fprintf(stderr, "Unable to initialize function hash table: Out of memory. Exiting.\n");
fprintf(ErrFp, "Unable to initialize function hash table: Out of memory. Exiting.\n");
exit(1);
}
}
@@ -506,12 +506,8 @@ RenameUserFunc(char const *oldname, char const *newname)
}
void
get_userfunc_hash_stats(int *total, int *maxlen, double *avglen)
dump_userfunc_hash_stats(void)
{
struct hash_table_stats s;
hash_table_get_stats(&FuncHash, &s);
*total = s.num_entries;
*maxlen = s.max_len;
*avglen = s.avg_len;
hash_table_dump_stats(&FuncHash, ErrFp);
}
+1 -7
View File
@@ -5,7 +5,7 @@
/* Useful utility functions. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -268,12 +268,6 @@ print_callstack_aux(FILE *fp, cs *entry)
}
}
int
have_callstack(void)
{
return (callstack != NULL);
}
int
print_callstack(FILE *fp)
{
+8 -11
View File
@@ -6,7 +6,7 @@
/* user- and system-defined variables. */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-2024 by Dianne Skoll */
/* Copyright (C) 1992-2025 by Dianne Skoll */
/* SPDX-License-Identifier: GPL-2.0-only */
/* */
/***************************************************************/
@@ -56,7 +56,7 @@ InitVars(void)
{
if (hash_table_init(&VHashTbl, offsetof(Var, link),
VarHashFunc, VarCompareFunc) < 0) {
fprintf(stderr, "Unable to initialize variable hash table: Out of memory. Exiting.\n");
fprintf(ErrFp, "Unable to initialize variable hash table: Out of memory. Exiting.\n");
exit(1);
}
}
@@ -723,7 +723,7 @@ int DoDump(ParsePtr p)
/* */
/* DumpVarTable */
/* */
/* Dump the variable table to stderr. */
/* Dump the variable table to ErrFp. */
/* */
/***************************************************************/
void DumpVarTable(void)
@@ -853,6 +853,7 @@ static SysVar SysVarArr[] = {
{"August", 1, TRANS_TYPE, "August", 0, 0 },
{"CalcUTC", 1, INT_TYPE, &CalculateUTC, 0, 1 },
{"CalMode", 0, INT_TYPE, &DoCalendar, 0, 0 },
{"CalType", 0, STR_TYPE, &CalType, 0, 0 },
{"Daemon", 0, INT_TYPE, &Daemon, 0, 0 },
{"DateSep", 1, SPECIAL_TYPE, date_sep_func, 0, 0 },
{"DateTimeSep", 1, SPECIAL_TYPE, datetime_sep_func, 0, 0 },
@@ -968,7 +969,7 @@ static int SetTranslatableVariable(SysVar *v, Value *value)
static int GetTranslatableVariable(SysVar *v, Value *value)
{
char const *translated = t((char const *) v->value);
char const *translated = tr((char const *) v->value);
if (translated) {
value->v.str = StrDup(translated);
} else {
@@ -1005,7 +1006,7 @@ static int SetSysVarHelper(SysVar *v, Value *value)
if (v->type == STR_TYPE) {
/* If it's already the same, don't bother doing anything */
if (!strcmp(value->v.str, (char const *) v->value)) {
if (!strcmp(value->v.str, * (char const **) v->value)) {
DestroyValue(*value);
return OK;
}
@@ -1249,11 +1250,7 @@ print_sysvar_tokens(void)
}
void
get_var_hash_stats(int *total, int *maxlen, double *avglen)
dump_var_hash_stats(void)
{
struct hash_table_stats s;
hash_table_get_stats(&VHashTbl, &s);
*total = s.num_entries;
*maxlen = s.max_len;
*avglen = s.avg_len;
hash_table_dump_stats(&VHashTbl, ErrFp);
}
+1 -1
View File
@@ -1,4 +1,4 @@
debug +sx
debug +hsx
set a 1
+12 -1
View File
@@ -7,7 +7,7 @@
# in the build directory.
#
# This file is part of REMIND.
# Copyright (C) 1992-2024 Dianne Skoll
# Copyright (C) 1992-2025 Dianne Skoll
# SPDX-License-Identifier: GPL-2.0-only
# ---------------------------------------------------------------------------
@@ -198,6 +198,17 @@ REM 4 MSG Normal
SET $DefaultColor "256 0 0"
EOF
# Test default color with weekly calendar
../src/remind -pq+ - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
REM 2 MSG Normal
SET $DefaultColor "255 0 0"
REM 3 MSG %"Red%" on the calendar!
SET $DefaultColor "-1 -1 -1"
REM 4 MSG Normal
# Should give an error
SET $DefaultColor "256 0 0"
EOF
# Test stdout
../src/remind - 1 jan 2012 <<'EOF' >> ../tests/test.out 2>&1
BANNER %
+81 -22
View File
@@ -1047,7 +1047,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
version() => "05.02.00"
version() => "05.02.02"
set a059 wkday(today())
today() => 1991-02-16
wkday(1991-02-16) => "Saturday"
@@ -2611,7 +2611,7 @@ a056 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
a007 "1991-02-16"
a057 "SDFJHSDF KSJDFH KJSDFH KSJDFH"
a008 "11:44"
a058 "05.02.00"
a058 "05.02.02"
a059 "Saturday"
a010 12
a060 6
@@ -2743,6 +2743,7 @@ Variable Value
$August "August"
$CalcUTC 0 [0, 1]
$CalMode 0
$CalType "none"
$Daemon 0
$DateSep "-"
$DateTimeSep "@"
@@ -5615,8 +5616,8 @@ REM SATISFY ""
REM SATISFY [version() > "01.00.00"]
../tests/test.rem(1050): SATISFY: expression has no reference to trigdate() or $T...
../tests/test.rem(1050): Trig = Saturday, 16 February, 1991
version() => "05.02.00"
"05.02.00" > "01.00.00" => 1
version() => "05.02.02"
"05.02.02" > "01.00.00" => 1
../tests/test.rem(1050): Trig(satisfied) = Saturday, 16 February, 1991
REM SATISFY [max(x, max(x, 1, 2, 3), 4, 5, 6) * 5]
../tests/test.rem(1051): SATISFY: expression has no reference to trigdate() or $T...
@@ -16127,8 +16128,8 @@ TRANSLATE "January" "translated-January"
TRANSLATE "Tuesday" "translated-Tuesday"
TRANSLATE "November" "translated-November"
TRANSLATE "tomorrow" "translated-Tomorrow"
TRANSLATE "today" "translated-Today"
TRANSLATE "is" "translated-Is"
TRANSLATE "today" "translated-Today"
TRANSLATE "from now" "translated-Fromnow"
TRANSLATE "Friday" "translated-Friday"
TRANSLATE "am" "translated-Am"
@@ -16139,8 +16140,8 @@ TRANSLATE "pm" "translated-Pm"
TRANSLATE "August" "translated-August"
TRANSLATE "May" "translated-May"
TRANSLATE "February" "translated-February"
TRANSLATE "on" "translated-On"
TRANSLATE "now" "translated-Now"
TRANSLATE "on" "translated-On"
$Ago is otherway-Ago
$Am is otherway-Am
$And is otherway-And
@@ -16232,11 +16233,28 @@ IF 1
../tests/test.rem(1435): Can't open file: /non/existent/file/should/not/work/wookie
ENDIF
do "with space.rem"
REM MSG D'oh, a file whose name has spaces! [filename()]
D'oh, a file whose name has spaces! ../tests/with space.rem
DEBUG -e
Var hash: total = 100141; maxlen = 5; avglen = 1.142
Func hash: total = 100016; maxlen = 5; avglen = 1.140
Dedup hash: total = 10000; maxlen = 7; avglen = 1.828
Trans hash: total = 1; maxlen = 1; avglen = 0.059
Variable hash table statistics:
Entries: 100141; Buckets: 87719; Non-empty Buckets: 66299
Maxlen: 5; Minlen: 0; Avglen: 1.142; Stddev: 0.878; Avg nonempty len: 1.510
Growths: 13; Shrinks: 0
Function hash table statistics:
Entries: 100016; Buckets: 87719; Non-empty Buckets: 63572
Maxlen: 5; Minlen: 0; Avglen: 1.140; Stddev: 0.934; Avg nonempty len: 1.573
Growths: 13; Shrinks: 0
Dedupe hash table statistics:
Entries: 10000; Buckets: 5471; Non-empty Buckets: 4752
Maxlen: 7; Minlen: 0; Avglen: 1.828; Stddev: 1.302; Avg nonempty len: 2.104
Growths: 9; Shrinks: 0
Translation hash table statistics:
Entries: 1; Buckets: 7; Non-empty Buckets: 1
Maxlen: 1; Minlen: 0; Avglen: 0.143; Stddev: 0.350; Avg nonempty len: 1.000
Growths: 0; Shrinks: 0
Expression nodes allocated: 300096
Expression nodes high-water: 300073
Expression nodes leaked: 0
@@ -20099,7 +20117,7 @@ No reminders.
<< /PageSize [612 792] >> setpagedevice
% This file was produced by Remind and Rem2PS, written by
% Dianne Skoll.
% Remind and Rem2PS are Copyright 1992-2024 Dianne Skoll.
% Remind and Rem2PS are Copyright (C) 1992-2025 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
@@ -21203,7 +21221,7 @@ showpage
<< /PageSize [612 792] >> setpagedevice
% This file was produced by Remind and Rem2PS, written by
% Dianne Skoll.
% Remind and Rem2PS are Copyright 1992-2024 Dianne Skoll.
% Remind and Rem2PS are Copyright (C) 1992-2025 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
@@ -22389,13 +22407,29 @@ February 29
-stdin-(7): Number too high
[
{
"translations":{"LANGID":"en"},"monthname":"January","year":2012,"daysinmonth":31,"firstwkday":0,"mondayfirst":0,"daynames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"prevmonthname":"December","daysinprevmonth":31,"prevmonthyear":2011,"nextmonthname":"February","daysinnextmonth":29,"nextmonthyear":2012,"entries":[
"translations":{"LANGID":"en"},"caltype":"monthly","monthname":"January","year":2012,"daysinmonth":31,"firstwkday":0,"mondayfirst":0,"daynames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"prevmonthname":"December","daysinprevmonth":31,"prevmonthyear":2011,"nextmonthname":"February","daysinnextmonth":29,"nextmonthyear":2012,"entries":[
{"date":"2012-01-02","filename":"-","lineno":1,"d":2,"priority":5000,"body":"Normal"},
{"date":"2012-01-03","filename":"-","lineno":3,"passthru":"COLOR","d":3,"priority":5000,"r":255,"g":0,"b":0,"rawbody":"%\"Red%\" on the calendar!","calendar_body":"Red","plain_body":"Red on the calendar!","body":"255 0 0 %\"Red%\" on the calendar!"},
{"date":"2012-01-04","filename":"-","lineno":5,"d":4,"priority":5000,"body":"Normal"}
]
}
]
-stdin-(7): Number too high
-stdin-(7): Number too high
-stdin-(7): Number too high
-stdin-(7): Number too high
-stdin-(7): Number too high
-stdin-(7): Number too high
-stdin-(7): Number too high
-stdin-(7): Number too high
[
{
"caltype":"weekly","translations":{"LANGID":"en"},"dates":[{"dayname":"Sunday","date":"2012-01-01","year":2012,"month":"January","day":1},{"dayname":"Monday","date":"2012-01-02","year":2012,"month":"January","day":2},{"dayname":"Tuesday","date":"2012-01-03","year":2012,"month":"January","day":3},{"dayname":"Wednesday","date":"2012-01-04","year":2012,"month":"January","day":4},{"dayname":"Thursday","date":"2012-01-05","year":2012,"month":"January","day":5},{"dayname":"Friday","date":"2012-01-06","year":2012,"month":"January","day":6},{"dayname":"Saturday","date":"2012-01-07","year":2012,"month":"January","day":7}],"entries":[{"date":"2012-01-02","d":2,"priority":5000,"body":"Normal"},
{"date":"2012-01-03","passthru":"COLOR","d":3,"priority":5000,"r":255,"g":0,"b":0,"rawbody":"%\"Red%\" on the calendar!","calendar_body":"Red","plain_body":"Red on the calendar!","body":"255 0 0 %\"Red%\" on the calendar!"},
{"date":"2012-01-04","d":4,"priority":5000,"body":"Normal"}
]
}
]
STDOUT is a: FILE
STDOUT is a: PIPE
+----------------------------------------------------------------------------+
@@ -23150,7 +23184,7 @@ SECURITY: Won't read world-writable file or directory!
Error reading include_dir/ww: Can't open file
SECURITY: Won't read world-writable file or directory!
Error reading include_dir/ww: No files matching *.rem
05.02.00
05.02.02
NOTE JSONQUEUE
[{"priority":2,"eventstart":"VOLATILE","time":"23:59","nexttime":"23:59","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue2.rem","lineno":1,"type":"MSG_TYPE","body":"XXXX"},{"priority":999,"eventstart":"VOLATILE","time":"23:58","nexttime":"23:58","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":5,"type":"MSG_TYPE","body":"quux"},{"priority":42,"eventstart":"VOLATILE","time":"23:57","nexttime":"23:57","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":4,"type":"MSG_TYPE","body":"bar"},{"priority":5000,"eventstart":"VOLATILE","time":"23:56","nexttime":"23:56","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":3,"type":"MSG_TYPE","body":"foo"}]
NOTE ENDJSONQUEUE
@@ -23702,10 +23736,22 @@ Parsed expression: isany("foo", 1 + 1, 2:00 + 1, '2021-01-01' + 1, '2021-01-01@1
"f" + "oo" => "foo"
isany("foo", 2, 02:01, 2021-01-02, 2021-01-01@14:01, "foo", ?) => 1
No reminders.
Var hash: total = 1; maxlen = 1; avglen = 0.059
Func hash: total = 0; maxlen = 0; avglen = 0.000
Dedup hash: total = 0; maxlen = 0; avglen = 0.000
Trans hash: total = 1; maxlen = 1; avglen = 0.059
Variable hash table statistics:
Entries: 1; Buckets: 7; Non-empty Buckets: 1
Maxlen: 1; Minlen: 0; Avglen: 0.143; Stddev: 0.350; Avg nonempty len: 1.000
Growths: 0; Shrinks: 0
Function hash table statistics:
Entries: 0; Buckets: 7; Non-empty Buckets: 0
Maxlen: 0; Minlen: 0; Avglen: 0.000; Stddev: 0.000; Avg nonempty len: 0.000
Growths: 0; Shrinks: 0
Dedupe hash table statistics:
Entries: 0; Buckets: 7; Non-empty Buckets: 0
Maxlen: 0; Minlen: 0; Avglen: 0.000; Stddev: 0.000; Avg nonempty len: 0.000
Growths: 0; Shrinks: 0
Translation hash table statistics:
Entries: 1; Buckets: 7; Non-empty Buckets: 1
Maxlen: 1; Minlen: 0; Avglen: 0.143; Stddev: 0.350; Avg nonempty len: 1.000
Growths: 0; Shrinks: 0
Expression nodes allocated: 512
Expression nodes high-water: 499
Expression nodes leaked: 0
@@ -24125,6 +24171,7 @@ $At
$August
$CalcUTC
$CalMode
$CalType
$Daemon
$DateSep
$DateTimeSep
@@ -24229,10 +24276,22 @@ $Uy
$Was
$Wednesday
No reminders.
Var hash: total = 1; maxlen = 1; avglen = 0.059
Func hash: total = 1; maxlen = 1; avglen = 0.059
Dedup hash: total = 0; maxlen = 0; avglen = 0.000
Trans hash: total = 2; maxlen = 1; avglen = 0.118
Variable hash table statistics:
Entries: 1; Buckets: 7; Non-empty Buckets: 1
Maxlen: 1; Minlen: 0; Avglen: 0.143; Stddev: 0.350; Avg nonempty len: 1.000
Growths: 13; Shrinks: 13
Function hash table statistics:
Entries: 1; Buckets: 7; Non-empty Buckets: 1
Maxlen: 1; Minlen: 0; Avglen: 0.143; Stddev: 0.350; Avg nonempty len: 1.000
Growths: 13; Shrinks: 13
Dedupe hash table statistics:
Entries: 0; Buckets: 7; Non-empty Buckets: 0
Maxlen: 0; Minlen: 0; Avglen: 0.000; Stddev: 0.000; Avg nonempty len: 0.000
Growths: 0; Shrinks: 0
Translation hash table statistics:
Entries: 2; Buckets: 7; Non-empty Buckets: 1
Maxlen: 2; Minlen: 0; Avglen: 0.286; Stddev: 0.700; Avg nonempty len: 2.000
Growths: 13; Shrinks: 13
Expression nodes allocated: 300032
Expression nodes high-water: 300000
Expression nodes leaked: 0
+3 -1
View File
@@ -1435,10 +1435,12 @@ IF 1
INCLUDE /non/existent/file/should/not/work/wookie
ENDIF
do "with space.rem"
DEBUG -e
# Output expression-node stats
DEBUG +s
DEBUG +h
# Don't want Remind to queue reminders
EXIT
+1 -1
View File
@@ -600001,4 +600001,4 @@ TRANSLATE "99999"
SET BOOGIE 1
FSET QUUX(x) x*2
TRANSLATE "A" "B"
DEBUG +s
DEBUG +h
+1 -1
View File
@@ -11,7 +11,7 @@
# Use the output to verify your translations.
#
# This file is part of REMIND.
# Copyright (C) 1992-2024 Dianne Skoll
# Copyright (C) 1992-2025 Dianne Skoll
# SPDX-License-Identifier: GPL-2.0-only
#
# ---------------------------------------------------------------------------
+1
View File
@@ -0,0 +1 @@
REM MSG D'oh, a file whose name has spaces! [filename()]
+1 -1
View File
@@ -1,6 +1,6 @@
# Makefile.in for installing WWW server calendar scripts
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
# The complete path to where the scripts actually live, as seen by
# the UNIX operating system.
+9 -9
View File
@@ -1,15 +1,15 @@
README
HTML Hebrew Calendar Server
HTML Calendar Server
This is a rudimentary Hebrew calendar server for the WWW. It
supplies local sunrise and sunset times, moon phases, upcoming Jewish
holidays, and PostScript calendars. It only works under UNIX. I've
only tested it with Linux running NCSA's httpd and Apache's httpd, but
it should work on any UNIX web server.
This is a rudimentary calendar server for the WWW. It supplies local
sunrise and sunset times, moon phases, upcoming Jewish holidays, and
PostScript calendars. It only works under UNIX/Linux. I've only tested it
with Linux running Apache's httpd, but it should work on any UNIX/Linx web
server that supports CGI scripts.
To install it, you need the Remind package, available via ftp from
https://dianne.skoll.ca/projects/remind/ You should install Remind,
To install it, you need the Remind package, available from
https://dianne.skoll.ca/projects/remind/ You should install Remind,
setting the latitude, longitude, location and time zone as appropriate
for your machine.
@@ -40,4 +40,4 @@ where "what" is one of:
called "calendar.html" and installed in the HTMLDIR you specified
in the Makefile.
4) Enjoy!
5) Enjoy!
+1 -1
View File
@@ -1,7 +1,7 @@
#!/bin/sh
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
# CAL_DISPATCH -- Shell script for CGI directory to dispatch calendar
# commands.
+1 -1
View File
@@ -2,7 +2,7 @@
# PostScript calendar shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
echo "Content-type: application/pdf"
echo
+1 -1
View File
@@ -2,7 +2,7 @@
# PostScript calendar shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
echo "Content-type: application/postscript"
echo
+1 -1
View File
@@ -2,7 +2,7 @@
# Hebrew date shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
echo Content-type: text/html
echo ""
+1 -1
View File
@@ -1,7 +1,7 @@
# Hebrew date reminder file
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
BANNER %
IF !$PSCAL
+1 -1
View File
@@ -2,7 +2,7 @@
# HTML calendar shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
echo "Content-Type: text/html"
echo ""
+1 -1
View File
@@ -2,7 +2,7 @@
# Hebrew PostScript calendar shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
# Figure out the month: If day <= 20, use this month; otherwise, use
# next month.
+1 -1
View File
@@ -2,7 +2,7 @@
# Hebrew PostScript calendar shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
# Figure out the month: If day <= 20, use this month; otherwise, use
# next month.
+1 -1
View File
@@ -2,7 +2,7 @@
# Moon shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
echo Content-type: text/html
echo
+1 -1
View File
@@ -1,7 +1,7 @@
# File for giving moon phase info.
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
set now now()
+1 -1
View File
@@ -2,7 +2,7 @@
# Sunrise shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
echo Content-type: text/html
echo
+1 -1
View File
@@ -1,7 +1,7 @@
# File for giving sunrise info
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
set now now()
+1 -1
View File
@@ -2,7 +2,7 @@
# Sunset shell script
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
# SPDX-License-Identifier: GPL-2.0-only
echo Content-type: text/html
+1 -1
View File
@@ -1,7 +1,7 @@
# File for giving sunset info
#
# This file is part of REMIND.
# Copyright (C) 1992-2018 by Dianne Skoll
# Copyright (C) 1992-2025 by Dianne Skoll
# SPDX-License-Identifier: GPL-2.0-only
set now now()