mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
Compare commits
17 Commits
03.04.00-B
...
03.04.00-B
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c593fe849 | ||
|
|
6a7bdb2ec7 | ||
|
|
a4aead18dd | ||
|
|
d277154d9f | ||
|
|
d2662fb026 | ||
|
|
2f522ea705 | ||
|
|
cd68041312 | ||
|
|
9c2556f16d | ||
|
|
b80b938d3d | ||
|
|
0bd6278050 | ||
|
|
b2746f28db | ||
|
|
cfd3698b53 | ||
|
|
6b5150d30e | ||
|
|
b011adf94e | ||
|
|
d09b725710 | ||
|
|
2f1e3524df | ||
|
|
2de47cfa51 |
38
build.tk
38
build.tk
@@ -27,8 +27,10 @@ proc SetConfigDefaults {} {
|
||||
global Config
|
||||
set Config(LAT_DEG) 45
|
||||
set Config(LAT_MIN) 24
|
||||
set Config(LAT_SEC) 14
|
||||
set Config(LON_DEG) 75
|
||||
set Config(LON_MIN) 39
|
||||
set Config(LON_SEC) 23
|
||||
set Config(LOCATION) "Ottawa"
|
||||
set Config(DEFAULT_PAGE) "Letter"
|
||||
set Config(DATESEP) "-"
|
||||
@@ -157,10 +159,14 @@ proc CreateLocationDialog { w } {
|
||||
-from 0 -to 89 -length 300 -variable Config(LAT_DEG)
|
||||
scale $w.latmin -label "Latitude (minutes)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LAT_MIN)
|
||||
scale $w.latsec -label "Latitude (seconds)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LAT_SEC)
|
||||
scale $w.londeg -label "Longitude (degrees)" -orient horizontal \
|
||||
-from 0 -to 179 -length 300 -variable Config(LON_DEG)
|
||||
scale $w.lonmin -label "Longtude (minutes)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LON_MIN)
|
||||
scale $w.lonsec -label "Longitude (seconds)" -orient horizontal \
|
||||
-from 0 -to 59 -length 300 -variable Config(LON_SEC)
|
||||
|
||||
radiobutton $w.north -text "Northern Hemisphere" \
|
||||
-variable Config(NORTHERN_HEMISPHERE) -value 1
|
||||
@@ -176,8 +182,10 @@ proc CreateLocationDialog { w } {
|
||||
$w.location insert end $Config(LOCATION)
|
||||
grid $w.latdeg -
|
||||
grid $w.latmin -
|
||||
grid $w.latsec -
|
||||
grid $w.londeg -
|
||||
grid $w.lonmin -
|
||||
grid $w.lonsec -
|
||||
|
||||
grid $w.north $w.west
|
||||
grid $w.south $w.east
|
||||
@@ -406,15 +414,19 @@ proc CreateCustomH {} {
|
||||
# modify them willy-nilly
|
||||
set LAT_DEG $Config(LAT_DEG)
|
||||
set LAT_MIN $Config(LAT_MIN)
|
||||
set LAT_SEC $Config(LAT_SEC)
|
||||
set LON_DEG $Config(LON_DEG)
|
||||
set LON_MIN $Config(LON_MIN)
|
||||
set LON_SEC $Config(LON_SEC)
|
||||
if {!$Config(NORTHERN_HEMISPHERE)} {
|
||||
set LAT_DEG "-$LAT_DEG"
|
||||
set LAT_MIN "-$LAT_MIN"
|
||||
set LAT_SEC "-$LAT_SEC"
|
||||
}
|
||||
if {!$Config(WESTERN_HEMISPHERE)} {
|
||||
set LON_DEG "-$LON_DEG"
|
||||
set LON_MIN "-$LON_MIN"
|
||||
set LON_SEC "-$LON_SEC"
|
||||
}
|
||||
set Config(LOCATION) [$Loc.location get]
|
||||
|
||||
@@ -431,21 +443,15 @@ proc CreateCustomH {} {
|
||||
|
||||
while {[gets $in line] != -1} {
|
||||
switch -glob -- $line {
|
||||
"#define LAT_DEG *" {
|
||||
puts $out "#define LAT_DEG $LAT_DEG"
|
||||
.msgs insert end "#define LAT_DEG $LAT_DEG\n"
|
||||
"#define DEFAULT_LATITUDE *" {
|
||||
set lat [expr $LAT_DEG + ($LAT_MIN/60.0) + ($LAT_SEC/3600.0)];
|
||||
puts $out "#define DEFAULT_LATITUDE $lat"
|
||||
.msgs insert end "#define DEFAULT_LATITUDE $lat"
|
||||
}
|
||||
"#define LAT_MIN *" {
|
||||
puts $out "#define LAT_MIN $LAT_MIN"
|
||||
.msgs insert end "#define LAT_MIN $LAT_MIN\n"
|
||||
}
|
||||
"#define LON_DEG *" {
|
||||
puts $out "#define LON_DEG $LON_DEG"
|
||||
.msgs insert end "#define LON_DEG $LON_DEG\n"
|
||||
}
|
||||
"#define LON_MIN *" {
|
||||
puts $out "#define LON_MIN $LON_MIN"
|
||||
.msgs insert end "#define LON_MIN $LON_MIN\n"
|
||||
"#define DEFAULT_LONGITUDE *" {
|
||||
set lon [expr -1.0 * ($LON_DEG + ($LON_MIN/60.0) + ($LON_SEC/3600.0))]
|
||||
puts $out "#define DEFAULT_LONGITUDE $lon"
|
||||
.msgs insert end "#define DEFAULT_LONGITUDE $lon"
|
||||
}
|
||||
"#define LOCATION *" {
|
||||
puts $out "#define LOCATION \"$Config(LOCATION)\""
|
||||
@@ -758,14 +764,17 @@ proc SetConfigFromRemind {} {
|
||||
# Query Remind for the rest
|
||||
QueryRemind $rem LAT_DEG {$LatDeg}
|
||||
QueryRemind $rem LAT_MIN {$LatMin}
|
||||
QueryRemind $rem LAT_SEC {$LatSec}
|
||||
QueryRemind $rem LON_DEG {$LongDeg}
|
||||
QueryRemind $rem LON_MIN {$LongMin}
|
||||
QueryRemind $rem LON_SEC {$LongSec}
|
||||
QueryRemind $rem LOCATION {$Location}
|
||||
QueryRemind $rem DATESEP {$DateSep}
|
||||
QueryRemind $rem TIMESEP {$TimeSep}
|
||||
QueryRemind $rem LANGUAGE {language()}
|
||||
|
||||
set $Config(LAT_MIN) [expr abs($Config(LAT_MIN))]
|
||||
set $Config(LAT_SEC) [expr abs($Config(LAT_SEC))]
|
||||
if {$Config(LAT_DEG) >= 0} {
|
||||
set Config(NORTHERN_HEMISPHERE) 1
|
||||
} else {
|
||||
@@ -774,6 +783,7 @@ proc SetConfigFromRemind {} {
|
||||
}
|
||||
|
||||
set $Config(LON_MIN) [expr abs($Config(LON_MIN))]
|
||||
set $Config(LON_SEC) [expr abs($Config(LON_SEC))]
|
||||
if {$Config(LON_DEG) >= 0} {
|
||||
set Config(WESTERN_HEMISPHERE) 1
|
||||
} else {
|
||||
|
||||
33
configure
vendored
33
configure
vendored
@@ -3731,39 +3731,6 @@ fi
|
||||
done
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
# This bug is HP SR number 8606223364.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned short" >&5
|
||||
$as_echo_n "checking size of unsigned short... " >&6; }
|
||||
if ${ac_cv_sizeof_unsigned_short+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short))" "ac_cv_sizeof_unsigned_short" "$ac_includes_default"; then :
|
||||
|
||||
else
|
||||
if test "$ac_cv_type_unsigned_short" = yes; then
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error 77 "cannot compute sizeof (unsigned short)
|
||||
See \`config.log' for more details" "$LINENO" 5; }
|
||||
else
|
||||
ac_cv_sizeof_unsigned_short=0
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short" >&5
|
||||
$as_echo "$ac_cv_sizeof_unsigned_short" >&6; }
|
||||
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define SIZEOF_UNSIGNED_SHORT $ac_cv_sizeof_unsigned_short
|
||||
_ACEOF
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
|
||||
@@ -27,7 +27,6 @@ dnl Replace `main' with a function in -lm:
|
||||
AC_CHECK_LIB(m, sqrt)
|
||||
|
||||
dnl Integer sizes
|
||||
AC_CHECK_SIZEOF(unsigned short)
|
||||
AC_CHECK_SIZEOF(unsigned int)
|
||||
AC_CHECK_SIZEOF(unsigned long)
|
||||
|
||||
|
||||
@@ -11,7 +11,13 @@ CHANGES TO REMIND
|
||||
type that lets you format the text in the PDF calendar (by changing the
|
||||
font size, color, underlining, etc.)
|
||||
|
||||
rem2pdf requires the Pango and Cairo Perl modules.
|
||||
rem2pdf requires the Pango and Cairo Perl modules. On Debian or
|
||||
Debian-derived systems, these may be installed with:
|
||||
|
||||
apt install libpango-perl libcairo-perl
|
||||
|
||||
Unlike rem2ps, the default font in rem2pdf is "Sans" rather than
|
||||
"Helvetica", as Sans seems to be typeset better by the Pango library.
|
||||
|
||||
- NEW FEATURE: remind: New system variables $Sunday through $Saturday
|
||||
and $January through $December let you set weekday and month names
|
||||
@@ -22,9 +28,27 @@ CHANGES TO REMIND
|
||||
- NEW FEATURE: tkremind: If rem2pdf installed, TkRemind offers you the
|
||||
choice of PDF or PostScript output in the Print dialog.
|
||||
|
||||
- CHANGE: remind: Increase the number of allowed "full OMITs" from 500
|
||||
to 1000.
|
||||
|
||||
- CHANGE: Remove the annoying code that slowed compilation and running
|
||||
on Windows and Mac OS X. I believe the point has been made and free
|
||||
OSes have enough of a critical mass that the annoyances are
|
||||
counter-productive.
|
||||
|
||||
- CLEANUP: remind: C source code: Replace the LAT_DEG, LAT_MIN,
|
||||
LAT_SEC and LON_DEG, LON_MIN, LON_SEC macros with DEFAULT_LATITUDE
|
||||
and DEFAULT_LONGITUDE.
|
||||
|
||||
- CLEANUP: remind: C source code: Remove various unused or obsolete macros.
|
||||
|
||||
- BUG FIX: Properly support formatting of double-wide characters in the
|
||||
terminal mode "remind -c" calendar.
|
||||
|
||||
- BUG FIX: remind: Get rid of LAT_DEG/LAT_MIN/LAT_SEC and
|
||||
LON_DEG/LON_MIN/LON_SEC macros in favour of DEFAULT_LATITUDE and
|
||||
DEFAULT_LONGITUDE.
|
||||
|
||||
- IMPROVEMENT: All localized languages now use UTF-8 exclusively.
|
||||
Support for old character encodings like ISO-8859-1 and ISO-8859-2
|
||||
has been dropped since modern UNIXes have pretty much standardized
|
||||
|
||||
@@ -36,8 +36,5 @@ install:
|
||||
fi; \
|
||||
exit 1;
|
||||
|
||||
|
||||
|
||||
|
||||
Makefile: Makefile.PL
|
||||
$(PERL) Makefile.PL || true
|
||||
|
||||
@@ -40,11 +40,11 @@ my $settings = {
|
||||
width => 0,
|
||||
height => 0,
|
||||
|
||||
title_font => 'Helvetica',
|
||||
header_font => 'Helvetica',
|
||||
daynum_font => 'Helvetica Bold Oblique',
|
||||
entry_font => 'Helvetica',
|
||||
small_cal_font => 'Helvetica',
|
||||
title_font => 'Sans',
|
||||
header_font => 'Sans',
|
||||
daynum_font => 'Sans Bold Oblique',
|
||||
entry_font => 'Sans',
|
||||
small_cal_font => 'Sans',
|
||||
|
||||
title_size => 14,
|
||||
header_size => 14,
|
||||
@@ -355,27 +355,27 @@ width and height for the options to be respected.
|
||||
=item --title-font=I<font>
|
||||
|
||||
Specify the font used for the calendar title. It can be any font that
|
||||
the Pango library on your system can use. The default is Helvetica. If
|
||||
the Pango library on your system can use. The default is Sans. If
|
||||
you choose a font with spaces in its name, you may need to quote this
|
||||
argument.
|
||||
|
||||
=item --header-font=I<font>
|
||||
|
||||
Specify the font used for the weekday names. The default is Helvetica.
|
||||
Specify the font used for the weekday names. The default is Sans.
|
||||
|
||||
=item --daynum-font=I<font>
|
||||
|
||||
Specify the font used for the day numbers. The default is
|
||||
Helvetica Bold Oblique.
|
||||
Sans Bold Oblique.
|
||||
|
||||
=item --entry-font=I<font>
|
||||
|
||||
Specify the font used for calendar entries. The default is Helvetica.
|
||||
Specify the font used for calendar entries. The default is Sans.
|
||||
|
||||
=item --small-cal-font=I<font>
|
||||
|
||||
Specify the font used for the small next- and previous-month
|
||||
calendars. The default is Helvetica.
|
||||
calendars. The default is Sans.
|
||||
|
||||
=item --title-size=I<n>
|
||||
|
||||
|
||||
@@ -684,7 +684,7 @@ static void DoCalendarOneWeek(int nleft)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
for (l=0; l<CalPad; l++) {
|
||||
gon();
|
||||
DRAW(tb);
|
||||
@@ -695,7 +695,7 @@ static void DoCalendarOneWeek(int nleft)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
/* Write the body lines */
|
||||
@@ -716,7 +716,7 @@ static void DoCalendarOneWeek(int nleft)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
/* Write the final line */
|
||||
@@ -867,7 +867,7 @@ static int WriteCalendarRow(void)
|
||||
sprintf(buf, "%d ", d+i-wd);
|
||||
if (Julian(y, m, d+i-wd) == RealToday) {
|
||||
PrintLeft(buf, ColSpaces-1, '*');
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
} else {
|
||||
PrintLeft(buf, ColSpaces, ' ');
|
||||
}
|
||||
@@ -876,7 +876,7 @@ static int WriteCalendarRow(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
for (l=0; l<CalPad; l++) {
|
||||
gon();
|
||||
DRAW(tb);
|
||||
@@ -887,7 +887,7 @@ static int WriteCalendarRow(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
/* Write the body lines */
|
||||
@@ -908,7 +908,7 @@ static int WriteCalendarRow(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
moreleft = (d+7-wd <= DaysInMonth(m, y));
|
||||
@@ -934,7 +934,7 @@ static void PrintLeft(char const *s, int width, char pad)
|
||||
#ifndef REM_USE_WCHAR
|
||||
int len = strlen(s);
|
||||
printf("%s", s);
|
||||
while (len++ < width) PutChar(pad);
|
||||
while (len++ < width) putchar(pad);
|
||||
#else
|
||||
size_t len = mbstowcs(NULL, s, 0);
|
||||
int i;
|
||||
@@ -999,10 +999,10 @@ static void PrintCentered(char const *s, int width, char *pad)
|
||||
for (i=0; i<width; i++) {
|
||||
if (*s) {
|
||||
if (isspace(*s)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
s++;
|
||||
} else {
|
||||
PutChar(*s++);
|
||||
putchar(*s++);
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
@@ -1084,7 +1084,7 @@ static int WriteOneCalLine(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
|
||||
return done;
|
||||
}
|
||||
@@ -1157,7 +1157,7 @@ static int WriteOneColLine(int col)
|
||||
for (ws = e->wc_pos; ws - e->wc_pos < ColSpaces; ws++) {
|
||||
if (!*ws) break;
|
||||
if (iswspace(*ws)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
numwritten++;
|
||||
} else {
|
||||
if (wcwidth(*ws) > 0) {
|
||||
@@ -1172,7 +1172,7 @@ static int WriteOneColLine(int col)
|
||||
for (ws = e->wc_pos; ws<wspace; ws++) {
|
||||
if (!*ws) break;
|
||||
if (iswspace(*ws)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
numwritten++;
|
||||
} else {
|
||||
if (wcwidth(*ws) > 0) {
|
||||
@@ -1189,7 +1189,7 @@ static int WriteOneColLine(int col)
|
||||
}
|
||||
|
||||
/* Flesh out the rest of the column */
|
||||
while(numwritten++ < ColSpaces) PutChar(' ');
|
||||
while(numwritten++ < ColSpaces) putchar(' ');
|
||||
|
||||
/* Skip any spaces before next word */
|
||||
while (iswspace(*ws)) ws++;
|
||||
@@ -1244,9 +1244,9 @@ static int WriteOneColLine(int col)
|
||||
if (!*s) break;
|
||||
numwritten++;
|
||||
if (isspace(*s)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
} else {
|
||||
PutChar(*s);
|
||||
putchar(*s);
|
||||
}
|
||||
}
|
||||
e->pos = s;
|
||||
@@ -1256,9 +1256,9 @@ static int WriteOneColLine(int col)
|
||||
if (!*s) break;
|
||||
numwritten++;
|
||||
if (isspace(*s)) {
|
||||
PutChar(' ');
|
||||
putchar(' ');
|
||||
} else {
|
||||
PutChar(*s);
|
||||
putchar(*s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1269,7 +1269,7 @@ static int WriteOneColLine(int col)
|
||||
}
|
||||
|
||||
/* Flesh out the rest of the column */
|
||||
while(numwritten++ < ColSpaces) PutChar(' ');
|
||||
while(numwritten++ < ColSpaces) putchar(' ');
|
||||
|
||||
/* Skip any spaces before next word */
|
||||
while (isspace(*s)) s++;
|
||||
@@ -1423,7 +1423,7 @@ static void WriteCalHeader(void)
|
||||
gon();
|
||||
DRAW(tb);
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
|
||||
WritePostHeaderLine();
|
||||
WriteCalDays();
|
||||
@@ -1437,7 +1437,7 @@ static void WriteCalHeader(void)
|
||||
/***************************************************************/
|
||||
static void WriteCalTrailer(void)
|
||||
{
|
||||
PutChar('\f');
|
||||
putchar('\f');
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -2051,7 +2051,7 @@ static void WriteTopCalLine(void)
|
||||
PrintCentered("", CalWidth-2, linestruct->lr);
|
||||
DRAW(bl);
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WriteBottomCalLine(void)
|
||||
@@ -2068,7 +2068,7 @@ static void WriteBottomCalLine(void)
|
||||
}
|
||||
}
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WritePostHeaderLine(void)
|
||||
@@ -2085,7 +2085,7 @@ static void WritePostHeaderLine(void)
|
||||
}
|
||||
}
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WriteWeekHeaderLine(void)
|
||||
@@ -2102,7 +2102,7 @@ static void WriteWeekHeaderLine(void)
|
||||
}
|
||||
}
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WriteIntermediateCalLine(void)
|
||||
@@ -2120,7 +2120,7 @@ static void WriteIntermediateCalLine(void)
|
||||
}
|
||||
}
|
||||
goff();
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
static void WriteCalDays(void)
|
||||
@@ -2138,7 +2138,7 @@ static void WriteCalDays(void)
|
||||
DRAW(tb);
|
||||
goff();
|
||||
}
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
@@ -38,7 +38,4 @@
|
||||
/* The number of bytes in a unsigned long. */
|
||||
#undef SIZEOF_UNSIGNED_LONG
|
||||
|
||||
/* The number of bytes in a unsigned short. */
|
||||
#undef SIZEOF_UNSIGNED_SHORT
|
||||
|
||||
#include "custom.h"
|
||||
|
||||
47
src/custom.h
47
src/custom.h
@@ -11,22 +11,18 @@
|
||||
/***************************************************************/
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
||||
/* DEFAULT_LATITUDE: Latitude of your location */
|
||||
/* DEFAULT_LONGITUDE: Longitude of your location */
|
||||
/* LOCATION: A string identifying your location. */
|
||||
/* All latitude and longitude numbers should be positive for the */
|
||||
/* northern and western hemisphere. If you live in the southern */
|
||||
/* hemisphere, ALL latitude values should be negative. If you live */
|
||||
/* in the eastern hemisphere, ALL longitude values should be negative. */
|
||||
/* Latitude and longitude should be positive for the */
|
||||
/* northern and eastern hemisphere and negative for the southern and */
|
||||
/* western hemisphere. */
|
||||
/* */
|
||||
/* The default values are initially set to Ottawa, Ontario, Canada. */
|
||||
/* The default values are initially set to the city hall in Ottawa, */
|
||||
/* Ontario, Canada. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define LAT_DEG 45
|
||||
#define LAT_MIN 25
|
||||
#define LAT_SEC 30
|
||||
#define LON_DEG 75
|
||||
#define LON_MIN 41
|
||||
#define LON_SEC 59
|
||||
#define DEFAULT_LATITUDE 45.42055555555555
|
||||
#define DEFAULT_LONGITUDE -75.68972222222223
|
||||
#define LOCATION "Ottawa"
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -58,12 +54,6 @@
|
||||
#define DATETIMESEP '@'
|
||||
/* #define DATETIMESEP '/' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
||||
/* the -u option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define WANT_U_OPTION 1
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
@@ -81,16 +71,7 @@
|
||||
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
||||
/* characters to be escaped with a backslash for the -k option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(UNIX)
|
||||
#define WANT_SHELL_ESCAPING 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Some implementations have a broken 'putc' and 'putchar'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#ifdef __SASC_60
|
||||
#define BROKEN_PUTC
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
||||
@@ -156,7 +137,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_FULL_OMITS 500
|
||||
#define MAX_FULL_OMITS 1000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form MM DD do we handle? */
|
||||
@@ -190,14 +171,6 @@
|
||||
#define PSBEGIN2 "# rem2ps2 begin"
|
||||
#define PSEND2 "# rem2ps2 end"
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
#define Putc SafePutc
|
||||
#define PutChar SafePutChar
|
||||
#else
|
||||
#define Putc putc
|
||||
#define PutChar putchar
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
|
||||
#define REM_USE_WCHAR 1
|
||||
#else
|
||||
|
||||
@@ -11,22 +11,18 @@
|
||||
/***************************************************************/
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
||||
/* LON_DEG, LON_MIN and LON_SEC: Longitude of your location */
|
||||
/* DEFAULT_LATITUDE: Latitude of your location */
|
||||
/* DEFAULT_LONGITUDE: Longitude of your location */
|
||||
/* LOCATION: A string identifying your location. */
|
||||
/* All latitude and longitude numbers should be positive for the */
|
||||
/* northern and western hemisphere. If you live in the southern */
|
||||
/* hemisphere, ALL latitude values should be negative. If you live */
|
||||
/* in the eastern hemisphere, ALL longitude values should be negative. */
|
||||
/* Latitude and longitude should be positive for the */
|
||||
/* northern and eastern hemisphere and negative for the southern and */
|
||||
/* western hemisphere. */
|
||||
/* */
|
||||
/* The default values are initially set to Ottawa, Ontario, Canada. */
|
||||
/* The default values are initially set to the city hall in Ottawa, */
|
||||
/* Ontario, Canada. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define LAT_DEG 45
|
||||
#define LAT_MIN 25
|
||||
#define LAT_SEC 30
|
||||
#define LON_DEG 75
|
||||
#define LON_MIN 41
|
||||
#define LON_SEC 59
|
||||
#define DEFAULT_LATITUDE 45.42055555555555
|
||||
#define DEFAULT_LONGITUDE -75.68972222222223
|
||||
#define LOCATION "Ottawa"
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
@@ -58,12 +54,6 @@
|
||||
#define DATETIMESEP '@'
|
||||
/* #define DATETIMESEP '/' */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* WANT_U_OPTION: Comment out the next define to permanently disable */
|
||||
/* the -u option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define WANT_U_OPTION 1
|
||||
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
/**********************************************************************/
|
||||
@@ -81,16 +71,7 @@
|
||||
/* WANT_SHELL_ESCAPING: Define this if you want special shell */
|
||||
/* characters to be escaped with a backslash for the -k option. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#if defined(UNIX)
|
||||
#define WANT_SHELL_ESCAPING 1
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* Some implementations have a broken 'putc' and 'putchar'. */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#ifdef __SASC_60
|
||||
#define BROKEN_PUTC
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* BASE: The base year for date calculation. NOTE! January 1 of the */
|
||||
@@ -156,7 +137,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define MAX_FULL_OMITS 500
|
||||
#define MAX_FULL_OMITS 1000
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form MM DD do we handle? */
|
||||
@@ -190,14 +171,6 @@
|
||||
#define PSBEGIN2 "# rem2ps2 begin"
|
||||
#define PSEND2 "# rem2ps2 end"
|
||||
|
||||
#ifdef BROKEN_PUTC
|
||||
#define Putc SafePutc
|
||||
#define PutChar SafePutChar
|
||||
#else
|
||||
#define Putc putc
|
||||
#define PutChar putchar
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_MBSTOWCS) && defined(HAVE_WCTYPE_H)
|
||||
#define REM_USE_WCHAR 1
|
||||
#else
|
||||
|
||||
12
src/expr.c
12
src/expr.c
@@ -101,7 +101,7 @@ static int DebugPerform(Operator *op)
|
||||
fprintf(ErrFp, " => ");
|
||||
if (!r) {
|
||||
PrintValue(&ValStack[ValStackPtr-1], ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
} else {
|
||||
fprintf(ErrFp, "%s\n", ErrMsg[r]);
|
||||
}
|
||||
@@ -580,7 +580,7 @@ static int MakeValue(char const *s, Value *v, Var *locals, ParsePtr p)
|
||||
if (! (DebugFlag & DB_PRTEXPR)) return r;
|
||||
if (r == OK) {
|
||||
PrintValue(v, ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
}
|
||||
return r;
|
||||
} else { /* Must be a symbol */
|
||||
@@ -591,7 +591,7 @@ static int MakeValue(char const *s, Value *v, Var *locals, ParsePtr p)
|
||||
if (! (DebugFlag & DB_PRTEXPR)) return r;
|
||||
if (r == OK) {
|
||||
PrintValue(v, ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@@ -1232,9 +1232,9 @@ void PrintValue (Value *v, FILE *fp)
|
||||
|
||||
if (v->type == STR_TYPE) {
|
||||
s=v->v.str;
|
||||
Putc('"', fp);
|
||||
for (y=0; y<MAX_PRT_LEN && *s; y++) Putc(*s++, fp);
|
||||
Putc('"',fp);
|
||||
putc('"', fp);
|
||||
for (y=0; y<MAX_PRT_LEN && *s; y++) putc(*s++, fp);
|
||||
putc('"',fp);
|
||||
if (*s) fprintf(fp, "...");
|
||||
}
|
||||
else if (v->type == INT_TYPE) fprintf(fp, "%d", v->v.val);
|
||||
|
||||
@@ -118,14 +118,14 @@ EXTERN INIT( int UseTrueColors, 0);
|
||||
EXTERN INIT( int TerminalBackground, TERMINAL_BACKGROUND_UNKNOWN);
|
||||
|
||||
/* Latitude and longitude */
|
||||
EXTERN INIT( int LatDeg, LAT_DEG);
|
||||
EXTERN INIT( int LatMin, LAT_MIN);
|
||||
EXTERN INIT( int LatSec, LAT_SEC);
|
||||
EXTERN INIT( int LongDeg, LON_DEG);
|
||||
EXTERN INIT( int LongMin, LON_MIN);
|
||||
EXTERN INIT( int LongSec, LON_SEC);
|
||||
EXTERN INIT( double Longitude, -999.0);
|
||||
EXTERN INIT( double Latitude, -999.0);
|
||||
EXTERN INIT( int LatDeg, 0);
|
||||
EXTERN INIT( int LatMin, 0);
|
||||
EXTERN INIT( int LatSec, 0);
|
||||
EXTERN INIT( int LongDeg, 0);
|
||||
EXTERN INIT( int LongMin, 0);
|
||||
EXTERN INIT( int LongSec, 0);
|
||||
EXTERN INIT( double Longitude, DEFAULT_LONGITUDE);
|
||||
EXTERN INIT( double Latitude, DEFAULT_LATITUDE);
|
||||
|
||||
EXTERN INIT( char *Location, LOCATION);
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ void InitRemind(int argc, char const *argv[])
|
||||
FromJulian(JulianToday, &CurYear, &CurMon, &CurDay);
|
||||
|
||||
/* Initialize Latitude and Longitude */
|
||||
set_lat_and_long_from_components();
|
||||
set_components_from_lat_and_long();
|
||||
|
||||
/* See if we were invoked as "rem" rather than "remind" */
|
||||
if (argv[0]) {
|
||||
|
||||
20
src/main.c
20
src/main.c
@@ -44,10 +44,6 @@
|
||||
|
||||
static void DoReminders(void);
|
||||
|
||||
/* Whooo... the putchar/Putchar/PutChar macros are a mess...
|
||||
my apologies... */
|
||||
#define Putchar(c) PutChar(c)
|
||||
|
||||
/***************************************************************/
|
||||
/***************************************************************/
|
||||
/** **/
|
||||
@@ -616,11 +612,11 @@ void OutputLine(FILE *fp)
|
||||
char c = 0;
|
||||
|
||||
while (*s) {
|
||||
if (*s == '\n') Putc('\\', fp);
|
||||
Putc(*s, fp);
|
||||
if (*s == '\n') putc('\\', fp);
|
||||
putc(*s, fp);
|
||||
c = *s++;
|
||||
}
|
||||
if (c != '\n') Putc('\n', fp);
|
||||
if (c != '\n') putc('\n', fp);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -1212,7 +1208,7 @@ void FillParagraph(char const *s)
|
||||
|
||||
/* If it's a carriage return, output it and start new paragraph */
|
||||
if (*s == '\n') {
|
||||
Putchar('\n');
|
||||
putchar('\n');
|
||||
s++;
|
||||
line = 0;
|
||||
while(ISBLANK(*s)) s++;
|
||||
@@ -1225,7 +1221,7 @@ void FillParagraph(char const *s)
|
||||
number of spaces */
|
||||
j = line ? SubsIndent : FirstIndent;
|
||||
for (i=0; i<j; i++) {
|
||||
Putchar(' ');
|
||||
putchar(' ');
|
||||
}
|
||||
|
||||
/* Calculate the amount of room left on this line */
|
||||
@@ -1244,17 +1240,17 @@ void FillParagraph(char const *s)
|
||||
}
|
||||
if (!pendspace || len+pendspace <= roomleft) {
|
||||
for (i=0; i<pendspace; i++) {
|
||||
Putchar(' ');
|
||||
putchar(' ');
|
||||
}
|
||||
while(t < s) {
|
||||
Putchar(*t);
|
||||
putchar(*t);
|
||||
if (strchr(EndSent, *t)) doublespace = 2;
|
||||
else if (!strchr(EndSentIg, *t)) doublespace = 1;
|
||||
t++;
|
||||
}
|
||||
} else {
|
||||
s = t;
|
||||
Putchar('\n');
|
||||
putchar('\n');
|
||||
line++;
|
||||
break;
|
||||
}
|
||||
|
||||
16
src/rem2ps.c
16
src/rem2ps.c
@@ -146,9 +146,9 @@ put_escaped_string(char const *s)
|
||||
{
|
||||
while(*s) {
|
||||
if (*s == '\\' || *s == '(' || *s == ')') {
|
||||
PutChar('\\');
|
||||
putchar('\\');
|
||||
}
|
||||
PutChar(*s);
|
||||
putchar(*s);
|
||||
s++;
|
||||
}
|
||||
}
|
||||
@@ -625,7 +625,7 @@ void WriteProlog(void)
|
||||
strcmp(SmallFont, DayFont) &&
|
||||
strcmp(TitleFont, SmallFont) &&
|
||||
strcmp(SmallFont, EntryFont)) printf(" %s", SmallFont);
|
||||
PutChar('\n');
|
||||
putchar('\n');
|
||||
printf("%%%%Creator: Rem2PS\n");
|
||||
printf("%%%%Pages: (atend)\n");
|
||||
printf("%%%%Orientation: %s\n", PortraitMode ? "Portrait" : "Landscape");
|
||||
@@ -805,20 +805,20 @@ void WriteOneEntry(CalEntry *c)
|
||||
}
|
||||
}
|
||||
|
||||
PutChar('(');
|
||||
putchar('(');
|
||||
while(*s) {
|
||||
/* Use the "unsigned char" cast to fix problem on Solaris 2.5 */
|
||||
/* which treated some latin1 characters as white space. */
|
||||
ch = (unsigned char) *s++;
|
||||
if (ch == '\\' || ch == '(' || ch == ')') PutChar('\\');
|
||||
if (!isspace(ch)) PutChar(ch);
|
||||
if (ch == '\\' || ch == '(' || ch == ')') putchar('\\');
|
||||
if (!isspace(ch)) putchar(ch);
|
||||
else {
|
||||
PutChar(')');
|
||||
putchar(')');
|
||||
while(isspace((unsigned char)*s)) s++;
|
||||
if (!*s) {
|
||||
goto finish;
|
||||
}
|
||||
PutChar('(');
|
||||
putchar('(');
|
||||
}
|
||||
}
|
||||
printf(")\n");
|
||||
|
||||
12
src/var.c
12
src/var.c
@@ -989,29 +989,29 @@ static void DumpSysVar(char const *name, const SysVar *v)
|
||||
SysVarFunc f = (SysVarFunc) v->value;
|
||||
f(0, &val);
|
||||
PrintValue(&val, ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
DestroyValue(val);
|
||||
} else if (v->type == STR_TYPE) {
|
||||
char const *s = *((char **)v->value);
|
||||
int y;
|
||||
Putc('"', ErrFp);
|
||||
putc('"', ErrFp);
|
||||
for (y=0; y<MAX_PRT_LEN && *s; y++) {
|
||||
if (*s == '"') {
|
||||
fprintf(ErrFp, "\" + char(34) + \"");
|
||||
s++;
|
||||
} else {
|
||||
Putc(*s++, ErrFp);
|
||||
putc(*s++, ErrFp);
|
||||
}
|
||||
}
|
||||
Putc('"', ErrFp);
|
||||
putc('"', ErrFp);
|
||||
if (*s) fprintf(ErrFp, "...");
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
} else if (v->type == DATE_TYPE) {
|
||||
Value val;
|
||||
val.type = DATE_TYPE;
|
||||
val.v.val = * (int *) v->value;
|
||||
PrintValue(&val, ErrFp);
|
||||
Putc('\n', ErrFp);
|
||||
putc('\n', ErrFp);
|
||||
} else {
|
||||
if (!v->modifiable) fprintf(ErrFp, "%d\n", *((int *)v->value));
|
||||
else {
|
||||
|
||||
@@ -837,7 +837,7 @@ REM Mon 15 Feb ADDOMIT MSG Family Day
|
||||
REM Feb 18 AFTER MSG Should trigger on Feb 19
|
||||
../tests/test.rem(233): Trig = Tuesday, 19 February, 1991
|
||||
OMIT DUMP
|
||||
Global Full OMITs (1 of maximum allowed 500):
|
||||
Global Full OMITs (1 of maximum allowed 1000):
|
||||
1991-02-18
|
||||
Global Partial OMITs (0 of maximum allowed 366):
|
||||
None.
|
||||
@@ -2773,7 +2773,7 @@ OMIT December 25 MSG X
|
||||
OMIT 26 Dec 2010 THROUGH 27 Dec 2010 MSG This is not legal
|
||||
../tests/test.rem(454): Trig = Sunday, 26 December, 2010
|
||||
OMIT DUMP
|
||||
Global Full OMITs (16 of maximum allowed 500):
|
||||
Global Full OMITs (16 of maximum allowed 1000):
|
||||
1991-03-11
|
||||
2010-09-03
|
||||
2010-09-04
|
||||
|
||||
Reference in New Issue
Block a user