Compare commits

...

16 Commits

Author SHA1 Message Date
David F. Skoll
487338d10c Updated for 3.1.4 release. 2008-02-03 17:12:16 -05:00
David F. Skoll
3d1c0e5667 Fix awful bug in rem2html for a 28-day February that starts on Sunday... 2008-01-31 23:31:45 -05:00
David F. Skoll
ce3bb191c4 More code cleanups and const-correctness. 2008-01-30 21:37:19 -05:00
David F. Skoll
03e9dbf364 More const qualification. 2008-01-28 11:39:15 -05:00
David F. Skoll
518aab3d02 Don't trash argv[] so reread works properly. 2008-01-28 11:28:17 -05:00
David F. Skoll
f055664f77 More const-correctness. 2008-01-27 11:02:03 -05:00
David F. Skoll
ba3e01f2ce Add a bunch of const qualifiers. 2008-01-26 21:55:58 -05:00
David F. Skoll
b6883c8a45 Keep version number in ONE place (configure.in) instead of two. 2008-01-26 15:34:32 -05:00
David F. Skoll
9e49ee3acb Make tkremind obey -b1 option (24-hour mode.) 2008-01-26 12:01:43 -05:00
David F. Skoll
7481f68bb2 Make tkremind work better with Tk8.5. 2007-12-24 11:40:22 -05:00
David F. Skoll
99792eec03 Add a test. 2007-11-05 11:52:50 -05:00
David F. Skoll
91458c7845 Better patch for parsing bug. 2007-11-05 11:44:48 -05:00
David F. Skoll
cad5849dc0 Merge branch 'master' of ssh://magnesium.roaringpenguin.com/home/dfs/personal-git-repos/Remind 2007-11-05 11:38:17 -05:00
David F. Skoll
a38e120e99 Fix weird parsing bug if you have a SKIP on an omitted day with a SATISFY. 2007-11-05 11:37:48 -05:00
David F. Skoll
0b31a78cf2 Patch to clean up HTML output (Jorey Bump) 2007-10-16 11:46:58 -04:00
David F. Skoll
861858c1a6 Bump version to 03.01.04. 2007-10-15 14:17:09 -04:00
37 changed files with 422 additions and 303 deletions

1
.gitignore vendored
View File

@@ -12,3 +12,4 @@ tests/test.out
.gitignore
*~
src/rem2ps
src/version.h

9
configure vendored
View File

@@ -666,6 +666,7 @@ SET_MAKE
CPP
GREP
EGREP
VERSION
LIBOBJS
LTLIBOBJS'
ac_subst_files=''
@@ -5281,7 +5282,9 @@ _ACEOF
fi
done
ac_config_files="$ac_config_files src/Makefile www/Makefile"
VERSION=03.01.04
ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -5839,6 +5842,7 @@ do
"src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
"www/Makefile") CONFIG_FILES="$CONFIG_FILES www/Makefile" ;;
"src/version.h") CONFIG_FILES="$CONFIG_FILES src/version.h" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -5952,11 +5956,12 @@ SET_MAKE!$SET_MAKE$ac_delim
CPP!$CPP$ac_delim
GREP!$GREP$ac_delim
EGREP!$EGREP$ac_delim
VERSION!$VERSION$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; then
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 55; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

View File

@@ -45,4 +45,6 @@ if test "$GCC" = yes; then
fi
AC_CHECK_FUNCS(setenv unsetenv)
AC_OUTPUT(src/Makefile www/Makefile)
VERSION=03.01.04
AC_SUBST(VERSION)
AC_OUTPUT(src/Makefile www/Makefile src/version.h)

View File

@@ -1,5 +1,24 @@
CHANGES TO REMIND
* Version 3.1 Patch 4 - 2008-02-03
- ENHANCMENT: tkremind respects the "-b1" option and operates in 24-hour
clock mode if the option is supplied.
- ENHANCEMENT: tkremind has been tweaked to look better with Tcl/Tk 8.5.
- CLEANUP: Version is kept only in configure.in instead of two different
places.
- CLEANUP: Added "const" qualifier to many places in the code that previously
lacked it.
- BUG FIX: A rare parsing error involving interaction between SATISFY and
SKIP has been fixed.
- BUG FIX: rem2html would output a horribly-wrong calendar for a 28-day
February starting on Sunday (such as February 2009.) This has been fixed.
* Version 3.1 Patch 3 - 2007-10-15
+ MINOR ENHANCEMENTS

View File

@@ -21,6 +21,8 @@ extra features as you become a more sophisticated \fBRemind\fR programmer.
on to \fBRemind\fR. The options it passes are
\fB\-b\fR, \fB\-g\fR, \fB\-x\fR, \fB\-i\fR and \fB\-m\fR.
See the \fBRemind\fR man page for details about the options.
Note that \fBTkRemind\fR will respect the \fB\-m\fR and
\fB\-b1\fR options and adjust its appearance accordingly.
\fIRead_file\fR is the file from which \fBTkRemind\fR reads reminders.
It is in standard \fBRemind\fR format. \fIWrite_file\fR is the file

View File

