mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 14:59:20 +02:00
Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7356138872 | ||
|
|
616966f5df | ||
|
|
a59e277c21 | ||
|
|
740ae2c3e9 | ||
|
|
25b7a40f2b | ||
|
|
2beaab1a2f | ||
|
|
60793d53c6 | ||
|
|
4f869c8c81 | ||
|
|
8955180a35 | ||
|
|
a30cbf5797 | ||
|
|
b2bd6109dc | ||
|
|
9455ec48d7 | ||
|
|
f751f5defa | ||
|
|
994edbebbe | ||
|
|
70959b791c | ||
|
|
524ece5119 | ||
|
|
6334bd61b6 | ||
|
|
2e56edd557 | ||
|
|
8cae1d21cd | ||
|
|
1de6ed16eb | ||
|
|
860cb94f41 | ||
|
|
6b505704e9 | ||
|
|
167631451d | ||
|
|
fa5180b94d | ||
|
|
ae01d7be43 | ||
|
|
d5ce39ade1 | ||
|
|
a043dfe8b9 | ||
|
|
7cfb75e3b3 | ||
|
|
a18f0d982f | ||
|
|
0e2dc805c2 | ||
|
|
4c1e11df2c | ||
|
|
76776d054a | ||
|
|
45ebd05cb6 | ||
|
|
0203ce3979 | ||
|
|
72d10178bf | ||
|
|
96f4e26d53 | ||
|
|
4fd86f1b6a | ||
|
|
2f3ee0aec3 | ||
|
|
a5dde31160 | ||
|
|
b45428df05 | ||
|
|
d938763643 | ||
|
|
e4e2157622 | ||
|
|
04b349c6c7 | ||
|
|
7fe3eb7391 | ||
|
|
c1992b577a | ||
|
|
632283d47f | ||
|
|
1d9e46997c | ||
|
|
861ce34022 | ||
|
|
32e8db322d | ||
|
|
3df2b72175 | ||
|
|
e7ac4f95be | ||
|
|
e7ed69287b | ||
|
|
2e80417f53 | ||
|
|
ee435d2bb9 | ||
|
|
bb516946be | ||
|
|
81157e1cb5 |
@@ -3,7 +3,7 @@ THE REMIND COPYRIGHT
|
|||||||
1. REMIND refers to the entire set of files and documentation in the
|
1. REMIND refers to the entire set of files and documentation in the
|
||||||
REMIND package.
|
REMIND package.
|
||||||
|
|
||||||
2. REMIND is Copyright 1992-2023 Dianne Skoll, except where noted in
|
2. REMIND is Copyright 1992-2024 Dianne Skoll, except where noted in
|
||||||
individual files.
|
individual files.
|
||||||
|
|
||||||
3. DISTRIBUTION AND USE
|
3. DISTRIBUTION AND USE
|
||||||
@@ -16,7 +16,7 @@ individual files.
|
|||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
675 Mass Ave, Cambridge, MA 02139, USA
|
51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|||||||
24
build.tk
Normal file → Executable file
24
build.tk
Normal file → Executable file
@@ -27,10 +27,10 @@ exec wish "$0" "$@"
|
|||||||
proc SetConfigDefaults {} {
|
proc SetConfigDefaults {} {
|
||||||
global Config
|
global Config
|
||||||
set Config(LAT_DEG) 45
|
set Config(LAT_DEG) 45
|
||||||
set Config(LAT_MIN) 24
|
set Config(LAT_MIN) 25
|
||||||
set Config(LAT_SEC) 14
|
set Config(LAT_SEC) 14
|
||||||
set Config(LON_DEG) 75
|
set Config(LON_DEG) 75
|
||||||
set Config(LON_MIN) 39
|
set Config(LON_MIN) 41
|
||||||
set Config(LON_SEC) 23
|
set Config(LON_SEC) 23
|
||||||
set Config(LOCATION) "Ottawa"
|
set Config(LOCATION) "Ottawa"
|
||||||
set Config(DEFAULT_PAGE) "Letter"
|
set Config(DEFAULT_PAGE) "Letter"
|
||||||
@@ -190,8 +190,8 @@ proc CreateLocationDialog { w } {
|
|||||||
|
|
||||||
grid $w.north $w.west
|
grid $w.north $w.west
|
||||||
grid $w.south $w.east
|
grid $w.south $w.east
|
||||||
grid $w.loclab -sticky e
|
grid $w.loclab -sticky e
|
||||||
grid $w.location -sticky nsew -row 6 -column 1
|
grid $w.location -sticky nsew -row 8 -column 1
|
||||||
}
|
}
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
@@ -293,9 +293,9 @@ proc BuildRemind {} {
|
|||||||
|
|
||||||
.msgs insert end "\n>>> Creating src/custom.h...\n\n" green
|
.msgs insert end "\n>>> Creating src/custom.h...\n\n" green
|
||||||
CreateCustomH
|
CreateCustomH
|
||||||
.msgs insert end ">>> Calling `./configure'...\n\n" green
|
.msgs insert end "\n>>> Calling `./configure'...\n\n" green
|
||||||
CallConfigure
|
CallConfigure
|
||||||
.msgs insert end ">>> Calling `make'...\n\n" green
|
.msgs insert end "\n>>> Calling `make'...\n\n" green
|
||||||
CallMake
|
CallMake
|
||||||
.msgs insert end "\n----------------------------------------------\n\n"
|
.msgs insert end "\n----------------------------------------------\n\n"
|
||||||
.msgs insert end "Remind" red
|
.msgs insert end "Remind" red
|
||||||
@@ -447,12 +447,12 @@ proc CreateCustomH {} {
|
|||||||
"#define DEFAULT_LATITUDE *" {
|
"#define DEFAULT_LATITUDE *" {
|
||||||
set lat [expr $LAT_DEG + ($LAT_MIN/60.0) + ($LAT_SEC/3600.0)];
|
set lat [expr $LAT_DEG + ($LAT_MIN/60.0) + ($LAT_SEC/3600.0)];
|
||||||
puts $out "#define DEFAULT_LATITUDE $lat"
|
puts $out "#define DEFAULT_LATITUDE $lat"
|
||||||
.msgs insert end "#define DEFAULT_LATITUDE $lat"
|
.msgs insert end "#define DEFAULT_LATITUDE $lat\n"
|
||||||
}
|
}
|
||||||
"#define DEFAULT_LONGITUDE *" {
|
"#define DEFAULT_LONGITUDE *" {
|
||||||
set lon [expr -1.0 * ($LON_DEG + ($LON_MIN/60.0) + ($LON_SEC/3600.0))]
|
set lon [expr -1.0 * ($LON_DEG + ($LON_MIN/60.0) + ($LON_SEC/3600.0))]
|
||||||
puts $out "#define DEFAULT_LONGITUDE $lon"
|
puts $out "#define DEFAULT_LONGITUDE $lon"
|
||||||
.msgs insert end "#define DEFAULT_LONGITUDE $lon"
|
.msgs insert end "#define DEFAULT_LONGITUDE $lon\n"
|
||||||
}
|
}
|
||||||
"#define LOCATION *" {
|
"#define LOCATION *" {
|
||||||
puts $out "#define LOCATION \"$Config(LOCATION)\""
|
puts $out "#define LOCATION \"$Config(LOCATION)\""
|
||||||
@@ -506,7 +506,13 @@ proc CallMake {} {
|
|||||||
"Icelandic" { set lang ICELANDIC }
|
"Icelandic" { set lang ICELANDIC }
|
||||||
default { set lang ENGLISH }
|
default { set lang ENGLISH }
|
||||||
}
|
}
|
||||||
RunCommand "make \"LANGDEF=-DLANG=$lang\""
|
set nproc 0
|
||||||
|
catch { set nproc [exec nproc] }
|
||||||
|
if { $nproc != 0 } {
|
||||||
|
RunCommand "make -j $nproc \"LANGDEF=-DLANG=$lang\""
|
||||||
|
} else {
|
||||||
|
RunCommand "make \"LANGDEF=-DLANG=$lang\""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ if test "$?" != 0 ; then
|
|||||||
fi
|
fi
|
||||||
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
||||||
|
|
||||||
VERSION=04.02.08
|
VERSION=04.02.09
|
||||||
AC_SUBST(VERSION)
|
AC_SUBST(VERSION)
|
||||||
AC_SUBST(PERL)
|
AC_SUBST(PERL)
|
||||||
AC_SUBST(PERLARTIFACTS)
|
AC_SUBST(PERLARTIFACTS)
|
||||||
|
|||||||
@@ -19,8 +19,7 @@
|
|||||||
|
|
||||||
;; You should have received a copy of the GNU General Public License
|
;; You should have received a copy of the GNU General Public License
|
||||||
;; along with this program; if not, write to the Free Software
|
;; along with this program; if not, write to the Free Software
|
||||||
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
|
||||||
;; 02111-1307, USA.
|
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,47 @@
|
|||||||
CHANGES TO REMIND
|
CHANGES TO REMIND
|
||||||
|
|
||||||
|
* VERSION 4.2 Patch 9 - 2024-02-04
|
||||||
|
|
||||||
|
- CHANGE: remind: Do not attempt to guess terminal background color on
|
||||||
|
startup. Only obtain it as needed. This can prevent mojibake from
|
||||||
|
appearing on terminals that don't support the color query escape
|
||||||
|
sequence.
|
||||||
|
|
||||||
|
- IMPROVEMENT: remind: Add new system variables $NumFullOmits,
|
||||||
|
$MaxFullOmits, $NumPartialOmits and $MaxPartialOmits.
|
||||||
|
|
||||||
|
- IMPROVEMENT: remind: Issue a warning if someone OMITs every possible date.
|
||||||
|
|
||||||
|
- IMPROVEMENT: remind: In several error messages complaining about limits
|
||||||
|
being exceeded, include the actual limit in the error message. Clarify
|
||||||
|
the man page regarding limits on the number of OMITs.
|
||||||
|
|
||||||
|
- MINOR NEW FEATURE: remind: The expression STRING * INT or INT * STRING
|
||||||
|
is now accepted and yields a string that is INT concatenations of the
|
||||||
|
origina STRING. In this case, INT must be non-negative and the total
|
||||||
|
string length can't exceed $MaxStringLen.
|
||||||
|
|
||||||
|
- DOCUMENTATION: Add "Astronomical Algorithms" by Jean Meeus to bibliography.
|
||||||
|
|
||||||
|
- DOCUMENTATION FIX: Update address of the Free Software Foundation in the
|
||||||
|
license file.
|
||||||
|
|
||||||
|
- DOCUMENTATION: Note that rem2ps is deprecated and will not received any
|
||||||
|
new features. Further development will happen on rem2pdf.
|
||||||
|
|
||||||
|
- BUG FIX: Preserve the filename() and priority context for queued reminders.
|
||||||
|
Previously, the filename information was lost and the priority was
|
||||||
|
coming from uninitialized memory (yikes!). bug found by Alexander
|
||||||
|
Möller.
|
||||||
|
|
||||||
|
- BUG FIX: build.tk: Various minor improvements.
|
||||||
|
|
||||||
|
- BUG FIX: remind: In server mode, if we de-queue a reminder without
|
||||||
|
triggering it, issue a "NOTE queued %d" message to update the
|
||||||
|
client's notion of the queue size.
|
||||||
|
|
||||||
|
- BUG FIX: tkremind: Fix typo found by Lorenzo Bazzanini.
|
||||||
|
|
||||||
* VERSION 4.2 Patch 8 - 2023-12-14
|
* VERSION 4.2 Patch 8 - 2023-12-14
|
||||||
|
|
||||||
- NEW FEATURE: Add the $MaxLateMinutes system variable. This suppresses
|
- NEW FEATURE: Add the $MaxLateMinutes system variable. This suppresses
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
# "#PSSTUFF" for nifty PostScript examples #
|
# "#PSSTUFF" for nifty PostScript examples #
|
||||||
# #
|
# #
|
||||||
# This file is part of REMIND. #
|
# This file is part of REMIND. #
|
||||||
# Copyright (C) 1992-2023 Dianne Skoll #
|
# Copyright (C) 1992-2024 Dianne Skoll #
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
# #
|
# #
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Not all sequences are supported by all terminals.
|
# Not all sequences are supported by all terminals.
|
||||||
|
|
||||||
# This file is part of REMIND
|
# This file is part of REMIND
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
if !defined("ansi_bold")
|
if !defined("ansi_bold")
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# US holidays
|
# US holidays
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# Copyright (C) 1992-2023 Dianne Skoll
|
# Copyright (C) 1992-2024 Dianne Skoll
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
|
||||||
REM [easterdate($Uy)-46] MSG Ash Wednesday
|
REM [easterdate($Uy)-46] MSG Ash Wednesday
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Danish language.
|
# Support for the Danish language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Mogens Lynnerup.
|
# This file is derived from a translation by Mogens Lynnerup.
|
||||||
|
|
||||||
SET $Sunday "Søndag"
|
SET $Sunday "Søndag"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the German language.
|
# Support for the German language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Wolfgang Thronicke
|
# This file is derived from a translation by Wolfgang Thronicke
|
||||||
|
|
||||||
# Day names
|
# Day names
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Support for the English language.
|
# Support for the English language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# Nothing to do for English since it is the default.
|
# Nothing to do for English since it is the default.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Spanish language.
|
# Support for the Spanish language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Rafa Couto <rafacouto@biogate.com>
|
# This file is derived from a translation by Rafa Couto <rafacouto@biogate.com>
|
||||||
|
|
||||||
SET $Sunday "Domingo"
|
SET $Sunday "Domingo"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Finnish language.
|
# Support for the Finnish language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Mikko Silvonen
|
# This file is derived from a translation by Mikko Silvonen
|
||||||
|
|
||||||
SET $Sunday "sunnuntai"
|
SET $Sunday "sunnuntai"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the French language.
|
# Support for the French language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Laurent Duperval
|
# This file is derived from a translation by Laurent Duperval
|
||||||
|
|
||||||
SET $Sunday "dimanche"
|
SET $Sunday "dimanche"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Hellenic (Greek) language.
|
# Support for the Hellenic (Greek) language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by jarlaxl lamat (jarlaxl@freemail.gr)
|
# This file is derived from a translation by jarlaxl lamat (jarlaxl@freemail.gr)
|
||||||
|
|
||||||
SET $Sunday "Κυριακή"
|
SET $Sunday "Κυριακή"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Icelanding language.
|
# Support for the Icelanding language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Björn Davíðsson (bjossi@snerpa.is)
|
# This file is derived from a translation by Björn Davíðsson (bjossi@snerpa.is)
|
||||||
|
|
||||||
SET $Sunday "sunnudagur"
|
SET $Sunday "sunnudagur"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Italian language.
|
# Support for the Italian language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# 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"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Dutch language.
|
# Support for the Dutch language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Willem Kasdorp and Erik-Jan Vens
|
# This file is derived from a translation by Willem Kasdorp and Erik-Jan Vens
|
||||||
|
|
||||||
SET $Sunday "zondag"
|
SET $Sunday "zondag"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Norwegian language.
|
# Support for the Norwegian language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Trygve Randen
|
# This file is derived from a translation by Trygve Randen
|
||||||
|
|
||||||
SET $Sunday "Søndag"
|
SET $Sunday "Søndag"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Polish language.
|
# Support for the Polish language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Jerzy Sobczyk
|
# This file is derived from a translation by Jerzy Sobczyk
|
||||||
|
|
||||||
SET $Sunday "Niedziela"
|
SET $Sunday "Niedziela"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the (Brazilian) Portuguese language.
|
# Support for the (Brazilian) Portuguese language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Marco Paganini
|
# This file is derived from a translation by Marco Paganini
|
||||||
|
|
||||||
SET $Sunday "domingo"
|
SET $Sunday "domingo"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Support for the Romanian language.
|
# Support for the Romanian language.
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# REMIND is Copyright (C) 1992-2023 by Dianne Skoll
|
# REMIND is Copyright (C) 1992-2024 by Dianne Skoll
|
||||||
# This file is derived from a translation by Liviu Daia
|
# This file is derived from a translation by Liviu Daia
|
||||||
|
|
||||||
SET $Sunday "Duminică"
|
SET $Sunday "Duminică"
|
||||||
|
|||||||
@@ -5,22 +5,25 @@ rem2ps \- draw a PostScript calendar from Remind output
|
|||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B rem2ps [\fIoptions\fR]
|
.B rem2ps [\fIoptions\fR]
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fBRem2ps\fR reads the standard input, which should be the results of
|
\fBrem2ps\fR reads the standard input, which should be the results of
|
||||||
running \fBRemind\fR with the \fB\-p\fR or \fB\-pp\fR option. It
|
running \fBRemind\fR with the \fB\-p\fR or \fB\-pp\fR option. It
|
||||||
emits PostScript code (which draws a calendar) to the standard output.
|
emits PostScript code (which draws a calendar) to the standard output.
|
||||||
.PP
|
.PP
|
||||||
See the section "Rem2PS Input Format" for details about the \fB\-p\fR
|
Although \fBrem2ps\fR will be maintained, no new features will be added
|
||||||
|
to it. Instead, all new development will continue on \fBrem2pdf\fR.
|
||||||
|
.PP
|
||||||
|
See the section "REM2PS INPUT FORMAT" for details about the \fB\-p\fR
|
||||||
data. This may be useful if you wish to create other \fBRemind\fR
|
data. This may be useful if you wish to create other \fBRemind\fR
|
||||||
back-ends.
|
back-ends.
|
||||||
.PP
|
.PP
|
||||||
Note that \fBRem2PS\fR does not handle UTF-8 input. If you need to
|
Note that \fBrem2ps\fR does not handle UTF-8 input. If you need to
|
||||||
render characters outside the ASCII character set, see
|
render characters outside the ASCII character set, see
|
||||||
\fBrem2pdf\fR instead.
|
\fBrem2pdf\fR instead.
|
||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
.B \-v
|
.B \-v
|
||||||
Be more verbose. This causes \fBRem2ps\fR to print progress messages
|
Be more verbose. This causes \fBrem2ps\fR to print progress messages
|
||||||
to the standard error stream. Normally, it is silent.
|
to the standard error stream. Normally, it is silent.
|
||||||
.TP
|
.TP
|
||||||
.B \-p file
|
.B \-p file
|
||||||
@@ -133,7 +136,7 @@ numbers.
|
|||||||
|
|
||||||
.PP
|
.PP
|
||||||
Type "rem2ps \-m help" for a list of available media. Note that the media
|
Type "rem2ps \-m help" for a list of available media. Note that the media
|
||||||
type (and all \fBRem2ps\fR options) are case-sensitive. If you don't use
|
type (and all \fBrem2ps\fR options) are case-sensitive. If you don't use
|
||||||
the \fB\-m\fR option, the media defaults to a compiled-in default - this
|
the \fB\-m\fR option, the media defaults to a compiled-in default - this
|
||||||
is usually Letter for North America and A4 for Europe. The "\-m help"
|
is usually Letter for North America and A4 for Europe. The "\-m help"
|
||||||
option will display the compiled-in default.
|
option will display the compiled-in default.
|
||||||
@@ -193,8 +196,8 @@ for good output:
|
|||||||
rem2ps \-ol 72 \-sh 12
|
rem2ps \-ol 72 \-sh 12
|
||||||
.fi
|
.fi
|
||||||
.SH USAGE
|
.SH USAGE
|
||||||
To use \fBRem2ps\fR, you should pipe the output of \fBRemind\fR with the \fB\-p\fR
|
To use \fBrem2ps\fR, you should pipe the output of \fBRemind\fR with the \fB\-p\fR
|
||||||
option to \fBRem2ps\fR, and then send the result to a printer. This is most easily
|
option to \fBrem2ps\fR, and then send the result to a printer. This is most easily
|
||||||
illustrated with examples:
|
illustrated with examples:
|
||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
@@ -228,10 +231,10 @@ calendar entries. This border is normally blank space.
|
|||||||
.TP
|
.TP
|
||||||
BoxWidth and BoxHeight
|
BoxWidth and BoxHeight
|
||||||
The width and height of the calendar box, from center-to-center of the
|
The width and height of the calendar box, from center-to-center of the
|
||||||
black gridlines.
|
black grid lines.
|
||||||
.TP
|
.TP
|
||||||
InBoxHeight
|
InBoxHeight
|
||||||
The height from the center of the bottom black gridline to the top
|
The height from the center of the bottom black grid line to the top
|
||||||
of the regular calendar entry area. The space from here to the top
|
of the regular calendar entry area. The space from here to the top
|
||||||
of the box is used only to draw the day number.
|
of the box is used only to draw the day number.
|
||||||
.TP
|
.TP
|
||||||
@@ -260,7 +263,7 @@ PostScript files. Always test your PostScript thoroughly with a PostScript
|
|||||||
viewer before sending it to the printer. You should not use any document
|
viewer before sending it to the printer. You should not use any document
|
||||||
structuring comments in your PostScript code.
|
structuring comments in your PostScript code.
|
||||||
.PP
|
.PP
|
||||||
In addition, prior to drawing a calendar page, \fBRem2ps\fR emits
|
In addition, prior to drawing a calendar page, \fBrem2ps\fR emits
|
||||||
the following PostScript code:
|
the following PostScript code:
|
||||||
.PP
|
.PP
|
||||||
.nf
|
.nf
|
||||||
@@ -320,8 +323,8 @@ For an example, create a file called "myprolog" whose contents are:
|
|||||||
} bind def
|
} bind def
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
Use that file with the \fBRem2ps\fR \fB\-p\fR option to create calendars
|
Use that file with the \fBrem2ps\fR \fB\-p\fR option to create calendars
|
||||||
with the year and month in large grey letters in the background of the
|
with the year and month in large gray letters in the background of the
|
||||||
calendar.
|
calendar.
|
||||||
.PP
|
.PP
|
||||||
.SH REM2PS INPUT FORMAT (-P OPTION)
|
.SH REM2PS INPUT FORMAT (-P OPTION)
|
||||||
@@ -380,7 +383,7 @@ been set to "-". The consistent use of "/" is designed to ease parsing.
|
|||||||
.PP
|
.PP
|
||||||
\fIspecial\fR is a string used
|
\fIspecial\fR is a string used
|
||||||
for "out-of-band" communication with back-ends. If the reminder
|
for "out-of-band" communication with back-ends. If the reminder
|
||||||
is a normal reminder, \fIspecial\fR is "*". The \fBRem2PS\fR
|
is a normal reminder, \fIspecial\fR is "*". The \fBrem2ps\fR
|
||||||
back-end understands the specials \fBPostScript\fR and \fBPSFile\fR.
|
back-end understands the specials \fBPostScript\fR and \fBPSFile\fR.
|
||||||
Other back-ends may understand other specials. A back end should
|
Other back-ends may understand other specials. A back end should
|
||||||
\fIsilently ignore\fR a reminder with a special it doesn't understand.
|
\fIsilently ignore\fR a reminder with a special it doesn't understand.
|
||||||
@@ -674,17 +677,17 @@ is desired.
|
|||||||
|
|
||||||
|
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
Rem2PS was written by Dianne Skoll <dianne@skoll.ca>
|
rem2ps was written by Dianne Skoll <dianne@skoll.ca>
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
All \fBRem2ps\fR options are case-sensitive, unlike \fBRemind\fR.
|
All \fBrem2ps\fR options are case-sensitive, unlike \fBRemind\fR.
|
||||||
Any time you supply
|
Any time you supply
|
||||||
a font name or size, line thickness, or border width, it is treated as a
|
a font name or size, line thickness, or border width, it is treated as a
|
||||||
string and sent straight to the PostScript interpreter. Thus, if you
|
string and sent straight to the PostScript interpreter. Thus, if you
|
||||||
supply invalid fonts or sizes, \fBRem2ps\fR will not complain, but the
|
supply invalid fonts or sizes, \fBrem2ps\fR will not complain, but the
|
||||||
resulting PostScript output will probably not work.
|
resulting PostScript output will probably not work.
|
||||||
.PP
|
.PP
|
||||||
You should ensure that the values you supply for margin widths are sensible.
|
You should ensure that the values you supply for margin widths are sensible.
|
||||||
If they are too big for the media size, \fBRem2ps\fR will not complain,
|
If they are too big for the media size, \fBrem2ps\fR will not complain,
|
||||||
but again, the PostScript output will probably not work.
|
but again, the PostScript output will probably not work.
|
||||||
.SH HOME PAGE
|
.SH HOME PAGE
|
||||||
https://dianne.skoll.ca/projects/remind/
|
https://dianne.skoll.ca/projects/remind/
|
||||||
|
|||||||
@@ -1138,7 +1138,7 @@ reminder is queued for later activation. When \fBRemind\fR has
|
|||||||
finished processing the reminder file, it puts itself in the
|
finished processing the reminder file, it puts itself in the
|
||||||
background, and activates timed reminders when the system time reached
|
background, and activates timed reminders when the system time reached
|
||||||
the specified time. Note that if you use the \fBNOQUEUE\fR modifier
|
the specified time. Note that if you use the \fBNOQUEUE\fR modifier
|
||||||
in the \fBREM\fR command, then this queueing and background activation
|
in the \fBREM\fR command, then this queuing and background activation
|
||||||
is \fInot\fR performed. \fBNOQUEUE\fR is useful if you want a time
|
is \fInot\fR performed. \fBNOQUEUE\fR is useful if you want a time
|
||||||
to be associated with a reminder (eg, in the calendar) but are not
|
to be associated with a reminder (eg, in the calendar) but are not
|
||||||
interested in a popup reminder happening at the specified time.
|
interested in a popup reminder happening at the specified time.
|
||||||
@@ -1210,7 +1210,9 @@ in the bodies of timed reminders, then when the timed reminders are
|
|||||||
activated, the variables and functions have the definitions that were
|
activated, the variables and functions have the definitions that were
|
||||||
in effect at the end of the reminder script. These definitions may
|
in effect at the end of the reminder script. These definitions may
|
||||||
\fInot\fR necessarily be those that were in effect at the time the reminder
|
\fInot\fR necessarily be those that were in effect at the time the reminder
|
||||||
was queued.
|
was queued. In addition, the OMIT context is whatever was in effect at
|
||||||
|
the end of the reminder script, which may not necessarily be the same
|
||||||
|
as when the \fBREM\fR command was first processed.
|
||||||
.PP
|
.PP
|
||||||
.B THE SCHED AND WARN KEYWORDS
|
.B THE SCHED AND WARN KEYWORDS
|
||||||
.PP
|
.PP
|
||||||
@@ -1704,6 +1706,11 @@ For example, the following sequences are equivalent:
|
|||||||
OMIT 3 Jan 2011 THROUGH 5 Jan 2011
|
OMIT 3 Jan 2011 THROUGH 5 Jan 2011
|
||||||
.fi
|
.fi
|
||||||
.PP
|
.PP
|
||||||
|
Note that \fBRemind\fR has a compiled-in limit to the number of full
|
||||||
|
OMITs. If you omit a range of \fIN\fR fully-specified (ie, year
|
||||||
|
included) days, then \fIN\fR full OMITs are used up. Trying to omit a
|
||||||
|
very large range may result in the error "Too many full OMITs"
|
||||||
|
.PP
|
||||||
You can make a THROUGH \fBOMIT\fR do double-duty as a \fBREM\fR command as
|
You can make a THROUGH \fBOMIT\fR do double-duty as a \fBREM\fR command as
|
||||||
long as both dates are fully specified
|
long as both dates are fully specified
|
||||||
.PP
|
.PP
|
||||||
@@ -2162,7 +2169,10 @@ Unary minus. Can be applied to an \fBINT\fR. Returns the negative
|
|||||||
of the operand.
|
of the operand.
|
||||||
.TP
|
.TP
|
||||||
.B *
|
.B *
|
||||||
Multiplication. Returns the product of two \fBINT\fRs.
|
Multiplication. Returns the product of two \fBINT\fRs. Alternatively, if
|
||||||
|
one argument is a \fBSTRING\fR and the other an \fBINT\fR, returns a
|
||||||
|
\fBSTRING\fR consisting of the INT number of repeats of the original STRING.
|
||||||
|
In this case, the INT argument cannot be negative.
|
||||||
.TP
|
.TP
|
||||||
.B /
|
.B /
|
||||||
Integer division. Returns the quotient of two \fBINT\fRs, discarding the
|
Integer division. Returns the quotient of two \fBINT\fRs, discarding the
|
||||||
@@ -2588,7 +2598,9 @@ The maximum number of iterations for the \fBSATISFY\fR clause
|
|||||||
A limit on the longest string that \fBRemind\fR will allow you
|
A limit on the longest string that \fBRemind\fR will allow you
|
||||||
to create. The default is 65535. If you set \fB$MaxStringLen\fR to 0
|
to create. The default is 65535. If you set \fB$MaxStringLen\fR to 0
|
||||||
or to -1, then \fBremind\fR will allow you to create arbitrarily-long
|
or to -1, then \fBremind\fR will allow you to create arbitrarily-long
|
||||||
strings, at least until it runs out of memory.
|
strings, at least until it runs out of memory. We do not recommend
|
||||||
|
setting \fB$MaxStringLen\fR to 0 or -1 because it is very easy to write
|
||||||
|
code that DOSes \fBRemind\fR in that case.
|
||||||
.TP
|
.TP
|
||||||
.B $MinsFromUTC
|
.B $MinsFromUTC
|
||||||
The number of minutes between Universal Time Coordinated and local time. If
|
The number of minutes between Universal Time Coordinated and local time. If
|
||||||
@@ -2603,6 +2615,18 @@ must also set \fB$CalcUTC\fR to 0 with the \fB\-i\fR option.
|
|||||||
.B $NextMode (read-only)
|
.B $NextMode (read-only)
|
||||||
If non-zero, then the \fB\-n\fR option was supplied on the command line.
|
If non-zero, then the \fB\-n\fR option was supplied on the command line.
|
||||||
.TP
|
.TP
|
||||||
|
.B $MaxFullOmits (read-only)
|
||||||
|
The maximum number of full OMITs allowed (a compiled-in constant.)
|
||||||
|
.TP
|
||||||
|
.B $MaxPartialOmits (read-only)
|
||||||
|
The maximum number of partial OMITs allowed (a compiled-in constant.)
|
||||||
|
.TP
|
||||||
|
.B $NumFullOmits (read-only)
|
||||||
|
The number of full OMITs in the current OMIT context.
|
||||||
|
.TP
|
||||||
|
.B $NumPartialOmits (read-only)
|
||||||
|
The number of partial OMITs in the current OMIT context.
|
||||||
|
.TP
|
||||||
.B $NumQueued (read-only)
|
.B $NumQueued (read-only)
|
||||||
Contains the number of reminders queued so far for background
|
Contains the number of reminders queued so far for background
|
||||||
timed triggering.
|
timed triggering.
|
||||||
@@ -3640,7 +3664,7 @@ not supplied, then it defaults to \fBtoday()\fR.
|
|||||||
.PP
|
.PP
|
||||||
The return value of \fBsoleq()\fR is a \fBDATETIME\fR object specifying
|
The return value of \fBsoleq()\fR is a \fBDATETIME\fR object specifying
|
||||||
the date and time of the solstice or equinox in the local time zone. It
|
the date and time of the solstice or equinox in the local time zone. It
|
||||||
should be accurate to within 3 minues or so in the worst case.
|
should be accurate to within 3 minutes or so in the worst case.
|
||||||
.PP
|
.PP
|
||||||
See the included file \fB$SysInclude/seasons.rem\fR for examples of how
|
See the included file \fB$SysInclude/seasons.rem\fR for examples of how
|
||||||
to use \fBsoleq()\fR.
|
to use \fBsoleq()\fR.
|
||||||
@@ -5537,13 +5561,13 @@ the anniversary of a death is. The following rules are used:
|
|||||||
o
|
o
|
||||||
If the death occurred on 30 Heshvan, and Heshvan in the year after the
|
If the death occurred on 30 Heshvan, and Heshvan in the year after the
|
||||||
death is \fIchaser\fR, then the jahrzeit is observed on 29 Heshvan in years
|
death is \fIchaser\fR, then the jahrzeit is observed on 29 Heshvan in years
|
||||||
when Heshvan is \fIchaser\fR. Otherwise, the yahrzeit is observed on 1
|
when Heshvan is \fIchaser\fR. Otherwise, the jahrzeit is observed on 1
|
||||||
Kislev when Heshvan is \fIchaser\fR.
|
Kislev when Heshvan is \fIchaser\fR.
|
||||||
.TP
|
.TP
|
||||||
o
|
o
|
||||||
If the death occurred on 30 Kislev, and Kislev in the year after the
|
If the death occurred on 30 Kislev, and Kislev in the year after the
|
||||||
death is \fIchaser\fR, then the jahrzeit is observed on 29 Kislev in years
|
death is \fIchaser\fR, then the jahrzeit is observed on 29 Kislev in years
|
||||||
when Kislev is \fIchaser\fR. Otherwise, the yahrzeit is observed on 1
|
when Kislev is \fIchaser\fR. Otherwise, the jahrzeit is observed on 1
|
||||||
Tevet when Kislev is \fIchaser\fR.
|
Tevet when Kislev is \fIchaser\fR.
|
||||||
.TP
|
.TP
|
||||||
o
|
o
|
||||||
@@ -5950,6 +5974,9 @@ Almanac Office, USNO.
|
|||||||
.PP
|
.PP
|
||||||
Richard Siegel and Michael and Sharon Strassfeld, \fIThe First Jewish
|
Richard Siegel and Michael and Sharon Strassfeld, \fIThe First Jewish
|
||||||
Catalog\fR, Jewish Publication Society of America.
|
Catalog\fR, Jewish Publication Society of America.
|
||||||
|
.PP
|
||||||
|
Jean Meeus, \fIAstronomical Algorithms, Second Edition\fR, Willmann-Bell, Inc.
|
||||||
|
|
||||||
.SH HOME PAGE
|
.SH HOME PAGE
|
||||||
https://dianne.skoll.ca/projects/remind/
|
https://dianne.skoll.ca/projects/remind/
|
||||||
.SH MAILING LIST
|
.SH MAILING LIST
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ If you create "timed" reminders, \fBTkRemind\fR will queue them in
|
|||||||
the background and pop up boxes as they are triggered. Additionally,
|
the background and pop up boxes as they are triggered. Additionally,
|
||||||
if you created the reminder using \fBTkRemind\fR, you will be given the
|
if you created the reminder using \fBTkRemind\fR, you will be given the
|
||||||
option of "turning off" the reminder for the rest of the day.
|
option of "turning off" the reminder for the rest of the day.
|
||||||
\fBTkRemind\fR achieves queueing of background reminders by running
|
\fBTkRemind\fR achieves queuing of background reminders by running
|
||||||
\fBRemind\fR in \fIserver mode\fR, described later.
|
\fBRemind\fR in \fIserver mode\fR, described later.
|
||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
@@ -436,10 +436,16 @@ NOTE JSONQUEUE
|
|||||||
Indicates that queue contents in JSON format are about to follow. The
|
Indicates that queue contents in JSON format are about to follow. The
|
||||||
end of the queue is indicated by a NOTE ENDJSONQUEUE line.
|
end of the queue is indicated by a NOTE ENDJSONQUEUE line.
|
||||||
|
|
||||||
|
.PP
|
||||||
|
Please note that \fBRemind\fR can write a status message \fIat any time\fR
|
||||||
|
and not just in response to a command sent to its standard input. Therefore,
|
||||||
|
a program that runs \fBRemind\fR in server mode must be prepared to handle
|
||||||
|
asynchronous status messages.
|
||||||
|
|
||||||
.SH AUTHOR
|
.SH AUTHOR
|
||||||
TkRemind was written by Dianne Skoll <dianne@skoll.ca>
|
TkRemind was written by Dianne Skoll <dianne@skoll.ca>
|
||||||
|
|
||||||
\fBTkRemind\fR is Copyright 1996-2023 by Dianne Skoll.
|
\fBTkRemind\fR is Copyright 1996-2024 by Dianne Skoll.
|
||||||
|
|
||||||
.SH FILES
|
.SH FILES
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# A cheesy graphical front/back end for Remind using Tcl/Tk
|
# A cheesy graphical front/back end for Remind using Tcl/Tk
|
||||||
#
|
#
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# Copyright (C) 1992-2023 Dianne Skoll
|
# Copyright (C) 1992-2024 Dianne Skoll
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------
|
#--------------------------------------------------------------
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ set Option(PrintSmallCalendars) 1
|
|||||||
set OptDescr(PrintFormat) "Print format: pdf or ps"
|
set OptDescr(PrintFormat) "Print format: pdf or ps"
|
||||||
set Option(PrintFormat) ps
|
set Option(PrintFormat) ps
|
||||||
|
|
||||||
set WarningHeaders [list "# Lines staring with REM TAG TKTAGnnn ... were created by tkremind" "# Do not edit them by hand or results may be unpredictable."]
|
set WarningHeaders [list "# Lines starting with REM TAG TKTAGnnn ... were created by tkremind" "# Do not edit them by hand or results may be unpredictable."]
|
||||||
|
|
||||||
# Highest tag seen so far. Array of tags is stored in ReminderTags()
|
# Highest tag seen so far. Array of tags is stored in ReminderTags()
|
||||||
set HighestTagSoFar 0
|
set HighestTagSoFar 0
|
||||||
@@ -312,6 +312,10 @@ proc is_warning_header { line } {
|
|||||||
if {"$line" == "$h"} {
|
if {"$line" == "$h"} {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
# Ignore prior typo line too
|
||||||
|
if {"$line" == "# Lines staring with REM TAG TKTAGnnn ... were created by tkremind"} {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@@ -2856,12 +2860,6 @@ proc IssueBackgroundReminder { file time now tag } {
|
|||||||
exec "/bin/sh" "-c" $Option(RunCmd) "&"
|
exec "/bin/sh" "-c" $Option(RunCmd) "&"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# reread status
|
|
||||||
if {$file != "stdin"} {
|
|
||||||
puts $file "STATUS"
|
|
||||||
flush $file
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
@@ -3746,7 +3744,7 @@ proc DoMoonSpecial { n stuff fntag day } {
|
|||||||
# Displays current date and time in status window
|
# Displays current date and time in status window
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc DisplayTime {} {
|
proc DisplayTime {} {
|
||||||
global TwentyFourHourMode
|
global TwentyFourHourMode DaemonFile
|
||||||
if {$TwentyFourHourMode} {
|
if {$TwentyFourHourMode} {
|
||||||
set msg [clock format [clock seconds] -format "%e %b %Y %H:%M"]
|
set msg [clock format [clock seconds] -format "%e %b %Y %H:%M"]
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
201
src/calendar.c
201
src/calendar.c
@@ -5,7 +5,7 @@
|
|||||||
/* The code for generating a calendar. */
|
/* The code for generating a calendar. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -556,11 +556,11 @@ static void goff(void)
|
|||||||
static void
|
static void
|
||||||
ClampColor(int *r, int *g, int *b)
|
ClampColor(int *r, int *g, int *b)
|
||||||
{
|
{
|
||||||
if (TerminalBackground == TERMINAL_BACKGROUND_UNKNOWN) {
|
if (GetTerminalBackground() == TERMINAL_BACKGROUND_UNKNOWN) {
|
||||||
/* No special clamping if terminal background is unknown */
|
/* No special clamping if terminal background is unknown */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (TerminalBackground == TERMINAL_BACKGROUND_DARK) {
|
if (GetTerminalBackground() == TERMINAL_BACKGROUND_DARK) {
|
||||||
if (*r <= 64 && *g <= 64 && *b <= 64) {
|
if (*r <= 64 && *g <= 64 && *b <= 64) {
|
||||||
int max = *r;
|
int max = *r;
|
||||||
double factor;
|
double factor;
|
||||||
@@ -579,7 +579,7 @@ ClampColor(int *r, int *g, int *b)
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (TerminalBackground == TERMINAL_BACKGROUND_LIGHT) {
|
if (GetTerminalBackground() == TERMINAL_BACKGROUND_LIGHT) {
|
||||||
if (*r > 191 && *g > 191 && *b > 191) {
|
if (*r > 191 && *g > 191 && *b > 191) {
|
||||||
int min = *r;
|
int min = *r;
|
||||||
if (*g < min) min = *g;
|
if (*g < min) min = *g;
|
||||||
@@ -667,11 +667,11 @@ Colorize(int r, int g, int b, int bg, int clamp)
|
|||||||
if (b > 64) b = 1;
|
if (b > 64) b = 1;
|
||||||
else b = 0;
|
else b = 0;
|
||||||
|
|
||||||
if (clamp && TerminalBackground == TERMINAL_BACKGROUND_DARK && !bg) {
|
if (clamp && GetTerminalBackground() == TERMINAL_BACKGROUND_DARK && !bg) {
|
||||||
/* Convert black-on-black to grey */
|
/* Convert black-on-black to grey */
|
||||||
if (!r && !g && !b) return VT100Colors[1][0][0][0];
|
if (!r && !g && !b) return VT100Colors[1][0][0][0];
|
||||||
}
|
}
|
||||||
if (clamp && TerminalBackground == TERMINAL_BACKGROUND_LIGHT && !bg) {
|
if (clamp && GetTerminalBackground() == TERMINAL_BACKGROUND_LIGHT && !bg) {
|
||||||
/* Convert white-on-white to grey */
|
/* Convert white-on-white to grey */
|
||||||
if (r && g && b) return VT100Colors[1][0][0][0];
|
if (r && g && b) return VT100Colors[1][0][0][0];
|
||||||
}
|
}
|
||||||
@@ -2211,10 +2211,120 @@ static void WriteSimpleEntryProtocol1(CalEntry *e)
|
|||||||
printf("%s\n", e->text);
|
printf("%s\n", e->text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WriteJSONTimeTrigger(TimeTrig const *tt)
|
||||||
|
{
|
||||||
|
PrintJSONKeyPairTime("time", tt->ttime);
|
||||||
|
PrintJSONKeyPairTime("nexttime", tt->nexttime);
|
||||||
|
PrintJSONKeyPairInt("tdelta", tt->delta);
|
||||||
|
PrintJSONKeyPairInt("trep", tt->rep);
|
||||||
|
if (tt->duration != NO_TIME) {
|
||||||
|
PrintJSONKeyPairInt("duration", tt->duration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteJSONTrigger(Trigger const *t, int include_tags, int today)
|
||||||
|
{
|
||||||
|
/* wd is an array of days from 0=monday to 6=sunday.
|
||||||
|
We convert to array of strings */
|
||||||
|
if (t->wd != NO_WD) {
|
||||||
|
printf("\"wd\":[");
|
||||||
|
int done = 0;
|
||||||
|
int i;
|
||||||
|
for (i=0; i<7; i++) {
|
||||||
|
if (t->wd & (1 << i)) {
|
||||||
|
if (done) {
|
||||||
|
printf(",");
|
||||||
|
}
|
||||||
|
done = 1;
|
||||||
|
printf("\"%s\"", EnglishDayName[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("],");
|
||||||
|
}
|
||||||
|
if (t->d != NO_DAY) {
|
||||||
|
PrintJSONKeyPairInt("d", t->d);
|
||||||
|
}
|
||||||
|
if (t->m != NO_MON) {
|
||||||
|
PrintJSONKeyPairInt("m", t->m+1);
|
||||||
|
}
|
||||||
|
if (t->y != NO_YR) {
|
||||||
|
PrintJSONKeyPairInt("y", t->y);
|
||||||
|
}
|
||||||
|
if (t->back) {
|
||||||
|
PrintJSONKeyPairInt("back", t->back);
|
||||||
|
}
|
||||||
|
if (t->delta) {
|
||||||
|
PrintJSONKeyPairInt("delta", t->delta);
|
||||||
|
}
|
||||||
|
if (t->rep) {
|
||||||
|
PrintJSONKeyPairInt("rep", t->rep);
|
||||||
|
}
|
||||||
|
/* Local omit is an array of days from 0=monday to 6=sunday.
|
||||||
|
We convert to array of strings */
|
||||||
|
if (t->localomit != NO_WD) {
|
||||||
|
printf("\"localomit\":[");
|
||||||
|
int done = 0;
|
||||||
|
int i;
|
||||||
|
for (i=0; i<7; i++) {
|
||||||
|
if (t->localomit & (1 << i)) {
|
||||||
|
if (done) {
|
||||||
|
printf(",");
|
||||||
|
}
|
||||||
|
done = 1;
|
||||||
|
printf("\"%s\"", EnglishDayName[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("],");
|
||||||
|
}
|
||||||
|
switch(t->skip) {
|
||||||
|
case SKIP_SKIP:
|
||||||
|
PrintJSONKeyPairString("skip", "SKIP");
|
||||||
|
break;
|
||||||
|
case BEFORE_SKIP:
|
||||||
|
PrintJSONKeyPairString("skip", "BEFORE");
|
||||||
|
break;
|
||||||
|
case AFTER_SKIP:
|
||||||
|
PrintJSONKeyPairString("skip", "AFTER");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
PrintJSONKeyPairDate("until", t->until);
|
||||||
|
if (t->once != NO_ONCE) {
|
||||||
|
PrintJSONKeyPairInt("once", t->once);
|
||||||
|
}
|
||||||
|
if (t->scanfrom != today) {
|
||||||
|
PrintJSONKeyPairDate("scanfrom", t->scanfrom);
|
||||||
|
}
|
||||||
|
PrintJSONKeyPairDate("from", t->from);
|
||||||
|
PrintJSONKeyPairInt("priority", t->priority);
|
||||||
|
PrintJSONKeyPairDateTime("eventstart", t->eventstart);
|
||||||
|
if (t->eventduration != NO_TIME) {
|
||||||
|
PrintJSONKeyPairInt("eventduration", t->eventduration);
|
||||||
|
}
|
||||||
|
if (t->maybe_uncomputable) {
|
||||||
|
PrintJSONKeyPairInt("maybe_uncomputable", 1);
|
||||||
|
}
|
||||||
|
if (t->noqueue) {
|
||||||
|
PrintJSONKeyPairInt("noqueue", 1);
|
||||||
|
}
|
||||||
|
if (*t->sched) {
|
||||||
|
PrintJSONKeyPairString("sched", t->sched);
|
||||||
|
}
|
||||||
|
if (*t->warn) {
|
||||||
|
PrintJSONKeyPairString("warn", t->warn);
|
||||||
|
}
|
||||||
|
if (*t->omitfunc) {
|
||||||
|
PrintJSONKeyPairString("omitfunc", t->omitfunc);
|
||||||
|
}
|
||||||
|
if (t->addomit) {
|
||||||
|
PrintJSONKeyPairInt("addomit", 1);
|
||||||
|
}
|
||||||
|
if (include_tags) {
|
||||||
|
PrintJSONKeyPairString("tags", DBufValue(&(t->tags)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void WriteSimpleEntryProtocol2(CalEntry *e, int today)
|
static void WriteSimpleEntryProtocol2(CalEntry *e, int today)
|
||||||
{
|
{
|
||||||
int done = 0;
|
|
||||||
char const *s;
|
char const *s;
|
||||||
if (DoPrefixLineNo) {
|
if (DoPrefixLineNo) {
|
||||||
PrintJSONKeyPairString("filename", e->filename);
|
PrintJSONKeyPairString("filename", e->filename);
|
||||||
@@ -2234,88 +2344,13 @@ static void WriteSimpleEntryProtocol2(CalEntry *e, int today)
|
|||||||
PrintJSONKeyPairInt("trep", e->tt.rep);
|
PrintJSONKeyPairInt("trep", e->tt.rep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e->trig.eventduration != NO_TIME) {
|
WriteJSONTrigger(&e->trig, 0, today);
|
||||||
PrintJSONKeyPairInt("eventduration", e->trig.eventduration);
|
|
||||||
}
|
|
||||||
/* wd is an array of days from 0=monday to 6=sunday.
|
|
||||||
We convert to array of strings */
|
|
||||||
if (e->trig.wd != NO_WD) {
|
|
||||||
printf("\"wd\":[");
|
|
||||||
done = 0;
|
|
||||||
int i;
|
|
||||||
for (i=0; i<7; i++) {
|
|
||||||
if (e->trig.wd & (1 << i)) {
|
|
||||||
if (done) {
|
|
||||||
printf(",");
|
|
||||||
}
|
|
||||||
done = 1;
|
|
||||||
printf("\"%s\"", EnglishDayName[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printf("],");
|
|
||||||
}
|
|
||||||
if (e->trig.d != NO_DAY) {
|
|
||||||
PrintJSONKeyPairInt("d", e->trig.d);
|
|
||||||
}
|
|
||||||
if (e->trig.m != NO_MON) {
|
|
||||||
PrintJSONKeyPairInt("m", e->trig.m+1);
|
|
||||||
}
|
|
||||||
if (e->trig.y != NO_YR) {
|
|
||||||
PrintJSONKeyPairInt("y", e->trig.y);
|
|
||||||
}
|
|
||||||
PrintJSONKeyPairDateTime("eventstart", e->trig.eventstart);
|
|
||||||
if (e->trig.back) {
|
|
||||||
PrintJSONKeyPairInt("back", e->trig.back);
|
|
||||||
}
|
|
||||||
if (e->trig.delta) {
|
|
||||||
PrintJSONKeyPairInt("delta", e->trig.delta);
|
|
||||||
}
|
|
||||||
if (e->trig.rep) {
|
|
||||||
PrintJSONKeyPairInt("rep", e->trig.rep);
|
|
||||||
}
|
|
||||||
if (e->nonconst_expr) {
|
if (e->nonconst_expr) {
|
||||||
PrintJSONKeyPairInt("nonconst_expr", e->nonconst_expr);
|
PrintJSONKeyPairInt("nonconst_expr", e->nonconst_expr);
|
||||||
}
|
}
|
||||||
if (e->if_depth) {
|
if (e->if_depth) {
|
||||||
PrintJSONKeyPairInt("if_depth", e->if_depth);
|
PrintJSONKeyPairInt("if_depth", e->if_depth);
|
||||||
}
|
}
|
||||||
switch(e->trig.skip) {
|
|
||||||
case SKIP_SKIP:
|
|
||||||
PrintJSONKeyPairString("skip", "SKIP");
|
|
||||||
break;
|
|
||||||
case BEFORE_SKIP:
|
|
||||||
PrintJSONKeyPairString("skip", "BEFORE");
|
|
||||||
break;
|
|
||||||
case AFTER_SKIP:
|
|
||||||
PrintJSONKeyPairString("skip", "AFTER");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
/* Local omit is an array of days from 0=monday to 6=sunday.
|
|
||||||
We convert to array of strings */
|
|
||||||
if (e->trig.localomit != NO_WD) {
|
|
||||||
printf("\"localomit\":[");
|
|
||||||
done = 0;
|
|
||||||
int i;
|
|
||||||
for (i=0; i<7; i++) {
|
|
||||||
if (e->trig.localomit & (1 << i)) {
|
|
||||||
if (done) {
|
|
||||||
printf(",");
|
|
||||||
}
|
|
||||||
done = 1;
|
|
||||||
printf("\"%s\"", EnglishDayName[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printf("],");
|
|
||||||
}
|
|
||||||
PrintJSONKeyPairDate("until", e->trig.until);
|
|
||||||
if (e->trig.once != NO_ONCE) {
|
|
||||||
PrintJSONKeyPairInt("once", e->trig.once);
|
|
||||||
}
|
|
||||||
if (e->trig.scanfrom != today) {
|
|
||||||
PrintJSONKeyPairDate("scanfrom", e->trig.scanfrom);
|
|
||||||
}
|
|
||||||
PrintJSONKeyPairDate("from", e->trig.from);
|
|
||||||
PrintJSONKeyPairInt("priority", e->trig.priority);
|
|
||||||
|
|
||||||
if (e->is_color) {
|
if (e->is_color) {
|
||||||
PrintJSONKeyPairInt("r", e->r);
|
PrintJSONKeyPairInt("r", e->r);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* which you can customize. */
|
/* which you can customize. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* which you can customize. */
|
/* which you can customize. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
/* commands. */
|
/* commands. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -1147,7 +1147,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int dse, int is_queue
|
|||||||
DoMsgCommand(msg_command, DBufValue(&buf));
|
DoMsgCommand(msg_command, DBufValue(&buf));
|
||||||
} else {
|
} else {
|
||||||
/* Add a space before "NOTE endreminder" */
|
/* Add a space before "NOTE endreminder" */
|
||||||
if (Daemon < 0 && !strncmp(DBufValue(&buf), "NOTE endreminder", 16)) {
|
if (IsServerMode() && !strncmp(DBufValue(&buf), "NOTE endreminder", 16)) {
|
||||||
printf(" %s", DBufValue(&buf));
|
printf(" %s", DBufValue(&buf));
|
||||||
} else {
|
} else {
|
||||||
printf("%s", DBufValue(&buf));
|
printf("%s", DBufValue(&buf));
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* reminders are triggered. */
|
/* reminders are triggered. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* buffers. */
|
/* buffers. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Declaration of functions for manipulating dynamic buffers */
|
/* Declaration of functions for manipulating dynamic buffers */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
12
src/err.h
12
src/err.h
@@ -5,7 +5,7 @@
|
|||||||
/* Error definitions. */
|
/* Error definitions. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -129,6 +129,10 @@
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define STR(X) STR2(X)
|
||||||
|
#define STR2(X) #X
|
||||||
|
|
||||||
|
|
||||||
#ifndef L_ERR_OVERRIDE
|
#ifndef L_ERR_OVERRIDE
|
||||||
EXTERN char *ErrMsg[]
|
EXTERN char *ErrMsg[]
|
||||||
|
|
||||||
@@ -165,7 +169,7 @@ EXTERN char *ErrMsg[]
|
|||||||
"Number too high",
|
"Number too high",
|
||||||
"Number too low",
|
"Number too low",
|
||||||
"Can't open file",
|
"Can't open file",
|
||||||
"INCLUDE nested too deeply",
|
"INCLUDE nested too deeply (max. " STR(INCLUDE_NEST) ")",
|
||||||
"Parse error",
|
"Parse error",
|
||||||
"Can't compute trigger",
|
"Can't compute trigger",
|
||||||
"Too many nested IFs",
|
"Too many nested IFs",
|
||||||
@@ -189,8 +193,8 @@ EXTERN char *ErrMsg[]
|
|||||||
"Day specified twice",
|
"Day specified twice",
|
||||||
"Unknown token",
|
"Unknown token",
|
||||||
"Must specify month in OMIT command",
|
"Must specify month in OMIT command",
|
||||||
"Too many partial OMITs",
|
"Too many partial OMITs (max. " STR(MAX_PARTIAL_OMITS) ")",
|
||||||
"Too many full OMITs",
|
"Too many full OMITs (max. " STR(MAX_FULL_OMITS) ")",
|
||||||
"Warning: PUSH-OMIT-CONTEXT without matching POP-OMIT-CONTEXT",
|
"Warning: PUSH-OMIT-CONTEXT without matching POP-OMIT-CONTEXT",
|
||||||
"Error reading",
|
"Error reading",
|
||||||
"Expecting end-of-line",
|
"Expecting end-of-line",
|
||||||
|
|||||||
60
src/expr.c
60
src/expr.c
@@ -5,7 +5,7 @@
|
|||||||
/* This file contains routines to parse and evaluate */
|
/* This file contains routines to parse and evaluate */
|
||||||
/* expressions. */
|
/* expressions. */
|
||||||
/* */
|
/* */
|
||||||
/* Copyright 1992-2023 by Dianne Skoll */
|
/* Copyright 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -944,7 +944,8 @@ static int Subtract(void)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static int Multiply(void)
|
static int Multiply(void)
|
||||||
{
|
{
|
||||||
Value v1, v2;
|
Value v1, v2, v3;
|
||||||
|
char *ptr;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
PopValStack(v2);
|
PopValStack(v2);
|
||||||
@@ -964,6 +965,61 @@ static int Multiply(void)
|
|||||||
PushValStack(v1);
|
PushValStack(v1);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* String times int means repeat the string that many times */
|
||||||
|
if ((v1.type == INT_TYPE && v2.type == STR_TYPE) ||
|
||||||
|
(v1.type == STR_TYPE && v2.type == INT_TYPE)) {
|
||||||
|
int rep = (v1.type == INT_TYPE ? v1.v.val : v2.v.val);
|
||||||
|
char const *str = (v1.type == INT_TYPE ? v2.v.str : v1.v.str);
|
||||||
|
int l;
|
||||||
|
|
||||||
|
/* Can't multiply by a negative number */
|
||||||
|
if (rep < 0) {
|
||||||
|
return E_2LOW;
|
||||||
|
}
|
||||||
|
if (rep == 0 || !str || !*str) {
|
||||||
|
/* Empty string */
|
||||||
|
DestroyValue(v1); DestroyValue(v2);
|
||||||
|
v3.type = STR_TYPE;
|
||||||
|
v3.v.str = malloc(1);
|
||||||
|
if (!v3.v.str) {
|
||||||
|
return E_NO_MEM;
|
||||||
|
}
|
||||||
|
*v3.v.str = 0;
|
||||||
|
PushValStack(v3);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create the new value */
|
||||||
|
l = (int) strlen(str);
|
||||||
|
if (l * rep < 0) {
|
||||||
|
DestroyValue(v1); DestroyValue(v2);
|
||||||
|
return E_STRING_TOO_LONG;
|
||||||
|
}
|
||||||
|
if ((unsigned long) l * (unsigned long) rep >= (unsigned long) INT_MAX) {
|
||||||
|
DestroyValue(v1); DestroyValue(v2);
|
||||||
|
return E_STRING_TOO_LONG;
|
||||||
|
}
|
||||||
|
if (MaxStringLen > 0 && ((unsigned long) l * (unsigned long) rep) > (unsigned long)MaxStringLen) {
|
||||||
|
DestroyValue(v1); DestroyValue(v2);
|
||||||
|
return E_STRING_TOO_LONG;
|
||||||
|
}
|
||||||
|
v3.type = STR_TYPE;
|
||||||
|
v3.v.str = malloc(l * rep + 1);
|
||||||
|
if (!v3.v.str) {
|
||||||
|
DestroyValue(v1); DestroyValue(v2);
|
||||||
|
return E_NO_MEM;
|
||||||
|
}
|
||||||
|
*v3.v.str = 0;
|
||||||
|
ptr = v3.v.str;
|
||||||
|
for (int i=0; i<rep; i++) {
|
||||||
|
strcat(ptr, str);
|
||||||
|
ptr += l;
|
||||||
|
}
|
||||||
|
DestroyValue(v1); DestroyValue(v2);
|
||||||
|
PushValStack(v3);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
DestroyValue(v1); DestroyValue(v2);
|
DestroyValue(v1); DestroyValue(v2);
|
||||||
return E_BAD_TYPE;
|
return E_BAD_TYPE;
|
||||||
}
|
}
|
||||||
|
|||||||
17
src/expr.h
17
src/expr.h
@@ -5,19 +5,20 @@
|
|||||||
/* Contains a few definitions used by expression evaluator. */
|
/* Contains a few definitions used by expression evaluator. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
/* Define the types of values */
|
/* Define the types of values */
|
||||||
#define ERR_TYPE 0
|
#define ERR_TYPE 0
|
||||||
#define INT_TYPE 1
|
#define INT_TYPE 1
|
||||||
#define TIME_TYPE 2
|
#define TIME_TYPE 2
|
||||||
#define DATE_TYPE 3
|
#define DATE_TYPE 3
|
||||||
#define STR_TYPE 4
|
#define STR_TYPE 4
|
||||||
#define DATETIME_TYPE 5
|
#define DATETIME_TYPE 5
|
||||||
#define SPECIAL_TYPE 6 /* Only for system variables */
|
#define SPECIAL_TYPE 6 /* Only for system variables */
|
||||||
|
#define CONST_INT_TYPE 7 /* Only for system variables */
|
||||||
|
|
||||||
/* Define stuff for parsing expressions */
|
/* Define stuff for parsing expressions */
|
||||||
#define BEG_OF_EXPR '['
|
#define BEG_OF_EXPR '['
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
/* files. */
|
/* files. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* expressions. */
|
/* expressions. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
/* globals.h and err.h */
|
/* globals.h and err.h */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ EXTERN INIT( int SortByDate, 0);
|
|||||||
EXTERN INIT( int SortByPrio, 0);
|
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( int SysTime, -1);
|
||||||
EXTERN INIT( int ParseUntriggered, 1);
|
EXTERN INIT( int ParseUntriggered, 1);
|
||||||
|
|
||||||
EXTERN char const *InitialFile;
|
EXTERN char const *InitialFile;
|
||||||
@@ -102,7 +102,7 @@ EXTERN INIT( int SynthesizeTags, 0);
|
|||||||
EXTERN INIT( int ScFormat, SC_AMPM);
|
EXTERN INIT( int ScFormat, SC_AMPM);
|
||||||
EXTERN INIT( int MaxSatIter, 1000);
|
EXTERN INIT( int MaxSatIter, 1000);
|
||||||
EXTERN INIT( int MaxStringLen, MAX_STR_LEN);
|
EXTERN INIT( int MaxStringLen, MAX_STR_LEN);
|
||||||
EXTERN INIT( char *FileName, NULL);
|
EXTERN INIT( char *FileName, NULL);
|
||||||
EXTERN INIT( int UseStdin, 0);
|
EXTERN INIT( int UseStdin, 0);
|
||||||
EXTERN INIT( int PurgeMode, 0);
|
EXTERN INIT( int PurgeMode, 0);
|
||||||
EXTERN INIT( int PurgeIncludeDepth, 0);
|
EXTERN INIT( int PurgeIncludeDepth, 0);
|
||||||
@@ -157,6 +157,9 @@ EXTERN INIT( char *EndSentIg, "\"')]}>");
|
|||||||
EXTERN DynamicBuffer Banner;
|
EXTERN DynamicBuffer Banner;
|
||||||
EXTERN DynamicBuffer LineBuffer;
|
EXTERN DynamicBuffer LineBuffer;
|
||||||
EXTERN DynamicBuffer ExprBuf;
|
EXTERN DynamicBuffer ExprBuf;
|
||||||
|
|
||||||
|
extern int NumFullOmits, NumPartialOmits;
|
||||||
|
|
||||||
/* List of months */
|
/* List of months */
|
||||||
EXTERN char *EnglishMonthName[]
|
EXTERN char *EnglishMonthName[]
|
||||||
#ifdef MK_GLOBALS
|
#ifdef MK_GLOBALS
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Support for the Hebrew calendar */
|
/* Support for the Hebrew calendar */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/* Derived from code written by Amos Shapir in 1978; revised */
|
/* Derived from code written by Amos Shapir in 1978; revised */
|
||||||
|
|||||||
41
src/init.c
41
src/init.c
@@ -7,7 +7,7 @@
|
|||||||
/* in normal mode. */
|
/* in normal mode. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -176,7 +176,6 @@ 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;
|
||||||
|
|
||||||
@@ -649,17 +648,6 @@ 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) {
|
||||||
@@ -779,7 +767,7 @@ void InitRemind(int argc, char const *argv[])
|
|||||||
#ifndef L_USAGE_OVERRIDE
|
#ifndef L_USAGE_OVERRIDE
|
||||||
void Usage(void)
|
void Usage(void)
|
||||||
{
|
{
|
||||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
|
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2024 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||||
#ifdef BETA
|
#ifdef BETA
|
||||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||||
#endif
|
#endif
|
||||||
@@ -1042,7 +1030,12 @@ guess_terminal_background(int *r, int *g, int *b)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tty_raw(ttyfd);
|
tty_raw(ttyfd);
|
||||||
write(ttyfd, "\033]11;?\033\\", 8);
|
n = write(ttyfd, "\033]11;?\033\\", 8);
|
||||||
|
|
||||||
|
if (n != 8) {
|
||||||
|
/* write failed... WTF? Not much we can do */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Wait up to 0.1s for terminal to respond */
|
/* Wait up to 0.1s for terminal to respond */
|
||||||
p.fd = ttyfd;
|
p.fd = ttyfd;
|
||||||
@@ -1110,3 +1103,21 @@ tty_reset(int fd)
|
|||||||
{
|
{
|
||||||
tcsetattr(fd, TCSAFLUSH, &orig_termios);
|
tcsetattr(fd, TCSAFLUSH, &orig_termios);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
GetTerminalBackground(void)
|
||||||
|
{
|
||||||
|
int r, g, b;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
should_guess_terminal_background = 0;
|
||||||
|
}
|
||||||
|
return TerminalBackground;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Header file for language support for various languages. */
|
/* Header file for language support for various languages. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* */
|
/* */
|
||||||
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
|
/* REMIND is Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* This file is Copyright (C) 1993 by Mogens Lynnerup. */
|
/* This file is Copyright (C) 1993 by Mogens Lynnerup. */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
/* Further corrections by Erik-Jan Vens */
|
/* Further corrections by Erik-Jan Vens */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Support for the English language. */
|
/* Support for the English language. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* This file is Copyright (C) 1993-1998 by Mikko Silvonen. */
|
/* This file is Copyright (C) 1993-1998 by Mikko Silvonen. */
|
||||||
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
|
/* REMIND is Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -254,7 +254,7 @@ EXTERN char *ErrMsg[] =
|
|||||||
#define L_USAGE_OVERRIDE 1
|
#define L_USAGE_OVERRIDE 1
|
||||||
void Usage(void)
|
void Usage(void)
|
||||||
{
|
{
|
||||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
|
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2024 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||||
#ifdef BETA
|
#ifdef BETA
|
||||||
fprintf(ErrFp, ">>>> BETAVERSIO <<<<\n");
|
fprintf(ErrFp, ">>>> BETAVERSIO <<<<\n");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* */
|
/* */
|
||||||
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
|
/* REMIND is Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* This file is Copyright (C) 1993 by Laurent Duperval and */
|
/* This file is Copyright (C) 1993 by Laurent Duperval and */
|
||||||
/* Dianne Skoll. */
|
/* Dianne Skoll. */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
@@ -228,7 +228,7 @@ EXTERN char *ErrMsg[] =
|
|||||||
#define L_USAGE_OVERRIDE 1
|
#define L_USAGE_OVERRIDE 1
|
||||||
void Usage(void)
|
void Usage(void)
|
||||||
{
|
{
|
||||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
|
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2024 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||||
#ifdef BETA
|
#ifdef BETA
|
||||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
/* I don't speak German. */
|
/* I don't speak German. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Support for the Icelandic language. */
|
/* Support for the Icelandic language. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* Translated by Björn Davíðsson (bjossi@snerpa.is) */
|
/* Translated by Björn Davíðsson (bjossi@snerpa.is) */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* It is Copyright (C) 1996 by Valerio Aimale */
|
/* It is Copyright (C) 1996 by Valerio Aimale */
|
||||||
/* */
|
/* */
|
||||||
/* Remind is copyright (C) 1992-2023 by Dianne Skoll */
|
/* Remind is copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* This file is Copyright (C) 1993 by Trygve Randen. */
|
/* This file is Copyright (C) 1993 by Trygve Randen. */
|
||||||
/* Remind is Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Remind is Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
/* Polish. */
|
/* Polish. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -244,7 +244,7 @@ EXTERN char *ErrMsg[] =
|
|||||||
#define L_USAGE_OVERRIDE 1
|
#define L_USAGE_OVERRIDE 1
|
||||||
void Usage(void)
|
void Usage(void)
|
||||||
{
|
{
|
||||||
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
|
fprintf(ErrFp, "\nREMIND %s (%s version) Copyright 1992-2024 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||||
#ifdef BETA
|
#ifdef BETA
|
||||||
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* */
|
/* */
|
||||||
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
|
/* REMIND is Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* This file is Copyright (C) 1996 by Marco Paganini and */
|
/* This file is Copyright (C) 1996 by Marco Paganini and */
|
||||||
/* Dianne Skoll. */
|
/* Dianne Skoll. */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
@@ -253,7 +253,7 @@ EXTERN char *ErrMsg[] =
|
|||||||
#define L_USAGE_OVERRIDE 1
|
#define L_USAGE_OVERRIDE 1
|
||||||
void Usage(void)
|
void Usage(void)
|
||||||
{
|
{
|
||||||
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-2023 Dianne Skoll\n", VERSION, L_LANGNAME);
|
fprintf(ErrFp, "\nREMIND %s (versao %s) (C) 1992-2024 Dianne Skoll\n", VERSION, L_LANGNAME);
|
||||||
#ifdef BETA
|
#ifdef BETA
|
||||||
fprintf(ErrFp, ">>>> VERSAO BETA <<<<\n");
|
fprintf(ErrFp, ">>>> VERSAO BETA <<<<\n");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* */
|
/* */
|
||||||
/* REMIND is Copyright (C) 1992-2023 by Dianne Skoll */
|
/* REMIND is Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* This file is Copyright (C) 1996-1998 by Liviu Daia */
|
/* This file is Copyright (C) 1996-1998 by Liviu Daia */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
/* Author: Rafa Couto <rafacouto@biogate.com> */
|
/* Author: Rafa Couto <rafacouto@biogate.com> */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
12
src/main.c
12
src/main.c
@@ -6,7 +6,7 @@
|
|||||||
/* routines, etc. */
|
/* routines, etc. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -747,17 +747,17 @@ int PushToken(char const *tok, ParsePtr p)
|
|||||||
/* Return the system time in seconds past midnight */
|
/* Return the system time in seconds past midnight */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
long SystemTime(int realtime)
|
int SystemTime(int realtime)
|
||||||
{
|
{
|
||||||
time_t now;
|
time_t now;
|
||||||
struct tm *t;
|
struct tm *t;
|
||||||
|
|
||||||
if (!realtime && (SysTime != -1L)) return SysTime;
|
if (!realtime && (SysTime != -1)) return SysTime;
|
||||||
|
|
||||||
now = time(NULL);
|
now = time(NULL);
|
||||||
t = localtime(&now);
|
t = localtime(&now);
|
||||||
return (long) t->tm_hour * 3600L + (long) t->tm_min * 60L +
|
return t->tm_hour * 3600L + t->tm_min * 60L +
|
||||||
(long) t->tm_sec;
|
t->tm_sec;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -769,7 +769,7 @@ long SystemTime(int realtime)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int MinutesPastMidnight(int realtime)
|
int MinutesPastMidnight(int realtime)
|
||||||
{
|
{
|
||||||
return (int) (SystemTime(realtime) / 60);
|
return (SystemTime(realtime) / 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Calculations for figuring out moon phases. */
|
/* Calculations for figuring out moon phases. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -412,7 +412,7 @@ static double phase(double pdate,
|
|||||||
Day = pdate - epoch; /* Date within epoch */
|
Day = pdate - epoch; /* Date within epoch */
|
||||||
N = fixangle((360 / 365.2422) * Day); /* Mean anomaly of the Sun */
|
N = fixangle((360 / 365.2422) * Day); /* Mean anomaly of the Sun */
|
||||||
M = fixangle(N + elonge - elongp); /* Convert from perigee
|
M = fixangle(N + elonge - elongp); /* Convert from perigee
|
||||||
co-ordinates to epoch 1980.0 */
|
coordinates to epoch 1980.0 */
|
||||||
Ec = kepler(M, eccent); /* Solve equation of Kepler */
|
Ec = kepler(M, eccent); /* Solve equation of Kepler */
|
||||||
Ec = sqrt((1 + eccent) / (1 - eccent)) * tan(Ec / 2);
|
Ec = sqrt((1 + eccent) / (1 - eccent)) * tan(Ec / 2);
|
||||||
Ec = 2 * todeg(atan(Ec)); /* 1 anomaly */
|
Ec = 2 * todeg(atan(Ec)); /* 1 anomaly */
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* the data structures for OMITted dates. */
|
/* the data structures for OMITted dates. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -32,7 +32,7 @@ static int PartialOmitArray[MAX_PARTIAL_OMITS];
|
|||||||
/* WeekdayOmits is declared in global.h */
|
/* WeekdayOmits is declared in global.h */
|
||||||
|
|
||||||
/* How many of each omit types do we have? */
|
/* How many of each omit types do we have? */
|
||||||
static int NumFullOmits, NumPartialOmits;
|
int NumFullOmits, NumPartialOmits;
|
||||||
|
|
||||||
/* The structure for saving and restoring OMIT contexts */
|
/* The structure for saving and restoring OMIT contexts */
|
||||||
typedef struct omitcontext {
|
typedef struct omitcontext {
|
||||||
@@ -445,6 +445,9 @@ int DoOmit(ParsePtr p)
|
|||||||
if (!BexistsIntArray(PartialOmitArray, NumPartialOmits, syndrome)) {
|
if (!BexistsIntArray(PartialOmitArray, NumPartialOmits, syndrome)) {
|
||||||
InsertIntoSortedArray(PartialOmitArray, NumPartialOmits, syndrome);
|
InsertIntoSortedArray(PartialOmitArray, NumPartialOmits, syndrome);
|
||||||
NumPartialOmits++;
|
NumPartialOmits++;
|
||||||
|
if (NumPartialOmits == 366) {
|
||||||
|
Wprint("You have OMITted everything! The space-time continuum is at risk.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (mc == m[1] && dc == d[1]) {
|
if (mc == m[1] && dc == d[1]) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
11
src/protos.h
11
src/protos.h
@@ -5,7 +5,7 @@
|
|||||||
/* Function Prototypes. */
|
/* Function Prototypes. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -22,6 +22,9 @@
|
|||||||
/* Characters to ignore */
|
/* Characters to ignore */
|
||||||
#define isempty(c) (isspace(c) || ((c) == '\\'))
|
#define isempty(c) (isspace(c) || ((c) == '\\'))
|
||||||
|
|
||||||
|
#define IsServerMode() (Daemon < 0)
|
||||||
|
#define ShouldFork (!DontFork)
|
||||||
|
|
||||||
#include "dynbuf.h"
|
#include "dynbuf.h"
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
@@ -71,7 +74,7 @@ void OutputLine (FILE *fp);
|
|||||||
void CreateParser (char const *s, ParsePtr p);
|
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);
|
int SystemTime (int realtime);
|
||||||
int MinutesPastMidnight (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);
|
||||||
@@ -171,6 +174,8 @@ int AddGlobalOmit(int dse);
|
|||||||
void set_lat_and_long_from_components(void);
|
void set_lat_and_long_from_components(void);
|
||||||
void set_components_from_lat_and_long(void);
|
void set_components_from_lat_and_long(void);
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
@@ -179,6 +184,8 @@ void clear_callstack(void);
|
|||||||
int print_callstack(FILE *fp);
|
int print_callstack(FILE *fp);
|
||||||
void pop_call(void);
|
void pop_call(void);
|
||||||
void FixSpecialType(Trigger *trig);
|
void FixSpecialType(Trigger *trig);
|
||||||
|
void WriteJSONTrigger(Trigger const *t, int include_tags, int today);
|
||||||
|
void WriteJSONTimeTrigger(TimeTrig const *tt);
|
||||||
#ifdef REM_USE_WCHAR
|
#ifdef REM_USE_WCHAR
|
||||||
#define _XOPEN_SOURCE 600
|
#define _XOPEN_SOURCE 600
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|||||||
171
src/queue.c
171
src/queue.c
@@ -5,7 +5,7 @@
|
|||||||
/* Queue up reminders for subsequent execution. */
|
/* Queue up reminders for subsequent execution. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -35,6 +35,13 @@
|
|||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
|
|
||||||
|
/* A list of filenames associated with queued reminders */
|
||||||
|
typedef struct queuedfname {
|
||||||
|
struct queuedfname *next;
|
||||||
|
char const *fname;
|
||||||
|
} QueuedFilename;
|
||||||
|
|
||||||
|
|
||||||
/* List structure for holding queued reminders */
|
/* List structure for holding queued reminders */
|
||||||
typedef struct queuedrem {
|
typedef struct queuedrem {
|
||||||
struct queuedrem *next;
|
struct queuedrem *next;
|
||||||
@@ -42,16 +49,18 @@ typedef struct queuedrem {
|
|||||||
int RunDisabled;
|
int RunDisabled;
|
||||||
int ntrig;
|
int ntrig;
|
||||||
char const *text;
|
char const *text;
|
||||||
|
char const *fname;
|
||||||
|
int lineno;
|
||||||
char passthru[PASSTHRU_LEN+1];
|
char passthru[PASSTHRU_LEN+1];
|
||||||
char sched[VAR_NAME_LEN+1];
|
char sched[VAR_NAME_LEN+1];
|
||||||
DynamicBuffer tags;
|
|
||||||
Trigger t;
|
Trigger t;
|
||||||
TimeTrig tt;
|
TimeTrig tt;
|
||||||
} QueuedRem;
|
} QueuedRem;
|
||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
|
|
||||||
static QueuedRem *QueueHead;
|
static QueuedRem *QueueHead = NULL;
|
||||||
|
static QueuedFilename *Files = NULL;
|
||||||
static time_t FileModTime;
|
static time_t FileModTime;
|
||||||
static struct stat StatBuf;
|
static struct stat StatBuf;
|
||||||
|
|
||||||
@@ -62,6 +71,50 @@ static int CalculateNextTimeUsingSched (QueuedRem *q);
|
|||||||
static void DaemonWait (struct timeval *sleep_tv);
|
static void DaemonWait (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);
|
||||||
|
|
||||||
|
/***************************************************************/
|
||||||
|
/* */
|
||||||
|
/* QueueFilename */
|
||||||
|
/* */
|
||||||
|
/* Add fname to the list of queued filenames if it's not */
|
||||||
|
/* already present. Either way, return a pointer to the */
|
||||||
|
/* filename. Returns NULL if out of memory */
|
||||||
|
/* */
|
||||||
|
/***************************************************************/
|
||||||
|
static QueuedFilename *last_file_found = NULL;
|
||||||
|
static char const *QueueFilename(char const *fname)
|
||||||
|
{
|
||||||
|
QueuedFilename *elem = Files;
|
||||||
|
|
||||||
|
/* Optimization: We are very likely in the same file as
|
||||||
|
before... */
|
||||||
|
if (last_file_found && !strcmp(fname, last_file_found->fname)) {
|
||||||
|
return last_file_found->fname;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* No such luck; search the list */
|
||||||
|
while(elem) {
|
||||||
|
if (!strcmp(elem->fname, fname)) {
|
||||||
|
last_file_found = elem;
|
||||||
|
return elem->fname;
|
||||||
|
}
|
||||||
|
elem = elem->next;
|
||||||
|
}
|
||||||
|
/* Not found... queue it */
|
||||||
|
elem = NEW(QueuedFilename);
|
||||||
|
if (!elem) return NULL;
|
||||||
|
elem->fname = StrDup(fname);
|
||||||
|
if (!elem->fname) {
|
||||||
|
free(elem);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
elem->next = Files;
|
||||||
|
Files = elem;
|
||||||
|
last_file_found = elem;
|
||||||
|
return elem->fname;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
@@ -72,7 +125,7 @@ static void PrintQueue(void);
|
|||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int QueueReminder(ParsePtr p, Trigger *trig,
|
int QueueReminder(ParsePtr p, Trigger *trig,
|
||||||
TimeTrig *tim, char const *sched)
|
TimeTrig *tim, char const *sched)
|
||||||
{
|
{
|
||||||
QueuedRem *qelem;
|
QueuedRem *qelem;
|
||||||
|
|
||||||
@@ -92,21 +145,28 @@ int QueueReminder(ParsePtr p, Trigger *trig,
|
|||||||
free(qelem);
|
free(qelem);
|
||||||
return E_NO_MEM;
|
return E_NO_MEM;
|
||||||
}
|
}
|
||||||
|
qelem->fname = QueueFilename(FileName);
|
||||||
|
if (!qelem->fname) {
|
||||||
|
free((void *) qelem->text);
|
||||||
|
free(qelem);
|
||||||
|
return E_NO_MEM;
|
||||||
|
}
|
||||||
|
|
||||||
|
qelem->lineno = LineNo;
|
||||||
NumQueued++;
|
NumQueued++;
|
||||||
qelem->typ = trig->typ;
|
qelem->typ = trig->typ;
|
||||||
strcpy(qelem->passthru, trig->passthru);
|
strcpy(qelem->passthru, trig->passthru);
|
||||||
qelem->tt = *tim;
|
qelem->tt = *tim;
|
||||||
qelem->t = *trig;
|
qelem->t = *trig;
|
||||||
DBufInit(&(qelem->t.tags));
|
DBufInit(&(qelem->t.tags));
|
||||||
|
DBufPuts(&(qelem->t.tags), DBufValue(&(trig->tags)));
|
||||||
|
if (SynthesizeTags) {
|
||||||
|
AppendTag(&(qelem->t.tags), SynthesizeTag());
|
||||||
|
}
|
||||||
qelem->next = QueueHead;
|
qelem->next = QueueHead;
|
||||||
qelem->RunDisabled = RunDisabled;
|
qelem->RunDisabled = RunDisabled;
|
||||||
qelem->ntrig = 0;
|
qelem->ntrig = 0;
|
||||||
strcpy(qelem->sched, sched);
|
strcpy(qelem->sched, sched);
|
||||||
DBufInit(&(qelem->tags));
|
|
||||||
DBufPuts(&(qelem->tags), DBufValue(&(trig->tags)));
|
|
||||||
if (SynthesizeTags) {
|
|
||||||
AppendTag(&(qelem->tags), SynthesizeTag());
|
|
||||||
}
|
|
||||||
QueueHead = qelem;
|
QueueHead = qelem;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -141,6 +201,21 @@ SigContHandler(int d)
|
|||||||
UNUSED(d);
|
UNUSED(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
print_num_queued(void)
|
||||||
|
{
|
||||||
|
int nqueued = 0;
|
||||||
|
QueuedRem *q = QueueHead;
|
||||||
|
while(q) {
|
||||||
|
if (q->tt.nexttime != NO_TIME) {
|
||||||
|
nqueued++;
|
||||||
|
}
|
||||||
|
q = q->next;
|
||||||
|
}
|
||||||
|
printf("NOTE queued %d\n", nqueued);
|
||||||
|
fflush(stdout);
|
||||||
|
}
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* HandleQueuedReminders */
|
/* HandleQueuedReminders */
|
||||||
@@ -154,7 +229,6 @@ void HandleQueuedReminders(void)
|
|||||||
int TimeToSleep;
|
int TimeToSleep;
|
||||||
unsigned SleepTime;
|
unsigned SleepTime;
|
||||||
Parser p;
|
Parser p;
|
||||||
Trigger trig;
|
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
struct timeval sleep_tv;
|
struct timeval sleep_tv;
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
@@ -165,6 +239,12 @@ void HandleQueuedReminders(void)
|
|||||||
/* Turn off sorting -- otherwise, TriggerReminder has no effect! */
|
/* Turn off sorting -- otherwise, TriggerReminder has no effect! */
|
||||||
SortByDate = 0;
|
SortByDate = 0;
|
||||||
|
|
||||||
|
/* Free FileName if necessary */
|
||||||
|
if (FileName) {
|
||||||
|
free(FileName);
|
||||||
|
FileName = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* If we are not connected to a tty, then we must close the
|
/* If we are not connected to a tty, then we must close the
|
||||||
* standard file descriptors. This is to prevent someone
|
* standard file descriptors. This is to prevent someone
|
||||||
* doing:
|
* doing:
|
||||||
@@ -174,7 +254,7 @@ 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) {
|
if (ShouldFork) {
|
||||||
maybe_close(STDIN_FILENO);
|
maybe_close(STDIN_FILENO);
|
||||||
maybe_close(STDOUT_FILENO);
|
maybe_close(STDOUT_FILENO);
|
||||||
maybe_close(STDERR_FILENO);
|
maybe_close(STDERR_FILENO);
|
||||||
@@ -197,7 +277,7 @@ void HandleQueuedReminders(void)
|
|||||||
q = q->next;
|
q = q->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DontFork || Daemon) {
|
if (ShouldFork || Daemon) {
|
||||||
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);
|
||||||
@@ -213,7 +293,7 @@ void HandleQueuedReminders(void)
|
|||||||
if (!q && !Daemon) break;
|
if (!q && !Daemon) break;
|
||||||
|
|
||||||
if (Daemon && !q) {
|
if (Daemon && !q) {
|
||||||
if (Daemon < 0) {
|
if (IsServerMode()) {
|
||||||
/* Sleep until midnight */
|
/* Sleep until midnight */
|
||||||
TimeToSleep = MINUTES_PER_DAY*60 - SystemTime(1);
|
TimeToSleep = MINUTES_PER_DAY*60 - SystemTime(1);
|
||||||
} else {
|
} else {
|
||||||
@@ -232,7 +312,7 @@ void HandleQueuedReminders(void)
|
|||||||
|
|
||||||
/* Wake up once a minute to recalibrate sleep time in
|
/* Wake up once a minute to recalibrate sleep time in
|
||||||
case of laptop hibernation */
|
case of laptop hibernation */
|
||||||
if (Daemon < 0) {
|
if (IsServerMode()) {
|
||||||
/* Wake up on the next exact minute */
|
/* Wake up on the next exact minute */
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
sleep_tv.tv_sec = 60 - (tv.tv_sec % 60);
|
sleep_tv.tv_sec = 60 - (tv.tv_sec % 60);
|
||||||
@@ -263,7 +343,7 @@ void HandleQueuedReminders(void)
|
|||||||
if (Daemon > 0 && SleepTime) CheckInitialFile();
|
if (Daemon > 0 && SleepTime) CheckInitialFile();
|
||||||
|
|
||||||
if (Daemon && !q) {
|
if (Daemon && !q) {
|
||||||
if (Daemon < 0) {
|
if (IsServerMode()) {
|
||||||
/* Sleep until midnight */
|
/* Sleep until midnight */
|
||||||
TimeToSleep = MINUTES_PER_DAY*60 - SystemTime(1);
|
TimeToSleep = MINUTES_PER_DAY*60 - SystemTime(1);
|
||||||
} else {
|
} else {
|
||||||
@@ -286,25 +366,25 @@ void HandleQueuedReminders(void)
|
|||||||
(MaxLateMinutes == 0 || SystemTime(1) - (q->tt.nexttime * 60) <= 60 * MaxLateMinutes))) {
|
(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;
|
|
||||||
strcpy(trig.passthru, q->passthru);
|
|
||||||
RunDisabled = q->RunDisabled;
|
RunDisabled = q->RunDisabled;
|
||||||
if (Daemon < 0) {
|
if (IsServerMode()) {
|
||||||
printf("NOTE reminder %s",
|
printf("NOTE reminder %s",
|
||||||
SimpleTime(q->tt.ttime));
|
SimpleTime(q->tt.ttime));
|
||||||
printf("%s", SimpleTime(MinutesPastMidnight(1)));
|
printf("%s", SimpleTime(MinutesPastMidnight(1)));
|
||||||
if (!*DBufValue(&q->tags)) {
|
if (!*DBufValue(&q->t.tags)) {
|
||||||
printf("*\n");
|
printf("*\n");
|
||||||
} else {
|
} else {
|
||||||
printf("%s\n", DBufValue(&(q->tags)));
|
printf("%s\n", DBufValue(&(q->t.tags)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set up global variables so some functions like trigdate()
|
/* Set up global variables so some functions like trigdate()
|
||||||
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);
|
||||||
(void) TriggerReminder(&p, &trig, &q->tt, DSEToday, 1);
|
FileName = (char *) q->fname;
|
||||||
if (Daemon < 0) {
|
(void) TriggerReminder(&p, &q->t, &q->tt, DSEToday, 1);
|
||||||
|
FileName = NULL;
|
||||||
|
if (IsServerMode()) {
|
||||||
printf("NOTE endreminder\n");
|
printf("NOTE endreminder\n");
|
||||||
}
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
@@ -314,14 +394,20 @@ 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
|
/* If it's dequeued, update num_queued */
|
||||||
suspended or hibernated, remove from queue */
|
|
||||||
if (q->tt.nexttime != NO_TIME) {
|
if (q->tt.nexttime != NO_TIME) {
|
||||||
|
/* If trigger time is way in the past because computer has been
|
||||||
|
suspended or hibernated, remove from queue */
|
||||||
if (q->tt.ttime < MinutesPastMidnight(1) - MaxLateMinutes &&
|
if (q->tt.ttime < MinutesPastMidnight(1) - MaxLateMinutes &&
|
||||||
q->tt.nexttime < MinutesPastMidnight(1) - MaxLateMinutes) {
|
q->tt.nexttime < MinutesPastMidnight(1) - MaxLateMinutes) {
|
||||||
q->tt.nexttime = NO_TIME;
|
q->tt.nexttime = NO_TIME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If we have dequeued a reminder, update controlling process */
|
||||||
|
if (q->tt.nexttime == NO_TIME && IsServerMode()) {
|
||||||
|
print_num_queued();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
@@ -530,6 +616,12 @@ json_queue(QueuedRem const *q)
|
|||||||
}
|
}
|
||||||
done = 1;
|
done = 1;
|
||||||
printf("{");
|
printf("{");
|
||||||
|
WriteJSONTrigger(&(q->t), 1, DSEToday);
|
||||||
|
WriteJSONTimeTrigger(&(q->tt));
|
||||||
|
PrintJSONKeyPairInt("rundisabled", q->RunDisabled);
|
||||||
|
PrintJSONKeyPairInt("ntrig", q->ntrig);
|
||||||
|
PrintJSONKeyPairString("filename", q->fname);
|
||||||
|
PrintJSONKeyPairInt("lineno", q->lineno);
|
||||||
switch(q->typ) {
|
switch(q->typ) {
|
||||||
case NO_TYPE: PrintJSONKeyPairString("type", "NO_TYPE"); break;
|
case NO_TYPE: PrintJSONKeyPairString("type", "NO_TYPE"); break;
|
||||||
case MSG_TYPE: PrintJSONKeyPairString("type", "MSG_TYPE"); break;
|
case MSG_TYPE: PrintJSONKeyPairString("type", "MSG_TYPE"); break;
|
||||||
@@ -542,26 +634,6 @@ json_queue(QueuedRem const *q)
|
|||||||
case PASSTHRU_TYPE: PrintJSONKeyPairString("type", "PASSTHRU_TYPE"); break;
|
case PASSTHRU_TYPE: PrintJSONKeyPairString("type", "PASSTHRU_TYPE"); break;
|
||||||
default: PrintJSONKeyPairString("type", "?"); break;
|
default: PrintJSONKeyPairString("type", "?"); break;
|
||||||
}
|
}
|
||||||
PrintJSONKeyPairInt("rundisabled", q->RunDisabled);
|
|
||||||
PrintJSONKeyPairInt("ntrig", q->ntrig);
|
|
||||||
PrintJSONKeyPairTime("ttime", q->tt.ttime);
|
|
||||||
PrintJSONKeyPairTime("nextttime", q->tt.nexttime);
|
|
||||||
PrintJSONKeyPairInt("delta", q->tt.delta);
|
|
||||||
if (q->tt.rep != NO_TIME) {
|
|
||||||
PrintJSONKeyPairInt("rep", q->tt.rep);
|
|
||||||
}
|
|
||||||
if (q->tt.duration != NO_TIME) {
|
|
||||||
PrintJSONKeyPairInt("duration", q->tt.duration);
|
|
||||||
}
|
|
||||||
if (q->passthru[0]) {
|
|
||||||
PrintJSONKeyPairString("passthru", q->passthru);
|
|
||||||
}
|
|
||||||
if (q->sched[0]) {
|
|
||||||
PrintJSONKeyPairString("sched", q->sched);
|
|
||||||
}
|
|
||||||
if (DBufLen(&(q->tags))) {
|
|
||||||
PrintJSONKeyPairString("tags", DBufValue(&(q->tags)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Last one is a special case - no trailing comma */
|
/* Last one is a special case - no trailing comma */
|
||||||
printf("\"");
|
printf("\"");
|
||||||
@@ -622,16 +694,7 @@ static void DaemonWait(struct timeval *sleep_tv)
|
|||||||
if (!strcmp(cmdLine, "EXIT\n")) {
|
if (!strcmp(cmdLine, "EXIT\n")) {
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
} else if (!strcmp(cmdLine, "STATUS\n")) {
|
} else if (!strcmp(cmdLine, "STATUS\n")) {
|
||||||
int nqueued = 0;
|
print_num_queued();
|
||||||
QueuedRem *q = QueueHead;
|
|
||||||
while(q) {
|
|
||||||
if (q->tt.nexttime != NO_TIME) {
|
|
||||||
nqueued++;
|
|
||||||
}
|
|
||||||
q = q->next;
|
|
||||||
}
|
|
||||||
printf("NOTE queued %d\n", nqueued);
|
|
||||||
fflush(stdout);
|
|
||||||
} else if (!strcmp(cmdLine, "QUEUE\n")) {
|
} else if (!strcmp(cmdLine, "QUEUE\n")) {
|
||||||
printf("NOTE queue\n");
|
printf("NOTE queue\n");
|
||||||
QueuedRem *q = QueueHead;
|
QueuedRem *q = QueueHead;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Print a PostScript calendar. */
|
/* Print a PostScript calendar. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -350,7 +350,7 @@ int main(int argc, char *argv[])
|
|||||||
!strcmp(DBufValue(&buf), PSBEGIN2)) {
|
!strcmp(DBufValue(&buf), PSBEGIN2)) {
|
||||||
if (!validfile) {
|
if (!validfile) {
|
||||||
if (Verbose) {
|
if (Verbose) {
|
||||||
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-2023 by Dianne Skoll\n\n", VERSION);
|
fprintf(stderr, "Rem2PS: Version %s Copyright 1992-2024 by Dianne Skoll\n\n", VERSION);
|
||||||
fprintf(stderr, "Generating PostScript calendar\n");
|
fprintf(stderr, "Generating PostScript calendar\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Define the PostScript prologue */
|
/* Define the PostScript prologue */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -14,7 +14,7 @@ char *PSProlog1[] =
|
|||||||
{
|
{
|
||||||
"% This file was produced by Remind and Rem2PS, written by",
|
"% This file was produced by Remind and Rem2PS, written by",
|
||||||
"% Dianne Skoll.",
|
"% Dianne Skoll.",
|
||||||
"% Remind and Rem2PS are Copyright 1992-2023 Dianne Skoll.",
|
"% Remind and Rem2PS are Copyright 1992-2024 Dianne Skoll.",
|
||||||
"/ISOLatin1Encoding where { pop save true }{ false } ifelse",
|
"/ISOLatin1Encoding where { pop save true }{ false } ifelse",
|
||||||
" /ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus",
|
" /ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus",
|
||||||
" StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute",
|
" StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Routines for sorting reminders by trigger date */
|
/* Routines for sorting reminders by trigger date */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* classifying the tokens parsed. */
|
/* classifying the tokens parsed. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Routines for figuring out the trigger date of a reminder */
|
/* Routines for figuring out the trigger date of a reminder */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -324,8 +324,11 @@ static int GetNextTriggerDate(Trigger *trig, int start, int *err, int *nextstart
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
start--;
|
start--;
|
||||||
|
if (start < 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (iter > MaxSatIter) {
|
if (start < 0 || iter > MaxSatIter) {
|
||||||
/* omitfunc must have returned "true" too often */
|
/* omitfunc must have returned "true" too often */
|
||||||
*err = E_CANT_TRIG;
|
*err = E_CANT_TRIG;
|
||||||
return -2;
|
return -2;
|
||||||
@@ -388,6 +391,10 @@ static int GetNextTriggerDate(Trigger *trig, int start, int *err, int *nextstart
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
simple--;
|
simple--;
|
||||||
|
if (simple < 0) {
|
||||||
|
*err = E_CANT_TRIG;
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (iter > MaxSatIter) {
|
if (iter > MaxSatIter) {
|
||||||
*err = E_CANT_TRIG;
|
*err = E_CANT_TRIG;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Type definitions all dumped here. */
|
/* Type definitions all dumped here. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* functions. */
|
/* functions. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -349,7 +349,9 @@ int CallUserFunc(char const *name, int nargs, ParsePtr p)
|
|||||||
|
|
||||||
/* Skip the opening bracket, if there's one */
|
/* Skip the opening bracket, if there's one */
|
||||||
while (isempty(*s)) s++;
|
while (isempty(*s)) s++;
|
||||||
if (*s == BEG_OF_EXPR) s++;
|
if (*s == BEG_OF_EXPR) {
|
||||||
|
s++;
|
||||||
|
}
|
||||||
push_call(f->filename, f->name, f->lineno);
|
push_call(f->filename, f->name, f->lineno);
|
||||||
h = Evaluate(&s, f->locals, p);
|
h = Evaluate(&s, f->locals, p);
|
||||||
if (h == OK) {
|
if (h == OK) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/* Useful utility functions. */
|
/* Useful utility functions. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -36,6 +36,11 @@ char *StrnCpy(char *dest, char const *source, int n)
|
|||||||
{
|
{
|
||||||
char *odest = dest;
|
char *odest = dest;
|
||||||
|
|
||||||
|
if (n <= 0) {
|
||||||
|
*dest = 0;
|
||||||
|
return dest;
|
||||||
|
}
|
||||||
|
|
||||||
while (n-- && (*dest++ = *source++)) ;
|
while (n-- && (*dest++ = *source++)) ;
|
||||||
if (*(dest-1)) *dest = 0;
|
if (*(dest-1)) *dest = 0;
|
||||||
return odest;
|
return odest;
|
||||||
@@ -108,7 +113,7 @@ int DateOK(int y, int m, int d)
|
|||||||
m > 11 ||
|
m > 11 ||
|
||||||
y > BASE + YR_RANGE ||
|
y > BASE + YR_RANGE ||
|
||||||
d > DaysInMonth(m, y) ) return 0;
|
d > DaysInMonth(m, y) ) return 0;
|
||||||
else return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Functions designed to defeat gcc optimizer */
|
/* Functions designed to defeat gcc optimizer */
|
||||||
|
|||||||
43
src/var.c
43
src/var.c
@@ -6,7 +6,7 @@
|
|||||||
/* user- and system-defined variables. */
|
/* user- and system-defined variables. */
|
||||||
/* */
|
/* */
|
||||||
/* This file is part of REMIND. */
|
/* This file is part of REMIND. */
|
||||||
/* Copyright (C) 1992-2023 by Dianne Skoll */
|
/* Copyright (C) 1992-2024 by Dianne Skoll */
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -167,6 +167,13 @@ static int latitude_func(int do_set, Value *val)
|
|||||||
return latitude_longitude_func(do_set, val, &Latitude, -90.0, 90.0);
|
return latitude_longitude_func(do_set, val, &Latitude, -90.0, 90.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int terminal_bg_func(int do_set, Value *val)
|
||||||
|
{
|
||||||
|
UNUSED(do_set);
|
||||||
|
val->type = INT_TYPE;
|
||||||
|
val->v.val = GetTerminalBackground();
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
static int trig_date_func(int do_set, Value *val)
|
static int trig_date_func(int do_set, Value *val)
|
||||||
{
|
{
|
||||||
@@ -525,7 +532,9 @@ int DoSet (Parser *p)
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
|
DynamicBuffer buf2;
|
||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
|
DBufInit(&buf2);
|
||||||
|
|
||||||
r = ParseIdentifier(p, &buf);
|
r = ParseIdentifier(p, &buf);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
@@ -541,6 +550,13 @@ int DoSet (Parser *p)
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = ParseToken(p, &buf2);
|
||||||
|
if (r) return r;
|
||||||
|
if (DBufLen(&buf2)) {
|
||||||
|
DBufFree(&buf2);
|
||||||
|
return E_EXPECTING_EOL;
|
||||||
|
}
|
||||||
|
DBufFree(&buf2);
|
||||||
if (*DBufValue(&buf) == '$') r = SetSysVar(DBufValue(&buf)+1, &v);
|
if (*DBufValue(&buf) == '$') r = SetSysVar(DBufValue(&buf)+1, &v);
|
||||||
else r = SetVar(DBufValue(&buf), &v);
|
else r = SetVar(DBufValue(&buf), &v);
|
||||||
if (buf.len > VAR_NAME_LEN) {
|
if (buf.len > VAR_NAME_LEN) {
|
||||||
@@ -762,10 +778,14 @@ typedef struct {
|
|||||||
char modifiable;
|
char modifiable;
|
||||||
int type;
|
int type;
|
||||||
void *value;
|
void *value;
|
||||||
int min;
|
int min; /* Or const-value */
|
||||||
int max;
|
int max;
|
||||||
} SysVar;
|
} SysVar;
|
||||||
|
|
||||||
|
/* Macro to access "min" but as a constval. Just to make source more
|
||||||
|
readable */
|
||||||
|
#define constval min
|
||||||
|
|
||||||
/* If the type of a sys variable is STR_TYPE, then min is redefined
|
/* If the type of a sys variable is STR_TYPE, then min is redefined
|
||||||
to be a flag indicating whether or not the value has been malloc'd. */
|
to be a flag indicating whether or not the value has been malloc'd. */
|
||||||
#define been_malloced min
|
#define been_malloced min
|
||||||
@@ -825,7 +845,9 @@ 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 },
|
||||||
|
{"MaxFullOmits", 0, CONST_INT_TYPE, NULL, MAX_FULL_OMITS, 0},
|
||||||
{"MaxLateMinutes", 1, INT_TYPE, &MaxLateMinutes, 0, 1440 },
|
{"MaxLateMinutes", 1, INT_TYPE, &MaxLateMinutes, 0, 1440 },
|
||||||
|
{"MaxPartialOmits",0, CONST_INT_TYPE, NULL, MAX_PARTIAL_OMITS, 0},
|
||||||
{"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 },
|
||||||
@@ -836,6 +858,8 @@ static SysVar SysVarArr[] = {
|
|||||||
{"NextMode", 0, INT_TYPE, &NextMode, 0, 0 },
|
{"NextMode", 0, INT_TYPE, &NextMode, 0, 0 },
|
||||||
{"November", 1, STR_TYPE, &DynamicMonthName[10],0, 0 },
|
{"November", 1, STR_TYPE, &DynamicMonthName[10],0, 0 },
|
||||||
{"Now", 1, STR_TYPE, &DynamicNow, 0, 0 },
|
{"Now", 1, STR_TYPE, &DynamicNow, 0, 0 },
|
||||||
|
{"NumFullOmits", 0, INT_TYPE, &NumFullOmits, 0, 0 },
|
||||||
|
{"NumPartialOmits",0, INT_TYPE, &NumPartialOmits, 0, 0 },
|
||||||
{"NumQueued", 0, INT_TYPE, &NumQueued, 0, 0 },
|
{"NumQueued", 0, INT_TYPE, &NumQueued, 0, 0 },
|
||||||
{"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 },
|
||||||
@@ -857,7 +881,7 @@ static SysVar SysVarArr[] = {
|
|||||||
{"SysInclude", 0, STR_TYPE, &SysDir, 0, 0 },
|
{"SysInclude", 0, STR_TYPE, &SysDir, 0, 0 },
|
||||||
{"T", 0, SPECIAL_TYPE, trig_date_func, 0, 0 },
|
{"T", 0, SPECIAL_TYPE, trig_date_func, 0, 0 },
|
||||||
{"Td", 0, SPECIAL_TYPE, trig_day_func, 0, 0 },
|
{"Td", 0, SPECIAL_TYPE, trig_day_func, 0, 0 },
|
||||||
{"TerminalBackground", 0, INT_TYPE, &TerminalBackground, 0, 0 },
|
{"TerminalBackground", 0, SPECIAL_TYPE, terminal_bg_func, 0, 0 },
|
||||||
{"Thursday", 1, STR_TYPE, &DynamicDayName[3], 0, 0 },
|
{"Thursday", 1, STR_TYPE, &DynamicDayName[3], 0, 0 },
|
||||||
{"TimeSep", 1, SPECIAL_TYPE, time_sep_func, 0, 0 },
|
{"TimeSep", 1, SPECIAL_TYPE, time_sep_func, 0, 0 },
|
||||||
{"Tm", 0, SPECIAL_TYPE, trig_mon_func, 0, 0 },
|
{"Tm", 0, SPECIAL_TYPE, trig_mon_func, 0, 0 },
|
||||||
@@ -895,13 +919,13 @@ int SetSysVar(char const *name, Value *value)
|
|||||||
int r;
|
int r;
|
||||||
SysVar *v = FindSysVar(name);
|
SysVar *v = FindSysVar(name);
|
||||||
if (!v) return E_NOSUCH_VAR;
|
if (!v) return E_NOSUCH_VAR;
|
||||||
if (v->type != SPECIAL_TYPE &&
|
|
||||||
v->type != value->type) return E_BAD_TYPE;
|
|
||||||
if (!v->modifiable) {
|
if (!v->modifiable) {
|
||||||
Eprint("%s: `$%s'", ErrMsg[E_CANT_MODIFY], name);
|
Eprint("%s: `$%s'", ErrMsg[E_CANT_MODIFY], name);
|
||||||
return E_CANT_MODIFY;
|
return E_CANT_MODIFY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (v->type != SPECIAL_TYPE &&
|
||||||
|
v->type != value->type) return E_BAD_TYPE;
|
||||||
if (v->type == SPECIAL_TYPE) {
|
if (v->type == SPECIAL_TYPE) {
|
||||||
SysVarFunc f = (SysVarFunc) v->value;
|
SysVarFunc f = (SysVarFunc) v->value;
|
||||||
r = f(1, value);
|
r = f(1, value);
|
||||||
@@ -942,6 +966,11 @@ int GetSysVar(char const *name, Value *val)
|
|||||||
|
|
||||||
val->type = ERR_TYPE;
|
val->type = ERR_TYPE;
|
||||||
if (!v) return E_NOSUCH_VAR;
|
if (!v) return E_NOSUCH_VAR;
|
||||||
|
if (v->type == CONST_INT_TYPE) {
|
||||||
|
val->v.val = v->constval;
|
||||||
|
val->type = INT_TYPE;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
if (v->type == SPECIAL_TYPE) {
|
if (v->type == SPECIAL_TYPE) {
|
||||||
SysVarFunc f = (SysVarFunc) v->value;
|
SysVarFunc f = (SysVarFunc) v->value;
|
||||||
return f(0, val);
|
return f(0, val);
|
||||||
@@ -1035,7 +1064,9 @@ static void DumpSysVar(char const *name, const SysVar *v)
|
|||||||
if (name) strcat(buffer, name); else strcat(buffer, v->name);
|
if (name) strcat(buffer, name); else strcat(buffer, v->name);
|
||||||
fprintf(ErrFp, "%16s ", buffer);
|
fprintf(ErrFp, "%16s ", buffer);
|
||||||
if (v) {
|
if (v) {
|
||||||
if (v->type == SPECIAL_TYPE) {
|
if (v->type == CONST_INT_TYPE) {
|
||||||
|
fprintf(ErrFp, "%d\n", v->constval);
|
||||||
|
} else if (v->type == SPECIAL_TYPE) {
|
||||||
SysVarFunc f = (SysVarFunc) v->value;
|
SysVarFunc f = (SysVarFunc) v->value;
|
||||||
f(0, &vtmp);
|
f(0, &vtmp);
|
||||||
PrintValue(&vtmp, ErrFp);
|
PrintValue(&vtmp, ErrFp);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ MSG UseVTColors is: [$UseVTColors]%
|
|||||||
MSG Use256Colors is: [$Use256Colors]%
|
MSG Use256Colors is: [$Use256Colors]%
|
||||||
MSG UseTrueColors is: [$UseTrueColors]%
|
MSG UseTrueColors is: [$UseTrueColors]%
|
||||||
MSG UseBGVTColors is: [$UseBGVTColors]%
|
MSG UseBGVTColors is: [$UseBGVTColors]%
|
||||||
set n ansicolor("")]
|
set n ansicolor("")
|
||||||
MSG This is [ansicolor(0,255,0)]green[n], [ansicolor("255 0 0")]red[n] and [ansicolor("0 0 255")]blue[n] text.%
|
MSG This is [ansicolor(0,255,0)]green[n], [ansicolor("255 0 0")]red[n] and [ansicolor("0 0 255")]blue[n] text.%
|
||||||
MSG This is [ansicolor(0,0,0)][ansicolor(0,255,0,1)]black text on a green background[n]%
|
MSG This is [ansicolor(0,0,0)][ansicolor(0,255,0,1)]black text on a green background[n]%
|
||||||
MSG This is [ansicolor(0,0,0,0,1)]clamped black text[n]%
|
MSG This is [ansicolor(0,0,0,0,1)]clamped black text[n]%
|
||||||
|
|||||||
6
tests/queue1.rem
Normal file
6
tests/queue1.rem
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
FSET msgprefix(x) "Priority: " + x + "; Filename: " + filename() + ": "
|
||||||
|
|
||||||
|
REM at 23:56 MSG foo
|
||||||
|
REM PRIORITY 42 at 23:57 MSG bar
|
||||||
|
REM PRIORITY 999 at 23:58 MSQ quux
|
||||||
|
DO queue2.rem
|
||||||
1
tests/queue2.rem
Normal file
1
tests/queue2.rem
Normal file
@@ -0,0 +1 @@
|
|||||||
|
REM at 23:59 PRIORITY 2 MSG XXXX
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
# in the build directory.
|
# in the build directory.
|
||||||
#
|
#
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# Copyright (C) 1992-2023 Dianne Skoll
|
# Copyright (C) 1992-2024 Dianne Skoll
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -31,6 +31,15 @@ fi
|
|||||||
TZ=UTC
|
TZ=UTC
|
||||||
export TZ
|
export TZ
|
||||||
|
|
||||||
|
RESULT=`(echo 'BANNER %'; echo 'IF now() > 23:55'; echo 'MSG late%'; echo 'ENDIF') | ../src/remind -h -`
|
||||||
|
|
||||||
|
if test "$RESULT" = "late" ; then
|
||||||
|
echo ""
|
||||||
|
echo "*** Please do not run the test suite between 23:55 and 00:00 UTC; it will fail."
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# If we're already in a utf-8 locale, do
|
# If we're already in a utf-8 locale, do
|
||||||
# nothing; otherwise, set LC_ALL
|
# nothing; otherwise, set LC_ALL
|
||||||
OK=0
|
OK=0
|
||||||
@@ -440,6 +449,11 @@ rm -rf include_dir/ww
|
|||||||
# Test --version long option
|
# Test --version long option
|
||||||
../src/remind --version >> ../tests/test.out 2>&1
|
../src/remind --version >> ../tests/test.out 2>&1
|
||||||
|
|
||||||
|
# Test queueing. Because eventstart depends on the actual system
|
||||||
|
# date, we have to convert it to some constant (in this case,
|
||||||
|
# VOLATILE) so that tests are not dependent on the system date.
|
||||||
|
echo JSONQUEUE | ../src/remind -z0 ../tests/queue1.rem 2>&1 | sed -e 's/"eventstart":"................"/"eventstart":"VOLATILE"/g' >> ../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
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ INCLUDECMD echo INCLUDECMD echo INCLUDECMD echo INCLUDECMD echo MSG Yippee
|
|||||||
INCLUDECMD echo INCLUDECMD echo INCLUDECMD echo MSG Yippee
|
INCLUDECMD echo INCLUDECMD echo INCLUDECMD echo MSG Yippee
|
||||||
INCLUDECMD echo INCLUDECMD echo MSG Yippee
|
INCLUDECMD echo INCLUDECMD echo MSG Yippee
|
||||||
INCLUDECMD echo MSG Yippee
|
INCLUDECMD echo MSG Yippee
|
||||||
echo INCLUDECMD echo MSG Yippee|(1): INCLUDE nested too deeply
|
echo INCLUDECMD echo MSG Yippee|(1): INCLUDE nested too deeply (max. 9)
|
||||||
REM MSG Today is [hebday(today())] [hebmon(today())] [hebyear(today())]
|
REM MSG Today is [hebday(today())] [hebmon(today())] [hebyear(today())]
|
||||||
../tests/test.rem(31): Trig = Saturday, 16 February, 1991
|
../tests/test.rem(31): Trig = Saturday, 16 February, 1991
|
||||||
today() => 1991-02-16
|
today() => 1991-02-16
|
||||||
@@ -1060,7 +1060,7 @@ set a057 value("a05"+"6")
|
|||||||
"a05" + "6" => "a056"
|
"a05" + "6" => "a056"
|
||||||
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
|
||||||
set a058 version()
|
set a058 version()
|
||||||
version() => "04.02.08"
|
version() => "04.02.09"
|
||||||
set a059 wkday(today())
|
set a059 wkday(today())
|
||||||
today() => 1991-02-16
|
today() => 1991-02-16
|
||||||
wkday(1991-02-16) => "Saturday"
|
wkday(1991-02-16) => "Saturday"
|
||||||
@@ -2644,7 +2644,7 @@ a086 4
|
|||||||
a109 2012-01-01
|
a109 2012-01-01
|
||||||
a128 2018-02-03@16:45
|
a128 2018-02-03@16:45
|
||||||
a039 "February"
|
a039 "February"
|
||||||
a058 "04.02.08"
|
a058 "04.02.09"
|
||||||
a077 "1992 92\n"
|
a077 "1992 92\n"
|
||||||
a096 -4
|
a096 -4
|
||||||
a119 -1
|
a119 -1
|
||||||
@@ -2789,7 +2789,9 @@ Variable Value
|
|||||||
$LongMin 15
|
$LongMin 15
|
||||||
$LongSec 0
|
$LongSec 0
|
||||||
$March "March"
|
$March "March"
|
||||||
|
$MaxFullOmits 1000
|
||||||
$MaxLateMinutes 0 [0, 1440]
|
$MaxLateMinutes 0 [0, 1440]
|
||||||
|
$MaxPartialOmits 366
|
||||||
$MaxSatIter 150 [10, Inf)
|
$MaxSatIter 150 [10, Inf)
|
||||||
$MaxStringLen 65535 [-1, Inf)
|
$MaxStringLen 65535 [-1, Inf)
|
||||||
$May "May"
|
$May "May"
|
||||||
@@ -2800,6 +2802,8 @@ Variable Value
|
|||||||
$NextMode 0
|
$NextMode 0
|
||||||
$November "November"
|
$November "November"
|
||||||
$Now "now"
|
$Now "now"
|
||||||
|
$NumFullOmits 1
|
||||||
|
$NumPartialOmits 0
|
||||||
$NumQueued 0
|
$NumQueued 0
|
||||||
$NumTrig 41
|
$NumTrig 41
|
||||||
$October "October"
|
$October "October"
|
||||||
@@ -4125,7 +4129,7 @@ Global Weekday OMITs:
|
|||||||
None.
|
None.
|
||||||
CLEAR-OMIT-CONTEXT
|
CLEAR-OMIT-CONTEXT
|
||||||
OMIT 2000-01-01 THROUGH 2020-12-31
|
OMIT 2000-01-01 THROUGH 2020-12-31
|
||||||
../tests/test.rem(841): Too many full OMITs
|
../tests/test.rem(841): Too many full OMITs (max. 1000)
|
||||||
|
|
||||||
OMIT Dec 5 2029 through Dec 4 2029
|
OMIT Dec 5 2029 through Dec 4 2029
|
||||||
../tests/test.rem(843): Error: THROUGH date earlier than start date
|
../tests/test.rem(843): Error: THROUGH date earlier than start date
|
||||||
@@ -4824,15 +4828,54 @@ set a htmlstriptags("<img src=\"foo\">")
|
|||||||
htmlstriptags("<img src=\"foo\">") => ""
|
htmlstriptags("<img src=\"foo\">") => ""
|
||||||
|
|
||||||
# $ParseUntriggered
|
# $ParseUntriggered
|
||||||
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
REM 2 Jan 1990 MSG ["bad_expr" / 2]
|
||||||
../tests/test.rem(885): Expired
|
../tests/test.rem(885): Expired
|
||||||
"bad_expr" * 2 => Type mismatch
|
"bad_expr" / 2 => Type mismatch
|
||||||
../tests/test.rem(885): `*': Type mismatch
|
../tests/test.rem(885): `/': Type mismatch
|
||||||
SET $ParseUntriggered 0
|
SET $ParseUntriggered 0
|
||||||
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
REM 2 Jan 1990 MSG ["bad_expr" / 2]
|
||||||
../tests/test.rem(887): Expired
|
../tests/test.rem(887): Expired
|
||||||
SET $ParseUntriggered 1
|
SET $ParseUntriggered 1
|
||||||
|
|
||||||
|
# String multiplication
|
||||||
|
|
||||||
|
set a "low" * (-1)
|
||||||
|
- 1 => -1
|
||||||
|
"low" * -1 => Number too low
|
||||||
|
../tests/test.rem(892): `*': Number too low
|
||||||
|
set a (-1) * "low"
|
||||||
|
- 1 => -1
|
||||||
|
-1 * "low" => Number too low
|
||||||
|
../tests/test.rem(893): `*': Number too low
|
||||||
|
|
||||||
|
set a "zero" * 0
|
||||||
|
"zero" * 0 => ""
|
||||||
|
set a 0 * "zero"
|
||||||
|
0 * "zero" => ""
|
||||||
|
|
||||||
|
set a "" * 10000000
|
||||||
|
"" * 10000000 => ""
|
||||||
|
set a 10000000 * ""
|
||||||
|
10000000 * "" => ""
|
||||||
|
|
||||||
|
# Too long for default limits
|
||||||
|
set a "wookie" * 1000000
|
||||||
|
"wookie" * 1000000 => String too long
|
||||||
|
../tests/test.rem(902): `*': String too long
|
||||||
|
set a 1000000 * "wookie"
|
||||||
|
1000000 * "wookie" => String too long
|
||||||
|
../tests/test.rem(903): `*': String too long
|
||||||
|
|
||||||
|
set a "Cabbage! " * 7
|
||||||
|
"Cabbage! " * 7 => "Cabbage! Cabbage! Cabbage! Cabbage! Cabb"...
|
||||||
|
set a 7 * "Cabbage! "
|
||||||
|
7 * "Cabbage! " => "Cabbage! Cabbage! Cabbage! Cabbage! Cabb"...
|
||||||
|
|
||||||
|
# Should result in errors
|
||||||
|
set pqxya 1+2)
|
||||||
|
1 + 2 => 3
|
||||||
|
../tests/test.rem(909): Expecting end-of-line
|
||||||
|
|
||||||
# Don't want Remind to queue reminders
|
# Don't want Remind to queue reminders
|
||||||
EXIT
|
EXIT
|
||||||
|
|
||||||
@@ -8678,7 +8721,7 @@ No reminders.
|
|||||||
<< /PageSize [612 792] >> setpagedevice
|
<< /PageSize [612 792] >> setpagedevice
|
||||||
% This file was produced by Remind and Rem2PS, written by
|
% This file was produced by Remind and Rem2PS, written by
|
||||||
% Dianne Skoll.
|
% Dianne Skoll.
|
||||||
% Remind and Rem2PS are Copyright 1992-2023 Dianne Skoll.
|
% Remind and Rem2PS are Copyright 1992-2024 Dianne Skoll.
|
||||||
/ISOLatin1Encoding where { pop save true }{ false } ifelse
|
/ISOLatin1Encoding where { pop save true }{ false } ifelse
|
||||||
/ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus
|
/ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus
|
||||||
StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute
|
StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute
|
||||||
@@ -9782,7 +9825,7 @@ showpage
|
|||||||
<< /PageSize [612 792] >> setpagedevice
|
<< /PageSize [612 792] >> setpagedevice
|
||||||
% This file was produced by Remind and Rem2PS, written by
|
% This file was produced by Remind and Rem2PS, written by
|
||||||
% Dianne Skoll.
|
% Dianne Skoll.
|
||||||
% Remind and Rem2PS are Copyright 1992-2023 Dianne Skoll.
|
% Remind and Rem2PS are Copyright 1992-2024 Dianne Skoll.
|
||||||
/ISOLatin1Encoding where { pop save true }{ false } ifelse
|
/ISOLatin1Encoding where { pop save true }{ false } ifelse
|
||||||
/ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus
|
/ISOLatin1Encoding [ StandardEncoding 0 45 getinterval aload pop /minus
|
||||||
StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute
|
StandardEncoding 46 98 getinterval aload pop /dotlessi /grave /acute
|
||||||
@@ -10894,11 +10937,11 @@ January 2012 31 0 0
|
|||||||
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
|
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
|
||||||
December 31
|
December 31
|
||||||
February 29
|
February 29
|
||||||
{"date":"2012-01-02","filename":"-","lineno":1,"wd":["Monday"],"nonconst_expr":1,"priority":5000,"body":"bar"}
|
{"date":"2012-01-02","filename":"-","lineno":1,"wd":["Monday"],"priority":5000,"omitfunc":"foo","nonconst_expr":1,"body":"bar"}
|
||||||
{"date":"2012-01-09","filename":"-","lineno":1,"wd":["Monday"],"nonconst_expr":1,"priority":5000,"body":"bar"}
|
{"date":"2012-01-09","filename":"-","lineno":1,"wd":["Monday"],"priority":5000,"omitfunc":"foo","nonconst_expr":1,"body":"bar"}
|
||||||
{"date":"2012-01-16","filename":"-","lineno":1,"wd":["Monday"],"nonconst_expr":1,"priority":5000,"body":"bar"}
|
{"date":"2012-01-16","filename":"-","lineno":1,"wd":["Monday"],"priority":5000,"omitfunc":"foo","nonconst_expr":1,"body":"bar"}
|
||||||
{"date":"2012-01-23","filename":"-","lineno":1,"wd":["Monday"],"nonconst_expr":1,"priority":5000,"body":"bar"}
|
{"date":"2012-01-23","filename":"-","lineno":1,"wd":["Monday"],"priority":5000,"omitfunc":"foo","nonconst_expr":1,"body":"bar"}
|
||||||
{"date":"2012-01-30","filename":"-","lineno":1,"wd":["Monday"],"nonconst_expr":1,"priority":5000,"body":"bar"}
|
{"date":"2012-01-30","filename":"-","lineno":1,"wd":["Monday"],"priority":5000,"omitfunc":"foo","nonconst_expr":1,"body":"bar"}
|
||||||
# rem2ps2 end
|
# rem2ps2 end
|
||||||
-stdin-(7): Number too high
|
-stdin-(7): Number too high
|
||||||
-stdin-(7): Number too high
|
-stdin-(7): Number too high
|
||||||
@@ -11696,4 +11739,7 @@ Can't open file: include_dir/ww
|
|||||||
Error reading include_dir/ww: Can't open file
|
Error reading include_dir/ww: Can't open file
|
||||||
SECURITY: Won't read world-writable file or directory!
|
SECURITY: Won't read world-writable file or directory!
|
||||||
Error reading include_dir/ww: No files matching *.rem
|
Error reading include_dir/ww: No files matching *.rem
|
||||||
04.02.08
|
04.02.09
|
||||||
|
NOTE JSONQUEUE
|
||||||
|
[{"priority":2,"eventstart":"VOLATILE","time":"23:59","nexttime":"23:59","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue2.rem","lineno":1,"type":"MSG_TYPE","body":"XXXX"},{"priority":999,"eventstart":"VOLATILE","time":"23:58","nexttime":"23:58","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":5,"type":"MSG_TYPE","body":"quux"},{"priority":42,"eventstart":"VOLATILE","time":"23:57","nexttime":"23:57","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":4,"type":"MSG_TYPE","body":"bar"},{"priority":5000,"eventstart":"VOLATILE","time":"23:56","nexttime":"23:56","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":3,"type":"MSG_TYPE","body":"foo"}]
|
||||||
|
NOTE ENDJSONQUEUE
|
||||||
|
|||||||
@@ -882,11 +882,32 @@ set a htmlstriptags("this is > whut <b>foo</b>")
|
|||||||
set a htmlstriptags("<img src=\"foo\">")
|
set a htmlstriptags("<img src=\"foo\">")
|
||||||
|
|
||||||
# $ParseUntriggered
|
# $ParseUntriggered
|
||||||
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
REM 2 Jan 1990 MSG ["bad_expr" / 2]
|
||||||
SET $ParseUntriggered 0
|
SET $ParseUntriggered 0
|
||||||
REM 2 Jan 1990 MSG ["bad_expr" * 2]
|
REM 2 Jan 1990 MSG ["bad_expr" / 2]
|
||||||
SET $ParseUntriggered 1
|
SET $ParseUntriggered 1
|
||||||
|
|
||||||
|
# String multiplication
|
||||||
|
|
||||||
|
set a "low" * (-1)
|
||||||
|
set a (-1) * "low"
|
||||||
|
|
||||||
|
set a "zero" * 0
|
||||||
|
set a 0 * "zero"
|
||||||
|
|
||||||
|
set a "" * 10000000
|
||||||
|
set a 10000000 * ""
|
||||||
|
|
||||||
|
# Too long for default limits
|
||||||
|
set a "wookie" * 1000000
|
||||||
|
set a 1000000 * "wookie"
|
||||||
|
|
||||||
|
set a "Cabbage! " * 7
|
||||||
|
set a 7 * "Cabbage! "
|
||||||
|
|
||||||
|
# Should result in errors
|
||||||
|
set pqxya 1+2)
|
||||||
|
|
||||||
# Don't want Remind to queue reminders
|
# Don't want Remind to queue reminders
|
||||||
EXIT
|
EXIT
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
# Use the output to verify your translations.
|
# Use the output to verify your translations.
|
||||||
#
|
#
|
||||||
# This file is part of REMIND.
|
# This file is part of REMIND.
|
||||||
# Copyright (C) 1992-2023 Dianne Skoll
|
# Copyright (C) 1992-2024 Dianne Skoll
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
#
|
#
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user