mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 23:08:40 +02:00
Compare commits
16 Commits
v3_01_03_R
...
03.01.04
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
487338d10c | ||
|
|
3d1c0e5667 | ||
|
|
ce3bb191c4 | ||
|
|
03e9dbf364 | ||
|
|
518aab3d02 | ||
|
|
f055664f77 | ||
|
|
ba3e01f2ce | ||
|
|
b6883c8a45 | ||
|
|
9e49ee3acb | ||
|
|
7481f68bb2 | ||
|
|
99792eec03 | ||
|
|
91458c7845 | ||
|
|
cad5849dc0 | ||
|
|
a38e120e99 | ||
|
|
0b31a78cf2 | ||
|
|
861858c1a6 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,3 +12,4 @@ tests/test.out
|
|||||||
.gitignore
|
.gitignore
|
||||||
*~
|
*~
|
||||||
src/rem2ps
|
src/rem2ps
|
||||||
|
src/version.h
|
||||||
|
|||||||
9
configure
vendored
9
configure
vendored
@@ -666,6 +666,7 @@ SET_MAKE
|
|||||||
CPP
|
CPP
|
||||||
GREP
|
GREP
|
||||||
EGREP
|
EGREP
|
||||||
|
VERSION
|
||||||
LIBOBJS
|
LIBOBJS
|
||||||
LTLIBOBJS'
|
LTLIBOBJS'
|
||||||
ac_subst_files=''
|
ac_subst_files=''
|
||||||
@@ -5281,7 +5282,9 @@ _ACEOF
|
|||||||
fi
|
fi
|
||||||
done
|
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
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# 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/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
|
||||||
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
|
"src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
|
||||||
"www/Makefile") CONFIG_FILES="$CONFIG_FILES www/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:$LINENO: error: invalid argument: $ac_config_target" >&5
|
||||||
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
|
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
|
||||||
@@ -5952,11 +5956,12 @@ SET_MAKE!$SET_MAKE$ac_delim
|
|||||||
CPP!$CPP$ac_delim
|
CPP!$CPP$ac_delim
|
||||||
GREP!$GREP$ac_delim
|
GREP!$GREP$ac_delim
|
||||||
EGREP!$EGREP$ac_delim
|
EGREP!$EGREP$ac_delim
|
||||||
|
VERSION!$VERSION$ac_delim
|
||||||
LIBOBJS!$LIBOBJS$ac_delim
|
LIBOBJS!$LIBOBJS$ac_delim
|
||||||
LTLIBOBJS!$LTLIBOBJS$ac_delim
|
LTLIBOBJS!$LTLIBOBJS$ac_delim
|
||||||
_ACEOF
|
_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
|
break
|
||||||
elif $ac_last_try; then
|
elif $ac_last_try; then
|
||||||
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
|
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
|
||||||
|
|||||||
@@ -45,4 +45,6 @@ if test "$GCC" = yes; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CHECK_FUNCS(setenv unsetenv)
|
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)
|
||||||
|
|||||||
@@ -1,5 +1,24 @@
|
|||||||
CHANGES TO REMIND
|
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
|
* Version 3.1 Patch 3 - 2007-10-15
|
||||||
|
|
||||||
+ MINOR ENHANCEMENTS
|
+ MINOR ENHANCEMENTS
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ extra features as you become a more sophisticated \fBRemind\fR programmer.
|
|||||||
on to \fBRemind\fR. The options it passes are
|
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.
|
\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.
|
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.
|
\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
|
It is in standard \fBRemind\fR format. \fIWrite_file\fR is the file
|
||||||
|
|||||||
105
scripts/tkremind
105
scripts/tkremind
@@ -95,6 +95,9 @@ catch {set AppendFile $ReminderFile}
|
|||||||
|
|
||||||
#---------------- DON'T CHANGE STUFF BELOW HERE ------------------
|
#---------------- DON'T CHANGE STUFF BELOW HERE ------------------
|
||||||
|
|
||||||
|
# 24-hour clock mode
|
||||||
|
set TwentyFourHourMode 0
|
||||||
|
|
||||||
# Is Monday in first column?
|
# Is Monday in first column?
|
||||||
set MondayFirst 0
|
set MondayFirst 0
|
||||||
|
|
||||||
@@ -153,7 +156,7 @@ set HighestTagSoFar 0
|
|||||||
proc Initialize {} {
|
proc Initialize {} {
|
||||||
|
|
||||||
global DayNames argc argv CommandLine ReminderFile AppendFile Remind PSCmd
|
global DayNames argc argv CommandLine ReminderFile AppendFile Remind PSCmd
|
||||||
global MondayFirst
|
global MondayFirst TwentyFourHourMode
|
||||||
|
|
||||||
set CommandLine "|$Remind -itkremind=1 -p -y -l"
|
set CommandLine "|$Remind -itkremind=1 -p -y -l"
|
||||||
set PSCmd "$Remind -p -l"
|
set PSCmd "$Remind -p -l"
|
||||||
@@ -165,6 +168,9 @@ proc Initialize {} {
|
|||||||
if {[regexp -- {m} [lindex $argv $i]]} {
|
if {[regexp -- {m} [lindex $argv $i]]} {
|
||||||
set MondayFirst 1
|
set MondayFirst 1
|
||||||
}
|
}
|
||||||
|
if {"[lindex $argv $i]" == "-b1"} {
|
||||||
|
set TwentyFourHourMode 1
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -329,10 +335,17 @@ proc CreateCalFrame { w dayNames } {
|
|||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc ConfigureCalFrame { w firstDay numDays } {
|
proc ConfigureCalFrame { w firstDay numDays } {
|
||||||
global CurMonth CurYear TodayMonth TodayYear TodayDay
|
global CurMonth CurYear TodayMonth TodayYear TodayDay
|
||||||
|
global tk_version
|
||||||
set offset [CalEntryOffset $firstDay]
|
set offset [CalEntryOffset $firstDay]
|
||||||
set first [expr $offset+1]
|
set first [expr $offset+1]
|
||||||
set last [expr $offset+$numDays]
|
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} {
|
for {set i 0} {$i < $first} {incr i} {
|
||||||
grid $w.l$i $w.t$i
|
grid $w.l$i $w.t$i
|
||||||
$w.l$i configure -text "" -command "" -state disabled -relief flat
|
$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 TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i"
|
||||||
$w.t$i tag bind REM <ButtonPress-3> "FireEditor $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 -state disabled
|
||||||
$w.t$i configure -background [lindex [$w.t$i configure -background] 3]
|
$w.t$i configure -background $bg
|
||||||
$w.l$i configure -background [lindex [$w.l$i configure -background] 3]
|
$w.l$i configure -background $bg
|
||||||
}
|
}
|
||||||
for {set i $first} {$i <= $last} {incr i} {
|
for {set i $first} {$i <= $last} {incr i} {
|
||||||
grid $w.l$i $w.t$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 TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i"
|
||||||
$w.t$i tag bind REM <ButtonPress-3> "FireEditor $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 -state disabled
|
||||||
$w.t$i configure -background [lindex [$w.t$i configure -background] 3]
|
$w.t$i configure -background $bg
|
||||||
$w.l$i configure -background [lindex [$w.l$i configure -background] 3]
|
$w.l$i configure -background $bg
|
||||||
}
|
}
|
||||||
set forgetIt 0
|
set forgetIt 0
|
||||||
for {set i [expr $last+1]} {$i < 42} {incr i} {
|
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 TAGGED <ButtonPress-1> "EditTaggedReminder $w.t$i"
|
||||||
$w.t$i tag bind REM <ButtonPress-3> "FireEditor $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 -state disabled
|
||||||
$w.t$i configure -background [lindex [$w.t$i configure -background] 3]
|
$w.t$i configure -background $bg
|
||||||
$w.l$i configure -background [lindex [$w.l$i configure -background] 3]
|
$w.l$i configure -background $bg
|
||||||
}
|
}
|
||||||
if { $CurMonth == $TodayMonth && $CurYear == $TodayYear } {
|
if { $CurMonth == $TodayMonth && $CurYear == $TodayYear } {
|
||||||
set n [expr $TodayDay + $offset]
|
set n [expr $TodayDay + $offset]
|
||||||
@@ -1067,7 +1080,7 @@ proc CreateModifyDialog {w day firstDay args} {
|
|||||||
|
|
||||||
# Set up: Year, Month, Day, WeekdayName
|
# Set up: Year, Month, Day, WeekdayName
|
||||||
global CurYear CurMonth EnglishDayNames MonthNames OptionType SkipType
|
global CurYear CurMonth EnglishDayNames MonthNames OptionType SkipType
|
||||||
global ModifyDialogResult
|
global ModifyDialogResult TwentyFourHourMode
|
||||||
|
|
||||||
set OptionType 1
|
set OptionType 1
|
||||||
set SkipType 1
|
set SkipType 1
|
||||||
@@ -1187,7 +1200,11 @@ proc CreateModifyDialog {w day firstDay args} {
|
|||||||
checkbutton $w.timebut -text "Timed reminder at"
|
checkbutton $w.timebut -text "Timed reminder at"
|
||||||
$w.timebut deselect
|
$w.timebut deselect
|
||||||
menubutton $w.timehour -text "12" -menu $w.timehour.menu -relief raised
|
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
|
menubutton $w.timemin -text "00" -menu $w.timemin.menu -relief raised
|
||||||
menu $w.timemin.menu -tearoff 0
|
menu $w.timemin.menu -tearoff 0
|
||||||
foreach i {00 05 10 15 20 25 30 35 40 45 50 55} {
|
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"
|
-command "$w.timemin configure -text $i"
|
||||||
}
|
}
|
||||||
|
|
||||||
menubutton $w.ampm -text "PM" -menu $w.ampm.menu -relief raised
|
if {!$TwentyFourHourMode} {
|
||||||
menu $w.ampm.menu -tearoff 0
|
menubutton $w.ampm -text "PM" -menu $w.ampm.menu -relief raised
|
||||||
$w.ampm.menu add command -label "AM" -command "$w.ampm configure -text {AM}"
|
menu $w.ampm.menu -tearoff 0
|
||||||
$w.ampm.menu add command -label "PM" -command "$w.ampm configure -text {PM}"
|
$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"
|
checkbutton $w.timeadvbut -text "with"
|
||||||
$w.timeadvbut deselect
|
$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"
|
$w.timerep.menu add command -label $i -command "$w.timerep configure -text $i"
|
||||||
}
|
}
|
||||||
label $w.timelab2 -text "minutes"
|
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
|
# SKIP TYPE
|
||||||
label $w.labhol -text "On holidays or weekends:"
|
label $w.labhol -text "On holidays or weekends:"
|
||||||
@@ -1295,13 +1318,20 @@ proc RemindDialogToOptions { w } {
|
|||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc OptionsToRemindDialog { w opts } {
|
proc OptionsToRemindDialog { w opts } {
|
||||||
global OptionType SkipType repbut expbut advbut advcount
|
global OptionType SkipType repbut expbut advbut advcount
|
||||||
global timebut timeadvbut timerepbut
|
global timebut timeadvbut timerepbut TwentyFourHourMode
|
||||||
global dSaturday dSunday dMonday dTuesday dWednesday dThursday dFriday
|
global dSaturday dSunday dMonday dTuesday dWednesday dThursday dFriday
|
||||||
|
set hour ""
|
||||||
|
set ampm ""
|
||||||
foreach {flag value} $opts {
|
foreach {flag value} $opts {
|
||||||
switch -glob -- $flag {
|
switch -glob -- $flag {
|
||||||
"-text-*" {
|
"-text-*" {
|
||||||
set win [string range $flag 6 end]
|
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-*" {
|
"-global-*" {
|
||||||
set win [string range $flag 8 end]
|
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.
|
# The reminder as a string.
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
proc CreateReminder {w} {
|
proc CreateReminder {w} {
|
||||||
global DidOmit
|
global DidOmit TwentyFourHourMode
|
||||||
|
|
||||||
set body [string trim [$w.entry get]]
|
set body [string trim [$w.entry get]]
|
||||||
|
|
||||||
@@ -1504,13 +1552,15 @@ proc CreateReminder {w} {
|
|||||||
if {$timebut} {
|
if {$timebut} {
|
||||||
set hour [$w.timehour cget -text]
|
set hour [$w.timehour cget -text]
|
||||||
set min [$w.timemin cget -text]
|
set min [$w.timemin cget -text]
|
||||||
if {[$w.ampm cget -text] == "PM"} {
|
if {!$TwentyFourHourMode} {
|
||||||
if {$hour < 12} {
|
if {[$w.ampm cget -text] == "PM"} {
|
||||||
incr hour 12
|
if {$hour < 12} {
|
||||||
}
|
incr hour 12
|
||||||
} else {
|
}
|
||||||
if {$hour == 12} {
|
} else {
|
||||||
set hour 0
|
if {$hour == 12} {
|
||||||
|
set hour 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
append rem " AT $hour:$min"
|
append rem " AT $hour:$min"
|
||||||
@@ -2647,7 +2697,12 @@ proc DoMoonSpecial { n stuff } {
|
|||||||
# Displays current date and time in status window
|
# Displays current date and time in status window
|
||||||
#***********************************************************************
|
#***********************************************************************
|
||||||
proc DisplayTime {} {
|
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
|
Status $msg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# Makefile.in for REMIND
|
# Makefile.in for REMIND
|
||||||
#
|
#
|
||||||
|
|
||||||
VERSION=03.01.03
|
|
||||||
SHELL= /bin/sh
|
SHELL= /bin/sh
|
||||||
BETA = 1
|
BETA = 1
|
||||||
srcdir=@srcdir@
|
srcdir=@srcdir@
|
||||||
@@ -12,6 +11,7 @@ bindir=@bindir@
|
|||||||
datadir=@datadir@
|
datadir=@datadir@
|
||||||
datarootdir=@datarootdir@
|
datarootdir=@datarootdir@
|
||||||
VPATH=$(srcdir)
|
VPATH=$(srcdir)
|
||||||
|
VERSION=@VERSION@
|
||||||
|
|
||||||
INSTALL=@INSTALL@
|
INSTALL=@INSTALL@
|
||||||
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
INSTALL_PROGRAM=@INSTALL_PROGRAM@
|
||||||
@@ -92,3 +92,4 @@ beta-tgz:
|
|||||||
|
|
||||||
#---------------- Stuff after this added by "make depend" -----------------
|
#---------------- Stuff after this added by "make depend" -----------------
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -28,14 +28,14 @@
|
|||||||
/* Data structures used by the calendar */
|
/* Data structures used by the calendar */
|
||||||
typedef struct cal_entry {
|
typedef struct cal_entry {
|
||||||
struct cal_entry *next;
|
struct cal_entry *next;
|
||||||
char *text;
|
char const *text;
|
||||||
char *pos;
|
char const *pos;
|
||||||
int time;
|
int time;
|
||||||
int priority;
|
int priority;
|
||||||
char tag[TAG_LEN+1];
|
char tag[TAG_LEN+1];
|
||||||
char passthru[PASSTHRU_LEN+1];
|
char passthru[PASSTHRU_LEN+1];
|
||||||
int duration;
|
int duration;
|
||||||
char *filename;
|
char const *filename;
|
||||||
int lineno;
|
int lineno;
|
||||||
} CalEntry;
|
} CalEntry;
|
||||||
|
|
||||||
@@ -48,8 +48,8 @@ static void SortCol (CalEntry **col);
|
|||||||
static void DoCalendarOneWeek (void);
|
static void DoCalendarOneWeek (void);
|
||||||
static void DoCalendarOneMonth (void);
|
static void DoCalendarOneMonth (void);
|
||||||
static int WriteCalendarRow (void);
|
static int WriteCalendarRow (void);
|
||||||
static void PrintLeft (char *s, int width, char pad);
|
static void PrintLeft (char const *s, int width, char pad);
|
||||||
static void PrintCentered (char *s, int width, char pad);
|
static void PrintCentered (char const *s, int width, char pad);
|
||||||
static int WriteOneCalLine (void);
|
static int WriteOneCalLine (void);
|
||||||
static int WriteOneColLine (int col);
|
static int WriteOneColLine (int col);
|
||||||
static void GenerateCalEntries (int col);
|
static void GenerateCalEntries (int col);
|
||||||
@@ -303,7 +303,7 @@ static int WriteCalendarRow(void)
|
|||||||
/* Left-justify a piece of text. */
|
/* 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);
|
int len = strlen(s);
|
||||||
printf("%s", s);
|
printf("%s", s);
|
||||||
@@ -317,7 +317,7 @@ static void PrintLeft(char *s, int width, char pad)
|
|||||||
/* Center a piec of text */
|
/* 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 len = strlen(s);
|
||||||
int d = (width - len) / 2;
|
int d = (width - len) / 2;
|
||||||
@@ -367,8 +367,8 @@ static int WriteOneCalLine(void)
|
|||||||
static int WriteOneColLine(int col)
|
static int WriteOneColLine(int col)
|
||||||
{
|
{
|
||||||
CalEntry *e = CalColumn[col];
|
CalEntry *e = CalColumn[col];
|
||||||
char *s;
|
char const *s;
|
||||||
char *space;
|
char const *space;
|
||||||
int numwritten = 0;
|
int numwritten = 0;
|
||||||
|
|
||||||
/* Print as many characters as possible within the column */
|
/* Print as many characters as possible within the column */
|
||||||
@@ -380,8 +380,8 @@ static int WriteOneColLine(int col)
|
|||||||
if (!*s && e->next) {
|
if (!*s && e->next) {
|
||||||
PrintLeft("", ColSpaces, ' ');
|
PrintLeft("", ColSpaces, ' ');
|
||||||
CalColumn[col] = e->next;
|
CalColumn[col] = e->next;
|
||||||
free(e->text);
|
free((char *) e->text);
|
||||||
free(e->filename);
|
free((char *) e->filename);
|
||||||
free(e);
|
free(e);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -420,8 +420,8 @@ static int WriteOneColLine(int col)
|
|||||||
/* If done, free memory if no next entry. */
|
/* If done, free memory if no next entry. */
|
||||||
if (!*s && !e->next) {
|
if (!*s && !e->next) {
|
||||||
CalColumn[col] = e->next;
|
CalColumn[col] = e->next;
|
||||||
free(e->text);
|
free((char *) e->text);
|
||||||
free(e->filename);
|
free((char *) e->filename);
|
||||||
free(e);
|
free(e);
|
||||||
} else {
|
} else {
|
||||||
e->pos = s;
|
e->pos = s;
|
||||||
@@ -440,7 +440,7 @@ static void GenerateCalEntries(int col)
|
|||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
Token tok;
|
Token tok;
|
||||||
char *s;
|
char const *s;
|
||||||
Parser p;
|
Parser p;
|
||||||
|
|
||||||
/* Do some initialization first... */
|
/* Do some initialization first... */
|
||||||
@@ -588,7 +588,7 @@ static int DoCalRem(ParsePtr p, int col)
|
|||||||
int jul;
|
int jul;
|
||||||
CalEntry *CurCol = CalColumn[col];
|
CalEntry *CurCol = CalColumn[col];
|
||||||
CalEntry *e;
|
CalEntry *e;
|
||||||
char *s, *s2;
|
char const *s, *s2;
|
||||||
DynamicBuffer buf, obuf, pre_buf;
|
DynamicBuffer buf, obuf, pre_buf;
|
||||||
Token tok;
|
Token tok;
|
||||||
|
|
||||||
@@ -830,8 +830,8 @@ static void WriteSimpleEntries(int col, int jul)
|
|||||||
printf("* ");
|
printf("* ");
|
||||||
}
|
}
|
||||||
printf("%s\n", e->text);
|
printf("%s\n", e->text);
|
||||||
free(e->text);
|
free((char *) e->text);
|
||||||
free(e->filename);
|
free((char *) e->filename);
|
||||||
n = e->next;
|
n = e->next;
|
||||||
free(e);
|
free(e);
|
||||||
e = n;
|
e = n;
|
||||||
@@ -888,14 +888,14 @@ static void WriteCalDays(void)
|
|||||||
/* This takes into account duration */
|
/* This takes into account duration */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
char *
|
char const *
|
||||||
CalendarTime(int tim, int duration)
|
CalendarTime(int tim, int duration)
|
||||||
{
|
{
|
||||||
static char buf[128];
|
static char buf[128];
|
||||||
int h, min, hh;
|
int h, min, hh;
|
||||||
int h2, min2, hh2, newtim, days;
|
int h2, min2, hh2, newtim, days;
|
||||||
char *ampm1;
|
char const *ampm1;
|
||||||
char *ampm2;
|
char const *ampm2;
|
||||||
char daybuf[64];
|
char daybuf[64];
|
||||||
|
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
@@ -970,7 +970,7 @@ CalendarTime(int tim, int duration)
|
|||||||
/* A trailing space is always added. */
|
/* A trailing space is always added. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
char *SimpleTime(int tim)
|
char const *SimpleTime(int tim)
|
||||||
{
|
{
|
||||||
static char buf[32];
|
static char buf[32];
|
||||||
int h, min, hh;
|
int h, min, hh;
|
||||||
|
|||||||
@@ -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. */
|
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||||
#undef HAVE_UTIME_NULL
|
#undef HAVE_UTIME_NULL
|
||||||
|
|
||||||
|
|||||||
13
src/dorem.c
13
src/dorem.c
@@ -555,7 +555,7 @@ int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
|
|||||||
char tmpBuf[64];
|
char tmpBuf[64];
|
||||||
DynamicBuffer buf, calRow;
|
DynamicBuffer buf, calRow;
|
||||||
DynamicBuffer pre_buf;
|
DynamicBuffer pre_buf;
|
||||||
char *s;
|
char const *s;
|
||||||
Value v;
|
Value v;
|
||||||
|
|
||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
@@ -812,7 +812,8 @@ int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
|
|||||||
{
|
{
|
||||||
int iter, jul, r;
|
int iter, jul, r;
|
||||||
Value v;
|
Value v;
|
||||||
char *s, *t;
|
char const *s;
|
||||||
|
char const *t;
|
||||||
|
|
||||||
t = p->pos;
|
t = p->pos;
|
||||||
iter = 0;
|
iter = 0;
|
||||||
@@ -848,7 +849,7 @@ int DoSatRemind(Trigger *trig, TimeTrig *tim, ParsePtr p)
|
|||||||
static int ParsePriority(ParsePtr s, Trigger *t)
|
static int ParsePriority(ParsePtr s, Trigger *t)
|
||||||
{
|
{
|
||||||
int p, r;
|
int p, r;
|
||||||
char *u;
|
char const *u;
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
|
|
||||||
@@ -886,14 +887,14 @@ static int ParsePriority(ParsePtr s, Trigger *t)
|
|||||||
/* Execute the '-k' command, escaping shell chars in message. */
|
/* 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 r;
|
||||||
int i, l;
|
int i, l;
|
||||||
DynamicBuffer execBuffer;
|
DynamicBuffer execBuffer;
|
||||||
|
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
DBufInit(&execBuffer);
|
DBufInit(&execBuffer);
|
||||||
@@ -951,7 +952,7 @@ static int ShouldTriggerBasedOnWarn(Trigger *t, int jul)
|
|||||||
{
|
{
|
||||||
char buffer[VAR_NAME_LEN+32];
|
char buffer[VAR_NAME_LEN+32];
|
||||||
int i;
|
int i;
|
||||||
char *s;
|
char const *s;
|
||||||
int r;
|
int r;
|
||||||
Value v;
|
Value v;
|
||||||
int lastReturnVal = 0; /* Silence compiler warning */
|
int lastReturnVal = 0; /* Silence compiler warning */
|
||||||
|
|||||||
@@ -54,11 +54,12 @@ int DoSubst(ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul,
|
|||||||
int d, m, y;
|
int d, m, y;
|
||||||
int tim = tt->ttime;
|
int tim = tt->ttime;
|
||||||
int h, min, hh, ch, cmin, chh;
|
int h, min, hh, ch, cmin, chh;
|
||||||
char *pm, *cpm;
|
char const *pm, *cpm;
|
||||||
int tdiff, adiff, mdiff, hdiff;
|
int tdiff, adiff, mdiff, hdiff;
|
||||||
char *mplu, *hplu, *when, *plu;
|
char const *mplu, *hplu, *when, *plu;
|
||||||
int has_quote = 0;
|
int has_quote = 0;
|
||||||
char *ss, *os;
|
char *ss;
|
||||||
|
char *os;
|
||||||
char s[256];
|
char s[256];
|
||||||
int origLen = DBufLen(dbuf);
|
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. */
|
/* 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)
|
int jul, int tim)
|
||||||
{
|
{
|
||||||
Trigger tempTrig;
|
Trigger tempTrig;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ static int DBufMakeRoom(DynamicBuffer *dbuf, int n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate memory */
|
/* Allocate memory */
|
||||||
buf = (char *) malloc(size);
|
buf = malloc(size);
|
||||||
if (!buf) return E_NO_MEM;
|
if (!buf) return E_NO_MEM;
|
||||||
|
|
||||||
/* Copy contents */
|
/* Copy contents */
|
||||||
@@ -102,7 +102,7 @@ int DBufPutcFN(DynamicBuffer *dbuf, char c)
|
|||||||
%DESCRIPTION:
|
%DESCRIPTION:
|
||||||
Appends a string to the buffer.
|
Appends a string to the buffer.
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
int DBufPuts(DynamicBuffer *dbuf, char *str)
|
int DBufPuts(DynamicBuffer *dbuf, char const *str)
|
||||||
{
|
{
|
||||||
int l = strlen(str);
|
int l = strlen(str);
|
||||||
if (!l) return OK;
|
if (!l) return OK;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ typedef struct {
|
|||||||
|
|
||||||
void DBufInit(DynamicBuffer *dbuf);
|
void DBufInit(DynamicBuffer *dbuf);
|
||||||
int DBufPutcFN(DynamicBuffer *dbuf, char c);
|
int DBufPutcFN(DynamicBuffer *dbuf, char c);
|
||||||
int DBufPuts(DynamicBuffer *dbuf, char *str);
|
int DBufPuts(DynamicBuffer *dbuf, char const *str);
|
||||||
void DBufFree(DynamicBuffer *dbuf);
|
void DBufFree(DynamicBuffer *dbuf);
|
||||||
int DBufGets(DynamicBuffer *dbuf, FILE *fp);
|
int DBufGets(DynamicBuffer *dbuf, FILE *fp);
|
||||||
|
|
||||||
|
|||||||
38
src/expr.c
38
src/expr.c
@@ -41,8 +41,8 @@ static int Multiply(void), Divide(void), Mod(void), Add(void),
|
|||||||
UnMinus(void), LogNot(void),
|
UnMinus(void), LogNot(void),
|
||||||
Compare(int);
|
Compare(int);
|
||||||
|
|
||||||
static int MakeValue (char *s, Value *v, Var *locals);
|
static int MakeValue (char const *s, Value *v, Var *locals);
|
||||||
static int ParseLiteralDate (char **s, int *jul, int *tim);
|
static int ParseLiteralDate (char const **s, int *jul, int *tim);
|
||||||
|
|
||||||
/* Binary operators - all left-associative */
|
/* Binary operators - all left-associative */
|
||||||
|
|
||||||
@@ -132,9 +132,9 @@ static void CleanStack(void)
|
|||||||
/* PeekChar - peek ahead to next char. */
|
/* 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++;
|
while (*t && isspace(*t)) t++;
|
||||||
return *t;
|
return *t;
|
||||||
}
|
}
|
||||||
@@ -146,7 +146,7 @@ static char PeekChar(char **s)
|
|||||||
/* Read a token. */
|
/* Read a token. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static int ParseExprToken(DynamicBuffer *buf, char **in)
|
static int ParseExprToken(DynamicBuffer *buf, char const **in)
|
||||||
{
|
{
|
||||||
|
|
||||||
char c;
|
char c;
|
||||||
@@ -266,7 +266,7 @@ static int ParseExprToken(DynamicBuffer *buf, char **in)
|
|||||||
/* Put the result into value pointed to by v. */
|
/* Put the result into value pointed to by v. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int EvalExpr(char **e, Value *v)
|
int EvalExpr(char const **e, Value *v)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ int EvalExpr(char **e, Value *v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Evaluate - do the actual work of evaluation. */
|
/* Evaluate - do the actual work of evaluation. */
|
||||||
int Evaluate(char **s, Var *locals)
|
int Evaluate(char const **s, Var *locals)
|
||||||
{
|
{
|
||||||
int OpBase, ValBase;
|
int OpBase, ValBase;
|
||||||
int r;
|
int r;
|
||||||
@@ -297,7 +297,7 @@ int Evaluate(char **s, Var *locals)
|
|||||||
int args; /* Number of function arguments */
|
int args; /* Number of function arguments */
|
||||||
Operator op, op2;
|
Operator op, op2;
|
||||||
Value va;
|
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;
|
OpBase = OpStackPtr;
|
||||||
ValBase = ValStackPtr;
|
ValBase = ValStackPtr;
|
||||||
@@ -339,7 +339,7 @@ int Evaluate(char **s, Var *locals)
|
|||||||
if (f) r = CallFunc(f, 0);
|
if (f) r = CallFunc(f, 0);
|
||||||
else {
|
else {
|
||||||
r = CallUserFunc(ufname, 0);
|
r = CallUserFunc(ufname, 0);
|
||||||
free(ufname);
|
free((char *) ufname);
|
||||||
}
|
}
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
r = ParseExprToken(&ExprBuf, s); /* Guaranteed to be right paren. */
|
r = ParseExprToken(&ExprBuf, s); /* Guaranteed to be right paren. */
|
||||||
@@ -349,12 +349,12 @@ int Evaluate(char **s, Var *locals)
|
|||||||
args++;
|
args++;
|
||||||
r = Evaluate(s, locals);
|
r = Evaluate(s, locals);
|
||||||
if (r) {
|
if (r) {
|
||||||
if (!f) free(ufname);
|
if (!f) free((char *) ufname);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
if (*DBufValue(&ExprBuf) == ')') break;
|
if (*DBufValue(&ExprBuf) == ')') break;
|
||||||
else if (*DBufValue(&ExprBuf) != ',') {
|
else if (*DBufValue(&ExprBuf) != ',') {
|
||||||
if (!f) free(ufname);
|
if (!f) free((char *) ufname);
|
||||||
Eprint("%s: `%c'", ErrMsg[E_EXPECT_COMMA],
|
Eprint("%s: `%c'", ErrMsg[E_EXPECT_COMMA],
|
||||||
*DBufValue(&ExprBuf));
|
*DBufValue(&ExprBuf));
|
||||||
DBufFree(&ExprBuf);
|
DBufFree(&ExprBuf);
|
||||||
@@ -364,7 +364,7 @@ int Evaluate(char **s, Var *locals)
|
|||||||
if (f) r = CallFunc(f, args);
|
if (f) r = CallFunc(f, args);
|
||||||
else {
|
else {
|
||||||
r = CallUserFunc(ufname, args);
|
r = CallUserFunc(ufname, args);
|
||||||
free(ufname);
|
free((char *) ufname);
|
||||||
}
|
}
|
||||||
DBufFree(&ExprBuf);
|
DBufFree(&ExprBuf);
|
||||||
if (r) return r;
|
if (r) return r;
|
||||||
@@ -448,7 +448,7 @@ int Evaluate(char **s, Var *locals)
|
|||||||
/* a date or the value of a symbol. */
|
/* 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 len;
|
||||||
int h, m, r;
|
int h, m, r;
|
||||||
@@ -456,7 +456,7 @@ static int MakeValue(char *s, Value *v, Var *locals)
|
|||||||
if (*s == '\"') { /* It's a literal string "*/
|
if (*s == '\"') { /* It's a literal string "*/
|
||||||
len = strlen(s)-1;
|
len = strlen(s)-1;
|
||||||
v->type = STR_TYPE;
|
v->type = STR_TYPE;
|
||||||
v->v.str = (char *) malloc(len);
|
v->v.str = malloc(len);
|
||||||
if (! v->v.str) {
|
if (! v->v.str) {
|
||||||
v->type = ERR_TYPE;
|
v->type = ERR_TYPE;
|
||||||
return E_NO_MEM;
|
return E_NO_MEM;
|
||||||
@@ -533,7 +533,7 @@ static int MakeValue(char *s, Value *v, Var *locals)
|
|||||||
int DoCoerce(char type, Value *v)
|
int DoCoerce(char type, Value *v)
|
||||||
{
|
{
|
||||||
int h, d, m, y, i, k;
|
int h, d, m, y, i, k;
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
/* Do nothing if value is already the right type */
|
/* Do nothing if value is already the right type */
|
||||||
if (type == v->type) return OK;
|
if (type == v->type) return OK;
|
||||||
@@ -751,7 +751,7 @@ static int Add(void)
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
v3.type = STR_TYPE;
|
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) {
|
if (!v3.v.str) {
|
||||||
DestroyValue(v1); DestroyValue(v2);
|
DestroyValue(v1); DestroyValue(v2);
|
||||||
return E_NO_MEM;
|
return E_NO_MEM;
|
||||||
@@ -1078,7 +1078,7 @@ static int LogNot(void)
|
|||||||
/* Find a function. */
|
/* 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 top=num-1, bot=0;
|
||||||
int mid, r;
|
int mid, r;
|
||||||
@@ -1102,7 +1102,7 @@ Operator *FindFunc(char *name, Operator where[], int num)
|
|||||||
void PrintValue (Value *v, FILE *fp)
|
void PrintValue (Value *v, FILE *fp)
|
||||||
{
|
{
|
||||||
int y, m, d;
|
int y, m, d;
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
if (v->type == STR_TYPE) {
|
if (v->type == STR_TYPE) {
|
||||||
s=v->v.str;
|
s=v->v.str;
|
||||||
@@ -1154,7 +1154,7 @@ int CopyValue(Value *dest, const Value *src)
|
|||||||
/* and tim; update s. */
|
/* 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 y, m, d;
|
||||||
int hour, min;
|
int hour, min;
|
||||||
|
|||||||
24
src/files.c
24
src/files.c
@@ -42,20 +42,20 @@
|
|||||||
/* Define the structures needed by the file caching system */
|
/* Define the structures needed by the file caching system */
|
||||||
typedef struct cache {
|
typedef struct cache {
|
||||||
struct cache *next;
|
struct cache *next;
|
||||||
char *text;
|
char const *text;
|
||||||
int LineNo;
|
int LineNo;
|
||||||
} CachedLine;
|
} CachedLine;
|
||||||
|
|
||||||
typedef struct cheader {
|
typedef struct cheader {
|
||||||
struct cheader *next;
|
struct cheader *next;
|
||||||
char *filename;
|
char const *filename;
|
||||||
CachedLine *cache;
|
CachedLine *cache;
|
||||||
int ownedByMe;
|
int ownedByMe;
|
||||||
} CachedFile;
|
} CachedFile;
|
||||||
|
|
||||||
/* Define the structures needed by the INCLUDE file system */
|
/* Define the structures needed by the INCLUDE file system */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *filename;
|
char const *filename;
|
||||||
int LineNo;
|
int LineNo;
|
||||||
unsigned int IfFlags;
|
unsigned int IfFlags;
|
||||||
int NumIfs;
|
int NumIfs;
|
||||||
@@ -73,7 +73,7 @@ static IncludeStruct IStack[INCLUDE_NEST];
|
|||||||
static int IStackPtr = 0;
|
static int IStackPtr = 0;
|
||||||
|
|
||||||
static int ReadLineFromFile (void);
|
static int ReadLineFromFile (void);
|
||||||
static int CacheFile (const char *fname);
|
static int CacheFile (char const *fname);
|
||||||
static void DestroyCache (CachedFile *cf);
|
static void DestroyCache (CachedFile *cf);
|
||||||
static int CheckSafety (void);
|
static int CheckSafety (void);
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ static int ReadLineFromFile(void)
|
|||||||
/* ShouldCache is 1, cache the file */
|
/* ShouldCache is 1, cache the file */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int OpenFile(const char *fname)
|
int OpenFile(char const *fname)
|
||||||
{
|
{
|
||||||
CachedFile *h = CachedFiles;
|
CachedFile *h = CachedFiles;
|
||||||
int r;
|
int r;
|
||||||
@@ -230,12 +230,12 @@ int OpenFile(const char *fname)
|
|||||||
/* Returns an indication of success or failure. */
|
/* Returns an indication of success or failure. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static int CacheFile(const char *fname)
|
static int CacheFile(char const *fname)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
CachedFile *cf;
|
CachedFile *cf;
|
||||||
CachedLine *cl;
|
CachedLine *cl;
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
cl = NULL;
|
cl = NULL;
|
||||||
/* Create a file header */
|
/* Create a file header */
|
||||||
@@ -349,7 +349,7 @@ int PopFile(void)
|
|||||||
if (fp != stdin)
|
if (fp != stdin)
|
||||||
(void) fseek(fp, i->offset, 0); /* Trust that it works... */
|
(void) fseek(fp, i->offset, 0); /* Trust that it works... */
|
||||||
}
|
}
|
||||||
free(i->filename);
|
free((char *) i->filename);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +387,7 @@ int DoInclude(ParsePtr p)
|
|||||||
/* inclusion. */
|
/* inclusion. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int IncludeFile(const char *fname)
|
int IncludeFile(char const *fname)
|
||||||
{
|
{
|
||||||
IncludeStruct *i;
|
IncludeStruct *i;
|
||||||
int r;
|
int r;
|
||||||
@@ -432,7 +432,7 @@ int IncludeFile(const char *fname)
|
|||||||
/* GetAccessDate - get the access date of a file. */
|
/* GetAccessDate - get the access date of a file. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int GetAccessDate(char *file)
|
int GetAccessDate(char const *file)
|
||||||
{
|
{
|
||||||
struct stat statbuf;
|
struct stat statbuf;
|
||||||
struct tm *t1;
|
struct tm *t1;
|
||||||
@@ -457,10 +457,10 @@ static void DestroyCache(CachedFile *cf)
|
|||||||
{
|
{
|
||||||
CachedLine *cl, *cnext;
|
CachedLine *cl, *cnext;
|
||||||
CachedFile *temp;
|
CachedFile *temp;
|
||||||
if (cf->filename) free(cf->filename);
|
if (cf->filename) free((char *) cf->filename);
|
||||||
cl = cf->cache;
|
cl = cf->cache;
|
||||||
while (cl) {
|
while (cl) {
|
||||||
if (cl->text) free (cl->text);
|
if (cl->text) free ((char *) cl->text);
|
||||||
cnext = cl->next;
|
cnext = cl->next;
|
||||||
free(cl);
|
free(cl);
|
||||||
cl = cnext;
|
cl = cnext;
|
||||||
|
|||||||
31
src/funcs.c
31
src/funcs.c
@@ -11,6 +11,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -47,7 +48,6 @@
|
|||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
#include "err.h"
|
#include "err.h"
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
#include "version.h"
|
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
static int FCurrent (void);
|
static int FCurrent (void);
|
||||||
@@ -358,11 +358,11 @@ static int CleanUpAfterFunc(void)
|
|||||||
/* Return a string value from a function. */
|
/* Return a string value from a function. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static int RetStrVal(const char *s)
|
static int RetStrVal(char const *s)
|
||||||
{
|
{
|
||||||
RetVal.type = STR_TYPE;
|
RetVal.type = STR_TYPE;
|
||||||
if (!s) {
|
if (!s) {
|
||||||
RetVal.v.str = (char *) malloc(1);
|
RetVal.v.str = malloc(1);
|
||||||
if (RetVal.v.str) *RetVal.v.str = 0;
|
if (RetVal.v.str) *RetVal.v.str = 0;
|
||||||
} else
|
} else
|
||||||
RetVal.v.str = StrDup(s);
|
RetVal.v.str = StrDup(s);
|
||||||
@@ -493,7 +493,7 @@ static int FDateTime(void)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static int FCoerce(void)
|
static int FCoerce(void)
|
||||||
{
|
{
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
|
if (ARG(0).type != STR_TYPE) return E_BAD_TYPE;
|
||||||
s = ARG(0).v.str;
|
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 < -128) return E_2LOW;
|
||||||
if (ARG(0).v.val > 255) return E_2HIGH;
|
if (ARG(0).v.val > 255) return E_2HIGH;
|
||||||
len = ARG(0).v.val ? 2 : 1;
|
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;
|
if (!RetVal.v.str) return E_NO_MEM;
|
||||||
RetVal.type = STR_TYPE;
|
RetVal.type = STR_TYPE;
|
||||||
*(RetVal.v.str) = ARG(0).v.val;
|
*(RetVal.v.str) = ARG(0).v.val;
|
||||||
@@ -599,7 +599,7 @@ static int FChar(void)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
RetVal.v.str = (char *) malloc(Nargs + 1);
|
RetVal.v.str = malloc(Nargs + 1);
|
||||||
if (!RetVal.v.str) return E_NO_MEM;
|
if (!RetVal.v.str) return E_NO_MEM;
|
||||||
RetVal.type = STR_TYPE;
|
RetVal.type = STR_TYPE;
|
||||||
for (i=0; i<Nargs; i++) {
|
for (i=0; i<Nargs; i++) {
|
||||||
@@ -710,7 +710,7 @@ static int FWkdaynum(void)
|
|||||||
|
|
||||||
static int FWkday(void)
|
static int FWkday(void)
|
||||||
{
|
{
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
if (!HASDATE(ARG(0)) && ARG(0).type != INT_TYPE) return E_BAD_TYPE;
|
if (!HASDATE(ARG(0)) && ARG(0).type != INT_TYPE) return E_BAD_TYPE;
|
||||||
if (ARG(0).type == INT_TYPE) {
|
if (ARG(0).type == INT_TYPE) {
|
||||||
@@ -726,7 +726,7 @@ static int FWkday(void)
|
|||||||
|
|
||||||
static int FMon(void)
|
static int FMon(void)
|
||||||
{
|
{
|
||||||
char *s;
|
char const *s;
|
||||||
int y, m, d, v;
|
int y, m, d, v;
|
||||||
|
|
||||||
if (!HASDATE(ARG(0)) && ARG(0).type != INT_TYPE) return E_BAD_TYPE;
|
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)
|
static int FOrd(void)
|
||||||
{
|
{
|
||||||
int t, u, v;
|
int t, u, v;
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
|
if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
|
||||||
|
|
||||||
@@ -874,7 +874,7 @@ static int FPlural(void)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
RetVal.type = STR_TYPE;
|
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) {
|
if (!RetVal.v.str) {
|
||||||
RetVal.type = ERR_TYPE;
|
RetVal.type = ERR_TYPE;
|
||||||
return E_NO_MEM;
|
return E_NO_MEM;
|
||||||
@@ -1315,7 +1315,8 @@ static int FIsomitted(void)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static int FSubstr(void)
|
static int FSubstr(void)
|
||||||
{
|
{
|
||||||
char *s, *t;
|
char *s;
|
||||||
|
char const *t;
|
||||||
int start, end;
|
int start, end;
|
||||||
|
|
||||||
if (ARG(0).type != STR_TYPE || ARG(1).type != INT_TYPE) return E_BAD_TYPE;
|
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)
|
static int FIndex(void)
|
||||||
{
|
{
|
||||||
char *s;
|
char const *s;
|
||||||
int start;
|
int start;
|
||||||
|
|
||||||
if (ARG(0).type != STR_TYPE || ARG(1).type != STR_TYPE ||
|
if (ARG(0).type != STR_TYPE || ARG(1).type != STR_TYPE ||
|
||||||
@@ -1463,7 +1464,7 @@ static int FFiledir(void)
|
|||||||
static int FAccess(void)
|
static int FAccess(void)
|
||||||
{
|
{
|
||||||
int amode;
|
int amode;
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
if (ARG(0).type != STR_TYPE ||
|
if (ARG(0).type != STR_TYPE ||
|
||||||
(ARG(1).type != INT_TYPE && ARG(1).type != STR_TYPE)) return E_BAD_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 sizebuf[30];
|
||||||
char fontsizebuf[30];
|
char fontsizebuf[30];
|
||||||
char *s = psbuff;
|
char *s = psbuff;
|
||||||
char *extra = NULL;
|
char const *extra = NULL;
|
||||||
int size = -1;
|
int size = -1;
|
||||||
int fontsize = -1;
|
int fontsize = -1;
|
||||||
|
|
||||||
@@ -2366,7 +2367,7 @@ static int tz_convert(int year, int month, int day,
|
|||||||
int r;
|
int r;
|
||||||
time_t t;
|
time_t t;
|
||||||
struct tm *res;
|
struct tm *res;
|
||||||
char *old_tz;
|
char const *old_tz;
|
||||||
|
|
||||||
/* init tm struct */
|
/* init tm struct */
|
||||||
tm->tm_sec = 0;
|
tm->tm_sec = 0;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ EXTERN int CurMon;
|
|||||||
EXTERN int CurYear;
|
EXTERN int CurYear;
|
||||||
EXTERN int LineNo;
|
EXTERN int LineNo;
|
||||||
EXTERN int FreshLine;
|
EXTERN int FreshLine;
|
||||||
EXTERN INIT( char *MsgCommand, NULL);
|
EXTERN INIT( char const *MsgCommand, NULL);
|
||||||
EXTERN INIT( int ShowAllErrors, 0);
|
EXTERN INIT( int ShowAllErrors, 0);
|
||||||
EXTERN INIT( int DebugFlag, 0);
|
EXTERN INIT( int DebugFlag, 0);
|
||||||
EXTERN INIT( int DoCalendar, 0);
|
EXTERN INIT( int DoCalendar, 0);
|
||||||
@@ -61,7 +61,7 @@ EXTERN INIT( int SortByPrio, 0);
|
|||||||
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
|
EXTERN INIT( int DefaultPrio, NO_PRIORITY);
|
||||||
EXTERN INIT( long SysTime, -1L);
|
EXTERN INIT( long SysTime, -1L);
|
||||||
|
|
||||||
EXTERN char *InitialFile;
|
EXTERN char const *InitialFile;
|
||||||
EXTERN int FileAccessDate;
|
EXTERN int FileAccessDate;
|
||||||
|
|
||||||
EXTERN INIT( int DontFork, 0);
|
EXTERN INIT( int DontFork, 0);
|
||||||
@@ -83,10 +83,10 @@ EXTERN INIT( int LastTriggerDate, 0);
|
|||||||
EXTERN INIT( int LastTrigValid, 0);
|
EXTERN INIT( int LastTrigValid, 0);
|
||||||
EXTERN INIT( int LastTriggerTime, 0);
|
EXTERN INIT( int LastTriggerTime, 0);
|
||||||
EXTERN INIT( int ShouldCache, 0);
|
EXTERN INIT( int ShouldCache, 0);
|
||||||
EXTERN char *CurLine;
|
EXTERN char const *CurLine;
|
||||||
EXTERN INIT( int NumTriggered, 0);
|
EXTERN INIT( int NumTriggered, 0);
|
||||||
EXTERN int ArgC;
|
EXTERN int ArgC;
|
||||||
EXTERN char **ArgV;
|
EXTERN char const **ArgV;
|
||||||
EXTERN INIT( int CalLines, CAL_LINES);
|
EXTERN INIT( int CalLines, CAL_LINES);
|
||||||
EXTERN INIT( int CalPad, 1);
|
EXTERN INIT( int CalPad, 1);
|
||||||
|
|
||||||
|
|||||||
16
src/hbcal.c
16
src/hbcal.c
@@ -55,7 +55,7 @@
|
|||||||
#define ADAR2ADARA 1
|
#define ADAR2ADARA 1
|
||||||
#define ADAR2BOTH 2
|
#define ADAR2BOTH 2
|
||||||
|
|
||||||
static char *HebMonthNames[] = {
|
static char const *HebMonthNames[] = {
|
||||||
"Tishrey", "Heshvan", "Kislev", "Tevet", "Shvat", "Adar A", "Adar B",
|
"Tishrey", "Heshvan", "Kislev", "Tevet", "Shvat", "Adar A", "Adar B",
|
||||||
"Nisan", "Iyar", "Sivan", "Tamuz", "Av", "Elul", "Adar"};
|
"Nisan", "Iyar", "Sivan", "Tamuz", "Av", "Elul", "Adar"};
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ int DaysInHebYear(int y)
|
|||||||
/* given the LENGTH of the Hebrew year. */
|
/* given the LENGTH of the Hebrew year. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
char *DaysInHebMonths(int ylen)
|
char const *DaysInHebMonths(int ylen)
|
||||||
{
|
{
|
||||||
static char monlen[13] =
|
static char monlen[13] =
|
||||||
{30, 29, 30, 29, 30, 0, 29, 30, 29, 30, 29, 30, 29};
|
{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 HebToJul(int hy, int hm, int hd)
|
||||||
{
|
{
|
||||||
int ylen;
|
int ylen;
|
||||||
char *monlens;
|
char const *monlens;
|
||||||
int rh;
|
int rh;
|
||||||
int m;
|
int m;
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ void JulToHeb(int jul, int *hy, int *hm, int *hd)
|
|||||||
int y, m, d;
|
int y, m, d;
|
||||||
int rh;
|
int rh;
|
||||||
int ylen;
|
int ylen;
|
||||||
char *monlen;
|
char const *monlen;
|
||||||
/* Get the common year */
|
/* Get the common year */
|
||||||
FromJulian(jul, &y, &m, &d);
|
FromJulian(jul, &y, &m, &d);
|
||||||
y += 3763; /* Over-estimate a bit to be on the safe side below... */
|
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. */
|
/* year. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int HebNameToNum(const char *mname)
|
int HebNameToNum(char const *mname)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int m=-1;
|
int m=-1;
|
||||||
@@ -254,7 +254,7 @@ int HebNameToNum(const char *mname)
|
|||||||
/* year. */
|
/* year. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
char *HebMonthName(int m, int y)
|
char const *HebMonthName(int m, int y)
|
||||||
{
|
{
|
||||||
if (m != ADARA && m != ADARB) return HebMonthNames[m];
|
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 GetValidHebDate(int yin, int min, int din, int adarbehave,
|
||||||
int *mout, int *dout, int jahr)
|
int *mout, int *dout, int jahr)
|
||||||
{
|
{
|
||||||
char *monlen;
|
char const *monlen;
|
||||||
int ylen;
|
int ylen;
|
||||||
|
|
||||||
*mout = min;
|
*mout = min;
|
||||||
@@ -448,7 +448,7 @@ int GetNextHebrewDate(int julstart, int hm, int hd,
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int ComputeJahr(int y, int m, int d, int *ans)
|
int ComputeJahr(int y, int m, int d, int *ans)
|
||||||
{
|
{
|
||||||
char *monlen;
|
char const *monlen;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
*ans = JAHR_NONE;
|
*ans = JAHR_NONE;
|
||||||
|
|||||||
42
src/init.c
42
src/init.c
@@ -12,6 +12,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#define L_IN_INIT 1
|
#define L_IN_INIT 1
|
||||||
@@ -28,7 +29,6 @@
|
|||||||
#include "protos.h"
|
#include "protos.h"
|
||||||
#include "expr.h"
|
#include "expr.h"
|
||||||
#include "err.h"
|
#include "err.h"
|
||||||
#include "version.h"
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
/***************************************************************
|
/***************************************************************
|
||||||
@@ -79,10 +79,10 @@ while (isdigit(*(s))) { \
|
|||||||
s++; \
|
s++; \
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ChgUser(char *u);
|
static void ChgUser(char const *u);
|
||||||
static void InitializeVar(char *str);
|
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;
|
static DynamicBuffer default_filename_buf;
|
||||||
|
|
||||||
@@ -94,9 +94,9 @@ static DynamicBuffer default_filename_buf;
|
|||||||
/* default filename. Use $DOTREMINDERS or $HOME/.reminders */
|
/* 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);
|
DBufInit(&default_filename_buf);
|
||||||
|
|
||||||
@@ -122,14 +122,14 @@ static char *DefaultFilename(void)
|
|||||||
/* Initialize the system - called only once at beginning! */
|
/* 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 i;
|
||||||
int y, m, d, rep;
|
int y, m, d, rep;
|
||||||
Token tok;
|
Token tok;
|
||||||
int InvokedAsRem = 0;
|
int InvokedAsRem = 0;
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
/* Initialize global dynamic buffers */
|
/* Initialize global dynamic buffers */
|
||||||
DBufInit(&Banner);
|
DBufInit(&Banner);
|
||||||
@@ -550,12 +550,15 @@ void Usage(void)
|
|||||||
/* USER environment variables. */
|
/* USER environment variables. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static void ChgUser(char *user)
|
static void ChgUser(char const *user)
|
||||||
{
|
{
|
||||||
uid_t myuid;
|
uid_t myuid;
|
||||||
|
|
||||||
struct passwd *pwent;
|
struct passwd *pwent;
|
||||||
static char *home, *shell, *username, *logname;
|
static char *home;
|
||||||
|
static char *shell;
|
||||||
|
static char *username;
|
||||||
|
static char *logname;
|
||||||
|
|
||||||
myuid = getuid();
|
myuid = getuid();
|
||||||
|
|
||||||
@@ -616,22 +619,29 @@ static void ChgUser(char *user)
|
|||||||
/* Initialize and preserve a variable */
|
/* 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;
|
Value val;
|
||||||
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
/* Scan for an '=' sign */
|
/* Scan for an '=' sign */
|
||||||
varname = str;
|
r = 0;
|
||||||
while (*str && *str != '=') str++;
|
while (*str && *str != '=') {
|
||||||
|
if (r < VAR_NAME_LEN) {
|
||||||
|
varname[r++] = *str;
|
||||||
|
}
|
||||||
|
str++;
|
||||||
|
}
|
||||||
|
varname[r] = 0;
|
||||||
if (!*str) {
|
if (!*str) {
|
||||||
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_EQ]);
|
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_EQ]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*str = 0;
|
|
||||||
if (!*varname) {
|
if (!*varname) {
|
||||||
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_VAR]);
|
fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_MISS_VAR]);
|
||||||
return;
|
return;
|
||||||
|
|||||||
28
src/main.c
28
src/main.c
@@ -62,9 +62,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Set up global vars */
|
/* Set up global vars */
|
||||||
ArgC = argc;
|
ArgC = argc;
|
||||||
ArgV = argv;
|
ArgV = (char const **) argv;
|
||||||
|
|
||||||
InitRemind(argc, argv);
|
InitRemind(argc, (char const **) argv);
|
||||||
if (DoCalendar || (DoSimpleCalendar && (!NextMode || PsCal))) {
|
if (DoCalendar || (DoSimpleCalendar && (!NextMode || PsCal))) {
|
||||||
ProduceCalendar();
|
ProduceCalendar();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -134,7 +134,7 @@ static void DoReminders(void)
|
|||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
Token tok;
|
Token tok;
|
||||||
char *s;
|
char const *s;
|
||||||
Parser p;
|
Parser p;
|
||||||
|
|
||||||
if (!UseStdin) {
|
if (!UseStdin) {
|
||||||
@@ -330,7 +330,7 @@ int ParseChar(ParsePtr p, int *err, int peek)
|
|||||||
return *(p->epos++);
|
return *(p->epos++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(p->etext); /* End of substituted expression */
|
free((void *) p->etext); /* End of substituted expression */
|
||||||
p->etext = NULL;
|
p->etext = NULL;
|
||||||
p->epos = NULL;
|
p->epos = NULL;
|
||||||
p->isnested = 0;
|
p->isnested = 0;
|
||||||
@@ -503,7 +503,7 @@ int EvaluateExpr(ParsePtr p, Value *v)
|
|||||||
/* Eprint - print an error message. */
|
/* Eprint - print an error message. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
void Eprint(const char *fmt, ...)
|
void Eprint(char const *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list argptr;
|
va_list argptr;
|
||||||
|
|
||||||
@@ -536,8 +536,8 @@ void Eprint(const char *fmt, ...)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
void OutputLine(FILE *fp)
|
void OutputLine(FILE *fp)
|
||||||
{
|
{
|
||||||
register char *s = CurLine;
|
char const *s = CurLine;
|
||||||
register char c = 0;
|
char c = 0;
|
||||||
|
|
||||||
while (*s) {
|
while (*s) {
|
||||||
if (*s == '\n') Putc('\\', fp);
|
if (*s == '\n') Putc('\\', fp);
|
||||||
@@ -554,7 +554,7 @@ void OutputLine(FILE *fp)
|
|||||||
/* Create a parser given a string buffer */
|
/* Create a parser given a string buffer */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
void CreateParser(char *s, ParsePtr p)
|
void CreateParser(char const *s, ParsePtr p)
|
||||||
{
|
{
|
||||||
p->text = s;
|
p->text = s;
|
||||||
p->pos = s;
|
p->pos = s;
|
||||||
@@ -576,7 +576,7 @@ void CreateParser(char *s, ParsePtr p)
|
|||||||
void DestroyParser(ParsePtr p)
|
void DestroyParser(ParsePtr p)
|
||||||
{
|
{
|
||||||
if (p->isnested && p->etext) {
|
if (p->isnested && p->etext) {
|
||||||
free(p->etext);
|
free((void *) p->etext);
|
||||||
p->etext = NULL;
|
p->etext = NULL;
|
||||||
p->isnested = 0;
|
p->isnested = 0;
|
||||||
}
|
}
|
||||||
@@ -589,10 +589,10 @@ void DestroyParser(ParsePtr p)
|
|||||||
/* on a per-parser basis. */
|
/* on a per-parser basis. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int PushToken(const char *tok, ParsePtr p)
|
int PushToken(char const *tok, ParsePtr p)
|
||||||
{
|
{
|
||||||
DBufFree(&p->pushedToken);
|
DBufFree(&p->pushedToken);
|
||||||
if (DBufPuts(&p->pushedToken, (char *) tok) != OK ||
|
if (DBufPuts(&p->pushedToken, tok) != OK ||
|
||||||
DBufPutc(&p->pushedToken, ' ') != OK) {
|
DBufPutc(&p->pushedToken, ' ') != OK) {
|
||||||
DBufFree(&p->pushedToken);
|
DBufFree(&p->pushedToken);
|
||||||
return E_NO_MEM;
|
return E_NO_MEM;
|
||||||
@@ -977,7 +977,7 @@ int DoErrMsg(ParsePtr p)
|
|||||||
TimeTrig tt;
|
TimeTrig tt;
|
||||||
Trigger t;
|
Trigger t;
|
||||||
int r;
|
int r;
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
DynamicBuffer buf;
|
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! */
|
/* A macro safe ONLY if used with arg with no side effects! */
|
||||||
#define ISBLANK(c) (isspace(c) && (c) != '\n')
|
#define ISBLANK(c) (isspace(c) && (c) != '\n')
|
||||||
|
|
||||||
void FillParagraph(char *s)
|
void FillParagraph(char const *s)
|
||||||
{
|
{
|
||||||
|
|
||||||
int line = 0;
|
int line = 0;
|
||||||
@@ -1087,7 +1087,7 @@ void FillParagraph(char *s)
|
|||||||
int doublespace = 1;
|
int doublespace = 1;
|
||||||
int pendspace;
|
int pendspace;
|
||||||
int len;
|
int len;
|
||||||
char *t;
|
char const *t;
|
||||||
|
|
||||||
int roomleft;
|
int roomleft;
|
||||||
|
|
||||||
|
|||||||
@@ -113,12 +113,12 @@ int PushOmitContext(ParsePtr p)
|
|||||||
|
|
||||||
context->numfull = NumFullOmits;
|
context->numfull = NumFullOmits;
|
||||||
context->numpart = NumPartialOmits;
|
context->numpart = NumPartialOmits;
|
||||||
context->fullsave = (int *) malloc(NumFullOmits * sizeof(int));
|
context->fullsave = malloc(NumFullOmits * sizeof(int));
|
||||||
if (NumFullOmits && !context->fullsave) {
|
if (NumFullOmits && !context->fullsave) {
|
||||||
free(context);
|
free(context);
|
||||||
return E_NO_MEM;
|
return E_NO_MEM;
|
||||||
}
|
}
|
||||||
context->partsave = (int *) malloc(NumPartialOmits * sizeof(int));
|
context->partsave = malloc(NumPartialOmits * sizeof(int));
|
||||||
if (NumPartialOmits && !context->partsave) {
|
if (NumPartialOmits && !context->partsave) {
|
||||||
free(context->fullsave);
|
free(context->fullsave);
|
||||||
free(context);
|
free(context);
|
||||||
|
|||||||
85
src/protos.h
85
src/protos.h
@@ -14,15 +14,15 @@
|
|||||||
#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
|
#define STRSET(x, str) { if (x) free(x); (x) = StrDup(str); }
|
||||||
|
|
||||||
/* Define a general malloc routine for creating pointers to objects */
|
/* 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"
|
#include "dynbuf.h"
|
||||||
|
|
||||||
int CallUserFunc (char *name, int nargs);
|
int CallUserFunc (char const *name, int nargs);
|
||||||
int DoFset (ParsePtr p);
|
int DoFset (ParsePtr p);
|
||||||
void ProduceCalendar (void);
|
void ProduceCalendar (void);
|
||||||
char *SimpleTime (int tim);
|
char const *SimpleTime (int tim);
|
||||||
char *CalendarTime (int tim, int duration);
|
char const *CalendarTime (int tim, int duration);
|
||||||
int DoRem (ParsePtr p);
|
int DoRem (ParsePtr p);
|
||||||
int DoFlush (ParsePtr p);
|
int DoFlush (ParsePtr p);
|
||||||
void DoExit (ParsePtr p);
|
void DoExit (ParsePtr p);
|
||||||
@@ -30,36 +30,35 @@ int ParseRem (ParsePtr s, Trigger *trig, TimeTrig *tim);
|
|||||||
int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int jul);
|
int TriggerReminder (ParsePtr p, Trigger *t, TimeTrig *tim, int jul);
|
||||||
int ShouldTriggerReminder (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 DoSubst (ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode);
|
||||||
int DoSubstFromString (char *source, DynamicBuffer *dbuf, int jul, int tim);
|
int DoSubstFromString (char const *source, DynamicBuffer *dbuf, int jul, int tim);
|
||||||
int EvalExpr (char **e, Value *v);
|
int EvalExpr (char const **e, Value *v);
|
||||||
int DoCoerce (char type, Value *v);
|
int DoCoerce (char type, Value *v);
|
||||||
void PrintValue (Value *v, FILE *fp);
|
void PrintValue (Value *v, FILE *fp);
|
||||||
int CopyValue (Value *dest, const Value *src);
|
int CopyValue (Value *dest, const Value *src);
|
||||||
int ReadLine (void);
|
int ReadLine (void);
|
||||||
int OpenFile (const char *fname);
|
int OpenFile (char const *fname);
|
||||||
int PopFile (void);
|
int PopFile (void);
|
||||||
int DoInclude (ParsePtr p);
|
int DoInclude (ParsePtr p);
|
||||||
int IncludeFile (const char *fname);
|
int IncludeFile (char const *fname);
|
||||||
int GetAccessDate (char *file);
|
int GetAccessDate (char const *file);
|
||||||
int SetAccessDate (char *fname, int jul);
|
int SetAccessDate (char const *fname, int jul);
|
||||||
int TopLevel (void);
|
int TopLevel (void);
|
||||||
int CallFunc (Operator *f, int nargs);
|
int CallFunc (Operator *f, int nargs);
|
||||||
void InitRemind (int argc, char *argv[]);
|
void InitRemind (int argc, char const *argv[]);
|
||||||
void Usage (void);
|
void Usage (void);
|
||||||
int main (int argc, char *argv[]);
|
|
||||||
int Julian (int year, int month, int day);
|
int Julian (int year, int month, int day);
|
||||||
void FromJulian (int jul, int *y, int *m, int *d);
|
void FromJulian (int jul, int *y, int *m, int *d);
|
||||||
int ParseChar (ParsePtr p, int *err, int peek);
|
int ParseChar (ParsePtr p, int *err, int peek);
|
||||||
int ParseToken (ParsePtr p, DynamicBuffer *dbuf);
|
int ParseToken (ParsePtr p, DynamicBuffer *dbuf);
|
||||||
int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf);
|
int ParseIdentifier (ParsePtr p, DynamicBuffer *dbuf);
|
||||||
int EvaluateExpr (ParsePtr p, Value *v);
|
int EvaluateExpr (ParsePtr p, Value *v);
|
||||||
int Evaluate (char **s, Var *locals);
|
int Evaluate (char const **s, Var *locals);
|
||||||
int FnPopValStack (Value *val);
|
int FnPopValStack (Value *val);
|
||||||
void Eprint (const char *fmt, ...);
|
void Eprint (char const *fmt, ...);
|
||||||
void OutputLine (FILE *fp);
|
void OutputLine (FILE *fp);
|
||||||
void CreateParser (char *s, ParsePtr p);
|
void CreateParser (char const *s, ParsePtr p);
|
||||||
void DestroyParser (ParsePtr p);
|
void DestroyParser (ParsePtr p);
|
||||||
int PushToken (const char *tok, ParsePtr p);
|
int PushToken (char const *tok, ParsePtr p);
|
||||||
long SystemTime (int realtime);
|
long SystemTime (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);
|
||||||
@@ -79,53 +78,53 @@ int PushOmitContext (ParsePtr p);
|
|||||||
int PopOmitContext (ParsePtr p);
|
int PopOmitContext (ParsePtr p);
|
||||||
int IsOmitted (int jul, int localomit);
|
int IsOmitted (int jul, int localomit);
|
||||||
int DoOmit (ParsePtr p);
|
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);
|
void HandleQueuedReminders (void);
|
||||||
char *FindInitialToken (Token *tok, char *s);
|
char const *FindInitialToken (Token *tok, char const *s);
|
||||||
void FindToken (const char *s, Token *tok);
|
void FindToken (char const *s, Token *tok);
|
||||||
void FindNumericToken (const char *s, Token *t);
|
void FindNumericToken (char const *s, Token *t);
|
||||||
int ComputeTrigger (int today, Trigger *trig, int *err);
|
int ComputeTrigger (int today, Trigger *trig, int *err);
|
||||||
char *StrnCpy (char *dest, const char *source, int n);
|
char *StrnCpy (char *dest, char const *source, int n);
|
||||||
int StrMatch (const char *s1, const char *s2, int n);
|
int StrMatch (char const *s1, char const *s2, int n);
|
||||||
int StrinCmp (const char *s1, const char *s2, int n);
|
int StrinCmp (char const *s1, char const *s2, int n);
|
||||||
char *StrDup (const char *s);
|
char *StrDup (char const *s);
|
||||||
int StrCmpi (const char *s1, const char *s2);
|
int StrCmpi (char const *s1, char const *s2);
|
||||||
Var *FindVar (const char *str, int create);
|
Var *FindVar (char const *str, int create);
|
||||||
int DeleteVar (const char *str);
|
int DeleteVar (char const *str);
|
||||||
int SetVar (const char *str, Value *val);
|
int SetVar (char const *str, Value *val);
|
||||||
int GetVarValue (const char *str, Value *val, Var *locals);
|
int GetVarValue (char const *str, Value *val, Var *locals);
|
||||||
int DoSet (Parser *p);
|
int DoSet (Parser *p);
|
||||||
int DoUnset (Parser *p);
|
int DoUnset (Parser *p);
|
||||||
int DoDump (ParsePtr p);
|
int DoDump (ParsePtr p);
|
||||||
void DumpVarTable (void);
|
void DumpVarTable (void);
|
||||||
void DestroyVars (int all);
|
void DestroyVars (int all);
|
||||||
int PreserveVar (char *name);
|
int PreserveVar (char const *name);
|
||||||
int DoPreserve (Parser *p);
|
int DoPreserve (Parser *p);
|
||||||
int DoSatRemind (Trigger *trig, TimeTrig *tim, ParsePtr 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);
|
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);
|
int DateOK (int y, int m, int d);
|
||||||
Operator *FindFunc (char *name, Operator where[], int num);
|
Operator *FindFunc (char const *name, Operator where[], int num);
|
||||||
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);
|
||||||
void IssueSortedReminders (void);
|
void IssueSortedReminders (void);
|
||||||
int UserFuncExists (char *fn);
|
int UserFuncExists (char const *fn);
|
||||||
void JulToHeb (int jul, int *hy, int *hm, int *hd);
|
void JulToHeb (int jul, int *hy, int *hm, int *hd);
|
||||||
int HebNameToNum (const char *mname);
|
int HebNameToNum (char const *mname);
|
||||||
char *HebMonthName (int m, int y);
|
char const *HebMonthName (int m, int y);
|
||||||
int RoshHashana (int i);
|
int RoshHashana (int i);
|
||||||
long DaysToHebYear (int y);
|
long DaysToHebYear (int y);
|
||||||
int DaysInHebYear (int y);
|
int DaysInHebYear (int y);
|
||||||
char *DaysInHebMonths (int ylen);
|
char const *DaysInHebMonths (int ylen);
|
||||||
int HebToJul (int hy, int hm, int hd);
|
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 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 GetNextHebrewDate (int julstart, int hm, int hd, int yahr, int adarbehave, int *ans);
|
||||||
int ComputeJahr (int y, int m, int d, int *ans);
|
int ComputeJahr (int y, int m, int d, int *ans);
|
||||||
int GetSysVar (const char *name, Value *val);
|
int GetSysVar (char const *name, Value *val);
|
||||||
int SetSysVar (const char *name, Value *val);
|
int SetSysVar (char const *name, Value *val);
|
||||||
void DumpSysVarByName (const char *name);
|
void DumpSysVarByName (char const *name);
|
||||||
int CalcMinsFromUTC (int jul, int tim, int *mins, int *isdst);
|
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 LocalToUTC (int locdate, int loctime, int *utcdate, int *utctime);
|
||||||
void UTCToLocal (int utcdate, int utctime, int *locdate, int *loctime);
|
void UTCToLocal (int utcdate, int utctime, int *locdate, int *loctime);
|
||||||
int MoonPhase (int date, int time);
|
int MoonPhase (int date, int time);
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ typedef struct queuedrem {
|
|||||||
int typ;
|
int typ;
|
||||||
int RunDisabled;
|
int RunDisabled;
|
||||||
int ntrig;
|
int ntrig;
|
||||||
char *text;
|
char const *text;
|
||||||
char passthru[PASSTHRU_LEN+1];
|
char passthru[PASSTHRU_LEN+1];
|
||||||
char sched[VAR_NAME_LEN+1];
|
char sched[VAR_NAME_LEN+1];
|
||||||
char tag[TAG_LEN+1];
|
char tag[TAG_LEN+1];
|
||||||
@@ -69,7 +69,7 @@ static void reread (void);
|
|||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int QueueReminder(ParsePtr p, Trigger *trig,
|
int QueueReminder(ParsePtr p, Trigger *trig,
|
||||||
TimeTrig *tim, const char *sched)
|
TimeTrig *tim, char const *sched)
|
||||||
{
|
{
|
||||||
QueuedRem *qelem;
|
QueuedRem *qelem;
|
||||||
|
|
||||||
@@ -396,7 +396,7 @@ static int CalculateNextTimeUsingSched(QueuedRem *q)
|
|||||||
/* Use LineBuffer for temp. string storage. */
|
/* Use LineBuffer for temp. string storage. */
|
||||||
int r;
|
int r;
|
||||||
Value v;
|
Value v;
|
||||||
char *s;
|
char const *s;
|
||||||
int LastTime = -1;
|
int LastTime = -1;
|
||||||
int ThisTime;
|
int ThisTime;
|
||||||
|
|
||||||
@@ -517,6 +517,6 @@ static void DaemonWait(unsigned int sleeptime)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static void reread(void)
|
static void reread(void)
|
||||||
{
|
{
|
||||||
execvp(ArgV[0], ArgV);
|
execvp(ArgV[0], (char **) ArgV);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
59
src/rem2ps.c
59
src/rem2ps.c
@@ -10,6 +10,7 @@
|
|||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "dynbuf.h"
|
#include "dynbuf.h"
|
||||||
|
|
||||||
@@ -20,9 +21,8 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "rem2ps.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_NORMAL 0
|
||||||
#define SPECIAL_POSTSCRIPT 1
|
#define SPECIAL_POSTSCRIPT 1
|
||||||
@@ -38,13 +38,13 @@ typedef struct calentry {
|
|||||||
} CalEntry;
|
} CalEntry;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char const *name;
|
||||||
int xsize, ysize;
|
int xsize, ysize;
|
||||||
} PageType;
|
} PageType;
|
||||||
|
|
||||||
char DayName[7][33];
|
char DayName[7][33];
|
||||||
|
|
||||||
char *SmallCalLoc[] = {
|
char const *SmallCalLoc[] = {
|
||||||
"",
|
"",
|
||||||
"bt",
|
"bt",
|
||||||
"tb",
|
"tb",
|
||||||
@@ -52,7 +52,7 @@ char *SmallCalLoc[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define NUMSMALL (sizeof(SmallCalLoc)/sizeof(SmallCalLoc[0]))
|
#define NUMSMALL (sizeof(SmallCalLoc)/sizeof(SmallCalLoc[0]))
|
||||||
char *SmallLocation;
|
char const *SmallLocation;
|
||||||
int SmallCol1, SmallCol2;
|
int SmallCol1, SmallCol2;
|
||||||
|
|
||||||
PageType Pages[] =
|
PageType Pages[] =
|
||||||
@@ -88,20 +88,20 @@ char PortraitMode;
|
|||||||
char NoSmallCal;
|
char NoSmallCal;
|
||||||
char UseISO;
|
char UseISO;
|
||||||
|
|
||||||
char *HeadFont="Helvetica";
|
char const *HeadFont="Helvetica";
|
||||||
char *TitleFont="Helvetica";
|
char const *TitleFont="Helvetica";
|
||||||
char *DayFont="Helvetica-BoldOblique";
|
char const *DayFont="Helvetica-BoldOblique";
|
||||||
char *EntryFont="Helvetica";
|
char const *EntryFont="Helvetica";
|
||||||
char *SmallFont="Helvetica";
|
char const *SmallFont="Helvetica";
|
||||||
char *LineWidth = "1";
|
char const *LineWidth = "1";
|
||||||
|
|
||||||
char *HeadSize="14";
|
char const *HeadSize="14";
|
||||||
char *TitleSize="14";
|
char const *TitleSize="14";
|
||||||
char *DaySize="14";
|
char const *DaySize="14";
|
||||||
char *EntrySize="8";
|
char const *EntrySize="8";
|
||||||
char *BorderSize = "6";
|
char const *BorderSize = "6";
|
||||||
|
|
||||||
char *UserProlog = NULL;
|
char const *UserProlog = NULL;
|
||||||
|
|
||||||
int validfile = 0;
|
int validfile = 0;
|
||||||
|
|
||||||
@@ -116,15 +116,15 @@ int FillPage;
|
|||||||
int Verbose = 0;
|
int Verbose = 0;
|
||||||
|
|
||||||
void Init (int argc, char *argv[]);
|
void Init (int argc, char *argv[]);
|
||||||
void Usage (char *s);
|
void Usage (char const *s);
|
||||||
void DoPsCal (void);
|
void DoPsCal (void);
|
||||||
int DoQueuedPs (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 WriteProlog (void);
|
||||||
void WriteCalEntry (void);
|
void WriteCalEntry (void);
|
||||||
void WriteOneEntry (CalEntry *c);
|
void WriteOneEntry (CalEntry *c);
|
||||||
void GetSmallLocations (void);
|
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 i;
|
||||||
int is_ps;
|
int is_ps;
|
||||||
int firstcol;
|
int firstcol;
|
||||||
char *startOfBody;
|
char const *startOfBody;
|
||||||
char passthru[PASSTHRU_LEN+1];
|
char passthru[PASSTHRU_LEN+1];
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
CalEntry *c, *d;
|
CalEntry *c, *d;
|
||||||
@@ -388,7 +388,7 @@ void WriteProlog(void)
|
|||||||
int i;
|
int i;
|
||||||
int x = CurPage->xsize;
|
int x = CurPage->xsize;
|
||||||
int y = CurPage->ysize;
|
int y = CurPage->ysize;
|
||||||
char *isostuff;
|
char const *isostuff;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int nread;
|
int nread;
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
@@ -574,7 +574,7 @@ void WriteCalEntry(void)
|
|||||||
void WriteOneEntry(CalEntry *c)
|
void WriteOneEntry(CalEntry *c)
|
||||||
{
|
{
|
||||||
int ch, i;
|
int ch, i;
|
||||||
char *s = c->entry;
|
char const *s = c->entry;
|
||||||
|
|
||||||
printf(" [");
|
printf(" [");
|
||||||
|
|
||||||
@@ -635,7 +635,8 @@ void WriteOneEntry(CalEntry *c)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
void Init(int argc, char *argv[])
|
void Init(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
char *s, *t;
|
char const *s;
|
||||||
|
char const *t;
|
||||||
int i=1;
|
int i=1;
|
||||||
int j;
|
int j;
|
||||||
int offset;
|
int offset;
|
||||||
@@ -791,7 +792,7 @@ void Init(int argc, char *argv[])
|
|||||||
/* Usage - print usage information */
|
/* Usage - print usage information */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
void Usage(char *s)
|
void Usage(char const *s)
|
||||||
{
|
{
|
||||||
if (s) fprintf(stderr, "Rem2PS: %s\n\n", s);
|
if (s) fprintf(stderr, "Rem2PS: %s\n\n", s);
|
||||||
|
|
||||||
@@ -820,7 +821,7 @@ void Usage(char *s)
|
|||||||
/* month. */
|
/* 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 */
|
/* Do the small calendar */
|
||||||
int i, j;
|
int i, j;
|
||||||
@@ -885,7 +886,7 @@ int DoQueuedPs(void)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
int fnoff;
|
int fnoff;
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
char *size, *extra;
|
char const *size, *extra;
|
||||||
int num, r, g, b, phase, fontsize, moonsize;
|
int num, r, g, b, phase, fontsize, moonsize;
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
|
|
||||||
@@ -1060,7 +1061,7 @@ int DoQueuedPs(void)
|
|||||||
void GetSmallLocations(void)
|
void GetSmallLocations(void)
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
char *s = SmallLocation;
|
char const *s = SmallLocation;
|
||||||
int colfirst, collast;
|
int colfirst, collast;
|
||||||
|
|
||||||
/* Figure out the first and last columns */
|
/* Figure out the first and last columns */
|
||||||
@@ -1122,7 +1123,7 @@ void GetSmallLocations(void)
|
|||||||
/* Read a space-delimited token into an output buffer. */
|
/* 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;
|
int i = 0;
|
||||||
|
|
||||||
|
|||||||
12
src/sort.c
12
src/sort.c
@@ -25,7 +25,7 @@
|
|||||||
/* The structure of a sorted entry */
|
/* The structure of a sorted entry */
|
||||||
typedef struct sortrem {
|
typedef struct sortrem {
|
||||||
struct sortrem *next;
|
struct sortrem *next;
|
||||||
char *text;
|
char const *text;
|
||||||
int trigdate;
|
int trigdate;
|
||||||
int trigtime;
|
int trigtime;
|
||||||
int typ;
|
int typ;
|
||||||
@@ -35,7 +35,7 @@ typedef struct sortrem {
|
|||||||
/* The sorted reminder queue */
|
/* The sorted reminder queue */
|
||||||
static Sortrem *SortedQueue = (Sortrem *) NULL;
|
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);
|
static void IssueSortBanner (int jul);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
@@ -45,7 +45,7 @@ static void IssueSortBanner (int jul);
|
|||||||
/* Create a new Sortrem entry - return NULL on failure. */
|
/* 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);
|
Sortrem *new = NEW(Sortrem);
|
||||||
if (!new) return NULL;
|
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 */
|
/* 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 *new = MakeSortRem(jul, tim, body, typ, prio);
|
||||||
Sortrem *cur = SortedQueue, *prev = NULL;
|
Sortrem *cur = SortedQueue, *prev = NULL;
|
||||||
@@ -154,7 +154,7 @@ void IssueSortedReminders(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(cur->text);
|
free((char *) cur->text);
|
||||||
free(cur);
|
free(cur);
|
||||||
cur = next;
|
cur = next;
|
||||||
}
|
}
|
||||||
@@ -173,7 +173,7 @@ static void IssueSortBanner(int jul)
|
|||||||
char BanExpr[64];
|
char BanExpr[64];
|
||||||
int y, m, d;
|
int y, m, d;
|
||||||
Value v;
|
Value v;
|
||||||
char *s = BanExpr;
|
char const *s = BanExpr;
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
|
|
||||||
if (UserFuncExists("sortbanner") != 1) return;
|
if (UserFuncExists("sortbanner") != 1) return;
|
||||||
|
|||||||
12
src/token.c
12
src/token.c
@@ -128,7 +128,7 @@ Token NonEnglishToks[] = {
|
|||||||
};
|
};
|
||||||
#endif
|
#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. */
|
/* left square bracket, return a T_Illegal type. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
char *FindInitialToken(Token *tok, char *s)
|
char const *FindInitialToken(Token *tok, char const *s)
|
||||||
{
|
{
|
||||||
DynamicBuffer buf;
|
DynamicBuffer buf;
|
||||||
DBufInit(&buf);
|
DBufInit(&buf);
|
||||||
@@ -165,7 +165,7 @@ char *FindInitialToken(Token *tok, char *s)
|
|||||||
/* Given a string, which token is it? */
|
/* 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 top, bot, mid, r, max;
|
||||||
int l;
|
int l;
|
||||||
@@ -252,7 +252,7 @@ void FindToken(const char *s, Token *tok)
|
|||||||
/* Rep - *n */
|
/* Rep - *n */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
void FindNumericToken(const char *s, Token *t)
|
void FindNumericToken(char const *s, Token *t)
|
||||||
{
|
{
|
||||||
int mult = 1, hour, min;
|
int mult = 1, hour, min;
|
||||||
|
|
||||||
@@ -335,10 +335,10 @@ void FindNumericToken(const char *s, Token *t)
|
|||||||
/* Compare a token to a string. */
|
/* 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;
|
register int r;
|
||||||
char *tk = t->name;
|
char const *tk = t->name;
|
||||||
while(*tk && *s && !(*s == ',' && *(s+1) == 0)) {
|
while(*tk && *s && !(*s == ',' && *(s+1) == 0)) {
|
||||||
r = *tk - tolower(*s);
|
r = *tk - tolower(*s);
|
||||||
tk++;
|
tk++;
|
||||||
|
|||||||
@@ -419,6 +419,14 @@ int ComputeTrigger(int today, Trigger *trig, int *err)
|
|||||||
}
|
}
|
||||||
return -1;
|
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.*/
|
/* Keep scanning... unless there's no point in doing it.*/
|
||||||
if (nextstart <= start) {
|
if (nextstart <= start) {
|
||||||
if (result != -1) {
|
if (result != -1) {
|
||||||
|
|||||||
12
src/types.h
12
src/types.h
@@ -24,7 +24,7 @@ typedef struct {
|
|||||||
|
|
||||||
/* Define the type of operators */
|
/* Define the type of operators */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char const *name;
|
||||||
char prec;
|
char prec;
|
||||||
char type;
|
char type;
|
||||||
int (*func)(void);
|
int (*func)(void);
|
||||||
@@ -73,12 +73,12 @@ typedef struct {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
char isnested; /* Is it a nested expression? */
|
char isnested; /* Is it a nested expression? */
|
||||||
char allownested;
|
char allownested;
|
||||||
char *text; /* Start of text */
|
char const *text; /* Start of text */
|
||||||
char *pos; /* Current position */
|
char const *pos; /* Current position */
|
||||||
char *etext; /* Substituted text */
|
char const *etext; /* Substituted text */
|
||||||
char *epos; /* Position in substituted text */
|
char const *epos; /* Position in substituted text */
|
||||||
DynamicBuffer pushedToken; /* Pushed-back token */
|
DynamicBuffer pushedToken; /* Pushed-back token */
|
||||||
char *tokenPushed; /* NULL if no pushed-back token */
|
char const *tokenPushed; /* NULL if no pushed-back token */
|
||||||
} Parser;
|
} Parser;
|
||||||
|
|
||||||
typedef Parser *ParsePtr; /* Pointer to parser structure */
|
typedef Parser *ParsePtr; /* Pointer to parser structure */
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
typedef struct udf_struct {
|
typedef struct udf_struct {
|
||||||
struct udf_struct *next;
|
struct udf_struct *next;
|
||||||
char name[VAR_NAME_LEN+1];
|
char name[VAR_NAME_LEN+1];
|
||||||
char *text;
|
char const *text;
|
||||||
Var *locals;
|
Var *locals;
|
||||||
char IsActive;
|
char IsActive;
|
||||||
int nargs;
|
int nargs;
|
||||||
@@ -47,7 +47,7 @@ extern Value ValStack[];
|
|||||||
extern int ValStackPtr;
|
extern int ValStackPtr;
|
||||||
|
|
||||||
static void DestroyUserFunc (UserFunc *f);
|
static void DestroyUserFunc (UserFunc *f);
|
||||||
static void FUnset (char *name);
|
static void FUnset (char const *name);
|
||||||
static void FSet (UserFunc *f);
|
static void FSet (UserFunc *f);
|
||||||
static int SetUpLocalVars (UserFunc *f);
|
static int SetUpLocalVars (UserFunc *f);
|
||||||
static void DestroyLocalVals (UserFunc *f);
|
static void DestroyLocalVals (UserFunc *f);
|
||||||
@@ -184,7 +184,7 @@ static void DestroyUserFunc(UserFunc *f)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Free the function definition */
|
/* Free the function definition */
|
||||||
if (f->text) free(f->text);
|
if (f->text) free( (char *) f->text);
|
||||||
|
|
||||||
/* Free the data structure itself */
|
/* Free the data structure itself */
|
||||||
free(f);
|
free(f);
|
||||||
@@ -198,7 +198,7 @@ static void DestroyUserFunc(UserFunc *f)
|
|||||||
/* it exists. */
|
/* it exists. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static void FUnset(char *name)
|
static void FUnset(char const *name)
|
||||||
{
|
{
|
||||||
UserFunc *cur, *prev;
|
UserFunc *cur, *prev;
|
||||||
int h;
|
int h;
|
||||||
@@ -238,12 +238,12 @@ static void FSet(UserFunc *f)
|
|||||||
/* Call a user-defined function. */
|
/* Call a user-defined function. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int CallUserFunc(char *name, int nargs)
|
int CallUserFunc(char const *name, int nargs)
|
||||||
{
|
{
|
||||||
UserFunc *f;
|
UserFunc *f;
|
||||||
int h = HashVal(name) % FUNC_HASH_SIZE;
|
int h = HashVal(name) % FUNC_HASH_SIZE;
|
||||||
int i;
|
int i;
|
||||||
char *s;
|
char const *s;
|
||||||
|
|
||||||
/* Search for the function */
|
/* Search for the function */
|
||||||
f = FuncHash[h];
|
f = FuncHash[h];
|
||||||
@@ -356,7 +356,7 @@ static void DestroyLocalVals(UserFunc *f)
|
|||||||
/* it is defined, or -1 if it is not defined. */
|
/* it is defined, or -1 if it is not defined. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int UserFuncExists(char *fn)
|
int UserFuncExists(char const *fn)
|
||||||
{
|
{
|
||||||
UserFunc *f;
|
UserFunc *f;
|
||||||
int h = HashVal(fn) % FUNC_HASH_SIZE;
|
int h = HashVal(fn) % FUNC_HASH_SIZE;
|
||||||
|
|||||||
16
src/utils.c
16
src/utils.c
@@ -30,9 +30,9 @@
|
|||||||
/* Just like strncpy EXCEPT we ALWAYS copy the trailing 0. */
|
/* 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++)) ;
|
while (n-- && (*dest++ = *source++)) ;
|
||||||
if (*(dest-1)) *dest = 0;
|
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. */
|
/* 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;
|
int l;
|
||||||
if ((l = strlen(s1)) < n) return 0;
|
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 */
|
/* 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;
|
register int r;
|
||||||
while (n && *s1 && *s2) {
|
while (n && *s1 && *s2) {
|
||||||
@@ -80,10 +80,10 @@ int StrinCmp(const char *s1, const char *s2, int n)
|
|||||||
/* Like ANSI strdup */
|
/* Like ANSI strdup */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
char *StrDup(const char *s)
|
char *StrDup(char const *s)
|
||||||
{
|
{
|
||||||
char *ret = (char *) malloc(strlen(s)+1);
|
char *ret = malloc(strlen(s)+1);
|
||||||
if (!ret) return (char *) NULL;
|
if (!ret) return NULL;
|
||||||
strcpy(ret, s);
|
strcpy(ret, s);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ char *StrDup(const char *s)
|
|||||||
/* Compare strings, case insensitive. */
|
/* Compare strings, case insensitive. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int StrCmpi(const char *s1, const char *s2)
|
int StrCmpi(char const *s1, char const *s2)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
while (*s1 && *s2) {
|
while (*s1 && *s2) {
|
||||||
|
|||||||
30
src/var.c
30
src/var.c
@@ -80,7 +80,7 @@ static int time_sep_func(int do_set, Value *val)
|
|||||||
/* Given a string, compute the hash value. */
|
/* 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 i=0;
|
||||||
register unsigned int j=1;
|
register unsigned int j=1;
|
||||||
@@ -102,7 +102,7 @@ unsigned int HashVal(const char *str)
|
|||||||
/* string. If create is 1, create the variable. */
|
/* 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 int h;
|
||||||
register Var *v;
|
register Var *v;
|
||||||
@@ -139,7 +139,7 @@ Var *FindVar(const char *str, int create)
|
|||||||
/* string and delete it. */
|
/* string and delete it. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int DeleteVar(const char *str)
|
int DeleteVar(char const *str)
|
||||||
{
|
{
|
||||||
register int h;
|
register int h;
|
||||||
register Var *v;
|
register Var *v;
|
||||||
@@ -168,7 +168,7 @@ int DeleteVar(const char *str)
|
|||||||
/* Set the indicate variable to the specified value. */
|
/* 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);
|
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. */
|
/* 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;
|
Var *v;
|
||||||
|
|
||||||
@@ -383,7 +383,7 @@ void DestroyVars(int all)
|
|||||||
/* Given the name of a variable, "preserve" it. */
|
/* Given the name of a variable, "preserve" it. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
int PreserveVar(char *name)
|
int PreserveVar(char const *name)
|
||||||
{
|
{
|
||||||
Var *v;
|
Var *v;
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ int DoPreserve (Parser *p)
|
|||||||
|
|
||||||
/* The structure of a system variable */
|
/* The structure of a system variable */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *name;
|
char const *name;
|
||||||
char modifiable;
|
char modifiable;
|
||||||
int type;
|
int type;
|
||||||
void *value;
|
void *value;
|
||||||
@@ -498,8 +498,8 @@ static SysVar SysVarArr[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
|
#define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
|
||||||
static SysVar *FindSysVar (const char *name);
|
static SysVar *FindSysVar (char const *name);
|
||||||
static void DumpSysVar (const char *name, const SysVar *v);
|
static void DumpSysVar (char const *name, const SysVar *v);
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
/* */
|
/* */
|
||||||
/* SetSysVar */
|
/* SetSysVar */
|
||||||
@@ -507,7 +507,7 @@ static void DumpSysVar (const char *name, const SysVar *v);
|
|||||||
/* Set a system variable to the indicated value. */
|
/* 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);
|
SysVar *v = FindSysVar(name);
|
||||||
if (!v) return E_NOSUCH_VAR;
|
if (!v) return E_NOSUCH_VAR;
|
||||||
@@ -542,7 +542,7 @@ int SetSysVar(const char *name, Value *value)
|
|||||||
/* Get the value of a system variable */
|
/* 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);
|
SysVar *v = FindSysVar(name);
|
||||||
|
|
||||||
@@ -577,7 +577,7 @@ int GetSysVar(const char *name, Value *val)
|
|||||||
/* Find a system var with specified name. */
|
/* 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 top=NUMSYSVARS-1, bottom=0;
|
||||||
int mid=(top + bottom) / 2;
|
int mid=(top + bottom) / 2;
|
||||||
@@ -601,7 +601,7 @@ static SysVar *FindSysVar(const char *name)
|
|||||||
/* If name is "", dump all system variables. */
|
/* If name is "", dump all system variables. */
|
||||||
/* */
|
/* */
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
void DumpSysVarByName(const char *name)
|
void DumpSysVarByName(char const *name)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
SysVar *v;
|
SysVar *v;
|
||||||
@@ -623,7 +623,7 @@ void DumpSysVarByName(const char *name)
|
|||||||
/* Dump the system variable. */
|
/* 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];
|
char buffer[VAR_NAME_LEN+10];
|
||||||
|
|
||||||
@@ -643,7 +643,7 @@ static void DumpSysVar(const char *name, const SysVar *v)
|
|||||||
}
|
}
|
||||||
DestroyValue(val);
|
DestroyValue(val);
|
||||||
} else if (v->type == STR_TYPE) {
|
} else if (v->type == STR_TYPE) {
|
||||||
char *s = *((char **)v->value);
|
char const *s = *((char **)v->value);
|
||||||
int y;
|
int y;
|
||||||
Putc('"', ErrFp);
|
Putc('"', ErrFp);
|
||||||
for (y=0; y<MAX_PRT_LEN && *s; y++) {
|
for (y=0; y<MAX_PRT_LEN && *s; y++) {
|
||||||
|
|||||||
@@ -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
1
src/version.h.in
Normal file
@@ -0,0 +1 @@
|
|||||||
|
#define VERSION "@VERSION@"
|
||||||
@@ -638,7 +638,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.01.03"
|
version() => "03.01.04"
|
||||||
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"
|
||||||
@@ -779,7 +779,7 @@ dump
|
|||||||
a048 "foo"
|
a048 "foo"
|
||||||
a067 "INT"
|
a067 "INT"
|
||||||
a039 "February"
|
a039 "February"
|
||||||
a058 "03.01.03"
|
a058 "03.01.04"
|
||||||
a077 "1992 92
|
a077 "1992 92
|
||||||
"
|
"
|
||||||
a049 21
|
a049 21
|
||||||
@@ -858,6 +858,7 @@ September 30
|
|||||||
2007/08/05 * * * * 3 NonOmit-2
|
2007/08/05 * * * * 3 NonOmit-2
|
||||||
2007/08/06 * * * * 5 NonOmit-1
|
2007/08/06 * * * * 5 NonOmit-1
|
||||||
2007/08/06 * * * * 3 NonOmit-2
|
2007/08/06 * * * * 3 NonOmit-2
|
||||||
|
2007/08/06 * * * * Blort
|
||||||
2007/08/07 * * * * 6 NonOmit-1
|
2007/08/07 * * * * 6 NonOmit-1
|
||||||
2007/08/07 * * * * 4 NonOmit-2
|
2007/08/07 * * * * 4 NonOmit-2
|
||||||
2007/08/08 COLOR * * * 0 0 255 Blue Wednesday
|
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 COLOR * * 825 6 7 8 1:45pm Mooo!
|
||||||
2007/08/20 * * * * 18 NonOmit-1
|
2007/08/20 * * * * 18 NonOmit-1
|
||||||
2007/08/20 * * * * 12 NonOmit-2
|
2007/08/20 * * * * 12 NonOmit-2
|
||||||
|
2007/08/20 * * * * Blort
|
||||||
2007/08/21 PostScript * * 115 (wookie) show
|
2007/08/21 PostScript * * 115 (wookie) show
|
||||||
2007/08/21 * * * * 19 NonOmit-1
|
2007/08/21 * * * * 19 NonOmit-1
|
||||||
2007/08/21 * * * * 13 NonOmit-2
|
2007/08/21 * * * * 13 NonOmit-2
|
||||||
@@ -915,6 +917,7 @@ September 30
|
|||||||
2007/08/26 * * * * 17 NonOmit-2
|
2007/08/26 * * * * 17 NonOmit-2
|
||||||
2007/08/27 * * * * 25 NonOmit-1
|
2007/08/27 * * * * 25 NonOmit-1
|
||||||
2007/08/27 * * * * 17 NonOmit-2
|
2007/08/27 * * * * 17 NonOmit-2
|
||||||
|
2007/08/27 * * * * Blort
|
||||||
2007/08/28 * * * * 26 NonOmit-1
|
2007/08/28 * * * * 26 NonOmit-1
|
||||||
2007/08/28 * * * * 18 NonOmit-2
|
2007/08/28 * * * * 18 NonOmit-2
|
||||||
2007/08/29 COLOR * * * 0 0 255 Blue Wednesday
|
2007/08/29 COLOR * * * 0 0 255 Blue Wednesday
|
||||||
@@ -944,6 +947,7 @@ Test 3
|
|||||||
2007/08/05 * * * * 3 NonOmit-2
|
2007/08/05 * * * * 3 NonOmit-2
|
||||||
2007/08/06 * * * * 5 NonOmit-1
|
2007/08/06 * * * * 5 NonOmit-1
|
||||||
2007/08/06 * * * * 3 NonOmit-2
|
2007/08/06 * * * * 3 NonOmit-2
|
||||||
|
2007/08/06 * * * * Blort
|
||||||
2007/08/07 * * * * 6 NonOmit-1
|
2007/08/07 * * * * 6 NonOmit-1
|
||||||
2007/08/07 * * * * 4 NonOmit-2
|
2007/08/07 * * * * 4 NonOmit-2
|
||||||
2007/08/08 COLOR * * * 0 0 255 Blue Wednesday
|
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 COLOR * * 825 6 7 8 1:45pm Mooo!
|
||||||
2007/08/20 * * * * 18 NonOmit-1
|
2007/08/20 * * * * 18 NonOmit-1
|
||||||
2007/08/20 * * * * 12 NonOmit-2
|
2007/08/20 * * * * 12 NonOmit-2
|
||||||
|
2007/08/20 * * * * Blort
|
||||||
2007/08/21 * * * * 19 NonOmit-1
|
2007/08/21 * * * * 19 NonOmit-1
|
||||||
2007/08/21 * * * * 13 NonOmit-2
|
2007/08/21 * * * * 13 NonOmit-2
|
||||||
2007/08/22 COLOR * * * 0 0 255 Blue Wednesday
|
2007/08/22 COLOR * * * 0 0 255 Blue Wednesday
|
||||||
@@ -993,6 +998,7 @@ Test 3
|
|||||||
2007/08/26 * * * * 17 NonOmit-2
|
2007/08/26 * * * * 17 NonOmit-2
|
||||||
2007/08/27 * * * * 25 NonOmit-1
|
2007/08/27 * * * * 25 NonOmit-1
|
||||||
2007/08/27 * * * * 17 NonOmit-2
|
2007/08/27 * * * * 17 NonOmit-2
|
||||||
|
2007/08/27 * * * * Blort
|
||||||
2007/08/28 * * * * 26 NonOmit-1
|
2007/08/28 * * * * 26 NonOmit-1
|
||||||
2007/08/28 * * * * 18 NonOmit-2
|
2007/08/28 * * * * 18 NonOmit-2
|
||||||
2007/08/29 COLOR * * * 0 0 255 Blue Wednesday
|
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 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
|
||||||
2007/08/06 * * * * 5 NonOmit-1
|
2007/08/06 * * * * 5 NonOmit-1
|
||||||
2007/08/06 * * * * 3 NonOmit-2
|
2007/08/06 * * * * 3 NonOmit-2
|
||||||
|
2007/08/06 * * * * Blort
|
||||||
2007/08/07 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
|
2007/08/07 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
|
||||||
2007/08/07 * * * * 6 NonOmit-1
|
2007/08/07 * * * * 6 NonOmit-1
|
||||||
2007/08/07 * * * * 4 NonOmit-2
|
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 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
|
||||||
2007/08/20 * * * * 18 NonOmit-1
|
2007/08/20 * * * * 18 NonOmit-1
|
||||||
2007/08/20 * * * * 12 NonOmit-2
|
2007/08/20 * * * * 12 NonOmit-2
|
||||||
|
2007/08/20 * * * * Blort
|
||||||
2007/08/21 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
|
2007/08/21 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
|
||||||
2007/08/21 * * * * 19 NonOmit-1
|
2007/08/21 * * * * 19 NonOmit-1
|
||||||
2007/08/21 * * * * 13 NonOmit-2
|
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 COLOR * * * 0 0 255 Blue Wednesday is in 2 days' time
|
||||||
2007/08/27 * * * * 25 NonOmit-1
|
2007/08/27 * * * * 25 NonOmit-1
|
||||||
2007/08/27 * * * * 17 NonOmit-2
|
2007/08/27 * * * * 17 NonOmit-2
|
||||||
|
2007/08/27 * * * * Blort
|
||||||
2007/08/28 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
|
2007/08/28 COLOR * * * 0 0 255 Blue Wednesday is tomorrow
|
||||||
2007/08/28 * * * * 26 NonOmit-1
|
2007/08/28 * * * * 26 NonOmit-1
|
||||||
2007/08/28 * * * * 18 NonOmit-2
|
2007/08/28 * * * * 18 NonOmit-2
|
||||||
|
|||||||
@@ -38,3 +38,6 @@ REM 22 AUG SPECIAL PostScript (cabbage) show
|
|||||||
REM 23 AUG AT 16:44 SPECIAL blort snoo glup
|
REM 23 AUG AT 16:44 SPECIAL blort snoo glup
|
||||||
REM 24 AUG SPECIAL blort gulp wookie
|
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
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo "Unconfiguring Remind..."
|
echo "Unconfiguring Remind..."
|
||||||
echo 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
|
rm -f config.cache config.log config.status src/Makefile src/config.h src/version.h
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
29
www/rem2html
29
www/rem2html
@@ -400,7 +400,7 @@ sub output_calendar
|
|||||||
$col++;
|
$col++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($last_col == 6) {
|
if ($last_col == 6 && $first_col > 0) {
|
||||||
small_calendar($Nextmon, $Nextlen, $Options{'forwurl'},
|
small_calendar($Nextmon, $Nextlen, $Options{'forwurl'},
|
||||||
($Firstwkday + $Numdays) % 7);
|
($Firstwkday + $Numdays) % 7);
|
||||||
$col++;
|
$col++;
|
||||||
@@ -451,6 +451,22 @@ sub output_calendar
|
|||||||
print "</tr>\n";
|
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> </td>\n");
|
||||||
|
}
|
||||||
|
small_calendar($Nextmon, $Nextlen, $Options{'forwurl'},
|
||||||
|
($Firstwkday + $Numdays) % 7);
|
||||||
|
print("</tr>\n");
|
||||||
|
}
|
||||||
# End the table
|
# End the table
|
||||||
print "</table>\n";
|
print "</table>\n";
|
||||||
}
|
}
|
||||||
@@ -471,9 +487,9 @@ sub draw_day_cell
|
|||||||
$shade = "";
|
$shade = "";
|
||||||
}
|
}
|
||||||
if ($class ne '') {
|
if ($class ne '') {
|
||||||
print "<td class=\"$class\"$shade>\n<p>";
|
print "<td class=\"$class\"$shade>\n";
|
||||||
} else {
|
} else {
|
||||||
print "<td valign=\"top\" $shade>\n<p>";
|
print "<td valign=\"top\" $shade>\n";
|
||||||
}
|
}
|
||||||
if ($moons->[$day]) {
|
if ($moons->[$day]) {
|
||||||
my $phase = $moons->[$day]->{'phase'};
|
my $phase = $moons->[$day]->{'phase'};
|
||||||
@@ -513,11 +529,10 @@ sub draw_day_cell
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($Options{'nostyle'}) {
|
if ($Options{'nostyle'}) {
|
||||||
print "<div style=\"float: right\">$day</div></p>\n";
|
print "<div style=\"float: right\">$day</div>\n";
|
||||||
print "<p> </p>\n";
|
print "<p> </p>\n";
|
||||||
} else {
|
} else {
|
||||||
print "<div class=\"rem-daynumber\">$day</div></p>\n";
|
print "<div class=\"rem-daynumber\">$day</div>\n";
|
||||||
print "<p class=\"rem-entry\"> </p>\n";
|
|
||||||
}
|
}
|
||||||
if ($days->[$day]) {
|
if ($days->[$day]) {
|
||||||
print(join("\n", @{$days->[$day]}));
|
print(join("\n", @{$days->[$day]}));
|
||||||
@@ -561,7 +576,7 @@ while(1) {
|
|||||||
}
|
}
|
||||||
if ($found_something) {
|
if ($found_something) {
|
||||||
end_output();
|
end_output();
|
||||||
exit(1);
|
exit(0);
|
||||||
} else {
|
} else {
|
||||||
print STDERR "$TIDY_PROGNAME: Could not find any calendar data on STDIN.\n";
|
print STDERR "$TIDY_PROGNAME: Could not find any calendar data on STDIN.\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user