home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume38
/
remind
/
patch07b
/
patch.07.A
Wrap
Text File
|
1993-07-22
|
39KB
|
1,184 lines
Prereq: "03.00.06"
See the patched file "WHATSNEW.30" for a list of
changes in this patch.
*** ../p6/version.h Fri Apr 23 12:59:49 1993
--- ./version.h Mon Jun 28 12:29:33 1993
***************
*** 9,12 ****
/* */
/***************************************************************/
! #define VERSION "03.00.06"
--- 9,12 ----
/* */
/***************************************************************/
! #define VERSION "03.00.07"
*** ../p6/Makefile Fri Apr 23 13:00:44 1993
--- ./Makefile Mon Jun 28 12:30:00 1993
***************
*** 12,18 ****
# Uncomment the next line if you want to use gcc instead of default compiler
CC= gcc
!
# Put any additional flags for the C compiler or linker here
CFLAGS= -O -ansi
CDEFS=
--- 12,18 ----
# Uncomment the next line if you want to use gcc instead of default compiler
CC= gcc
! LD= gcc
# Put any additional flags for the C compiler or linker here
CFLAGS= -O -ansi
CDEFS=
***************
*** 46,52 ****
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
# in config.h; then, you should be able to type 'make'.
#-----------------------------------------------------------------------------
! VERSION= 03.00.06
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
lang.h english.h german.h dutch.h finnish.h
--- 46,53 ----
# YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
# in config.h; then, you should be able to type 'make'.
#-----------------------------------------------------------------------------
! VERSION= 03.00.07
! MATHLIB= -lm
HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
lang.h english.h german.h dutch.h finnish.h
***************
*** 70,79 ****
$(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
rem2ps: rem2ps.o
! $(CC) $(LDFLAGS) -o rem2ps rem2ps.o
remind: $(OBJS)
! $(CC) $(LDFLAGS) -o remind $(OBJS)
clean:
rm -f *.o *~
--- 71,80 ----
$(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
rem2ps: rem2ps.o
! $(LD) $(LDFLAGS) -o rem2ps rem2ps.o
remind: $(OBJS)
! $(LD) $(LDFLAGS) -o remind $(OBJS) $(MATHLIB)
clean:
rm -f *.o *~
***************
*** 105,112 ****
var.o: var.c $(STDHDRS) expr.h
tarZ:
! tar cvf remind-3.0.6.tar $(MANIFEST)
! compress -v remind-3.0.6.tar
shar:
shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
--- 106,113 ----
var.o: var.c $(STDHDRS) expr.h
tarZ:
! tar cvf remind-3.0.7.tar $(MANIFEST)
! compress -v remind-3.0.7.tar
shar:
shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
*** ../p6/README.UNIX Thu Apr 22 10:24:13 1993
--- ./README.UNIX Mon Jun 28 12:29:27 1993
***************
*** 32,38 ****
script.
*** NOTE *** Please be aware that "remind-all.csh" and "remind-all.sh"
! have been changed since the last release of Remind. If you install
the new remind executable, make sure you switch over to the new
"remind-all" scripts.
--- 32,38 ----
script.
*** NOTE *** Please be aware that "remind-all.csh" and "remind-all.sh"
! have been changed since version 03.00.05 of Remind. If you install
the new remind executable, make sure you switch over to the new
"remind-all" scripts.
*** ../p6/WHATSNEW.30 Mon May 3 11:00:51 1993
--- ./WHATSNEW.30 Mon Jul 19 10:59:32 1993
***************
*** 1,5 ****
--- 1,48 ----
CHANGES TO REMIND
+ * Version 3.0 Patch 7
+
+ + MAJOR ENHANCEMENTS
+
+ - Added "system variables" to allow the user more control over
+ Remind operation, and to allow queries about the command-line
+ options from within a reminder script. They allow for specification
+ of longitude and latitude for use by sunrise/sunset calculations.
+
+ - Added sunrise(), sunset(), isdst() and minsfromutc() functions -
+ these are needed to support sunrise and sunset calculations.
+
+ + MINOR ENHANCEMENTS
+
+ - Allowed the MSG, RUN, CAL, PS and PSF keywords to be used in the
+ same reminder as the SATISFY keyword. This makes many complex
+ reminders more compact.
+
+ - Added the filedir() function to enable Remind's include to emulate
+ CPP's #include more closely.
+
+ - Allowed non-root users to use the "-u" option. It only affects
+ the "SHELL", "HOME", "USER" and "LOGNAME" environment variables -
+ it doesn't change the effective uid and gid when run by non-root.
+
+ - Added built-in function "easterdate" to calculate date of Easter
+ Sunday - function courtesy of Michael Salmon.
+
+ - Improved the Jewish holiday reminders in "defs.rem" to give advance
+ notice of holidays.
+
+ - Allowed the "simple calendar" option (-s) to specify a number of
+ weeks as well as a number of months, in the same fashion as the
+ -c option. Thanks to Dave Rickel.
+
+ + BUG FIXES
+
+ - Corrected the behaviour of "hebdate" for jahrzeits; added an additional
+ parameter to specify the behaviour of dates in Adar during leap years.
+
+ - Changed kall so that "kall sh" doesn't commit suicide - patch courtesy
+ of Michael Salmon.
+
* Version 3.0 Patch 6
+ MINOR ENHANCEMENTS
*** ../p6/calendar.c Mon May 3 12:01:29 1993
--- ./calendar.c Mon Jun 28 13:08:26 1993
***************
*** 83,91 ****
} else {
JulianToday -= ((JulianToday+1)%7);
! WriteIntermediateCalLine();
! WriteCalDays();
! WriteIntermediateCalLine();
while (CalWeeks--)
DoCalendarOneWeek();
--- 83,93 ----
} else {
JulianToday -= ((JulianToday+1)%7);
! if (!DoSimpleCalendar) {
! WriteIntermediateCalLine();
! WriteCalDays();
! WriteIntermediateCalLine();
! }
while (CalWeeks--)
DoCalendarOneWeek();
***************
*** 106,112 ****
static void DoCalendarOneWeek()
#endif
{
! int y, m, d, done, i, l;
char buf[81];
int LinesWritten = 0;
int OrigJul = JulianToday;
--- 108,114 ----
static void DoCalendarOneWeek()
#endif
{
! int y, m, d, done, i, l, wd;
char buf[81];
int LinesWritten = 0;
int OrigJul = JulianToday;
***************
*** 119,124 ****
--- 121,135 ----
/* Output the entries */
+ /* If it's "Simple Calendar" format, do it simply... */
+ if (DoSimpleCalendar) {
+ wd = (JulianToday + 1) % 7;
+ for (i=0; i<7; i++) {
+ WriteSimpleEntries(i, OrigJul+i-wd);
+ }
+ return;
+ }
+
/* Here come the first few lines... */
putchar('|');
for (i=0; i<7; i++) {
***************
*** 464,469 ****
--- 475,481 ----
ClearGlobalOmits();
DestroyOmitContexts();
DestroyVars();
+ NumTriggered = 0;
r=OpenFile(InitialFile);
if (r) {
***************
*** 618,623 ****
--- 630,637 ----
CalEntry *CurPs = CalPs[col];
CalEntry *e;
char *s;
+ char buf[TOKSIZE];
+ Token tok;
/* Parse the trigger date and time */
if ( (r=ParseRem(p, &trig, &tim)) ) return r;
***************
*** 627,637 ****
if (DontIssueAts && tim.ttime != NO_TIME) return OK;
#endif
if (trig.typ == NO_TYPE) return E_EOLN;
! if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
!
/* Calculate the trigger date */
! jul = ComputeTrigger(trig.scanfrom, &trig, &r);
! if (r) return r;
if (!PsCal && (trig.typ == PS_TYPE || trig.typ == PSF_TYPE)) return OK;
/* Remove any "at" times from PS or PSFILE reminders */
--- 641,663 ----
if (DontIssueAts && tim.ttime != NO_TIME) return OK;
#endif
if (trig.typ == NO_TYPE) return E_EOLN;
! if (trig.typ == SAT_TYPE) {
! r=DoSatRemind(&trig, &tim, p);
! if (r) return r;
! r=ParseToken(p, buf);
! if (r) return r;
! FindToken(buf, &tok);
! if (tok.type == T_Empty || tok.type == T_Comment) return OK;
! if (tok.type != T_RemType || tok.val == SAT_TYPE) return E_PARSE_ERR;
! trig.typ = tok.val;
! jul = LastTriggerDate;
! if (!LastTrigValid) return OK;
! } else {
/* Calculate the trigger date */
! jul = ComputeTrigger(trig.scanfrom, &trig, &r);
! if (r) return r;
! }
!
if (!PsCal && (trig.typ == PS_TYPE || trig.typ == PSF_TYPE)) return OK;
/* Remove any "at" times from PS or PSFILE reminders */
***************
*** 639,644 ****
--- 665,671 ----
/* If trigger date == today, add it to the current entry */
if (jul == JulianToday) {
+ NumTriggered++;
s = SubstBuffer;
if (DoSimpleCalendar || tim.ttime != NO_TIME)
s += strlen(SimpleTime(tim.ttime, s));
*** ../p6/config.h Thu Apr 22 10:24:02 1993
--- ./config.h Mon Jun 28 12:29:29 1993
***************
*** 12,17 ****
--- 12,41 ----
/***************************************************************/
/*---------------------------------------------------------------------*/
+ /* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
+ /* LONG_DEG, LONG_MIN and LONG_SEC: Longitude of your location */
+ /* For latitude, north is positive, south is negative. */
+ /* For longitude, west is positive, east is negative. */
+ /* NOTE: For negative numbers, all three of DEG, MIN, SEC should be */
+ /* negative. To indicate -20deg22'33" use */
+ /* DEG=-20, MIN=-22 and SEC=-33. */
+ /* The default values are initially set to Ottawa, Ontario, Canada. */
+ /*---------------------------------------------------------------------*/
+ #define LAT_DEG 45
+ #define LAT_MIN 24
+ #define LAT_SEC 00
+ #define LONG_DEG 75
+ #define LONG_MIN 39
+ #define LONG_SEC 0
+
+ /*---------------------------------------------------------------------*/
+ /* HAVE_MKTIME: Define this if your C library includes the mktime() */
+ /* function. Otherwise, will attempt to use the Unix */
+ /* style time manipulations. */
+ /*---------------------------------------------------------------------*/
+ #define HAVE_MKTIME 1
+
+ /*---------------------------------------------------------------------*/
/* DEFAULT_PAGE: The default page size to use for Rem2PS. */
/* The Letter version is appropriate for North America; the A4 version */
/* is appropriate for Europe. */
***************
*** 72,78 ****
/* IMPORTANT NOTE: The Hebrew date routines depend on BASE */
/* being set to 1990. If you change it, you'll have to add the */
/* number of days between 1 Jan <NEWBASE> and 1 Jan 1990 to the */
! /* manifest constant CORRECTION in hbcal.c */
/*---------------------------------------------------------------------*/
#define BASE 1990
--- 96,103 ----
/* IMPORTANT NOTE: The Hebrew date routines depend on BASE */
/* being set to 1990. If you change it, you'll have to add the */
/* number of days between 1 Jan <NEWBASE> and 1 Jan 1990 to the */
! /* manifest constant CORRECTION in hbcal.c. Also, the year */
! /* folding mechanism in main.c depends on BASE<2001. */
/*---------------------------------------------------------------------*/
#define BASE 1990
***************
*** 86,92 ****
#define YR_RANGE 88
/*---------------------------------------------------------------------*/
! /* VAR_NAME_LEN: The maximum length of variable names */
/*---------------------------------------------------------------------*/
#define VAR_NAME_LEN 12
--- 111,118 ----
#define YR_RANGE 88
/*---------------------------------------------------------------------*/
! /* VAR_NAME_LEN: The maximum length of variable names. Don't make it */
! /* any less than 12. */
/*---------------------------------------------------------------------*/
#define VAR_NAME_LEN 12
*** ../p6/defs.rem Mon May 3 10:29:12 1993
--- ./defs.rem Fri Jul 16 15:28:09 1993
***************
*** 25,32 ****
################################################
# Ensure required version of remind is used... #
################################################
! IF version() < "03.00.06"
! ERRMSG This file requires at least version 03.00.06 of Remind.%
ERRMSG This version is version [version()].
EXIT
ENDIF
--- 25,32 ----
################################################
# Ensure required version of remind is used... #
################################################
! IF version() < "03.00.07"
! ERRMSG This file requires at least version 03.00.07 of Remind.%
ERRMSG This version is version [version()].
EXIT
ENDIF
***************
*** 100,105 ****
--- 100,145 ----
FSET _back(days) TRIGGER(TODAY()-days)
###########################################################
+ # On MS-DOS systems, the standard C library functions are #
+ # not reliable for computing offsets from local time to #
+ # UTC. The following provides a work-around for the #
+ # sunrise() and sunset() functions. Note, however, that #
+ # if Daylight Savings Time is in effect for today(), the #
+ # sun functions return times in DST even for dates on #
+ # which DST is not in effect; the converse can also occur.#
+ # #
+ # Change the timezone to your timezone - the default is #
+ # for EST which is 5 hours (300 minutes) behind UTC. #
+ # The code is correct for places in which Daylight Savings#
+ # Time begins on the last Sunday in March and ends on the #
+ # last Sunday in October. #
+ ###########################################################
+
+ IF OSTYPE() == "MSDOS"
+ # Eastern Standard Time
+ SET TimeZone -300
+
+ # Use --8 rather than --7 because we want the last day BEFORE
+ # the time switch occurs.
+ REM Sun 1 Apr --8 SATISFY 1
+ SET BegDst TRIGDATE()
+
+ REM Sun 1 Nov --8 SATISFY 1
+ SET EndDst TRIGDATE()
+
+ SET $CalcUTC 0
+
+ # Check out the following IF statement and figure out why it works!
+ IF EndDst < BegDst
+ # Daylight Savings Time
+ SET $MinsFromUTC TimeZone+60
+ ELSE
+ # Standard Time
+ SET $MinsFromUTC TimeZone
+ ENDIF
+ ENDIF
+
+ ###########################################################
# Function which returns a string in "am/pm" format based #
# on the time. For example, set a am_pm(NOW())... #
###########################################################
***************
*** 219,226 ****
# on 2 Jan rather than 8 Jan. We add 6 to TRIGDATE() in _IsMortDate to
# compensate.
! REM 2 Jan 1993 *14 SATISFY _IsMortDate(TRIGDATE()+6)
! REM [TRIGGER(TRIGDATE())] ++4 MSG %"Schedule mortgage payment%" for %a.
# Now the mail reminder two weeks before the payment date - because two
# weeks before a payment date is also a payment date, no pre-compensation
--- 259,266 ----
# on 2 Jan rather than 8 Jan. We add 6 to TRIGDATE() in _IsMortDate to
# compensate.
! REM 2 Jan 1993 *14 ++4 SATISFY [_IsMortDate(TRIGDATE()+6)] \
! MSG %"Schedule mortgage payment%" for %a.
# Now the mail reminder two weeks before the payment date - because two
# weeks before a payment date is also a payment date, no pre-compensation
***************
*** 227,242 ****
# in the starting date of 8 Jan is necessary - convince yourself of this!
# This uses the _mail() function defined earlier.
! REM 8 Jan 1993 *14 SATISFY _IsMortDate(TRIGDATE()+14)
! REM [TRIGGER(TRIGDATE())] ONCE RUN [_mail("Decatur Federal", \
! "Pay mortgage by the " + ORD(DAY(TRIGDATE()+14)))]
# Make an entry on the calendar when the mortgage should be paid
! REM 8 Jan 1993 *14 SATISFY _IsMortDate(TRIGDATE())
! REM [TRIGGER(TRIGDATE())] CAL Mortgage payment
#USHOLS
#############################################################################
# #
--- 267,312 ----
# in the starting date of 8 Jan is necessary - convince yourself of this!
# This uses the _mail() function defined earlier.
! REM ONCE 8 Jan 1993 *14 SATISFY [_IsMortDate(TRIGDATE()+14)] \
! RUN [_mail("Decatur Federal", \
! "Pay mortgage by the " + ORD(DAY(TRIGDATE()+14)))]
# Make an entry on the calendar when the mortgage should be paid
! REM 8 Jan 1993 *14 SATISFY [_IsMortDate(TRIGDATE())] \
! CAL Mortgage payment
+ #PSSTUFF
+ ##########################################################################
+ # #
+ # This portion of the file contains some cute examples of the new #
+ # PS-type reminders. You need a PostScript printer or viewer to #
+ # appreciate these. To use them, pipe the output of remind -p into the #
+ # rem2ps program. #
+ # #
+ ##########################################################################
+ # Convenient to stick all the PostScript code in a string var - makes
+ # reminders easier to understand. The variable "shade" will contain
+ # PostScript code to shade in a particular box on the calendar.
+ SET shade \
+ "/_A LineWidth 2 div def \
+ _A _A moveto \
+ BoxWidth _A sub _A lineto \
+ BoxWidth _A sub BoxHeight _A sub lineto \
+ _A BoxHeight _A sub lineto \
+ closepath 0.95 setgray fill 0.0 setgray"
+
+ # The following reminder will shade the Saturday and Sunday calendar
+ # entries.
+ REM Sat Sun PS [shade]
+
+ # The following will fill in the Hebrew dates on the calendar. For this
+ # example, I recommend that you use the "-sd 10" option for rem2ps.
+ REM PS Border BoxHeight Border sub DaySize sub moveto \
+ /DayFont findfont DaySize scalefont setfont \
+ ([hebday(today())] [hebmon(today())]) show
+
#USHOLS
#############################################################################
# #
***************
*** 245,260 ****
# #
#############################################################################
! IF !DEFINED("easter")
! SET a YEAR(TODAY())
! SET b (a/100 - (a/100 + 8) % 25 + 1) / 3
! SET c (a%19*19 + a/100 - a/400 - b + 15) % 30
! SET d (32 + a/100%4*2 + (a%100/4*2) - c - a%100%4) % 7
! SET e c + d - (((a%19) + c*11 + d*22) / 451) * 7 + 114
! SET easter DATE(a, e / 31, e % 31 + 1)
! PRESERVE easter
! ENDIF
!
REM [TRIGGER(easter-46)] MSG %"Ash Wednesday%"
REM [TRIGGER(easter-7)] MSG %"Palm Sunday%"
OMIT [TRIGGER(easter-2)] MSG %"Good Friday%"
--- 315,322 ----
# #
#############################################################################
! SET SaveTrig $NumTrig
! SET easter EASTERDATE(YEAR(TODAY()))
REM [TRIGGER(easter-46)] MSG %"Ash Wednesday%"
REM [TRIGGER(easter-7)] MSG %"Palm Sunday%"
OMIT [TRIGGER(easter-2)] MSG %"Good Friday%"
***************
*** 292,299 ****
REM Sun [_last(Oct)] MSG Daylight Savings Time - %"DST over%"
REM Oct 30 MSG %"Mischief Night%"
REM Oct 31 MSG %"Halloween%"
! REM Tue Nov 2 SCANFROM [_back(7)] SATISFY (YEAR(TRIGDATE()) % 4) == 0
! REM [_trig()] MSG %"Election%" Day
REM Thu Nov [Week_4] SCANFROM [_back(7)] SATISFY 1
OMIT [_trig()] MSG %"Thanksgiving%" Day
REM Fri Nov [Week_4+1] SCANFROM [_back(7)] SATISFY 1
--- 354,362 ----
REM Sun [_last(Oct)] MSG Daylight Savings Time - %"DST over%"
REM Oct 30 MSG %"Mischief Night%"
REM Oct 31 MSG %"Halloween%"
! REM Tue Nov 2 SCANFROM [_back(7)] \
! SATISFY [(YEAR(TRIGDATE()) % 4) == 0] \
! MSG %"Election%" Day
REM Thu Nov [Week_4] SCANFROM [_back(7)] SATISFY 1
OMIT [_trig()] MSG %"Thanksgiving%" Day
REM Fri Nov [Week_4+1] SCANFROM [_back(7)] SATISFY 1
***************
*** 301,306 ****
--- 364,381 ----
OMIT Dec 24 MSG %"Christmas Eve%"
OMIT Dec 25 MSG %"Christmas%" Day
+ ##########################################################################
+ # #
+ # The next block uses the shade variable defined in PSSTUFF above. #
+ # If any US holidays were triggered above, shade in the calendar #
+ # entry in PostScript. This is not quite correct, as it blots out the #
+ # other PostScript stuff above. I was too lazy to do it properly :-) #
+ # #
+ ##########################################################################
+ if $NumTrig > SaveTrig
+ REM PS [shade]
+ endif
+
# Seasons (valid from 1992 to 2000)...
REM Mar 20 MSG %"Spring%" begins
REM Jun [IIF(YEAR(TODAY())%4, 21, 20)] MSG %"Summer%" begins
***************
*** 315,325 ****
# dates were obtained from "The First Jewish Catalog" by Richard Siegel #
# and Michael and Sharon Strassfeld, published by the Jewish Publication #
# Society of America. The Reform version of the calendar was guessed #
! # at by David Skoll based on experience # I welcome corrections. #
# #
- # You (probably) want to add deltas to some of the reminders so that #
- # you are given advance notice of Jewish holidays. #
- # #
##########################################################################
# Here are some general functions that you might find nice to use
--- 390,397 ----
# dates were obtained from "The First Jewish Catalog" by Richard Siegel #
# and Michael and Sharon Strassfeld, published by the Jewish Publication #
# Society of America. The Reform version of the calendar was guessed #
! # at by David Skoll based on experience. I welcome corrections. #
# #
##########################################################################
# Here are some general functions that you might find nice to use
***************
*** 348,429 ****
SET InIsrael VALUE("InIsrael", 0)
SET Reform VALUE("Reform", 0)
! [_h(1, "Tishrey")] MSG Rosh Hashana 1
# No RH-2 or Tzom Gedalia in Reform
IF !Reform
! [_h(2, "Tishrey")] MSG Rosh Hashana 2
! [_h(3, "Tishrey")] MSG Tzom Gedalia
ENDIF
! [_h(10, "Tishrey")] MSG Yom Kippur
! [_h(15, "Tishrey")] MSG Sukkot 1
IF !InIsrael
! [_h(16, "Tishrey")] MSG Sukkot 2
ENDIF
! [_h(21, "Tishrey")] MSG Hashana Rabba
! [_h(22, "Tishrey")] MSG Shemini Atzeret
IF InIsrael
! [_h(22, "Tishrey")] MSG Simchat Torah
ELSE
! [_h(23, "Tishrey")] MSG Simchat Torah
ENDIF
# Because Kislev can change length, we must be more careful about Chanukah
FSET _chan(x) TRIGGER(HEBDATE(24, "Kislev", today()-9)+x)
! [_chan(1)] MSG Chanukah 1
! [_chan(2)] MSG Chanukah 2
! [_chan(3)] MSG Chanukah 3
! [_chan(4)] MSG Chanukah 4
! [_chan(5)] MSG Chanukah 5
! [_chan(6)] MSG Chanukah 6
! [_chan(7)] MSG Chanukah 7
! [_chan(8)] MSG Chanukah 8
# Not sure about Reform's position on the next one.
IF !Reform
! [_h(10, "Tevet")] MSG Asara B'Tevet
ENDIF
! [_h(15, "Shvat")] MSG Tu B'Shvat
! [_h(15, "Adar A")] MSG Purim Katan
! [_h(13, "Adar")] MSG Fast of Esther
! [_h(14, "Adar")] MSG Purim
! [_h(15, "Nisan")] MSG Pesach
IF !InIsrael
! [_h(16, "Nisan")] MSG Pesach 2
ENDIF
! [_h(21, "Nisan")] MSG Pesach 7
IF !InIsrael && !Reform
! [_h(22, "Nisan")] MSG Pesach 8
ENDIF
! [_h(27, "Nisan")] MSG Yom HaShoah
! [_h(4, "Iyar")] MSG Yom HaZikaron
! [_h(5, "Iyar")] MSG Yom Ha'atzmaut
# Not sure about Reform's position on Lag B'Omer
IF !Reform
! [_h(18, "Iyar")] MSG Lag B'Omer
ENDIF
! [_h(28, "Iyar")] MSG Yom Yerushalayim
! [_h(6, "Sivan")] MSG Shavuot
IF !InIsrael && !Reform
! [_h(7, "Sivan")] MSG Shavuot 2
ENDIF
# Fairly sure Reform Jews don't observe the next two
IF !Reform
! [_h(17, "Tamuz")] MSG Fast of 17th of Tammuz
! [_h(9, "Av")] MSG Tish'a B'Av
ENDIF
# Counting the omer - do the whole spiel, i.e:
--- 420,501 ----
SET InIsrael VALUE("InIsrael", 0)
SET Reform VALUE("Reform", 0)
! [_h(1, "Tishrey")] ++4 MSG %"Rosh Hashana 1%" is %b.
# No RH-2 or Tzom Gedalia in Reform
IF !Reform
! [_h(2, "Tishrey")] ++4 MSG %"Rosh Hashana 2%" is %b.
! [_h(3, "Tishrey")] ++4 MSG %"Tzom Gedalia%" is %b.
ENDIF
! [_h(10, "Tishrey")] ++4 MSG %"Yom Kippur%" is %b.
! [_h(15, "Tishrey")] ++4 MSG %"Sukkot 1%" is %b.
IF !InIsrael
! [_h(16, "Tishrey")] MSG %"Sukkot 2%"
ENDIF
! [_h(21, "Tishrey")] ++4 MSG %"Hashana Rabba%" is %b.
! [_h(22, "Tishrey")] ++4 MSG %"Shemini Atzeret%" is %b.
IF InIsrael
! [_h(22, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
ELSE
! [_h(23, "Tishrey")] ++4 MSG %"Simchat Torah%" is %b.
ENDIF
# Because Kislev can change length, we must be more careful about Chanukah
FSET _chan(x) TRIGGER(HEBDATE(24, "Kislev", today()-9)+x)
! [_chan(1)] ++4 MSG %"Chanukah 1%" is %b.
! [_chan(2)] MSG %"Chanukah 2%"
! [_chan(3)] MSG %"Chanukah 3%"
! [_chan(4)] MSG %"Chanukah 4%"
! [_chan(5)] MSG %"Chanukah 5%"
! [_chan(6)] MSG %"Chanukah 6%"
! [_chan(7)] MSG %"Chanukah 7%"
! [_chan(8)] MSG %"Chanukah 8%"
# Not sure about Reform's position on the next one.
IF !Reform
! [_h(10, "Tevet")] ++4 MSG %"Asara B'Tevet%" is %b.
ENDIF
! [_h(15, "Shvat")] ++4 MSG %"Tu B'Shvat%" is %b.
! [_h(15, "Adar A")] ++4 MSG %"Purim Katan%" is %b.
! [_h(13, "Adar")] ++4 MSG %"Fast of Esther%" is %b.
! [_h(14, "Adar")] ++4 MSG %"Purim%" is %b.
! [_h(15, "Nisan")] ++4 MSG %"Pesach%" is %b.
IF !InIsrael
! [_h(16, "Nisan")] MSG %"Pesach 2%"
ENDIF
! [_h(21, "Nisan")] MSG %"Pesach 7%"
IF !InIsrael && !Reform
! [_h(22, "Nisan")] MSG %"Pesach 8%"
ENDIF
! [_h(27, "Nisan")] ++4 MSG %"Yom HaShoah%" is %b.
! [_h(4, "Iyar")] ++4 MSG %"Yom HaZikaron%" is %b.
! [_h(5, "Iyar")] ++4 MSG %"Yom Ha'atzmaut%" is %b.
# Not sure about Reform's position on Lag B'Omer
IF !Reform
! [_h(18, "Iyar")] ++4 MSG %"Lag B'Omer%" is %b.
ENDIF
! [_h(28, "Iyar")] ++4 MSG %"Yom Yerushalayim%" is %b.
! [_h(6, "Sivan")] ++4 MSG %"Shavuot%" is %b.
IF !InIsrael && !Reform
! [_h(7, "Sivan")] MSG %"Shavuot 2%"
ENDIF
# Fairly sure Reform Jews don't observe the next two
IF !Reform
! [_h(17, "Tamuz")] ++4 MSG %"Fast of 17th of Tammuz%" is %b.
! [_h(9, "Av")] ++4 MSG %"Tish'a B'Av%" is %b.
ENDIF
# Counting the omer - do the whole spiel, i.e:
***************
*** 444,476 ****
CAL [ORD(odays)] of Omer
ENDIF
! #PSSTUFF
! ##########################################################################
! # #
! # This portion of the file contains some cute examples of the new #
! # PS-type reminders. You need a PostScript printer or viewer to #
! # appreciate these. To use them, pipe the output of remind -p into the #
! # rem2ps program. #
! # #
! ##########################################################################
! # Convenient to stick all the PostScript code in a string var - makes
! # reminders easier to understand. The variable "shade" will contain
! # PostScript code to shade in a particular box on the calendar.
! SET shade \
! "/_A LineWidth 2 div def \
! _A _A moveto \
! BoxWidth _A sub _A lineto \
! BoxWidth _A sub BoxHeight _A sub lineto \
! _A BoxHeight _A sub lineto \
! closepath 0.95 setgray fill 0.0 setgray"
!
! # The following reminder will shade the Saturday and Sunday calendar
! # entries.
! REM Sat Sun PS [shade]
!
! # The following will fill in the Hebrew dates on the calendar. For this
! # example, I recommend that you use the "-sd 10" option for rem2ps.
! REM PS Border BoxHeight Border sub DaySize sub moveto \
! /DayFont findfont DaySize scalefont setfont \
! ([hebday(today())] [hebmon(today())]) show
--- 516,525 ----
CAL [ORD(odays)] of Omer
ENDIF
! ### Candle lighting and Havdalah. You should probably add candle lighting
! ### for other holidays besides Shabbat. These just create calendar entries
! ### for Friday and Saturday. Note: You must set your latitude, longitude
! ### and possibly time zone for these to work properly!
! REM Friday CAL Candle lighting at [sunset(trigdate())-18]
! REM Saturday CAL Havdalah at [sunset(trigdate())+42]
*** ../p6/dorem.c Fri Apr 30 13:16:27 1993
--- ./dorem.c Mon Jun 28 12:58:03 1993
***************
*** 48,62 ****
TimeTrig tim;
int r;
int jul;
/* Parse the trigger date and time */
if ( (r=ParseRem(p, &trig, &tim)) ) return r;
if (trig.typ == NO_TYPE) return E_EOLN;
! if (trig.typ == SAT_TYPE) return DoSatRemind(&trig, &tim, p);
/* Calculate the trigger date */
! jul = ComputeTrigger(trig.scanfrom, &trig, &r);
! if (r) return r;
/* Queue the reminder, if necessary */
#ifdef HAVE_QUEUED
--- 48,76 ----
TimeTrig tim;
int r;
int jul;
+ char buf[TOKSIZE];
+ Token tok;
/* Parse the trigger date and time */
if ( (r=ParseRem(p, &trig, &tim)) ) return r;
if (trig.typ == NO_TYPE) return E_EOLN;
! if (trig.typ == SAT_TYPE) {
! r=DoSatRemind(&trig, &tim, p);
! if (r) return r;
! r=ParseToken(p, buf);
! if (r) return r;
! FindToken(buf, &tok);
! if (tok.type == T_Empty || tok.type == T_Comment) return OK;
! if (tok.type != T_RemType || tok.val == SAT_TYPE) return E_PARSE_ERR;
! trig.typ = tok.val;
! jul = LastTriggerDate;
! if (!LastTrigValid) return OK;
! } else {
/* Calculate the trigger date */
! jul = ComputeTrigger(trig.scanfrom, &trig, &r);
! if (r) return r;
! }
/* Queue the reminder, if necessary */
#ifdef HAVE_QUEUED
***************
*** 228,234 ****
return OK;
default:
! Eprint("Unknown token in REM command: %s", TokBuffer);
return E_PARSE_ERR;
}
}
--- 242,248 ----
return OK;
default:
! Eprint("Unknown token in trigger: %s", TokBuffer);
return E_PARSE_ERR;
}
}
***************
*** 601,608 ****
{
int iter, jul, r;
Value v;
! char *s;
iter = 0;
jul = trig->scanfrom;
while (iter++ < MaxSatIter) {
--- 615,623 ----
{
int iter, jul, r;
Value v;
! char *s, *t;
+ t = p->pos;
iter = 0;
jul = trig->scanfrom;
while (iter++ < MaxSatIter) {
***************
*** 612,624 ****
}
s = p->pos;
r = EvaluateExpr(p, &v);
! p->pos = s;
if (r) return r;
if (v.type != INT_TYPE && v.type != STR_TYPE) return E_BAD_TYPE;
if (v.type == INT_TYPE && v.v.val) return OK;
if (v.type == STR_TYPE && *v.v.str) return OK;
jul++;
}
LastTrigValid = 0;
return OK;
}
--- 627,641 ----
}
s = p->pos;
r = EvaluateExpr(p, &v);
! t = p->pos;
if (r) return r;
if (v.type != INT_TYPE && v.type != STR_TYPE) return E_BAD_TYPE;
if (v.type == INT_TYPE && v.v.val) return OK;
if (v.type == STR_TYPE && *v.v.str) return OK;
+ p->pos = s;
jul++;
}
+ p->pos = t;
LastTrigValid = 0;
return OK;
}
*** ../p6/err.h Thu Apr 22 10:24:04 1993
--- ./err.h Mon Jun 28 12:29:30 1993
***************
*** 56,61 ****
--- 56,63 ----
#define E_PARSE_AS_REM 44 /* Not really an error - just returned by
DoOmit to indicate line should be executed
as a REM statement, also. */
+ #define E_CANT_MODIFY 45
+ #define E_MKTIME_PROBLEM 46
#ifdef MK_GLOBALS
#undef EXTERN
#define EXTERN
***************
*** 112,118 ****
"Domain error",
"Invalid identifier",
"Recursive function call detected",
! ""
}
#endif
;
--- 114,122 ----
"Domain error",
"Invalid identifier",
"Recursive function call detected",
! "",
! "Cannot modify system variable",
! "C library function can't represent date/time"
}
#endif
;
*** ../p6/expr.c Thu Apr 22 11:00:23 1993
--- ./expr.c Mon Jun 28 12:29:43 1993
***************
*** 239,245 ****
if (c == '\'') return OK ; else return E_MISS_QUOTE;
}
! if (!ISID(c)) {
Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], c);
return E_ILLEGAL_CHAR;
}
--- 239,245 ----
if (c == '\'') return OK ; else return E_MISS_QUOTE;
}
! if (!ISID(c) && c != '$') {
Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], c);
return E_ILLEGAL_CHAR;
}
***************
*** 306,312 ****
int args; /* Number of function arguments */
Operator op, op2;
Value va;
! char *ufname;
OpBase = OpStackPtr;
ValBase = ValStackPtr;
--- 306,312 ----
int args; /* Number of function arguments */
Operator op, op2;
Value va;
! char *ufname = NULL; /* Stop GCC from complaining about use of uninit var */
OpBase = OpStackPtr;
ValBase = ValStackPtr;
***************
*** 366,372 ****
r = PushOpStack(f);
if (r) return r;
continue; /* Still looking for an atomic vlue */
! } else if (!ISID(*ExprBuf) && *ExprBuf != '"' && *ExprBuf != '\'') {
Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
return E_ILLEGAL_CHAR;
} else { /* Must be a literal value */
--- 366,373 ----
r = PushOpStack(f);
if (r) return r;
continue; /* Still looking for an atomic vlue */
! } else if (!ISID(*ExprBuf) && *ExprBuf != '$'
! && *ExprBuf != '"' && *ExprBuf != '\'') {
Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], *ExprBuf);
return E_ILLEGAL_CHAR;
} else { /* Must be a literal value */
***************
*** 483,488 ****
--- 484,500 ----
v->type = INT_TYPE;
v->v.val = len;
return OK;
+ } else if (*s == '$') { /* A system variable */
+ if (DebugFlag & DB_PRTEXPR)
+ fprintf(ErrFp, "%s => ", s);
+ r = GetSysVar(s+1, v);
+
+ if (! (DebugFlag & DB_PRTEXPR)) return r;
+ if (r == OK) {
+ PrintValue(v, ErrFp);
+ putc('\n', ErrFp);
+ }
+ return r;
} else /* Must be a symbol */
if (DebugFlag & DB_PRTEXPR)
fprintf(ErrFp, "%s => ", s);
*** ../p6/funcs.c Mon May 3 12:30:00 1993
--- ./funcs.c Fri Jul 16 15:23:44 1993
***************
*** 19,24 ****
--- 19,25 ----
#endif
#include <string.h>
#include <ctype.h>
+ #include <math.h>
#ifdef UNIX
#ifdef HAVE_UNISTD
#include <unistd.h>
***************
*** 58,63 ****
--- 59,66 ----
PRIVATE int FDaysinmon ARGS ((void));
PRIVATE int FDefined ARGS ((void));
PRIVATE int FDosubst ARGS ((void));
+ PRIVATE int FEasterdate ARGS ((void));
+ PRIVATE int FFiledir ARGS ((void));
PRIVATE int FFilename ARGS ((void));
PRIVATE int FGetenv ARGS ((void));
PRIVATE int FHebdate ARGS ((void));
***************
*** 67,77 ****
--- 70,82 ----
PRIVATE int FHour ARGS ((void));
PRIVATE int FIif ARGS ((void));
PRIVATE int FIndex ARGS ((void));
+ PRIVATE int FIsdst ARGS ((void));
PRIVATE int FIsomitted ARGS ((void));
PRIVATE int FLanguage ARGS ((void));
PRIVATE int FMax ARGS ((void));
PRIVATE int FMin ARGS ((void));
PRIVATE int FMinute ARGS ((void));
+ PRIVATE int FMinsfromutc ARGS ((void));
PRIVATE int FMon ARGS ((void));
PRIVATE int FMonnum ARGS ((void));
PRIVATE int FOrd ARGS ((void));
***************
*** 81,86 ****
--- 86,93 ----
PRIVATE int FShell ARGS ((void));
PRIVATE int FStrlen ARGS ((void));
PRIVATE int FSubstr ARGS ((void));
+ PRIVATE int FSunrise ARGS ((void));
+ PRIVATE int FSunset ARGS ((void));
PRIVATE int FTime ARGS ((void));
PRIVATE int FTrigdate ARGS ((void));
PRIVATE int FTrigtime ARGS ((void));
***************
*** 100,105 ****
--- 107,113 ----
PRIVATE int FTrigger ARGS ((void));
PRIVATE int CheckArgs ARGS ((Operator *f, int nargs));
PRIVATE int CleanUpAfterFunc ARGS ((void));
+ PRIVATE int SunStuff ARGS ((int rise, double cosz, int jul));
#ifdef __MSDOS__
PRIVATE FILE *popen ARGS((char *cmd, char *mode));
***************
*** 161,169 ****
{ "daysinmon", 2, 2, FDaysinmon },
{ "defined", 1, 1, FDefined },
{ "dosubst", 1, 3, FDosubst },
{ "filename", 0, 0, FFilename },
{ "getenv", 1, 1, FGetenv },
! { "hebdate", 2, 4, FHebdate },
{ "hebday", 1, 1, FHebday },
{ "hebmon", 1, 1, FHebmon },
{ "hebyear", 1, 1, FHebyear },
--- 169,179 ----
{ "daysinmon", 2, 2, FDaysinmon },
{ "defined", 1, 1, FDefined },
{ "dosubst", 1, 3, FDosubst },
+ { "easterdate", 1, 1, FEasterdate },
+ { "filedir", 0, 0, FFiledir },
{ "filename", 0, 0, FFilename },
{ "getenv", 1, 1, FGetenv },
! { "hebdate", 2, 5, FHebdate },
{ "hebday", 1, 1, FHebday },
{ "hebmon", 1, 1, FHebmon },
{ "hebyear", 1, 1, FHebyear },
***************
*** 170,175 ****
--- 180,186 ----
{ "hour", 1, 1, FHour },
{ "iif", 1, NO_MAX, FIif },
{ "index", 2, 3, FIndex },
+ { "isdst", 0, 2, FIsdst },
{ "isleap", 1, 1, FIsleap },
{ "isomitted", 1, 1, FIsomitted },
{ "language", 0, 0, FLanguage },
***************
*** 176,181 ****
--- 187,193 ----
{ "lower", 1, 1, FLower },
{ "max", 1, NO_MAX, FMax },
{ "min", 1, NO_MAX, FMin },
+ { "minsfromutc", 0, 2, FMinsfromutc },
{ "minute", 1, 1, FMinute },
{ "mon", 1, 1, FMon },
{ "monnum", 1, 1, FMonnum },
***************
*** 188,193 ****
--- 200,207 ----
{ "shell", 1, 1, FShell },
{ "strlen", 1, 1, FStrlen },
{ "substr", 2, 3, FSubstr },
+ { "sunrise", 0, 1, FSunrise},
+ { "sunset", 0, 1, FSunset },
{ "time", 2, 2, FTime },
{ "today", 0, 0, FToday },
{ "trigdate", 0, 0, FTrigdate },
***************
*** 417,426 ****
it won't be destroyed */
DCOPYVAL(RetVal, ARG(1));
! if (StriEq(s, "int")) return DoCoerce(INT_TYPE, &RetVal);
! else if (StriEq(s, "date")) return DoCoerce(DATE_TYPE, &RetVal);
! else if (StriEq(s, "time")) return DoCoerce(TIM_TYPE, &RetVal);
! else if (StriEq(s, "string")) return DoCoerce(STR_TYPE, &RetVal);
else return E_CANT_COERCE;
}
--- 431,440 ----
it won't be destroyed */
DCOPYVAL(RetVal, ARG(1));
! if (! StrCmpi(s, "int")) return DoCoerce(INT_TYPE, &RetVal);
! else if (! StrCmpi(s, "date")) return DoCoerce(DATE_TYPE, &RetVal);
! else if (! StrCmpi(s, "time")) return DoCoerce(TIM_TYPE, &RetVal);
! else if (! StrCmpi(s, "string")) return DoCoerce(STR_TYPE, &RetVal);
else return E_CANT_COERCE;
}