mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 23:08:40 +02:00
Rename "wouldtrig" to just "trig"
This commit is contained in:
2
configure
vendored
2
configure
vendored
@@ -3994,7 +3994,7 @@ _ACEOF
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
VERSION=03.04.01
|
VERSION=03.04.02
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale initgroups)
|
||||||
VERSION=03.04.01
|
VERSION=03.04.02
|
||||||
AC_SUBST(VERSION)
|
AC_SUBST(VERSION)
|
||||||
AC_SUBST(PERL)
|
AC_SUBST(PERL)
|
||||||
AC_SUBST(PERLARTIFACTS)
|
AC_SUBST(PERLARTIFACTS)
|
||||||
|
|||||||
13
src/funcs.c
13
src/funcs.c
@@ -58,6 +58,7 @@ static int FADusk (func_info *);
|
|||||||
static int FAbs (func_info *);
|
static int FAbs (func_info *);
|
||||||
static int FAccess (func_info *);
|
static int FAccess (func_info *);
|
||||||
static int FAmpm (func_info *);
|
static int FAmpm (func_info *);
|
||||||
|
static int FTrig (func_info *);
|
||||||
static int FIsAny (func_info *);
|
static int FIsAny (func_info *);
|
||||||
static int FArgs (func_info *);
|
static int FArgs (func_info *);
|
||||||
static int FAsc (func_info *);
|
static int FAsc (func_info *);
|
||||||
@@ -126,6 +127,7 @@ static int FSunset (func_info *);
|
|||||||
static int FTime (func_info *);
|
static int FTime (func_info *);
|
||||||
static int FTimepart (func_info *);
|
static int FTimepart (func_info *);
|
||||||
static int FToday (func_info *);
|
static int FToday (func_info *);
|
||||||
|
static int FTrig (func_info *);
|
||||||
static int FTrigback (func_info *);
|
static int FTrigback (func_info *);
|
||||||
static int FTrigdate (func_info *);
|
static int FTrigdate (func_info *);
|
||||||
static int FTrigdatetime (func_info *);
|
static int FTrigdatetime (func_info *);
|
||||||
@@ -151,7 +153,6 @@ static int FVersion (func_info *);
|
|||||||
static int FWeekno (func_info *);
|
static int FWeekno (func_info *);
|
||||||
static int FWkday (func_info *);
|
static int FWkday (func_info *);
|
||||||
static int FWkdaynum (func_info *);
|
static int FWkdaynum (func_info *);
|
||||||
static int FWouldTrig (func_info *);
|
|
||||||
static int FYear (func_info *);
|
static int FYear (func_info *);
|
||||||
static int FShellescape (func_info *);
|
static int FShellescape (func_info *);
|
||||||
|
|
||||||
@@ -280,6 +281,7 @@ BuiltinFunc Func[] = {
|
|||||||
{ "time", 2, 2, 1, FTime },
|
{ "time", 2, 2, 1, FTime },
|
||||||
{ "timepart", 1, 1, 1, FTimepart },
|
{ "timepart", 1, 1, 1, FTimepart },
|
||||||
{ "today", 0, 0, 0, FToday },
|
{ "today", 0, 0, 0, FToday },
|
||||||
|
{ "trig", 0, NO_MAX, 0, FTrig },
|
||||||
{ "trigback", 0, 0, 0, FTrigback },
|
{ "trigback", 0, 0, 0, FTrigback },
|
||||||
{ "trigdate", 0, 0, 0, FTrigdate },
|
{ "trigdate", 0, 0, 0, FTrigdate },
|
||||||
{ "trigdatetime", 0, 0, 0, FTrigdatetime },
|
{ "trigdatetime", 0, 0, 0, FTrigdatetime },
|
||||||
@@ -305,7 +307,6 @@ BuiltinFunc Func[] = {
|
|||||||
{ "weekno", 0, 3, 1, FWeekno },
|
{ "weekno", 0, 3, 1, FWeekno },
|
||||||
{ "wkday", 1, 1, 1, FWkday },
|
{ "wkday", 1, 1, 1, FWkday },
|
||||||
{ "wkdaynum", 1, 1, 1, FWkdaynum },
|
{ "wkdaynum", 1, 1, 1, FWkdaynum },
|
||||||
{ "wouldtrig", 0, NO_MAX, 0, FWouldTrig },
|
|
||||||
{ "year", 1, 1, 1, FYear }
|
{ "year", 1, 1, 1, FYear }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3011,9 +3012,9 @@ FEvalTrig(func_info *info)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int LastWouldTrig = 0;
|
static int LastTrig = 0;
|
||||||
static int
|
static int
|
||||||
FWouldTrig(func_info *info)
|
FTrig(func_info *info)
|
||||||
{
|
{
|
||||||
Parser p;
|
Parser p;
|
||||||
Trigger trig;
|
Trigger trig;
|
||||||
@@ -3024,7 +3025,7 @@ FWouldTrig(func_info *info)
|
|||||||
|
|
||||||
RetVal.type = DATE_TYPE;
|
RetVal.type = DATE_TYPE;
|
||||||
if (Nargs == 0) {
|
if (Nargs == 0) {
|
||||||
RETVAL = LastWouldTrig;
|
RETVAL = LastTrig;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3055,7 +3056,7 @@ FWouldTrig(func_info *info)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ShouldTriggerReminder(&trig, &tim, jul, &r)) {
|
if (ShouldTriggerReminder(&trig, &tim, jul, &r)) {
|
||||||
LastWouldTrig = jul;
|
LastTrig = jul;
|
||||||
RETVAL = jul;
|
RETVAL = jul;
|
||||||
DestroyParser(&p);
|
DestroyParser(&p);
|
||||||
FreeTrig(&trig);
|
FreeTrig(&trig);
|
||||||
|
|||||||
@@ -1020,7 +1020,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() => "03.04.01"
|
version() => "03.04.02"
|
||||||
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"
|
||||||
@@ -2589,7 +2589,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 "03.04.01"
|
a058 "03.04.02"
|
||||||
a077 "1992 92
|
a077 "1992 92
|
||||||
"
|
"
|
||||||
a096 -4
|
a096 -4
|
||||||
@@ -3752,47 +3752,47 @@ set x psmoon(0)
|
|||||||
psmoon(0) => ../tests/test.rem(731): psmoon() is deprecated; use SPECIAL MOON instead.
|
psmoon(0) => ../tests/test.rem(731): psmoon() is deprecated; use SPECIAL MOON instead.
|
||||||
"gsave 0 setgray newpath Border DaySize 2"...
|
"gsave 0 setgray newpath Border DaySize 2"...
|
||||||
|
|
||||||
# Wouldtrig
|
# Trig
|
||||||
IF wouldtrig("sun +1") || wouldtrig("thu +1")
|
IF trig("sun +1") || trig("thu +1")
|
||||||
wouldtrig("sun +1") => ../tests/test.rem(734): Trig = Sunday, 17 February, 1991
|
trig("sun +1") => ../tests/test.rem(734): Trig = Sunday, 17 February, 1991
|
||||||
1991-02-17
|
1991-02-17
|
||||||
wouldtrig("thu +1") => ../tests/test.rem(734): Trig = Thursday, 21 February, 1991
|
trig("thu +1") => ../tests/test.rem(734): Trig = Thursday, 21 February, 1991
|
||||||
1990-01-01
|
1990-01-01
|
||||||
1991-02-17 || 1990-01-01 => 1991-02-17
|
1991-02-17 || 1990-01-01 => 1991-02-17
|
||||||
REM [wouldtrig()] +1 MSG Foo %b
|
REM [trig()] +1 MSG Foo %b
|
||||||
wouldtrig() => 1991-02-17
|
trig() => 1991-02-17
|
||||||
../tests/test.rem(735): Trig = Sunday, 17 February, 1991
|
../tests/test.rem(735): Trig = Sunday, 17 February, 1991
|
||||||
Foo tomorrow
|
Foo tomorrow
|
||||||
|
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
# Wouldtrig with a bad warnfunc
|
# Trig with a bad warnfunc
|
||||||
FSET w(x) x/0
|
FSET w(x) x/0
|
||||||
IF wouldtrig("sun warn w") || wouldtrig("thu warn w")
|
IF trig("sun warn w") || trig("thu warn w")
|
||||||
wouldtrig("sun warn w") => ../tests/test.rem(740): Trig = Sunday, 17 February, 1991
|
trig("sun warn w") => ../tests/test.rem(740): Trig = Sunday, 17 February, 1991
|
||||||
Entering UserFN w(1)
|
Entering UserFN w(1)
|
||||||
x => 1
|
x => 1
|
||||||
1 / 0 => Division by zero
|
1 / 0 => Division by zero
|
||||||
../tests/test.rem(740): `/': Division by zero
|
../tests/test.rem(740): `/': Division by zero
|
||||||
Leaving UserFN w() => Division by zero
|
Leaving UserFN w() => Division by zero
|
||||||
1990-01-01
|
1990-01-01
|
||||||
wouldtrig("thu warn w") => ../tests/test.rem(740): Trig = Thursday, 21 February, 1991
|
trig("thu warn w") => ../tests/test.rem(740): Trig = Thursday, 21 February, 1991
|
||||||
Entering UserFN w(1)
|
Entering UserFN w(1)
|
||||||
x => 1
|
x => 1
|
||||||
1 / 0 => Division by zero
|
1 / 0 => Division by zero
|
||||||
Leaving UserFN w() => Division by zero
|
Leaving UserFN w() => Division by zero
|
||||||
1990-01-01
|
1990-01-01
|
||||||
1990-01-01 || 1990-01-01 => 1990-01-01
|
1990-01-01 || 1990-01-01 => 1990-01-01
|
||||||
REM [wouldtrig()] +1 MSG Foo %b
|
REM [trig()] +1 MSG Foo %b
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
# Wouldtrig with a good warnfunc
|
# Trig with a good warnfunc
|
||||||
FSET w(x) choose(x, 5, 3, 1, 0)
|
FSET w(x) choose(x, 5, 3, 1, 0)
|
||||||
|
|
||||||
# Ugh. This is where short-circuit logical operators
|
# Ugh. This is where short-circuit logical operators
|
||||||
# would really come in handy.
|
# would really come in handy.
|
||||||
IF wouldtrig("sun warn w") || wouldtrig("thu warn w")
|
IF trig("sun warn w") || trig("thu warn w")
|
||||||
wouldtrig("sun warn w") => ../tests/test.rem(749): Trig = Sunday, 17 February, 1991
|
trig("sun warn w") => ../tests/test.rem(749): Trig = Sunday, 17 February, 1991
|
||||||
Entering UserFN w(1)
|
Entering UserFN w(1)
|
||||||
x => 1
|
x => 1
|
||||||
choose(1, 5, 3, 1, 0) => 5
|
choose(1, 5, 3, 1, 0) => 5
|
||||||
@@ -3806,15 +3806,15 @@ x => 3
|
|||||||
choose(3, 5, 3, 1, 0) => 1
|
choose(3, 5, 3, 1, 0) => 1
|
||||||
Leaving UserFN w() => 1
|
Leaving UserFN w() => 1
|
||||||
1991-02-17
|
1991-02-17
|
||||||
wouldtrig("thu warn w") => ../tests/test.rem(749): Trig = Thursday, 21 February, 1991
|
trig("thu warn w") => ../tests/test.rem(749): Trig = Thursday, 21 February, 1991
|
||||||
Entering UserFN w(1)
|
Entering UserFN w(1)
|
||||||
x => 1
|
x => 1
|
||||||
choose(1, 5, 3, 1, 0) => 5
|
choose(1, 5, 3, 1, 0) => 5
|
||||||
Leaving UserFN w() => 5
|
Leaving UserFN w() => 5
|
||||||
1991-02-21
|
1991-02-21
|
||||||
1991-02-17 || 1991-02-21 => 1991-02-17
|
1991-02-17 || 1991-02-21 => 1991-02-17
|
||||||
REM [wouldtrig()] +5 MSG Foo %b
|
REM [trig()] +5 MSG Foo %b
|
||||||
wouldtrig() => 1991-02-21
|
trig() => 1991-02-21
|
||||||
../tests/test.rem(750): Trig = Thursday, 21 February, 1991
|
../tests/test.rem(750): Trig = Thursday, 21 February, 1991
|
||||||
Foo in 5 days' time
|
Foo in 5 days' time
|
||||||
|
|
||||||
|
|||||||
@@ -730,24 +730,24 @@ msg [a]
|
|||||||
set x psshade(50)
|
set x psshade(50)
|
||||||
set x psmoon(0)
|
set x psmoon(0)
|
||||||
|
|
||||||
# Wouldtrig
|
# Trig
|
||||||
IF wouldtrig("sun +1") || wouldtrig("thu +1")
|
IF trig("sun +1") || trig("thu +1")
|
||||||
REM [wouldtrig()] +1 MSG Foo %b
|
REM [trig()] +1 MSG Foo %b
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
# Wouldtrig with a bad warnfunc
|
# Trig with a bad warnfunc
|
||||||
FSET w(x) x/0
|
FSET w(x) x/0
|
||||||
IF wouldtrig("sun warn w") || wouldtrig("thu warn w")
|
IF trig("sun warn w") || trig("thu warn w")
|
||||||
REM [wouldtrig()] +1 MSG Foo %b
|
REM [trig()] +1 MSG Foo %b
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
# Wouldtrig with a good warnfunc
|
# Trig with a good warnfunc
|
||||||
FSET w(x) choose(x, 5, 3, 1, 0)
|
FSET w(x) choose(x, 5, 3, 1, 0)
|
||||||
|
|
||||||
# Ugh. This is where short-circuit logical operators
|
# Ugh. This is where short-circuit logical operators
|
||||||
# would really come in handy.
|
# would really come in handy.
|
||||||
IF wouldtrig("sun warn w") || wouldtrig("thu warn w")
|
IF trig("sun warn w") || trig("thu warn w")
|
||||||
REM [wouldtrig()] +5 MSG Foo %b
|
REM [trig()] +5 MSG Foo %b
|
||||||
ENDIF
|
ENDIF
|
||||||
|
|
||||||
# Don't want Remind to queue reminders
|
# Don't want Remind to queue reminders
|
||||||
|
|||||||
Reference in New Issue
Block a user