home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-12-18 | 31.9 KB | 1,082 lines |
- Prereq: "03.00.00"
- *** ../p0/version.h Mon Nov 9 14:12:11 1992
- --- ./version.h Wed Dec 16 10:51:27 1992
- ***************
- *** 5,12 ****
- /* What version of remind do we have? */
- /* */
- /* This file is part of REMIND. */
- ! /* Copyright (C) 1991 by David F. Skoll. */
- /* */
- /***************************************************************/
-
- ! #define VERSION "03.00.00"
- --- 5,12 ----
- /* What version of remind do we have? */
- /* */
- /* This file is part of REMIND. */
- ! /* Copyright (C) 1992 by David F. Skoll. */
- /* */
- /***************************************************************/
-
- ! #define VERSION "03.00.01"
- *** ../p0/MANIFEST.DOS Mon Nov 9 14:12:36 1992
- --- ./MANIFEST.DOS Wed Dec 16 10:51:55 1992
- ***************
- *** 1,6 ****
- --- 1,7 ----
- calendar.c
- config.h
- copyrigh
- + defs.rem
- dorem.c
- dosubst.c
- err.h
- ***************
- *** 18,23 ****
- --- 19,25 ----
- main.c
- makefile
- makefile.msc
- + makefile.os2
- makefile.tc
- manifest.dos
- manifest.unx
- ***************
- *** 25,36 ****
- --- 27,43 ----
- protos.h
- queue.c
- readme.dos
- + readme.os2
- readme.uni
- rem
- rem.1
- + rem2ps.1
- + rem2ps.c
- + rem2ps.h
- remind-a.csh
- remind-a.sh
- remind.1
- + remind.def
- test-rem
- test.cmp
- test.rem
- *** ../p0/MANIFEST.UNX Mon Nov 9 14:12:36 1992
- --- ./MANIFEST.UNX Wed Dec 16 10:51:55 1992
- ***************
- *** 1,6 ****
- calendar.c
- config.h
- ! COPYRIGHT
- dorem.c
- dosubst.c
- err.h
- --- 1,14 ----
- + COPYRIGHT
- + MANIFEST.DOS
- + MANIFEST.UNX
- + Makefile
- + README.DOS
- + README.OS2
- + README.UNIX
- + WHATSNEW.30
- calendar.c
- config.h
- ! defs.rem
- dorem.c
- dosubst.c
- err.h
- ***************
- *** 16,36 ****
- lnk.msc
- lnk.tc
- main.c
- - Makefile
- makefile.msc
- makefile.tc
- - MANIFEST.DOS
- - MANIFEST.UNX
- omit.c
- protos.h
- queue.c
- - README.DOS
- - README.UNIX
- rem
- rem.1
- remind-all.csh
- remind-all.sh
- remind.1
- test-rem
- test.cmp
- test.rem
- --- 24,44 ----
- lnk.msc
- lnk.tc
- main.c
- makefile.msc
- + makefile.os2
- makefile.tc
- omit.c
- protos.h
- queue.c
- rem
- rem.1
- + rem2ps.1
- + rem2ps.c
- + rem2ps.h
- remind-all.csh
- remind-all.sh
- remind.1
- + remind.def
- test-rem
- test.cmp
- test.rem
- ***************
- *** 41,44 ****
- utils.c
- var.c
- version.h
- - WHATSNEW.30
- --- 49,51 ----
- *** ../p0/Makefile Mon Nov 9 14:12:26 1992
- --- ./Makefile Wed Dec 16 10:54:10 1992
- ***************
- *** 7,13 ****
- # Uncomment the next line if you are running on a SYSV system
- # SYSV= -DSYSV
-
- ! # Uncomment the next line if you are running on any type of UNIX system
- UNIX= -DUNIX
-
- # Uncomment the next line if you want to use gcc instead of default compiler
- --- 7,13 ----
- # Uncomment the next line if you are running on a SYSV system
- # SYSV= -DSYSV
-
- ! # Uncomment the next line if you are running under UNIX (including SYSV!)
- UNIX= -DUNIX
-
- # Uncomment the next line if you want to use gcc instead of default compiler
- ***************
- *** 17,27 ****
- CFLAGS= -O -ansi
- CDEFS=
-
- #-----------------------------------------------------------------------------
- # 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.00
-
- HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
- STDHDRS= config.h types.h protos.h globals.h err.h
- --- 17,51 ----
- CFLAGS= -O -ansi
- CDEFS=
-
- + #### INSTALLATION LOCATIONS ####
- + # Note that I use 'cp' rather than 'install' for improved portability.
- + #
- + # BINDIR: Where should the Remind executable be installed?
- + BINDIR= /usr/local/bin
- +
- + # SCRIPTDIR: Where should the kall and rem shell scripts be installed?
- + SCRIPTDIR= /usr/share/bin
- +
- + # MANDIR: Where should the man pages be installed?
- + MANDIR= /usr/local/man
- +
- + # MANSECT: Which man section should the man pages go into?
- + MANSECT= 1
- +
- + # EXEMODE: What file protection mode should be used for the executables?
- + EXEMODE= 755
- +
- + # MANMODE: What file protection mode should be used for the man pages?
- + MANMODE= 644
- +
- + # OWNER: What owner and group to use for executables, scripts and man pages?
- + OWNER=bin.bin
- +
- #-----------------------------------------------------------------------------
- # 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.01
-
- HDRS= config.h err.h expr.h globals.h protos.h types.h version.h
- STDHDRS= config.h types.h protos.h globals.h err.h
- ***************
- *** 30,48 ****
-
- MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
- remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
- ! makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1
-
- OBJS= $(SRCS:.c=.o)
-
- ! remind: $(OBJS)
- ! $(CC) -o remind $(OBJS)
-
- .c.o:
- $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
-
- clean:
- rm -f *.o *~
-
- calendar.o: calendar.c $(STDHDRS) expr.h
- dorem.o: dorem.c $(STDHDRS) expr.h
- dosubst.o: dosubst.c $(STDHDRS)
- --- 54,79 ----
-
- MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
- remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
- ! makefile.msc lnk.msc lnk.tc MANIFEST.UNX MANIFEST.DOS WHATSNEW.30 kall kall.1 \
- ! defs.rem README.OS2 makefile.os2 rem2ps.c rem2ps.h remind.def rem2ps.1
-
- OBJS= $(SRCS:.c=.o)
-
- ! all: remind rem2ps
-
- .c.o:
- $(CC) $(UNIX) $(SYSV) -c -o $*.o $(CFLAGS) $(CDEFS) $*.c
-
- + rem2ps: rem2ps.o
- + $(CC) -o rem2ps rem2ps.o
- +
- + remind: $(OBJS)
- + $(CC) -o remind $(OBJS)
- +
- clean:
- rm -f *.o *~
-
- + rem2ps.o: rem2ps.c
- calendar.o: calendar.c $(STDHDRS) expr.h
- dorem.o: dorem.c $(STDHDRS) expr.h
- dosubst.o: dosubst.c $(STDHDRS)
- ***************
- *** 61,75 ****
- var.o: var.c $(STDHDRS) expr.h
-
- tarZ:
- ! tar cvf remind-3.0.0.tar $(MANIFEST)
- ! compress -v remind-3.0.0.tar
-
- shar:
- shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
-
- todos:
- - mdel 'a:*.*'
- - mdel 'a:*'
- mcopy -tn $(MANIFEST) a:
-
- fromdos:
- --- 92,104 ----
- var.o: var.c $(STDHDRS) expr.h
-
- tarZ:
- ! tar cvf remind-3.0.1.tar $(MANIFEST)
- ! compress -v remind-3.0.1.tar
-
- shar:
- shar -x -n"Remind $(VERSION)" -l45 -o./Shar $(MANIFEST)
-
- todos:
- mcopy -tn $(MANIFEST) a:
-
- fromdos:
- ***************
- *** 76,81 ****
- --- 105,111 ----
- mcopy -tn 'a:*' .
- -mv -f copyrigh COPYRIGHT
- -mv -f makefile Makefile
- + -mv -f readme.os2 README.OS2
- -mv -f readme.dos README.DOS
- -mv -f readme.uni README.UNIX
- -mv -f remind-a.csh remind-all.csh
- ***************
- *** 89,92 ****
- cp $(MANIFEST) ../backup
-
- transmit:
- ! sz -a -Z -e $(MANIFEST)
- --- 119,154 ----
- cp $(MANIFEST) ../backup
-
- transmit:
- ! sz -a -e $(MANIFEST)
- !
- ! install: install-bin install-scripts install-man
- !
- ! install-bin: remind rem2ps
- ! cp remind $(BINDIR)/remind
- ! -chmod $(EXEMODE) $(BINDIR)/remind
- ! -chown $(OWNER) $(BINDIR)/remind
- ! cp rem2ps $(BINDIR)/rem2ps
- ! -chmod $(EXEMODE) $(BINDIR)/rem2ps
- ! -chown $(OWNER) $(BINDIR)/rem2ps
- !
- ! install-scripts:
- ! cp kall $(SCRIPTDIR)/kall
- ! -chmod $(EXEMODE) $(SCRIPTDIR)/kall
- ! -chown $(OWNER) $(SCRIPTDIR)/kall
- ! cp rem $(SCRIPTDIR)/rem
- ! -chmod $(EXEMODE) $(SCRIPTDIR)/rem
- ! -chown $(OWNER) $(SCRIPTDIR)/rem
- !
- ! install-man:
- ! cp remind.1 $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
- ! -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
- ! -chown $(OWNER) $(MANDIR)/man$(MANSECT)/remind.$(MANSECT)
- ! cp rem.1 $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
- ! -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
- ! -chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem.$(MANSECT)
- ! cp kall.1 $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
- ! -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
- ! -chown $(OWNER) $(MANDIR)/man$(MANSECT)/kall.$(MANSECT)
- ! cp rem2ps.1 $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
- ! -chmod $(MANMODE) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
- ! -chown $(OWNER) $(MANDIR)/man$(MANSECT)/rem2ps.$(MANSECT)
- *** ../p0/README.DOS Mon Nov 9 14:12:05 1992
- --- ./README.DOS Wed Dec 16 10:51:22 1992
- ***************
- *** 15,19 ****
- --- 15,27 ----
-
- This will create REMIND.EXE, which is ready to be executed.
-
- + The file "defs.rem" has some sample Remind definitions and commands.
- +
- --
- David F. Skoll <dfs@doe.carleton.ca>
- + 4-317 LeBreton Street South
- + Ottawa, Ontario K1S 4L4
- + CANADA
- +
- + Tel. (613) 567-3662
- +
- *** ../p0/README.UNIX Mon Nov 9 14:12:05 1992
- --- ./README.UNIX Wed Dec 16 10:51:21 1992
- ***************
- *** 16,25 ****
-
- 5 - Type 'make'
-
- ! 6 - Type 'test-rem' to run the acceptance test
-
- ! 7 - Copy the remind executable to the appropriate directory, and copy
- ! the man page to the man directory.
-
- Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
- These allow automatic mailing of reminders to all users who create a
- --- 16,25 ----
-
- 5 - Type 'make'
-
- ! 6 - Type 'sh test-rem' to run the acceptance test
-
- ! 7 - Type 'make install' to install Remind, kall, rem and the man
- ! pages.
-
- Two shell scripts, "remind-all.csh" and "remind-all.sh" are provided.
- These allow automatic mailing of reminders to all users who create a
- ***************
- *** 38,46 ****
- --- 38,61 ----
- is provided. You should examine the script to ensure that the defaults
- are correct.
-
- + Many people have asked me why I supply the "rem" script instead of
- + having Remind assume a default file. The answer is: That's how I like
- + it! My personal preference is for a program which normally takes
- + parameters to display usage information when invoked with no
- + parameters. I like that behaviour so I can quickly get an idea of
- + what a program does without poring through the man page. And I think
- + I'll keep Remind that way. Sorry to all who dislike it. :-)
- +
- A shell script called "kall" is provided so you can kill your background
- remind processes when you log out. See the man page. Note that kall
- depends on the output of "ps", and may not be portable.
-
- + The file "defs.rem" has some sample Remind definitions and commands.
- +
- --
- David F. Skoll <dfs@doe.carleton.ca>
- + 4-317 LeBreton Street South
- + Ottawa, Ontario K1S 4L4
- + CANADA
- +
- + Tel. (613) 567-3662
- *** ../p0/WHATSNEW.30 Mon Nov 9 14:12:37 1992
- --- ./WHATSNEW.30 Wed Dec 16 10:51:56 1992
- ***************
- *** 1,5 ****
- --- 1,50 ----
- CHANGES TO REMIND
-
- + *** PLEASE NOTE: AFTER 24 FEBRUARY, 1993, MY NEW ADDRESS WILL BE:
- + 986 Eiffel Avenue,
- + Ottawa, Ontario
- + Canada
- +
- + * Version 3.0 Patch 1
- +
- + - Wrote the Rem2ps program to produce PostScript calendars
- +
- + - Added an 'install' target to the Makefile
- +
- + - Fixed a bug which allowed the shell() function to execute in timed
- + reminders which were queued with RUN disabled.
- +
- + - Added support for OS/2, courtesy of DARREL HANKERSON
- + <HANK@DUCVAX.AUBURN.EDU>
- +
- + - In expressions, can now specify literal dates as 'yyyy/mm/dd' rather than
- + using the date() function.
- +
- + - Fixed all the source files to include "config.h" first.
- +
- + - Changed the way triggers are calculated so that trigger dates are
- + always valid if year, month and day are specified, and there is no
- + UNTIL clause. See MAN page section "DETAILS ABOUT TRIGVALID()."
- +
- + - Defined _POSIX_SOURCE so Remind will compile on SGI workstations (and
- + be more portable... I hope.)
- +
- + - Fixed some rather brain-dead definitions of UPPER and LOWER, as pointed
- + out by <rsalz@osf.org>
- +
- + - Added more details to the Man page concerning how triggers are computed,
- + and added warnings about computing OMIT dates.
- +
- + - Added the file defs.rem which contains examples of useful definitions and
- + triggers.
- +
- + - Changed the script test-rem to be a sh script instead of csh for improved
- + portability.
- +
- + - Fixed up the README.* files to reflect the changes.
- +
- + - Re-formatted the WHATSNEW.30 file.
- +
- * Version 3.0
-
- - Total rewrite from previous versions
- ***************
- *** 21,100 ****
- - Fixed a lurking bug in trigger date calculation which, amazingly, had not
- been caught in the couple of years that Remind has been out!
-
- ! * Version 2.4 Patch 5 - Added the "c+n" option for printing a calendar by
- ! weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
-
- ! * Version 2.3 Patch 4 - Made the init.c file nicer. Made the Makefile
- ! prettier. Added "make test", "make tar" and "make shar" Makefile targets.
-
- ! * Version 2.3 Patch 3 - Added a command-line option for Remind to process
- ! queued reminders in the foreground. This makes automatic termination
- ! of Remind processes from within X-Windows and Sunview easier.
-
- ! * Version 2.3 Patch 2 - Fixed up a problem with timed reminders which resulted
- ! in cursor not starting from left side of screen on some systems.
-
- ! Fixed the SIGINT handler for SYSV systems - this was interrupting the
- ! sleep(2) system call.
-
- ! Closed stdin and stdout if remind was part of a pipe - this prevents other
- ! sections of the pipe from hanging as remind puts itself in the background.
-
- ! Added the "-h" (Hush mode) option
-
- ! Added the "%#" and "%@" modifiers for the current time.
-
- ! Made the Makefile more portable
-
- ! * Version 2.3 Patch 1 - Added the "-t" command-line option to get Remind
- ! to trigger all non-expired reminders.
-
- ! Added Turbo C support courtesy of Rhys Weatherly
-
- ! Added the "RUN ON" and "RUN OFF" commands for a secure interface with
- ! the Elm mail system.
-
- ! Added the "rem" shell script for running Remind with a default script.
-
- ! Added manual pages for "kall" and "rem".
-
- ! * Version 2.3 - Added the UNTIL keyword for forcing reminders to expire.
-
- ! Added the "++" form of 'back' and the "--" form of 'delta' for
- ! ignoring OMIT information.
-
- ! Added the CLEAR-OMIT-CONTEXT, PUSH-OMIT-CONTEXT and POP-OMIT-CONTEXT
- ! keywords for isolating personal or peculiar reminders from the global
- ! OMIT context.
-
- ! Speeded up the parsing of tokens.
-
- ! Changed the source to recognize and exploit ANSI-C compilers which
- ! accept function prototypes.
-
- ! Added the "-n" option to output the next occurrence of each reminder
- ! in SimpleCalendar format
-
- ! Modified the calendar and SimpleCalendar formats so that the % escape
- ! substitutions ARE performed.
-
- ! * Version 2.2 - Patch 5 - Added the BEFORE, AFTER and SKIP tokens to make the
- ! handling of holidays more sensible. Also corrected a few more bugs.
-
- ! * Version 2.2 - Patch 3 - Added the MSG or RUN tokens in an OMIT command; also
- ! allowed RUN-type reminders to be explicitly included in the calendar by
- ! using the %" escape sequence.
-
- ! * Version 2.2 - Added the AT keyword, the timed reminders daemon, and the
- ! calendar facility.
-
- ! * Version 2.1 - Added the "repeat" token for repeating reminders with a period
- ! other than 7 days. Also fixed some bugs from version 2.0
-
- ! * Version 2.0 - first public release. Included advanced date specifications,
- ! character substitution, and the RUN keyword.
-
- ! * Version 1.0 - never publicly released.
-
-
-
- --- 66,169 ----
- - Fixed a lurking bug in trigger date calculation which, amazingly, had not
- been caught in the couple of years that Remind has been out!
-
- ! * Version 2.4 Patch 5
-
- ! - Added the "c+n" option for printing a calendar by
- ! weeks instead of months, courtesy Dennis Cottel (dennis@peanuts.nosc.mil).
-
- ! * Version 2.3 Patch 4
-
- ! - Made the init.c file nicer. Made the Makefile
- ! prettier. Added "make test", "make tar" and "make shar" Makefile targets.
-
- ! * Version 2.3 Patch 3
-
- ! - Added a command-line option for Remind to process
- ! queued reminders in the foreground. This makes automatic termination
- ! of Remind processes from within X-Windows and Sunview easier.
-
- ! * Version 2.3 Patch 2
-
- ! - Fixed up a problem with timed reminders which resulted
- ! in cursor not starting from left side of screen on some systems.
-
- ! - Fixed the SIGINT handler for SYSV systems - this was interrupting the
- ! sleep(2) system call.
-
- ! - Closed stdin and stdout if remind was part of a pipe - this prevents other
- ! sections of the pipe from hanging as remind puts itself in the background.
-
- ! - Added the "-h" (Hush mode) option
-
- ! - Added the "%#" and "%@" modifiers for the current time.
-
- ! - Made the Makefile more portable
-
- ! * Version 2.3 Patch 1
-
- ! - Added the "-t" command-line option to get Remind
- ! to trigger all non-expired reminders.
-
- ! - Added Turbo C support courtesy of Rhys Weatherly
-
- ! - Added the "RUN ON" and "RUN OFF" commands for a secure interface with
- ! the Elm mail system.
-
- ! - Added the "rem" shell script for running Remind with a default script.
-
- ! - Added manual pages for "kall" and "rem".
-
- ! * Version 2.3
-
- ! - Added the UNTIL keyword for forcing reminders to expire.
-
- ! - Added the "++" form of 'back' and the "--" form of 'delta' for
- ! ignoring OMIT information.
-
- ! - Added the CLEAR-OMIT-CONTEXT, PUSH-OMIT-CONTEXT and POP-OMIT-CONTEXT
- ! keywords for isolating personal or peculiar reminders from the global
- ! OMIT context.
-
- ! - Speeded up the parsing of tokens.
-
- ! - Changed the source to recognize and exploit ANSI-C compilers which
- ! accept function prototypes.
-
- ! - Added the "-n" option to output the next occurrence of each reminder
- ! in SimpleCalendar format
-
- ! - Modified the calendar and SimpleCalendar formats so that the % escape
- ! substitutions ARE performed.
- !
- ! * Version 2.2 - Patch 5
- !
- ! - Added the BEFORE, AFTER and SKIP tokens to make the
- ! handling of holidays more sensible. Also corrected a few more bugs.
- !
- ! * Version 2.2 - Patch 3
- !
- ! - Added the MSG or RUN tokens in an OMIT command; also
- ! allowed RUN-type reminders to be explicitly included in the calendar by
- ! using the %" escape sequence.
- !
- ! * Version 2.2
- !
- ! - Added the AT keyword, the timed reminders daemon, and the
- ! calendar facility.
- !
- ! * Version 2.1
- !
- ! - Added the "repeat" token for repeating reminders with a period
- ! other than 7 days. Also fixed some bugs from version 2.0
- !
- ! * Version 2.0
- !
- ! - first public release. Included advanced date specifications,
- ! character substitution, and the RUN keyword.
- !
- ! * Version 1.0
- !
- ! - never publicly released.
-
-
-
- *** ../p0/calendar.c Mon Nov 9 14:12:13 1992
- --- ./calendar.c Wed Dec 16 10:51:29 1992
- ***************
- *** 173,182 ****
- --- 173,202 ----
- static void DoCalendarOneMonth()
- #endif
- {
- + int y, m, d, mm, yy;
- +
- if (!DoSimpleCalendar) WriteCalHeader();
-
- + if (PsCal) {
- + FromJulian(JulianToday, &y, &m, &d);
- + printf("%s\n", PSBEGIN);
- + printf("%s %d %d %d\n",
- + MonthName[m], y, DaysInMonth(m, y), (JulianToday+1) % 7);
- + mm = m-1;
- + if (mm<0) {
- + mm = 11; yy = y-1;
- + } else yy=y;
- +
- + printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
- + mm = m+1;
- + if (mm>11) {
- + mm = 0; yy = y+1;
- + } else yy=y;
- + printf("%s %d\n", MonthName[mm], DaysInMonth(mm,yy));
- + }
- while (WriteCalendarRow()) continue;
-
- + if (PsCal) printf("%s\n", PSEND);
- if (!DoSimpleCalendar) WriteCalTrailer();
- }
-
- *** ../p0/config.h Mon Nov 9 14:12:07 1992
- --- ./config.h Wed Dec 16 10:51:23 1992
- ***************
- *** 7,13 ****
- /* care of certain system dependencies. */
- /* */
- /* This file is part of REMIND. */
- ! /* Copyright (C) 1991 by David F. Skoll. */
- /* */
- /***************************************************************/
-
- --- 7,13 ----
- /* care of certain system dependencies. */
- /* */
- /* This file is part of REMIND. */
- ! /* Copyright (C) 1992 by David F. Skoll. */
- /* */
- /***************************************************************/
-
- ***************
- *** 109,115 ****
- --- 109,117 ----
- /*---------------------------------------------------------------------*/
- /* Do we have the <unistd.h> header? If not, use sys/files.h */
- /*---------------------------------------------------------------------*/
- + #ifdef UNIX
- #define HAVE_UNISTD 1
- + #endif
-
- /*---------------------------------------------------------------------*/
- /* How many attempts to resolve a weird date spec? */
- ***************
- *** 151,153 ****
- --- 153,162 ----
- /*---------------------------------------------------------------------*/
- #define PUBLIC
- #define PRIVATE static
- +
- + #ifdef UNIX
- + #define _POSIX_SOURCE
- + #endif
- +
- + #define PSBEGIN "# rem2ps begin"
- + #define PSEND "# rem2ps end"
- *** ../p0/dorem.c Mon Nov 9 14:12:13 1992
- --- ./dorem.c Wed Dec 16 10:51:30 1992
- ***************
- *** 10,17 ****
- /* Copyright (C) 1992 by David F. Skoll. */
- /* */
- /***************************************************************/
- - #include <stdio.h>
- #include "config.h"
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
- --- 10,17 ----
- /* Copyright (C) 1992 by David F. Skoll. */
- /* */
- /***************************************************************/
- #include "config.h"
- + #include <stdio.h>
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
- *** ../p0/dosubst.c Mon Nov 9 14:12:14 1992
- --- ./dosubst.c Wed Dec 16 10:51:30 1992
- ***************
- *** 9,17 ****
- /* Copyright (C) 1992 by David F. Skoll. */
- /* */
- /***************************************************************/
- #include <stdio.h>
- #include <ctype.h>
- - #include "config.h"
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
- --- 9,17 ----
- /* Copyright (C) 1992 by David F. Skoll. */
- /* */
- /***************************************************************/
- + #include "config.h"
- #include <stdio.h>
- #include <ctype.h>
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
- ***************
- *** 110,116 ****
- if (err) return err;
- if (c == '\n') continue;
- if (!c) {
- ! if (mode != CAL_MODE) *s++ = '\n';
- *s++ = 0;
- break;
- }
- --- 110,116 ----
- if (err) return err;
- if (c == '\n') continue;
- if (!c) {
- ! if (mode != CAL_MODE && t->typ != RUN_TYPE) *s++ = '\n';
- *s++ = 0;
- break;
- }
- ***************
- *** 346,352 ****
- s += strlen(s);
- break;
-
- ! case '_': sprintf(s, "%s", NL);
- s += strlen(s);
- break;
-
- --- 346,356 ----
- s += strlen(s);
- break;
-
- ! case '_':
- ! if (mode != CAL_MODE)
- ! sprintf(s, "%s", NL);
- ! else
- ! sprintf(s, " ");
- s += strlen(s);
- break;
-
- *** ../p0/err.h Mon Nov 9 14:12:07 1992
- --- ./err.h Wed Dec 16 10:51:24 1992
- ***************
- *** 5,11 ****
- /* Error definitions. */
- /* */
- /* This file is part of REMIND. */
- ! /* Copyright (C) 1991 by David F. Skoll. */
- /* */
- /***************************************************************/
-
- --- 5,11 ----
- /* Error definitions. */
- /* */
- /* This file is part of REMIND. */
- ! /* Copyright (C) 1992 by David F. Skoll. */
- /* */
- /***************************************************************/
-
- *** ../p0/expr.c Mon Nov 9 14:12:16 1992
- --- ./expr.c Wed Dec 16 10:51:32 1992
- ***************
- *** 5,23 ****
- /* This file contains routines to parse and evaluate */
- /* expressions. */
- /* */
- ! /* Copyright 1991 by David F. Skoll. */
- /* */
- /***************************************************************/
-
- ! /* If we're using Turbo C, turn off annoying warning messages! */
- ! #ifdef __TURBOC__
- ! #pragma warn -pia
- ! #endif
- !
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- - #include "config.h"
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
- --- 5,18 ----
- /* This file contains routines to parse and evaluate */
- /* expressions. */
- /* */
- ! /* Copyright 1992 by David F. Skoll. */
- /* */
- /***************************************************************/
-
- ! #include "config.h"
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
- ***************
- *** 62,67 ****
- --- 57,63 ----
- PRIVATE int MakeValue ARGS ((char *s, Value *v, Var *locals));
- PRIVATE int PushOpStack ARGS ((Operator *op));
- PRIVATE int PopOpStack ARGS ((Operator *op));
- + PRIVATE int ParseLiteralDate ARGS ((char **s, int *jul));
-
- /* Binary operators - all left-associative */
-
- ***************
- *** 236,243 ****
- if (c == '\"') return OK ; else return E_MISS_QUOTE;
- }
-
- ! if (!ISID(c)) return E_ILLEGAL_CHAR;
-
- /* Parse a constant, variable name or function */
- while (ISID(**in) || **in == ':') *out++ = *(*in)++;
-
- --- 232,249 ----
- if (c == '\"') return OK ; else return E_MISS_QUOTE;
- }
-
- ! /* Dates can be specified with single-quotes */
- ! if (c == '\'') {
- ! while (**in) if ((c = *out++ = *(*in)++) == '\'') break;
- ! *out = 0;
- ! if (c == '\'') return OK ; else return E_MISS_QUOTE;
- ! }
-
- + if (!ISID(c)) {
- + Eprint("%s '%c'", ErrMsg[E_ILLEGAL_CHAR], c);
- + return E_ILLEGAL_CHAR;
- + }
- +
- /* Parse a constant, variable name or function */
- while (ISID(**in) || **in == ':') *out++ = *(*in)++;
-
- ***************
- *** 337,343 ****
- r = Evaluate(s, locals);
- if (r) return r;
- if (*ExprBuf == ')') break;
- ! else if (*ExprBuf != ',') return E_ILLEGAL_CHAR;
- }
- if (f) r = CallFunc(f, args);
- else {
- --- 343,352 ----
- r = Evaluate(s, locals);
- if (r) return r;
- if (*ExprBuf == ')') break;
- ! else if (*ExprBuf != ',') {
- ! Eprint("Expecting comma, found '%c'", *ExprBuf);
- ! return E_ILLEGAL_CHAR;
- ! }
- }
- if (f) r = CallFunc(f, args);
- else {
- ***************
- *** 352,358 ****
- r = PushOpStack(f);
- if (r) return r;
- continue; /* Still looking for an atomic vlue */
- ! } else if (!ISID(*ExprBuf) && *ExprBuf != '"') {
- return E_ILLEGAL_CHAR;
- } else { /* Must be a literal value */
- r = MakeValue(ExprBuf, &va, locals);
- --- 361,368 ----
- 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 */
- r = MakeValue(ExprBuf, &va, locals);
- ***************
- *** 408,415 ****
- /***************************************************************/
- /* */
- /* MakeValue */
- ! /* Generate a literal value. It's either a string, a number */
- ! /* or the value of a symbol. */
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- --- 418,425 ----
- /***************************************************************/
- /* */
- /* MakeValue */
- ! /* Generate a literal value. It's either a string, a number, */
- ! /* a date or the value of a symbol. */
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ***************
- *** 435,440 ****
- --- 445,457 ----
- strncpy(v->v.str, s+1, len-1);
- *(v->v.str+len-1) = 0;
- return OK;
- + } else if (*s == '\'') { /* It's a literal date */
- + s++;
- + if ((r=ParseLiteralDate(&s, &h))) return r;
- + if (*s != '\'') return E_BAD_DATE;
- + v->type = DATE_TYPE;
- + v->v.val = h;
- + return OK;
- } else if (isdigit(*s)) { /* It's a number - use len to hold it.*/
- len = 0;
- while (*s && isdigit(*s)) {
- ***************
- *** 640,670 ****
- } else return E_2LOW;
-
- case STR_TYPE:
- - y=0; m=0; d=0;
- s = v->v.str;
- ! if (!isdigit(*s)) return E_CANT_COERCE;
- ! while (isdigit(*s)) {
- ! y *= 10;
- ! y += *s++ - '0';
- ! }
- ! if (*s++ != '/') return E_CANT_COERCE;
- ! if (!isdigit(*s)) return E_CANT_COERCE;
- ! while (isdigit(*s)) {
- ! m *= 10;
- ! m += *s++ - '0';
- ! }
- ! m--;
- ! if (*s++ != '/') return E_CANT_COERCE;
- ! if (!isdigit(*s)) return E_CANT_COERCE;
- ! while (isdigit(*s)) {
- ! d *= 10;
- ! d += *s++ - '0';
- ! }
- ! if (*s || y < BASE || y > BASE+YR_RANGE ||
- ! m>11 || d<1 || d>DaysInMonth(m, y)) return E_CANT_COERCE;
- v->type = DATE_TYPE;
- free(v->v.str);
- ! v->v.val = Julian(y, m, d);
- return OK;
-
- default: return E_CANT_COERCE;
- --- 657,668 ----
- } else return E_2LOW;
-
- case STR_TYPE:
- s = v->v.str;
- ! if (ParseLiteralDate(&s, &i)) return E_CANT_COERCE;
- ! if (*s) return E_CANT_COERCE;
- v->type = DATE_TYPE;
- free(v->v.str);
- ! v->v.val = i;
- return OK;
-
- default: return E_CANT_COERCE;
- ***************
- *** 1209,1212 ****
- --- 1207,1255 ----
- dest->v.val = src->v.val;
- return OK;
- }
- + }
- +
- + /***************************************************************/
- + /* */
- + /* ParseLiteralDate */
- + /* */
- + /* Parse a literal date. Return result in jul, update s. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PRIVATE int ParseLiteralDate(char **s, int *jul)
- + #else
- + static int ParseLiteralDate(s, jul)
- + char **s;
- + int *jul;
- + #endif
- + {
- + int y, m, d;
- +
- + y=0; m=0; d=0;
- +
- + if (!isdigit(**s)) return E_BAD_DATE;
- + while (isdigit(**s)) {
- + y *= 10;
- + y += *(*s)++ - '0';
- + }
- + if (*(*s)++ != '/') return E_BAD_DATE;
- + if (!isdigit(**s)) return E_BAD_DATE;
- + while (isdigit(**s)) {
- + m *= 10;
- + m += *(*s)++ - '0';
- + }
- + m--;
- + if (*(*s)++ != '/') return E_BAD_DATE;
- + if (!isdigit(**s)) return E_BAD_DATE;
- + while (isdigit(**s)) {
- + d *= 10;
- + d += *(*s)++ - '0';
- + }
- + if (y < BASE || y > BASE+YR_RANGE || m<0 ||
- + m>11 || d<1 || d>DaysInMonth(m, y)) return E_BAD_DATE;
- +
- + *jul = Julian(y, m, d);
- +
- + return OK;
- }
-