@@ -95,6 +95,9 @@ catch {set AppendFile $ReminderFile}
#---------------- DON'T CHANGE STUFF BELOW HERE ------------------
# 24-hour clock mode
set TwentyFourHourMode 0
# Is Monday in first column?
set MondayFirst 0
@@ -153,7 +156,7 @@ set HighestTagSoFar 0
proc Initialize {} {
global DayNames argc argv CommandLine ReminderFile AppendFile Remind PSCmd
global MondayFirst
global MondayFirst TwentyFourHourMode
set CommandLine "|$Remind -itkremind=1 -p -y -l"
set PSCmd "$Remind -p -l"
@@ -165,6 +168,9 @@ proc Initialize {} {
if {[regexp -- {m} [lindex $argv $i]]} {
set MondayFirst 1
}
if {"[lindex $argv $i]" == "-b1"} {
set TwentyFourHourMode 1
}
} else {
break
}
@@ -329,10 +335,17 @@ proc CreateCalFrame { w dayNames } {
#***********************************************************************
proc ConfigureCalFrame { w firstDay numDays } {
global CurMonth CurYear TodayMonth TodayYear TodayDay
global tk_version
set offset [CalEntryOffset $firstDay]
set first [expr $offset+1]
set last [expr $offset+$numDays]
if {$tk_version >= 8.5} {
set bg "#d9d9d9"
} else {
set bg [lindex [$w.t0 configure -background] 3]
}
for {set i 0} {$i < $first} {incr i} {
grid $w.l$i $w.t$i
$w.l$i configure -text "" -command "" -state disabled -relief flat
@@ -344,8 +357,8 @@ proc ConfigureCalFrame { w firstDay numDays } {
$w.t$i tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i"
$w.t$i tag bind REM <ButtonPress-3> "FireEditor $w.t$i"
$w.t$i configure -state disabled
$w.t$i configure -background [lindex [$w.t$i configure -background] 3]
$w.l$i configure -background [lindex [$w.l$i configure -background] 3]
$w.t$i configure -background $bg
$w.l$i configure -background $bg
}
for {set i $first} {$i <= $last} {incr i} {
grid $w.l$i $w.t$i
@@ -360,8 +373,8 @@ proc ConfigureCalFrame { w firstDay numDays } {
$w.t$i tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i"
$w.t$i tag bind REM <ButtonPress-3> "FireEditor $w.t$i"
$w.t$i configure -state disabled
$w.t$i configure -background [lindex [$w.t$i configure -background] 3]
$w.l$i configure -background [lindex [$w.l$i configure -background] 3]
$w.t$i configure -background $bg
$w.l$i configure -background $bg
}
set forgetIt 0
for {set i [expr $last+1]} {$i < 42} {incr i} {
@@ -385,8 +398,8 @@ proc ConfigureCalFrame { w firstDay numDays } {
$w.t$i tag bind TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i"
$w.t$i tag bind REM <ButtonPress-3> "FireEditor $w.t$i"
$w.t$i configure -state disabled
$w.t$i configure -background [lindex [$w.t$i configure -background] 3]
$w.l$i configure -background [lindex [$w.l$i configure -background] 3]
$w.t$i configure -background $bg
$w.l$i configure -background $bg
}
if { $CurMonth == $TodayMonth && $CurYear == $TodayYear } {
set n [expr $TodayDay + $offset]
@@ -1067,7 +1080,7 @@ proc CreateModifyDialog {w day firstDay args} {
# Set up: Year, Month, Day, WeekdayName
global CurYear CurMonth EnglishDayNames MonthNames OptionType SkipType
global ModifyDialogResult
global ModifyDialogResult TwentyFourHourMode
set OptionType 1
set SkipType 1
@@ -1187,7 +1200,11 @@ proc CreateModifyDialog {w day firstDay args} {
checkbutton $w.timebut -text "Timed reminder at"
$w.timebut deselect
menubutton $w.timehour -text "12" -menu $w.timehour.menu -relief raised
CreateDayMenu $w.timehour 1 12 0
if {$TwentyFourHourMode} {
CreateDayMenu $w.timehour 0 23 0
} else {
CreateDayMenu $w.timehour 1 12 0
}
menubutton $w.timemin -text "00" -menu $w.timemin.menu -relief raised
menu $w.timemin.menu -tearoff 0
foreach i {00 05 10 15 20 25 30 35 40 45 50 55} {
@@ -1195,10 +1212,12 @@ proc CreateModifyDialog {w day firstDay args} {
-command "$w.timemin configure -text $i"
}
menubutton $w.ampm -text "PM" -menu $w.ampm.menu -relief raised
menu $w.ampm.menu -tearoff 0
$w.ampm.menu add command -label "AM" -command "$w.ampm configure -text {AM}"
$w.ampm.menu add command -label "PM" -command "$w.ampm configure -text {PM}"
if {!$TwentyFourHourMode} {
menubutton $w.ampm -text "PM" -menu $w.ampm.menu -relief raised
menu $w.ampm.menu -tearoff 0
$w.ampm.menu add command -label "AM" -command "$w.ampm configure -text {AM}"
$w.ampm.menu add command -label "PM" -command "$w.ampm configure -text {PM}"
}
checkbutton $w.timeadvbut -text "with"
$w.timeadvbut deselect
@@ -1217,7 +1236,11 @@ proc CreateModifyDialog {w day firstDay args} {
$w.timerep.menu add command -label $i -command "$w.timerep configure -text $i"
}
label $w.timelab2 -text "minutes"
pack $w.timebut $w.timehour $w.timemin $w.ampm $w.timeadvbut $w.timeadv $w.timelab1 $w.timerepbut $w.timerep $w.timelab2 -side left -anchor w -in $w.time
if {$TwentyFourHourMode} {
pack $w.timebut $w.timehour $w.timemin $w.timeadvbut $w.timeadv $w.timelab1 $w.timerepbut $w.timerep $w.timelab2 -side left -anchor w -in $w.time
} else {
pack $w.timebut $w.timehour $w.timemin $w.ampm $w.timeadvbut $w.timeadv $w.timelab1 $w.timerepbut $w.timerep $w.timelab2 -side left -anchor w -in $w.time
}
# SKIP TYPE
label $w.labhol -text "On holidays or weekends:"
@@ -1295,13 +1318,20 @@ proc RemindDialogToOptions { w } {
#***********************************************************************
proc OptionsToRemindDialog { w opts } {
global OptionType SkipType repbut expbut advbut advcount
global timebut timeadvbut timerepbut
global timebut timeadvbut timerepbut TwentyFourHourMode
global dSaturday dSunday dMonday dTuesday dWednesday dThursday dFriday
set hour ""
set ampm ""
foreach {flag value} $opts {
switch -glob -- $flag {
"-text-*" {
set win [string range $flag 6 end]
$w.$win configure -text $value
catch { $w.$win configure -text $value }
if {"$flag" == "-text-ampm"} {
set ampm $value
} elseif {"$flag" == "-text-timehour"} {
set hour $value
}
}
"-global-*" {
set win [string range $flag 8 end]
@@ -1314,6 +1344,24 @@ proc OptionsToRemindDialog { w opts } {
}
}
}
if {"$hour" != ""} {
if {$TwentyFourHourMode} {
if {"$ampm" != ""} {
if {"$ampm" == "PM" && $hour < 12} {
incr hour 12;
$w.timehour configure -text $hour
}
}
} else {
if {$hour > 12} {
incr hour -12
$w.timehour configure -text $hour
$w.ampm configure -text "PM"
} else {
$w.ampm configure -text "AM"
}
}
}
}
#---------------------------------------------------------------------------
@@ -1467,7 +1515,7 @@ proc CenterWindow {w} {
# The reminder as a string.
#---------------------------------------------------------------------------
proc CreateReminder {w} {
global DidOmit
global DidOmit TwentyFourHourMode
set body [string trim [$w.entry get]]
@@ -1504,13 +1552,15 @@ proc CreateReminder {w} {
if {$timebut} {
set hour [$w.timehour cget -text]
set min [$w.timemin cget -text]
if {[$w.ampm cget -text] == "PM"} {
if {$hour < 12} {
incr hour 12
}
} else {
if {$hour == 12} {
set hour 0
if {!$TwentyFourHourMode} {
if {[$w.ampm cget -text] == "PM"} {
if {$hour < 12} {
incr hour 12
}
} else {
if {$hour == 12} {
set hour 0
}
}
}
append rem " AT $hour:$min"
@@ -2647,7 +2697,12 @@ proc DoMoonSpecial { n stuff } {
# Displays current date and time in status window
#***********************************************************************
proc DisplayTime {} {
set msg [clock format [clock seconds] -format "%e %b %Y %I:%M%p"]
global TwentyFourHourMode
if {$TwentyFourHourMode} {
set msg [clock format [clock seconds] -format "%e %b %Y %H:%M"]
} else {
set msg [clock format [clock seconds] -format "%e %b %Y %I:%M%p"]
}
Status $msg
}

View File

@@ -1,7 +1,6 @@
# Makefile.in for REMIND
#
VERSION=03.01.03
SHELL= /bin/sh
BETA = 1
srcdir=@srcdir@
@@ -12,6 +11,7 @@ bindir=@bindir@
datadir=@datadir@
datarootdir=@datarootdir@
VPATH=$(srcdir)
VERSION=@VERSION@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
@@ -92,3 +92,4 @@ beta-tgz:
#---------------- Stuff after this added by "make depend" -----------------

View File

@@ -28,14 +28,14 @@
/* Data structures used by the calendar */
typedef struct cal_entry {
struct cal_entry *next;
char *text;
char *pos;
char const *text;
char const *pos;
int time;
int priority;
char tag[TAG_LEN+1];
char passthru[PASSTHRU_LEN+1];
int duration;
char *filename;
char const *filename;
int lineno;
} CalEntry;
@@ -48,8 +48,8 @@ static void SortCol (CalEntry **col);
static void DoCalendarOneWeek (void);
static void DoCalendarOneMonth (void);
static int WriteCalendarRow (void);
static void PrintLeft (char *s, int width, char pad);
static void PrintCentered (char *s, int width, char pad);
static void PrintLeft (char const *s, int width, char pad);
static void PrintCentered (char const *s, int width, char pad);
static int WriteOneCalLine (void);
static int WriteOneColLine (int col);
static void GenerateCalEntries (int col);
@@ -303,7 +303,7 @@ static int WriteCalendarRow(void)
/* Left-justify a piece of text. */
/* */
/***************************************************************/
static void PrintLeft(char *s, int width, char pad)
static void PrintLeft(char const *s, int width, char pad)
{
int len = strlen(s);
printf("%s", s);
@@ -317,7 +317,7 @@ static void PrintLeft(char *s, int width, char pad)
/* Center a piec of text */
/* */
/***************************************************************/
static void PrintCentered(char *s, int width, char pad)
static void PrintCentered(char const *s, int width, char pad)
{
int len = strlen(s);
int d = (width - len) / 2;
@@ -367,8 +367,8 @@ static int WriteOneCalLine(void)
static int WriteOneColLine(int col)
{
CalEntry *e = CalColumn[col];
char *s;
char *space;
char const *s;
char const *space;
int numwritten = 0;
/* Print as many characters as possible within the column */
@@ -380,8 +380,8 @@ static int WriteOneColLine(int col)
if (!*s && e->next) {
PrintLeft("", ColSpaces, ' ');
CalColumn[col] = e->next;
free(e->text);
free(e->filename);
free((char *) e->text);
free((char *) e->filename);
free(e);
return 1;
}
@@ -420,8 +420,8 @@ static int WriteOneColLine(int col)
/* If done, free memory if no next entry. */
if (!*s && !e->next) {
CalColumn[col] = e->next;
free(e->text);
free(e->filename);
free((char *) e->text);
free((char *) e->filename);
free(e);
} else {
e->pos = s;
@@ -440,7 +440,7 @@ static void GenerateCalEntries(int col)
{
int r;
Token tok;
char *s;
char const *s;
Parser p;
/* Do some initialization first... */
@@ -588,7 +588,7 @@ static int DoCalRem(ParsePtr p, int col)
int jul;
CalEntry *CurCol = CalColumn[col];
CalEntry *e;
char *s, *s2;
char const *s, *s2;
DynamicBuffer buf, obuf, pre_buf;
Token tok;
@@ -830,8 +830,8 @@ static void WriteSimpleEntries(int col, int jul)
printf("* ");
}
printf("%s\n", e->text);
free(e->text);
free(e->filename);
free((char *) e->text);
free((char *) e->filename);
n = e->next;
free(e);
e = n;
@@ -888,14 +888,14 @@ static void WriteCalDays(void)
/* This takes into account duration */
/* */
/***************************************************************/
char *
char const *
CalendarTime(int tim, int duration)
{
static char buf[128];
int h, min, hh;
int h2, min2, hh2, newtim, days;
char *ampm1;
char *ampm2;
char const *ampm1;
char const *ampm2;
char daybuf[64];
buf[0] = 0;
@@ -970,7 +970,7 @@ CalendarTime(int tim, int duration)
/* A trailing space is always added. */
/* */
/***************************************************************/
char *SimpleTime(int tim)
char const *SimpleTime(int tim)
{
static char buf[32];
int h, min, hh;

View File

@@ -1,5 +1,3 @@
/* src/config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if utime(file, NULL) sets file's timestamp to the present. */
#undef HAVE_UTIME_NULL

View File

@@ -555,7 +555,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
char tmpBuf[64];
DynamicBuffer buf, calRow;
DynamicBuffer pre_buf;
char *s;
char const *s;
Value v;
DBufInit(&buf);
@@ -812,7 +812,8 @@ int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
{
int iter, jul, r;
Value v;
char *s, *t;
char const *s;
char const *t;
t = p->pos;
iter = 0;
@@ -848,7 +849,7 @@ int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
static int ParsePriority(ParsePtr s, Trigger *t)
{
int p, r;
char *u;
char const *u;
DynamicBuffer buf;
DBufInit(&buf);
@@ -886,14 +887,14 @@ static int ParsePriority(ParsePtr s, Trigger *t)
/* Execute the '-k' command, escaping shell chars in message. */
/* */
/***************************************************************/
int DoMsgCommand(char *cmd, char *msg)
int DoMsgCommand(char const *cmd, char const *msg)
{
int r;
int i, l;
DynamicBuffer execBuffer;
DynamicBuffer buf;
char *s;
char const *s;
DBufInit(&buf);
DBufInit(&execBuffer);
@@ -951,7 +952,7 @@ static int ShouldTriggerBasedOnWarn(Trigger *t, int jul)
{
char buffer[VAR_NAME_LEN+32];
int i;
char *s;
char const *s;
int r;
Value v;
int lastReturnVal = 0; /* Silence compiler warning */

View File

@@ -54,11 +54,12 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
int d, m, y;
int tim = tt->ttime;
int h, min, hh, ch, cmin, chh;
char *pm, *cpm;
char const *pm, *cpm;
int tdiff, adiff, mdiff, hdiff;
char *mplu, *hplu, *when, *plu;
char const *mplu, *hplu, *when, *plu;
int has_quote = 0;
char *ss, *os;
char *ss;
char *os;
char s[256];
int origLen = DBufLen(dbuf);
@@ -649,7 +650,7 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
/* default triggers and a mode of NORMAL_MODE. */
/* */
/***************************************************************/
int DoSubstFromString(char *source, DynamicBuffer *dbuf,
int DoSubstFromString(char const *source, DynamicBuffer *dbuf,
int jul, int tim)
{
Trigger tempTrig;

View File

@@ -42,7 +42,7 @@ static int DBufMakeRoom(DynamicBuffer *dbuf, int n)
}
/* Allocate memory */
buf = (char *) malloc(size);
buf = malloc(size);
if (!buf) return E_NO_MEM;
/* Copy contents */
@@ -102,7 +102,7 @@ int DBufPutcFN(DynamicBuffer *dbuf, char c)
%DESCRIPTION:
Appends a string to the buffer.
**********************************************************************/
int DBufPuts(DynamicBuffer *dbuf, char *str)
int DBufPuts(DynamicBuffer *dbuf, char const *str)
{
int l = strlen(str);
if (!l) return OK;

View File

@@ -25,7 +25,7 @@ typedef struct {
void DBufInit(DynamicBuffer *dbuf);
int DBufPutcFN(DynamicBuffer *dbuf, char c);
int DBufPuts(DynamicBuffer *dbuf, char *str);
int DBufPuts(DynamicBuffer *dbuf, char const *str);
void DBufFree(DynamicBuffer *dbuf);
int DBufGets(DynamicBuffer *dbuf, FILE *fp);

View File

@@ -41,8 +41,8 @@ static int Multiply(void), Divide(void), Mod(void), Add(void),
UnMinus(void), LogNot(void),
Compare(int);
static int MakeValue (char *s, Value *v, Var *locals);
static int ParseLiteralDate (char **s, int *jul, int *tim);
static int MakeValue (char const *s, Value *v, Var *locals);
static int ParseLiteralDate (char const **s, int *jul, int *tim);
/* Binary operators - all left-associative */
@@ -132,9 +132,9 @@ static void CleanStack(void)
/* PeekChar - peek ahead to next char. */
/* */
/***************************************************************/
static char PeekChar(char **s)
static char PeekChar(char const **s)
{
char *t = *s;
char const *t = *s;
while (*t && isspace(*t)) t++;
return *t;
}
@@ -146,7 +146,7 @@ static char PeekChar(char **s)
/* Read a token. */
/* */
/***************************************************************/
static int ParseExprToken(DynamicBuffer *buf, char **in)
static int ParseExprToken(DynamicBuffer *buf, char const **in)
{
char c;
@@ -266,7 +266,7 @@ static int ParseExprToken(DynamicBuffer *buf, char **in)
/* Put the result into value pointed to by v. */
/* */
/***************************************************************/
int EvalExpr(char **e, Value *v)
int EvalExpr(char const **e, Value *v)
{
int r;
@@ -289,7 +289,7 @@ int EvalExpr(char **e, Value *v)
}
/* Evaluate - do the actual work of evaluation. */
int Evaluate(char **s, Var *locals)
int Evaluate(char const **s, Var *locals)
{
int OpBase, ValBase;
int r;
@@ -297,7 +297,7 @@ int Evaluate(char **s, Var *locals)
int args; /* Number of function arguments */
Operator op, op2;
Value va;
char *ufname = NULL; /* Stop GCC from complaining about use of uninit var */
char const *ufname = NULL; /* Stop GCC from complaining about use of uninit var */
OpBase = OpStackPtr;
ValBase = ValStackPtr;
@@ -339,7 +339,7 @@ int Evaluate(char **s, Var *locals)
if (f) r = CallFunc(f, 0);
else {
r = CallUserFunc(ufname, 0);
free(ufname);
free((char *) ufname);
}
if (r) return r;
r = ParseExprToken(&ExprBuf, s); /* Guaranteed to be right paren. */
@@ -349,12 +349,12 @@ int Evaluate(char **s, Var *locals)
args++;
r = Evaluate(s, locals);
if (r) {
if (!f) free(ufname);
if (!f) free((char *) ufname);
return r;
}
if (*DBufValue(&ExprBuf) == ')') break;
else if (*DBufValue(&ExprBuf) != ',') {
if (!f) free(ufname);
if (!f) free((char *) ufname);
Eprint("%s: `%c'", ErrMsg[E_EXPECT_COMMA],
*DBufValue(&ExprBuf));
DBufFree(&ExprBuf);
@@ -364,7 +364,7 @@ int Evaluate(char **s, Var *locals)
if (f) r = CallFunc(f, args);
else {
r = CallUserFunc(ufname, args);
free(ufname);
free((char *) ufname);
}
DBufFree(&ExprBuf);
if (r) return r;
@@ -448,7 +448,7 @@ int Evaluate(char **s, Var *locals)
/* a date or the value of a symbol. */
/* */
/***************************************************************/
static int MakeValue(char *s, Value *v, Var *locals)
static int MakeValue(char const *s, Value *v, Var *locals)
{
int len;
int h, m, r;
@@ -456,7 +456,7 @@ static int MakeValue(char *s, Value *v, Var *locals)
if (*s == '\"') { /* It's a literal string "*/
len = strlen(s)-1;
v->type = STR_TYPE;
v->v.str = (char *) malloc(len);
v->v.str = malloc(len);
if (! v->v.str) {
v->type = ERR_TYPE;
return E_NO_MEM;
@@ -533,7 +533,7 @@ static int MakeValue(char *s, Value *v, Var *locals)
int DoCoerce(char type, Value *v)
{
int h, d, m, y, i, k;
char *s;
char const *s;
/* Do nothing if value is already the right type */
if (type == v->type) return OK;
@@ -751,7 +751,7 @@ static int Add(void)
return r;
}
v3.type = STR_TYPE;
v3.v.str = (char *) malloc(strlen(v1.v.str) + strlen(v2.v.str) + 1);
v3.v.str = malloc(strlen(v1.v.str) + strlen(v2.v.str) + 1);
if (!v3.v.str) {
DestroyValue(v1); DestroyValue(v2);
return E_NO_MEM;
@@ -1078,7 +1078,7 @@ static int LogNot(void)
/* Find a function. */
/* */
/***************************************************************/
Operator *FindFunc(char *name, Operator where[], int num)
Operator *FindFunc(char const *name, Operator where[], int num)
{
int top=num-1, bot=0;
int mid, r;
@@ -1102,7 +1102,7 @@ Operator *FindFunc(char *name, Operator where[], int num)
void PrintValue (Value *v, FILE *fp)
{
int y, m, d;
char *s;
char const *s;
if (v->type == STR_TYPE) {
s=v->v.str;
@@ -1154,7 +1154,7 @@ int CopyValue(Value *dest, const Value *src)
/* and tim; update s. */
/* */
/***************************************************************/
static int ParseLiteralDate(char **s, int *jul, int *tim)
static int ParseLiteralDate(char const **s, int *jul, int *tim)
{
int y, m, d;
int hour, min;

View File

@@ -42,20 +42,20 @@
/* Define the structures needed by the file caching system */
typedef struct cache {
struct cache *next;
char *text;
char const *text;
int LineNo;
} CachedLine;
typedef struct cheader {
struct cheader *next;
char *filename;
char const *filename;
CachedLine *cache;
int ownedByMe;
} CachedFile;
/* Define the structures needed by the INCLUDE file system */
typedef struct {
char *filename;
char const *filename;
int LineNo;
unsigned int IfFlags;
int NumIfs;
@@ -73,7 +73,7 @@ static IncludeStruct IStack[INCLUDE_NEST];
static int IStackPtr = 0;
static int ReadLineFromFile (void);
static int CacheFile (const char *fname);
static int CacheFile (char const *fname);
static void DestroyCache (CachedFile *cf);
static int CheckSafety (void);
@@ -171,7 +171,7 @@ static int ReadLineFromFile(void)
/* ShouldCache is 1, cache the file */
/* */
/***************************************************************/
int OpenFile(const char *fname)
int OpenFile(char const *fname)
{
CachedFile *h = CachedFiles;
int r;
@@ -230,12 +230,12 @@ int OpenFile(const char *fname)
/* Returns an indication of success or failure. */
/* */
/***************************************************************/
static int CacheFile(const char *fname)
static int CacheFile(char const *fname)
{
int r;
CachedFile *cf;
CachedLine *cl;
char *s;
char const *s;
cl = NULL;
/* Create a file header */
@@ -349,7 +349,7 @@ int PopFile(void)
if (fp != stdin)
(void) fseek(fp, i->offset, 0); /* Trust that it works... */
}
free(i->filename);
free((char *) i->filename);
return OK;
}
@@ -387,7 +387,7 @@ int DoInclude(ParsePtr p)
/* inclusion. */
/* */
/***************************************************************/
int IncludeFile(const char *fname)
int IncludeFile(char const *fname)
{
IncludeStruct *i;
int r;
@@ -432,7 +432,7 @@ int IncludeFile(const char *fname)
/* GetAccessDate - get the access date of a file. */
/* */
/***************************************************************/
int GetAccessDate(char *file)
int GetAccessDate(char const *file)
{
struct stat statbuf;
struct tm *t1;
@@ -457,10 +457,10 @@ static void DestroyCache(CachedFile *cf)
{
CachedLine *cl, *cnext;
CachedFile *temp;
if (cf->filename) free(cf->filename);
if (cf->filename) free((char *) cf->filename);
cl = cf->cache;
while (cl) {
if (cl->text) free (cl->text);
if (cl->text) free ((char *) cl->text);
cnext = cl->next;
free(cl);
cl = cnext;

View File

@@ -11,6 +11,7 @@
/* */
/***************************************************************/
#include "version.h"
#include "config.h"
#include <stdio.h>
@@ -47,7 +48,6 @@
#include "protos.h"
#include "err.h"
#include "expr.h"
#include "version.h"
/* Function prototypes */
static int FCurrent (void);
@@ -358,11 +358,11 @@ static int CleanUpAfterFunc(void)
/* Return a string value from a function. */
/* */
/***************************************************************/
static int RetStrVal(const char *s)
static int RetStrVal(char const *s)
{
RetVal.type = STR_TYPE;
if (!s) {
RetVal.v.str = (char *) malloc(1);
RetVal.v.str = malloc(1);
if (RetVal.v.str) *RetVal.v.str = 0;
} else
RetVal.v.str = StrDup(s);
@@ -493,7 +493,7 @@ static int FDateTime(void)
/***************************************************************/
static int FCoerce(void)
{
char *s;
char const *s;
if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
s = ARG(0).v.str;
@@ -591,7 +591,7 @@ static int FChar(void)
if (ARG(0).v.val < -128) return E_2LOW;
if (ARG(0).v.val > 255) return E_2HIGH;
len = ARG(0).v.val ? 2 : 1;
RetVal.v.str = (char *) malloc(len);
RetVal.v.str = malloc(len);
if (!RetVal.v.str) return E_NO_MEM;
RetVal.type = STR_TYPE;
*(RetVal.v.str) = ARG(0).v.val;
@@ -599,7 +599,7 @@ static int FChar(void)
return OK;
}
RetVal.v.str = (char *) malloc(Nargs + 1);
RetVal.v.str = malloc(Nargs + 1);
if (!RetVal.v.str) return E_NO_MEM;
RetVal.type = STR_TYPE;
for (i=0; i<Nargs; i++) {
@@ -710,7 +710,7 @@ static int FWkdaynum(void)
static int FWkday(void)
{
char *s;
char const *s;
if (!HASDATE(ARG(0)) && ARG(0).type != INT_TYPE) return E_BAD_TYPE;
if (ARG(0).type == INT_TYPE) {
@@ -726,7 +726,7 @@ static int FWkday(void)
static int FMon(void)
{
char *s;
char const *s;
int y, m, d, v;
if (!HASDATE(ARG(0)) && ARG(0).type != INT_TYPE) return E_BAD_TYPE;
@@ -833,7 +833,7 @@ static int FSgn(void)
static int FOrd(void)
{
int t, u, v;
char *s;
char const *s;
if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
@@ -874,7 +874,7 @@ static int FPlural(void)
return OK;
}
RetVal.type = STR_TYPE;
RetVal.v.str = (char *) malloc(strlen(ARG(1).v.str)+2);
RetVal.v.str = malloc(strlen(ARG(1).v.str)+2);
if (!RetVal.v.str) {
RetVal.type = ERR_TYPE;
return E_NO_MEM;
@@ -1315,7 +1315,8 @@ static int FIsomitted(void)
/***************************************************************/
static int FSubstr(void)
{
char *s, *t;
char *s;
char const *t;
int start, end;
if (ARG(0).type != STR_TYPE || ARG(1).type != INT_TYPE) return E_BAD_TYPE;
@@ -1349,7 +1350,7 @@ static int FSubstr(void)
/***************************************************************/
static int FIndex(void)
{
char *s;
char const *s;
int start;
if (ARG(0).type != STR_TYPE || ARG(1).type != STR_TYPE ||
@@ -1463,7 +1464,7 @@ static int FFiledir(void)
static int FAccess(void)
{
int amode;
char *s;
char const *s;
if (ARG(0).type != STR_TYPE ||
(ARG(1).type != INT_TYPE && ARG(1).type != STR_TYPE)) return E_BAD_TYPE;
@@ -2096,7 +2097,7 @@ static int FPsmoon(void)
char sizebuf[30];
char fontsizebuf[30];
char *s = psbuff;
char *extra = NULL;
char const *extra = NULL;
int size = -1;
int fontsize = -1;
@@ -2366,7 +2367,7 @@ static int tz_convert(int year, int month, int day,
int r;
time_t t;
struct tm *res;
char *old_tz;
char const *old_tz;
/* init tm struct */
tm->tm_sec = 0;

View File

@@ -37,7 +37,7 @@ EXTERN int CurMon;
EXTERN int CurYear;
EXTERN int LineNo;
EXTERN int FreshLine;
EXTERN INIT( char *MsgCommand, NULL);
EXTERN INIT( char const *MsgCommand, NULL);
EXTERN INIT( int ShowAllErrors, 0);
EXTERN INIT( int DebugFlag, 0);
EXTERN INIT( int DoCalendar, 0);
@@ -61,7 +61,7 @@ EXTERN INIT( int SortByPrio, 0);
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
EXTERN INIT( long SysTime, -1L);
EXTERN char *InitialFile;
EXTERN char const *InitialFile;
EXTERN int FileAccessDate;
EXTERN INIT( int DontFork, 0);
@@ -83,10 +83,10 @@ EXTERN INIT( int LastTriggerDate, 0);
EXTERN INIT( int LastTrigValid, 0);
EXTERN INIT( int LastTriggerTime, 0);
EXTERN INIT( int ShouldCache, 0);
EXTERN char *CurLine;
EXTERN char const *CurLine;
EXTERN INIT( int NumTriggered, 0);
EXTERN int ArgC;
EXTERN char **ArgV;
EXTERN char const **ArgV;
EXTERN INIT( int CalLines, CAL_LINES);
EXTERN INIT( int CalPad, 1);

View File

@@ -55,7 +55,7 @@
#define ADAR2ADARA 1
#define ADAR2BOTH 2
static char *HebMonthNames[] = {
static char const *HebMonthNames[] = {
"Tishrey", "Heshvan", "Kislev", "Tevet", "Shvat", "Adar A", "Adar B",
"Nisan", "Iyar", "Sivan", "Tamuz", "Av", "Elul", "Adar"};
@@ -137,7 +137,7 @@ int DaysInHebYear(int y)
/* given the LENGTH of the Hebrew year. */
/* */
/***************************************************************/
char *DaysInHebMonths(int ylen)
char const *DaysInHebMonths(int ylen)
{
static char monlen[13] =
{30, 29, 30, 29, 30, 0, 29, 30, 29, 30, 29, 30, 29};
@@ -166,7 +166,7 @@ char *DaysInHebMonths(int ylen)
int HebToJul(int hy, int hm, int hd)
{
int ylen;
char *monlens;
char const *monlens;
int rh;
int m;
@@ -201,7 +201,7 @@ void JulToHeb(int jul, int *hy, int *hm, int *hd)
int y, m, d;
int rh;
int ylen;
char *monlen;
char const *monlen;
/* Get the common year */
FromJulian(jul, &y, &m, &d);
y += 3763; /* Over-estimate a bit to be on the safe side below... */
@@ -232,7 +232,7 @@ void JulToHeb(int jul, int *hy, int *hm, int *hd)
/* year. */
/* */
/***************************************************************/
int HebNameToNum(const char *mname)
int HebNameToNum(char const *mname)
{
int i;
int m=-1;
@@ -254,7 +254,7 @@ int HebNameToNum(const char *mname)
/* year. */
/* */
/***************************************************************/
char *HebMonthName(int m, int y)
char const *HebMonthName(int m, int y)
{
if (m != ADARA && m != ADARB) return HebMonthNames[m];
@@ -293,7 +293,7 @@ char *HebMonthName(int m, int y)
int GetValidHebDate(int yin, int min, int din, int adarbehave,
int *mout, int *dout, int jahr)
{
char *monlen;
char const *monlen;
int ylen;
*mout = min;
@@ -448,7 +448,7 @@ int GetNextHebrewDate(int julstart, int hm, int hd,
/***************************************************************/
int ComputeJahr(int y, int m, int d, int *ans)
{
char *monlen;
char const *monlen;
int len;
*ans = JAHR_NONE;

View File

@@ -12,6 +12,7 @@
/* */
/***************************************************************/
#include "version.h"
#include "config.h"
#define L_IN_INIT 1
@@ -28,7 +29,6 @@
#include "protos.h"
#include "expr.h"
#include "err.h"
#include "version.h"
#include "globals.h"
/***************************************************************
@@ -79,10 +79,10 @@ while (isdigit(*(s))) { \
s++; \
}
static void ChgUser(char *u);
static void InitializeVar(char *str);
static void ChgUser(char const *u);
static void InitializeVar(char const *str);
static char *BadDate = "Illegal date on command line\n";
static char const *BadDate = "Illegal date on command line\n";
static DynamicBuffer default_filename_buf;
@@ -94,9 +94,9 @@ static DynamicBuffer default_filename_buf;
/* default filename. Use $DOTREMINDERS or $HOME/.reminders */
/* */
/***************************************************************/
static char *DefaultFilename(void)
static char const *DefaultFilename(void)
{
char *s;
char const *s;
DBufInit(&default_filename_buf);
@@ -122,14 +122,14 @@ static char *DefaultFilename(void)
/* Initialize the system - called only once at beginning! */
/* */
/***************************************************************/
void InitRemind(int argc, char *argv[])
void InitRemind(int argc, char const *argv[])
{
char *arg;
char const *arg;
int i;
int y, m, d, rep;
Token tok;
int InvokedAsRem = 0;
char *s;
char const *s;
/* Initialize global dynamic buffers */
DBufInit(&Banner);
@@ -550,12 +550,15 @@ void Usage(void)
/* USER environment variables. */
/* */
/***************************************************************/
static void ChgUser(char *user)
static void ChgUser(char const *user)
{
uid_t myuid;
struct passwd *pwent;
static char *home, *shell, *username, *logname;
static char *home;
static char *shell;
static char *username;
static char *logname;
myuid = getuid();
@@ -616,22 +619,29 @@ static void ChgUser(char *user)
/* Initialize and preserve a variable */
/* */
/***************************************************************/
static void InitializeVar(char *str)
static void InitializeVar(char const *str)
{
char *varname, *expr;
char const *expr;
char varname[VAR_NAME_LEN+1];
Value val;
int r;
/* Scan for an '=' sign */
varname = str;
while (*str && *str != '=') str++;
r = 0;
while (*str && *str != '=') {
if (r < VAR_NAME_LEN) {
varname[r++] = *str;
}
str++;
}
varname[r] = 0;
if (!*str) {
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_EQ]);
return;
}
*str = 0;
if (!*varname) {
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_VAR]);
return;

View File

@@ -62,9 +62,9 @@ int main(int argc, char *argv[])
/* Set up global vars */
ArgC = argc;
ArgV = argv;
ArgV = (char const **) argv;
InitRemind(argc, argv);
InitRemind(argc, (char const **) argv);
if (DoCalendar || (DoSimpleCalendar && (!NextMode || PsCal))) {
ProduceCalendar();
return 0;
@@ -134,7 +134,7 @@ static void DoReminders(void)
{
int r;
Token tok;
char *s;
char const *s;
Parser p;
if (!UseStdin) {
@@ -330,7 +330,7 @@ int ParseChar(ParsePtr p, int *err, int peek)
return *(p->epos++);
}
}
free(p->etext); /* End of substituted expression */
free((void *) p->etext); /* End of substituted expression */
p->etext = NULL;
p->epos = NULL;
p->isnested = 0;
@@ -503,7 +503,7 @@ int EvaluateExpr(ParsePtr p, Value *v)
/* Eprint - print an error message. */
/* */
/***************************************************************/
void Eprint(const char *fmt, ...)
void Eprint(char const *fmt, ...)
{
va_list argptr;
@@ -536,8 +536,8 @@ void Eprint(const char *fmt, ...)
/***************************************************************/
void OutputLine(FILE *fp)
{
register char *s = CurLine;
register char c = 0;
char const *s = CurLine;
char c = 0;
while (*s) {
if (*s == '\n') Putc('\\', fp);
@@ -554,7 +554,7 @@ void OutputLine(FILE *fp)
/* Create a parser given a string buffer */
/* */
/***************************************************************/
void CreateParser(char *s, ParsePtr p)
void CreateParser(char const *s, ParsePtr p)
{
p->text = s;
p->pos = s;
@@ -576,7 +576,7 @@ void CreateParser(char *s, ParsePtr p)
void DestroyParser(ParsePtr p)
{
if (p->isnested && p->etext) {
free(p->etext);
free((void *) p->etext);
p->etext = NULL;
p->isnested = 0;
}
@@ -589,10 +589,10 @@ void DestroyParser(ParsePtr p)
/* on a per-parser basis. */
/* */
/***************************************************************/
int PushToken(const char *tok, ParsePtr p)
int PushToken(char const *tok, ParsePtr p)
{
DBufFree(&p->pushedToken);
if (DBufPuts(&p->pushedToken, (char *) tok) != OK ||
if (DBufPuts(&p->pushedToken, tok) != OK ||
DBufPutc(&p->pushedToken, ' ') != OK) {
DBufFree(&p->pushedToken);
return E_NO_MEM;
@@ -977,7 +977,7 @@ int DoErrMsg(ParsePtr p)
TimeTrig tt;
Trigger t;
int r;
char *s;
char const *s;
DynamicBuffer buf;
@@ -1079,7 +1079,7 @@ int CalcMinsFromUTC(int jul, int tim, int *mins, int *isdst)
/* A macro safe ONLY if used with arg with no side effects! */
#define ISBLANK(c) (isspace(c) && (c) != '\n')
void FillParagraph(char *s)
void FillParagraph(char const *s)
{
int line = 0;
@@ -1087,7 +1087,7 @@ void FillParagraph(char *s)
int doublespace = 1;
int pendspace;
int len;
char *t;
char const *t;
int roomleft;

View File

@@ -113,12 +113,12 @@ int PushOmitContext(ParsePtr p)
context->numfull = NumFullOmits;
context->numpart = NumPartialOmits;
context->fullsave = (int *) malloc(NumFullOmits * sizeof(int));
context->fullsave = malloc(NumFullOmits * sizeof(int));
if (NumFullOmits && !context->fullsave) {
free(context);
return E_NO_MEM;
}
context->partsave = (int *) malloc(NumPartialOmits * sizeof(int));
context->partsave = malloc(NumPartialOmits * sizeof(int));
if (NumPartialOmits && !context->partsave) {
free(context->fullsave);
free(context);

View File

@@ -14,15 +14,15 @@
#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
/* Define a general malloc routine for creating pointers to objects */
#define NEW(type) ((type *) malloc(sizeof(type)))
#define NEW(type) (malloc(sizeof(type)))
#include "dynbuf.h"
int CallUserFunc (char *name, int nargs);
int CallUserFunc (char const *name, int nargs);
int DoFset (ParsePtr p);
void ProduceCalendar (void);
char *SimpleTime (int tim);
char *CalendarTime (int tim, int duration);
char const *SimpleTime (int tim);
char const *CalendarTime (int tim, int duration);
int DoRem (ParsePtr p);
int DoFlush (ParsePtr p);
void DoExit (ParsePtr p);
@@ -30,36 +30,35 @@ int ParseRem (ParsePtr s, Trigger *trig, TimeTrig *tim);
int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int jul);
int ShouldTriggerReminder (Trigger *t, TimeTrig *tim, int jul);
int DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode);
int DoSubstFromString (char *source, DynamicBuffer *dbuf, int jul, int tim);
int EvalExpr (char **e, Value *v);
int DoSubstFromString (char const *source, DynamicBuffer *dbuf, int jul, int tim);
int EvalExpr (char const **e, Value *v);
int DoCoerce (char type, Value *v);
void PrintValue (Value *v, FILE *fp);
int CopyValue (Value *dest, const Value *src);
int ReadLine (void);
int OpenFile (const char *fname);
int OpenFile (char const *fname);
int PopFile (void);
int DoInclude (ParsePtr p);
int IncludeFile (const char *fname);
int GetAccessDate (char *file);
int SetAccessDate (char *fname, int jul);
int IncludeFile (char const *fname);
int GetAccessDate (char const *file);
int SetAccessDate (char const *fname, int jul);
int TopLevel (void);
int CallFunc (Operator *f, int nargs);
void InitRemind (int argc, char *argv[]);
void InitRemind (int argc, char const *argv[]);
void Usage (void);
int main (int argc, char *argv[]);
int Julian (int year, int month, int day);
void FromJulian (int jul, int *y, int *m, int *d);
int ParseChar (ParsePtr p, int *err, int peek);
int ParseToken (ParsePtr p, DynamicBuffer *dbuf);
int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf);
int EvaluateExpr (ParsePtr p, Value *v);
int Evaluate (char **s, Var *locals);
int Evaluate (char const **s, Var *locals);
int FnPopValStack (Value *val);
void Eprint (const char *fmt, ...);
void Eprint (char const *fmt, ...);
void OutputLine (FILE *fp);
void CreateParser (char *s, ParsePtr p);
void CreateParser (char const *s, ParsePtr p);
void DestroyParser (ParsePtr p);
int PushToken (const char *tok, ParsePtr p);
int PushToken (char const *tok, ParsePtr p);
long SystemTime (int realtime);
int SystemDate (int *y, int *m, int *d);
int DoIf (ParsePtr p);
@@ -79,53 +78,53 @@ int PushOmitContext (ParsePtr p);
int PopOmitContext (ParsePtr p);
int IsOmitted (int jul, int localomit);
int DoOmit (ParsePtr p);
int QueueReminder (ParsePtr p, Trigger *trig, TimeTrig *tim, const char *sched);
int QueueReminder (ParsePtr p, Trigger *trig, TimeTrig *tim, char const *sched);
void HandleQueuedReminders (void);
char *FindInitialToken (Token *tok, char *s);
void FindToken (const char *s, Token *tok);
void FindNumericToken (const char *s, Token *t);
char const *FindInitialToken (Token *tok, char const *s);
void FindToken (char const *s, Token *tok);
void FindNumericToken (char const *s, Token *t);
int ComputeTrigger (int today, Trigger *trig, int *err);
char *StrnCpy (char *dest, const char *source, int n);
int StrMatch (const char *s1, const char *s2, int n);
int StrinCmp (const char *s1, const char *s2, int n);
char *StrDup (const char *s);
int StrCmpi (const char *s1, const char *s2);
Var *FindVar (const char *str, int create);
int DeleteVar (const char *str);
int SetVar (const char *str, Value *val);
int GetVarValue (const char *str, Value *val, Var *locals);
char *StrnCpy (char *dest, char const *source, int n);
int StrMatch (char const *s1, char const *s2, int n);
int StrinCmp (char const *s1, char const *s2, int n);
char *StrDup (char const *s);
int StrCmpi (char const *s1, char const *s2);
Var *FindVar (char const *str, int create);
int DeleteVar (char const *str);
int SetVar (char const *str, Value *val);
int GetVarValue (char const *str, Value *val, Var *locals);
int DoSet (Parser *p);
int DoUnset (Parser *p);
int DoDump (ParsePtr p);
void DumpVarTable (void);
void DestroyVars (int all);
int PreserveVar (char *name);
int PreserveVar (char const *name);
int DoPreserve (Parser *p);
int DoSatRemind (Trigger *trig, TimeTrig *tim, ParsePtr p);
int DoMsgCommand (char *cmd, char *msg);
int DoMsgCommand (char const *cmd, char const *msg);
int ParseNonSpaceChar (ParsePtr p, int *err, int peek);
unsigned int HashVal (const char *str);
unsigned int HashVal (char const *str);
int DateOK (int y, int m, int d);
Operator *FindFunc (char *name, Operator where[], int num);
int InsertIntoSortBuffer (int jul, int tim, char *body, int typ, int prio);
void IssueSortedReminders (void);
int UserFuncExists (char *fn);
Operator *FindFunc (char const *name, Operator where[], int num);
int InsertIntoSortBuffer (int jul, int tim, char const *body, int typ, int prio);
void IssueSortedReminders (void);
int UserFuncExists (char const *fn);
void JulToHeb (int jul, int *hy, int *hm, int *hd);
int HebNameToNum (const char *mname);
char *HebMonthName (int m, int y);
int HebNameToNum (char const *mname);
char const *HebMonthName (int m, int y);
int RoshHashana (int i);
long DaysToHebYear (int y);
int DaysInHebYear (int y);
char *DaysInHebMonths (int ylen);
char const *DaysInHebMonths (int ylen);
int HebToJul (int hy, int hm, int hd);
int GetValidHebDate (int yin, int min, int din, int adarbehave, int *mout, int *dout, int yahr);
int GetNextHebrewDate (int julstart, int hm, int hd, int yahr, int adarbehave, int *ans);
int ComputeJahr (int y, int m, int d, int *ans);
int GetSysVar (const char *name, Value *val);
int SetSysVar (const char *name, Value *val);
void DumpSysVarByName (const char *name);
int GetSysVar (char const *name, Value *val);
int SetSysVar (char const *name, Value *val);
void DumpSysVarByName (char const *name);
int CalcMinsFromUTC (int jul, int tim, int *mins, int *isdst);
void FillParagraph (char *s);
void FillParagraph (char const *s);
void LocalToUTC (int locdate, int loctime, int *utcdate, int *utctime);
void UTCToLocal (int utcdate, int utctime, int *locdate, int *loctime);
int MoonPhase (int date, int time);

View File

@@ -40,7 +40,7 @@ typedef struct queuedrem {
int typ;
int RunDisabled;
int ntrig;
char *text;
char const *text;
char passthru[PASSTHRU_LEN+1];
char sched[VAR_NAME_LEN+1];
char tag[TAG_LEN+1];
@@ -69,7 +69,7 @@ static void reread (void);
/* */
/***************************************************************/
int QueueReminder(ParsePtr p, Trigger *trig,
TimeTrig *tim, const char *sched)
TimeTrig *tim, char const *sched)
{
QueuedRem *qelem;
@@ -396,7 +396,7 @@ static int CalculateNextTimeUsingSched(QueuedRem *q)
/* Use LineBuffer for temp. string storage. */
int r;
Value v;
char *s;
char const *s;
int LastTime = -1;
int ThisTime;
@@ -517,6 +517,6 @@ static void DaemonWait(unsigned int sleeptime)
/***************************************************************/
static void reread(void)
{
execvp(ArgV[0], ArgV);
execvp(ArgV[0], (char **) ArgV);
}

View File

@@ -10,6 +10,7 @@
/* */
/***************************************************************/
#include "version.h"
#include "config.h"
#include "dynbuf.h"
@@ -20,9 +21,8 @@
#include <unistd.h>
#include <stdlib.h>
#include "rem2ps.h"
#include "version.h"
#define NEW(type) ((type *) malloc(sizeof(type)))
#define NEW(type) (malloc(sizeof(type)))
#define SPECIAL_NORMAL 0
#define SPECIAL_POSTSCRIPT 1
@@ -38,13 +38,13 @@ typedef struct calentry {
} CalEntry;
typedef struct {
char *name;
char const *name;
int xsize, ysize;
} PageType;
char DayName[7][33];
char *SmallCalLoc[] = {
char const *SmallCalLoc[] = {
"",
"bt",
"tb",
@@ -52,7 +52,7 @@ char *SmallCalLoc[] = {
};
#define NUMSMALL (sizeof(SmallCalLoc)/sizeof(SmallCalLoc[0]))
char *SmallLocation;
char const *SmallLocation;
int SmallCol1, SmallCol2;
PageType Pages[] =
@@ -88,20 +88,20 @@ char PortraitMode;
char NoSmallCal;
char UseISO;
char *HeadFont="Helvetica";
char *TitleFont="Helvetica";
char *DayFont="Helvetica-BoldOblique";
char *EntryFont="Helvetica";
char *SmallFont="Helvetica";
char *LineWidth = "1";
char const *HeadFont="Helvetica";
char const *TitleFont="Helvetica";
char const *DayFont="Helvetica-BoldOblique";
char const *EntryFont="Helvetica";
char const *SmallFont="Helvetica";
char const *LineWidth = "1";
char *HeadSize="14";
char *TitleSize="14";
char *DaySize="14";
char *EntrySize="8";
char *BorderSize = "6";
char const *HeadSize="14";
char const *TitleSize="14";
char const *DaySize="14";
char const *EntrySize="8";
char const *BorderSize = "6";
char *UserProlog = NULL;
char const *UserProlog = NULL;
int validfile = 0;
@@ -116,15 +116,15 @@ int FillPage;
int Verbose = 0;
void Init (int argc, char *argv[]);
void Usage (char *s);
void Usage (char const *s);
void DoPsCal (void);
int DoQueuedPs (void);
void DoSmallCal (char *m, int days, int first, int col, int which);
void DoSmallCal (char const *m, int days, int first, int col, int which);
void WriteProlog (void);
void WriteCalEntry (void);
void WriteOneEntry (CalEntry *c);
void GetSmallLocations (void);
char *EatToken(char *in, char *out, int maxlen);
char const *EatToken(char const *in, char *out, int maxlen);
/***************************************************************/
/* */
@@ -182,7 +182,7 @@ void DoPsCal(void)
int i;
int is_ps;
int firstcol;
char *startOfBody;
char const *startOfBody;
char passthru[PASSTHRU_LEN+1];
DynamicBuffer buf;
CalEntry *c, *d;
@@ -388,7 +388,7 @@ void WriteProlog(void)
int i;
int x = CurPage->xsize;
int y = CurPage->ysize;
char *isostuff;
char const *isostuff;
FILE *fp;
int nread;
char buffer[512];
@@ -574,7 +574,7 @@ void WriteCalEntry(void)
void WriteOneEntry(CalEntry *c)
{
int ch, i;
char *s = c->entry;
char const *s = c->entry;
printf(" [");
@@ -635,7 +635,8 @@ void WriteOneEntry(CalEntry *c)
/***************************************************************/
void Init(int argc, char *argv[])
{
char *s, *t;
char const *s;
char const *t;
int i=1;
int j;
int offset;
@@ -791,7 +792,7 @@ void Init(int argc, char *argv[])
/* Usage - print usage information */
/* */
/***************************************************************/
void Usage(char *s)
void Usage(char const *s)
{
if (s) fprintf(stderr, "Rem2PS: %s\n\n", s);
@@ -820,7 +821,7 @@ void Usage(char *s)
/* month. */
/* */
/***************************************************************/
void DoSmallCal(char *m, int days, int first, int col, int which)
void DoSmallCal(char const *m, int days, int first, int col, int which)
{
/* Do the small calendar */
int i, j;
@@ -885,7 +886,7 @@ int DoQueuedPs(void)
FILE *fp;
int fnoff;
char buffer[512];
char *size, *extra;
char const *size, *extra;
int num, r, g, b, phase, fontsize, moonsize;
unsigned char c;
@@ -1060,7 +1061,7 @@ int DoQueuedPs(void)
void GetSmallLocations(void)
{
char c;
char *s = SmallLocation;
char const *s = SmallLocation;
int colfirst, collast;
/* Figure out the first and last columns */
@@ -1122,7 +1123,7 @@ void GetSmallLocations(void)
/* Read a space-delimited token into an output buffer. */
/* */
/***************************************************************/
char *EatToken(char *in, char *out, int maxlen)
char const *EatToken(char const *in, char *out, int maxlen)
{
int i = 0;

View File

@@ -25,7 +25,7 @@
/* The structure of a sorted entry */
typedef struct sortrem {
struct sortrem *next;
char *text;
char const *text;
int trigdate;
int trigtime;
int typ;
@@ -35,7 +35,7 @@ typedef struct sortrem {
/* The sorted reminder queue */
static Sortrem *SortedQueue = (Sortrem *) NULL;
static Sortrem *MakeSortRem (int jul, int tim, char *body, int typ, int prio);
static Sortrem *MakeSortRem (int jul, int tim, char const *body, int typ, int prio);
static void IssueSortBanner (int jul);
/***************************************************************/
@@ -45,7 +45,7 @@ static void IssueSortBanner (int jul);
/* Create a new Sortrem entry - return NULL on failure. */
/* */
/***************************************************************/
static Sortrem *MakeSortRem(int jul, int tim, char *body, int typ, int prio)
static Sortrem *MakeSortRem(int jul, int tim, char const *body, int typ, int prio)
{
Sortrem *new = NEW(Sortrem);
if (!new) return NULL;
@@ -71,7 +71,7 @@ static Sortrem *MakeSortRem(int jul, int tim, char *body, int typ, int prio)
/* Insert a reminder into the sort buffer */
/* */
/***************************************************************/
int InsertIntoSortBuffer(int jul, int tim, char *body, int typ, int prio)
int InsertIntoSortBuffer(int jul, int tim, char const *body, int typ, int prio)
{
Sortrem *new = MakeSortRem(jul, tim, body, typ, prio);
Sortrem *cur = SortedQueue, *prev = NULL;
@@ -154,7 +154,7 @@ void IssueSortedReminders(void)
break;
}
free(cur->text);
free((char *) cur->text);
free(cur);
cur = next;
}
@@ -173,7 +173,7 @@ static void IssueSortBanner(int jul)
char BanExpr[64];
int y, m, d;
Value v;
char *s = BanExpr;
char const *s = BanExpr;
DynamicBuffer buf;
if (UserFuncExists("sortbanner") != 1) return;

View File

@@ -128,7 +128,7 @@ Token NonEnglishToks[] = {
};
#endif
static int TokStrCmp (const Token *t, const char *s);
static int TokStrCmp (Token const *t, char const *s);
/***************************************************************/
/* */
@@ -138,7 +138,7 @@ static int TokStrCmp (const Token *t, const char *s);
/* left square bracket, return a T_Illegal type. */
/* */
/***************************************************************/
char *FindInitialToken(Token *tok, char *s)
char const *FindInitialToken(Token *tok, char const *s)
{
DynamicBuffer buf;
DBufInit(&buf);
@@ -165,7 +165,7 @@ char *FindInitialToken(Token *tok, char *s)
/* Given a string, which token is it? */
/* */
/***************************************************************/
void FindToken(const char *s, Token *tok)
void FindToken(char const *s, Token *tok)
{
int top, bot, mid, r, max;
int l;
@@ -252,7 +252,7 @@ void FindToken(const char *s, Token *tok)
/* Rep - *n */
/* */
/***************************************************************/
void FindNumericToken(const char *s, Token *t)
void FindNumericToken(char const *s, Token *t)
{
int mult = 1, hour, min;
@@ -335,10 +335,10 @@ void FindNumericToken(const char *s, Token *t)
/* Compare a token to a string. */
/* */
/***************************************************************/
static int TokStrCmp(const Token *t, const char *s)
static int TokStrCmp(Token const *t, char const *s)
{
register int r;
char *tk = t->name;
char const *tk = t->name;
while(*tk && *s && !(*s == ',' && *(s+1) == 0)) {
r = *tk - tolower(*s);
tk++;

View File

@@ -419,6 +419,14 @@ int ComputeTrigger(int today, Trigger *trig, int *err)
}
return -1;
}
if (trig->skip == SKIP_SKIP &&
IsOmitted(result, trig->localomit) &&
nextstart <= start &&
result >= start) {
nextstart = result + 1;
}
/* Keep scanning... unless there's no point in doing it.*/
if (nextstart <= start) {
if (result != -1) {

View File

@@ -24,7 +24,7 @@ typedef struct {
/* Define the type of operators */
typedef struct {
char *name;
char const *name;
char prec;
char type;
int (*func)(void);
@@ -73,12 +73,12 @@ typedef struct {
typedef struct {
char isnested; /* Is it a nested expression? */
char allownested;
char *text; /* Start of text */
char *pos; /* Current position */
char *etext; /* Substituted text */
char *epos; /* Position in substituted text */
char const *text; /* Start of text */
char const *pos; /* Current position */
char const *etext; /* Substituted text */
char const *epos; /* Position in substituted text */
DynamicBuffer pushedToken; /* Pushed-back token */
char *tokenPushed; /* NULL if no pushed-back token */
char const *tokenPushed; /* NULL if no pushed-back token */
} Parser;
typedef Parser *ParsePtr; /* Pointer to parser structure */

View File

@@ -29,7 +29,7 @@
typedef struct udf_struct {
struct udf_struct *next;
char name[VAR_NAME_LEN+1];
char *text;
char const *text;
Var *locals;
char IsActive;
int nargs;
@@ -47,7 +47,7 @@ extern Value ValStack[];
extern int ValStackPtr;
static void DestroyUserFunc (UserFunc *f);
static void FUnset (char *name);
static void FUnset (char const *name);
static void FSet (UserFunc *f);
static int SetUpLocalVars (UserFunc *f);
static void DestroyLocalVals (UserFunc *f);
@@ -184,7 +184,7 @@ static void DestroyUserFunc(UserFunc *f)
}
/* Free the function definition */
if (f->text) free(f->text);
if (f->text) free( (char *) f->text);
/* Free the data structure itself */
free(f);
@@ -198,7 +198,7 @@ static void DestroyUserFunc(UserFunc *f)
/* it exists. */
/* */
/***************************************************************/
static void FUnset(char *name)
static void FUnset(char const *name)
{
UserFunc *cur, *prev;
int h;
@@ -238,12 +238,12 @@ static void FSet(UserFunc *f)
/* Call a user-defined function. */
/* */
/***************************************************************/
int CallUserFunc(char *name, int nargs)
int CallUserFunc(char const *name, int nargs)
{
UserFunc *f;
int h = HashVal(name) % FUNC_HASH_SIZE;
int i;
char *s;
char const *s;
/* Search for the function */
f = FuncHash[h];
@@ -356,7 +356,7 @@ static void DestroyLocalVals(UserFunc *f)
/* it is defined, or -1 if it is not defined. */
/* */
/***************************************************************/
int UserFuncExists(char *fn)
int UserFuncExists(char const *fn)
{
UserFunc *f;
int h = HashVal(fn) % FUNC_HASH_SIZE;

View File

@@ -30,9 +30,9 @@
/* Just like strncpy EXCEPT we ALWAYS copy the trailing 0. */
/* */
/***************************************************************/
char *StrnCpy(char *dest, const char *source, int n)
char *StrnCpy(char *dest, char const *source, int n)
{
register char *odest = dest;
char *odest = dest;
while (n-- && (*dest++ = *source++)) ;
if (*(dest-1)) *dest = 0;
@@ -48,7 +48,7 @@ char *StrnCpy(char *dest, const char *source, int n)
/* of the first string, whichever is greater. */
/* */
/***************************************************************/
int StrMatch(const char *s1, const char *s2, int n)
int StrMatch(char const *s1, char const *s2, int n)
{
int l;
if ((l = strlen(s1)) < n) return 0;
@@ -60,7 +60,7 @@ int StrMatch(const char *s1, const char *s2, int n)
/* StrinCmp - compare strings, case-insensitive */
/* */
/***************************************************************/
int StrinCmp(const char *s1, const char *s2, int n)
int StrinCmp(char const *s1, char const *s2, int n)
{
register int r;
while (n && *s1 && *s2) {
@@ -80,10 +80,10 @@ int StrinCmp(const char *s1, const char *s2, int n)
/* Like ANSI strdup */
/* */
/***************************************************************/
char *StrDup(const char *s)
char *StrDup(char const *s)
{
char *ret = (char *) malloc(strlen(s)+1);
if (!ret) return (char *) NULL;
char *ret = malloc(strlen(s)+1);
if (!ret) return NULL;
strcpy(ret, s);
return ret;
}
@@ -95,7 +95,7 @@ char *StrDup(const char *s)
/* Compare strings, case insensitive. */
/* */
/***************************************************************/
int StrCmpi(const char *s1, const char *s2)
int StrCmpi(char const *s1, char const *s2)
{
int r;
while (*s1 && *s2) {

View File

@@ -80,7 +80,7 @@ static int time_sep_func(int do_set, Value *val)
/* Given a string, compute the hash value. */
/* */
/***************************************************************/
unsigned int HashVal(const char *str)
unsigned int HashVal(char const *str)
{
register unsigned int i=0;
register unsigned int j=1;
@@ -102,7 +102,7 @@ unsigned int HashVal(const char *str)
/* string. If create is 1, create the variable. */
/* */
/***************************************************************/
Var *FindVar(const char *str, int create)
Var *FindVar(char const *str, int create)
{
register int h;
register Var *v;
@@ -139,7 +139,7 @@ Var *FindVar(const char *str, int create)
/* string and delete it. */
/* */
/***************************************************************/
int DeleteVar(const char *str)
int DeleteVar(char const *str)
{
register int h;
register Var *v;
@@ -168,7 +168,7 @@ int DeleteVar(const char *str)
/* Set the indicate variable to the specified value. */
/* */
/***************************************************************/
int SetVar(const char *str, Value *val)
int SetVar(char const *str, Value *val)
{
Var *v = FindVar(str, 1);
@@ -186,7 +186,7 @@ int SetVar(const char *str, Value *val)
/* Get a copy of the value of the variable. */
/* */
/***************************************************************/
int GetVarValue(const char *str, Value *val, Var *locals)
int GetVarValue(char const *str, Value *val, Var *locals)
{
Var *v;
@@ -383,7 +383,7 @@ void DestroyVars(int all)
/* Given the name of a variable, "preserve" it. */
/* */
/***************************************************************/
int PreserveVar(char *name)
int PreserveVar(char const *name)
{
Var *v;
@@ -440,7 +440,7 @@ int DoPreserve (Parser *p)
/* The structure of a system variable */
typedef struct {
char *name;
char const *name;
char modifiable;
int type;
void *value;
@@ -498,8 +498,8 @@ static SysVar SysVarArr[] = {
};
#define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
static SysVar *FindSysVar (const char *name);
static void DumpSysVar (const char *name, const SysVar *v);
static SysVar *FindSysVar (char const *name);
static void DumpSysVar (char const *name, const SysVar *v);
/***************************************************************/
/* */
/* SetSysVar */
@@ -507,7 +507,7 @@ static void DumpSysVar (const char *name, const SysVar *v);
/* Set a system variable to the indicated value. */
/* */
/***************************************************************/
int SetSysVar(const char *name, Value *value)
int SetSysVar(char const *name, Value *value)
{
SysVar *v = FindSysVar(name);
if (!v) return E_NOSUCH_VAR;
@@ -542,7 +542,7 @@ int SetSysVar(const char *name, Value *value)
/* Get the value of a system variable */
/* */
/***************************************************************/
int GetSysVar(const char *name, Value *val)
int GetSysVar(char const *name, Value *val)
{
SysVar *v = FindSysVar(name);
@@ -577,7 +577,7 @@ int GetSysVar(const char *name, Value *val)
/* Find a system var with specified name. */
/* */
/***************************************************************/
static SysVar *FindSysVar(const char *name)
static SysVar *FindSysVar(char const *name)
{
int top=NUMSYSVARS-1, bottom=0;
int mid=(top + bottom) / 2;
@@ -601,7 +601,7 @@ static SysVar *FindSysVar(const char *name)
/* If name is "", dump all system variables. */
/* */
/***************************************************************/
void DumpSysVarByName(const char *name)
void DumpSysVarByName(char const *name)
{
int i;
SysVar *v;
@@ -623,7 +623,7 @@ void DumpSysVarByName(const char *name)
/* Dump the system variable. */
/* */
/***************************************************************/
static void DumpSysVar(const char *name, const SysVar *v)
static void DumpSysVar(char const *name, const SysVar *v)
{
char buffer[VAR_NAME_LEN+10];
@@ -643,7 +643,7 @@ static void DumpSysVar(const char *name, const SysVar *v)
}
DestroyValue(val);
} else if (v->type == STR_TYPE) {
char *s = *((char **)v->value);
char const *s = *((char **)v->value);
int y;
Putc('"', ErrFp);
for (y=0; y<MAX_PRT_LEN && *s; y++) {

View File

@@ -1,13 +0,0 @@
/***************************************************************/
/* */
/* VERSION.H */
/* */
/* What version of remind do we have? */
/* */
/* This file is part of REMIND. */
/* Copyright (C) 1992-1998 by David F. Skoll */
/* Copyright (C) 1999-2007 by Roaring Penguin Software Inc. */
/* */
/***************************************************************/
#define VERSION "03.01.03"

1
src/version.h.in Normal file
View File

@@ -0,0 +1 @@
#define VERSION "@VERSION@"

View File

@@ -638,7 +638,7 @@ set a057 value("a05"+"6")
"a05" + "6" => "a056"
value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
set a058 version()
version() => "03.01.03"
version() => "03.01.04"
set a059 wkday(today())
today() => 1991-02-16
wkday(1991-02-16) => "Saturday"
@@ -779,7 +779,7 @@ dump
a048 "foo"
a067 "INT"
a039 "February"
a058 "03.01.03"
a058 "03.01.04"
a077 "1992 92
"
a049 21
@@ -858,6 +858,7 @@ September 30
2007/08/05 * * * * 3 NonOmit-2
2007/08/06 * * * * 5 NonOmit-1
2007/08/06 * * * * 3 NonOmit-2
2007/08/06 * * * * Blort
2007/08/07 * * * * 6 NonOmit-1
2007/08/07 * * * * 4 NonOmit-2
2007/08/08 COLOR * * * 0 0 255 Blue Wednesday
@@ -894,6 +895,7 @@ September 30
2007/08/20 COLOR * * 825 6 7 8 1:45pm Mooo!
2007/08/20 * * * * 18 NonOmit-1
2007/08/20 * * * * 12 NonOmit-2
2007/08/20 * * * * Blort
2007/08/21 PostScript * * 115 (wookie) show
2007/08/21 * * * * 19 NonOmit-1
2007/08/21 * * * * 13 NonOmit-2
@@ -915,6 +917,7 @@ September 30
2007/08/26 * * * * 17 NonOmit-2
2007/08/27 * * * * 25 NonOmit-1
2007/08/27 * * * * 17 NonOmit-2
2007/08/27 * * * * Blort
2007/08/28 * * * * 26 NonOmit-1
2007/08/28 * * * * 18 NonOmit-2
2007/08/29 COLOR * * * 0 0 255 Blue Wednesday
@@ -944,6 +947,7 @@ Test 3
2007/08/05 * * * * 3 NonOmit-2
2007/08/06 * * * * 5 NonOmit-1
2007/08/06 * * * * 3 NonOmit-2
2007/08/06 * * * * Blort
2007/08/07 * * * * 6 NonOmit-1
2007/08/07 * * * * 4 NonOmit-2
2007/08/08 COLOR * * * 0 0 255 Blue Wednesday
@@ -977,6 +981,7 @@ Test 3
2007/08/20 COLOR * * 825 6 7 8 1:45pm Mooo!
2007/08/20 * * * * 18 NonOmit-1
2007/08/20 * * * * 12 NonOmit-2
2007/08/20 * * * * Blort
2007/08/21 * * * * 19 NonOmit-1
2007/08/21 * * * * 13 NonOmit-2
2007/08/22 COLOR * * * 0 0 255 Blue Wednesday
@@ -993,6 +998,7 @@ Test 3
2007/08/26 * * * * 17 NonOmit-2
2007/08/27 * * * * 25 NonOmit-1
2007/08/27 * * * * 17 NonOmit-2
2007/08/27 * * * * Blort
2007/08/28 * * * * 26 NonOmit-1
2007/08/28 * * * * 18 NonOmit-2
2007/08/29 COLOR * * * 0 0 255 Blue Wednesday
@@ -1021,6 +1027,7 @@ Test 4
2007/08/06 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
2007/08/06 * * * * 5 NonOmit-1
2007/08/06 * * * * 3 NonOmit-2
2007/08/06 * * * * Blort
2007/08/07 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
2007/08/07 * * * * 6 NonOmit-1
2007/08/07 * * * * 4 NonOmit-2
@@ -1059,6 +1066,7 @@ Test 4
2007/08/20 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
2007/08/20 * * * * 18 NonOmit-1
2007/08/20 * * * * 12 NonOmit-2
2007/08/20 * * * * Blort
2007/08/21 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
2007/08/21 * * * * 19 NonOmit-1
2007/08/21 * * * * 13 NonOmit-2
@@ -1077,6 +1085,7 @@ Test 4
2007/08/27 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
2007/08/27 * * * * 25 NonOmit-1
2007/08/27 * * * * 17 NonOmit-2
2007/08/27 * * * * Blort
2007/08/28 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
2007/08/28 * * * * 26 NonOmit-1
2007/08/28 * * * * 18 NonOmit-2

View File

@@ -38,3 +38,6 @@ REM 22 AUG SPECIAL PostScript (cabbage) show
REM 23 AUG AT 16:44 SPECIAL blort snoo glup
REM 24 AUG SPECIAL blort gulp wookie
# Bug discovered by Paul Pelzl
OMIT 13 August
REM 6 August 2007 *7 SKIP SATISFY [1] MSG Blort

View File

@@ -1,6 +1,6 @@
#!/bin/sh
echo "Unconfiguring Remind..."
echo rm -f config.cache config.log config.status src/Makefile src/config.h
rm -f config.cache config.log config.status src/Makefile src/config.h
echo rm -f config.cache config.log config.status src/Makefile src/config.h src/version.h
rm -f config.cache config.log config.status src/Makefile src/config.h src/version.h
exit 0

View File

@@ -400,7 +400,7 @@ sub output_calendar
$col++;
}
if ($last_col == 6) {
if ($last_col == 6 && $first_col > 0) {
small_calendar($Nextmon, $Nextlen, $Options{'forwurl'},
($Firstwkday + $Numdays) % 7);
$col++;
@@ -451,6 +451,22 @@ sub output_calendar
print "</tr>\n";
}
# Add a row for small calendars if they were not yet done!
if ($first_col == 0 && $last_col == 6) {
if ($Options{'nostyle'}) {
print "<tr>\n";
} else {
print "<tr class=\"rem-cal-row\">\n";
}
small_calendar($Prevmon, $Prevlen, $Options{'backurl'},
($Firstwkday - $Prevlen + 35) % 7);
for (my $i=0; $i<5; $i++) {
print("<td$class>&nbsp;</td>\n");
}
small_calendar($Nextmon, $Nextlen, $Options{'forwurl'},
($Firstwkday + $Numdays) % 7);
print("</tr>\n");
}
# End the table
print "</table>\n";
}
@@ -471,9 +487,9 @@ sub draw_day_cell
$shade = "";
}
if ($class ne '') {
print "<td class=\"$class\"$shade>\n<p>";
print "<td class=\"$class\"$shade>\n";
} else {
print "<td valign=\"top\" $shade>\n<p>";
print "<td valign=\"top\" $shade>\n";
}
if ($moons->[$day]) {
my $phase = $moons->[$day]->{'phase'};
@@ -513,11 +529,10 @@ sub draw_day_cell
}
if ($Options{'nostyle'}) {
print "<div style=\"float: right\">$day</div></p>\n";
print "<div style=\"float: right\">$day</div>\n";
print "<p>&nbsp;</p>\n";
} else {
print "<div class=\"rem-daynumber\">$day</div></p>\n";
print "<p class=\"rem-entry\">&nbsp;</p>\n";
print "<div class=\"rem-daynumber\">$day</div>\n";
}
if ($days->[$day]) {
print(join("\n", @{$days->[$day]}));
@@ -561,7 +576,7 @@ while(1) {
}
if ($found_something) {
end_output();
exit(1);
exit(0);
} else {
print STDERR "$TIDY_PROGNAME: Could not find any calendar data on STDIN.\n";
exit(1);