mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 14:59:20 +02:00
Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d45925758 | ||
|
|
8cadb23f48 | ||
|
|
63211b65c2 | ||
|
|
1be84525b1 | ||
|
|
67ae95a464 | ||
|
|
c03a95ad94 | ||
|
|
51aa7aecb9 | ||
|
|
592cfe5a20 | ||
|
|
b4cf15e73e | ||
|
|
862e143372 | ||
|
|
1f10ca49ad | ||
|
|
4a0c4ffdca | ||
|
|
27c8737f3a | ||
|
|
ecf45fc453 | ||
|
|
0a1178cfd7 | ||
|
|
20a35dc627 | ||
|
|
79887c06f0 | ||
|
|
f7ff424904 | ||
|
|
6678721fe3 | ||
|
|
496302097b | ||
|
|
fe3e2b9a20 | ||
|
|
400a6b066f | ||
|
|
76d181e7fc | ||
|
|
77373eed2d | ||
|
|
6b52be388f | ||
|
|
0518a12a91 | ||
|
|
362a02c4b8 | ||
|
|
3e3a0cde47 | ||
|
|
c16f93effd | ||
|
|
61b27c02b5 | ||
|
|
ba28eaad53 | ||
|
|
92c2d0cc9f | ||
|
|
21d5e8a095 | ||
|
|
60417d68a7 | ||
|
|
7d25387403 | ||
|
|
b454cf5b20 | ||
|
|
9ea6385b72 | ||
|
|
55b7908444 | ||
|
|
e9ff66478b | ||
|
|
d3240d711d | ||
|
|
a8d63a4199 | ||
|
|
a4807a21c3 | ||
|
|
a394ef53a0 | ||
|
|
eb8243743a | ||
|
|
8444bb15c5 |
@@ -1,30 +0,0 @@
|
|||||||
MICROSOFT WINDOWS
|
|
||||||
=================
|
|
||||||
|
|
||||||
I used to prohibit porting Remind to Microsoft Windows. However, this
|
|
||||||
may cause problems with the GPL, so I have removed that restriction.
|
|
||||||
|
|
||||||
Although I cannot prevent you from porting Remind to Windows, I appeal
|
|
||||||
to you not to do it. I am trying to encourage the growth of free
|
|
||||||
software, not proprietary software.
|
|
||||||
|
|
||||||
If you port Remind to Windows, I will not provide support or answers to
|
|
||||||
questions -- you're on your own. On the other hand, I will feel no guilt
|
|
||||||
in taking enhancements and merging them into the UNIX stream.
|
|
||||||
|
|
||||||
APPLE
|
|
||||||
=====
|
|
||||||
|
|
||||||
I can't prevent you from using Remind on Apple's products, but I hope
|
|
||||||
you don't. Apple's corporate culture is the very antithesis of Free
|
|
||||||
Software. Rather than using Mac OS X, I encourage you to switch to
|
|
||||||
Linux or FreeBSD, two Free Software operating systems that are every
|
|
||||||
bit as capable as Mac OS X and which are unencumbered by Apple's
|
|
||||||
arbitrary restrictions.
|
|
||||||
|
|
||||||
And if you're looking to port Remind to other Apple products like the
|
|
||||||
iPhone or iPad, please don't. Those products enforce Apple's rigorous
|
|
||||||
controls much more stringently than Mac OS X on an Apple PC.
|
|
||||||
|
|
||||||
--
|
|
||||||
Dianne Skoll
|
|
||||||
28
build.tk
28
build.tk
@@ -15,6 +15,8 @@
|
|||||||
# the next line restarts using wish \
|
# the next line restarts using wish \
|
||||||
exec wish "$0" "$@"
|
exec wish "$0" "$@"
|
||||||
|
|
||||||
|
global RemindExecutable
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
# %PROCEDURE: SetConfigDefaults
|
# %PROCEDURE: SetConfigDefaults
|
||||||
# %ARGUMENTS:
|
# %ARGUMENTS:
|
||||||
@@ -40,7 +42,7 @@ proc SetConfigDefaults {} {
|
|||||||
set Config(WESTERN_HEMISPHERE) 1
|
set Config(WESTERN_HEMISPHERE) 1
|
||||||
set Config(LANGUAGE) "English"
|
set Config(LANGUAGE) "English"
|
||||||
set Config(INST_DIR) "/usr/local/bin"
|
set Config(INST_DIR) "/usr/local/bin"
|
||||||
set Config(MAN_DIR) "/usr/local/man"
|
set Config(MAN_DIR) "/usr/local/share/man"
|
||||||
}
|
}
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
@@ -124,7 +126,7 @@ proc CreateMainDialog {} {
|
|||||||
# Creates the "installation directories" dialog.
|
# Creates the "installation directories" dialog.
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc CreateInstallDirDialog { w } {
|
proc CreateInstallDirDialog { w } {
|
||||||
global Config
|
global Config RemindExecutable
|
||||||
label $w.binlabel -text "Location for programs: "
|
label $w.binlabel -text "Location for programs: "
|
||||||
entry $w.bin -width 30
|
entry $w.bin -width 30
|
||||||
$w.bin insert end $Config(INST_DIR)
|
$w.bin insert end $Config(INST_DIR)
|
||||||
@@ -133,16 +135,19 @@ proc CreateInstallDirDialog { w } {
|
|||||||
entry $w.man -width 30
|
entry $w.man -width 30
|
||||||
$w.man insert end $Config(MAN_DIR)
|
$w.man insert end $Config(MAN_DIR)
|
||||||
|
|
||||||
text $w.blurb -width 1 -height 5 -wrap word -relief flat -takefocus 0
|
text $w.blurb -width 1 -height 20 -wrap word -relief flat -takefocus 0
|
||||||
$w.blurb insert end "\n(Tabbed-notebook Tcl code taken from \"Effective Tcl/Tk Programming\" by Mark Harrison and Michael McLennan, Addison-Wesley Professional Computing Series.)"
|
if { "$RemindExecutable" != "" } {
|
||||||
$w.blurb configure -state disabled
|
$w.blurb insert end "Note: Default settings were obtained by querying the existing installed version of Remind found at: $RemindExecutable\n"
|
||||||
# Disable all text-window behaviour
|
}
|
||||||
bindtags $w.blurb {NoSuchTag}
|
$w.blurb insert end "\n(Tabbed-notebook Tcl code taken from \"Effective Tcl/Tk Programming\" by Mark Harrison and Michael McLennan, Addison-Wesley Professional Computing Series.)\n"
|
||||||
grid $w.binlabel -row 0 -column 0 -sticky e
|
grid $w.binlabel -row 0 -column 0 -sticky e
|
||||||
grid $w.bin -row 0 -column 1 -sticky nsew
|
grid $w.bin -row 0 -column 1 -sticky nsew
|
||||||
grid $w.manlabel -row 1 -column 0 -sticky e
|
grid $w.manlabel -row 1 -column 0 -sticky e
|
||||||
grid $w.man -row 1 -column 1 -sticky nsew
|
grid $w.man -row 1 -column 1 -sticky nsew
|
||||||
grid $w.blurb - -sticky nsew
|
grid $w.blurb - -sticky nsew
|
||||||
|
# Disable all text-window behaviour
|
||||||
|
bindtags $w.blurb {NoSuchTag}
|
||||||
|
$w.blurb configure -state disabled
|
||||||
}
|
}
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
@@ -727,7 +732,7 @@ proc notebook_fix_size {win} {
|
|||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc FindRemind {} {
|
proc FindRemind {} {
|
||||||
global env
|
global env
|
||||||
set path [concat [split $env(PATH) ":"] "/bin" "/usr/bin" "/usr/local/bin"]
|
set path [concat [split $env(PATH) ":"] "/usr/local/bin" "/bin" "/usr/bin" ]
|
||||||
foreach thing $path {
|
foreach thing $path {
|
||||||
if [file executable [file join $thing "remind"]] {
|
if [file executable [file join $thing "remind"]] {
|
||||||
return [file join $thing "remind"]
|
return [file join $thing "remind"]
|
||||||
@@ -745,16 +750,17 @@ proc FindRemind {} {
|
|||||||
# sensible defaults.
|
# sensible defaults.
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc SetConfigFromRemind {} {
|
proc SetConfigFromRemind {} {
|
||||||
global Config
|
global Config RemindExecutable
|
||||||
SetConfigDefaults
|
SetConfigDefaults
|
||||||
set rem [FindRemind]
|
set rem [FindRemind]
|
||||||
|
set RemindExecutable $rem
|
||||||
if {"$rem" == ""} {
|
if {"$rem" == ""} {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
set dir [file dirname $rem]
|
set dir [file dirname $rem]
|
||||||
set Config(INST_DIR) $dir
|
set Config(INST_DIR) $dir
|
||||||
if {"$dir" == "/usr/local/bin"} {
|
if {"$dir" == "/usr/local/bin"} {
|
||||||
set Config(MAN_DIR) "/usr/local/man"
|
set Config(MAN_DIR) "/usr/local/share/man"
|
||||||
} elseif {$dir == "/usr/bin"} {
|
} elseif {$dir == "/usr/bin"} {
|
||||||
set Config(MAN_DIR) "/usr/share/man"
|
set Config(MAN_DIR) "/usr/share/man"
|
||||||
}
|
}
|
||||||
@@ -764,6 +770,8 @@ proc SetConfigFromRemind {} {
|
|||||||
set Config(MAN_DIR) "/usr/share/man"
|
set Config(MAN_DIR) "/usr/share/man"
|
||||||
} elseif {[file readable "/usr/man/man1/remind.1"]} {
|
} elseif {[file readable "/usr/man/man1/remind.1"]} {
|
||||||
set Config(MAN_DIR) "/usr/man"
|
set Config(MAN_DIR) "/usr/man"
|
||||||
|
} elseif {[file readable "/usr/local/share/man/man1/remind.1"]} {
|
||||||
|
set Config(MAN_DIR) "/usr/local/share/man"
|
||||||
} elseif {[file readable "/usr/local/man/man1/remind.1"]} {
|
} elseif {[file readable "/usr/local/man/man1/remind.1"]} {
|
||||||
set Config(MAN_DIR) "/usr/local/man"
|
set Config(MAN_DIR) "/usr/local/man"
|
||||||
}
|
}
|
||||||
|
|||||||
115
configure
vendored
115
configure
vendored
@@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.71.
|
# Generated by GNU Autoconf 2.71 for remind 04.03.07.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
|
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
|
||||||
@@ -606,12 +606,12 @@ MFLAGS=
|
|||||||
MAKEFLAGS=
|
MAKEFLAGS=
|
||||||
|
|
||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME=''
|
PACKAGE_NAME='remind'
|
||||||
PACKAGE_TARNAME=''
|
PACKAGE_TARNAME='remind'
|
||||||
PACKAGE_VERSION=''
|
PACKAGE_VERSION='04.03.07'
|
||||||
PACKAGE_STRING=''
|
PACKAGE_STRING='remind 04.03.07'
|
||||||
PACKAGE_BUGREPORT=''
|
PACKAGE_BUGREPORT=''
|
||||||
PACKAGE_URL=''
|
PACKAGE_URL='https://dianne.skoll.ca/projects/remind/'
|
||||||
|
|
||||||
ac_unique_file="src/queue.c"
|
ac_unique_file="src/queue.c"
|
||||||
# Factoring default headers for most tests.
|
# Factoring default headers for most tests.
|
||||||
@@ -757,7 +757,7 @@ localstatedir='${prefix}/var'
|
|||||||
runstatedir='${localstatedir}/run'
|
runstatedir='${localstatedir}/run'
|
||||||
includedir='${prefix}/include'
|
includedir='${prefix}/include'
|
||||||
oldincludedir='/usr/include'
|
oldincludedir='/usr/include'
|
||||||
docdir='${datarootdir}/doc/${PACKAGE}'
|
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||||
infodir='${datarootdir}/info'
|
infodir='${datarootdir}/info'
|
||||||
htmldir='${docdir}'
|
htmldir='${docdir}'
|
||||||
dvidir='${docdir}'
|
dvidir='${docdir}'
|
||||||
@@ -1264,7 +1264,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures this package to adapt to many kinds of systems.
|
\`configure' configures remind 04.03.07 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@@ -1313,7 +1313,7 @@ Fine tuning of the installation directories:
|
|||||||
--infodir=DIR info documentation [DATAROOTDIR/info]
|
--infodir=DIR info documentation [DATAROOTDIR/info]
|
||||||
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
|
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
|
||||||
--mandir=DIR man documentation [DATAROOTDIR/man]
|
--mandir=DIR man documentation [DATAROOTDIR/man]
|
||||||
--docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
|
--docdir=DIR documentation root [DATAROOTDIR/doc/remind]
|
||||||
--htmldir=DIR html documentation [DOCDIR]
|
--htmldir=DIR html documentation [DOCDIR]
|
||||||
--dvidir=DIR dvi documentation [DOCDIR]
|
--dvidir=DIR dvi documentation [DOCDIR]
|
||||||
--pdfdir=DIR pdf documentation [DOCDIR]
|
--pdfdir=DIR pdf documentation [DOCDIR]
|
||||||
@@ -1325,7 +1325,9 @@ _ACEOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
|
case $ac_init_help in
|
||||||
|
short | recursive ) echo "Configuration of remind 04.03.07:";;
|
||||||
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
Optional Features:
|
Optional Features:
|
||||||
@@ -1348,6 +1350,7 @@ Use these variables to override the choices made by `configure' or to help
|
|||||||
it to find libraries and programs with nonstandard names/locations.
|
it to find libraries and programs with nonstandard names/locations.
|
||||||
|
|
||||||
Report bugs to the package provider.
|
Report bugs to the package provider.
|
||||||
|
remind home page: <https://dianne.skoll.ca/projects/remind/>.
|
||||||
_ACEOF
|
_ACEOF
|
||||||
ac_status=$?
|
ac_status=$?
|
||||||
fi
|
fi
|
||||||
@@ -1411,7 +1414,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
configure
|
remind configure 04.03.07
|
||||||
generated by GNU Autoconf 2.71
|
generated by GNU Autoconf 2.71
|
||||||
|
|
||||||
Copyright (C) 2021 Free Software Foundation, Inc.
|
Copyright (C) 2021 Free Software Foundation, Inc.
|
||||||
@@ -1861,7 +1864,7 @@ cat >config.log <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by $as_me, which was
|
It was created by remind $as_me 04.03.07, which was
|
||||||
generated by GNU Autoconf 2.71. Invocation command line was
|
generated by GNU Autoconf 2.71. Invocation command line was
|
||||||
|
|
||||||
$ $0$ac_configure_args_raw
|
$ $0$ac_configure_args_raw
|
||||||
@@ -2450,7 +2453,6 @@ as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
|
|||||||
as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
|
as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
|
||||||
as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
|
as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
|
||||||
as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H"
|
as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H"
|
||||||
as_fn_append ac_header_c_list " utime.h utime_h HAVE_UTIME_H"
|
|
||||||
|
|
||||||
# Auxiliary files required by this configure script.
|
# Auxiliary files required by this configure script.
|
||||||
ac_aux_files="install-sh"
|
ac_aux_files="install-sh"
|
||||||
@@ -4004,6 +4006,12 @@ printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default"
|
||||||
|
if test "x$ac_cv_header_strings_h" = xyes
|
||||||
|
then :
|
||||||
|
printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h
|
||||||
|
|
||||||
|
fi
|
||||||
ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default"
|
ac_fn_c_check_header_compile "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default"
|
||||||
if test "x$ac_cv_header_sys_types_h" = xyes
|
if test "x$ac_cv_header_sys_types_h" = xyes
|
||||||
then :
|
then :
|
||||||
@@ -4080,60 +4088,6 @@ printf "%s\n" "#define TM_IN_SYS_TIME 1" >>confdefs.h
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether utime accepts a null argument" >&5
|
|
||||||
printf %s "checking whether utime accepts a null argument... " >&6; }
|
|
||||||
if test ${ac_cv_func_utime_null+y}
|
|
||||||
then :
|
|
||||||
printf %s "(cached) " >&6
|
|
||||||
else $as_nop
|
|
||||||
rm -f conftest.data; >conftest.data
|
|
||||||
# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong.
|
|
||||||
if test "$cross_compiling" = yes
|
|
||||||
then :
|
|
||||||
ac_cv_func_utime_null='guessing yes'
|
|
||||||
else $as_nop
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
/* end confdefs.h. */
|
|
||||||
$ac_includes_default
|
|
||||||
#ifdef HAVE_UTIME_H
|
|
||||||
# include <utime.h>
|
|
||||||
#endif
|
|
||||||
int
|
|
||||||
main (void)
|
|
||||||
{
|
|
||||||
struct stat s, t;
|
|
||||||
return ! (stat ("conftest.data", &s) == 0
|
|
||||||
&& utime ("conftest.data", 0) == 0
|
|
||||||
&& stat ("conftest.data", &t) == 0
|
|
||||||
&& t.st_mtime >= s.st_mtime
|
|
||||||
&& t.st_mtime - s.st_mtime < 120);
|
|
||||||
;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
_ACEOF
|
|
||||||
if ac_fn_c_try_run "$LINENO"
|
|
||||||
then :
|
|
||||||
ac_cv_func_utime_null=yes
|
|
||||||
else $as_nop
|
|
||||||
ac_cv_func_utime_null=no
|
|
||||||
fi
|
|
||||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
|
||||||
conftest.$ac_objext conftest.beam conftest.$ac_ext
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_utime_null" >&5
|
|
||||||
printf "%s\n" "$ac_cv_func_utime_null" >&6; }
|
|
||||||
if test "x$ac_cv_func_utime_null" != xno; then
|
|
||||||
ac_cv_func_utime_null=yes
|
|
||||||
|
|
||||||
printf "%s\n" "#define HAVE_UTIME_NULL 1" >>confdefs.h
|
|
||||||
|
|
||||||
fi
|
|
||||||
rm -f conftest.data
|
|
||||||
|
|
||||||
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
|
||||||
@@ -4181,6 +4135,24 @@ if test "$?" != 0 ; then
|
|||||||
echo "*** COULD NOT DETERMINE RELEASE DATE: docs/WHATSNEW is incorrect!"
|
echo "*** COULD NOT DETERMINE RELEASE DATE: docs/WHATSNEW is incorrect!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup"
|
||||||
|
if test "x$ac_cv_func_strdup" = xyes
|
||||||
|
then :
|
||||||
|
printf "%s\n" "#define HAVE_STRDUP 1" >>confdefs.h
|
||||||
|
|
||||||
|
fi
|
||||||
|
ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
|
||||||
|
if test "x$ac_cv_func_strcasecmp" = xyes
|
||||||
|
then :
|
||||||
|
printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h
|
||||||
|
|
||||||
|
fi
|
||||||
|
ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp"
|
||||||
|
if test "x$ac_cv_func_strncasecmp" = xyes
|
||||||
|
then :
|
||||||
|
printf "%s\n" "#define HAVE_STRNCASECMP 1" >>confdefs.h
|
||||||
|
|
||||||
|
fi
|
||||||
ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv"
|
ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv"
|
||||||
if test "x$ac_cv_func_setenv" = xyes
|
if test "x$ac_cv_func_setenv" = xyes
|
||||||
then :
|
then :
|
||||||
@@ -4225,7 +4197,7 @@ then :
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
VERSION=04.03.04
|
VERSION=$PACKAGE_VERSION
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -4731,7 +4703,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
|||||||
# report actual input values of CONFIG_FILES etc. instead of their
|
# report actual input values of CONFIG_FILES etc. instead of their
|
||||||
# values after options handling.
|
# values after options handling.
|
||||||
ac_log="
|
ac_log="
|
||||||
This file was extended by $as_me, which was
|
This file was extended by remind $as_me 04.03.07, which was
|
||||||
generated by GNU Autoconf 2.71. Invocation command line was
|
generated by GNU Autoconf 2.71. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@@ -4787,7 +4759,8 @@ $config_files
|
|||||||
Configuration headers:
|
Configuration headers:
|
||||||
$config_headers
|
$config_headers
|
||||||
|
|
||||||
Report bugs to the package provider."
|
Report bugs to the package provider.
|
||||||
|
remind home page: <https://dianne.skoll.ca/projects/remind/>."
|
||||||
|
|
||||||
_ACEOF
|
_ACEOF
|
||||||
ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
|
ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
|
||||||
@@ -4795,7 +4768,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
|
|||||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||||
ac_cs_config='$ac_cs_config_escaped'
|
ac_cs_config='$ac_cs_config_escaped'
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
config.status
|
remind config.status 04.03.07
|
||||||
configured by $0, generated by GNU Autoconf 2.71,
|
configured by $0, generated by GNU Autoconf 2.71,
|
||||||
with options \\"\$ac_cs_config\\"
|
with options \\"\$ac_cs_config\\"
|
||||||
|
|
||||||
|
|||||||
12
configure.in
12
configure.in
@@ -1,6 +1,6 @@
|
|||||||
dnl Process this file with autoconf to produce a configure script.
|
dnl Process this file with autoconf to produce a configure script.
|
||||||
|
|
||||||
AC_INIT
|
AC_INIT(remind, 04.03.07, , , https://dianne.skoll.ca/projects/remind/)
|
||||||
AC_CONFIG_SRCDIR([src/queue.c])
|
AC_CONFIG_SRCDIR([src/queue.c])
|
||||||
|
|
||||||
cat <<'EOF'
|
cat <<'EOF'
|
||||||
@@ -30,7 +30,7 @@ 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])
|
AC_CHECK_HEADERS_ONCE([sys/time.h stdint.h])
|
||||||
|
|
||||||
dnl Integer sizes
|
dnl Integer sizes
|
||||||
AC_CHECK_SIZEOF(unsigned int)
|
AC_CHECK_SIZEOF(unsigned int)
|
||||||
@@ -38,13 +38,11 @@ AC_CHECK_SIZEOF(unsigned long)
|
|||||||
AC_CHECK_SIZEOF(time_t)
|
AC_CHECK_SIZEOF(time_t)
|
||||||
|
|
||||||
dnl Checks for header files.
|
dnl Checks for header files.
|
||||||
AC_CHECK_HEADERS(sys/types.h glob.h wctype.h locale.h langinfo.h sys/inotify.h)
|
AC_CHECK_HEADERS(strings.h sys/types.h glob.h wctype.h locale.h langinfo.h sys/inotify.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.
|
|
||||||
AC_FUNC_UTIME_NULL
|
|
||||||
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
|
||||||
@@ -86,9 +84,9 @@ if test "$?" != 0 ; then
|
|||||||
echo "*** COULD NOT DETERMINE RELEASE DATE: docs/WHATSNEW is incorrect!"
|
echo "*** COULD NOT DETERMINE RELEASE DATE: docs/WHATSNEW is incorrect!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups inotify_init1)
|
AC_CHECK_FUNCS(strdup strcasecmp strncasecmp setenv unsetenv glob mbstowcs setlocale initgroups inotify_init1)
|
||||||
|
|
||||||
VERSION=04.03.04
|
VERSION=$PACKAGE_VERSION
|
||||||
AC_SUBST(VERSION)
|
AC_SUBST(VERSION)
|
||||||
AC_SUBST(PERL)
|
AC_SUBST(PERL)
|
||||||
AC_SUBST(PERLARTIFACTS)
|
AC_SUBST(PERLARTIFACTS)
|
||||||
|
|||||||
@@ -1,5 +1,62 @@
|
|||||||
CHANGES TO REMIND
|
CHANGES TO REMIND
|
||||||
|
|
||||||
|
* VERSION 4.3 Patch 7 - 2024-04-29
|
||||||
|
|
||||||
|
* IMPROVEMENT: build.tk: Add a note if build.tk obtains default settings
|
||||||
|
from an existing Remind installation.
|
||||||
|
|
||||||
|
* IMPROVEMENT: configure: Pass all args to AC_INIT including the Remind
|
||||||
|
home page. Remove some unused autoconf cruft.
|
||||||
|
|
||||||
|
* IMPROVEMENT: Use standard C library versions of strdup, strcasemp and
|
||||||
|
strncasecmp where available, rather than using our own versions.
|
||||||
|
|
||||||
|
* MINOR FEATURE: remind: Make $Tt a synonym for trigtime().
|
||||||
|
|
||||||
|
* BUG FIX: remind: Make sure shellescape() doesn't mangle UTF-8 characters
|
||||||
|
with high-bits set.
|
||||||
|
|
||||||
|
* BUG FIX: remind: Don't rely on undefined behavior of "%" operator in
|
||||||
|
the ord() built-in function.
|
||||||
|
|
||||||
|
* BUG FIX: remind: Do not clear out trigtime() unnecessarily. Before,
|
||||||
|
you could not write things like the following; now you can:
|
||||||
|
|
||||||
|
REM Tue AT 11:30 DURATION 0:30 MSG Thing 1
|
||||||
|
REM Tue AT [trigtime()+trigduration()] DURATION 1:00 MSG Thing 2
|
||||||
|
REM Tue AT [trigtime()+trigduration()] DURATION 0:45 MSG Thing 3
|
||||||
|
|
||||||
|
for successive reminders that should be moved as a block if the time of
|
||||||
|
the first one changes.
|
||||||
|
|
||||||
|
* BUG FIX: Don't update trigdate() or trigtime() while parsing a REM
|
||||||
|
statement... only when actually computing the trigger.
|
||||||
|
|
||||||
|
* VERSION 4.3 Patch 6 - 2024-04-02
|
||||||
|
|
||||||
|
* NEW FILE: Add [$SysInclude]/holidays/pt.rem - Portuguese holidays, courtesy
|
||||||
|
of Joop Kiefte.
|
||||||
|
|
||||||
|
* BUG FIX: remind: Fix compile error on systems that don't support inotify(7).
|
||||||
|
|
||||||
|
* BUG FIX: remind: Fix test failures on FreeBSD. On FreeBSD, you have to copy
|
||||||
|
the result of getenv() or else a subsequent setenv() can change the stored
|
||||||
|
value.
|
||||||
|
|
||||||
|
* VERSION 4.3 Patch 5 - 2024-04-01
|
||||||
|
|
||||||
|
* IMPROVEMENT: remind: Use inotify to detect reminder file changes
|
||||||
|
even in regular daemon mode (-zn where n>0).
|
||||||
|
|
||||||
|
* INTERNAL IMPROVEMENTS: Rearrange and refactor some code.
|
||||||
|
|
||||||
|
* FIXES: Various fixes and improvements to man pages.
|
||||||
|
|
||||||
|
* BUG FIX: remind: Handle queued "SPECIAL COLOR" reminders correctly.
|
||||||
|
|
||||||
|
* BUG FIX: remind: Preserve the value of $DefaultColor that was in effect
|
||||||
|
when a reminder was queued; restore it before issuing the queued reminder.
|
||||||
|
|
||||||
* VERSION 4.3 Patch 4 - 2024-03-25
|
* VERSION 4.3 Patch 4 - 2024-03-25
|
||||||
|
|
||||||
* NEW FEATURE: remind: Add the new "multitrig" function, which is how "trig"
|
* NEW FEATURE: remind: Add the new "multitrig" function, which is how "trig"
|
||||||
|
|||||||
17
include/holidays/pt.rem
Normal file
17
include/holidays/pt.rem
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Portuguese holidays
|
||||||
|
# Courtesy of Joop Kiefte
|
||||||
|
|
||||||
|
OMIT 1 Jan MSG Ano Novo
|
||||||
|
OMIT [easterdate()-47] MSG Carnaval
|
||||||
|
OMIT [easterdate()-2] MSG Sexta-feira Santa
|
||||||
|
OMIT [easterdate()] MSG Domingo de Páscoa
|
||||||
|
OMIT 25 Apr MSG Dia da Liberdade
|
||||||
|
OMIT 1 May MSG Dia do Trabalhador
|
||||||
|
OMIT [easterdate()+60] MSG Corpo de Deus
|
||||||
|
OMIT 10 Jun MSG Dia de Portugal, de Camões e das Comunidades Portuguesas
|
||||||
|
OMIT 15 Aug MSG Assunção de Nossa Senhora
|
||||||
|
OMIT 5 Oct MSG Implantação da República
|
||||||
|
OMIT 1 Nov MSG Dia de Todos os Santos
|
||||||
|
OMIT 1 Dec MSG Restauração da Independência
|
||||||
|
OMIT 8 Dec MSG Imaculada Conceição
|
||||||
|
OMIT 25 Dec MSG Natal
|
||||||
@@ -366,13 +366,18 @@ You use both \fB\-k\fR\fIcmd1\fR and \fB\-k:\fR\fIcmd2\fR to use different
|
|||||||
commands for queued versus non-queued reminders.
|
commands for queued versus non-queued reminders.
|
||||||
.RE
|
.RE
|
||||||
.TP
|
.TP
|
||||||
\fB\-z\fR[\fIn\fR] Runs \fBRemind\fR in the daemon mode. If \fIn\fR
|
\fB\-z\fR[\fIn\fR] Runs \fBRemind\fR in "daemon mode". If \fIn\fR
|
||||||
is supplied, it specifies how often (in minutes) \fBRemind\fR should
|
is supplied, it specifies how often (in minutes) \fBRemind\fR should
|
||||||
wake up to check if the reminder script has been changed. \fIN\fR
|
wake up to check if the reminder script has been changed. \fIN\fR
|
||||||
defaults to 1, and can range from 1 to 60. Note that the use of the
|
defaults to 1, and can range from 1 to 60. Note that the use of the
|
||||||
\fB\-z\fR option also enables the \fB\-f\fR option.
|
\fB\-z\fR option also enables the \fB\-f\fR option.
|
||||||
.PP
|
.PP
|
||||||
.RS
|
.RS
|
||||||
|
If \fBRemind\fR is compiled on a system that supports
|
||||||
|
\fBinotify\fR(7), then if the reminder script supplied on the
|
||||||
|
command-line is actually a directory, \fBRemind\fR additionally checks
|
||||||
|
if all files within that directory have been modified since startup.
|
||||||
|
.PP
|
||||||
If you supply the option \fB\-zj\fR, \fBRemind\fR runs in a
|
If you supply the option \fB\-zj\fR, \fBRemind\fR runs in a
|
||||||
special mode called \fBserver mode\fR. This is documented
|
special mode called \fBserver mode\fR. This is documented
|
||||||
in the tkremind man page; see tkremind(1). The older server mode
|
in the tkremind man page; see tkremind(1). The older server mode
|
||||||
@@ -454,14 +459,14 @@ text editor capable of creating plain-text files to create a
|
|||||||
very simple and almost immediately understandable:
|
very simple and almost immediately understandable:
|
||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
REM 6 Jan MSG Dianne's birthday
|
REM Mar 31 MSG International Transgender Day of Visibility
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
to the baroque and obscure:
|
to the baroque and obscure:
|
||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
REM [date(thisyear, 1, 1) + 180] ++5 OMIT \\
|
REM [date(thisyear, 1, 1) + 180] ++5 OMIT \\
|
||||||
sat sun BEFORE MSG [ord(thisyear-1980)] payment due %b!
|
sat sun BEFORE MSG [ord(thisyear-1980)] payment due %b!
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
A reminder file consists of commands, with one command per line. Several
|
A reminder file consists of commands, with one command per line. Several
|
||||||
@@ -2394,9 +2399,9 @@ Universal Time Coordinated in the \fB$MinsFromUTC\fR system variable.
|
|||||||
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
|
||||||
.B $Daemon (read-only)
|
.B $Daemon (read-only)
|
||||||
If the daemon mode \fB\-z\fR was invoked, contains the number of
|
If "daemon mode" \fB\-z\fR was invoked, contains the number of
|
||||||
minutes between wakeups. If not running in daemon mode, contains
|
minutes between wakeups. If not running in daemon mode, contains
|
||||||
0.
|
0. In server mode (either \fB-z0\fR or \fB-zj\fR), contains -1.
|
||||||
.TP
|
.TP
|
||||||
.B $DateSep
|
.B $DateSep
|
||||||
This variable can be set only to "/" or "-". It holds the character
|
This variable can be set only to "/" or "-". It holds the character
|
||||||
@@ -2742,6 +2747,9 @@ Equivalent to \fBwkdaynum(trigdate())\fR.
|
|||||||
.B $Ty (read-only)
|
.B $Ty (read-only)
|
||||||
Equivalent to \fByear(trigdate())\fR.
|
Equivalent to \fByear(trigdate())\fR.
|
||||||
.TP
|
.TP
|
||||||
|
.B $Tt (read-only, TIME type)
|
||||||
|
Equivalent to \fBtrigtime()\fR.
|
||||||
|
.TP
|
||||||
.B $TimeSep
|
.B $TimeSep
|
||||||
This variable can be set only to ":" or ".". It holds the character
|
This variable can be set only to ":" or ".". It holds the character
|
||||||
used to separate portions of a time when \fBRemind\fR prints a TIME or
|
used to separate portions of a time when \fBRemind\fR prints a TIME or
|
||||||
@@ -5080,21 +5088,25 @@ structuring comments in your PostScript code.
|
|||||||
.PP
|
.PP
|
||||||
.SH DAEMON MODE
|
.SH DAEMON MODE
|
||||||
.PP
|
.PP
|
||||||
If you use the \fB\-z\fR command-line option, \fBRemind\fR runs in the
|
If you use the \fB\-z\fR command-line option, \fBRemind\fR runs in
|
||||||
"daemon" mode. In this mode, no "normal" reminders are issued.
|
"daemon mode". In this mode, no "normal" reminders are issued.
|
||||||
Instead, only timed reminders are collected and queued, and are then
|
Instead, only timed reminders are collected and queued, and are then
|
||||||
issued whenever they reach their trigger time.
|
issued whenever they reach their trigger time.
|
||||||
.PP
|
.PP
|
||||||
In addition, \fBRemind\fR wakes up every few minutes to check the modification
|
In addition, \fBRemind\fR wakes up every few minutes to check the
|
||||||
date on the reminder script (the filename supplied on the command line.)
|
modification date on the reminder script (the filename supplied on the
|
||||||
If \fBRemind\fR detects that the script has changed, it re-executes itself
|
command line.) If \fBRemind\fR detects that the script has changed,
|
||||||
in daemon mode, and interprets the changed script.
|
it re-executes itself in daemon mode, and interprets the changed
|
||||||
|
script. If \fBRemind\fR was compiled with support for
|
||||||
|
\fBinotify\fR(7), then if the command-line reminder script is really a
|
||||||
|
directory, \fBRemind\fR also re-executes itself if any of the files in
|
||||||
|
the directory is changed.
|
||||||
.PP
|
.PP
|
||||||
In daemon mode, \fBRemind\fR also re-reads the remind script when it
|
In daemon mode, \fBRemind\fR also re-reads the remind script when it
|
||||||
detects that the system date has changed.
|
detects that the system date has changed.
|
||||||
.PP
|
.PP
|
||||||
In daemon mode, \fBRemind\fR acts as if the \fB\-f\fR option had been used,
|
In daemon mode, \fBRemind\fR acts as if the \fB\-f\fR option had been used,
|
||||||
so to run in the daemon mode in the background, use:
|
so to run in daemon mode in the background, use:
|
||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
remind \-z .reminders &
|
remind \-z .reminders &
|
||||||
|
|||||||
@@ -486,7 +486,7 @@ output for the invalid reminder.
|
|||||||
=head1 ABSOLUTELY-POSITIONED TEXT
|
=head1 ABSOLUTELY-POSITIONED TEXT
|
||||||
|
|
||||||
If your B<PANGO> special reminder starts with C<@I<x>,I<y>> where I<x>
|
If your B<PANGO> special reminder starts with C<@I<x>,I<y>> where I<x>
|
||||||
and I<y> are floating-point numbers, then the Pango marked-up test is
|
and I<y> are floating-point numbers, then the Pango marked-up text is
|
||||||
positioned absolutely with respect to the day's box (and is not
|
positioned absolutely with respect to the day's box (and is not
|
||||||
counted when calculating the box's height.)
|
counted when calculating the box's height.)
|
||||||
|
|
||||||
|
|||||||
@@ -63,14 +63,15 @@ install: all
|
|||||||
done
|
done
|
||||||
-mkdir -p $(DESTDIR)$(datarootdir)/remind || true
|
-mkdir -p $(DESTDIR)$(datarootdir)/remind || true
|
||||||
cp -R ../include/* $(DESTDIR)$(datarootdir)/remind
|
cp -R ../include/* $(DESTDIR)$(datarootdir)/remind
|
||||||
|
chmod -R a+rX $(DESTDIR)$(datarootdir)/remind
|
||||||
-mkdir -p $(DESTDIR)$(prefix)/share/pixmaps
|
-mkdir -p $(DESTDIR)$(prefix)/share/pixmaps
|
||||||
-mkdir -p $(DESTDIR)$(prefix)/share/applications
|
-mkdir -p $(DESTDIR)$(prefix)/share/applications
|
||||||
$(INSTALL_DATA) $(srcdir)/../resources/tkremind.png $(DESTDIR)$(prefix)/share/pixmaps
|
$(INSTALL_DATA) $(srcdir)/../resources/tkremind.png $(DESTDIR)$(prefix)/share/pixmaps
|
||||||
$(INSTALL_PROGRAM) $(srcdir)/../resources/tkremind.desktop $(DESTDIR)$(prefix)/share/applications
|
$(INSTALL_PROGRAM) $(srcdir)/../resources/tkremind.desktop $(DESTDIR)$(prefix)/share/applications
|
||||||
-if test "$(DESTDIR)" = ""; then \
|
-if test "$(DESTDIR)" = ""; then \
|
||||||
update-desktop-database < /dev/null > /dev/null 2>&1 ; \
|
update-desktop-database < /dev/null > /dev/null 2>&1 ; \
|
||||||
xdg-icon-resource install --novendor --size 64 $(DESTDIR)$(prefix)/share/pixmaps/tkremind.png < /dev/null > /dev/null 2>&1; \
|
xdg-icon-resource install --novendor --size 64 $(DESTDIR)$(prefix)/share/pixmaps/tkremind.png < /dev/null > /dev/null 2>&1 || true; \
|
||||||
xdg-desktop-menu install --novendor $(DESTDIR)$(prefix)/share/applications/tkremind.desktop < /dev/null > /dev/null 2>&1 ; \
|
xdg-desktop-menu install --novendor $(DESTDIR)$(prefix)/share/applications/tkremind.desktop < /dev/null > /dev/null 2>&1 || true; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install-stripped: install
|
install-stripped: install
|
||||||
|
|||||||
@@ -1770,7 +1770,7 @@ static int DoCalRem(ParsePtr p, int col)
|
|||||||
DBufInit(&raw_buf);
|
DBufInit(&raw_buf);
|
||||||
|
|
||||||
/* Parse the trigger date and time */
|
/* Parse the trigger date and time */
|
||||||
if ( (r=ParseRem(p, &trig, &tim, 1)) ) {
|
if ( (r=ParseRem(p, &trig, &tim)) ) {
|
||||||
FreeTrig(&trig);
|
FreeTrig(&trig);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,27 +24,46 @@ if (!$ARGV[0]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $lang = $ARGV[0];
|
my $lang = $ARGV[0];
|
||||||
if (!exists($language_map->{$lang})) {
|
my $rc = 0;
|
||||||
print STDERR "$lang is not a valid language.\n";
|
if ($lang eq 'all') {
|
||||||
exit(1);
|
foreach my $l (sort(keys(%$language_map))) {
|
||||||
}
|
if (check($l)) {
|
||||||
|
$rc = 1;
|
||||||
my $flag = $language_map->{$lang};
|
}
|
||||||
print STDERR "Testing for: $lang - $flag.\n";
|
}
|
||||||
my_sys("make clean > /dev/null 2>&1") && die("make clean failed");
|
|
||||||
my_sys("make -j6 all LANGDEF=-DLANG=$flag > /dev/null 2>&1") && die("make all failed");
|
|
||||||
my_sys("./remind -q -r ../tests/tstlang.rem 2022-03-23 11:44 > test-$lang-compiled.out 2>&1");
|
|
||||||
|
|
||||||
my_sys("make clean > /dev/null 2>&1") && die("make clean failed");
|
|
||||||
my_sys("make -j6 all > /dev/null 2>&1") && die("make all failed");
|
|
||||||
my_sys("./remind -q -r -ii=\\\"../include/lang/$lang.rem\\\" ../tests/tstlang.rem 2022-03-23 11:44 > test-$lang-runtime.out 2>&1");
|
|
||||||
|
|
||||||
my $rc = my_sys("cmp test-$lang-compiled.out test-$lang-runtime.out > /dev/null 2>&1");
|
|
||||||
if ($rc == 0) {
|
|
||||||
print STDERR "Congrats! Compiled and runtime language output matches for $lang.\n";
|
|
||||||
} else {
|
} else {
|
||||||
print STDERR "Whoops. Compiled and runtime language output differs for $lang.\n"
|
$rc = check($lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exit($rc);
|
||||||
|
|
||||||
|
sub check
|
||||||
|
{
|
||||||
|
my ($lang) = @_;
|
||||||
|
if (!exists($language_map->{$lang})) {
|
||||||
|
print STDERR "$lang is not a valid language.\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $flag = $language_map->{$lang};
|
||||||
|
print STDERR "Testing for: $lang - $flag.\n";
|
||||||
|
my_sys("make clean > /dev/null 2>&1") && die("make clean failed");
|
||||||
|
my_sys("make -j18 all LANGDEF=-DLANG=$flag > /dev/null 2>&1") && die("make all failed");
|
||||||
|
my_sys("./remind -q -r ../tests/tstlang.rem 2022-03-23 11:44 > test-$lang-compiled.out 2>&1");
|
||||||
|
|
||||||
|
my_sys("make clean > /dev/null 2>&1") && die("make clean failed");
|
||||||
|
my_sys("make -j18 all > /dev/null 2>&1") && die("make all failed");
|
||||||
|
my_sys("./remind -q -r -ii=\\\"../include/lang/$lang.rem\\\" ../tests/tstlang.rem 2022-03-23 11:44 > test-$lang-runtime.out 2>&1");
|
||||||
|
|
||||||
|
my $rc = my_sys("cmp test-$lang-compiled.out test-$lang-runtime.out > /dev/null 2>&1");
|
||||||
|
if ($rc == 0) {
|
||||||
|
print STDERR "Congrats! Compiled and runtime language output matches for $lang.\n";
|
||||||
|
} else {
|
||||||
|
print STDERR "Whoops. Compiled and runtime language output differs for $lang.\n"
|
||||||
|
}
|
||||||
|
return $rc;
|
||||||
|
}
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
sub my_sys
|
sub my_sys
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
|
||||||
#undef HAVE_UTIME_NULL
|
|
||||||
|
|
||||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
|
||||||
#undef TIME_WITH_SYS_TIME
|
|
||||||
|
|
||||||
/* Define if your <sys/time.h> declares struct tm. */
|
/* Define if your <sys/time.h> declares struct tm. */
|
||||||
#undef TM_IN_SYS_TIME
|
#undef TM_IN_SYS_TIME
|
||||||
|
|
||||||
@@ -16,6 +10,15 @@
|
|||||||
/* Define if you have the <glob.h> header file */
|
/* Define if you have the <glob.h> header file */
|
||||||
#undef HAVE_GLOB_H
|
#undef HAVE_GLOB_H
|
||||||
|
|
||||||
|
/* Define if you have <stdint.h> */
|
||||||
|
#undef HAVE_STDINT_H
|
||||||
|
|
||||||
|
#undef HAVE_STRINGS_H
|
||||||
|
|
||||||
|
#undef HAVE_STRDUP
|
||||||
|
#undef HAVE_STRCASECMP
|
||||||
|
#undef HAVE_STRNCASECMP
|
||||||
|
|
||||||
#undef HAVE_WCTYPE_H
|
#undef HAVE_WCTYPE_H
|
||||||
|
|
||||||
#undef HAVE_LOCALE_H
|
#undef HAVE_LOCALE_H
|
||||||
@@ -42,4 +45,8 @@
|
|||||||
/* The number of bytes in a unsigned long. */
|
/* The number of bytes in a unsigned long. */
|
||||||
#undef SIZEOF_UNSIGNED_LONG
|
#undef SIZEOF_UNSIGNED_LONG
|
||||||
|
|
||||||
|
#define PACKAGE_NAME "@PACKAGE_NAME@"
|
||||||
|
#define PACKAGE_URL "@PACKAGE_URL@"
|
||||||
|
|
||||||
#include "custom.h"
|
#include "custom.h"
|
||||||
|
|
||||||
|
|||||||
28
src/dorem.c
28
src/dorem.c
@@ -25,7 +25,7 @@
|
|||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
|
|
||||||
static int ParseTimeTrig (ParsePtr s, TimeTrig *tim, int save_in_globals);
|
static int ParseTimeTrig (ParsePtr s, TimeTrig *tim);
|
||||||
static int ParseLocalOmit (ParsePtr s, Trigger *t);
|
static int ParseLocalOmit (ParsePtr s, Trigger *t);
|
||||||
static int ParseScanFrom (ParsePtr s, Trigger *t, int type);
|
static int ParseScanFrom (ParsePtr s, Trigger *t, int type);
|
||||||
static int ParsePriority (ParsePtr s, Trigger *t);
|
static int ParsePriority (ParsePtr s, Trigger *t);
|
||||||
@@ -63,7 +63,7 @@ int DoRem(ParsePtr p)
|
|||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
|
|
||||||
/* Parse the trigger date and time */
|
/* Parse the trigger date and time */
|
||||||
if ( (r=ParseRem(p, &trig, &tim, 1)) ) {
|
if ( (r=ParseRem(p, &trig, &tim)) ) {
|
||||||
FreeTrig(&trig);
|
FreeTrig(&trig);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ int DoRem(ParsePtr p)
|
|||||||
/* trigger structure. */
|
/* trigger structure. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim)
|
||||||
{
|
{
|
||||||
register int r;
|
register int r;
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
@@ -262,10 +262,6 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
|||||||
trig->need_wkday = 0;
|
trig->need_wkday = 0;
|
||||||
trig->adj_for_last = 0;
|
trig->adj_for_last = 0;
|
||||||
|
|
||||||
if (save_in_globals) {
|
|
||||||
LastTriggerTime = NO_TIME;
|
|
||||||
}
|
|
||||||
|
|
||||||
int parsing = 1;
|
int parsing = 1;
|
||||||
while(parsing) {
|
while(parsing) {
|
||||||
/* Read space-delimited string */
|
/* Read space-delimited string */
|
||||||
@@ -315,10 +311,6 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
|||||||
trig->m = m;
|
trig->m = m;
|
||||||
trig->d = d;
|
trig->d = d;
|
||||||
tim->ttime = (tok.val % MINUTES_PER_DAY);
|
tim->ttime = (tok.val % MINUTES_PER_DAY);
|
||||||
if (save_in_globals) {
|
|
||||||
LastTriggerTime = tim->ttime;
|
|
||||||
SaveLastTimeTrig(tim);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_WkDay:
|
case T_WkDay:
|
||||||
@@ -355,14 +347,14 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
|||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
if (tim->ttime != NO_TIME) return E_TIME_TWICE;
|
if (tim->ttime != NO_TIME) return E_TIME_TWICE;
|
||||||
tim->ttime = tok.val;
|
tim->ttime = tok.val;
|
||||||
r = ParseTimeTrig(s, tim, save_in_globals);
|
r = ParseTimeTrig(s, tim);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
trig->duration_days = ComputeTrigDuration(tim);
|
trig->duration_days = ComputeTrigDuration(tim);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case T_At:
|
case T_At:
|
||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
r=ParseTimeTrig(s, tim, save_in_globals);
|
r=ParseTimeTrig(s, tim);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
trig->duration_days = ComputeTrigDuration(tim);
|
trig->duration_days = ComputeTrigDuration(tim);
|
||||||
break;
|
break;
|
||||||
@@ -522,9 +514,6 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
|||||||
} else {
|
} else {
|
||||||
tim->duration = NO_TIME;
|
tim->duration = NO_TIME;
|
||||||
}
|
}
|
||||||
if (save_in_globals) {
|
|
||||||
SaveLastTimeTrig(tim);
|
|
||||||
}
|
|
||||||
trig->duration_days = ComputeTrigDuration(tim);
|
trig->duration_days = ComputeTrigDuration(tim);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -608,7 +597,7 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals)
|
|||||||
/* ParseTimeTrig - parse the AT part of a timed reminder */
|
/* ParseTimeTrig - parse the AT part of a timed reminder */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static int ParseTimeTrig(ParsePtr s, TimeTrig *tim, int save_in_globals)
|
static int ParseTimeTrig(ParsePtr s, TimeTrig *tim)
|
||||||
{
|
{
|
||||||
Token tok;
|
Token tok;
|
||||||
int r;
|
int r;
|
||||||
@@ -643,11 +632,6 @@ static int ParseTimeTrig(ParsePtr s, TimeTrig *tim, int save_in_globals)
|
|||||||
default:
|
default:
|
||||||
if (tim->ttime == NO_TIME) return E_EXPECT_TIME;
|
if (tim->ttime == NO_TIME) return E_EXPECT_TIME;
|
||||||
|
|
||||||
/* Save trigger time in global variable */
|
|
||||||
if (save_in_globals) {
|
|
||||||
LastTriggerTime = tim->ttime;
|
|
||||||
SaveLastTimeTrig(tim);
|
|
||||||
}
|
|
||||||
PushToken(DBufValue(&buf), s);
|
PushToken(DBufValue(&buf), s);
|
||||||
DBufFree(&buf);
|
DBufFree(&buf);
|
||||||
return OK;
|
return OK;
|
||||||
|
|||||||
22
src/files.c
22
src/files.c
@@ -101,13 +101,17 @@ static int CheckSafetyAux (struct stat *statbuf);
|
|||||||
static int PopFile (void);
|
static int PopFile (void);
|
||||||
static int IncludeCmd(char const *);
|
static int IncludeCmd(char const *);
|
||||||
|
|
||||||
void set_cloexec(int fd)
|
void set_cloexec(FILE *fp)
|
||||||
{
|
{
|
||||||
int flags;
|
int flags;
|
||||||
flags = fcntl(fd, F_GETFD);
|
int fd;
|
||||||
if (flags >= 0) {
|
if (fp) {
|
||||||
flags |= FD_CLOEXEC;
|
fd = fileno(fp);
|
||||||
fcntl(fd, F_SETFD, flags);
|
flags = fcntl(fd, F_GETFD);
|
||||||
|
if (flags >= 0) {
|
||||||
|
flags |= FD_CLOEXEC;
|
||||||
|
fcntl(fd, F_SETFD, flags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +139,7 @@ static void OpenPurgeFile(char const *fname, char const *mode)
|
|||||||
if (!PurgeFP) {
|
if (!PurgeFP) {
|
||||||
fprintf(ErrFp, "Cannot open `%s' for writing: %s\n", DBufValue(&fname_buf), strerror(errno));
|
fprintf(ErrFp, "Cannot open `%s' for writing: %s\n", DBufValue(&fname_buf), strerror(errno));
|
||||||
}
|
}
|
||||||
set_cloexec(fileno(PurgeFP));
|
set_cloexec(PurgeFP);
|
||||||
DBufFree(&fname_buf);
|
DBufFree(&fname_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,7 +344,7 @@ int OpenFile(char const *fname)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fp = fopen(fname, "r");
|
fp = fopen(fname, "r");
|
||||||
if (fp) set_cloexec(fileno(fp));
|
set_cloexec(fp);
|
||||||
if (DebugFlag & DB_TRACE_FILES) {
|
if (DebugFlag & DB_TRACE_FILES) {
|
||||||
fprintf(ErrFp, "Reading `%s': Opening file on disk\n", fname);
|
fprintf(ErrFp, "Reading `%s': Opening file on disk\n", fname);
|
||||||
}
|
}
|
||||||
@@ -360,7 +364,7 @@ int OpenFile(char const *fname)
|
|||||||
if (strcmp(fname, "-")) {
|
if (strcmp(fname, "-")) {
|
||||||
fp = fopen(fname, "r");
|
fp = fopen(fname, "r");
|
||||||
if (!fp || !CheckSafety()) return E_CANT_OPEN;
|
if (!fp || !CheckSafety()) return E_CANT_OPEN;
|
||||||
set_cloexec(fileno(fp));
|
set_cloexec(fp);
|
||||||
if (PurgeMode) OpenPurgeFile(fname, "w");
|
if (PurgeMode) OpenPurgeFile(fname, "w");
|
||||||
} else {
|
} else {
|
||||||
fp = stdin;
|
fp = stdin;
|
||||||
@@ -557,7 +561,7 @@ static int PopFile(void)
|
|||||||
if (strcmp(i->filename, "-")) {
|
if (strcmp(i->filename, "-")) {
|
||||||
fp = fopen(i->filename, "r");
|
fp = fopen(i->filename, "r");
|
||||||
if (!fp || !CheckSafety()) return E_CANT_OPEN;
|
if (!fp || !CheckSafety()) return E_CANT_OPEN;
|
||||||
set_cloexec(fileno(fp));
|
set_cloexec(fp);
|
||||||
if (PurgeMode) OpenPurgeFile(i->filename, "a");
|
if (PurgeMode) OpenPurgeFile(i->filename, "a");
|
||||||
} else {
|
} else {
|
||||||
fp = stdin;
|
fp = stdin;
|
||||||
|
|||||||
38
src/funcs.c
38
src/funcs.c
@@ -23,6 +23,11 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
@@ -1108,8 +1113,11 @@ static int FOrd(func_info *info)
|
|||||||
ASSERT_TYPE(0, INT_TYPE);
|
ASSERT_TYPE(0, INT_TYPE);
|
||||||
|
|
||||||
v = ARGV(0);
|
v = ARGV(0);
|
||||||
t = v % 100;
|
if (v < 0) {
|
||||||
if (t < 0) t = -t;
|
t = (-v) % 100;
|
||||||
|
} else {
|
||||||
|
t = v % 100;
|
||||||
|
}
|
||||||
u = t % 10;
|
u = t % 10;
|
||||||
s = "th";
|
s = "th";
|
||||||
if (u == 1 && t != 11) s = "st";
|
if (u == 1 && t != 11) s = "st";
|
||||||
@@ -2575,6 +2583,10 @@ static int UTCToLocalHelper(int datetime, int *ret)
|
|||||||
min = (datetime % MINUTES_PER_DAY) % 60;
|
min = (datetime % MINUTES_PER_DAY) % 60;
|
||||||
|
|
||||||
old_tz = getenv("TZ");
|
old_tz = getenv("TZ");
|
||||||
|
if (old_tz) {
|
||||||
|
old_tz = StrDup(old_tz);
|
||||||
|
if (!old_tz) return E_NO_MEM;
|
||||||
|
}
|
||||||
|
|
||||||
tz_set_tz("UTC");
|
tz_set_tz("UTC");
|
||||||
|
|
||||||
@@ -2588,6 +2600,9 @@ static int UTCToLocalHelper(int datetime, int *ret)
|
|||||||
utc.tm_isdst = 0;
|
utc.tm_isdst = 0;
|
||||||
utc_t = mktime(&utc);
|
utc_t = mktime(&utc);
|
||||||
tz_set_tz(old_tz);
|
tz_set_tz(old_tz);
|
||||||
|
if (old_tz) {
|
||||||
|
free( (void *) old_tz);
|
||||||
|
}
|
||||||
|
|
||||||
if (utc_t == -1) {
|
if (utc_t == -1) {
|
||||||
return E_MKTIME_PROBLEM;
|
return E_MKTIME_PROBLEM;
|
||||||
@@ -3222,6 +3237,10 @@ static int tz_convert(int year, int month, int day,
|
|||||||
|
|
||||||
/* backup old TZ env var */
|
/* backup old TZ env var */
|
||||||
old_tz = getenv("TZ");
|
old_tz = getenv("TZ");
|
||||||
|
if (old_tz) {
|
||||||
|
old_tz = StrDup(old_tz);
|
||||||
|
if (!old_tz) return E_NO_MEM;
|
||||||
|
}
|
||||||
if (tgt_tz == NULL) {
|
if (tgt_tz == NULL) {
|
||||||
tgt_tz = old_tz;
|
tgt_tz = old_tz;
|
||||||
}
|
}
|
||||||
@@ -3229,6 +3248,8 @@ static int tz_convert(int year, int month, int day,
|
|||||||
/* set source TZ */
|
/* set source TZ */
|
||||||
r = tz_set_tz(src_tz);
|
r = tz_set_tz(src_tz);
|
||||||
if (r == -1) {
|
if (r == -1) {
|
||||||
|
tz_set_tz(old_tz);
|
||||||
|
if (old_tz) free((void *) old_tz);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3236,14 +3257,16 @@ static int tz_convert(int year, int month, int day,
|
|||||||
t = mktime(tm);
|
t = mktime(tm);
|
||||||
|
|
||||||
if (t == (time_t) -1) {
|
if (t == (time_t) -1) {
|
||||||
tz_set_tz(old_tz);
|
tz_set_tz(old_tz);
|
||||||
|
if (old_tz) free((void *) old_tz);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set target TZ */
|
/* set target TZ */
|
||||||
r = tz_set_tz(tgt_tz);
|
r = tz_set_tz(tgt_tz);
|
||||||
if (r == -1) {
|
if (r == -1) {
|
||||||
tz_set_tz(old_tz);
|
tz_set_tz(old_tz);
|
||||||
|
if (old_tz) free((void *) old_tz);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3252,6 +3275,7 @@ static int tz_convert(int year, int month, int day,
|
|||||||
|
|
||||||
/* restore old TZ */
|
/* restore old TZ */
|
||||||
tz_set_tz(old_tz);
|
tz_set_tz(old_tz);
|
||||||
|
if (old_tz) free((void *) old_tz);
|
||||||
|
|
||||||
/* return result */
|
/* return result */
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
@@ -3482,7 +3506,7 @@ FEvalTrig(func_info *info)
|
|||||||
|
|
||||||
CreateParser(ARGSTR(0), &p);
|
CreateParser(ARGSTR(0), &p);
|
||||||
p.allownested = 0;
|
p.allownested = 0;
|
||||||
r = ParseRem(&p, &trig, &tim, 0);
|
r = ParseRem(&p, &trig, &tim);
|
||||||
if (r) {
|
if (r) {
|
||||||
DestroyParser(&p);
|
DestroyParser(&p);
|
||||||
return r;
|
return r;
|
||||||
@@ -3541,7 +3565,7 @@ FMultiTrig(func_info *info)
|
|||||||
for (i=0; i<Nargs; i++) {
|
for (i=0; i<Nargs; i++) {
|
||||||
CreateParser(ARGSTR(i), &p);
|
CreateParser(ARGSTR(i), &p);
|
||||||
p.allownested = 0;
|
p.allownested = 0;
|
||||||
r = ParseRem(&p, &trig, &tim, 0);
|
r = ParseRem(&p, &trig, &tim);
|
||||||
if (r) {
|
if (r) {
|
||||||
DestroyParser(&p);
|
DestroyParser(&p);
|
||||||
return r;
|
return r;
|
||||||
@@ -3598,7 +3622,7 @@ FTrig(func_info *info)
|
|||||||
for (i=0; i<Nargs; i++) {
|
for (i=0; i<Nargs; i++) {
|
||||||
CreateParser(ARGSTR(i), &p);
|
CreateParser(ARGSTR(i), &p);
|
||||||
p.allownested = 0;
|
p.allownested = 0;
|
||||||
r = ParseRem(&p, &trig, &tim, 0);
|
r = ParseRem(&p, &trig, &tim);
|
||||||
if (r) {
|
if (r) {
|
||||||
DestroyParser(&p);
|
DestroyParser(&p);
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ EXTERN INIT( int LastTrigValid, 0);
|
|||||||
EXTERN Trigger LastTrigger;
|
EXTERN Trigger LastTrigger;
|
||||||
EXTERN TimeTrig LastTimeTrig;
|
EXTERN TimeTrig LastTimeTrig;
|
||||||
EXTERN INIT( int LastTriggerDate, 0);
|
EXTERN INIT( int LastTriggerDate, 0);
|
||||||
EXTERN INIT( int LastTriggerTime, 0);
|
EXTERN INIT( int LastTriggerTime, NO_TIME);
|
||||||
EXTERN INIT( int ShouldCache, 0);
|
EXTERN INIT( int ShouldCache, 0);
|
||||||
EXTERN char const *CurLine;
|
EXTERN char const *CurLine;
|
||||||
EXTERN INIT( int NumTriggered, 0);
|
EXTERN INIT( int NumTriggered, 0);
|
||||||
|
|||||||
@@ -20,6 +20,12 @@
|
|||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "err.h"
|
#include "err.h"
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HOUR 1080L
|
#define HOUR 1080L
|
||||||
#define DAY (24L*HOUR)
|
#define DAY (24L*HOUR)
|
||||||
#define WEEK (7L*DAY)
|
#define WEEK (7L*DAY)
|
||||||
|
|||||||
@@ -806,6 +806,7 @@ void Usage(void)
|
|||||||
fprintf(ErrFp, " -m Start calendar with Monday rather than Sunday\n");
|
fprintf(ErrFp, " -m Start calendar with Monday rather than Sunday\n");
|
||||||
fprintf(ErrFp, " -y Synthesize tags for tagless reminders\n");
|
fprintf(ErrFp, " -y Synthesize tags for tagless reminders\n");
|
||||||
fprintf(ErrFp, " -j[n] Run in 'purge' mode. [n = INCLUDE depth]\n");
|
fprintf(ErrFp, " -j[n] Run in 'purge' mode. [n = INCLUDE depth]\n");
|
||||||
|
fprintf(ErrFp, "\nRemind home page: %s\n", PACKAGE_URL);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
#endif /* L_USAGE_OVERRIDE */
|
#endif /* L_USAGE_OVERRIDE */
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ EXTERN char *ErrMsg[] =
|
|||||||
"No files matching *.rem",
|
"No files matching *.rem",
|
||||||
"String too long",
|
"String too long",
|
||||||
"Time specified twice",
|
"Time specified twice",
|
||||||
"Cannot specify DURATION without specifying AT".
|
"Cannot specify DURATION without specifying AT",
|
||||||
"Odotettu viikonpäivän nimi"
|
"Odotettu viikonpäivän nimi"
|
||||||
};
|
};
|
||||||
#endif /* MK_GLOBALS */
|
#endif /* MK_GLOBALS */
|
||||||
@@ -272,12 +272,10 @@ void Usage(void)
|
|||||||
fprintf(ErrFp, " -o Älä noudata ONCE-lauseita\n");
|
fprintf(ErrFp, " -o Älä noudata ONCE-lauseita\n");
|
||||||
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta välittämättä\n");
|
fprintf(ErrFp, " -t Laukaise kaikki viestit deltan arvosta välittämättä\n");
|
||||||
fprintf(ErrFp, " -h Suppeat tulostukset\n");
|
fprintf(ErrFp, " -h Suppeat tulostukset\n");
|
||||||
#ifdef HAVE_QUEUED
|
|
||||||
fprintf(ErrFp, " -a Älä laukaise viestejä heti - lisää ne jonoon\n");
|
fprintf(ErrFp, " -a Älä laukaise viestejä heti - lisää ne jonoon\n");
|
||||||
fprintf(ErrFp, " -q Älä lisää viestejä jonoon\n");
|
fprintf(ErrFp, " -q Älä lisää viestejä jonoon\n");
|
||||||
fprintf(ErrFp, " -f Laukaise viestit, pysy etualalla\n");
|
fprintf(ErrFp, " -f Laukaise viestit, pysy etualalla\n");
|
||||||
fprintf(ErrFp, " -z[n] Käynnisty demonina, herätys n:n (5:n) minuutin välein\n");
|
fprintf(ErrFp, " -z[n] Käynnisty demonina, herätys n:n (5:n) minuutin välein\n");
|
||||||
#endif
|
|
||||||
fprintf(ErrFp, " -d... Virheenetsintä: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
fprintf(ErrFp, " -d... Virheenetsintä: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||||
fprintf(ErrFp, " -e Ohjaa virhetulostus stdout-vuohon\n");
|
fprintf(ErrFp, " -e Ohjaa virhetulostus stdout-vuohon\n");
|
||||||
fprintf(ErrFp, " -b[n] Ajan ilmaisu: 0=ap/ip, 1=24 tuntia, 2=ei aikoja\n");
|
fprintf(ErrFp, " -b[n] Ajan ilmaisu: 0=ap/ip, 1=24 tuntia, 2=ei aikoja\n");
|
||||||
|
|||||||
@@ -246,12 +246,10 @@ void Usage(void)
|
|||||||
fprintf(ErrFp, " -o Ignorer instructions ONCE\n");
|
fprintf(ErrFp, " -o Ignorer instructions ONCE\n");
|
||||||
fprintf(ErrFp, " -t Déclencher tous les rappels peu importe le delta\n");
|
fprintf(ErrFp, " -t Déclencher tous les rappels peu importe le delta\n");
|
||||||
fprintf(ErrFp, " -h Mode silencieux\n");
|
fprintf(ErrFp, " -h Mode silencieux\n");
|
||||||
#ifdef HAVE_QUEUED
|
|
||||||
fprintf(ErrFp, " -a Ne pas déclencher les rappels minutés immédiatement - les mettre en file\n");
|
fprintf(ErrFp, " -a Ne pas déclencher les rappels minutés immédiatement - les mettre en file\n");
|
||||||
fprintf(ErrFp, " -q Ne pas mettre les rappels minutés en file\n");
|
fprintf(ErrFp, " -q Ne pas mettre les rappels minutés en file\n");
|
||||||
fprintf(ErrFp, " -f Déclencher les rappels minutés immédiatement en restant en avant-plan\n");
|
fprintf(ErrFp, " -f Déclencher les rappels minutés immédiatement en restant en avant-plan\n");
|
||||||
fprintf(ErrFp, " -z[n] Entrer en mode 'daemon', réveil chaque n (5) minutes\n");
|
fprintf(ErrFp, " -z[n] Entrer en mode 'daemon', réveil chaque n (5) minutes\n");
|
||||||
#endif
|
|
||||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||||
fprintf(ErrFp, " -e Envoyer les messages de stderr à stdout\n");
|
fprintf(ErrFp, " -e Envoyer les messages de stderr à stdout\n");
|
||||||
fprintf(ErrFp, " -b[n] Formats de l'heure pour le calendrier: 0=am/pm, 1=24hr, 2=aucun\n");
|
fprintf(ErrFp, " -b[n] Formats de l'heure pour le calendrier: 0=am/pm, 1=24hr, 2=aucun\n");
|
||||||
|
|||||||
@@ -262,12 +262,10 @@ void Usage(void)
|
|||||||
fprintf(ErrFp, " -o Ignoruj instrukcje ONCE\n");
|
fprintf(ErrFp, " -o Ignoruj instrukcje ONCE\n");
|
||||||
fprintf(ErrFp, " -t Odpal wszystkie przyszłe przypomnienia niezależnie od delty\n");
|
fprintf(ErrFp, " -t Odpal wszystkie przyszłe przypomnienia niezależnie od delty\n");
|
||||||
fprintf(ErrFp, " -h Praca bezszmerowa\n");
|
fprintf(ErrFp, " -h Praca bezszmerowa\n");
|
||||||
#ifdef HAVE_QUEUED
|
|
||||||
fprintf(ErrFp, " -a Nie odpalaj przyponień czasowych - kolejkuj je\n");
|
fprintf(ErrFp, " -a Nie odpalaj przyponień czasowych - kolejkuj je\n");
|
||||||
fprintf(ErrFp, " -q Nie kolejkuj przyponień czasowych\n");
|
fprintf(ErrFp, " -q Nie kolejkuj przyponień czasowych\n");
|
||||||
fprintf(ErrFp, " -f Nie przechodź do pracy w tle\n");
|
fprintf(ErrFp, " -f Nie przechodź do pracy w tle\n");
|
||||||
fprintf(ErrFp, " -z[n] Pracuj jako demon, budząc się co n (5) minut\n");
|
fprintf(ErrFp, " -z[n] Pracuj jako demon, budząc się co n (5) minut\n");
|
||||||
#endif
|
|
||||||
fprintf(ErrFp, " -d... Odpluskwianie: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
fprintf(ErrFp, " -d... Odpluskwianie: e=echo x=expr-eval t=trig v=dumpvars l=showline\n");
|
||||||
fprintf(ErrFp, " -e Komunikaty o błędach skieruj na stdout\n");
|
fprintf(ErrFp, " -e Komunikaty o błędach skieruj na stdout\n");
|
||||||
fprintf(ErrFp, " -b[n] Format czasu: 0=am/pm, 1=24godz., 2=żaden\n");
|
fprintf(ErrFp, " -b[n] Format czasu: 0=am/pm, 1=24godz., 2=żaden\n");
|
||||||
|
|||||||
@@ -271,12 +271,10 @@ void Usage(void)
|
|||||||
fprintf(ErrFp, " -o Ignora diretivas ONCE\n");
|
fprintf(ErrFp, " -o Ignora diretivas ONCE\n");
|
||||||
fprintf(ErrFp, " -t Aciona todos os compromissos futuros, sem considerar o delta\n");
|
fprintf(ErrFp, " -t Aciona todos os compromissos futuros, sem considerar o delta\n");
|
||||||
fprintf(ErrFp, " -h Modo `Hush' - quieto\n");
|
fprintf(ErrFp, " -h Modo `Hush' - quieto\n");
|
||||||
#ifdef HAVE_QUEUED
|
|
||||||
fprintf(ErrFp, " -a Nao aciona compromissos com hora imediatamente - apenas coloca na fila\n");
|
fprintf(ErrFp, " -a Nao aciona compromissos com hora imediatamente - apenas coloca na fila\n");
|
||||||
fprintf(ErrFp, " -q Nao coloca compromissos com hora na fila\n");
|
fprintf(ErrFp, " -q Nao coloca compromissos com hora na fila\n");
|
||||||
fprintf(ErrFp, " -f Aciona compromissos com hora em modo foreground\n");
|
fprintf(ErrFp, " -f Aciona compromissos com hora em modo foreground\n");
|
||||||
fprintf(ErrFp, " -z[n] Modo `daemon', acordando a cada n (5) minutos.\n");
|
fprintf(ErrFp, " -z[n] Modo `daemon', acordando a cada n (5) minutos.\n");
|
||||||
#endif
|
|
||||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trigger v=dumpvars l=showline\n");
|
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trigger v=dumpvars l=showline\n");
|
||||||
fprintf(ErrFp, " -e Desvia mensagens normalmente enviadas a stderr para stdout\n");
|
fprintf(ErrFp, " -e Desvia mensagens normalmente enviadas a stderr para stdout\n");
|
||||||
fprintf(ErrFp, " -b[n] Formato da hora para o cal: 0=am/pm, 1=24hr, 2=nenhum\n");
|
fprintf(ErrFp, " -b[n] Formato da hora para o cal: 0=am/pm, 1=24hr, 2=nenhum\n");
|
||||||
|
|||||||
@@ -22,6 +22,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#ifdef HAVE_LOCALE_H
|
#ifdef HAVE_LOCALE_H
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
@@ -900,7 +905,7 @@ int DoIfTrig(ParsePtr p)
|
|||||||
if ((size_t) NumIfs >= IF_NEST) return E_NESTED_IF;
|
if ((size_t) NumIfs >= IF_NEST) return E_NESTED_IF;
|
||||||
if (ShouldIgnoreLine()) syndrome = IF_TRUE | BEFORE_ELSE;
|
if (ShouldIgnoreLine()) syndrome = IF_TRUE | BEFORE_ELSE;
|
||||||
else {
|
else {
|
||||||
if ( (r=ParseRem(p, &trig, &tim, 1)) ) return r;
|
if ( (r=ParseRem(p, &trig, &tim)) ) return r;
|
||||||
if (trig.typ != NO_TYPE) return E_PARSE_ERR;
|
if (trig.typ != NO_TYPE) return E_PARSE_ERR;
|
||||||
dse = ComputeTrigger(trig.scanfrom, &trig, &tim, &r, 1);
|
dse = ComputeTrigger(trig.scanfrom, &trig, &tim, &r, 1);
|
||||||
if (r) {
|
if (r) {
|
||||||
|
|||||||
10
src/md5.h
10
src/md5.h
@@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
|
#include <stdint.h>
|
||||||
|
typedef uint32_t uint32;
|
||||||
|
#else
|
||||||
#if SIZEOF_UNSIGNED_INT == 4
|
#if SIZEOF_UNSIGNED_INT == 4
|
||||||
typedef unsigned int uint32;
|
typedef unsigned int uint32;
|
||||||
#elif SIZEOF_UNSIGNED_LONG == 4
|
#elif SIZEOF_UNSIGNED_LONG == 4
|
||||||
@@ -13,6 +17,7 @@ typedef unsigned long uint32;
|
|||||||
#else
|
#else
|
||||||
# error Could not find a 32-bit integer type
|
# error Could not find a 32-bit integer type
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
struct MD5Context {
|
struct MD5Context {
|
||||||
uint32 buf[4];
|
uint32 buf[4];
|
||||||
@@ -26,9 +31,4 @@ void MD5Update(struct MD5Context *context, unsigned char const *buf,
|
|||||||
void MD5Final(unsigned char digest[16], struct MD5Context *context);
|
void MD5Final(unsigned char digest[16], struct MD5Context *context);
|
||||||
void MD5Transform(uint32 buf[4], uint32 const in[16]);
|
void MD5Transform(uint32 buf[4], uint32 const in[16]);
|
||||||
|
|
||||||
/*
|
|
||||||
* This is needed to make RSAREF happy on some MS-DOS compilers.
|
|
||||||
*/
|
|
||||||
typedef struct MD5Context MD5_CTX;
|
|
||||||
|
|
||||||
#endif /* !MD5_H */
|
#endif /* !MD5_H */
|
||||||
|
|||||||
26
src/protos.h
26
src/protos.h
@@ -13,6 +13,18 @@
|
|||||||
/* Suppress unused variable warnings */
|
/* Suppress unused variable warnings */
|
||||||
#define UNUSED(x) (void) x
|
#define UNUSED(x) (void) x
|
||||||
|
|
||||||
|
#ifdef HAVE_STRDUP
|
||||||
|
#define StrDup strdup
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STRNCASECMP
|
||||||
|
#define StrinCmp strncasecmp
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STRCASECMP
|
||||||
|
#define StrCmpi strcasecmp
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define a string assignment macro - be careful!!! */
|
/* Define a string assignment macro - be careful!!! */
|
||||||
#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
|
#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
|
||||||
|
|
||||||
@@ -37,7 +49,7 @@ char const *CalendarTime (int tim, int duration);
|
|||||||
int DoRem (ParsePtr p);
|
int DoRem (ParsePtr p);
|
||||||
int DoFlush (ParsePtr p);
|
int DoFlush (ParsePtr p);
|
||||||
void DoExit (ParsePtr p);
|
void DoExit (ParsePtr p);
|
||||||
int ParseRem (ParsePtr s, Trigger *trig, TimeTrig *tim, int save_in_globals);
|
int ParseRem (ParsePtr s, Trigger *trig, TimeTrig *tim);
|
||||||
int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int dse, int is_queued, DynamicBuffer *output);
|
int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int dse, int is_queued, DynamicBuffer *output);
|
||||||
int ShouldTriggerReminder (Trigger *t, TimeTrig *tim, int dse, int *err);
|
int ShouldTriggerReminder (Trigger *t, TimeTrig *tim, int dse, int *err);
|
||||||
int DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse, int mode);
|
int DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int dse, int mode);
|
||||||
@@ -103,9 +115,19 @@ int ComputeTrigger (int today, Trigger *trig, TimeTrig *tim, int *err, int save_
|
|||||||
int ComputeTriggerNoAdjustDuration (int today, Trigger *trig, TimeTrig *tim, int *err, int save_in_globals, int duration_days);
|
int ComputeTriggerNoAdjustDuration (int today, Trigger *trig, TimeTrig *tim, int *err, int save_in_globals, int duration_days);
|
||||||
int AdjustTriggerForDuration(int today, int r, Trigger *trig, TimeTrig *tim, int save_in_globals);
|
int AdjustTriggerForDuration(int today, int r, Trigger *trig, TimeTrig *tim, int save_in_globals);
|
||||||
char *StrnCpy (char *dest, char const *source, int n);
|
char *StrnCpy (char *dest, char const *source, int n);
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCASECMP
|
||||||
int StrinCmp (char const *s1, char const *s2, int n);
|
int StrinCmp (char const *s1, char const *s2, int n);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRDUP
|
||||||
char *StrDup (char const *s);
|
char *StrDup (char const *s);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCASECMP
|
||||||
int StrCmpi (char const *s1, char const *s2);
|
int StrCmpi (char const *s1, char const *s2);
|
||||||
|
#endif
|
||||||
|
|
||||||
Var *FindVar (char const *str, int create);
|
Var *FindVar (char const *str, int create);
|
||||||
int DeleteVar (char const *str);
|
int DeleteVar (char const *str);
|
||||||
int SetVar (char const *str, Value const *val);
|
int SetVar (char const *str, Value const *val);
|
||||||
@@ -181,7 +203,7 @@ int GetTerminalBackground(void);
|
|||||||
char const *get_day_name(int wkday);
|
char const *get_day_name(int wkday);
|
||||||
char const *get_month_name(int mon);
|
char const *get_month_name(int mon);
|
||||||
|
|
||||||
void set_cloexec(int fd);
|
void set_cloexec(FILE *fp);
|
||||||
int push_call(char const *filename, char const *func, int lineno);
|
int push_call(char const *filename, char const *func, int lineno);
|
||||||
void clear_callstack(void);
|
void clear_callstack(void);
|
||||||
int print_callstack(FILE *fp);
|
int print_callstack(FILE *fp);
|
||||||
|
|||||||
56
src/queue.c
56
src/queue.c
@@ -66,6 +66,7 @@ typedef struct queuedrem {
|
|||||||
char sched[VAR_NAME_LEN+1];
|
char sched[VAR_NAME_LEN+1];
|
||||||
Trigger t;
|
Trigger t;
|
||||||
TimeTrig tt;
|
TimeTrig tt;
|
||||||
|
int red, green, blue;
|
||||||
} QueuedRem;
|
} QueuedRem;
|
||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
@@ -79,7 +80,7 @@ static void CheckInitialFile (void);
|
|||||||
static int CalculateNextTime (QueuedRem *q);
|
static int CalculateNextTime (QueuedRem *q);
|
||||||
static QueuedRem *FindNextReminder (void);
|
static QueuedRem *FindNextReminder (void);
|
||||||
static int CalculateNextTimeUsingSched (QueuedRem *q);
|
static int CalculateNextTimeUsingSched (QueuedRem *q);
|
||||||
static void DaemonWait (struct timeval *sleep_tv);
|
static void ServerWait (struct timeval *sleep_tv);
|
||||||
static void reread (void);
|
static void reread (void);
|
||||||
static void PrintQueue(void);
|
static void PrintQueue(void);
|
||||||
static char const *QueueFilename(char const *fname);
|
static char const *QueueFilename(char const *fname);
|
||||||
@@ -206,6 +207,9 @@ int QueueReminder(ParsePtr p, Trigger *trig,
|
|||||||
if (!qelem) {
|
if (!qelem) {
|
||||||
return E_NO_MEM;
|
return E_NO_MEM;
|
||||||
}
|
}
|
||||||
|
qelem->red = DefaultColorR;
|
||||||
|
qelem->green = DefaultColorG;
|
||||||
|
qelem->blue = DefaultColorB;
|
||||||
qelem->text = StrDup(p->pos); /* Guaranteed that parser is not nested. */
|
qelem->text = StrDup(p->pos); /* Guaranteed that parser is not nested. */
|
||||||
if (!qelem->text) {
|
if (!qelem->text) {
|
||||||
free(qelem);
|
free(qelem);
|
||||||
@@ -357,9 +361,7 @@ void HandleQueuedReminders(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_INOTIFY
|
#ifdef USE_INOTIFY
|
||||||
if (IsServerMode()) {
|
watch_fd = setup_inotify_watch();
|
||||||
watch_fd = setup_inotify_watch();
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
/* Sit in a loop, issuing reminders when necessary */
|
/* Sit in a loop, issuing reminders when necessary */
|
||||||
while(1) {
|
while(1) {
|
||||||
@@ -386,8 +388,6 @@ void HandleQueuedReminders(void)
|
|||||||
SleepTime = 60*Daemon;
|
SleepTime = 60*Daemon;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wake up once a minute to recalibrate sleep time in
|
|
||||||
case of laptop hibernation */
|
|
||||||
if (IsServerMode()) {
|
if (IsServerMode()) {
|
||||||
/* Wake up on the next exact minute */
|
/* Wake up on the next exact minute */
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
@@ -398,7 +398,7 @@ void HandleQueuedReminders(void)
|
|||||||
} else {
|
} else {
|
||||||
sleep_tv.tv_usec = 0;
|
sleep_tv.tv_usec = 0;
|
||||||
}
|
}
|
||||||
DaemonWait(&sleep_tv);
|
ServerWait(&sleep_tv);
|
||||||
/* A DEL command might have deleted our queued reminder! */
|
/* A DEL command might have deleted our queued reminder! */
|
||||||
q = FindNextReminder();
|
q = FindNextReminder();
|
||||||
} else {
|
} else {
|
||||||
@@ -418,7 +418,9 @@ void HandleQueuedReminders(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Daemon > 0 && SleepTime) CheckInitialFile();
|
if (Daemon > 0 && SleepTime) {
|
||||||
|
CheckInitialFile();
|
||||||
|
}
|
||||||
|
|
||||||
if (Daemon && !q) {
|
if (Daemon && !q) {
|
||||||
if (IsServerMode()) {
|
if (IsServerMode()) {
|
||||||
@@ -469,10 +471,15 @@ void HandleQueuedReminders(void)
|
|||||||
and trigtime() work correctly */
|
and trigtime() work correctly */
|
||||||
SaveAllTriggerInfo(&(q->t), &(q->tt), DSEToday, q->tt.ttime, 1);
|
SaveAllTriggerInfo(&(q->t), &(q->tt), DSEToday, q->tt.ttime, 1);
|
||||||
FileName = (char *) q->fname;
|
FileName = (char *) q->fname;
|
||||||
|
DefaultColorR = q->red;
|
||||||
|
DefaultColorG = q->green;
|
||||||
|
DefaultColorB = q->blue;
|
||||||
|
/* Make a COPY of q->t because TriggerReminder can change q->t.typ */
|
||||||
|
Trigger tcopy = q->t;
|
||||||
if (DaemonJSON) {
|
if (DaemonJSON) {
|
||||||
DynamicBuffer out;
|
DynamicBuffer out;
|
||||||
DBufInit(&out);
|
DBufInit(&out);
|
||||||
(void) TriggerReminder(&p, &q->t, &q->tt, DSEToday, 1, &out);
|
(void) TriggerReminder(&p, &tcopy, &q->tt, DSEToday, 1, &out);
|
||||||
if (q->typ != RUN_TYPE) {
|
if (q->typ != RUN_TYPE) {
|
||||||
printf("\"body\":\"");
|
printf("\"body\":\"");
|
||||||
chomp(&out);
|
chomp(&out);
|
||||||
@@ -481,7 +488,7 @@ void HandleQueuedReminders(void)
|
|||||||
}
|
}
|
||||||
DBufFree(&out);
|
DBufFree(&out);
|
||||||
} else {
|
} else {
|
||||||
(void) TriggerReminder(&p, &q->t, &q->tt, DSEToday, 1, NULL);
|
(void) TriggerReminder(&p, &tcopy, &q->tt, DSEToday, 1, NULL);
|
||||||
}
|
}
|
||||||
FileName = NULL;
|
FileName = NULL;
|
||||||
if (IsServerMode() && !DaemonJSON && q->typ != RUN_TYPE) {
|
if (IsServerMode() && !DaemonJSON && q->typ != RUN_TYPE) {
|
||||||
@@ -630,7 +637,25 @@ static void CheckInitialFile(void)
|
|||||||
/* If date has rolled around, or file has changed, spawn a new version. */
|
/* If date has rolled around, or file has changed, spawn a new version. */
|
||||||
time_t tim = FileModTime;
|
time_t tim = FileModTime;
|
||||||
int y, m, d;
|
int y, m, d;
|
||||||
|
#ifdef USE_INOTIFY
|
||||||
|
char buf[sizeof(struct inotify_event) + NAME_MAX + 1];
|
||||||
|
int n;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef USE_INOTIFY
|
||||||
|
/* If there are any inotify events, reread */
|
||||||
|
if (watch_fd >= 0) {
|
||||||
|
while(1) {
|
||||||
|
n = read(watch_fd, buf, sizeof(buf));
|
||||||
|
if (n < 0 && errno == EINTR) continue;
|
||||||
|
if (n > 0) {
|
||||||
|
close(watch_fd);
|
||||||
|
reread();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (stat(InitialFile, &StatBuf) == 0) tim = StatBuf.st_mtime;
|
if (stat(InitialFile, &StatBuf) == 0) tim = StatBuf.st_mtime;
|
||||||
if (tim != FileModTime ||
|
if (tim != FileModTime ||
|
||||||
RealToday != SystemDate(&y, &m, &d)) {
|
RealToday != SystemDate(&y, &m, &d)) {
|
||||||
@@ -740,7 +765,10 @@ json_queue(QueuedRem const *q)
|
|||||||
case PS_TYPE: PrintJSONKeyPairString("type", "PS_TYPE"); break;
|
case PS_TYPE: PrintJSONKeyPairString("type", "PS_TYPE"); break;
|
||||||
case PSF_TYPE: PrintJSONKeyPairString("type", "PSF_TYPE"); break;
|
case PSF_TYPE: PrintJSONKeyPairString("type", "PSF_TYPE"); break;
|
||||||
case MSF_TYPE: PrintJSONKeyPairString("type", "MSF_TYPE"); break;
|
case MSF_TYPE: PrintJSONKeyPairString("type", "MSF_TYPE"); break;
|
||||||
case PASSTHRU_TYPE: PrintJSONKeyPairString("type", "PASSTHRU_TYPE"); break;
|
case PASSTHRU_TYPE:
|
||||||
|
PrintJSONKeyPairString("type", "PASSTHRU_TYPE");
|
||||||
|
PrintJSONKeyPairString("passthru", q->passthru);
|
||||||
|
break;
|
||||||
default: PrintJSONKeyPairString("type", "?"); break;
|
default: PrintJSONKeyPairString("type", "?"); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -766,12 +794,12 @@ json_queue(QueuedRem const *q)
|
|||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* DaemonWait */
|
/* ServerWait */
|
||||||
/* */
|
/* */
|
||||||
/* Sleep or read command from stdin in "daemon -1" mode */
|
/* Sleep or read command from stdin in server mode */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static void DaemonWait(struct timeval *sleep_tv)
|
static void ServerWait(struct timeval *sleep_tv)
|
||||||
{
|
{
|
||||||
fd_set readSet;
|
fd_set readSet;
|
||||||
int retval;
|
int retval;
|
||||||
|
|||||||
@@ -16,6 +16,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|||||||
26
src/utils.c
26
src/utils.c
@@ -17,6 +17,11 @@ static char const DontEscapeMe[] =
|
|||||||
#include "err.h"
|
#include "err.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_STRINGS_H
|
||||||
|
#include <strings.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
@@ -46,6 +51,7 @@ char *StrnCpy(char *dest, char const *source, int n)
|
|||||||
return odest;
|
return odest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_STRNCASECMP
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* StrinCmp - compare strings, case-insensitive */
|
/* StrinCmp - compare strings, case-insensitive */
|
||||||
@@ -64,6 +70,9 @@ int StrinCmp(char const *s1, char const *s2, int n)
|
|||||||
if (n) return (toupper(*s1) - toupper(*s2)); else return 0;
|
if (n) return (toupper(*s1) - toupper(*s2)); else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRDUP
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* StrDup */
|
/* StrDup */
|
||||||
@@ -79,6 +88,9 @@ char *StrDup(char const *s)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_STRCASECMP
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* StrCmpi */
|
/* StrCmpi */
|
||||||
@@ -98,6 +110,8 @@ int StrCmpi(char const *s1, char const *s2)
|
|||||||
return toupper(*s1) - toupper(*s2);
|
return toupper(*s1) - toupper(*s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* DateOK */
|
/* DateOK */
|
||||||
@@ -151,11 +165,15 @@ int _private_sub_overflow(int a, int b)
|
|||||||
int
|
int
|
||||||
ShellEscape(char const *in, DynamicBuffer *out)
|
ShellEscape(char const *in, DynamicBuffer *out)
|
||||||
{
|
{
|
||||||
while(*in) {
|
unsigned char const *i = (unsigned char const *) in;
|
||||||
if (!strchr(DontEscapeMe, *in)) {
|
while(*i) {
|
||||||
if (DBufPutc(out, '\\') != OK) return E_NO_MEM;
|
/* Don't escape chars with high bit set. That will mangle UTF-8 */
|
||||||
|
if (! (*i & 0x80) ) {
|
||||||
|
if (!strchr(DontEscapeMe, *i)) {
|
||||||
|
if (DBufPutc(out, '\\') != OK) return E_NO_MEM;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (DBufPutc(out, *in++) != OK) return E_NO_MEM;
|
if (DBufPutc(out, *i++) != OK) return E_NO_MEM;
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/var.c
14
src/var.c
@@ -175,6 +175,19 @@ static int terminal_bg_func(int do_set, Value *val)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int trig_time_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
UNUSED(do_set);
|
||||||
|
if (LastTriggerTime != NO_TIME) {
|
||||||
|
val->type = TIME_TYPE;
|
||||||
|
val->v.val = LastTriggerTime;
|
||||||
|
} else {
|
||||||
|
val->type = INT_TYPE;
|
||||||
|
val->v.val = 0;
|
||||||
|
}
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
static int trig_date_func(int do_set, Value *val)
|
static int trig_date_func(int do_set, Value *val)
|
||||||
{
|
{
|
||||||
UNUSED(do_set);
|
UNUSED(do_set);
|
||||||
@@ -887,6 +900,7 @@ static SysVar SysVarArr[] = {
|
|||||||
{"Tm", 0, SPECIAL_TYPE, trig_mon_func, 0, 0 },
|
{"Tm", 0, SPECIAL_TYPE, trig_mon_func, 0, 0 },
|
||||||
{"Today", 1, STR_TYPE, &DynamicToday, 0, 0 },
|
{"Today", 1, STR_TYPE, &DynamicToday, 0, 0 },
|
||||||
{"Tomorrow", 1, STR_TYPE, &DynamicTomorrow, 0, 0 },
|
{"Tomorrow", 1, STR_TYPE, &DynamicTomorrow, 0, 0 },
|
||||||
|
{"Tt", 0, SPECIAL_TYPE, trig_time_func, 0, 0 },
|
||||||
{"Tuesday", 1, STR_TYPE, &DynamicDayName[1], 0, 0 },
|
{"Tuesday", 1, STR_TYPE, &DynamicDayName[1], 0, 0 },
|
||||||
{"Tw", 0, SPECIAL_TYPE, trig_wday_func, 0, 0 },
|
{"Tw", 0, SPECIAL_TYPE, trig_wday_func, 0, 0 },
|
||||||
{"Ty", 0, SPECIAL_TYPE, trig_year_func, 0, 0 },
|
{"Ty", 0, SPECIAL_TYPE, trig_year_func, 0, 0 },
|
||||||
|
|||||||
1290
tests/test.cmp
1290
tests/test.cmp
File diff suppressed because one or more lines are too long
@@ -329,6 +329,7 @@ set a052 time(1+2, 3+4)
|
|||||||
rem 10 jan 1992 AT 11:22 CAL
|
rem 10 jan 1992 AT 11:22 CAL
|
||||||
set a053 trigdate()
|
set a053 trigdate()
|
||||||
set a054 trigtime()
|
set a054 trigtime()
|
||||||
|
set a054b $Tt
|
||||||
set a055 trigvalid()
|
set a055 trigvalid()
|
||||||
set a056 upper("sdfjhsdf ksjdfh kjsdfh ksjdfh")
|
set a056 upper("sdfjhsdf ksjdfh kjsdfh ksjdfh")
|
||||||
set a057 value("a05"+"6")
|
set a057 value("a05"+"6")
|
||||||
@@ -457,6 +458,7 @@ set a129 23:30 + '2019-02-02@16:44'
|
|||||||
REM 13 AT 16:00 DURATION 72:00 MSG 72-hour event
|
REM 13 AT 16:00 DURATION 72:00 MSG 72-hour event
|
||||||
set a130 trigdate()
|
set a130 trigdate()
|
||||||
set a131 trigtime()
|
set a131 trigtime()
|
||||||
|
set a131b $Tt
|
||||||
set a132 trigdatetime()
|
set a132 trigdatetime()
|
||||||
set a133 trigduration()
|
set a133 trigduration()
|
||||||
set a134 trigeventstart()
|
set a134 trigeventstart()
|
||||||
@@ -925,6 +927,21 @@ REM Tue OMIT 2024-01-01 MSG Wookie
|
|||||||
# No error
|
# No error
|
||||||
REM Tue OMIT Wed 2024-01-01 MSG Blort
|
REM Tue OMIT Wed 2024-01-01 MSG Blort
|
||||||
|
|
||||||
|
# Make sure trigtime() is not reset between invocations
|
||||||
|
REM Tue AT 16:00 DURATION 30 MSG Thing One
|
||||||
|
REM [$T] AT [trigtime()+trigduration()] DURATION 15 MSG Thing Two
|
||||||
|
REM [$T] AT [$Tt+trigduration()] DURATION 30 MSG Thing Three
|
||||||
|
REM [$T] AT [trigtime()+trigduration()] DURATION 10 MSG Last Thing
|
||||||
|
|
||||||
|
# Make sure trigtime is not reset during parsing
|
||||||
|
REM Tue AT 16:00 MSG blort
|
||||||
|
REM Tue AT 10:00 DURATION [$Tt] MSG blort
|
||||||
|
REM Tue AT 16:00 MSG blort
|
||||||
|
REM Tue AT 10:00 DURATION [trigtime()] MSG blort
|
||||||
|
|
||||||
|
# Make sure shellescape does not mangle UTF-8 characters
|
||||||
|
msg [shellescape("😆")]
|
||||||
|
|
||||||
# Don't want Remind to queue reminders
|
# Don't want Remind to queue reminders
|
||||||
EXIT
|
EXIT
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user