Path: wupost!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnews!jbr0 From: jbr0@cbnews.cb.att.com (joseph.a.brownlee) Newsgroups: alt.sources Subject: Pcal v4.1, part 1 of 6 Keywords: pcal calendar postscript Message-ID: <1991Aug19.121007.212@cbnews.cb.att.com> Date: 19 Aug 91 12:10:07 GMT Organization: AT&T Bell Laboratories Lines: 1129 "Pcal" Version 4.1 This is an intermediate release of "Pcal", the PostScript calendar making program. For those not familiar with this pcakage, "pcal" generates calendars in various formats and generates Postscript. You can keep "events" in a file and "pcal" will place them in the appropriate day in the calendar. Major changes since v4.0: 1) Of interest to Pcal hackers and installers: . The Un*x flavor of Pcal is now considerably smarter about finding the date file, using the PATH environment variable to identify the directory where the executable lives. (This is so system- dependent that it exists only for Un*x; in fact, it may require some tweaking for your particular system. See the comments in pcalutil.c regarding X_OK.) 2) New command-line options: . The "-v" option has been added to print version information without the entire usage message. . The "-G" option has been added to print "gray" dates as filled outlines (thanks to Richard Dyson for the idea). 3) New date file functionality: . Pcal now supports format specifiers (derived mostly from strftime()) which allow the user to substitute the current month, day, weekday, year, etc. into a text or foot string. For further information, refer to the manual page and/or the comments in "pcal.c". 4) Other new functionality: . The default moon phase algorithm has been replaced with an astronomer-quality version; moon file ".moonXX" will continue to be supported for now. 5) Portability: . Some VMS-specific files have been updated. Also, a TeX style sheet is now included in the distribution. Credit where credit is due: The following people contributed to Pcal v4.1: Overall coordinator, troff manual page: Joe Brownlee VMS/TeX support, moon phase algorithm: Richard Dyson Other C and PostScript code: Andrew Rogers Although they probably wouldn't recognize the current version, countless others worked on Pcal long before any of us ever heard of it; see the Orig.ReadMe file and topline comments in pcal.c. ^ _ Joe Brownlee, Analysts International Corporation @ AT&T Bell Labs /_\ @ / ` 471 E Broad St, Suite 2001, Columbus, Ohio 43215 (614) 860-7461 / \ | \_, E-mail: jbr@cblph.att.com Who pays attention to what _I_ say? "Scotty, we need warp speed in 3 minutes or we're all dead!" --- James T. Kirk ------------------------------- 8< cut here >8 ------------------------------- #!/bin/sh # This is a shell archive (produced by shar 3.49) # To extract the files from this archive, save it to a file, remove # everything above the "!/bin/sh" line above, and type "sh file_name". # # existing files will NOT be overwritten unless -c is specified # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 1849 -rw-r--r-- ReadMe # 2923 -rw-r--r-- Make_Pcal.com # 1159 -rw-r--r-- Makefile # 1010 -rw-r--r-- Makefile.Amiga # 1023 -rw-r--r-- Makefile.DOS # 2505 -rw-r--r-- Makefile.VMS # 984 -rw-r--r-- Orig.ReadMe # 23366 -rw-r--r-- Pcal.TeX # 24613 -rw-r--r-- Pcal.hlp # 670 -rw-r--r-- SetUp.com # 31 -rw-r--r-- VaxCrtl.opt # 9144 -rw-rw-rw- calendar # 8311 -rw-rw-rw- exprpars.c # 2504 -rw-rw-rw- moon91 # 14863 -rw-rw-rw- moonphas.c # 2051 -rw-rw-rw- noprotos.h # 36344 -rw-rw-rw- pcal.c # 20376 -rw-r--r-- pcal.man # 14846 -rw-rw-rw- pcaldefs.h # 3549 -rw-rw-rw- pcalglob.h # 3975 -rw-r--r-- pcalinit.c # 13642 -rw-rw-rw- pcalinit.ps # 27444 -rw-rw-rw- pcallang.h # 16402 -rw-r--r-- pcalutil.c # 3511 -rw-rw-rw- protos.h # 27599 -rw-r--r-- readfile.c # 3609 -rw-r--r-- troffman.sty # 13864 -rw-r--r-- writefil.c # # ============= ReadMe ============== if test -f 'ReadMe' -a X"$1" != X"-c"; then echo 'x - skipping ReadMe (File already exists)' else echo 'x - extracting ReadMe (Text)' sed 's/^X//' << 'SHAR_EOF' > 'ReadMe' && "Pcal" Version 4.1 X This is an intermediate release of "Pcal", the PostScript calendar making program. X Major changes: X X 1) Of interest to Pcal hackers and installers: X X . The Un*x flavor of Pcal is now considerably smarter about finding X the date file, using the PATH environment variable to identify X the directory where the executable lives. (This is so system- X dependent that it exists only for Un*x; in fact, it may require X some tweaking for your particular system. See the comments in X pcalutil.c regarding X_OK.) X X X 2) New command-line options: X X . The "-v" option has been added to print version information without X the entire usage message. X X . The "-G" option has been added to print "gray" dates as filled X outlines (thanks to Richard Dyson for the idea). X X X 3) New date file functionality: X X . Pcal now supports format specifiers (derived mostly from strftime()) X which allow the user to substitute the current month, day, weekday, X year, etc. into a text or foot string. For further information, X refer to the manual page and/or the comments in "pcal.c". X X X 4) Other new functionality: X X . The default moon phase algorithm has been replaced with an X astronomer-quality version; moon file ".moonXX" will continue X to be supported for now. X X 5) Portability: X X . Some VMS-specific files have been updated. Also, a TeX style sheet X is now included in the distribution. X X Credit where credit is due: X The following people contributed to Pcal v4.1: X X Overall coordinator, troff manual page: Joe Brownlee X VMS/TeX support, moon phase algorithm: Richard Dyson X Other C and PostScript code: Andrew Rogers X Although they probably wouldn't recognize the current version, countless others worked on Pcal long before any of us ever heard of it; see the Orig.ReadMe file and topline comments in pcal.c. SHAR_EOF chmod 0644 ReadMe || echo 'restore of ReadMe failed' Wc_c="`wc -c < 'ReadMe'`" test 1849 -eq "$Wc_c" || echo 'ReadMe: original size 1849, current size' "$Wc_c" fi # ============= Make_Pcal.com ============== if test -f 'Make_Pcal.com' -a X"$1" != X"-c"; then echo 'x - skipping Make_Pcal.com (File already exists)' else echo 'x - extracting Make_Pcal.com (Text)' sed 's/^X//' << 'SHAR_EOF' > 'Make_Pcal.com' && $ If F$Mode () .eqs. "INTERACTIVE" $ Then $ VERIFY = F$Verify (0) $ Else $ VERIFY = F$Verify (1) $ EndIf $!======================================================================== $! $! Name : MAKE_PCAL.COM $! $! Purpose : Compile and Link pcal under VMS $! $! Arguments : P1/P2 = DATE_DEBUG: compile with DEBUG info $! P1/P2 = LINK : link only $! $! Created: 13-SEP-1990 Rick Dyson $! Updated: 20-SEP-1990 pcal v2.3 $! Updated: 2-OCT-1990 pcal v2.4 $! Updated: 8-OCT-1990 pcal v2.5 $! Updated: 2-JAN-1991 pcal v3.0 $! Updated: 15-FEB-1991 pcal v3.1 $! Updated: 1-MAR-1991 pcal v4.0 $! Updated: 15-AUG-1991 pcal v4.1 $! $!======================================================================== $ THIS_PATH = F$Element (0, "]", F$Environment ("PROCEDURE")) + "]" $ Set Default 'THIS_PATH' $ On Error Then GoTo FINISH $ On Control_Y Then GoTo FINISH $ If P1 .eqs. "DATE_DEBUG" .or. P2 .eqs. "DATE_DEBUG" $ Then $ DEFINE = "/Define = (""VMS"", ""DATE_DEBUG"")" $ Else $ DEFINE = "/Define = (""VMS"")" $ EndIf $ If P1 .eqs. "LINK" .or. P2 .eqs. "LINK" Then GoTo LINK $ Write Sys$Output "Making pcalinit..." $ Cc /NoList 'DEFINE' PCALINIT $ Link /NoMap PCALINIT,VAXCRTL.OPT /Option $ PCALINIT := $ 'THIS_PATH'PCALINIT.EXE $ Write Sys$Output "Executing pcalinit..." $ PCALINIT PCALINIT.PS PCALINIT.H $ Write Sys$Output "Compiling pcal programs..." $ Cc /NoList 'DEFINE' PCAL.C $ Cc /NoList 'DEFINE' EXPRPARS.C $ Cc /NoList 'DEFINE' MOONPHAS.C $ Cc /NoList 'DEFINE' PCALUTIL.C $ Cc /NoList 'DEFINE' READFILE.C $ Cc /NoList 'DEFINE' WRITEFIL.C $LINK: $ Write Sys$Output "Linking pcal..." $ Link /NoMap PCAL,EXPRPARS,MOONPHAS,PCALUTIL,READFILE,WRITEFIL,VAXCRTL/Option $EXIT: $ If .not. $Status Then GoTo FINISH $ Set NoOn $ Set Protection = Owner:RWED *.OBJ;*,*.EXE;-1 $ Purge /Log /NoConfirm *.OBJ,*.EXE $ If F$Search ("PCAL.HLB") .eqs. "" $ Then $ Write Sys$Output "Creating a help library for Pcal..." $ Library /Log /Help /Create PCAL PCAL $ Else $ Write Sys$Output "Updating help library for Pcal..." $ Library /Log /Help PCAL PCAL $ EndIf $ If F$Mode () .nes. "INTERACTIVE" Then GoTo FINISH $ Set File /Truncate PCAL.HLB $ LIB = "Hlp$Library" $ X = F$Trnlnm (LIB, "Lnm$Process") $ If X .eqs. "" Then GoTo INSERT $ If X .eqs. "''THIS_PATH'PCAL.HLB" Then GoTo FINISH $ BASE = LIB + "_" $ N = 1 $NEXTLIB: $ LIB := 'BASE''N' $ X = F$Trnlnm (LIB, "Lnm$Process") $ If X .eqs. "" Then GoTo INSERT $ If X .eqs. "''THIS_PATH'PCAL.HLB" Then GoTo FINISH $ N = N + 1 $ GoTo NEXTLIB $INSERT: $ Define 'LIB' 'THIS_PATH'PCAL.HLB $FINISH: $ Set Protection = (System:RWE, Owner:RWED, Group:RE, World:RE) *.*;* $ Purge /Log /NoConfirm *.* $ Set Protection = Owner:RWE *.* $ VERIFY = F$Verify (VERIFY) $ Exit SHAR_EOF chmod 0644 Make_Pcal.com || echo 'restore of Make_Pcal.com failed' Wc_c="`wc -c < 'Make_Pcal.com'`" test 2923 -eq "$Wc_c" || echo 'Make_Pcal.com: original size 2923, current size' "$Wc_c" fi # ============= Makefile ============== if test -f 'Makefile' -a X"$1" != X"-c"; then echo 'x - skipping Makefile (File already exists)' else echo 'x - extracting Makefile (Text)' sed 's/^X//' << 'SHAR_EOF' > 'Makefile' && # # Makefile for Pcal v4.0 under UNIX # X # Set the configuration variables below to taste. X CC = /bin/cc MANDIR = /usr/man COPTS = OBJECTS = pcal.o exprpars.o moonphas.o pcalutil.o readfile.o writefil.o X pcal: $(OBJECTS) X $(CC) $(LDFLAGS) -o pcal $(OBJECTS) -lm X @ echo "Build of pcal complete" X exprpars.o: exprpars.c pcaldefs.h X $(CC) $(CFLAGS) $(COPTS) -c exprpars.c X moonphas.o: moonphas.c pcaldefs.h pcalglob.h X $(CC) $(CFLAGS) $(COPTS) -c moonphas.c X pcal.o: pcal.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(CFLAGS) $(COPTS) -c pcal.c X pcalutil.o: pcalutil.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(CFLAGS) $(COPTS) -c pcalutil.c X readfile.o: readfile.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(CFLAGS) $(COPTS) -c readfile.c X writefil.o: writefil.c pcaldefs.h pcalglob.h pcallang.h pcalinit.h X $(CC) $(CFLAGS) $(COPTS) -c writefil.c X pcalinit: pcalinit.c X $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcalinit pcalinit.c X pcalinit.h: pcalinit pcalinit.ps X pcalinit pcalinit.ps pcalinit.h X pcalglob.h: protos.h noprotos.h X clean: X rm -f $(OBJECTS) pcal pcalinit pcalinit.h X man: pcal.man X nroff -man pcal.man > pcal.1 X pack pcal.1 # mv pcal.1.z $(MANDIR) SHAR_EOF chmod 0644 Makefile || echo 'restore of Makefile failed' Wc_c="`wc -c < 'Makefile'`" test 1159 -eq "$Wc_c" || echo 'Makefile: original size 1159, current size' "$Wc_c" fi # ============= Makefile.Amiga ============== if test -f 'Makefile.Amiga' -a X"$1" != X"-c"; then echo 'x - skipping Makefile.Amiga (File already exists)' else echo 'x - extracting Makefile.Amiga (Text)' sed 's/^X//' << 'SHAR_EOF' > 'Makefile.Amiga' && # Makefile for the Amiga. # # Set the configuration variables below to taste. X CC = lc:lc LDFLAGS = -cufirst -v -d0 -m3s -O OBJECTS = pcal.o exprpars.o moonphas.o pcalutil.o readfile.o writefil.o X pcal: $(OBJECTS) X blink from lib:c.o $(OBJECTS) to pcal lib lib:lcm.lib lib:lc.lib SC SD VERBOSE ND X @ echo "+ Build of pcal complete!" X exprpars.o: exprpars.c pcaldefs.h X $(CC) $(LDFLAGS) >bugs-$> exprpars.c X moonphas.o: moonphas.c pcaldefs.h pcalglob.h X $(CC) $(LDFLAGS) >bugs-$> moonphas.c X pcal.o: pcal.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(LDFLAGS) >bugs-$> pcal.c X pcalutil.o: pcalutil.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(LDFLAGS) >bugs-$> pcalutil.c X readfile.o: readfile.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(LDFLAGS) >bugs-$> readfile.c X writefil.o: writefil.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(LDFLAGS) >bugs-$> writefil.c X pcalinit: pcalinit.c X $(CC) $(LDFLAGS) >bugs-$> -Lscsdndver pcalinit pcalinit.c X pcalinit.h: pcalinit pcalinit.ps X DH0:pcal/pcalinit pcalinit.ps SHAR_EOF chmod 0644 Makefile.Amiga || echo 'restore of Makefile.Amiga failed' Wc_c="`wc -c < 'Makefile.Amiga'`" test 1010 -eq "$Wc_c" || echo 'Makefile.Amiga: original size 1010, current size' "$Wc_c" fi # ============= Makefile.DOS ============== if test -f 'Makefile.DOS' -a X"$1" != X"-c"; then echo 'x - skipping Makefile.DOS (File already exists)' else echo 'x - extracting Makefile.DOS (Text)' sed 's/^X//' << 'SHAR_EOF' > 'Makefile.DOS' && # PCAL v4.0 MAKEFILE for MS-DOS. # Uses TurboC command line compiler. X CC = tcc CFLAGS = -DDOS OBJECTS = pcal.obj exprpars.obj moonphas.obj pcalutil.obj readfile.obj writefil.obj X pcal.exe: $(OBJECTS) X $(CC) $(LDFLAGS) $(OBJECTS) X @ echo + Build of pcal complete! X exprpars.obj: exprpars.c pcaldefs.h X $(CC) $(CFLAGS) $(COPTS) -c exprpars.c X moonphas.obj: moonphas.c pcaldefs.h pcalglob.h X $(CC) $(CFLAGS) $(COPTS) -c moonphas.c X pcal.obj: pcal.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(CFLAGS) $(COPTS) -c pcal.c X pcalutil.obj: pcalutil.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(CFLAGS) $(COPTS) -c pcalutil.c X readfile.obj: readfile.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(CFLAGS) $(COPTS) -c readfile.c X writefil.obj: writefil.c pcaldefs.h pcalglob.h pcallang.h pcalinit.h X $(CC) $(CFLAGS) $(COPTS) -c writefil.c X pcalinit.exe: pcalinit.c X $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) pcalinit.c X pcalinit.h: pcalinit.exe pcalinit.ps X pcalinit pcalinit.ps pcalinit.h X clean: X del *.obj X del pcalinit.exe X del pcalinit.h SHAR_EOF chmod 0644 Makefile.DOS || echo 'restore of Makefile.DOS failed' Wc_c="`wc -c < 'Makefile.DOS'`" test 1023 -eq "$Wc_c" || echo 'Makefile.DOS: original size 1023, current size' "$Wc_c" fi # ============= Makefile.VMS ============== if test -f 'Makefile.VMS' -a X"$1" != X"-c"; then echo 'x - skipping Makefile.VMS (File already exists)' else echo 'x - extracting Makefile.VMS (Text)' sed 's/^X//' << 'SHAR_EOF' > 'Makefile.VMS' && # This is a makfile for the public domain VMS version of MAKE by Nelson # H.F. Beebe dated 20-Feb-88. Below you will find a paragraph cut out # of the MAKE.DOC file. If you have this program and want to use it # instead of the MAKE_PCAL.COM, rename this file from MAKEFILE.VMS to # MAKEFILE. and type # MAKE pcal ! for the program # MAKE help ! for the help library # MAKE clean ! to clean up the directory # # The original version of MAKE was done by Stuart Feldman in # 1978. This multi-operating-system version is based on a # public-domain posting of 3-Dec-86 to the Usenet bulletin # board mod.sources, its author known only by an EMAIL # address: Caret@FAIRLIGHT.OZ. It contained support for Unix, # OS9, and EON operating systems. The TOPS-20, VMS, and # MS-DOS support was added by Nelson H.F. Beebe # (BEEBE@UTAH-SCIENCE). # X # Set the configuration variables below to taste. X CFLAGS = /NoList COPTS = VAXCRTL.OPT /Option OBJECTS = exprpars.obj moonphas.obj pcalutil.obj readfile.obj writefil.obj OBJLIST = exprpars,moonphas,pcalutil,readfile,writefil X pcal: pcal.exe X pcal.exe: pcal.obj $(OBJECTS) X $(CC) $(CFLAGS) pcal X Link pcal,$(OBJLIST),$(COPTS) X Set Protection = (System:RWE, Owner:RWE, Group:RE, World:RE) *.* X exprpars.obj: exprpars.c pcaldefs.h X $(CC) $(CFLAGS) exprpars.c X moonphas.obj: moonphas.c pcaldefs.h pcalglob.h X $(CC) $(CFLAGS) moonphas.c X pcal.obj: pcal.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(CFLAGS) pcal.c X pcalutil.obj: pcalutil.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(CFLAGS) pcalutil.c X readfile.obj: readfile.c pcaldefs.h pcalglob.h pcallang.h X $(CC) $(CFLAGS) readfile.c X writefil.obj: writefil.c pcaldefs.h pcalglob.h pcallang.h pcalinit.h X $(CC) $(CFLAGS) writefil.c X pcalinit: pcalinit.exe X pcalinit.exe: pcalinit.c X $(CC) $(CFLAGS) pcalinit.c X Link $(LDFLAGS) pcalinit,$(COPTS) X pcalinit.h: pcalinit.exe pcalinit.ps X MCR Sys$$Disk:[]pcalinit pcalinit.ps pcalinit.h X help: pcal.hlb X pcal.hlb: pcal.hlp X Library /Log /Create /Help PCAL.HLB PCAL.HLP X Set Protection = (System:RWE, Owner:RWE, Group:RE, World:RE) PCAL.HLB X Set File /Truncate PCAL.HLB X clean: X Set Protection = Owner:RWED *.*;-1 X Purge /Log /NoConfirm pcal.exe,pcalinit.exe X Set Protection = Owner:RWED *.obj X Delete /Log /NoConfirm *.obj;* X Set Protection = Owner:RWED pcalinit.h X Delete /Log /NoConfirm pcalinit.h; X Set Protection = (System:RWE, Owner:RWE) *.* SHAR_EOF chmod 0644 Makefile.VMS || echo 'restore of Makefile.VMS failed' Wc_c="`wc -c < 'Makefile.VMS'`" test 2505 -eq "$Wc_c" || echo 'Makefile.VMS: original size 2505, current size' "$Wc_c" fi # ============= Orig.ReadMe ============== if test -f 'Orig.ReadMe' -a X"$1" != X"-c"; then echo 'x - skipping Orig.ReadMe (File already exists)' else echo 'x - extracting Orig.ReadMe (Text)' sed 's/^X//' << 'SHAR_EOF' > 'Orig.ReadMe' && "Pcal" is a program to print PostScript calendars for any month and year. By default, it looks for a file in the home directory named "calendar" for entries with leading dates matching dates on the calendar, and prints any following text under the appropriate day. X The program may be a little System V flavored (getopt, time routines) but should be easily portable to other vintages of UNIX. X Pcal is the combined effort of several people, most notably Patrick Wood of Pipeline Associates, Inc. for the original PostScript code and Bill Vogel of AT&T for the calendar file mechanism. My part was simple translation to a "C" program, the addition of a couple options and a more generalized date searching routine (oh yes, and a manual page :-). X The original calendar PostScript was Copyright (c) 1987 by Patrick Wood and Pipeline Associates, Inc. with permission to modify and redistribute. Please retain this README file with the package. X X Ken Keirnan Pacific Bell San Ramon, CA. SHAR_EOF chmod 0644 Orig.ReadMe || echo 'restore of Orig.ReadMe failed' Wc_c="`wc -c < 'Orig.ReadMe'`" test 984 -eq "$Wc_c" || echo 'Orig.ReadMe: original size 984, current size' "$Wc_c" fi # ============= Pcal.TeX ============== if test -f 'Pcal.TeX' -a X"$1" != X"-c"; then echo 'x - skipping Pcal.TeX (File already exists)' else echo 'x - extracting Pcal.TeX (Text)' sed 's/^X//' << 'SHAR_EOF' > 'Pcal.TeX' && % -*-LaTeX-*- % Converted automatically from troff to LaTeX % by tr2latex (version 1.04, July 15, 1991) % on Thu Aug 15 10:28:35 1991 % tr2latex was written by Kamal Al-Yahya at Stanford University % (Kamal%Hanauma@SU-SCORE.ARPA) X \documentstyle[troffman]{article} \begin{document} % % input file: [-]pcal.man % \phead{PCAL}{4.1}{}{}{} X \shead{NAME} pcal -- generate PostScript calendars X \shead{SYNOPSIS} {\bf pcal} [{\bf --e} $|$\ {\bf --f} {\it cal\/}] [{\bf --o} {\it \ file\/}] [{\bf --j} $|$ {\bf --J}] [{\bf --l} $|$ {\bf --p}] [{\bf --m} $|$ {\bf --M}] [{\bf --b}{\it \ day\/} $|$ all ][{\bf --g}{\it \ day\/}$|$ all \/]\hfil\break [{\bf --O}] [{\bf --G}] [{\bf --F}{\it \ day\/}] [{\bf --A} $|$ {\bf --E}] [{\bf --t}{\it \ title\_font\/}] [{\bf --d}{\it \ day\_font\/}] [{\bf --n}{\it \ text\_font\/}] [{\bf --L}{\it \ footer\_string\/}]\hfil\break [{\bf --C}{\it \ footer\_string\/}] [{\bf --R}{\it \ footer\_string\/}] [{\bf --D}{\it \ symbol\/}] [{\bf --U}{\it \ symbol\/}] [{\bf --x}{\it \ xscale\/}] [{\bf --y}{\it \ yscale\/}]\hfil\break [{\bf --X}{\it \ xtrans\/}] [{\bf --Y}{\it \ ytrans\/}][{\bf --I}] [{\bf --B}] [{\bf --w}] [{\bf --h}{\rm \ $|$\ }{\bf --v}]\hfil\break [{\bf month}] [{\bf year}] [{\bf nmonths}] X \shead{DESCRIPTION} {\it Pcal} generates PostScript to produce landscape or portrait calendars for any month and year. The arguments {\bf month}, {\bf year}, and {\bf nmonths}, if provided, should be numeric. The {\bf month} value should be in the range 1 -- 12, and the {\bf year} value should be specified as 1 or 2 digits or as the full 4 digit year. If no numeric arguments are provided, the calendar for the current month and year will be generated. X If one numeric argument is provided, it is interpreted as the {\bf year} value, and calendars for the entire year will be generated. Otherwise, {\bf nmonth} months, starting with {\bf month} and {\bf year}, will be generated. X For whole-year calendars ({\it i.e.}, the {\bf --w} option is given), the command line arguments are interpreted somewhat differently. By default, all months in the current year are printed, starting with January. If the {\bf month} argument alone is given, it is expected to be the desired {\bf year} to print, and prints all of the months in the given year. If both {\bf month} and {\bf year} are given, then 12 consecutive months are printed starting at the given month and year. If the {\bf month}, {\bf year}, and {\bf nmonths} arguments are all present, printing begins with the given month and year and {\bf nmonths} months are printed, rounded up to the nearest multiple of 12. X {\bf The Date File} X By default, {\it pcal} simply prints an empty calendar. Its real power is in its ability to place ``events'' in appropriate days on the calendar, thus allowing the user to create personalized calendars. This is achieved through the use of the ``date file''. X The date file is named {\it calendar} ({\it pcal.dat} under MS-DOS), or {\it calendar} for compatibility with older versions. {\it Pcal} will look in several places for such a file. First, if a file called {\it calendar} exists in the caller's home directory, it is used. Next, if such a file exists in the directory indicated by environment variable {\bf PCAL\_DIR} (or the current directory if no such variable is defined), it is used. Finally, the directory where the {\it pcal} executable resides will be checked. If no date file is found, an empty calendar is printed. X If a date file is found, it will be searched for lines with leading dates matching the requested month and year. Any text following the dates found will be printed on the calendar under the appropriate day of the month. Dates in the {\it calendar} file may be expressed in any of several formats: X %.ft CW {\tt\nofill X $<$ordinal$>$ $<$day\_spec$>$ in $<$month\_spec$>$\{$\ast$\} \{$<$text$>$\} X $<$day\_spec$>$ $<$prep$>$ $<$date\_spec$>$\{$\ast$\} \{$<$text$>$\} X $<$date\_spec$>$\{$\ast$\} \{$<$text$>$\} \fill} %.ft X Where: X {\tt\nofill X $<$month\_name$>$ := first 3+ characters of name of month, or ``all'' X $<$month\_spec$>$ := $<$month\_name$>$, or ``year'' X $<$day\_spec$>$ := first 3+ characters of name of weekday, ``day'', X ``weekday'', ``workday'', ``holiday'', ``nonweekday'', X ``nonworkday'', or ``nonholiday'' X $<$ordinal$>$ := any ordinal number (``1st'', ``2nd'', {\it etc.}), X ``first'' $\ldots$ ``fifth'', ``last'', ``odd'', ``even'', X or ``all'' X $<$prep$>$ := ``before'', ``preceding'', ``after'', ``following'', X ``on\_or\_before'' (``oob''), or ``on\_or\_after'' (``ooa'') X $<$sep$>$ := one or more non-numeric, non-space, non-`$\ast$' characters X $<$month$>$ := a numeric month (1-12) X $<$day$>$ := day of month (1-31) X $<$year$>$ := a numeric year \fill} %.ft X If the {\bf --A} option (American date formats, the default) is given: X {\tt\nofill X $<$date\_spec$>$ := [$<$month\_name$>$ $<$day$>$ $|$ $<$month$>$$<$sep$>$$<$day$>$\{$<$sep$>$$<$year$>$\}] \fill} X If the {\bf --E} option (European date formats) is given: X {\tt\nofill X $<$date\_spec$>$ := [$<$day$>$ $<$month\_name$>$ $|$ $<$day$>$$<$sep$>$$<$month$>$\{$<$sep$>$$<$year$>$\}] \fill} X {\it Pcal} also allows format specifiers in both the text and foot strings (see the {\bf --L}, {\bf --C}, and {\bf --R} options below); each will be replaced by a corresponding string as outlined in the table below. Most of these are derived from the %.ft CW {\it strftime()} %.ft function; the {\bf \%l} and {\bf \%[o0+--]} format specifiers are specific to {\it pcal}: X {\tt\nofill X \%a abbreviated weekday X \%A full weekday X \%b abbreviated month name X \%B full month name X \%d day of month (1-31) X \%j day of year (1-366) X \%l days left in year (0-365) X \%m month (1-12) X \%U week number (0-53) X \%W week number (0-53) X \%y year w/o century (00-99) X \%Y year w/century X \%\% ``\%'' character X X \%o print number as ordinal X \%0 print number with leading zeroes X \%+ use following month or year X \%-- use previous month or year \fill} X The {\bf \%U} format specifier considers the first logical Sunday (the first day of the week as printed; see the {\bf --F} option below) of the year as the first day of week number 1; the {\bf \%W} specifier uses the first logical Monday instead. This is an extension of the behavior of the %.ft CW {\it strftime()} %.ft function. X The {\bf \%o} format specifier prints a number as an ordinal, with the appropriate suffix (``st'', ``nd'', ``rd'', or ``th'' in English) appended; for example, {\bf \%od} prints the day of the month as ``1st'', ``2nd'', ``3rd'', {\it etc.} X Unlike %.ft CW {\it strftime(),} %.ft {\it pcal}'s default is to print numbers (except {\bf \%y}{\rm )} without leading zeroes. If leading zeroes are desired, the ``0'' prefix may be used; for example, {\bf \%0j} prints the day of year as 001-365. X The {\bf \%+} and {\bf \%--} format specifiers direct {\it pcal} to substitute the following or previous month or year for the following {\bf [bBmyY]} specifier; for example, {\bf \%+B} prints the name of the following month. X Examples: X %.ft CW {\tt\nofill X last Monday in May$\ast$ Memorial Day Holiday \par\vspace{1.0\baselineskip} X all Fridays in Oct Status Meeting, 11 AM X first workday in all \%-B progress report due X all Fri in all Time card due, 3 PM X all Monday in all Fiscal week \%0W X -2nd workday in all Schedule for \%+B due X Fri on\_or\_before all 15 Pay Day X even Fridays in year Pay Day X 183rd day of year mid-year (\%l days left) \par\vspace{1.0\baselineskip} X Tue after first Mon in Nov Election Day (USA) \par\vspace{1.0\baselineskip} X 4th Thu in Nov$\ast$ Thanksgiving X Fri after 4th Thu in Nov$\ast$ Day after Thanksgiving \par\vspace{1.0\baselineskip} X 12/25/90$\ast$ Christmas \# American X 25.12.90$\ast$ Christmas \# European \par\vspace{1.0\baselineskip} X Dec 25$\ast$ Christmas \# American X 25 Dec$\ast$ Christmas \# European \fill} %.ft X Any non-numeric character may separate numeric dates. Holidays may be flagged by following the date immediately with ``$\ast$'' as in the examples above; this will cause the date to be printed in gray. ``Each'' and ``every'' are accepted as synonyms for ``all'', and any word may be used in place of ``in''. The abbreviations ``oob'' and ``ooa'' may be used in place of the keywords ``on\_or\_before'' and ``on\_or\_after'', respectively. X Wildcard day names are also provided. The keyword ``weekday'' applies to any days which are normally printed in black on the calendar. The keyword ``workday'' is the same, but does not include any holidays. The keyword ``holiday'' includes only those days flagged as holidays. The keywords ``nonweekday'', ``nonworkday'', and ``nonholiday'' are also recognized as negations of the above. See the {\bf CAVEATS} below for important notes on using these keywords. X Ordinal day numbers may be used to specify dates, either relative to the month or to the year. Either words or numeric abbreviations may be used for ``first'' through ``fifth''; higher numbers must be given using the numeric equivalent ({\it e.g.}, 100th). Negative ordinal numbers may even be used. For example, ``--2nd'' means ``next to last''. X ``Odd'' and ``even'' do not refer to the actual date; instead, ``odd'' means ``alternate, starting with the first'', and ``even'' means ``alternate, starting with the second''. Thus, ``odd Fridays in March'' refers to the first, third, and (if present) fifth Fridays in March - not to those Fridays falling on odd dates. X ``All'' refers to each individual month; ``year'' refers to the year as an entity. Thus ``odd Fridays in all'' refers to the first, third, and fifth Friday of each month, while ``odd Fridays in year'' refers to the first Friday of January and every other Friday thereafter. X Text in the date file may use C-like escape sequences ({\it i.e.}, a ``\bs '' followed by a character, 1 -- 3 octal digits, or ``x'' followed by 1 -- 2 hexadecimal digits). Escaped whitespace (including {\bf newline} ) and the standard ANSI character escapes (``\bs a'', ``\bs b'', ``\bs f'', ``\bs n'', ``\bs r'', ``\bs t'', ``\bs v'') are all replaced by a single blank. X Lines in the {\it calendar} file consisting of {\bf year \#\#\#\#} (where {\bf \#\#\#\#} is a numeric year) can be used to set the year for following entries. This assumes that the following entries do not contain a year; any date entries containing year information will set the remembered year to that year. X Lines in the {\it calendar} file consisting of {\bf opt $<$options$>$} can be used to override the defaults for any command-line options except {\bf --e}, {\bf --f}, {\bf --h}, {\bf --v}, {\bf --D}, and {\bf --U}. Any options specified in this manner are, in turn, overridden by those specified explicitly on the command line. X Lines in the {\it calendar} file consisting of {\bf note $<$month$>$} can be used to place notes regarding the entire month is one of the unused blocks of the calendar. The {\bf $<$month$>$} indicator may be either a number 1 through 12 or an alphabetic month name as described above; ``note all'' will place the associated text in the notes block for each month in the current year. X Comments are supported in the {\it calendar} file. Any characters following a ``\#'' character through the end of the line are ignored. X {\it Pcal} supports rudimentary {\it cpp}-like functionality in the date file, allowing the following constructs: {\bf define\ $|$\ undef}, {\bf if\{n\}def $\ldots$ else $\ldots$ endif}, and {\bf include}. Note that these are not preceded by ``\#'' as they are in C. Symbol names defined using these keywords (or via the {\bf -D} option) are case-insensitive. It is not an error to {\bf undef} an undefined symbol, nor to {\bf define} a previously-defined one. An {\bf ifdef} alone is always {\bf false}; an {\bf ifndef} alone is always {\bf true}. X The name of the file in the {\bf include} directive may optionally be surrounded by either `` '' or $<$$>$, both of which are ignored. If the name is not an absolute path, it is taken to be relative to the directory where the file containing the directive is located. {\it Pcal} is smart enough to translate {\bf \~{}/} to the user's home directory. X In addition to pre-processing keywords, {\it pcal} also accepts boolean expressions in {\bf if\{n\}def} directives. These expressions consist of symbol names joined by the boolean operators {\bf !}, {\bf \&}, {\bf \^{}}, and {\bf $|$}, in order of precedence, high to low. Parentheses may be used to alter the precedence. The synonyms {\bf \&\&} and {\bf $|$$|$} are accepted for {\bf \&} and {\bf $|$}. A symbol name evaluates to {\bf true} if currently defined, {\bf false} if not; thus: X %.ft CW {\tt\nofill X ifdef A $|$ B $|$ C \fill} %.ft X $\ldots$ is {\bf true} if any of the symbols A, B, and C is defined, and: X %.ft CW {\tt\nofill X ifdef A \& B \& C \fill} %.ft X $\ldots$ is {\bf true} if they all are. Note that {\bf ifndef $<$expr$>$} is equivalent to {\bf ifdef !( $<$expr$>$ ).} X {\bf The Moon File} X If a file of the name {\it .moon\#\#} ({\it moon\#\#.dat}under MS-DOS), where {\bf \#\#} is the last two digits of the calendar year, exists in the same directory as the date file, {\it pcal} uses the information contained within to calculate the phase of the moon. If no such file exists, {\it pcal} uses an approximate algorithm. X Entries in the moon file must conform to the following syntax: X If the {\bf --A} option (American date formats, the default) is given: X %.ft CW {\tt\nofill X $<$quarter$>$ $<$month$>$$<$sep$>$$<$day$>$ \{$<$hour$>$$<$sep$>$$<$min$>$\} \fill} %.ft X If the {\bf --E} option (European date formats) is given: X %.ft CW {\tt\nofill X $<$quarter$>$ $<$day$>$$<$sep$>$$<$month$>$ \{$<$hour$>$$<$sep$>$$<$min$>$\} \fill} %.ft X Where: X {\tt\nofill X $<$quarter$>$ := ``nm'', ``fq'' or ``1q'', ``fm'', ``3q'' or ``lq'' X (new moon, first quarter, full moon, last quarter) X $<$hour$>$ := number 0-23 (24-hour clock) X $<$min$>$ := number 0-59 \fill} X This file must contain entries for all quarter moons in the year, in chronological order; if any errors are encountered, {\it pcal} will revert to using its default algorithm. X As in the date file, comments start with `\#' and run through the end of the given line. X {\bf Options} X {\it Pcal} has many options: \begin{TPlist}{{\bf --e}} \item[{{\bf --e}}] Prints an empty calendar. Do not print entries from a {\it calendar} file. \item[{{\bf --f}{\it \ cal}}] Directs {\it pcal} to use the file name {\it cal} as the input file in place of the default {\it calendar} file in the user's home directory (or the directory pointed to by {\bf PCAL\_DIR}. \item[{{\bf --o}{\it \ file}}] Directs {\it pcal} to write the output to {\it file} instead of to stdout. \item[{{\bf --l}}] Causes the output to be in landscape mode (default). This also resets the x- and y-axis scaling and translation factors to the defaults for landscape mode. \item[{{\bf --p}}] Causes the output to be in portrait mode. This also resets the x- and y-axis scaling and translation factors to the defaults for portrait mode. \item[{{\bf --j}}] Causes the Julian date (day of year) to be printed in each calendar box. \item[{{\bf --J}}] Causes the Julian date and the number of days remaining in the year to be printed in each calendar box. \item[{{\bf --m}}] Causes moon icons to be printed on dates corresponding to new, half, and full moons (the default is that no moons are printed). \item[{{\bf --M}}] Causes moon icons to be printed on all dates (the default is that no moons are printed). \item[{{\bf --b}{\it \ day}{\bf \ $|$\ all}}] Causes all dates falling on weekday {\it day} to be printed in black; {\bf --b all} causes all weekdays to be printed in black. \item[{{\bf --g}{\it \ day}{\bf \ $|$\ all}}] Causes all dates falling on weekday {\it day} to be printed in gray; {\bf --g all} causes all weekdays to be printed in gray. \begin{IPlist} \IPitem{{}} The default for the {\bf --b}{\rm \ and\ }{\bf --g} options is to print Saturdays and Sundays in gray and other days, unless flagged as holidays, in black. \end{IPlist}% \item[{{\bf --O}}] Causes pcal to print ``gray'' dates as outlined characters. \item[{{\bf --G}}] Causes pcal to print ``gray'' dates as outlined characters filled with gray. \item[{{\bf --F}{\it \ day}}] Selects weekday {\it day} as the first day of the week. The given day will appear in the left-most column of the calendar. \item[{{\bf --A}}] Directs {\it pcal} to use American date conventions {\bf mm/dd\{/yy\}} and {\bf month dd} ) when parsing the date file (default). \item[{{\bf --E}}] Directs {\it pcal} to use European date conventions {\bf dd/mm\{/yy\}} and {\bf dd month} ) when parsing the date file. \item[{{\bf --X}{\it \ xtrans}}] Specifies the x-axis translation value for positioning the output on the page. \item[{{\bf --Y}{\it \ ytrans}}] Specifies the y-axis translation value for positioning the output on the page. \item[{{\bf --x}{\it \ xscale}}] Specifies the x-axis scaling factor for the calendar size. \item[{{\bf --y}{\it \ yscale}}] Specifies the y-axis scaling factor for the calendar size. \item[{{\bf --t}{\it \ title\_font}}] Specifies the name of a font to use to print the month name and year at the top of the calendar. For example, {\bf pcal\ --t\ Times-Roman}. \item[{{\bf --d}{\it \ day\_font}}] Similar to the {\bf --t} option, but selects the font used to print the day numbers. \item[{{\bf --n}{\it \ text\_font}}] Similar to the {\bf --t} option, but selects the font used to print the text inside each day and in the notes block. \item[{{\bf --D}{\it \ symbol}}] Defines the named symbol prior to reading the date file. \item[{{\bf --U}{\it \ symbol}}] Un-defines the named symbol prior to reading the date file. \item[{{\bf --L}{\it \ string}}] Causes the accompanying string to be printed as a left-justified footer. Format specifiers denoting the month and/or year may appear in the string; the appropriate values will be substituted upon printing. \item[{{\bf --C}{\it \ string}}] Causes the accompanying string to be printed as a centered footer. Format specifiers denoting the month and/or year may appear in the string; the appropriate values will be substituted upon printing. \item[{{\bf --R}{\it \ string}}] Causes the accompanying string to be printed as a right-justified footer. Format specifiers denoting the month and/or year may appear in the string; the appropriate values will be substituted upon printing. \item[{{\bf --B}}] Causes {\it pcal} to leave unused calendar boxes blank (default is gray). \item[{{\bf --w}}] Causes {\it pcal} to print a calendar for 12 consecutive months: 3 rows / 4 columns in landscape mode, 4 rows / 3 columns in portrait mode. See the {\bf CAVEATS} section for details on the use of this option with other options. \item[{{\bf --I}}] Resets all parameters to the program defaults. \item[{{\bf --h}}] Causes {\it pcal} to write version information, usage message, and full explanation of options and file formats (to {\it stdout}) and terminate. \item[{{\bf --v}}] Causes {\it pcal} to write version information only (to {\it stdout}) and terminate. \end{TPlist} X Any option which normally takes an argument may be specified without the argument in order to reset the value to the program default. Note that while the {\bf --D} option alone clears all the defined symbols, the {\bf --U} option alone has no effect. The {\bf --} (or {\bf --\,--} as per System V) argument may be used to disambiguate command lines such as: X \begin{IPlist} \IPitem{{}} {\bf pcal --t 9 90} \end{IPlist} X This could be written instead as one of the following: \begin{IPlist} \IPitem{{}} {\bf pcal --t -- 9 90} \nwl {\bf pcal --t --\,-- 9 90} \end{IPlist} X If the environment variable {\bf PCAL\_OPTS} is defined, its contents are parsed as a command line. Flags set via {\bf PCAL\_OPTS} override the program defaults, but are overridden by options set via {\bf opt} lines in the {\it calendar} file or explicitly on the command line. X \shead{CAVEATS} The ``workday'' and ``holiday'' keywords are aware of only those holidays which have already been flagged at the point where they appear. For example, consider January 1990: X %.ft CW {\tt\nofill %.ne 7 X January 1990 X S M Tu W Th F S X 1 2 3 4 5 6 X 7 8 9 10 11 12 13 X 14 15 16 17 18 19 20 X 21 22 23 24 25 26 27 X 28 29 30 31 \fill} %.ft X If the {\it calendar} file looked like this: X %.ft CW {\tt\nofill X workday on\_or\_before all 15 payday X 3rd Mon in Jan$\ast$ MLK day \fill} %.ft X then {\it pcal} would mark the 15th as ``payday'' since at that point in the {\it calendar} file it has no way of knowing that January 15th will later be flagged as a holiday. If the two lines were reversed, such that the holiday preceded the ``workday'' wildcard, then {\it pcal} would work as intended, marking instead the 12th as ``payday''. Also, beware of year boundaries which affect the handling of all of the day wildcard keywords. In general, it is best to place monthly wildcards such as the example above at the end of each year to achieve the desired effect. X When the {\bf --w} and {\bf --p} options are used together, {\it pcal} revises the y-scale factor in order to use the entire portrait page; therefore, the user should avoid using use the {\bf --y} option when using both the {\bf --w} and {\bf --p} options. Use of the {\bf --w} option in any case effectively disables the {\bf --m}, {\bf --M}, {\bf --j} , and {\bf --J} options. X \shead{SEE ALSO} cal(1) X \shead{VERSION} This documentation corresponds to v4.1 dated 15-AUG-1991. X \shead{AUTHORS} The original PostScript code to generate the calendars was written by Patrick Wood (Copyright (c) 1987 by Patrick Wood of Pipeline Associates, Inc.), and authorized for modification and redistribution. The calendar file inclusion code was originally written in {\it bs}(1) by Bill Vogel of AT\&T. Patrick's original PostScript was modified and enhanced several times by others whose names have regrettably been lost. Ken Keirnan of Pacific Bell assembled the original ``C'' version upon which this is based; additional modifications and enhancements are the work of Joseph P. Larson, Ed Hand, Andrew W. Rogers, Mark Kantrowitz, Joe Brownlee, Jamie Zawinski, Richard L. Dyson, Bill Hogsett, and Floyd Miller. X \end{document} SHAR_EOF chmod 0644 Pcal.TeX || echo 'restore of Pcal.TeX failed' Wc_c="`wc -c < 'Pcal.TeX'`" test 23366 -eq "$Wc_c" || echo 'Pcal.TeX: original size 23366, current size' "$Wc_c" fi true || echo 'restore of Pcal.hlp failed' echo End of part 1, continue with part 2 exit 0 -- ^ _ Joe Brownlee, Analysts International Corporation @ AT&T Bell Labs /_\ @ / ` 471 E Broad St, Suite 2001, Columbus, Ohio 43215 (614) 860-7461 / \ | \_, E-mail: jbr@cblph.att.com Who pays attention to what _I_ say? "Scotty, we need warp speed in 3 minutes or we're all dead!" --- James T. Kirk