mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 14:59:20 +02:00
Compare commits
82 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51dfd707a2 | ||
|
|
7c3bf8601b | ||
|
|
714195efe5 | ||
|
|
eaeca2d09b | ||
|
|
ffa3b13437 | ||
|
|
2551e98d11 | ||
|
|
1bfd7761bc | ||
|
|
de9cb1d0a3 | ||
|
|
b2d32b514a | ||
|
|
6e53fd6924 | ||
|
|
8296d2b962 | ||
|
|
d6e66ee1e6 | ||
|
|
a49532b9c5 | ||
|
|
57d87f4caf | ||
|
|
ec9b30c616 | ||
|
|
27d8a62ab6 | ||
|
|
5077814c4a | ||
|
|
ca795a352a | ||
|
|
e59fc36458 | ||
|
|
39e3657539 | ||
|
|
6031f70701 | ||
|
|
3567c9e55f | ||
|
|
26de4e3fd3 | ||
|
|
cd65c6144d | ||
|
|
d32edbbb1f | ||
|
|
eae48a5538 | ||
|
|
63eba104d9 | ||
|
|
ae64961735 | ||
|
|
f7bb91320c | ||
|
|
c11071a859 | ||
|
|
53cbcc22db | ||
|
|
af9dcec3e9 | ||
|
|
d5a4b0d235 | ||
|
|
3b870403d9 | ||
|
|
284d822884 | ||
|
|
d881a26ad0 | ||
|
|
8519edde29 | ||
|
|
a30c467c48 | ||
|
|
887cd83ebe | ||
|
|
242d787ca2 | ||
|
|
5dd2cf7356 | ||
|
|
5efb70909d | ||
|
|
a60d466774 | ||
|
|
1c01f36271 | ||
|
|
3718632551 | ||
|
|
e8f3d5ff9f | ||
|
|
d77e27942d | ||
|
|
734cc61489 | ||
|
|
44d489d3d2 | ||
|
|
3e36ffa9ff | ||
|
|
12104a96b1 | ||
|
|
8ab8d65a15 | ||
|
|
f7a8122cef | ||
|
|
77d9bbb7d6 | ||
|
|
623def52fd | ||
|
|
d088e35142 | ||
|
|
5821e55eb8 | ||
|
|
1ee989c65d | ||
|
|
62388fb21f | ||
|
|
13571f84af | ||
|
|
03fdc06b65 | ||
|
|
4bce675ae6 | ||
|
|
7b64623115 | ||
|
|
e268bbf31d | ||
|
|
5863404de6 | ||
|
|
2de5996f4e | ||
|
|
695e79602a | ||
|
|
cf0d958da5 | ||
|
|
85b0348fa7 | ||
|
|
15a5d9a876 | ||
|
|
1baa6dab0c | ||
|
|
34bb250ba3 | ||
|
|
598b1b7464 | ||
|
|
e63d4be4e8 | ||
|
|
65561e7f34 | ||
|
|
da31dadb71 | ||
|
|
705adbb82a | ||
|
|
269f9788b6 | ||
|
|
5e1c5ae384 | ||
|
|
562eb83bde | ||
|
|
a53db00243 | ||
|
|
11375729db |
27
configure.in
27
configure.in
@@ -1,6 +1,7 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_INIT(src/queue.c)
|
AC_INIT
|
||||||
|
AC_CONFIG_SRCDIR([src/queue.c])
|
||||||
|
|
||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@ cat <<'EOF'
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
AC_CONFIG_HEADER(src/config.h)
|
AC_CONFIG_HEADERS([src/config.h])
|
||||||
|
|
||||||
AC_ARG_ENABLE(perl-build-artifacts,
|
AC_ARG_ENABLE(perl-build-artifacts,
|
||||||
[ --disable-perl-build-artifacts
|
[ --disable-perl-build-artifacts
|
||||||
@@ -29,32 +30,32 @@ AC_PATH_PROG([PERL], [perl])
|
|||||||
|
|
||||||
dnl Checks for libraries.
|
dnl Checks for libraries.
|
||||||
AC_CHECK_LIB(m, sqrt)
|
AC_CHECK_LIB(m, sqrt)
|
||||||
|
AC_CHECK_HEADERS_ONCE([sys/time.h])
|
||||||
|
|
||||||
dnl Integer sizes
|
dnl Integer sizes
|
||||||
AC_CHECK_SIZEOF(unsigned int)
|
AC_CHECK_SIZEOF(unsigned int)
|
||||||
AC_CHECK_SIZEOF(unsigned long)
|
AC_CHECK_SIZEOF(unsigned long)
|
||||||
|
AC_CHECK_SIZEOF(time_t)
|
||||||
|
|
||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_CHECK_HEADERS(sys/types.h sys/file.h glob.h wctype.h locale.h langinfo.h)
|
AC_CHECK_HEADERS(sys/types.h glob.h wctype.h locale.h langinfo.h)
|
||||||
|
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_STRUCT_TM
|
AC_STRUCT_TM
|
||||||
|
|
||||||
dnl Checks for library functions.
|
dnl Checks for library functions.
|
||||||
AC_FUNC_UTIME_NULL
|
AC_FUNC_UTIME_NULL
|
||||||
AC_HEADER_TIME
|
|
||||||
|
|
||||||
if test "$GCC" = yes; then
|
if test "$GCC" = yes; then
|
||||||
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
|
CFLAGS="$CFLAGS -Wall -Wextra -Wstrict-prototypes"
|
||||||
# Check for link-time optimization support
|
# Check for link-time optimization support
|
||||||
f=-flto=auto
|
f=-flto=auto
|
||||||
AC_MSG_CHECKING([whether $CC supports $f])
|
AC_MSG_CHECKING([whether $CC supports $f])
|
||||||
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
|
if $CC -Werror -E $f - < /dev/null > /dev/null 2>&1 ; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
CFLAGS="$CFLAGS $f"
|
CFLAGS="$CFLAGS $f"
|
||||||
f=-ffat-lto-objects
|
f=-ffat-lto-objects
|
||||||
AC_MSG_CHECKING([whether $CC supports $f])
|
AC_MSG_CHECKING([whether $CC supports $f])
|
||||||
if $CC -E $f /dev/null > /dev/null 2>&1 ; then
|
if $CC -Werror -E $f - < /dev/null > /dev/null 2>&1 ; then
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
CFLAGS="$CFLAGS $f"
|
CFLAGS="$CFLAGS $f"
|
||||||
else
|
else
|
||||||
@@ -65,6 +66,12 @@ if test "$GCC" = yes; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl If sizeof(time_t) is 4, try to get 64-bit time_t
|
||||||
|
if test "$ac_cv_sizeof_time_t" = "4" ; then
|
||||||
|
AC_MSG_NOTICE([time_t is 32-bits on this system; attempting to use 64-bit time_t])
|
||||||
|
CFLAGS="$CFLAGS -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64"
|
||||||
|
fi
|
||||||
|
|
||||||
if test "$ac_cv_perlartifacts" = "yes" ; then
|
if test "$ac_cv_perlartifacts" = "yes" ; then
|
||||||
PERLARTIFACTS=
|
PERLARTIFACTS=
|
||||||
else
|
else
|
||||||
@@ -80,10 +87,12 @@ if test "$?" != 0 ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
||||||
VERSION=04.02.04
|
|
||||||
|
VERSION=04.02.08
|
||||||
AC_SUBST(VERSION)
|
AC_SUBST(VERSION)
|
||||||
AC_SUBST(PERL)
|
AC_SUBST(PERL)
|
||||||
AC_SUBST(PERLARTIFACTS)
|
AC_SUBST(PERLARTIFACTS)
|
||||||
AC_SUBST(RELEASE_DATE)
|
AC_SUBST(RELEASE_DATE)
|
||||||
AC_OUTPUT(src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1)
|
AC_CONFIG_FILES([src/Makefile www/Makefile src/version.h rem2html/Makefile rem2pdf/Makefile.PL rem2pdf/Makefile.top rem2pdf/bin/rem2pdf man/rem.1 man/rem2ps.1 man/remind.1 man/tkremind.1])
|
||||||
|
AC_OUTPUT
|
||||||
chmod a+x rem2pdf/bin/rem2pdf
|
chmod a+x rem2pdf/bin/rem2pdf
|
||||||
|
|||||||
@@ -514,6 +514,7 @@ Acts on the region or places point where it needs to be."
|
|||||||
(set (make-local-variable 'comment-start) ";")
|
(set (make-local-variable 'comment-start) ";")
|
||||||
(set (make-local-variable 'comment-start) "#")
|
(set (make-local-variable 'comment-start) "#")
|
||||||
(set (make-local-variable 'comment-end) "\n")
|
(set (make-local-variable 'comment-end) "\n")
|
||||||
|
(set (make-local-variable 'comment-end-skip) "[ \t]*\\(\\s>\\||#\\)")
|
||||||
(set (make-local-variable 'skeleton-end-hook) nil) ; so the skeletons will not automatically go to a new line.
|
(set (make-local-variable 'skeleton-end-hook) nil) ; so the skeletons will not automatically go to a new line.
|
||||||
(set (make-local-variable 'fill-column) '100);cause I was having problems with autofill.
|
(set (make-local-variable 'fill-column) '100);cause I was having problems with autofill.
|
||||||
(set (make-local-variable 'indent-line-function) 'remind-indent-line)
|
(set (make-local-variable 'indent-line-function) 'remind-indent-line)
|
||||||
|
|||||||
101
docs/WHATSNEW
101
docs/WHATSNEW
@@ -1,5 +1,106 @@
|
|||||||
CHANGES TO REMIND
|
CHANGES TO REMIND
|
||||||
|
|
||||||
|
* VERSION 4.2 Patch 8 - 2023-12-14
|
||||||
|
|
||||||
|
- NEW FEATURE: Add the $MaxLateMinutes system variable. This suppresses
|
||||||
|
a queued time reminder if the current time is more than $MaxLateMinutes
|
||||||
|
past the trigger time. (This typically only occurs if the computer
|
||||||
|
has been suspended/hibernated and then resumed.)
|
||||||
|
|
||||||
|
- IMPROVEMENT: tkremind: If an error occurs during printing, catch it
|
||||||
|
and change the Queue... button to Errors... (the same way errors in
|
||||||
|
reminder files are handled.)
|
||||||
|
|
||||||
|
- IMPROVEMENT: rem2html: add the --utf8 flag to set the HTML charset to
|
||||||
|
UTF-8.
|
||||||
|
|
||||||
|
- MINOR IMPROVEMENTS: Refactor some of the C code; use symbolic exit
|
||||||
|
statuses and file descriptors for stdin/stdout/stderr where possible.
|
||||||
|
|
||||||
|
- BUG FIX: configure.in: Use better option detection so we don't use the
|
||||||
|
unsupported option -ffat-lto-objects if compiling with clang instead of gcc.
|
||||||
|
|
||||||
|
- BUG FIXES: Many fixes to man pages, some by Jochen Sprickerhof
|
||||||
|
|
||||||
|
- MINOR BUG FIX: If Remind puts itself in the background, only close
|
||||||
|
stdout/stderr if they are not associated with a terminal. If
|
||||||
|
we close a descriptor, dup /dev/null onto it.
|
||||||
|
|
||||||
|
- MINOR BUG FIX: Catch SIGCONT when running in daemon/background mode.
|
||||||
|
This forces the select() call to be interrupted so we can update the
|
||||||
|
sleep time. This really only matters if the computer or the background
|
||||||
|
Remind process is suspended and then resumed.
|
||||||
|
|
||||||
|
* VERSION 4.2 Patch 7 - 2023-10-09
|
||||||
|
|
||||||
|
- IMPROVEMENT: remind: On 32-bit systems, attempt to use a 64-bit time_t
|
||||||
|
if the C library supports that. This lets Remind work properly with
|
||||||
|
dates after 2038 in the few cases it has to call mktime() internally.
|
||||||
|
|
||||||
|
- MINOR NEW FEATURE: remind: Attempt to obtain the terminal background
|
||||||
|
color using an OSC sequence. This normally only happens if standard
|
||||||
|
output is a terminal, but can be forced with the '-@..,t' option.
|
||||||
|
|
||||||
|
- MINOR NEW FEATURE: remind: Add "--version" long option to print out
|
||||||
|
Remind's version and exit.
|
||||||
|
|
||||||
|
- MINOR IMPROVEMENT: tkremind: Use a higher-resolution PNG image for
|
||||||
|
the icon.
|
||||||
|
|
||||||
|
- MINOR IMPROVEMENT: remind-conf-mode.el: Update highlighting rules
|
||||||
|
courtesy of Bill Benedetto
|
||||||
|
|
||||||
|
- MINOR CHANGE: Make AT optional. If we encounter a TIME in a REM
|
||||||
|
command, implicitly begin an AT clause.
|
||||||
|
|
||||||
|
- DOCUMENTATION: Many minor fixes and improvements courtesy of Dan Jacobson.
|
||||||
|
|
||||||
|
- BUG FIX: Make "-w0" set the calendar width based on standard output
|
||||||
|
rather than setting it to zero and causing an infinite loop.
|
||||||
|
|
||||||
|
* VERSION 4.2 Patch 6 - 2023-09-12
|
||||||
|
|
||||||
|
- NEW FEATURE: remind: The "nonomitted()" function takes an optional
|
||||||
|
extra INT argument called "step". See man page for details. Also
|
||||||
|
allows the "start" argument to be greater than the "end" argument,
|
||||||
|
in which case they are effectively swapped.
|
||||||
|
|
||||||
|
- NEW FEATURE: remind: The "slide()" function takes an optional extra
|
||||||
|
INT argument called "step", similar to "nonomitted()". See man page
|
||||||
|
for details.
|
||||||
|
|
||||||
|
- NEW FEATURE: remind: Added the $ParseUntriggered system variable;
|
||||||
|
see the man page for details. You almost certainly will never need
|
||||||
|
to use this.
|
||||||
|
|
||||||
|
- NEW FILE: holidays/ie.rem: Added Irish holidays, courtesy of
|
||||||
|
Amy de Buitléir.
|
||||||
|
|
||||||
|
- CHANGE: remind: The "-tn" option sets all REM statement deltas to
|
||||||
|
++n rather than adding n to any existing REM statement's delta.
|
||||||
|
Additionally, the corresponding system variable $DeltaOffset has
|
||||||
|
been renamed to $DeltaOverride.
|
||||||
|
|
||||||
|
- NEW OPTION: remind: Add the "-tz" option to explicitly set all
|
||||||
|
REM statement deltas to zero.
|
||||||
|
|
||||||
|
- DOCUMENTATION FIX: remind: various documentation improvements.
|
||||||
|
|
||||||
|
- BUG FIX: Correct some errors in Italian localization, courtesy of
|
||||||
|
Emanuele Torre
|
||||||
|
|
||||||
|
* VERSION 4.2 Patch 5 - 2023-04-11
|
||||||
|
|
||||||
|
- MINOR IMPROVEMENT: remind: If someone uses OMIT yyyy-mm-dd UNTIL yyyy-mm-dd
|
||||||
|
give a better error message suggesting THROUGH instead of UNTIL.
|
||||||
|
|
||||||
|
- BUG FIX: remind: The fix for the combination of ADDOMIT and SATISFY that
|
||||||
|
appeared in version 04.02.00 was not complete; the bug has finally been
|
||||||
|
properly fixed.
|
||||||
|
|
||||||
|
- BUG FIX: remind: Remove an unnecessary #include <sys/file.h>.
|
||||||
|
Nothing needed that and it broke compilation on FreeBSD.
|
||||||
|
|
||||||
* VERSION 4.2 Patch 4 - 2023-03-15
|
* VERSION 4.2 Patch 4 - 2023-03-15
|
||||||
|
|
||||||
- NEW FEATURE: Remind: Add "htmlescape" and "htmlstriptags" built-in
|
- NEW FEATURE: Remind: Add "htmlescape" and "htmlstriptags" built-in
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ FSET center(x) pad("", " ", (columns() - columns(x))/2) + x
|
|||||||
FSET right(x) pad("", " ", columns() - columns(x)) + x
|
FSET right(x) pad("", " ", columns() - columns(x)) + x
|
||||||
|
|
||||||
MSG This is left-aligned.
|
MSG This is left-aligned.
|
||||||
MSG [ansicolor(0,255,0)]This is also left-aligned.[ansicolor("")]
|
MSG [ansicolor(0,255,0)]🌕 🌕 🌕 🌕 This is also left-aligned.[ansicolor("")]
|
||||||
|
|
||||||
MSG [center("This is centered.")]
|
MSG [center("This is centered.")]
|
||||||
MSG [ansicolor(255,255,0) + center("🌕 🌕 🌕 🌕 This is also centered. ") + ansicolor("")]
|
MSG [ansicolor(255,255,0) + center("🌕 🌕 🌕 🌕 This is also centered. ") + ansicolor("")]
|
||||||
|
|||||||
@@ -8,15 +8,13 @@
|
|||||||
# Set this variable to 1 if your terminal has a dark background or 0 if
|
# Set this variable to 1 if your terminal has a dark background or 0 if
|
||||||
# it: light.
|
# it: light.
|
||||||
|
|
||||||
bg_dark=1
|
|
||||||
|
|
||||||
# Set your latitude and longitude correctly for Sunrise/Sunset/Equinox/Solstice
|
# Set your latitude and longitude correctly for Sunrise/Sunset/Equinox/Solstice
|
||||||
#
|
#
|
||||||
# The values below are for Ottawa, Ontario, Canada
|
# The values below are for Ottawa, Ontario, Canada
|
||||||
latitude="45.420556"
|
latitude="45.420556"
|
||||||
longitude="-75.689722"
|
longitude="-75.689722"
|
||||||
|
|
||||||
remind -g -ibg_dark="$bg_dark" "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
|
remind -g "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
|
||||||
SET $AddBlankLines 0
|
SET $AddBlankLines 0
|
||||||
BANNER %
|
BANNER %
|
||||||
|
|
||||||
@@ -24,24 +22,25 @@ INCLUDE [$SysInclude]/ansitext.rem
|
|||||||
|
|
||||||
MSG Today is [ansi_bold][$T][ansi_normal], being the [ord($T-date(year($T),1,1)+1)] day of [year($T)].%_
|
MSG Today is [ansi_bold][$T][ansi_normal], being the [ord($T-date(year($T),1,1)+1)] day of [year($T)].%_
|
||||||
|
|
||||||
IF bg_dark
|
IF $TerminalBackground == 0
|
||||||
SPECIAL COLOR 255 255 0 Sunrise: 🌅 [sunrise()] today and [sunrise($T+1)] tomorrow
|
SPECIAL COLOR 255 255 0 Sunrise: 🌅 [sunrise()] today and [sunrise($T+1)] tomorrow
|
||||||
SPECIAL COLOR 255 128 0 Sunset: 🌇 [sunset()] today and [sunset($T+1)] tomorrow%_
|
SPECIAL COLOR 255 128 0 Sunset: 🌇 [sunset()] today and [sunset($T+1)] tomorrow%_
|
||||||
|
ELSE
|
||||||
|
SPECIAL COLOR 128 128 0 Sunrise: 🌅 [sunrise()] today and [sunrise($T+1)] tomorrow
|
||||||
|
SPECIAL COLOR 128 32 0 Sunset: 🌇 [sunset()] today and [sunset($T+1)] tomorrow%_
|
||||||
|
|
||||||
ENDIF
|
ENDIF
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
remind -g -ibg_dark="$bg_dark" "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
|
remind -g "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
|
||||||
SET $AddBlankLines 0
|
SET $AddBlankLines 0
|
||||||
BANNER %
|
BANNER %
|
||||||
IF bg_dark
|
IF $TerminalBackground == 0
|
||||||
REM [moondatetime(0)] +60 SPECIAL COLOR 255 255 0 New moon: 🌑 [$T] %3 (%b)
|
REM [moondatetime(0)] +60 SPECIAL COLOR 255 255 0 New moon: 🌑 [$T] %3 (%b)
|
||||||
REM [moondatetime(1)] +60 SPECIAL COLOR 255 255 128 First Quarter: 🌓 [$T] %3 (%b)
|
REM [moondatetime(1)] +60 SPECIAL COLOR 255 255 128 First Quarter: 🌓 [$T] %3 (%b)
|
||||||
REM [moondatetime(2)] +60 SPECIAL COLOR 255 255 255 Full moon: 🌕 [$T] %3 (%b)
|
REM [moondatetime(2)] +60 SPECIAL COLOR 255 255 255 Full moon: 🌕 [$T] %3 (%b)
|
||||||
REM [moondatetime(3)] +60 SPECIAL COLOR 255 255 128 Last Quarter: 🌗 [$T] %3 (%b)
|
REM [moondatetime(3)] +60 SPECIAL COLOR 255 255 128 Last Quarter: 🌗 [$T] %3 (%b)
|
||||||
ELSE
|
ELSE
|
||||||
SPECIAL COLOR 128 128 0 Sunrise: 🌅 [sunrise()] today and [sunrise($T+1)] tomorrow
|
|
||||||
SPECIAL COLOR 128 32 0 Sunset: 🌇 [sunset()] today and [sunset($T+1)] tomorrow%_
|
|
||||||
|
|
||||||
REM [moondatetime(0)] +60 SPECIAL COLOR 128 128 0 New moon: 🌑 [$T] %3 (%b)
|
REM [moondatetime(0)] +60 SPECIAL COLOR 128 128 0 New moon: 🌑 [$T] %3 (%b)
|
||||||
REM [moondatetime(1)] +60 SPECIAL COLOR 128 128 64 First Quarter: 🌓 [$T] %3 (%b)
|
REM [moondatetime(1)] +60 SPECIAL COLOR 128 128 64 First Quarter: 🌓 [$T] %3 (%b)
|
||||||
REM [moondatetime(2)] +60 SPECIAL COLOR 0 0 0 Full moon: 🌕 [$T] %3 (%b)
|
REM [moondatetime(2)] +60 SPECIAL COLOR 0 0 0 Full moon: 🌕 [$T] %3 (%b)
|
||||||
@@ -51,7 +50,7 @@ EOF
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
remind -g -ibg_dark="$bg_dark" "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
|
remind -g "-i\$Latitude=\"$latitude\"" "-i\$Longitude=\"$longitude\"" -q -@2 - "$@" <<'EOF'
|
||||||
SET $AddBlankLines 0
|
SET $AddBlankLines 0
|
||||||
BANNER %
|
BANNER %
|
||||||
|
|
||||||
|
|||||||
42
include/holidays/ie.rem
Normal file
42
include/holidays/ie.rem
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
;
|
||||||
|
; Irish Holidays
|
||||||
|
;
|
||||||
|
; The dates for the Public ("bank") holidays are taken from the following site:
|
||||||
|
; https://www.citizensinformation.ie/en/employment/employment-rights-and-conditions/leave-and-holidays/public-holidays/
|
||||||
|
;
|
||||||
|
; This file was derived from:
|
||||||
|
; https://github.com/mhwombat/dotWombat/blob/master/.config/remind/IrishHolidays.rem
|
||||||
|
; by Amy de Buitléir.
|
||||||
|
|
||||||
|
; fixed dates
|
||||||
|
OMIT 31 December MSG New Year's Eve (Oíche Chinn Bliana) Public Holiday
|
||||||
|
OMIT 1 January MSG New Year's Day (Lá Caille, Lá Bliana Nua) Public Holiday
|
||||||
|
OMIT 17 March MSG Saint Patrick's Day (Lá Fhéile Pádraig) Public Holiday
|
||||||
|
OMIT 24 December MSG Christmas Eve (Oíche Nollag) Public Holiday
|
||||||
|
OMIT 25 December MSG Christmas Day (Lá Nollag) Public Holiday
|
||||||
|
OMIT 26 December MSG Saint Stephen's Day, Wren Day (Lá Fhéile Stiofáin, Lá an Dreoilín) Public Holiday
|
||||||
|
|
||||||
|
; moving dates
|
||||||
|
|
||||||
|
; First Monday in May
|
||||||
|
REM Monday 1 May SCANFROM -7 ADDOMIT MSG May Day (Lá Bealtaine) Public Holiday
|
||||||
|
|
||||||
|
; First Monday in June
|
||||||
|
REM Monday 1 June SCANFROM -7 ADDOMIT MSG June Public Holiday
|
||||||
|
|
||||||
|
; First Monday in August
|
||||||
|
REM Monday 1 August SCANFROM -7 ADDOMIT MSG August Public Holiday
|
||||||
|
|
||||||
|
; Last Monday in October
|
||||||
|
REM Monday 1 -7 November SCANFROM -7 ADDOMIT MSG October Public Holiday
|
||||||
|
|
||||||
|
; Easter
|
||||||
|
SET easter easterdate(today())
|
||||||
|
REM [TRIGGER(easter-2)] MSG Good Friday (Aoine an Chéasta)
|
||||||
|
REM [TRIGGER(easter)] MSG Easter Sunday (Domhnach Cásca)
|
||||||
|
OMIT [TRIGGER(easter+1)] MSG Easter Monday (Luan Cásca) Public Holiday
|
||||||
|
|
||||||
|
; St. Brigid's Day
|
||||||
|
REM 1 February MSG Saint Brigid's Day (Lá Fhéile Bríde or Imbolc)
|
||||||
|
; The public holiday is the first Monday in February, or 1 February if the date falls on a Friday
|
||||||
|
REM February SCANFROM -7 ADDOMIT SATISFY [($Td==1 && $Tw==5) || ($Td<8 && $Tw==1 && $Td!=4)] MSG Public Holiday
|
||||||
@@ -4,11 +4,11 @@
|
|||||||
# This file is derived from a translation by Valerio Aimale
|
# This file is derived from a translation by Valerio Aimale
|
||||||
|
|
||||||
SET $Sunday "Domenica"
|
SET $Sunday "Domenica"
|
||||||
SET $Monday "Lunedí"
|
SET $Monday "Lunedì"
|
||||||
SET $Tuesday "Martedí"
|
SET $Tuesday "Martedì"
|
||||||
SET $Wednesday "Mercoledí"
|
SET $Wednesday "Mercoledì"
|
||||||
SET $Thursday "Giovedí"
|
SET $Thursday "Giovedì"
|
||||||
SET $Friday "Venerdí"
|
SET $Friday "Venerdì"
|
||||||
SET $Saturday "Sabato"
|
SET $Saturday "Sabato"
|
||||||
|
|
||||||
SET $January "Gennaio"
|
SET $January "Gennaio"
|
||||||
@@ -40,7 +40,7 @@ SET $Now "ora"
|
|||||||
SET $At "alle"
|
SET $At "alle"
|
||||||
SET $Minute "minuto"
|
SET $Minute "minuto"
|
||||||
SET $Hour "ora"
|
SET $Hour "ora"
|
||||||
SET $Is "é"
|
SET $Is "è"
|
||||||
SET $Was "era"
|
SET $Was "era"
|
||||||
SET $And "e"
|
SET $And "e"
|
||||||
SET $Hplu "a"
|
SET $Hplu "a"
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ Remind was written by Dianne Skoll <dianne@skoll.ca>
|
|||||||
.SH HOME PAGE
|
.SH HOME PAGE
|
||||||
https://dianne.skoll.ca/projects/remind/
|
https://dianne.skoll.ca/projects/remind/
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
\fBremind\fR
|
\fBremind\fR(1)
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ calendar.
|
|||||||
.SH REM2PS INPUT FORMAT (-P OPTION)
|
.SH REM2PS INPUT FORMAT (-P OPTION)
|
||||||
The \fB\-p\fR option is an older, simpler interchange format used by
|
The \fB\-p\fR option is an older, simpler interchange format used by
|
||||||
\fBRemind\fR to communicate with back-ends. New back-ends are
|
\fBRemind\fR to communicate with back-ends. New back-ends are
|
||||||
encoraged to support the new \fB\-pp\fR format preferably, though they
|
encouraged to support the new \fB\-pp\fR format preferably, though they
|
||||||
are encouraged to support the older \fB\-p\fR format as well if the
|
are encouraged to support the older \fB\-p\fR format as well if the
|
||||||
older format contains enough information for them to work properly.
|
older format contains enough information for them to work properly.
|
||||||
.PP
|
.PP
|
||||||
@@ -458,7 +458,7 @@ JSON object. The keys that may be present in the JSON object are as
|
|||||||
follows:
|
follows:
|
||||||
.TP
|
.TP
|
||||||
.B date \fIYYYY-MM-DD\fR
|
.B date \fIYYYY-MM-DD\fR
|
||||||
The \fbdate\fR key will \fIalways\fR be present; it is the trigger date
|
The \fBdate\fR key will \fIalways\fR be present; it is the trigger date
|
||||||
of the reminder expressed as a string in the format \fIYYYY-MM-DD\fR
|
of the reminder expressed as a string in the format \fIYYYY-MM-DD\fR
|
||||||
.TP
|
.TP
|
||||||
.B filename \fIf\fR
|
.B filename \fIf\fR
|
||||||
|
|||||||
193
man/remind.1.in
193
man/remind.1.in
@@ -28,6 +28,10 @@ Anything after the __EOF__ marker is completely ignored.
|
|||||||
\fBRemind\fR has a slew of options. If you're new to the program,
|
\fBRemind\fR has a slew of options. If you're new to the program,
|
||||||
ignore them for now and skip to the section "REMINDER FILES".
|
ignore them for now and skip to the section "REMINDER FILES".
|
||||||
.TP
|
.TP
|
||||||
|
.B \-\-version
|
||||||
|
The \fB\-\-version\fR option causes \fBRemind\fR to print its version number
|
||||||
|
to standard output and then exit.
|
||||||
|
.TP
|
||||||
.B \-n
|
.B \-n
|
||||||
The \fB\-n\fR option causes \fBRemind\fR to print the \fBnext\fR occurrence
|
The \fB\-n\fR option causes \fBRemind\fR to print the \fBnext\fR occurrence
|
||||||
of each reminder in a simple calendar format. You can sort this by
|
of each reminder in a simple calendar format. You can sort this by
|
||||||
@@ -60,7 +64,9 @@ weeks to be produced.
|
|||||||
.B 'a'
|
.B 'a'
|
||||||
causes \fBRemind\fR to display reminders on the calendar on the
|
causes \fBRemind\fR to display reminders on the calendar on the
|
||||||
day they actually occur \fIas well as\fR on any preceding days
|
day they actually occur \fIas well as\fR on any preceding days
|
||||||
specified by the reminder's \fIdelta\fR.
|
specified by the reminder's \fIdelta\fR. This \fIalso\fR causes
|
||||||
|
\fBRemind\fR to include text outside %"...%" sequences that would
|
||||||
|
otherwise be removed (though the actual %" markers themselves are removed.)
|
||||||
.TP
|
.TP
|
||||||
.B 'l'
|
.B 'l'
|
||||||
causes \fBRemind\fR to use VT100 line-drawing characters to draw
|
causes \fBRemind\fR to use VT100 line-drawing characters to draw
|
||||||
@@ -103,11 +109,18 @@ If the optional \fIm\fR parameter is supplied following a comma, then
|
|||||||
\fIm\fR=0 tells \fBRemind\fR that the terminal background is dark, and
|
\fIm\fR=0 tells \fBRemind\fR that the terminal background is dark, and
|
||||||
\fBRemind\fR will brighten up dark colors to make them visible. If
|
\fBRemind\fR will brighten up dark colors to make them visible. If
|
||||||
\fIm\fR=1, then \fBRemind\fR assumes the terminal background is light
|
\fIm\fR=1, then \fBRemind\fR assumes the terminal background is light
|
||||||
and it will darken bright colors to make them visible. If no \fIm\fR
|
and it will darken bright colors to make them visible. If \fIm\fR is
|
||||||
is supplied, or it is supplied as \fIm\fR=2, then \fBRemind\fR does
|
specified as 2, then \fBRemind\fR does not perform any adjustments,
|
||||||
not perform any adjustments, and some reminders may be hard or
|
and some reminders may be hard or impossible to see if the color is
|
||||||
impossible to see if the color is too close to the terminal background
|
too close to the terminal background color. If you supply the letter
|
||||||
color.
|
\fBt\fR rather than a number, then Remind attempts to guess the background
|
||||||
|
color of the terminal, \fIeven if\fR stdout is not a terminal.
|
||||||
|
.PP
|
||||||
|
On startup, if the standard output is a terminal, \fBRemind\fR
|
||||||
|
attempts to determine if the terminal background is dark or light by
|
||||||
|
sending a special escape sequence to determine the background color.
|
||||||
|
The \fIm\fR parameter can override this check (or force it if
|
||||||
|
\fIm\fR is given as \fBt\fR.)
|
||||||
.PP
|
.PP
|
||||||
If the optional \fIb\fR parameter is supplied following a comma, then
|
If the optional \fIb\fR parameter is supplied following a comma, then
|
||||||
\fIb=0\fR tells \fBRemind\fR to ignore SPECIAL SHADE reminders (the
|
\fIb=0\fR tells \fBRemind\fR to ignore SPECIAL SHADE reminders (the
|
||||||
@@ -222,8 +235,14 @@ regardless of the \fIdelta\fR supplied for each reminder.
|
|||||||
.TP
|
.TP
|
||||||
.B \-t\fR\fIn\fR
|
.B \-t\fR\fIn\fR
|
||||||
If you supply a number \fIn\fR after the \fB\-t\fR option, then
|
If you supply a number \fIn\fR after the \fB\-t\fR option, then
|
||||||
\fBRemind\fR pretends that each non-expired reminder has a \fIdelta\fR
|
\fBRemind\fR pretends that echo \fBREM\fR command has a delta
|
||||||
of \fIn\fR days and triggers reminders accordingly.
|
of \+\+\fIn\fR, regardless of any existing delta.
|
||||||
|
.TP
|
||||||
|
.B \-tz\fR
|
||||||
|
If you supply the letter \fBz\fR after the \fB\-t\fR option, then
|
||||||
|
\fBRemind\fR sets all REM statements' deltas to zero, regardless of the
|
||||||
|
value supplied in the REM statement itself. In effect, this disables
|
||||||
|
all deltas of the form \fB\+\fIn\fR and \fB\+\+\fIn\fR.
|
||||||
.TP
|
.TP
|
||||||
.B \-tt\fR[\fIn\fR]
|
.B \-tt\fR[\fIn\fR]
|
||||||
The \fB-tt\fR option causes \fBRemind\fR to assume a default delta of
|
The \fB-tt\fR option causes \fBRemind\fR to assume a default delta of
|
||||||
@@ -602,6 +621,11 @@ The following examples show how date specifications are interpreted.
|
|||||||
.PP
|
.PP
|
||||||
1. Null date specification - the reminder is triggered every day.
|
1. Null date specification - the reminder is triggered every day.
|
||||||
The trigger date for a specific run is simply the current system date.
|
The trigger date for a specific run is simply the current system date.
|
||||||
|
For example:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
REM MSG This is triggered every time Remind runs
|
||||||
|
.fi
|
||||||
.PP
|
.PP
|
||||||
2. Only
|
2. Only
|
||||||
.I day
|
.I day
|
||||||
@@ -1782,7 +1806,7 @@ will begin reading from standard input.
|
|||||||
.PP
|
.PP
|
||||||
If you specify a \fIdirectory\fR as the argument to \fBINCLUDE\fR, then
|
If you specify a \fIdirectory\fR as the argument to \fBINCLUDE\fR, then
|
||||||
\fBRemind\fR will process all files in that directory that match the shell
|
\fBRemind\fR will process all files in that directory that match the shell
|
||||||
patterm "*.rem". The files are processed in sorted order; the sort order
|
pattern "*.rem". The files are processed in sorted order; the sort order
|
||||||
matches that used by the shell when it expands "*.rem".
|
matches that used by the shell when it expands "*.rem".
|
||||||
.PP
|
.PP
|
||||||
Note that the file specified by an \fBINCLUDE\fR command is interpreted
|
Note that the file specified by an \fBINCLUDE\fR command is interpreted
|
||||||
@@ -2390,6 +2414,10 @@ is normally 0, but can be set with the \fB\-tt\fR option or explicitly
|
|||||||
set in your script. If \fB$DefaultDelta\fR is non-zero, you can use an
|
set in your script. If \fB$DefaultDelta\fR is non-zero, you can use an
|
||||||
explicit delta of +0 in an AT clause to countermand the default delta.
|
explicit delta of +0 in an AT clause to countermand the default delta.
|
||||||
.TP
|
.TP
|
||||||
|
.B $DeltaOverride (read-only)
|
||||||
|
If non-zero, corresponds to the \fIn\fR argument given to a
|
||||||
|
\fB\-t\fR\fIn\fR command-line option.
|
||||||
|
.TP
|
||||||
.B $DontFork (read-only)
|
.B $DontFork (read-only)
|
||||||
If non-zero, then the \fB\-c\fR option was supplied on the command line.
|
If non-zero, then the \fB\-c\fR option was supplied on the command line.
|
||||||
.TP
|
.TP
|
||||||
@@ -2456,7 +2484,8 @@ or a date different from today's true date was supplied. If non-zero,
|
|||||||
then \fBONCE\fR directives will be ignored.
|
then \fBONCE\fR directives will be ignored.
|
||||||
.TP
|
.TP
|
||||||
.B $InfDelta (read-only)
|
.B $InfDelta (read-only)
|
||||||
If non-zero, then the \fB\-t\fR option was supplied on the command line.
|
If non-zero, then the \fB\-t\fR option was supplied on the command line,
|
||||||
|
with no \fIn\fR argument.
|
||||||
.TP
|
.TP
|
||||||
.B $IntMax (read-only)
|
.B $IntMax (read-only)
|
||||||
The largest representable \fBINT\fR. On a machine with 32-bit signed integers
|
The largest representable \fBINT\fR. On a machine with 32-bit signed integers
|
||||||
@@ -2533,6 +2562,24 @@ updates \fB$LongDeg\fR, \fB$LongMin\fR and \fB$LongSec\fR. Similar
|
|||||||
rules apply to \fB$Latitude\fR, \fB$LatDeg\fR, \fB$LatMin\fR and \fB$LatSec\fR.
|
rules apply to \fB$Latitude\fR, \fB$LatDeg\fR, \fB$LatMin\fR and \fB$LatSec\fR.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
|
.B $MaxLateMinutes
|
||||||
|
This variable controls how \fBRemind\fR reacts to a computer being suspended
|
||||||
|
and then woken. Normally, if a timed reminder is queued and then the
|
||||||
|
computer suspended, and then the computer is woken \fIafter\fR the
|
||||||
|
timed reminder's trigger time, \fBRemind\fR will triger the timer anyway,
|
||||||
|
despite the fact that the trigger time has already passed.
|
||||||
|
.RS
|
||||||
|
.PP
|
||||||
|
If you set \fB$MaxLateMinutes\fR to a non-zero integer between 1 and 1440,
|
||||||
|
then \fBRemind\fR will \fInot\fR trigger a timed reminder whose trigger
|
||||||
|
time is more than \fB$MaxLateMinutes\fR minutes in the past.
|
||||||
|
.PP
|
||||||
|
Note that \fBRemind\fR uses the value of \fB$MaxLateMinutes\fR that is in
|
||||||
|
effect when it has finished reading the reminder file and puts itself in
|
||||||
|
the background. Generally, you should set \fB$MaxLateMinutes\fR once
|
||||||
|
near the beginning of the file and not change it after that.
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
.B $MaxSatIter
|
.B $MaxSatIter
|
||||||
The maximum number of iterations for the \fBSATISFY\fR clause
|
The maximum number of iterations for the \fBSATISFY\fR clause
|
||||||
(described later.) Must be at least 10.
|
(described later.) Must be at least 10.
|
||||||
@@ -2577,6 +2624,28 @@ by \fBREM\fR commands; triggers in \fBIFTRIG\fR commands do
|
|||||||
not affect it.
|
not affect it.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
|
.B $ParseUntriggered
|
||||||
|
A flag indicating whether or not \fBRemind\fR should fully parse \fBREM\fR
|
||||||
|
statements that are not triggered. 0 means to skip parsing them and 1
|
||||||
|
(the default) means to parse them.
|
||||||
|
.PP
|
||||||
|
.RS
|
||||||
|
For example, if we have the following \fBREM\fR statement:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
REM 2020-01-01 MSG ["bad_expression" * 2]
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
Then by default, \fBRemind\fR will fully parse the line and issue
|
||||||
|
a "Type mismatch" error even if the reminder is not triggered. However,
|
||||||
|
if \fB$ParseUntriggered\fR is set to 0, then \fBRemind\fR will not
|
||||||
|
issue the error except on 2020-01-01, when the reminder is triggered.
|
||||||
|
.PP
|
||||||
|
Setting \fB$ParseUntriggered\fR to 0 may in some cases slightly
|
||||||
|
improve performance, at the risk of not catching errors until a
|
||||||
|
reminder is triggered.
|
||||||
|
.RE
|
||||||
|
.TP
|
||||||
.B $PrefixLineNo (read-only)
|
.B $PrefixLineNo (read-only)
|
||||||
If non-zero, then the \fB\-l\fR option was supplied on the command line.
|
If non-zero, then the \fB\-l\fR option was supplied on the command line.
|
||||||
.TP
|
.TP
|
||||||
@@ -2678,9 +2747,13 @@ Set to 1 if the \fB\-@1\fR option was used; 0 otherwise.
|
|||||||
Set to 1 if the \fB\-@2\fR option was used; 0 otherwise.
|
Set to 1 if the \fB\-@2\fR option was used; 0 otherwise.
|
||||||
.TP
|
.TP
|
||||||
.B $TerminalBackground (read-only)
|
.B $TerminalBackground (read-only)
|
||||||
Returns -1 if the terminal background color was not specified,
|
Returns -1 if the terminal background color could not be determined, 0
|
||||||
0 if it was specified as dark with the \fB\-@,0\fR option or
|
if it was found to be dark (or was specified as dark with the
|
||||||
1 if it was specified as light with the \fB\-@,1\fR option.
|
\fB\-@,0\fR option) or 1 if it was found to be light (or specified as
|
||||||
|
light with the \fB\-@,1\fR option.) The terminal background is considered
|
||||||
|
to be "dark" if the average of the red, green and blue components is
|
||||||
|
at most 85 out of 255, and if the maximum of any component is at most
|
||||||
|
128 out of 255.
|
||||||
.PP
|
.PP
|
||||||
Note: If any of the calendar modes are in effect, then the
|
Note: If any of the calendar modes are in effect, then the
|
||||||
values of $Daemon, $DontFork, $DontTrigAts, $DontQueue, $HushMode,
|
values of $Daemon, $DontFork, $DontTrigAts, $DontQueue, $HushMode,
|
||||||
@@ -3258,14 +3331,31 @@ is supplied, only the date component is used.
|
|||||||
Returns the time of "nautical twilight" on the specified \fIdate\fR. If
|
Returns the time of "nautical twilight" on the specified \fIdate\fR. If
|
||||||
\fIdate\fR is omitted, defaults to \fBtoday()\fR.
|
\fIdate\fR is omitted, defaults to \fBtoday()\fR.
|
||||||
.TP
|
.TP
|
||||||
.B nonomitted(dq_start, dq_end [,s_wkday...])
|
.B nonomitted(dq_start, dq_end [, i_step] [,s_wkday...])
|
||||||
This function returns the number of \fInon-\fRomitted days between
|
This function returns the number of \fInon-\fRomitted days between
|
||||||
\fIstart\fR and \fIend\fR. If \fIstart\fR is non-omitted, then it is
|
\fIstart\fR and \fIend\fR. If \fIstart\fR is non-omitted, then it is
|
||||||
counted. \fIend\fR is never counted.
|
counted. \fIend\fR is never counted.
|
||||||
.RS
|
.RS
|
||||||
.PP
|
.PP
|
||||||
Note that \fIend\fR must be greater than or equal to \fIstart\fR or an
|
Note that if \fIend\fR is less than \fIstart\fR, the arguments
|
||||||
error is reported. In addition to using the global OMIT context, you
|
are effectively swapped, so counting always begins from the older
|
||||||
|
date.
|
||||||
|
.PP
|
||||||
|
If the third argument to \fBnonomitted\fR is an \fBINT\fR, then it must
|
||||||
|
be greater than zero, and is consider to be the \fIstep\fR by which
|
||||||
|
\fBnonomitted\fR counts. For example the following expression:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
nonomitted('2023-07-01', '2023-07-29', 7)
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
returns the number of non-omitted Saturdays from 2023-07-01 up to
|
||||||
|
(but not including) 2023-07-29. (Both 2023-07-01 and 2023-07-29 are
|
||||||
|
Saturdays.)
|
||||||
|
.PP
|
||||||
|
If no \fIstep\fR argument is supplied, then a step of 1 is used.
|
||||||
|
.PP
|
||||||
|
In addition to using the global OMIT context, you
|
||||||
can supply additional arguments that are names of weekdays to be
|
can supply additional arguments that are names of weekdays to be
|
||||||
omitted. However, in a \fBREM\fR command, any local \fBOMITFUNC\fR
|
omitted. However, in a \fBREM\fR command, any local \fBOMITFUNC\fR
|
||||||
clause is \fInot\fR taken into account by this function.
|
clause is \fInot\fR taken into account by this function.
|
||||||
@@ -3292,7 +3382,7 @@ reminder will label day numbers in a calendar:
|
|||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
Obviously, the answer you get from \fBnonomitted\fR depends on the global
|
Obviously, the answer you get from \fBnonomitted\fR depends on the global
|
||||||
OMIT context. If you use moveable OMITs, you may get inconsistent results.
|
OMIT context. If you use movable OMITs, you may get inconsistent results.
|
||||||
.PP
|
.PP
|
||||||
Here is a more complex use for \fBnonomitted\fR. My garbage collection
|
Here is a more complex use for \fBnonomitted\fR. My garbage collection
|
||||||
follows two interleaved 14-day cycles: One Friday, garbage and paper
|
follows two interleaved 14-day cycles: One Friday, garbage and paper
|
||||||
@@ -3486,10 +3576,13 @@ will set \fBa\fR to:
|
|||||||
.fi
|
.fi
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B slide(d_start, i_amt [,s_wkday...])
|
.B slide(d_start, i_amt [, i_step] [,s_wkday...])
|
||||||
This function is the inverse of \fBnonomitted\fR. It adds \fIamt\fR
|
This function is the inverse of \fBnonomitted\fR. It adds \fIamt\fR
|
||||||
days (which can be negative) to \fIstart\fR, \fInot counting omitted days\fR.
|
(which can be negative) chunks of \fIstep\fR days to \fIstart\fR,
|
||||||
The optional \fIwkday\fR arguments are additional weekday names to omit.
|
\fInot counting omitted days\fR. If \fIstep\fR is not supplied, then
|
||||||
|
it is assumed to be 1. Note that only every \fIstep\fRth day is
|
||||||
|
tested to see if it is omitted. The optional \fIwkday\fR arguments
|
||||||
|
are additional weekday names to omit.
|
||||||
.RS
|
.RS
|
||||||
.PP
|
.PP
|
||||||
Consider this example:
|
Consider this example:
|
||||||
@@ -3509,6 +3602,26 @@ May 16 and 17. You can go backwards, too, so:
|
|||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
takes \fIa\fR back to 2009-05-13.
|
takes \fIa\fR back to 2009-05-13.
|
||||||
|
.PP
|
||||||
|
Now consider this example:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
OMIT 14 May 2009
|
||||||
|
SET a slide('2009-05-07', 2, 7)
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
This sets \fIa\fR to '2009-05-28' because we skip ahead two weeks, not
|
||||||
|
counting a week where the day we land on happens to be omitted. Contrast with
|
||||||
|
this:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
OMIT 13 May 2009
|
||||||
|
SET a slide('2009-05-07', 2, 7)
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
which sets \fIa\fR to '2009-05-21'. Although 2009-05-13 is omitted, we
|
||||||
|
don't "land" on it as we step forward in chunks of 7 days, so we never
|
||||||
|
see that it is omitted.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
.B soleq(i_which [, dqi_start])
|
.B soleq(i_which [, dqi_start])
|
||||||
@@ -4216,7 +4329,7 @@ you define a function taking no parameters. Here are some examples:
|
|||||||
.nf
|
.nf
|
||||||
FSET double(x) 2*x
|
FSET double(x) 2*x
|
||||||
FSET yeardiff(date1, date2) year(date1) - year(date2)
|
FSET yeardiff(date1, date2) year(date1) - year(date2)
|
||||||
FSET since(x) ord(year(trigdate())\-x)
|
FSET since(x) ord($Ty \- x)
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
The last function is useful in birthday reminders. For example:
|
The last function is useful in birthday reminders. For example:
|
||||||
@@ -4231,6 +4344,12 @@ Dean was born in 1984. The above example, on 1 November 1992, would print:
|
|||||||
Dean's 8th birthday is today.
|
Dean's 8th birthday is today.
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
|
Similarly, the function is useful in anniversary reminders. For example:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
REM 4 June MSG [since(1989)] anniversary of the Tienanmen Square massacre
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
Notes:
|
Notes:
|
||||||
.TP
|
.TP
|
||||||
o
|
o
|
||||||
@@ -5449,7 +5568,7 @@ The \fBSPECIAL\fR keyword is used to transmit "out-of-band" information
|
|||||||
to \fBRemind\fR backends, such as \fBtkremind\fR or \fBRem2PS\fR.
|
to \fBRemind\fR backends, such as \fBtkremind\fR or \fBRem2PS\fR.
|
||||||
They are used only when piping data from a \fBremind \-p\fR line.
|
They are used only when piping data from a \fBremind \-p\fR line.
|
||||||
(Note that the COLOR special is an exception; it downgrades to the
|
(Note that the COLOR special is an exception; it downgrades to the
|
||||||
equivalent of MSG in \fBremind's\fR normal mode of operation.)
|
equivalent of MSG in \fBRemind's\fR normal mode of operation.)
|
||||||
.PP
|
.PP
|
||||||
The various \fBSPECIAL\fRs recognized are particular for each
|
The various \fBSPECIAL\fRs recognized are particular for each
|
||||||
backend; however, there are four \fBSPECIAL\fRs that all backends
|
backend; however, there are four \fBSPECIAL\fRs that all backends
|
||||||
@@ -5538,7 +5657,7 @@ after the WEEK keyword.
|
|||||||
.PP
|
.PP
|
||||||
.SH MISCELLANEOUS
|
.SH MISCELLANEOUS
|
||||||
.PP
|
.PP
|
||||||
.B COMMAND ABBREVIATIONS
|
.B COMMAND AND KEYWORD ABBREVIATIONS
|
||||||
.PP
|
.PP
|
||||||
The following tokens can be abbreviated:
|
The following tokens can be abbreviated:
|
||||||
.TP
|
.TP
|
||||||
@@ -5565,6 +5684,9 @@ o
|
|||||||
\fBINCLUDE\fR --> \fBINC\fR
|
\fBINCLUDE\fR --> \fBINC\fR
|
||||||
.TP
|
.TP
|
||||||
o
|
o
|
||||||
|
\fBMAYBE-UNCOMPUTABLE\fR --> \fBMAYBE\fR
|
||||||
|
.TP
|
||||||
|
o
|
||||||
\fBSCANFROM\fR --> \fBSCAN\fR
|
\fBSCANFROM\fR --> \fBSCAN\fR
|
||||||
.PP
|
.PP
|
||||||
.B NIFTY EXAMPLES
|
.B NIFTY EXAMPLES
|
||||||
@@ -5737,6 +5859,25 @@ components, then \fBRemind\fR will correctly compute a trigger date, even
|
|||||||
if it happens to be before the start of scanning.
|
if it happens to be before the start of scanning.
|
||||||
Note that this behaviour is not true for
|
Note that this behaviour is not true for
|
||||||
versions of \fBRemind\fR prior to 03.00.01.
|
versions of \fBRemind\fR prior to 03.00.01.
|
||||||
|
.SH FILES
|
||||||
|
.PP
|
||||||
|
The traditional location of your reminders file or directory is:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
$HOME/.reminders
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
where \fB$HOME\fR is your home directory.
|
||||||
|
.PP
|
||||||
|
Remind ships with some preinstalled files for holidays and language
|
||||||
|
packs. These are located in the following directory:
|
||||||
|
.PP
|
||||||
|
.nf
|
||||||
|
@prefix@/share/remind/
|
||||||
|
.fi
|
||||||
|
.PP
|
||||||
|
Do not hard-code the above directory in your reminder files. Instead,
|
||||||
|
use the value of the $SysInclude system variable.
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
.PP
|
.PP
|
||||||
Dianne Skoll <dianne@skoll.ca> wrote \fBRemind\fR. The moon code
|
Dianne Skoll <dianne@skoll.ca> wrote \fBRemind\fR. The moon code
|
||||||
@@ -5784,9 +5925,11 @@ Liviu Daia
|
|||||||
Rafa Couto
|
Rafa Couto
|
||||||
.PP
|
.PP
|
||||||
\fBIcelandic\fR --
|
\fBIcelandic\fR --
|
||||||
Bj\(:orn Dav\('i\[Sd]sson
|
Bj\[:o]rn Daví\[Sd]sson
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
.PP
|
.PP
|
||||||
|
If you find a bug in Remind, please report it to: dianne@skoll.ca
|
||||||
|
.PP
|
||||||
There's no good reason why read-only system variables are not
|
There's no good reason why read-only system variables are not
|
||||||
implemented as functions, or why functions like \fBversion()\fR, etc.
|
implemented as functions, or why functions like \fBversion()\fR, etc.
|
||||||
are not implemented as read-only system variables.
|
are not implemented as read-only system variables.
|
||||||
@@ -5809,6 +5952,8 @@ Richard Siegel and Michael and Sharon Strassfeld, \fIThe First Jewish
|
|||||||
Catalog\fR, Jewish Publication Society of America.
|
Catalog\fR, Jewish Publication Society of America.
|
||||||
.SH HOME PAGE
|
.SH HOME PAGE
|
||||||
https://dianne.skoll.ca/projects/remind/
|
https://dianne.skoll.ca/projects/remind/
|
||||||
|
.SH MAILING LIST
|
||||||
|
https://dianne.skoll.ca/mailman/listinfo/remind-fans
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.PP
|
.PP
|
||||||
\fBrem\fR(1), \fBrem2ps\fR(1), \fBrem2pdf\fR(1), \fBtkremind\fR(1), \fBrem2html\fR(1)
|
\fBrem\fR(1), \fBrem2ps\fR(1), \fBrem2pdf\fR(1), \fBtkremind\fR(1), \fBrem2html\fR(1)
|
||||||
|
|||||||
@@ -383,6 +383,16 @@ same thing.
|
|||||||
STATUS
|
STATUS
|
||||||
Return the number of queued reminders.
|
Return the number of queued reminders.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
QUEUE
|
||||||
|
Returns the contents of the queue, printed between "NOTE queue" and
|
||||||
|
"NOTE endqueue" lines.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
JSONQUEUE
|
||||||
|
Returns the contents of the queue in JSON format, printed between
|
||||||
|
"NOTE JSONQUEUE" and "NOTE ENDJSONQUEUE" lines.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
REREAD
|
REREAD
|
||||||
Re-read the reminder file
|
Re-read the reminder file
|
||||||
@@ -416,6 +426,16 @@ NOTE queued \fIn\fR
|
|||||||
This line is emitted in response to a \fBSTATUS\fR command. The number
|
This line is emitted in response to a \fBSTATUS\fR command. The number
|
||||||
\fIn\fR is the number of reminders in the queue.
|
\fIn\fR is the number of reminders in the queue.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
NOTE queue
|
||||||
|
Indicates that queue contents are about to follow. The end of the
|
||||||
|
queue is indicated by a NOTE endqueue line.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
NOTE JSONQUEUE
|
||||||
|
Indicates that queue contents in JSON format are about to follow. The
|
||||||
|
end of the queue is indicated by a NOTE ENDJSONQUEUE line.
|
||||||
|
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
TkRemind was written by Dianne Skoll <dianne@skoll.ca>
|
TkRemind was written by Dianne Skoll <dianne@skoll.ca>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use warnings;
|
|||||||
|
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use JSON::MaybeXS;
|
use JSON::MaybeXS;
|
||||||
|
use Encode;
|
||||||
|
|
||||||
my %Options;
|
my %Options;
|
||||||
|
|
||||||
@@ -44,6 +45,11 @@ Print usage information
|
|||||||
|
|
||||||
Print version
|
Print version
|
||||||
|
|
||||||
|
=item --utf8
|
||||||
|
|
||||||
|
Assume standard input is encoded in UTF-8; write UTF-8 data to standard
|
||||||
|
output.
|
||||||
|
|
||||||
=item --backurl I<url>
|
=item --backurl I<url>
|
||||||
|
|
||||||
When producing the small calendar for the previous month, make the
|
When producing the small calendar for the previous month, make the
|
||||||
@@ -154,6 +160,7 @@ Usage: remind -pp ... | rem2html [options]
|
|||||||
Options:
|
Options:
|
||||||
|
|
||||||
--help, -h Print usage information
|
--help, -h Print usage information
|
||||||
|
--utf8 Assume UTF-8 input and write UTF-8 output
|
||||||
--man Show man page (requires "perldoc")
|
--man Show man page (requires "perldoc")
|
||||||
--version Print version
|
--version Print version
|
||||||
--backurl url Make the title on the previous month's small calendar
|
--backurl url Make the title on the previous month's small calendar
|
||||||
@@ -197,6 +204,7 @@ sub parse_options
|
|||||||
local $SIG{__WARN__} = sub { print STDERR "$TIDY_PROGNAME: $_[0]\n"; };
|
local $SIG{__WARN__} = sub { print STDERR "$TIDY_PROGNAME: $_[0]\n"; };
|
||||||
if (!GetOptions(\%Options, "help|h",
|
if (!GetOptions(\%Options, "help|h",
|
||||||
"man",
|
"man",
|
||||||
|
"utf8",
|
||||||
"pngs",
|
"pngs",
|
||||||
"version",
|
"version",
|
||||||
"stylesheet=s",
|
"stylesheet=s",
|
||||||
@@ -216,13 +224,22 @@ sub parse_options
|
|||||||
if ($stylesheet) {
|
if ($stylesheet) {
|
||||||
$Options{stylesheet} = smoosh($Options{imgbase}, $stylesheet);
|
$Options{stylesheet} = smoosh($Options{imgbase}, $stylesheet);
|
||||||
}
|
}
|
||||||
|
if ($Options{utf8}) {
|
||||||
|
binmode(STDIN, ':encoding(UTF-8)');
|
||||||
|
binmode(STDOUT, ':encoding(UTF-8)');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub start_output
|
sub start_output
|
||||||
{
|
{
|
||||||
return if ($Options{tableonly});
|
return if ($Options{tableonly});
|
||||||
|
|
||||||
print("<html>\n<head>\n<title>" . $Options{title} . "</title>\n");
|
print("<html>\n<head>\n");
|
||||||
|
if ($Options{utf8}) {
|
||||||
|
print '<meta charset="UTF-8">' . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
print("<title>" . $Options{title} . "</title>\n");
|
||||||
if (!$Options{nostyle}) {
|
if (!$Options{nostyle}) {
|
||||||
if ($Options{stylesheet}) {
|
if ($Options{stylesheet}) {
|
||||||
print('<link rel="stylesheet" type="text/css" href="' .
|
print('<link rel="stylesheet" type="text/css" href="' .
|
||||||
@@ -310,7 +327,12 @@ sub parse_input
|
|||||||
($y, $m, $d, $special, $tag, $duration, $time, $body) =
|
($y, $m, $d, $special, $tag, $duration, $time, $body) =
|
||||||
($1, $2, $3, $4, $5, $6, $7, $8);
|
($1, $2, $3, $4, $5, $6, $7, $8);
|
||||||
} elsif (/\{/) {
|
} elsif (/\{/) {
|
||||||
my $obj = decode_json($_);
|
my $obj;
|
||||||
|
if ($Options{utf8}) {
|
||||||
|
$obj = decode_json(encode('UTF-8', $_, Encode::FB_DEFAULT));
|
||||||
|
} else {
|
||||||
|
$obj = decode_json($_);
|
||||||
|
}
|
||||||
next unless ($obj->{date} =~ /^(\d+)-(\d+)-(\d+)$/);
|
next unless ($obj->{date} =~ /^(\d+)-(\d+)-(\d+)$/);
|
||||||
$y = $1;
|
$y = $1;
|
||||||
$m = $2;
|
$m = $2;
|
||||||
|
|||||||
@@ -29,31 +29,62 @@ set Hostname [exec hostname]
|
|||||||
# Our icon photo
|
# Our icon photo
|
||||||
catch {
|
catch {
|
||||||
image create photo rpicon -data {
|
image create photo rpicon -data {
|
||||||
R0lGODlhFwAgAOecABUTERYTERYUERcVEhgWExkXFBkXFRoXFRsZFhwZFxwa
|
iVBORw0KGgoAAAANSUhEUgAAAEAAAABbCAYAAADDeIOGAAAACXBIWXMAAAu6AAALugFBTNueAAAA
|
||||||
GB0bGR4cGR4cGh8dGiAeHCEfHCEfHSIgHSIgHiQiHyYkISknJCooJispJywq
|
GXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAADANJREFUeJzdnGtsFNcVx38Xr19r
|
||||||
Jy4sKTIwLjUzMDUzMTo4Njs5Nzs5ODw7ODw7OT07OT48OkE/PUJAPkNBP0RC
|
4/BawjPGjcGY2MY8Q+1g05iXKwoihvAQoCJEQoiU0CofWgmpUhIJNVKpSGnUSGmKLEEihcZFQeBW
|
||||||
QEVDQUVEQkdFQ0lIRkpJR01LSU5MSlBPTVFQTlNSUFRSUFRSUVVTUlVUUllY
|
gRJeKQkQisFAsWDxGsdAawjgGGF7Tz/MrrvGuzN3ZmchzV8aeT17zj3n/u+5d87cxyoR4fsMpVQx
|
||||||
VltZV1xaWF1cWmBfXmJgX2RiYGZlY2dmZGppZ2tqaG1ram9tbHFwb3Jwb3Rz
|
MBkYC+QDQ4DBQDtQ7XmEviUESqnBwAKgFHgaGAP0iRC5AWwDtojI1e8FAUqp4cBzwExgBpAVRexb
|
||||||
cXV0c3Z0c3Z1c3Z1dHd1dHh2dXh3dnt5eHx7eXx7en18en59e4B/foGAf4KB
|
4E/AJhG52n1XRP4vL2Ag8DOgFmgDJMYVBPYCT0ct51FXJEbl+gLpMb77IbAZuGpS6fBVD6wys6W+
|
||||||
f4SDgYWEgoWEg4eGhIiHhouKiI2Mio6Ni46NjJCQj5KRkJSTkZeWlpiXlpmY
|
C4OgUiodeBGYC4zHaN1OoAU4CxzGaOVFwHR69ulo+Bb4HfCmiNw1lfwOtPY84AzWral7HQfKtO0/
|
||||||
l5qZmJybmp6dnKCfnqGgoKKhoKOioaSjoqinp6qpqKurqq+urbCvrrCwr7Gw
|
4sqvA+66VPFO4PeA15YPj7Dyz4VC1Y3KtwIvOvLjEVW+CPi3TuUyMzOtZC4DJY59eQSVTwL26VR+
|
||||||
r7OysbW1tLi3tri3t7u6ur28vMTDw8TEw8XFxMbFxcfGxsfHxsrJycrKyczM
|
48aNcu/ePXn++edjyVwAiuPy5xEQ8Gvdlr97966IiLz99tvRZPzA2Hj9sXqcuAql1CLgVR3Ze/fu
|
||||||
y83My83MzM3NzdDQz9LR0dPS0tPT09fX19jY19ra2dvb29zc29zc3Ojn5+jo
|
ce7cOUSE/fv39/oaeFVEzsft1ENs+TwggI3BbcSIEVJcXBztu39iEFkBpGra7xtN9qEkQqFE568Y
|
||||||
6Orq6uzs7O/v7/T09PX19fb29vf39/r6+vv7+/7+/v//////////////////
|
SYzbuAU0YHQJP0aGeBODKICRQAHQCPxCHqzwQ2r93+BeomM3NzgCVMXyLeERoJSaDewC0hJqyEAb
|
||||||
////////////////////////////////////////////////////////////
|
xpPhLHAa+LuInDBTSCgBSql+wCGMEEwULgN/AfYDB0Xkti3tBIf+H0hQeCulBKgG+n4nH4NKqXnA
|
||||||
////////////////////////////////////////////////////////////
|
mkSUnZmZyaZNmxgyZMhgEbkTV2EJavlU4CQWrejz+SQjI0O71VNTU2XBggXyxRdfiIhIZWXlN0BK
|
||||||
////////////////////////////////////////////////////////////
|
PL4makpsIzDBSmjz5s3Mnz+fQ4cOceHCBQKBAM3Nzdy+fZs7d+6glGLAgAH4fD6Ki4uZNWsWeXl5
|
||||||
////////////////////////////////////////////////////////////
|
3fqTJk3K2rt372xgt2NPE9D6+RhvZ6atmZubK/fv35d48MknnwiwOR5/EzEGvAn0txKqqqoiOTk5
|
||||||
////////////////////////////////////////////////////////////
|
LkPPPvss/fv3/1E8ZbhKgFJqDjBfR7a0tDRue16vl/z8/LGhx60juEaAUkoBvwTrcSUzM5NnnnnG
|
||||||
////////////////////////////////////////////////////////////
|
Fbv5+flpQLlTfTcj4KdoOpKXl0f//pa9RAsFBQUAE53qu0KAUioF2KArP2DAADfMAvDkk0+CMZPs
|
||||||
/////////////////////yH5BAEKAP8ALAAAAAAXACAAAAj+AP8JHEiwoMGD
|
CG5FwAsY01xaSE9Pd8ksFBUV4fF4xjrVj5sApVQSsNqOjsfjXvqRnZ3NsGHDRimlHPUpNyJgNTb7
|
||||||
CAcusRAAQEKDBQIcEBAAwUODAQJAsBGAwsWCBzJuUBLgI0ENGVM2dACg5UWV
|
YEtLiwtm/4fs7OxUYIoT3bgICI38tvN9v98fTppcwdChQwFynejGGwFVwDS7Si0tLWzdupWvv/46
|
||||||
KU+Y/JfRQBknPoq8ATQz4wxOQIFa6vMx5ZSgQetczJDSClKgcF6mFDEnE9I2
|
TvMGfD4fwAgnuvESsNKJUjAY5JVXXmHMmDEsXLiQHTt2EAwGHTsxePBggKGOlOPI+Qsxdlm48n4/
|
||||||
D0fADOChUdA1D7dmTBEUTditDQRQAnomIQaxICpoAmomoUoAGS2YIBIUDEIu
|
depU+fjjjx29E7zzzjsC1DqqRxwEbHGr8uHL4/HI+vXrpb293RYB27dvF+DUQyMAYweGzvq8o2vR
|
||||||
YndI8FAJaBaEMlIuSEkloxugUBBOSLkh44AvGfkAPYJQpYqMLIQEILB205DO
|
okXS0dGhTUBNTY0ATU7q4nQMWAYMc6hriZ07d/LGG29oy2dkZAD0VUrZTjCcEqD1xhcPtm7dyqVL
|
||||||
KW9kJHMhQAmgkaKgzsgjggM5GbEAxaNmdoAPOoz8CCAgEVAtg3wPEPMnQQAU
|
l7RkQwRkAo/ZtWObAKVULhDXO7gOWltb2blzp5as1+sFoy62nwROImA54F4yH4GsrJ6buw4fPqyl
|
||||||
QWsg5AAzDZSMbIBeaoHwAUwSDAI2XMAENA8ThAPEBvAStEkc3yonrOW0aUMk
|
16dPdzUG2bXpJCmf50DHEsOHD+f+/fs97ukmShEE2J5ishUBSqnxaEx2OsG4ceO4detWj3t37ujN
|
||||||
+BkBVAlaKATC8Fsp8Igid5ABgxMHtaTgggy6ZFBAADs= }
|
eEcQoOzatdsFFuAsaizh8/no6Ojoca+wsFBLNyJykuzatUvATLsGdPH444/3ujdtmt5rRkSk2B7T
|
||||||
|
tBWUUqOBqXYN6CAjI4ORI0f2uJeWlkZlZaWWfnt7u2Pbdhj7McaKj+soKirq1f8rKysZN26cln4E
|
||||||
|
Affs2rZDQIndwnUxceJEmpqaetxbvHixtn4EAbZDQYuAUIqZMAImTJhAY2Njj3vNzc3a+q2treGP
|
||||||
|
5ttio0A3AmbicMLBCklJSZSUlBAIBHrcf++997h586ZWGRHd5xu79nUJcGcVIwrGjx9PVlYWly9f
|
||||||
|
7nH//PnzvPbaa1plhIj6Frhu174uAZPsFBp6OdFCWVkZx44d65UFAmzbto13333XsoxQF7glIu6P
|
||||||
|
AUqpZGxmf6E5Oi2Ul5dTX18f9btgMMgHH3xgWUYoZb5lJRcNOhEwA+idpZggNEenJTd37lzOnTsX
|
||||||
|
UyY7O9uynKtXr4KxNc42dAiwFf4Ajz2m91peXl5OWloaZ86ciSnzYIL0IILBYPiJ8R8bLnZDh4Bi
|
||||||
|
u4XqLn3NmDGDixcvmkbAE088YVpGY2NjeAxwtNqiQ8BTtgrs00dr8TM1NZXKykoOHDjQ6yUoEqNG
|
||||||
|
jTItp66uLjyl7miRwZQApdQQYLSdAlNTU7UImDx5Mjk5OXz55ZcxZbxeLxMnmq+6RUybuU8Axgkt
|
||||||
|
W/l/V1eX1mOwoqICwJSAwsJCBg0yn+SJyB+u6foYCSsCbIU/GNPsVk+B5ORkqqqqOH36tOkAOGmS
|
||||||
|
9fgbigABHG2dtyIgz+L7Xujs7CQzM9NUpqSkhKKiInbv3k1nZ2dMueJi6/H34sWLYGSA/7LnqQEr
|
||||||
|
An5gt0ARYeDAgabdYN48Y1px3759MWWSkpKYPt18d73f76ehoQHgiog4WlyMSYBSqg8OCAAjCmK9
|
||||||
|
y2dlZbF06VIaGxv5/PPPY5ZRUFDA2LHmGz+OHj0ajiC/Ez/BPALGYTMDDOPatWuMHx992878+fMZ
|
||||||
|
MWIENTU1pjM5s2bNsrQTMX40OHATMCcgHwezrGAMTLEIWLZsGQA1NTWmZcyePdvSTl1dXfjjBTv+
|
||||||
|
9YDJAujPcbi4WVVVJUeOHOl1f/LkyRIMBuX48ePi8Xhi6o8ePVq6urpMF0SDwaCMGjVKME6HFzpZ
|
||||||
|
GLVaHHW8+NnQ0MC0adN6bGwGWLVqFUopPvzwQ9PRv6KiInKuPyrq6+u5cuUKQBPG2WNnMImA7TiM
|
||||||
|
gJSUFAkEAvLyyy9338vJyZG2tjbp6OiQ3NxcU/29e/daLom///77Yfm/OW19qwhwtuUEY6HiwIED
|
||||||
|
PQaylStX4vV6qa6uDj+6omLChAnMmTPH0kbEABjf2UGTCDhHHJscNmzYIB0dHZKdnS3Dhg2T69ev
|
||||||
|
i4hIeXm5qd7rr79u2foiImVlZWGd9fFEQNRlrtAskOMIAOMZ7fF4mDlzJkOHDsXn81FbW8uhQ4di
|
||||||
|
6ni9XpYuXWpZ9vXr1zlxovsw2Nl4/IzV+k/hwn6furo6qa2tlRs3boiIyOLFi011Fi5cqNX61dXV
|
||||||
|
YZ2baJ4cjRnpMQj4SbwEAPLWW291O338+HFJS0szla+pqdEiYN26dWGdA/FU3oyAF9wgoKKiotvp
|
||||||
|
JUuWmMpOmTJFgsGgFgFFRUVhvd8mioBfuUFAcnKynDx5Ug4fPiwpKSmmslu2bNGqfH19vSQlJYX1
|
||||||
|
VsZLQKy1fsdHUCLR0dHBRx99xNmzZ6PO+4cxcuRIVq/W23D+6aef0tXVBXAf41RqXIhFQLRfYnKE
|
||||||
|
6upqy93hK1asoG/fvlrlHT16NPyxXkT8cTkHMbvATlzoAjpXv379xO/3a4V/V1dXOP8X4I/xhr+Y
|
||||||
|
ZIKuRYAVli9frrX4AcYEit/vD/970g37sQiwveHQCdLT03nppZe05ffs2RP+KMA/XHEiRheIKw3W
|
||||||
|
vZYvX64V+mEUFhaGdS8ROvof7xWLgOZEVz4pKUk+++wz7cofPHgwfGRegB1uVD7qGKCUSuUhdIG5
|
||||||
|
c+dSVlamLb9nz55w44Bb4U/0McBHgrbCRmLt2rW25CNmkIPAQdcciQj7EmATxs9RJDT8S0tLtdNe
|
||||||
|
EZFTp05FTqHVuxX+IoJHKTUIeBtYgsuHqWNh7dq1GAfO9LBr167IKbTYc+kO8WceUtIDSEFBga3T
|
||||||
|
ICIi06dPjyzjBVcjANiKsQBiex+AE6xZsybmydG2tja++uorrly5QlNTE4FAgEAgwLFjx8IiHRg/
|
||||||
|
xOYalIiEDz+vBVZgbIdNSFfIyclh9+7dNDU1dVcw8q/f76etrc2siBMiMtlNn3r9jpBSqhSYjTEo
|
||||||
|
5mNMjztaIHkQKSkpdHZ2Wp0RvI2x2NkS+tsc+nsNqBMRV8cA0x9SCh2NHYtxRnA0MBwYgJEnhC+z
|
||||||
|
17h2jP27d0Kf2zH2893G2NNzM3S1YvzAYgDj9Ffsd2eX8V/DpporbFKohAAAAABJRU5ErkJggg== }
|
||||||
|
|
||||||
wm iconphoto . -default rpicon
|
wm iconphoto . -default rpicon
|
||||||
}
|
}
|
||||||
@@ -1249,7 +1280,7 @@ proc Status { stuff } {
|
|||||||
# None
|
# None
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
proc DoPrint {} {
|
proc DoPrint {} {
|
||||||
global Rem2PS Rem2PDF HaveRem2PDF PSCmd Option PrintStatus
|
global Rem2PS Rem2PDF HaveRem2PDF PSCmd Option PrintStatus RemindErrors
|
||||||
global CurMonth CurYear MonthNames
|
global CurMonth CurYear MonthNames
|
||||||
|
|
||||||
catch {destroy .p}
|
catch {destroy .p}
|
||||||
@@ -1435,7 +1466,8 @@ proc DoPrint {} {
|
|||||||
append cmd " $fname"
|
append cmd " $fname"
|
||||||
Status "Printing..."
|
Status "Printing..."
|
||||||
if {[catch {eval "exec $cmd"} err]} {
|
if {[catch {eval "exec $cmd"} err]} {
|
||||||
tk_dialog .error Error "Error during printing: $err" error 0 Ok
|
set RemindErrors [unique_lines $err]
|
||||||
|
set_button_to_errors
|
||||||
}
|
}
|
||||||
DisplayTime
|
DisplayTime
|
||||||
}
|
}
|
||||||
@@ -2671,9 +2703,14 @@ proc ShowQueue { file } {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
set obj [lsort -command sort_q $obj]
|
set obj [lsort -command sort_q $obj]
|
||||||
|
set did 0
|
||||||
foreach q $obj {
|
foreach q $obj {
|
||||||
$w.t insert end "$q\n"
|
$w.t insert end "$q\n"
|
||||||
|
set did 1
|
||||||
}
|
}
|
||||||
|
if { $did == 0 } {
|
||||||
|
$w.t insert end "(Queue is empty)\n"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$w.t configure -state disabled
|
$w.t configure -state disabled
|
||||||
}
|
}
|
||||||
@@ -4017,13 +4054,17 @@ bind Balloon <Destroy> {
|
|||||||
catch { unset Balloon(helptext%W) }
|
catch { unset Balloon(helptext%W) }
|
||||||
}
|
}
|
||||||
|
|
||||||
proc balloon_add_help { w txt } {
|
proc balloon_set_help { w txt } {
|
||||||
global Balloon
|
global Balloon
|
||||||
if {"$txt" == ""} {
|
if {"$txt" == ""} {
|
||||||
catch { unset Balloon(helptext$w) }
|
catch { unset Balloon(helptext$w) }
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
set Balloon(helptext$w) $txt
|
set Balloon(helptext$w) $txt
|
||||||
|
}
|
||||||
|
|
||||||
|
proc balloon_add_help { w txt } {
|
||||||
|
balloon_set_help $w $txt
|
||||||
bindtags $w "Balloon [bindtags $w]"
|
bindtags $w "Balloon [bindtags $w]"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4175,9 +4216,11 @@ proc update_color_buttons { w } {
|
|||||||
}
|
}
|
||||||
|
|
||||||
proc set_button_to_queue {} {
|
proc set_button_to_queue {} {
|
||||||
|
balloon_set_help .b.queue "See the queue of pending reminders (debugging purposes only)"
|
||||||
.b.queue configure -text {Queue...} -command {DoQueue}
|
.b.queue configure -text {Queue...} -command {DoQueue}
|
||||||
}
|
}
|
||||||
proc set_button_to_errors {} {
|
proc set_button_to_errors {} {
|
||||||
|
balloon_set_help .b.queue "See the list of errors from the most recent operation"
|
||||||
.b.queue configure -text {Errors...} -command {ShowErrors}
|
.b.queue configure -text {Errors...} -command {ShowErrors}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1218,7 +1218,7 @@ static void PrintLeft(char const *s, int width, char pad)
|
|||||||
if (!buf) {
|
if (!buf) {
|
||||||
/* Uh-oh... cannot recover */
|
/* Uh-oh... cannot recover */
|
||||||
fprintf(stderr, "%s\n", ErrMsg[E_NO_MEM]);
|
fprintf(stderr, "%s\n", ErrMsg[E_NO_MEM]);
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(void) mbstowcs(buf, s, len+1);
|
(void) mbstowcs(buf, s, len+1);
|
||||||
@@ -1297,7 +1297,7 @@ static void PrintCentered(char const *s, int width, char *pad)
|
|||||||
if (!buf) {
|
if (!buf) {
|
||||||
/* Uh-oh... cannot recover */
|
/* Uh-oh... cannot recover */
|
||||||
fprintf(stderr, "%s\n", ErrMsg[E_NO_MEM]);
|
fprintf(stderr, "%s\n", ErrMsg[E_NO_MEM]);
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(void) mbstowcs(buf, s, len+1);
|
(void) mbstowcs(buf, s, len+1);
|
||||||
@@ -1603,7 +1603,7 @@ static void GenerateCalEntries(int col)
|
|||||||
r=IncludeFile(InitialFile);
|
r=IncludeFile(InitialFile);
|
||||||
if (r) {
|
if (r) {
|
||||||
fprintf(ErrFp, "%s %s: %s\n", ErrMsg[E_ERR_READING], InitialFile, ErrMsg[r]);
|
fprintf(ErrFp, "%s %s: %s\n", ErrMsg[E_ERR_READING], InitialFile, ErrMsg[r]);
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
@@ -1611,7 +1611,7 @@ static void GenerateCalEntries(int col)
|
|||||||
if (r == E_EOF) return;
|
if (r == E_EOF) return;
|
||||||
if (r) {
|
if (r) {
|
||||||
Eprint("%s: %s", ErrMsg[E_ERR_READING], ErrMsg[r]);
|
Eprint("%s: %s", ErrMsg[E_ERR_READING], ErrMsg[r]);
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
s = FindInitialToken(&tok, CurLine);
|
s = FindInitialToken(&tok, CurLine);
|
||||||
|
|
||||||
@@ -1811,8 +1811,12 @@ static int DoCalRem(ParsePtr p, int col)
|
|||||||
FindToken(DBufValue(&buf), &tok);
|
FindToken(DBufValue(&buf), &tok);
|
||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
if (tok.type == T_Empty || tok.type == T_Comment) {
|
if (tok.type == T_Empty || tok.type == T_Comment) {
|
||||||
|
r = OK;
|
||||||
|
if (trig.addomit) {
|
||||||
|
r = AddGlobalOmit(LastTriggerDate);
|
||||||
|
}
|
||||||
FreeTrig(&trig);
|
FreeTrig(&trig);
|
||||||
return OK;
|
return r;
|
||||||
}
|
}
|
||||||
if (tok.type != T_RemType || tok.val == SAT_TYPE) {
|
if (tok.type != T_RemType || tok.val == SAT_TYPE) {
|
||||||
FreeTrig(&trig);
|
FreeTrig(&trig);
|
||||||
|
|||||||
@@ -7,9 +7,6 @@
|
|||||||
/* Define if your <sys/time.h> declares struct tm. */
|
/* Define if your <sys/time.h> declares struct tm. */
|
||||||
#undef TM_IN_SYS_TIME
|
#undef TM_IN_SYS_TIME
|
||||||
|
|
||||||
/* Define if you have the <sys/file.h> header file. */
|
|
||||||
#undef HAVE_SYS_FILE_H
|
|
||||||
|
|
||||||
/* Define if you have the <sys/types.h> header file. */
|
/* Define if you have the <sys/types.h> header file. */
|
||||||
#undef HAVE_SYS_TYPES_H
|
#undef HAVE_SYS_TYPES_H
|
||||||
|
|
||||||
|
|||||||
55
src/dorem.c
55
src/dorem.c
@@ -199,9 +199,11 @@ int DoRem(ParsePtr p)
|
|||||||
} else {
|
} else {
|
||||||
/* Parse the rest of the line to catch any potential
|
/* Parse the rest of the line to catch any potential
|
||||||
expression-pasting errors */
|
expression-pasting errors */
|
||||||
while (ParseChar(p, &r, 0)) {
|
if (ParseUntriggered) {
|
||||||
if (r != 0) {
|
while (ParseChar(p, &r, 0)) {
|
||||||
break;
|
if (r != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -348,6 +350,16 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
|||||||
if (r) return r;
|
if (r) return r;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* A time implicitly introduces an AT if AT is not explicit */
|
||||||
|
case T_Time:
|
||||||
|
DBufFree(&buf);
|
||||||
|
if (tim->ttime != NO_TIME) return E_TIME_TWICE;
|
||||||
|
tim->ttime = tok.val;
|
||||||
|
r = ParseTimeTrig(s, tim, save_in_globals);
|
||||||
|
if (r) return r;
|
||||||
|
trig->duration_days = ComputeTrigDuration(tim);
|
||||||
|
break;
|
||||||
|
|
||||||
case T_At:
|
case T_At:
|
||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
r=ParseTimeTrig(s, tim, save_in_globals);
|
r=ParseTimeTrig(s, tim, save_in_globals);
|
||||||
@@ -1134,7 +1146,12 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int dse, int is_queue
|
|||||||
if (msg_command) {
|
if (msg_command) {
|
||||||
DoMsgCommand(msg_command, DBufValue(&buf));
|
DoMsgCommand(msg_command, DBufValue(&buf));
|
||||||
} else {
|
} else {
|
||||||
printf("%s", DBufValue(&buf));
|
/* Add a space before "NOTE endreminder" */
|
||||||
|
if (Daemon < 0 && !strncmp(DBufValue(&buf), "NOTE endreminder", 16)) {
|
||||||
|
printf(" %s", DBufValue(&buf));
|
||||||
|
} else {
|
||||||
|
printf("%s", DBufValue(&buf));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1182,7 +1199,7 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int dse, int *err)
|
|||||||
if (DontIssueAts > 1) {
|
if (DontIssueAts > 1) {
|
||||||
/* If two or more -a options, then *DO* issue ats that are in the
|
/* If two or more -a options, then *DO* issue ats that are in the
|
||||||
future */
|
future */
|
||||||
if (tim->ttime < SystemTime(0) / 60) {
|
if (tim->ttime < MinutesPastMidnight(0)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1190,29 +1207,31 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int dse, int *err)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't trigger "old" timed reminders */
|
|
||||||
/*** REMOVED...
|
|
||||||
if (dse == DSEToday &&
|
|
||||||
tim->ttime != NO_TIME &&
|
|
||||||
tim->ttime < SystemTime(0) / 60) return 0;
|
|
||||||
*** ...UNTIL HERE */
|
|
||||||
|
|
||||||
/* If "infinite delta" option is chosen, always trigger future reminders */
|
/* If "infinite delta" option is chosen, always trigger future reminders */
|
||||||
if (InfiniteDelta || NextMode) return 1;
|
if (InfiniteDelta || NextMode) return 1;
|
||||||
|
|
||||||
/* If there's a "warn" function, it overrides any deltas */
|
/* If there's a "warn" function, it overrides any deltas except
|
||||||
|
* DeltaOverride*/
|
||||||
if (t->warn[0] != 0) {
|
if (t->warn[0] != 0) {
|
||||||
if (DeltaOffset) {
|
if (DeltaOverride > 0) {
|
||||||
if (dse <= DSEToday + DeltaOffset) {
|
if (dse <= DSEToday + DeltaOverride) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ShouldTriggerBasedOnWarn(t, dse, err);
|
return ShouldTriggerBasedOnWarn(t, dse, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Zero delta */
|
||||||
|
if (DeltaOverride < 0) {
|
||||||
|
return dse == DSEToday;
|
||||||
|
}
|
||||||
|
|
||||||
/* Move back by delta days, if any */
|
/* Move back by delta days, if any */
|
||||||
if (t->delta != NO_DELTA) {
|
if (DeltaOverride) {
|
||||||
if (t->delta < 0)
|
/* A positive DeltaOverride takes precedence over everything */
|
||||||
|
dse = dse - DeltaOverride;
|
||||||
|
} else if (t->delta != NO_DELTA) {
|
||||||
|
if (t->delta < 0)
|
||||||
dse = dse + t->delta;
|
dse = dse + t->delta;
|
||||||
else {
|
else {
|
||||||
int iter = 0;
|
int iter = 0;
|
||||||
@@ -1237,7 +1256,7 @@ int ShouldTriggerReminder(Trigger *t, TimeTrig *tim, int dse, int *err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Should we trigger the reminder? */
|
/* Should we trigger the reminder? */
|
||||||
return (dse <= DSEToday + DeltaOffset);
|
return (dse <= DSEToday);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse, int mode)
|
int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse, int mode)
|
||||||
{
|
{
|
||||||
int diff = dse - DSEToday;
|
int diff = dse - DSEToday;
|
||||||
int curtime = SystemTime(0) / 60;
|
int curtime = MinutesPastMidnight(0);
|
||||||
int err, done;
|
int err, done;
|
||||||
int c;
|
int c;
|
||||||
int d, m, y;
|
int d, m, y;
|
||||||
@@ -894,7 +894,7 @@ int DoSubstFromString(char const *source, DynamicBuffer *dbuf,
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (dse == NO_DATE) dse=DSEToday;
|
if (dse == NO_DATE) dse=DSEToday;
|
||||||
if (tim == NO_TIME) tim=SystemTime(0)/60;
|
if (tim == NO_TIME) tim=MinutesPastMidnight(0);
|
||||||
CreateParser(source, &tempP);
|
CreateParser(source, &tempP);
|
||||||
tempP.allownested = 0;
|
tempP.allownested = 0;
|
||||||
tempTrig.typ = MSG_TYPE;
|
tempTrig.typ = MSG_TYPE;
|
||||||
|
|||||||
55
src/funcs.c
55
src/funcs.c
@@ -30,10 +30,6 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef HAVE_SYS_FILE_H
|
|
||||||
#include <sys/file.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -1425,28 +1421,28 @@ static int FRealtoday(func_info *info)
|
|||||||
static int FNow(func_info *info)
|
static int FNow(func_info *info)
|
||||||
{
|
{
|
||||||
RetVal.type = TIME_TYPE;
|
RetVal.type = TIME_TYPE;
|
||||||
RETVAL = (int) ( SystemTime(0) / 60L );
|
RETVAL = MinutesPastMidnight(0);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int FRealnow(func_info *info)
|
static int FRealnow(func_info *info)
|
||||||
{
|
{
|
||||||
RetVal.type = TIME_TYPE;
|
RetVal.type = TIME_TYPE;
|
||||||
RETVAL = (int) ( SystemTime(1) / 60L );
|
RETVAL = MinutesPastMidnight(1);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int FCurrent(func_info *info)
|
static int FCurrent(func_info *info)
|
||||||
{
|
{
|
||||||
RetVal.type = DATETIME_TYPE;
|
RetVal.type = DATETIME_TYPE;
|
||||||
RETVAL = DSEToday * MINUTES_PER_DAY + (SystemTime(0) / 60);
|
RETVAL = DSEToday * MINUTES_PER_DAY + MinutesPastMidnight(0);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int FRealCurrent(func_info *info)
|
static int FRealCurrent(func_info *info)
|
||||||
{
|
{
|
||||||
RetVal.type = DATETIME_TYPE;
|
RetVal.type = DATETIME_TYPE;
|
||||||
RETVAL = RealToday * MINUTES_PER_DAY + (SystemTime(1) / 60);
|
RETVAL = RealToday * MINUTES_PER_DAY + MinutesPastMidnight(1);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2496,7 +2492,7 @@ static int FTimezone(func_info *info)
|
|||||||
|
|
||||||
if (Nargs == 0) {
|
if (Nargs == 0) {
|
||||||
dse = DSEToday;
|
dse = DSEToday;
|
||||||
now = (SystemTime(0) / 60);
|
now = MinutesPastMidnight(0);
|
||||||
} else {
|
} else {
|
||||||
if (!HASDATE(ARG(0))) return E_BAD_TYPE;
|
if (!HASDATE(ARG(0))) return E_BAD_TYPE;
|
||||||
dse = DATEPART(ARG(0));
|
dse = DATEPART(ARG(0));
|
||||||
@@ -3294,6 +3290,8 @@ FSlide(func_info *info)
|
|||||||
{
|
{
|
||||||
int r, omit, d, i, localomit, amt;
|
int r, omit, d, i, localomit, amt;
|
||||||
Token tok;
|
Token tok;
|
||||||
|
int step = 1;
|
||||||
|
int localargs = 2;
|
||||||
|
|
||||||
if (!HASDATE(ARG(0))) return E_BAD_TYPE;
|
if (!HASDATE(ARG(0))) return E_BAD_TYPE;
|
||||||
ASSERT_TYPE(1, INT_TYPE);
|
ASSERT_TYPE(1, INT_TYPE);
|
||||||
@@ -3303,8 +3301,13 @@ FSlide(func_info *info)
|
|||||||
if (amt > 1000000) return E_2HIGH;
|
if (amt > 1000000) return E_2HIGH;
|
||||||
if (amt < -1000000) return E_2LOW;
|
if (amt < -1000000) return E_2LOW;
|
||||||
|
|
||||||
|
if (Nargs > 2 && ARG(2).type == INT_TYPE) {
|
||||||
|
step = ARGV(2);
|
||||||
|
if (step < 1) return E_2LOW;
|
||||||
|
localargs++;
|
||||||
|
}
|
||||||
localomit = 0;
|
localomit = 0;
|
||||||
for (i=2; i<Nargs; i++) {
|
for (i=localargs; i<Nargs; i++) {
|
||||||
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
|
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
|
||||||
FindToken(ARG(i).v.str, &tok);
|
FindToken(ARG(i).v.str, &tok);
|
||||||
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
|
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
|
||||||
@@ -3315,14 +3318,14 @@ FSlide(func_info *info)
|
|||||||
if ((WeekdayOmits | localomit) == 0x7F && amt != 0) return E_2MANY_LOCALOMIT;
|
if ((WeekdayOmits | localomit) == 0x7F && amt != 0) return E_2MANY_LOCALOMIT;
|
||||||
if (amt > 0) {
|
if (amt > 0) {
|
||||||
while(amt) {
|
while(amt) {
|
||||||
d++;
|
d += step;
|
||||||
r = IsOmitted(d, localomit, NULL, &omit);
|
r = IsOmitted(d, localomit, NULL, &omit);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
if (!omit) amt--;
|
if (!omit) amt--;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while(amt) {
|
while(amt) {
|
||||||
d--;
|
d -= step;
|
||||||
if (d < 0) return E_DATE_OVER;
|
if (d < 0) return E_DATE_OVER;
|
||||||
r = IsOmitted(d, localomit, NULL, &omit);
|
r = IsOmitted(d, localomit, NULL, &omit);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
@@ -3339,6 +3342,8 @@ FNonomitted(func_info *info)
|
|||||||
{
|
{
|
||||||
int d1, d2, ans, localomit, i;
|
int d1, d2, ans, localomit, i;
|
||||||
int omit, r;
|
int omit, r;
|
||||||
|
int step = 1;
|
||||||
|
int localargs = 2;
|
||||||
Token tok;
|
Token tok;
|
||||||
|
|
||||||
if (!HASDATE(ARG(0)) ||
|
if (!HASDATE(ARG(0)) ||
|
||||||
@@ -3347,10 +3352,20 @@ FNonomitted(func_info *info)
|
|||||||
}
|
}
|
||||||
d1 = DATEPART(ARG(0));
|
d1 = DATEPART(ARG(0));
|
||||||
d2 = DATEPART(ARG(1));
|
d2 = DATEPART(ARG(1));
|
||||||
if (d2 < d1) return E_2LOW;
|
if (d2 < d1) {
|
||||||
|
i = d1;
|
||||||
|
d1 = d2;
|
||||||
|
d2 = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check for a "step" argument - it's an INT */
|
||||||
|
if (Nargs > 2 && ARG(2).type == INT_TYPE) {
|
||||||
|
step = ARGV(2);
|
||||||
|
if (step < 1) return E_2LOW;
|
||||||
|
localargs++;
|
||||||
|
}
|
||||||
localomit = 0;
|
localomit = 0;
|
||||||
for (i=2; i<Nargs; i++) {
|
for (i=localargs; i<Nargs; i++) {
|
||||||
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
|
if (ARG(i).type != STR_TYPE) return E_BAD_TYPE;
|
||||||
FindToken(ARG(i).v.str, &tok);
|
FindToken(ARG(i).v.str, &tok);
|
||||||
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
|
if (tok.type != T_WkDay) return E_UNKNOWN_TOKEN;
|
||||||
@@ -3359,11 +3374,12 @@ FNonomitted(func_info *info)
|
|||||||
|
|
||||||
ans = 0;
|
ans = 0;
|
||||||
while (d1 < d2) {
|
while (d1 < d2) {
|
||||||
r = IsOmitted(d1++, localomit, NULL, &omit);
|
r = IsOmitted(d1, localomit, NULL, &omit);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
if (!omit) {
|
if (!omit) {
|
||||||
ans++;
|
ans++;
|
||||||
}
|
}
|
||||||
|
d1 += step;
|
||||||
}
|
}
|
||||||
RetVal.type = INT_TYPE;
|
RetVal.type = INT_TYPE;
|
||||||
RETVAL = ans;
|
RETVAL = ans;
|
||||||
@@ -3558,6 +3574,8 @@ rows_or_cols(func_info *info, int want_rows)
|
|||||||
struct winsize w;
|
struct winsize w;
|
||||||
int fd = STDOUT_FILENO;
|
int fd = STDOUT_FILENO;
|
||||||
|
|
||||||
|
int opened = 0;
|
||||||
|
|
||||||
RetVal.type = INT_TYPE;
|
RetVal.type = INT_TYPE;
|
||||||
if (!isatty(fd)) {
|
if (!isatty(fd)) {
|
||||||
fd = open("/dev/tty", O_RDONLY);
|
fd = open("/dev/tty", O_RDONLY);
|
||||||
@@ -3565,6 +3583,7 @@ rows_or_cols(func_info *info, int want_rows)
|
|||||||
RETVAL = -1;
|
RETVAL = -1;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
opened = 1;
|
||||||
}
|
}
|
||||||
if (ioctl(fd, TIOCGWINSZ, &w) == 0) {
|
if (ioctl(fd, TIOCGWINSZ, &w) == 0) {
|
||||||
if (want_rows) RETVAL = w.ws_row;
|
if (want_rows) RETVAL = w.ws_row;
|
||||||
@@ -3572,7 +3591,7 @@ rows_or_cols(func_info *info, int want_rows)
|
|||||||
} else {
|
} else {
|
||||||
RETVAL = -1;
|
RETVAL = -1;
|
||||||
}
|
}
|
||||||
if (fd != STDOUT_FILENO) {
|
if (opened) {
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
@@ -3741,7 +3760,7 @@ solstice_equinox_for_year(int y, int which)
|
|||||||
j -= 2447892.50000; /* This is the Julian date of midnight, 1 Jan 1990 UTC */
|
j -= 2447892.50000; /* This is the Julian date of midnight, 1 Jan 1990 UTC */
|
||||||
int dse = (int) j;
|
int dse = (int) j;
|
||||||
|
|
||||||
int min = floor((j - (double) dse) * MINUTES_PER_DAY);
|
int min = (int) floor((j - (double) dse) * MINUTES_PER_DAY);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Convert from UTC to local time */
|
/* Convert from UTC to local time */
|
||||||
@@ -3789,8 +3808,10 @@ FSoleq(func_info *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ret = solstice_equinox_for_year(y, which);
|
ret = solstice_equinox_for_year(y, which);
|
||||||
|
if (ret < 0) return E_MKTIME_PROBLEM;
|
||||||
if (dse != NO_DATE && (ret / MINUTES_PER_DAY) < dse) {
|
if (dse != NO_DATE && (ret / MINUTES_PER_DAY) < dse) {
|
||||||
ret = solstice_equinox_for_year(y+1, which);
|
ret = solstice_equinox_for_year(y+1, which);
|
||||||
|
if (ret < 0) return E_MKTIME_PROBLEM;
|
||||||
}
|
}
|
||||||
RetVal.type = DATETIME_TYPE;
|
RetVal.type = DATETIME_TYPE;
|
||||||
RETVAL = ret;
|
RETVAL = ret;
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ EXTERN int LineNo;
|
|||||||
EXTERN int FreshLine;
|
EXTERN int FreshLine;
|
||||||
EXTERN uid_t TrustedUsers[MAX_TRUSTED_USERS];
|
EXTERN uid_t TrustedUsers[MAX_TRUSTED_USERS];
|
||||||
|
|
||||||
|
EXTERN INIT( int MaxLateMinutes, 0);
|
||||||
EXTERN INIT( int NumTrustedUsers, 0);
|
EXTERN INIT( int NumTrustedUsers, 0);
|
||||||
EXTERN INIT( char const *MsgCommand, NULL);
|
EXTERN INIT( char const *MsgCommand, NULL);
|
||||||
EXTERN INIT( char const *QueuedMsgCommand, NULL);
|
EXTERN INIT( char const *QueuedMsgCommand, NULL);
|
||||||
@@ -70,7 +71,7 @@ EXTERN INIT( int Hush, 0);
|
|||||||
EXTERN INIT( int NextMode, 0);
|
EXTERN INIT( int NextMode, 0);
|
||||||
EXTERN INIT( int InfiniteDelta, 0);
|
EXTERN INIT( int InfiniteDelta, 0);
|
||||||
EXTERN INIT( int DefaultTDelta, 0);
|
EXTERN INIT( int DefaultTDelta, 0);
|
||||||
EXTERN INIT( int DeltaOffset, 0);
|
EXTERN INIT( int DeltaOverride, 0);
|
||||||
EXTERN INIT( int RunDisabled, 0);
|
EXTERN INIT( int RunDisabled, 0);
|
||||||
EXTERN INIT( int IgnoreOnce, 0);
|
EXTERN INIT( int IgnoreOnce, 0);
|
||||||
EXTERN INIT( int SortByTime, 0);
|
EXTERN INIT( int SortByTime, 0);
|
||||||
@@ -79,6 +80,7 @@ EXTERN INIT( int SortByPrio, 0);
|
|||||||
EXTERN INIT( int UntimedBeforeTimed, 0);
|
EXTERN INIT( int UntimedBeforeTimed, 0);
|
||||||
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
|
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
|
||||||
EXTERN INIT( long SysTime, -1L);
|
EXTERN INIT( long SysTime, -1L);
|
||||||
|
EXTERN INIT( int ParseUntriggered, 1);
|
||||||
|
|
||||||
EXTERN char const *InitialFile;
|
EXTERN char const *InitialFile;
|
||||||
EXTERN int FileAccessDate;
|
EXTERN int FileAccessDate;
|
||||||
|
|||||||
193
src/init.c
193
src/init.c
@@ -25,10 +25,11 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <termios.h>
|
||||||
|
|
||||||
#ifdef HAVE_INITGROUPS
|
#ifdef HAVE_INITGROUPS
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
@@ -40,6 +41,14 @@
|
|||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
#include "err.h"
|
#include "err.h"
|
||||||
|
|
||||||
|
static int should_guess_terminal_background = 1;
|
||||||
|
|
||||||
|
static void guess_terminal_background(int *r, int *g, int *b);
|
||||||
|
static int tty_init(int fd);
|
||||||
|
static void tty_raw(int fd);
|
||||||
|
static void tty_reset(int fd);
|
||||||
|
|
||||||
|
static void ProcessLongOption(char const *arg);
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
*
|
*
|
||||||
* Command line options recognized:
|
* Command line options recognized:
|
||||||
@@ -167,6 +176,7 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
int x;
|
int x;
|
||||||
int dse;
|
int dse;
|
||||||
int ttyfd;
|
int ttyfd;
|
||||||
|
int r, g, b;
|
||||||
|
|
||||||
dse = NO_DATE;
|
dse = NO_DATE;
|
||||||
|
|
||||||
@@ -219,7 +229,7 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Invoked with a NULL argv[0]; bailing because that's just plain bizarre.\n");
|
fprintf(stderr, "Invoked with a NULL argv[0]; bailing because that's just plain bizarre.\n");
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse the command-line options */
|
/* Parse the command-line options */
|
||||||
@@ -243,6 +253,11 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
while(*arg) arg++;
|
while(*arg) arg++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case '-':
|
||||||
|
ProcessLongOption(arg);
|
||||||
|
while(*arg) arg++;
|
||||||
|
break;
|
||||||
|
|
||||||
case '@':
|
case '@':
|
||||||
UseVTColors = 1;
|
UseVTColors = 1;
|
||||||
if (*arg) {
|
if (*arg) {
|
||||||
@@ -259,16 +274,24 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
if (*arg == ',') {
|
if (*arg == ',') {
|
||||||
arg++;
|
arg++;
|
||||||
if (*arg != ',') {
|
if (*arg != ',') {
|
||||||
PARSENUM(x, arg);
|
if (*arg == 't') {
|
||||||
if (x == 0) {
|
arg++;
|
||||||
TerminalBackground = TERMINAL_BACKGROUND_DARK;
|
should_guess_terminal_background = 2;
|
||||||
} else if (x == 1) {
|
|
||||||
TerminalBackground = TERMINAL_BACKGROUND_LIGHT;
|
|
||||||
} else if (x == 2) {
|
|
||||||
TerminalBackground = TERMINAL_BACKGROUND_UNKNOWN;
|
|
||||||
} else {
|
} else {
|
||||||
fprintf(ErrFp, "%s: -@n,m,b: m must be 0, 1 or 2 (assuming 2)\n",
|
PARSENUM(x, arg);
|
||||||
argv[0]);
|
if (x == 0) {
|
||||||
|
should_guess_terminal_background = 0;
|
||||||
|
TerminalBackground = TERMINAL_BACKGROUND_DARK;
|
||||||
|
} else if (x == 1) {
|
||||||
|
should_guess_terminal_background = 0;
|
||||||
|
TerminalBackground = TERMINAL_BACKGROUND_LIGHT;
|
||||||
|
} else if (x == 2) {
|
||||||
|
should_guess_terminal_background = 0;
|
||||||
|
TerminalBackground = TERMINAL_BACKGROUND_UNKNOWN;
|
||||||
|
} else {
|
||||||
|
fprintf(ErrFp, "%s: -@n,m,b: m must be t, 0, 1 or 2 (assuming 2)\n",
|
||||||
|
argv[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -341,10 +364,15 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
} else if (!*arg) {
|
} else if (!*arg) {
|
||||||
InfiniteDelta = 1;
|
InfiniteDelta = 1;
|
||||||
} else {
|
} else {
|
||||||
PARSENUM(DeltaOffset, arg);
|
if (*arg == 'z') {
|
||||||
if (DeltaOffset < 0) {
|
DeltaOverride = -1;
|
||||||
DeltaOffset = 0;
|
arg++;
|
||||||
}
|
} else {
|
||||||
|
PARSENUM(DeltaOverride, arg);
|
||||||
|
if (DeltaOverride < 0) {
|
||||||
|
DeltaOverride = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
@@ -532,7 +560,7 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
arg++;
|
arg++;
|
||||||
/* -wt means get width from /dev/tty */
|
/* -wt means get width from /dev/tty */
|
||||||
ttyfd = open("/dev/tty", O_RDONLY);
|
ttyfd = open("/dev/tty", O_RDONLY);
|
||||||
if (!ttyfd) {
|
if (ttyfd < 0) {
|
||||||
fprintf(stderr, "%s: `-wt': Cannot open /dev/tty: %s\n",
|
fprintf(stderr, "%s: `-wt': Cannot open /dev/tty: %s\n",
|
||||||
argv[0], strerror(errno));
|
argv[0], strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
@@ -543,7 +571,12 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
PARSENUM(CalWidth, arg);
|
PARSENUM(CalWidth, arg);
|
||||||
if (CalWidth != 0 && CalWidth < 71) CalWidth = 71;
|
if (CalWidth != 0 && CalWidth < 71) CalWidth = 71;
|
||||||
if (CalWidth == 0) {
|
if (CalWidth == 0) {
|
||||||
CalWidth = -1;
|
/* Cal width of 0 means obtain from stdout */
|
||||||
|
if (isatty(STDOUT_FILENO)) {
|
||||||
|
InitCalWidthAndFormWidth(STDOUT_FILENO);
|
||||||
|
} else {
|
||||||
|
CalWidth = 80;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FormWidth = CalWidth - 8;
|
FormWidth = CalWidth - 8;
|
||||||
if (FormWidth < 20) FormWidth = 20;
|
if (FormWidth < 20) FormWidth = 20;
|
||||||
@@ -616,6 +649,17 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (should_guess_terminal_background) {
|
||||||
|
guess_terminal_background(&r, &g, &b);
|
||||||
|
if (r >= 0 && g >= 0 && b >= 0) {
|
||||||
|
if (r+g+b <= 85*3 && r <= 128 && g <= 128 && b <= 128) {
|
||||||
|
TerminalBackground = TERMINAL_BACKGROUND_DARK;
|
||||||
|
} else {
|
||||||
|
TerminalBackground = TERMINAL_BACKGROUND_LIGHT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the filename. */
|
/* Get the filename. */
|
||||||
if (!InvokedAsRem) {
|
if (!InvokedAsRem) {
|
||||||
if (i >= argc) {
|
if (i >= argc) {
|
||||||
@@ -721,7 +765,7 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
|
|
||||||
/* Figure out the offset from UTC */
|
/* Figure out the offset from UTC */
|
||||||
if (CalculateUTC)
|
if (CalculateUTC)
|
||||||
(void) CalcMinsFromUTC(DSEToday, SystemTime(0)/60,
|
(void) CalcMinsFromUTC(DSEToday, MinutesPastMidnight(0),
|
||||||
&MinsFromUTC, NULL);
|
&MinsFromUTC, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -953,3 +997,116 @@ AddTrustedUser(char const *username)
|
|||||||
NumTrustedUsers++;
|
NumTrustedUsers++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
ProcessLongOption(char const *arg)
|
||||||
|
{
|
||||||
|
if (!strcmp(arg, "version")) {
|
||||||
|
printf("%s\n", VERSION);
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
fprintf(ErrFp, "%s: Unknown long option --%s\n", ArgV[0], arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
guess_terminal_background(int *r, int *g, int *b)
|
||||||
|
{
|
||||||
|
int ttyfd;
|
||||||
|
struct pollfd p;
|
||||||
|
int rr, gg, bb;
|
||||||
|
char buf[128];
|
||||||
|
int n;
|
||||||
|
|
||||||
|
*r = -1;
|
||||||
|
*g = -1;
|
||||||
|
*b = -1;
|
||||||
|
|
||||||
|
/* Don't guess if stdout not a terminal unless asked to by @,t */
|
||||||
|
if (should_guess_terminal_background != 2) {
|
||||||
|
if (!isatty(STDOUT_FILENO)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ttyfd = open("/dev/tty", O_RDWR);
|
||||||
|
if (ttyfd < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isatty(ttyfd)) {
|
||||||
|
/* Not a TTY: Can't guess the color */
|
||||||
|
close(ttyfd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!tty_init(ttyfd)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
tty_raw(ttyfd);
|
||||||
|
write(ttyfd, "\033]11;?\033\\", 8);
|
||||||
|
|
||||||
|
/* Wait up to 0.1s for terminal to respond */
|
||||||
|
p.fd = ttyfd;
|
||||||
|
p.events = POLLIN;
|
||||||
|
if (poll(&p, 1, 100) < 0) {
|
||||||
|
tty_reset(ttyfd);
|
||||||
|
close(ttyfd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!(p.revents & POLLIN)) {
|
||||||
|
tty_reset(ttyfd);
|
||||||
|
close(ttyfd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
n = read(ttyfd, buf, 127);
|
||||||
|
if (n <= 0) {
|
||||||
|
tty_reset(ttyfd);
|
||||||
|
close(ttyfd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
tty_reset(ttyfd);
|
||||||
|
buf[n+1] = 0;
|
||||||
|
if (n < 25) {
|
||||||
|
/* Too short */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (sscanf(buf+5, "rgb:%x/%x/%x", &rr, &gg, &bb) != 3) {
|
||||||
|
/* Couldn't scan color codes */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
*r = (rr >> 8) & 255;
|
||||||
|
*g = (gg >> 8) & 255;
|
||||||
|
*b = (bb >> 8) & 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct termios orig_termios;
|
||||||
|
|
||||||
|
static int
|
||||||
|
tty_init(int fd)
|
||||||
|
{
|
||||||
|
if (tcgetattr(fd, &orig_termios) < 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
tty_raw(int fd)
|
||||||
|
{
|
||||||
|
struct termios raw;
|
||||||
|
|
||||||
|
raw = orig_termios;
|
||||||
|
|
||||||
|
raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON);
|
||||||
|
raw.c_oflag &= ~(OPOST);
|
||||||
|
raw.c_cflag |= (CS8);
|
||||||
|
raw.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
|
||||||
|
|
||||||
|
/* put terminal in raw mode after flushing */
|
||||||
|
tcsetattr(fd,TCSAFLUSH,&raw);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
tty_reset(int fd)
|
||||||
|
{
|
||||||
|
tcsetattr(fd, TCSAFLUSH, &orig_termios);
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,11 +17,11 @@
|
|||||||
|
|
||||||
/* Day names */
|
/* Day names */
|
||||||
#define L_SUNDAY "Domenica"
|
#define L_SUNDAY "Domenica"
|
||||||
#define L_MONDAY "Lunedí"
|
#define L_MONDAY "Lunedì"
|
||||||
#define L_TUESDAY "Martedí"
|
#define L_TUESDAY "Martedì"
|
||||||
#define L_WEDNESDAY "Mercoledí"
|
#define L_WEDNESDAY "Mercoledì"
|
||||||
#define L_THURSDAY "Giovedí"
|
#define L_THURSDAY "Giovedì"
|
||||||
#define L_FRIDAY "Venerdí"
|
#define L_FRIDAY "Venerdì"
|
||||||
#define L_SATURDAY "Sabato"
|
#define L_SATURDAY "Sabato"
|
||||||
|
|
||||||
/* Month names */
|
/* Month names */
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
#define L_AT "alle"
|
#define L_AT "alle"
|
||||||
#define L_MINUTE "minut"
|
#define L_MINUTE "minut"
|
||||||
#define L_HOUR "or"
|
#define L_HOUR "or"
|
||||||
#define L_IS "é"
|
#define L_IS "è"
|
||||||
#define L_WAS "era"
|
#define L_WAS "era"
|
||||||
#define L_AND "e"
|
#define L_AND "e"
|
||||||
/* What to add to make "hour" plural */
|
/* What to add to make "hour" plural */
|
||||||
|
|||||||
41
src/main.c
41
src/main.c
@@ -26,16 +26,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#ifdef TIME_WITH_SYS_TIME
|
#if defined(HAVE_SYS_TIME_H)
|
||||||
#include <time.h>
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#endif
|
||||||
#if defined(HAVE_SYS_TIME_H) || defined (TIME_WITH_SYS_TIME)
|
|
||||||
#include <sys/time.h>
|
|
||||||
#else
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef REM_USE_WCHAR
|
#ifdef REM_USE_WCHAR
|
||||||
@@ -187,14 +181,14 @@ static void DoReminders(void)
|
|||||||
|
|
||||||
if (FileAccessDate < 0) {
|
if (FileAccessDate < 0) {
|
||||||
fprintf(ErrFp, "%s: `%s': %s.\n", ErrMsg[E_CANTACCESS], InitialFile, strerror(errno));
|
fprintf(ErrFp, "%s: `%s': %s.\n", ErrMsg[E_CANTACCESS], InitialFile, strerror(errno));
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
r=IncludeFile(InitialFile);
|
r=IncludeFile(InitialFile);
|
||||||
if (r) {
|
if (r) {
|
||||||
fprintf(ErrFp, "%s %s: %s\n", ErrMsg[E_ERR_READING],
|
fprintf(ErrFp, "%s %s: %s\n", ErrMsg[E_ERR_READING],
|
||||||
InitialFile, ErrMsg[r]);
|
InitialFile, ErrMsg[r]);
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
@@ -202,7 +196,7 @@ static void DoReminders(void)
|
|||||||
if (r == E_EOF) return;
|
if (r == E_EOF) return;
|
||||||
if (r) {
|
if (r) {
|
||||||
Eprint("%s: %s", ErrMsg[E_ERR_READING], ErrMsg[r]);
|
Eprint("%s: %s", ErrMsg[E_ERR_READING], ErrMsg[r]);
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
s = FindInitialToken(&tok, CurLine);
|
s = FindInitialToken(&tok, CurLine);
|
||||||
|
|
||||||
@@ -755,17 +749,30 @@ int PushToken(char const *tok, ParsePtr p)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
long SystemTime(int realtime)
|
long SystemTime(int realtime)
|
||||||
{
|
{
|
||||||
time_t tloc;
|
time_t now;
|
||||||
struct tm *t;
|
struct tm *t;
|
||||||
|
|
||||||
if (!realtime && (SysTime != -1L)) return SysTime;
|
if (!realtime && (SysTime != -1L)) return SysTime;
|
||||||
|
|
||||||
(void) time(&tloc);
|
now = time(NULL);
|
||||||
t = localtime(&tloc);
|
t = localtime(&now);
|
||||||
return (long) t->tm_hour * 3600L + (long) t->tm_min * 60L +
|
return (long) t->tm_hour * 3600L + (long) t->tm_min * 60L +
|
||||||
(long) t->tm_sec;
|
(long) t->tm_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
/* */
|
||||||
|
/* MinutesPastMidnight */
|
||||||
|
/* */
|
||||||
|
/* Return the system time in minutes past midnight */
|
||||||
|
/* */
|
||||||
|
/***************************************************************/
|
||||||
|
int MinutesPastMidnight(int realtime)
|
||||||
|
{
|
||||||
|
return (int) (SystemTime(realtime) / 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* SystemDate */
|
/* SystemDate */
|
||||||
@@ -777,11 +784,11 @@ long SystemTime(int realtime)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int SystemDate(int *y, int *m, int *d)
|
int SystemDate(int *y, int *m, int *d)
|
||||||
{
|
{
|
||||||
time_t tloc;
|
time_t now;
|
||||||
struct tm *t;
|
struct tm *t;
|
||||||
|
|
||||||
(void) time(&tloc);
|
now = time(NULL);
|
||||||
t = localtime(&tloc);
|
t = localtime(&now);
|
||||||
|
|
||||||
*d = t->tm_mday;
|
*d = t->tm_mday;
|
||||||
*m = t->tm_mon;
|
*m = t->tm_mon;
|
||||||
|
|||||||
@@ -377,8 +377,12 @@ int DoOmit(ParsePtr p)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Eprint("%s: `%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN],
|
if (tok.type == T_Until) {
|
||||||
DBufValue(&buf));
|
Eprint("OMIT: UNTIL not allowed; did you mean THROUGH?");
|
||||||
|
} else {
|
||||||
|
Eprint("%s: `%s' (OMIT)", ErrMsg[E_UNKNOWN_TOKEN],
|
||||||
|
DBufValue(&buf));
|
||||||
|
}
|
||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
return E_UNKNOWN_TOKEN;
|
return E_UNKNOWN_TOKEN;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ void CreateParser (char const *s, ParsePtr p);
|
|||||||
void DestroyParser (ParsePtr p);
|
void DestroyParser (ParsePtr p);
|
||||||
int PushToken (char const *tok, ParsePtr p);
|
int PushToken (char const *tok, ParsePtr p);
|
||||||
long SystemTime (int realtime);
|
long SystemTime (int realtime);
|
||||||
|
int MinutesPastMidnight (int realtime);
|
||||||
int SystemDate (int *y, int *m, int *d);
|
int SystemDate (int *y, int *m, int *d);
|
||||||
int DoIf (ParsePtr p);
|
int DoIf (ParsePtr p);
|
||||||
int DoElse (ParsePtr p);
|
int DoElse (ParsePtr p);
|
||||||
|
|||||||
71
src/queue.c
71
src/queue.c
@@ -27,6 +27,7 @@
|
|||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
@@ -79,7 +80,7 @@ int QueueReminder(ParsePtr p, Trigger *trig,
|
|||||||
trig->noqueue ||
|
trig->noqueue ||
|
||||||
tim->ttime == NO_TIME ||
|
tim->ttime == NO_TIME ||
|
||||||
trig->typ == CAL_TYPE ||
|
trig->typ == CAL_TYPE ||
|
||||||
tim->ttime < SystemTime(0) / 60 ||
|
tim->ttime < MinutesPastMidnight(0) ||
|
||||||
((trig->typ == RUN_TYPE) && RunDisabled)) return OK;
|
((trig->typ == RUN_TYPE) && RunDisabled)) return OK;
|
||||||
|
|
||||||
qelem = NEW(QueuedRem);
|
qelem = NEW(QueuedRem);
|
||||||
@@ -110,6 +111,36 @@ int QueueReminder(ParsePtr p, Trigger *trig,
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
maybe_close(int fd)
|
||||||
|
{
|
||||||
|
int new_fd;
|
||||||
|
/* Don't close descriptors connected to a TTY, except for stdin */
|
||||||
|
if (fd && isatty(fd)) return;
|
||||||
|
|
||||||
|
(void) close(fd);
|
||||||
|
if (fd != STDIN_FILENO) {
|
||||||
|
new_fd = open("/dev/null", O_WRONLY);
|
||||||
|
} else {
|
||||||
|
new_fd = open("/dev/null", O_RDONLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If the open failed... well... not much we can do */
|
||||||
|
if (new_fd < 0) return;
|
||||||
|
|
||||||
|
/* If we got back the same fd as what we just closed, aces! */
|
||||||
|
if (fd == new_fd) return;
|
||||||
|
|
||||||
|
(void) dup2(new_fd, fd);
|
||||||
|
(void) close(new_fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SigContHandler(int d)
|
||||||
|
{
|
||||||
|
UNUSED(d);
|
||||||
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* HandleQueuedReminders */
|
/* HandleQueuedReminders */
|
||||||
@@ -143,9 +174,10 @@ void HandleQueuedReminders(void)
|
|||||||
* processed correctly are RUN commands, provided they mail
|
* processed correctly are RUN commands, provided they mail
|
||||||
* the result back or use their own resource (as a window).
|
* the result back or use their own resource (as a window).
|
||||||
*/
|
*/
|
||||||
if (!DontFork && (!isatty(1) || !isatty(2))) {
|
if (!DontFork) {
|
||||||
close(1);
|
maybe_close(STDIN_FILENO);
|
||||||
close(2);
|
maybe_close(STDOUT_FILENO);
|
||||||
|
maybe_close(STDERR_FILENO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we're a daemon, get the mod time of initial file */
|
/* If we're a daemon, get the mod time of initial file */
|
||||||
@@ -160,7 +192,7 @@ void HandleQueuedReminders(void)
|
|||||||
/* Initialize the queue - initialize all the entries time of issue */
|
/* Initialize the queue - initialize all the entries time of issue */
|
||||||
|
|
||||||
while (q) {
|
while (q) {
|
||||||
q->tt.nexttime = (int) (SystemTime(1)/60 - 1);
|
q->tt.nexttime = MinutesPastMidnight(1) - 1;
|
||||||
q->tt.nexttime = CalculateNextTime(q);
|
q->tt.nexttime = CalculateNextTime(q);
|
||||||
q = q->next;
|
q = q->next;
|
||||||
}
|
}
|
||||||
@@ -169,6 +201,8 @@ void HandleQueuedReminders(void)
|
|||||||
sa.sa_handler = SigIntHandler;
|
sa.sa_handler = SigIntHandler;
|
||||||
sa.sa_flags = 0;
|
sa.sa_flags = 0;
|
||||||
(void) sigaction(SIGINT, &sa, NULL);
|
(void) sigaction(SIGINT, &sa, NULL);
|
||||||
|
sa.sa_handler = SigContHandler;
|
||||||
|
(void) sigaction(SIGCONT, &sa, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sit in a loop, issuing reminders when necessary */
|
/* Sit in a loop, issuing reminders when necessary */
|
||||||
@@ -222,7 +256,7 @@ void HandleQueuedReminders(void)
|
|||||||
if (!Daemon) {
|
if (!Daemon) {
|
||||||
int y, m, d;
|
int y, m, d;
|
||||||
if (RealToday != SystemDate(&y, &m, &d)) {
|
if (RealToday != SystemDate(&y, &m, &d)) {
|
||||||
exit(0);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,10 +278,12 @@ void HandleQueuedReminders(void)
|
|||||||
/* Do NOT trigger the reminder if tt.nexttime is more than a
|
/* Do NOT trigger the reminder if tt.nexttime is more than a
|
||||||
minute in the past. This can happen if the clock is
|
minute in the past. This can happen if the clock is
|
||||||
changed or a laptop awakes from hibernation.
|
changed or a laptop awakes from hibernation.
|
||||||
However, DO trigger if tt.nexttime == tt.ttime so all
|
However, DO trigger if tt.nexttime == tt.ttime and we're
|
||||||
|
within MaxLateTrigger minutes so all
|
||||||
queued reminders are triggered at least once. */
|
queued reminders are triggered at least once. */
|
||||||
if ((SystemTime(1) - (q->tt.nexttime * 60) <= 60) ||
|
if ((SystemTime(1) - (q->tt.nexttime * 60) <= 60) ||
|
||||||
(q->tt.nexttime == q->tt.ttime)) {
|
(q->tt.nexttime == q->tt.ttime &&
|
||||||
|
(MaxLateMinutes == 0 || SystemTime(1) - (q->tt.nexttime * 60) <= 60 * MaxLateMinutes))) {
|
||||||
/* Trigger the reminder */
|
/* Trigger the reminder */
|
||||||
CreateParser(q->text, &p);
|
CreateParser(q->text, &p);
|
||||||
trig.typ = q->typ;
|
trig.typ = q->typ;
|
||||||
@@ -256,7 +292,7 @@ void HandleQueuedReminders(void)
|
|||||||
if (Daemon < 0) {
|
if (Daemon < 0) {
|
||||||
printf("NOTE reminder %s",
|
printf("NOTE reminder %s",
|
||||||
SimpleTime(q->tt.ttime));
|
SimpleTime(q->tt.ttime));
|
||||||
printf("%s", SimpleTime(SystemTime(1)/60));
|
printf("%s", SimpleTime(MinutesPastMidnight(1)));
|
||||||
if (!*DBufValue(&q->tags)) {
|
if (!*DBufValue(&q->tags)) {
|
||||||
printf("*\n");
|
printf("*\n");
|
||||||
} else {
|
} else {
|
||||||
@@ -277,8 +313,17 @@ void HandleQueuedReminders(void)
|
|||||||
|
|
||||||
/* Calculate the next trigger time */
|
/* Calculate the next trigger time */
|
||||||
q->tt.nexttime = CalculateNextTime(q);
|
q->tt.nexttime = CalculateNextTime(q);
|
||||||
|
|
||||||
|
/* If trigger time is way in the past because computer has been
|
||||||
|
suspended or hibernated, remove from queue */
|
||||||
|
if (q->tt.nexttime != NO_TIME) {
|
||||||
|
if (q->tt.ttime < MinutesPastMidnight(1) - MaxLateMinutes &&
|
||||||
|
q->tt.nexttime < MinutesPastMidnight(1) - MaxLateMinutes) {
|
||||||
|
q->tt.nexttime = NO_TIME;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exit(0);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -566,16 +611,16 @@ static void DaemonWait(struct timeval *sleep_tv)
|
|||||||
|
|
||||||
/* If EOF on stdin, exit */
|
/* If EOF on stdin, exit */
|
||||||
if (feof(stdin)) {
|
if (feof(stdin)) {
|
||||||
exit(0);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read a line from stdin and interpret it */
|
/* Read a line from stdin and interpret it */
|
||||||
if (!fgets(cmdLine, sizeof(cmdLine), stdin)) {
|
if (!fgets(cmdLine, sizeof(cmdLine), stdin)) {
|
||||||
exit(0);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(cmdLine, "EXIT\n")) {
|
if (!strcmp(cmdLine, "EXIT\n")) {
|
||||||
exit(0);
|
exit(EXIT_SUCCESS);
|
||||||
} else if (!strcmp(cmdLine, "STATUS\n")) {
|
} else if (!strcmp(cmdLine, "STATUS\n")) {
|
||||||
int nqueued = 0;
|
int nqueued = 0;
|
||||||
QueuedRem *q = QueueHead;
|
QueuedRem *q = QueueHead;
|
||||||
|
|||||||
24
src/rem2ps.c
24
src/rem2ps.c
@@ -186,19 +186,19 @@ JSONToCalEntry(DynamicBuffer *buf)
|
|||||||
val = json_parse(DBufValue(buf), DBufLen(buf));
|
val = json_parse(DBufValue(buf), DBufLen(buf));
|
||||||
if (!val) {
|
if (!val) {
|
||||||
fprintf(stderr, "Unable to parse JSON line `%s'\n", DBufValue(buf));
|
fprintf(stderr, "Unable to parse JSON line `%s'\n", DBufValue(buf));
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val->type != json_object) {
|
if (val->type != json_object) {
|
||||||
fprintf(stderr, "Expecting JSON object; found `%s'\n",
|
fprintf(stderr, "Expecting JSON object; found `%s'\n",
|
||||||
DBufValue(buf));
|
DBufValue(buf));
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
c = NEW(CalEntry);
|
c = NEW(CalEntry);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
fprintf(stderr, "malloc failed - aborting.\n");
|
fprintf(stderr, "malloc failed - aborting.\n");
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
c->next = NULL;
|
c->next = NULL;
|
||||||
c->special = SPECIAL_NORMAL;
|
c->special = SPECIAL_NORMAL;
|
||||||
@@ -221,7 +221,7 @@ JSONToCalEntry(DynamicBuffer *buf)
|
|||||||
c->entry = malloc(strlen(s)+1);
|
c->entry = malloc(strlen(s)+1);
|
||||||
if (!c->entry) {
|
if (!c->entry) {
|
||||||
fprintf(stderr, "malloc failed - aborting.\n");
|
fprintf(stderr, "malloc failed - aborting.\n");
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
strcpy(c->entry, s);
|
strcpy(c->entry, s);
|
||||||
got_body = 1;
|
got_body = 1;
|
||||||
@@ -253,7 +253,7 @@ JSONToCalEntry(DynamicBuffer *buf)
|
|||||||
|
|
||||||
if (!got_body || !got_date) {
|
if (!got_body || !got_date) {
|
||||||
fprintf(stderr, "Could not parse line `%s'\n", DBufValue(buf));
|
fprintf(stderr, "Could not parse line `%s'\n", DBufValue(buf));
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
@@ -272,7 +272,7 @@ TextToCalEntry(DynamicBuffer *buf)
|
|||||||
CalEntry *c = NEW(CalEntry);
|
CalEntry *c = NEW(CalEntry);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
fprintf(stderr, "malloc failed - aborting.\n");
|
fprintf(stderr, "malloc failed - aborting.\n");
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
c->next = NULL;
|
c->next = NULL;
|
||||||
c->special = SPECIAL_NORMAL;
|
c->special = SPECIAL_NORMAL;
|
||||||
@@ -296,7 +296,7 @@ TextToCalEntry(DynamicBuffer *buf)
|
|||||||
c->entry = malloc(strlen(startOfBody) + 1);
|
c->entry = malloc(strlen(startOfBody) + 1);
|
||||||
if (!c->entry) {
|
if (!c->entry) {
|
||||||
fprintf(stderr, "malloc failed - aborting.\n");
|
fprintf(stderr, "malloc failed - aborting.\n");
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
strcpy(c->entry, startOfBody);
|
strcpy(c->entry, startOfBody);
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ int main(int argc, char *argv[])
|
|||||||
DBufGets(&buf, stdin);
|
DBufGets(&buf, stdin);
|
||||||
if (first_line && (!strcmp(DBufValue(&buf), "["))) {
|
if (first_line && (!strcmp(DBufValue(&buf), "["))) {
|
||||||
fprintf(stderr, "Rem2PS: It appears that you have invoked Remind with the -ppp option.\n Please use either -p or -pp, but not -ppp.\n");
|
fprintf(stderr, "Rem2PS: It appears that you have invoked Remind with the -ppp option.\n Please use either -p or -pp, but not -ppp.\n");
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
first_line = 0;
|
first_line = 0;
|
||||||
if (!strcmp(DBufValue(&buf), PSBEGIN) ||
|
if (!strcmp(DBufValue(&buf), PSBEGIN) ||
|
||||||
@@ -361,7 +361,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!validfile) {
|
if (!validfile) {
|
||||||
fprintf(stderr, "Rem2PS: Couldn't find any calendar data - are you\n");
|
fprintf(stderr, "Rem2PS: Couldn't find any calendar data - are you\n");
|
||||||
fprintf(stderr, " sure you fed me input produced by remind -p ...?\n");
|
fprintf(stderr, " sure you fed me input produced by remind -p ...?\n");
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
printf("%%%%Trailer\n");
|
printf("%%%%Trailer\n");
|
||||||
printf("%%%%Pages: %d\n", validfile);
|
printf("%%%%Pages: %d\n", validfile);
|
||||||
@@ -486,7 +486,7 @@ void DoPsCal(void)
|
|||||||
while(1) {
|
while(1) {
|
||||||
if (feof(stdin)) {
|
if (feof(stdin)) {
|
||||||
fprintf(stderr, "Input from REMIND is corrupt!\n");
|
fprintf(stderr, "Input from REMIND is corrupt!\n");
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DBufGets(&buf, stdin);
|
DBufGets(&buf, stdin);
|
||||||
@@ -952,7 +952,7 @@ void Init(int argc, char *argv[])
|
|||||||
fprintf(stderr, " WxHin Specify size in inches (W and H are decimal numbers)\n");
|
fprintf(stderr, " WxHin Specify size in inches (W and H are decimal numbers)\n");
|
||||||
fprintf(stderr, " WxHcm Specify size in centimetres (W and H are decimal numbers)\n");
|
fprintf(stderr, " WxHcm Specify size in centimetres (W and H are decimal numbers)\n");
|
||||||
fprintf(stderr, "Default media type is %s\n", DefaultPage[0].name);
|
fprintf(stderr, "Default media type is %s\n", DefaultPage[0].name);
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -1033,7 +1033,7 @@ void Usage(char const *s)
|
|||||||
fprintf(stderr, "-e Make calendar fill entire page\n");
|
fprintf(stderr, "-e Make calendar fill entire page\n");
|
||||||
fprintf(stderr, "-x Put day numbers on left instead of right\n");
|
fprintf(stderr, "-x Put day numbers on left instead of right\n");
|
||||||
fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins\n");
|
fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins\n");
|
||||||
exit(1);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -792,7 +792,7 @@ static SysVar SysVarArr[] = {
|
|||||||
{"DefaultColor", 1, SPECIAL_TYPE, default_color_func, 0, 0 },
|
{"DefaultColor", 1, SPECIAL_TYPE, default_color_func, 0, 0 },
|
||||||
{"DefaultPrio", 1, INT_TYPE, &DefaultPrio, 0, 9999 },
|
{"DefaultPrio", 1, INT_TYPE, &DefaultPrio, 0, 9999 },
|
||||||
{"DefaultTDelta", 1, INT_TYPE, &DefaultTDelta, 0, 1440 },
|
{"DefaultTDelta", 1, INT_TYPE, &DefaultTDelta, 0, 1440 },
|
||||||
{"DeltaOffset", 0, INT_TYPE, &DeltaOffset, 0, 0 },
|
{"DeltaOverride", 0, INT_TYPE, &DeltaOverride, 0, 0 },
|
||||||
{"DontFork", 0, INT_TYPE, &DontFork, 0, 0 },
|
{"DontFork", 0, INT_TYPE, &DontFork, 0, 0 },
|
||||||
{"DontQueue", 0, INT_TYPE, &DontQueue, 0, 0 },
|
{"DontQueue", 0, INT_TYPE, &DontQueue, 0, 0 },
|
||||||
{"DontTrigAts", 0, INT_TYPE, &DontIssueAts, 0, 0 },
|
{"DontTrigAts", 0, INT_TYPE, &DontIssueAts, 0, 0 },
|
||||||
@@ -825,6 +825,7 @@ static SysVar SysVarArr[] = {
|
|||||||
{"LongMin", 1, SPECIAL_TYPE, longmin_func, 0, 0 },
|
{"LongMin", 1, SPECIAL_TYPE, longmin_func, 0, 0 },
|
||||||
{"LongSec", 1, SPECIAL_TYPE, longsec_func, 0, 0 },
|
{"LongSec", 1, SPECIAL_TYPE, longsec_func, 0, 0 },
|
||||||
{"March", 1, STR_TYPE, &DynamicMonthName[2], 0, 0 },
|
{"March", 1, STR_TYPE, &DynamicMonthName[2], 0, 0 },
|
||||||
|
{"MaxLateMinutes", 1, INT_TYPE, &MaxLateMinutes, 0, 1440 },
|
||||||
{"MaxSatIter", 1, INT_TYPE, &MaxSatIter, 10, ANY },
|
{"MaxSatIter", 1, INT_TYPE, &MaxSatIter, 10, ANY },
|
||||||
{"MaxStringLen", 1, INT_TYPE, &MaxStringLen, -1, ANY },
|
{"MaxStringLen", 1, INT_TYPE, &MaxStringLen, -1, ANY },
|
||||||
{"May", 1, STR_TYPE, &DynamicMonthName[4], 0, 0 },
|
{"May", 1, STR_TYPE, &DynamicMonthName[4], 0, 0 },
|
||||||
@@ -839,6 +840,7 @@ static SysVar SysVarArr[] = {
|
|||||||
{"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
|
{"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
|
||||||
{"October", 1, STR_TYPE, &DynamicMonthName[9], 0, 0 },
|
{"October", 1, STR_TYPE, &DynamicMonthName[9], 0, 0 },
|
||||||
{"On", 1, STR_TYPE, &DynamicOn, 0, 0 },
|
{"On", 1, STR_TYPE, &DynamicOn, 0, 0 },
|
||||||
|
{"ParseUntriggered", 1, INT_TYPE, &ParseUntriggered, 0, 1 },
|
||||||
{"Pm", 1, STR_TYPE, &DynamicPm, 0, 0 },
|
{"Pm", 1, STR_TYPE, &DynamicPm, 0, 0 },
|
||||||
{"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0 },
|
{"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0 },
|
||||||
{"PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
|
{"PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
|
||||||
|
|||||||
@@ -408,6 +408,18 @@ TZ=Europe/Berlin ../src/remind -dxe ../tests/tz.rem >> ../tests/test.out 2>&1
|
|||||||
# Test that banner is printed on every iteration
|
# Test that banner is printed on every iteration
|
||||||
echo "MSG Should be three banners." | ../src/remind - 2022-10-20 '*3' >> ../tests/test.out 2>&1
|
echo "MSG Should be three banners." | ../src/remind - 2022-10-20 '*3' >> ../tests/test.out 2>&1
|
||||||
|
|
||||||
|
# Test the -tn option
|
||||||
|
echo "REM May 23 +10 MSG Orange %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 +10 MSG Quux %b" | ../src/remind -t1 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 +10 MSG Cabbage %b" | ../src/remind -t2 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 MSG Banana %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 MSG Carrot %b" | ../src/remind -t1 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 23 MSG Apple %b" | ../src/remind -t2 - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
|
||||||
|
# Test the -tz option
|
||||||
|
echo "REM May 22 +10 MSG Foo %b" | ../src/remind - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
echo "REM May 22 +10 MSG Bar %b" | ../src/remind -tz - 2023-05-21 >> ../tests/test.out 2>&1
|
||||||
|
|
||||||
# World-writable file
|
# World-writable file
|
||||||
rm -rf include_dir/ww
|
rm -rf include_dir/ww
|
||||||
touch include_dir/ww
|
touch include_dir/ww
|
||||||
@@ -425,6 +437,9 @@ rm -rf include_dir/ww
|
|||||||
# This segfaulted in 04.02.03
|
# This segfaulted in 04.02.03
|
||||||
../src/remind -h '-imsgprefix(x)="foo"' /dev/null >> ../tests/test.out 2>&1
|
../src/remind -h '-imsgprefix(x)="foo"' /dev/null >> ../tests/test.out 2>&1
|
||||||
|
|
||||||
|
# Test --version long option
|
||||||
|
../src/remind --version >> ../tests/test.out 2>&1
|
||||||
|
|
||||||
# Remove references to SysInclude, which is build-specific
|
# Remove references to SysInclude, which is build-specific
|
||||||
grep -F -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out
|
grep -F -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out
|
||||||
cmp -s ../tests/test.out ../tests/test.cmp
|
cmp -s ../tests/test.out ../tests/test.cmp
|
||||||
|
|||||||
1171
tests/test.cmp
1171
tests/test.cmp
File diff suppressed because it is too large
Load Diff
@@ -482,7 +482,7 @@ msg [$December]%
|
|||||||
msg [$DefaultColor]%
|
msg [$DefaultColor]%
|
||||||
msg [$DefaultPrio]%
|
msg [$DefaultPrio]%
|
||||||
msg [$DefaultTDelta]%
|
msg [$DefaultTDelta]%
|
||||||
msg [$DeltaOffset]%
|
msg [$DeltaOverride]%
|
||||||
msg [$DontFork]%
|
msg [$DontFork]%
|
||||||
msg [$DontQueue]%
|
msg [$DontQueue]%
|
||||||
msg [$DontTrigAts]%
|
msg [$DontTrigAts]%
|
||||||
@@ -881,6 +881,12 @@ set a htmlstriptags("This is <unclosed whut?")
|
|||||||
set a htmlstriptags("this is > whut <b>foo</b>")
|
set a htmlstriptags("this is > whut <b>foo</b>")
|
||||||
set a htmlstriptags("<img src=\"foo\">")
|
set a htmlstriptags("<img src=\"foo\">")
|
||||||
|
|
||||||
|
# $ParseUntriggered
|
||||||
|
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
||||||
|
SET $ParseUntriggered 0
|
||||||
|
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
||||||
|
SET $ParseUntriggered 1
|
||||||
|
|
||||||
# Don't want Remind to queue reminders
|
# Don't want Remind to queue reminders
|
||||||
EXIT
|
EXIT
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,25 @@ REM 12 AUG SPECIAL MOON 0
|
|||||||
# Test nonomitted
|
# Test nonomitted
|
||||||
REM MSG [nonomitted('2007-08-01', today())] NonOmit-1
|
REM MSG [nonomitted('2007-08-01', today())] NonOmit-1
|
||||||
REM MSG [nonomitted('2007-08-01', today(), "Sat", "Sun")] NonOmit-2
|
REM MSG [nonomitted('2007-08-01', today(), "Sat", "Sun")] NonOmit-2
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-30', 7)]
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-29', 7)]
|
||||||
|
REM MSG [nonomitted('2007-08-28', '2007-08-01', 7)]
|
||||||
|
|
||||||
|
PUSH-OMIT-CONTEXT
|
||||||
|
OMIT 2007-08-15
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-30', 7)]
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-29', 7)]
|
||||||
|
REM MSG [nonomitted('2007-08-01', '2007-08-28', 7)]
|
||||||
|
POP-OMIT-CONTEXT
|
||||||
|
|
||||||
|
# Test slide
|
||||||
|
REM MSG [slide('2007-08-03', 4)]
|
||||||
|
REM MSG [slide('2007-08-03', 4, 7)]
|
||||||
|
|
||||||
|
PUSH-OMIT-CONTEXT
|
||||||
|
OMIT 2007-08-17
|
||||||
|
REM MSG [slide('2007-08-03', 4, 7)]
|
||||||
|
POP-OMIT-CONTEXT
|
||||||
|
|
||||||
# Test SPECIAL COLOR with an AT clause
|
# Test SPECIAL COLOR with an AT clause
|
||||||
REM 20 AUG AT 13:45 SPECIAL COLOR 6 7 8 Mooo!
|
REM 20 AUG AT 13:45 SPECIAL COLOR 6 7 8 Mooo!
|
||||||
|
|||||||
Reference in New Issue
Block a user