pcal-4.11.0/0000755000175000001440000000000010732024434010700 5ustar wuserspcal-4.11.0/Makefile0000644000175000001440000002777210732017670012363 0ustar wusers# # Makefile for 'pcal' under Unix/Linux, DOS+DJGPP, and DOS/Windows+Cygwin # # Use these commands: # # Unix/Linux: make # # DOS+DJGPP: make OS=DJGPP # # # v4.11.0: Bill Marr # # Provide support for a user-specified destination directory ('$DESTDIR') # on the installation step. # # For example: make DESTDIR=$HOME/test install # # Remove all remaining references (environment variables, etc) to the # unneeded 'pcalinit' items, which were accidentally overlooked in the # last release. # # v4.10.0: Bill Marr # # Accommodate the fact that the use of 'pcalinit.{c,ps,h}' is no longer # needed. PostScript output is now directly generated by C code, without # the use of a PostScript template which was converted to a C header file. # # Eliminate other now-unused files ('pcalglob.h', 'pcalpapr.{c,h}') and add # new files ('encvec.c', 'pcallang.c'). # # Drop support for obsolete platforms (Amiga, VMS, OS/2). # # Rename 'EPS' definition to 'EPS_DSC' (in order to more clearly show its # purpose and to avoid confusion with the embedded EPS image capability for # monthly calendars). Enhance comments about its use. # # Expand the explanation and provide more examples of the use of the # timezone setting. # # Remove the now-unneeded 'VERSION = x.y' declaration. # # v4.9.1: Bill Marr # # Fix syntax which causes error when using 'make install' command. # # v4.9.0: Bill Marr # # Add comments for new 'MAPFONTS' options to control PostScript character # encodings to support multiple languages. # # Remove obsolete comment about directory usage. Fix minor comment typo. # # Remove reference to now-obsolete 'Esperanto' character encoding. # # Enable the '-DSEARCH_PCAL_DIR=0' line by default now, so that the 'pcal' # configuration file (a.k.a. the 'date' file, often named 'calendar') will # _not_ be looked for in the same directory as the 'pcal' executable file. # This prevents erroneous use of a common Unix executable named 'calendar' # as a 'pcal' configuration file. This change was done to minimize the # deltas applied by the Debian distribution. # # Bypass some processing of the documentation if the directory specified # by 'MANDIR' and/or 'CATDIR' does not exist. This prevents an error # during the 'make install' step when building in certain environments # (e.g. DOS+DJGPP). # # v4.8.0: Bill Marr # # Enhance comments; reverse sense of 'SEARCH_PCAL_DIR' flag so that # enabling the commented-out line has the desired effect; remove unused # 'make' targets ('compress' and 'uuencode') and now-obsolete list of files # for 'TARSRC'; remove refs to obsolete source files; remove now-unneeded # specification of paper size; provide for new directory locations for # source code, object code, and executable code; merge OS/2 'Makefile.os2' # file into this file; add support for DOS+DJGPP building based on a patch # from Thiago F.G. Albuquerque; provide a new flag 'BUILD_ENV_xxx' so that # we can distinquish the build environment among Unix, OS/2, and DOS+DJGPP # at compile time; fixed up the out-of-date target dependency lists # # v4.7: Andrew Rogers # # add HTML-specific command-line definitions (cf. pcaldefs.h) # delete moon96; add moon98 # add Makefile.os2 to TARSRC definition # parameterize executable names; define pcalinit-specific compiler # name (to facilitate cross-builds) # # v4.6: Andrew Rogers # # "make compress" creates compressed tar file; "make uuencode" creates # uuencode-d version thereof # # v4.5: Andrew Rogers # # "make clean" leaves pcal intact but removes other by-products; # "make clobber" blows everything away; # "make fresh" rebuilds from scratch # # ----------------------------------------------------------------------------- # # Depending on whether we're compiling for Unix/Linux or DOS+DJGPP, use # appropriate values for the OS name, the 'build environment' flag, the names # of the executable files, the compiler(s), and the 'PACK' value. # # The 'PACK' value is used for packing the 'man' page. Note that setting # 'PACK' to ":" will cause no packing to be done; otherwise, choose # "compress", "pack", or "gzip" as your system requires. # ifeq ($(OS),DJGPP) # DOS+DJGPP OS_NAME = "DOS+DJGPP" D_BUILD_ENV = -DBUILD_ENV_DJGPP PCAL = pcal.exe CC = gcc PACK = : else # Unix OS_NAME = "Unix" D_BUILD_ENV = -DBUILD_ENV_UNIX PCAL = pcal CC = /usr/bin/gcc PACK = compress # PACK = pack # PACK = gzip endif # # Define various directories for the following items: # # - source code # - object code (and compile-time, auto-generated C header files) # - installed 'pcal' executable # - documentation # - 'man' pages # - 'cat' pages # SRCDIR = src OBJDIR = obj EXECDIR = exec DOCDIR = doc # # Compiling for DOS+DJGPP requires different directories for the installed # executable and the 'man'/'cat' pages. Unix uses the values shown below. # ifeq ($(OS),DJGPP) # DOS+DJGPP BINDIR = $(DJDIR)/bin MANDIR = $(DJDIR)/man/man1 CATDIR = $(DJDIR)/man/cat1 else # Unix BINDIR = /usr/local/bin MANDIR = /usr/man/man1 CATDIR = /usr/man/cat1 endif OBJECTS = $(OBJDIR)/pcal.o \ $(OBJDIR)/encvec.o $(OBJDIR)/exprpars.o \ $(OBJDIR)/moonphas.o $(OBJDIR)/pcalutil.o \ $(OBJDIR)/pcallang.o \ $(OBJDIR)/readfile.o $(OBJDIR)/writefil.o # ------------------------------------------------------------------ # # Site-specific defaults which may be overridden here (cf. pcallang.h); # uncomment the examples below and/or change them to your liking # # # Allow the ability to specify an alternate 8-bit character mapping by # defining 'MAPFONTS' to one of the following: # # ENC_LATIN_1 (ISO 8859-1) # ENC_LATIN_2 (ISO 8859-2) # ENC_LATIN_3 (ISO 8859-3) # ENC_LATIN_4 (ISO 8859-4) # ENC_CYRILLIC (ISO 8859-5) # ENC_ARABIC (ISO 8859-6) (*** unsupported ***) # ENC_GREEK (ISO 8859-7) # ENC_HEBREW (ISO 8859-8) (*** unsupported ***) # ENC_LATIN_5 (ISO 8859-9) # ENC_LATIN_6 (ISO 8859-10) # ENC_THAI (ISO 8859-11) # ENC_LATIN_7 (ISO 8859-13) # ENC_LATIN_8 (ISO 8859-14) # ENC_LATIN_9 (ISO 8859-15) # ENC_LATIN_10 (ISO 8859-16) (*** unsupported ***) # ENC_KOI8_R (Russian) # ENC_KOI8_U (Ukrainian) # ENC_ROMAN8 (Roman8) # # This is equivalent to the use of the '-r' option. # # Note that this is not normally needed, since 'pcal' will automatically # assign the proper character encoding (if any) depending on the language # selected. # # D_MAPFONTS = -DMAPFONTS=ENC_KOI8_R # redefine title, date, and notes font/pointsize ('-t', '-d', '-n') # D_TITLEFONT = '-DTITLEFONT="Helvetica-Bold/48"' # D_DATEFONT = '-DDATEFONT="Helvetica-Bold/28"' # D_NOTESFONT = '-DNOTESFONT="Helvetica/8"' # redefine shading (dates/fillboxes) ('-s') # D_SHADING = '-DSHADING="0.6/0.99"' # specify American (USA_DATES) or European (EUR_DATES) date parsing ('-A', '-E') # D_DATE_STYLE = -DDATE_STYLE=USA_DATES # specify first (leftmost) weekday on calendar ('-F') # D_FIRST_DAY = -DFIRST_DAY=MON # # Specify the timezone ('-z') for determining the correct day when # calculating the moon phases: # # "0" = UTC/GMT (default) # "5" = New York EST # "-3" = Moscow # "-5.5" = India # # D_TIMEZONE = '-DTIMEZONE="5 [New York EST]"' # D_TIMEZONE = '-DTIMEZONE="4 [New York EDT]"' # D_TIMEZONE = '-DTIMEZONE="8 [Los Angeles PST]"' # D_TIMEZONE = '-DTIMEZONE="7 [Los Angeles PDT]"' # D_TIMEZONE = '-DTIMEZONE="-3 [Moscow]"' # D_TIMEZONE = '-DTIMEZONE="-5.5 [India]"' # # This flag controls the generation of EPS-like PostScript Document # Structuring Conventions (DSC) so that the output contains enhanced comments # ('%%Page:', etc.) that are necessary for programs like 'psnup' to do useful # things with the generated calendars. These comments also allow PostScript # previewer applications to page up to the previous page. # D_EPS_DSC = -DEPS_DSC # specify default language # D_LANGUAGE = -DLANG_DEFAULT=LANG_ENGLISH # customize HTML output # D_BGCOLOR = '-DBGCOLOR="ffffff"' # D_BACKGROUND = -DBACKGROUND=NULL # D_TEXT = -DTEXT=NULL # D_LINK = -DLINK=NULL # D_ALINK = -DALINK=NULL # D_VLINK = -DVLINK=NULL # D_HOLIDAY_PRE = '-DHOLIDAY_PRE=""' # D_HOLIDAY_POST = '-DHOLIDAY_POST=""' # D_BLANK_STYLE = '-DDIVIDE_BLANK_SPACE=0' # # This flag controls whether 'pcal' will search for the calendar # control/options file ('calendar') in the directory where the 'pcal' # executable code resides. Disabling this flag (by enabling the line below) # prevents the search, thereby avoiding a potential conflict with any program # named 'calendar' which has also been installed there. Note that the # 'pcaldefs.h' source code file enables this search by default, unless it has # been overridden here. # D_SEARCH_PCAL_DIR = '-DSEARCH_PCAL_DIR=0' # ------------------------------------------------------------------ COPTS = $(D_MAPFONTS) $(D_TITLEFONT) $(D_DATEFONT) $(D_NOTESFONT) \ $(D_SHADING) $(D_DATE_STYLE) $(D_FIRST_DAY) $(D_TIMEZONE) \ $(D_EPS_DSC) $(D_LANGUAGE) $(D_BGCOLOR) $(D_BACKGROUND) \ $(D_TEXT) $(D_LINK) $(D_ALINK) $(D_VLINK) \ $(D_HOLIDAY_PRE) $(D_HOLIDAY_POST) $(D_BLANK_STYLE) \ $(D_SEARCH_PCAL_DIR) $(D_BUILD_ENV) # # Depending on whether we're compiling for Unix/Linux or DOS+DJGPP, use # appropriate values as flags for the C compiler. # # '-O2' enables a 2nd-level code optimization # '-Wall' enables many compile-time warning messages # '-W' enables some additional compile-time warning messages # ifeq ($(OS),DJGPP) # DOS+DJGPP CFLAGS = -Wall -W else # Unix CFLAGS = -O2 -Wall -W endif $(EXECDIR)/$(PCAL): $(OBJECTS) $(CC) $(LDFLAGS) -o $(EXECDIR)/$(PCAL) $(OBJECTS) -lm @ echo Build of $(PCAL) for $(OS_NAME) completed. $(OBJDIR)/encvec.o: $(SRCDIR)/encvec.c $(CC) $(CFLAGS) $(COPTS) -o $@ -c $(SRCDIR)/encvec.c $(OBJDIR)/exprpars.o: $(SRCDIR)/exprpars.c $(SRCDIR)/pcaldefs.h \ $(SRCDIR)/protos.h $(CC) $(CFLAGS) $(COPTS) -o $@ -c $(SRCDIR)/exprpars.c $(OBJDIR)/moonphas.o: $(SRCDIR)/moonphas.c $(SRCDIR)/pcaldefs.h \ $(SRCDIR)/pcallang.h \ $(SRCDIR)/protos.h $(CC) $(CFLAGS) $(COPTS) -o $@ -c $(SRCDIR)/moonphas.c $(OBJDIR)/pcal.o: $(SRCDIR)/pcal.c $(SRCDIR)/pcaldefs.h \ $(SRCDIR)/pcallang.h \ $(SRCDIR)/protos.h $(CC) $(CFLAGS) $(COPTS) -o $@ -c $(SRCDIR)/pcal.c $(OBJDIR)/pcallang.o: $(SRCDIR)/pcallang.c $(SRCDIR)/pcallang.h \ $(SRCDIR)/pcaldefs.h $(CC) $(CFLAGS) $(COPTS) -o $@ -c $(SRCDIR)/pcallang.c $(OBJDIR)/pcalutil.o: $(SRCDIR)/pcalutil.c $(SRCDIR)/pcaldefs.h \ $(SRCDIR)/pcallang.h \ $(SRCDIR)/protos.h $(CC) $(CFLAGS) $(COPTS) -o $@ -c $(SRCDIR)/pcalutil.c $(OBJDIR)/readfile.o: $(SRCDIR)/readfile.c $(SRCDIR)/pcaldefs.h \ $(SRCDIR)/pcallang.h \ $(SRCDIR)/protos.h $(CC) $(CFLAGS) $(COPTS) -o $@ -c $(SRCDIR)/readfile.c $(OBJDIR)/writefil.o: $(SRCDIR)/writefil.c $(SRCDIR)/pcaldefs.h \ $(SRCDIR)/pcallang.h \ $(SRCDIR)/protos.h $(CC) $(CFLAGS) $(COPTS) -o $@ -c $(SRCDIR)/writefil.c # # This target will delete everything except the 'pcal' executable. # clean: rm -f $(OBJECTS) \ $(DOCDIR)/pcal.cat $(DOCDIR)/pcal-help.ps \ $(DOCDIR)/pcal-help.html $(DOCDIR)/pcal-help.txt # # This target will delete everything, including the 'pcal' executable. # clobber: clean rm -f $(EXECDIR)/$(PCAL) # # This target will delete everything and rebuild 'pcal' from scratch. # fresh: clobber $(PCAL) man: $(DOCDIR)/pcal.man nroff -man $(DOCDIR)/pcal.man > $(DOCDIR)/pcal.cat groff -man -Tps $(DOCDIR)/pcal.man >$(DOCDIR)/pcal-help.ps groff -man -Thtml $(DOCDIR)/pcal.man >$(DOCDIR)/pcal-help.html groff -man -Tascii $(DOCDIR)/pcal.man >$(DOCDIR)/pcal-help.txt install: $(EXECDIR)/$(PCAL) man mkdir -p $(DESTDIR)/$(BINDIR) mkdir -p $(DESTDIR)/$(MANDIR) mkdir -p $(DESTDIR)/$(CATDIR) cp $(EXECDIR)/$(PCAL) $(DESTDIR)/$(BINDIR) cp $(DOCDIR)/pcal.man $(DESTDIR)/$(MANDIR)/pcal.1 $(PACK) $(DESTDIR)/$(MANDIR)/pcal.1 cp $(DOCDIR)/pcal.cat $(DESTDIR)/$(CATDIR)/pcal.1 $(PACK) $(DESTDIR)/$(CATDIR)/pcal.1 pcal-4.11.0/Makefile.Amiga0000644000175000001440000000137510732021350013355 0ustar wusers# # Makefile automatically generated by MKMK V6.55 # Sun Apr 01 18:33:06 2007 # CFLAGS= DEF M_PI=PI DATA=f OPT PARM=r LDFLAGS= link math s noicon OBJS= pcal.o moonphas.o readfile.o encvec.o writefil.o exprpars.o pcalutil.o \ pcallang.o /exec/pcal: $(OBJS) $(CC) $(LDFLAGS) to $@ $(OBJS) moonphas.o: moonphas.c pcaldefs.h pcallang.h protos.h pcal.o: pcal.c pcaldefs.h pcallang.h protos.h readfile.o: readfile.c pcaldefs.h pcallang.h protos.h encvec.o: encvec.c writefil.o: writefil.c pcaldefs.h pcallang.h protos.h exprpars.o: exprpars.c pcaldefs.h protos.h pcalutil.o: pcalutil.c pcaldefs.h pcallang.h protos.h pcallang.o: pcallang.c pcaldefs.h pcallang.h clean: -delete $(OBJS) /exec/pcal.lnk archive: clean lha -r u RAM:pcal /// pcal-4.10.0 pcal-4.11.0/Makefile.DOS0000644000175000001440000001330710465000255012766 0ustar wusers# # Makefile for 'pcal' under MS-DOS # # v4.10.0: Bill Marr # # Fix a problem whereby the specification of the memory model to be used # was missing from the link stage. Explicitly specify the memory model as # a variable. Document the available memory models and their use. # # Enable a run-time check for stack overflow conditions by compiling with # the '-N' option. # # Accommodate the fact that the use of 'pcalinit.{c,ps,h}' is no longer # needed. PostScript output is now directly generated by C code, without # the use of a PostScript template which is converted to a C header file. # # Eliminate other now-unused files ('pcalglob.h', 'pcalpapr.{c,h}') and add # new files ('encvec.c', 'pcallang.c'). # # Specify proper header file dependencies. Several of them were incorrect. # # Rename 'EPS' definition to 'EPS_DSC' (in order to more clearly show its # purpose and to avoid confusion with the embedded EPS image capability for # monthly calendars). # # Provide several enhancements to the comments. # # v4.9.0: Bill Marr # # Use 'src/' now that source files are in their own subdirectory. # # Add '-DEPS' switch to get EPS-compliant PostScript output. # # v4.8.0: Bill Marr # # Change compiler command line to work under Borland C++ v5.0 # # v4.5: "make clean" leaves pcal intact but removes other by-products; # "make clobber" blows everything away; # "make fresh" rebuilds pcal from scratch # # Uses TurboC or Borland C++ command line compiler: # # make -f Makefile.DOS # # Define various directories for the following items: # # - source code # - object code # - installed 'pcal' executable # # This 'make' file mimics the Unix 'Makefile' file, by defining separate # directories for the source, the objects, and the executable. However, # unlike the Unix compilers, the Borland C (DOS) compiler had trouble with # creating the objects and executable code in subdirectories, so for now, # we're just using the same actual destination directory ('.') for both of # them. # SRCDIR = src OBJDIR = . EXECDIR = . # # Use the Borland C++ compiler (v5.0)... # CC = bcc # # Select the appropriate memory model: # # t = tiny (code+data < 64K) # s = small (code < 64K, data < 64K) # c = compact (code < 64K, data < 16M) # m = medium (code < 16M, data < 64K) # l = large (code < 16M, data < 16M) # h = huge (same as 'large', but allows > 64K total static data) # MODEL = h # # This flag controls the generation of EPS-like PostScript Document # Structuring Conventions (DSC) so that the output contains enhanced comments # ('%%Page:', etc.) that are necessary for programs like 'psnup' to do useful # things with the generated calendars. These comments also allow PostScript # previewer applications to page up to the previous page. # D_EPS_DSC = -DEPS_DSC # # Enable certain compile flags: # # -DBUILD_ENV_MSDOS declare that we're building for MS-DOS # # Borland compiler flags: # # -m($MODEL) use specified memory model # -N check for 'stack overflow' condition # -v- disable debugging information # -w-ccc disable warning 'Condition is always true/false' # -w-pia disable warning 'Possibly incorrect assignment' # -w-rch disable warning 'Unreachable code in function xxx' # -w-rvl disable warning 'Function should return a value in function xxx' # -w-par disable warning 'Parameter xxx is never used in function xxx' # -w-aus disable warning 'xxx is assigned a value that is never used in function xxx' # CFLAGS = -DBUILD_ENV_MSDOS $(D_EPS_DSC) -I$(SRCDIR) \ -m$(MODEL) -N -v- -w-ccc -w-pia -w-rch -w-rvl -w-par -w-aus OBJECTS = $(OBJDIR)\pcal.obj \ $(OBJDIR)\encvec.obj $(OBJDIR)\exprpars.obj \ $(OBJDIR)\moonphas.obj $(OBJDIR)\pcalutil.obj \ $(OBJDIR)\pcallang.obj \ $(OBJDIR)\readfile.obj $(OBJDIR)\writefil.obj $(EXECDIR)\pcal.exe: $(OBJECTS) $(CC) -m$(MODEL) $(LDFLAGS) $(OBJECTS) @ echo Build of 'pcal' for MS-DOS completed. $(OBJDIR)\encvec.obj: $(SRCDIR)/encvec.c $(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)/encvec.c $(OBJDIR)\exprpars.obj: $(SRCDIR)\exprpars.c $(SRCDIR)\pcaldefs.h \ $(SRCDIR)\protos.h $(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\exprpars.c $(OBJDIR)\moonphas.obj: $(SRCDIR)\moonphas.c $(SRCDIR)\pcaldefs.h \ $(SRCDIR)\pcallang.h \ $(SRCDIR)\protos.h $(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\moonphas.c $(OBJDIR)\pcal.obj: $(SRCDIR)\pcal.c $(SRCDIR)\pcaldefs.h \ $(SRCDIR)\pcallang.h \ $(SRCDIR)\protos.h $(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\pcal.c $(OBJDIR)\pcallang.obj: $(SRCDIR)\pcallang.c $(SRCDIR)\pcallang.h \ $(SRCDIR)\pcaldefs.h $(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\pcallang.c $(OBJDIR)\pcalutil.obj: $(SRCDIR)\pcalutil.c $(SRCDIR)\pcaldefs.h \ $(SRCDIR)\pcallang.h \ $(SRCDIR)\protos.h $(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\pcalutil.c $(OBJDIR)\readfile.obj: $(SRCDIR)\readfile.c $(SRCDIR)\pcaldefs.h \ $(SRCDIR)\pcallang.h \ $(SRCDIR)\protos.h $(CC) $(CFLAGS) $(COPTS) -c $(SRCDIR)\readfile.c $(OBJDIR)\writefil.obj: $(SRCDIR)\writefil.c $(SRCDIR)\pcaldefs.h \ $(SRCDIR)\pcallang.h \ $(SRCDIR)\protos.h $(CC) $(CFLAGS) $(COPTS) -I$(OBJDIR) -c $(SRCDIR)\writefil.c # # This target will delete everything except the 'pcal' executable. # clean: del $(OBJDIR)\*.obj # # This target will delete everything, including the 'pcal' executable. # clobber: clean del $(EXECDIR)\pcal.exe # # This target will delete everything and rebuild 'pcal' from scratch. # fresh: clobber pcal.exe pcal-4.11.0/doc/0000755000175000001440000000000010732024237011446 5ustar wuserspcal-4.11.0/doc/obsolete/0000755000175000001440000000000010732022552013260 5ustar wuserspcal-4.11.0/doc/obsolete/CVS/0000755000175000001440000000000010732022552013713 5ustar wuserspcal-4.11.0/doc/obsolete/CVS/Root0000644000175000001440000000006310732022552014560 0ustar wusers:ext:marr99@pcal.cvs.sourceforge.net:/cvsroot/pcal pcal-4.11.0/doc/obsolete/CVS/Repository0000644000175000001440000000002210732022552016007 0ustar wuserspcal/doc/obsolete pcal-4.11.0/doc/obsolete/CVS/Entries0000644000175000001440000000005510732022552015247 0ustar wusers/pscalendar/1.1/Wed Dec 15 23:10:03 2004// D pcal-4.11.0/doc/obsolete/pscalendar0000755000175000001440000001265010160142113015315 0ustar wusers#!/bin/csh -f # # [Here it is... the original shell script and PostScript boilerplate that # would eventually become "pcal". Modified slightly by A. W. Rogers to # correct bug in leap year algorithm, suppress the illegible weekday names # in the small calendars, use the more common "-d" flag (instead of "-P") to # specify line printer destination, default to the current month/year, and # add the current century to years between 0 and 99.] # # Original From: patwood@unirot.UUCP (Patrick Wood) # # The following is a PostScript program to print calendars. It doesn't # work on or before 1752. # # Shell stuff added 3/9/87 by King Ables # # Made pretty by tjt 1988 # # Tim Tessin - Lawrence Livermore National Laboratory # tjt@tis.llnl.gov # Phone: (415) 423-4560 / 422-8971 # Run like the following: pscalendar -Pstrudel 4 1988 - for April 1988 # set printer="cat" top: if ($#argv > 0) then switch ("$argv[1]") case -d*: case -P*: set printer="lp "`echo $argv[1] | sed s/-P/-d/` shift argv goto top case *: if ($?month) then set year="$argv[1]" else if ($?year) then echo "usage: $0 [-dprinter] month year" exit 1 else set month="$argv[1]" endif shift argv goto top endsw endif if ($?year) then else @ month = `date +%m` @ year = `date +%Y` endif if ($year >= 0 && $year < 100) then @ year += 100 * (`date +%Y` / 100) endif cat < -J print Julian day and days remaining -j print Julian day (day of year) -K prev/next-month in 1st/last box -k prev/next-month in 1st 2 boxes -L define left-justified footer string -l landscape mode -M print all moons -m print new/half/full moons -N define heading for notes box -n select alternate notes font -O print day as empty colored outline -o select alternate output file -P paper size (letter, legal, a4, tabloid) -p portrait mode -Q -q generate yearly-planner style HTML calendar -R define right-justified footer string -r remap fonts for 8-bit characters -S suppress small prev/next-month calendars -s define date color & fill box shading color -T select typeface for date/note text -t select alternate title font -U undefine preprocessor symbol -u display parameter usage message -V -v display version ID -W monthly title horizontal alignment -w print whole-year/page calendar -X X-axis transformation -x X-axis scale factor -Y Y-axis transformation -y Y-axis scale factor -Z generate debugging information -z specify alternate time zone -# print multiple copies of each page The 'pcal' (and 'lcal' [lunar calendar]) homepage is: http://pcal.sourceforge.net Note: The latest information (including a list of any bugs or problems with the latest release) can be found at that website. The 'pcal' and 'lcal' applications are available at: http://sourceforge.net/projects/pcal/ A section entitled "Guidelines for Application Maintainers" can be found here: http://pcal.sourceforge.net/maintainers.html ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- Building 'pcal': Unix/Linux (or DOS/Windows + Cygwin): make make install (as 'root' user) DOS (Borland, etc): make -f Makefile.DOS Successfully compiles with Borland C++ v5.0 (and probably several other earlier/later versions of Borland C++ or Turbo C/C++). make -f Makefile.DOS install DOS (using DJGPP): make OS=DJGPP make OS=DJGPP install ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.11.0 This release of 'pcal' includes additional functionality, some bug fixes, and an update of the associated documentation. Major changes: 1) New functionality: - Support for the following languages has been added: - Slovak ("-a sk") Thanks to Zdenko Podobny for this patch and for a new calendar configuration file with Slovak holidays ('calendar_sk.txt'), which is now included in the 'examples' directory. - Hawaiian ("-a ha") Thanks to Eric Nichols for this patch. - Added a sample Spanish calendar configuration file, with Spanish holidays ('calendar_es.txt'), generously provided by Francisco José Marín Pérez. Aside: The file was renamed from his original name of 'calendar_sp.txt' to 'calendar_es.txt', in order to match the convention of using ISO 3166 (country codes) for 'pcal' sample configuration files. - Allow the drawing of moon phase icons ('-m' or '-M') and Julian dates ('-j' or '-J') on yearly-format calendars. Previously, these features were only allowed on monthly-format calendars. If someone has eyes good enough to see these things, they should be allowed to add them to their yearly-format calendars! :^) Since moon phase icons and Julian dates were automatically disabled on yearly-format calendars in older releases, you might be surprised to suddenly find these (possibly unwanted) items on your yearly-format calendars, assuming you have a 'pcal' configuration file (loaded with '-f') with one of those 4 options enabled (i.e. 'opt -m', 'opt -M', 'opt -j', and/or 'opt -J'). If you want to see moon phases or Julian dates _only_ on your monthly-format calendars, simply modify your configuration file(s) to use a check such as this: # # Display moon phase icons on every day of the month. # # Beginning with version 4.11.0, this works on yearly-format (1 # year per page) calendars too. But it can be disabled as shown # below. # ifndef whole_year opt -M endif Note that the 'pcal-cfg.txt' sample configuration file (distributed with 'pcal' in the 'examples' subdirectory) has some examples of this too. - Added a new preposition -- 'on'. The use of this preposition is similar to the existing prepositions like 'on_or_before' and 'on_or_after', but it requires that the event occur exactly on the specified day. Some examples to clarify: Sat on Jul 4 Huge party! This example causes the text "Huge party!" to be displayed only if July 4th (for that year) occurs on a Saturday. Fri on all 13 Avoid black cats! This example causes the text "Avoid black cats!" to be displayed on Friday the 13th, for every month ("all") in which it occurs. This new feature was added based on a request from (and partially based on a patch from) Erkki Petsalo. - Added a new option -- '-W [ left | center | right ]' -- to specify the horizontal alignment of the month/year title displayed at the top of monthly-format calendars. The default is, of course, 'center'. Thanks to Todd Foster for providing a complete and thorough patch to provide this new feature. He uses it to avoid splitting the month/year label as he cuts a monthly-format calendar apart to fit into a 6x9-inch notebook, but this feature might be useful to others as well. - Per a request from Stefan Haubenthal, who provided a small patch and a proper makefile ('Makefile.Amiga'), re-added support for the Amiga platform, which had been removed in the last release (due to unavailability of someone to test on that platform). 2) Removed functionality: - Removed the long-obsolete external 'moon file' concept. Now, we depend solely on the algorithmic determination of moon phases, which has been in place for many years and seems to be plenty accurate. The 'moon98' file (with manual entries of the dates and times of the 4 primary moon phases for all of 1998) was also removed from the 'examples' subdirectory, since it no longer serves any purpose. - The 'F13' pre-defined event has been removed. It is unnecessary now that 'pcal' has support for the new 'on' preposition (described above). Replace any occurrence of 'F13' in your configuration file(s) with this: Fri on all 13 The 'examples/pcal-cfg.txt' and 'examples/calendar_nl.txt' files were altered accordingly, intelligently using a pre-processor 'ifdef' directive and the pre-defined 'pcal' version symbol ('ifdef v4_8_0 | v4_9_0 | v4_9_1 | v4_10_0') to use the appropriate format for this event specification, depending upon which version of 'pcal' is being used. 3) Bug fixes: - Fixed a bug present since the 4.10.0 release of 'pcal' whereby the use of the '-J' (capital 'J') option to display both the Julian date (day of year) and the number of remaining days in the year erroneously caused garbage text (PostScript commands) to appear in place of the number of days remaining in the year. - Fixed a long-standing bug whereby the last line of a 'pcal' configuration file was silently ignored if it ended without a 'line feed' (ASCII 10 character). Thanks to Thomas Zastrow for reporting this bug. - Fixed a long-standing bug in the 'moon phase' calculations. This bug only affected the pure DOS build (i.e. made with 'Makefile.DOS'). It did not affect the Linux/Unix builds or the DJGPP-based or Cygwin-based builds. This bug was causing the major phases of the moon (new, 1Q, full, 3Q) to be erroneously detected on 2 adjacent days instead of on just the single day on which they actually occurred. This in turn caused 2 of the same moon phase icons to appear on adjacent days on monthly-format calendars when the '-m' option was used. Thanks to Eric Nichols who helped to confirm the presence of this bug. 4) Other changes: - In the USA calendar example file and the generic 'pcal-cfg.txt' example file, commented out the pre-2007 rules for Daylight Saving Time (DST) and added new rules for 2007 and beyond. - Made some tweaks to the 'examples/pcal-cfg.txt' 'pcal' sample configuration file, in some cases to demonstrate more 'pcal' functionality. - Added the Polish calendar ('examples/calendar_pl.txt'), provided by Dominik 'Chiron' Derlatka in the previous 'pcal' release, to the release package. It had been inadvertently omitted from the 4.10.0 release (but was available via CVS checkout since then). - Added 2 Unix shell scripts to a new 'scripts' directory in the 'pcal' distribution: - my_daily_reminder_script.sh This script provides daily email schedule reminders. - group_calendaring.sh This script allows a simple 'group calendaring' capability. These scripts were written and generously provided by Kristofer Bergstrom. They help automate his usage of 'pcal' and should prove useful to others. Kris' detailed explanation of the usage of these scripts is available as a link on the main 'pcal'/'lcal' website, but here's the direct link: http://pcal.sourceforge.net/scripts.html - Modified the Unix makefile to allow use of a user-specified destination directory ('$DESTDIR') on the installation step. For example: make DESTDIR=$HOME/test install Thanks to "Jonathan" (who's packaging 'pcal' for Gentoo) for this idea and a related patch. - Made various tweaks and updates to the 'man pcal' page. Some of these are intended to provide more guidance and examples in the use of 'pcal'. Added a long-missing description of the pre-defined symbols for paper size and page orientation, which can be used to advantage in the 'pcal' configuration file. - Fixed up a few errors (wrong credits, etc) and made various required changes to previous release notes in this 'ReadMe.txt' file. Credits: The original calendar PostScript was Copyright (c) 1987 by Patrick Wood and Pipeline Associates, Inc. with permission to modify and redistribute. The following people contributed to Pcal v4.11.0: Bug fixes, support for moon icons and Julian dates on yearly-format calendars, and various other fixes: Bill Marr Slovak language support and config file: Zdenko Podobny Hawaiian language support: Eric Nichols Spanish config file: Francisco José Marín Pérez Useful Unix scripts: Kristofer Bergstrom New 'on' preposition: Erkki Petsalo Title alignment option: Todd Foster Amiga support: Stefan Haubenthal For a list of all known contributors to date, see the 'Authors' section of the 'man' page. Bill Marr (marr99@users.sourceforge.net) 18 Dec 2007 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.10.0 This release of 'pcal' includes additional functionality, some bug fixes, and an update of the associated documentation. Major changes: 1) New functionality: - Support for the following languages has been added: - Danish ("-a da") - Dutch ("-a nl") - Polish ("-a pl") - Romanian ("-a ro") Thanks to Ewald Beekman, a new calendar configuration file with Dutch holidays ('calendar_nl.txt') is included in the 'examples' directory. Thanks to Dominik 'Chiron' Derlatka, a new calendar configuration file with Polish holidays ('calendar_pl.txt') is included in the 'examples' directory. 2) Removed functionality: - Support for the OS/2, Amiga, and Vax/VMS platforms has been removed. These platforms are essentially obsolete and the files and code needed to accommodate these platforms was cluttering things up and interfering with further progress by needlessly complicating the code. Anyone needing support for these platforms is advised to continue using the 4.9.1 release of 'pcal'. 3) Bug fixes: - Fixed a couple of long-standing, recently-uncovered bugs in the use of the timezone ('-z') option, which is used in the 'moon phase' calculations: (1) Negative timezone arguments, used for areas east of (i.e. later than) UTC/Greenwich (e.g. '-z-5'), were not being processed correctly. (They were erroneously adjusted by adding a full 24 hours to make them positive.) Thanks to Lalit Chhabra for reporting this bug. (2) The user-specified timezone offset was being normalized to +/- 12 hours. Although this works for the vast majority of users, there are places in the world which are outside that range. For example, Christmas Island (aka 'Kiritimati', in the Pacific Ocean) is in the UTC+14 timezone. The local time there is 14 hours ahead of UTC, so the 'pcal' option would be '-z-14'. Obviously, with such places in the world, we can no longer normalize the user-specified timezone offset to +/- 12 hours. - Fixed a problem whereby certain installations of Cygwin were unable to compile 'pcal', due to a namespace collision between the 'getline()' routine in 'pcal' and the standard C library function 'getline()'. Thanks to Daniela ('Dani') Duerbeck for reporting this and to Stefan Fronzek for confirming that the fix worked. - Worked around a problem whereby a 'segmentation fault' crash can occur when a single entry in the 'pcal' configuration file has more than 100 'words' defining an event. Thanks to Eric Herrera for the crash report. For now, the limit has been increased from from 100 to 300, which should solve the problem for the vast majority of 'pcal' users. 4) Other changes: - Eliminated certain compile-time warnings that occur in a "GCC 3.4.2 + Solaris" build environment, thanks to a report from David Mathog. This involved adding a bunch casting operations to the argument of certain function calls like 'isdigit()' and 'islower()'. - Eliminated the voluminous description of the syntax and operations for the 'pcal' configuration file from the 'pcal -h' output, leaving just the detailed description of the command-line parameters. The long description of the use of 'pcal' configuration file was somewhat out-of-date and basically just (badly) duplicated the content of the 'man pcal' page (or its HTML, PostScript, or ASCII equivalent file). The 'man pcal' page should be treated as the authoritative reference for detailed aspects of 'pcal' operation. - Changed the format for the timestamp in the PostScript comment output ('%%CreationDate:') to one which is more thorough and less ambiguous. - Provide the URL to the 'pcal'/'lcal' website in the header (comment) section ('%%Creator:') of the PostScript output. - In the USA calendar example file, a couple of out-of-date URLs were repaired and some erroneous comment information about the date of George Washington's birthday was fixed. 5) Of interest to 'pcal' hackers and installers: - Made a major change to 'pcal' design. Previously, the PostScript output was generated in part using an external program ('pcalinit[.c]') which read the PostScript template file ('pcalinit.ps') and automatically generated a C header file ('pcalinit.h'). This old method had a few disadvantages: (1) The PostScript output that it generated was ugly, with no whitespace (vertically or horizontally) and devoid of the (useful) comments that were part of the PostScript template file. This made reading the PostScript much harder. (2) It was harder to take advantage of patterns in the PostScript output, causing redundancy. (3) It was harder to compile (especially as the size of the PostScript template file grew) under limited environments, like DOS. The new method generates all the PostScript output using C code only. Minor optimizations in the code can be made this way, without needlessly replicating similar chunks of PostScript code. This puts some of the logic behind the PostScript output back into C code, where it's easier to see what's happening. In truth, this change was first made (recently) to the 'lcal' application, where the inefficiencies are greater. Logically, however, 'pcal' benefited from the same change. - Renamed the 'Makefile' flag 'EPS' to 'EPS_DSC' in order to more clearly show its purpose (i.e. to use different PostScript Document Structuring Conventions [DSC]) and to avoid confusion with the embedded EPS image capability for monthly calendars. Credits: The original calendar PostScript was Copyright (c) 1987 by Patrick Wood and Pipeline Associates, Inc. with permission to modify and redistribute. The following people contributed to Pcal v4.10.0: Bug fixes, various other fixes: Bill Marr Polish language support: Dominik 'Chiron' Derlatka Dutch language support: Ewald Beekman Romanian language support: Claudiu Costin Danish language support: Kenneth Geisshirt For a list of all known contributors to date, see the 'Authors' section of the 'man' page. Bill Marr (marr99@users.sourceforge.net) 06 Aug 2006 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.9.1 This release of 'pcal' includes no new functionality. It contains only a simple bug fix. Major changes: 1) Bug fixes: - Fixed a bug which inadvertently slipped into the 4.9.0 release at the last minute. This bug is only encountered when building for the Unix/Linux, OS/2, or DOS+DJGPP environments (i.e. when using the 'Makefile' file). It causes a syntax error if you attempt to install 'pcal' using the 'make install' command. Bill Marr (marr99@users.sourceforge.net) 24 Aug 2005 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.9.0 This release of 'pcal' includes additional functionality, some bug fixes, and an update of the associated documentation. Major changes: 1) New functionality: - Added new PostScript encoding vectors to support the following character sets: - KOI8-R -- Russian - ISO 8859-2 -- Latin2 (East European) - ISO 8859-3 -- Latin3 (South European) - ISO 8859-4 -- Latin4 (North European) - ISO 8859-5 -- Cyrillic - ISO 8859-7 -- Greek - ISO 8859-9 -- Latin5 (Turkish) - ISO 8859-10 -- Latin6 (Nordic) - ISO 8859-11 -- Thai - ISO 8859-13 -- Latin7 (Baltic Rim) - ISO 8859-14 -- Latin8 (Celtic) - ISO 8859-15 -- Latin9 (adds euro, etc) Note that not all of these new encodings are currently used, simply because a language which requires the use of a given encoding may not yet be supported by 'pcal'. Any of these encodings which are not yet used have been added with the intent of simplifying the future addition of support for other languages. Furthermore, encodings for Arabic (ISO 8859-6), Hebrew (ISO 8859-8), and Latin10 (ISO 8859-16) are not currently supported at all, but placeholders have been added to the 'pcal' source code to allow easier entry of those encodings in the future, if someone comes up with the necessary PostScript encoding vectors. - Support for the following languages has been added: - Czech ("-a cz") - Hungarian ("-a hu") - Catalan ("-a ca") - Russian language support is no longer considered "experimental", now that 'pcal' properly supports the KOI8-R character encoding. The default encoding for Russian is now KOI8-R instead of KOI8-U (which was used in v4.8.0 as a crude, temporary method). Latvian and Lithuanian language support is no longer considered "experimental", now that 'pcal' properly supports the 'Latin7' (ISO 8859-13) character encoding. The default encoding for both Latvian and Lithuanian is now 'Latin4' instead of 'Latin1' (which was used in v4.8.0 as a crude, temporary method). 2) New date file functionality: - Based on a patch from Bill Bogstad, added the capability to delete specific events, thereby allowing one to exclude one or more events that were inserted as a group of events, by using the new 'delete' keyword. More details are in the 'man' page. The sample configuration file ('examples/pcal-cfg.txt') also includes an example of the usage of this new capability. 3) Other changes: - Changed the date/event separator character from a space to a tab when using the '-c' option (to output text lines which are compatible with the Unix 'calendar' program). This was done at the behest of a user who found that the space character was inadequate as a separator. In fact, the 'calendar' program from a recent stable version (6.0.17) of the Debian 'bsdmainutils' package proves that the space character is truly inadequate as a separator when running 'pcal -c > pcal-output.txt; calendar -f pcal-output.txt'. - Added a Perl script ('html/pcal.pl') from David Mathog which is an alternate way (compared to the existing 'pcal.cgi' Bourne shell script) to generate calendars via HTML/CGI. - Now that new character encodings are available, the default Greek-language character encoding was changed from 'Latin-1' (ISO 8859-1) to 'Greek' (ISO 8859-7) to prevent having to specify '-r none' in order to get a usable Greek calendar. - Added new 'pcal' calendar configuration files to the 'examples/' directory: - 'calendar_us.txt' This example, provided by J. Rhett Hooper, contains events for users in the USA. - 'calendar_hu.txt' This example, provided by Ferenc Kruzslicz, contains events for users in Hungary. - Now that the Latin3 (ISO 8859-3) character encoding is provided, there's no need to use the previous (customized) method of supporting the Esperanto language. Because of this, the custom 'Esperanto' encoding has been eliminated. Esperanto speakers/users should now just use the standard 'Latin3' (ISO 8859-3) characters, which fully support the unique characters in the Esperanto language. This change cleans up the code in several spots. - Tweaked several of the sample calendar configuration files in the 'examples/' directory to not specify any fonts. The specification of fonts is better left to the command line, since the necessary fonts to display/print a given language's calendar will undoubtedly differ amongst various users. - Added several new 'examples/fonttest_*' files to support testing of the various character encodings. These 'font test' files can be used as shown in this example to check any of your fonts for use with the specified character encoding: pcal -f examples/fonttest_koi8r -n some_koi8_fontname Renamed old 'examples/fonttest_x' files to be more explicit, thereby avoiding confusion with newly-added 'fonttest' files. - Fixed a long-standing misrepresentation of the Spanish word for 'Saturday'. The word is 'Sábado', but the acute accent on the first 'a' was missing. - Fixed misrepresentations of the Lithuanian word for 'August' and the Latvian words for 'June' and 'July'. Since these languages were added in the previous release, these months erroneously used a 'u'+circumflex instead of the proper 'u'+macron. 4) Bug fixes: - Fixed a bug introduced in version 4.8.0 whereby the specification of a plural form of the day-of-week name was not being properly detected, reporting an 'unrecognized line in file' error. Here's an example: all Fridays in Oct xxxxx Thanks to Pedro I. Sanchez for reporting this bug. A work-around for this bug was to simply change the plural form to the singular form (e.g. "Fridays" to "Friday" or just "Fri"). - Fix a long-standing bug whereby a centered "footer" specification with 'strftime()'-like date specifiers used in an HTML yearly calendar was using/showing the correct date values for the HTML 'title' but the wrong date values for the centered header string at the start of the actual displayed (HTML) content. 5) Documentation changes: - Added an entry to this 'ReadMe.txt' file in the v4.8.0 'Bug fixes' section due to a last-minute v4.8.0 change to fix a couple of security holes which accidentally went undocumented in this file. - Various updates throughout. 6) Of interest to 'pcal' hackers and installers: - All PostScript encoding vectors used to define the various character encodings were defined as 'readonly'. This is mostly a cosmetic change rather than a functional change. - Made changes to the 'Makefile.DOS' file to accommodate the separate directories for the source, the objects, and the executables. That change should have been part of the v4.8.0 release but was accidentally neglected. Make further changes to the DOS build process (via 'Makefile.DOS'): - Define '-DEPS' so that EPS-compatible PostScript is generated, just like has been done for the Unix build for a while. This allows PostScript utilities to process pages more intelligently (e.g. so that a preview utility can page up and down properly). - Define several compile-time flags to prevent certain warnings. - Define the '-DPROTOS' compile-time flag to include full prototypes, thereby preventing many warnings about 'missing prototype'. - Define the '-DSTDLIB' compile-time flag to prevent warnings about multiply-defined prototypes. - To enhance compatibility with the Debian GNU/Linux distribution, made a change to the (Unix, OS/2, DOS+DJGPP) 'Makefile' file (specifically, to the 'D_SEARCH_PCAL_DIR' variable) to default to _not_ searching the directory with the 'pcal' executable file when searching for the 'calendar' ('pcal' configuration) file. - Made a minor change to the (Unix, OS/2, DOS+DJGPP) 'Makefile' file based on a patch from Thiago F.G. Albuquerque to prevent an error when building in the DOS+DJGPP environment when the directory specified by 'CATDIR' does not exist. - Remove obsolete comment in the 'Makefile' file about separate directories for the source, the objects, and the executables. This comment was accidentally left in place for the v4.8.0 release. - In 'pcallang.h', to be consistent, converted all high-order characters in the language string specifications to simple octal format, to match the octal format used in the PostScript encoding vector specifications of 'pcalinit.ps'. This makes it easier to edit the 'pcallang.h' file in any editor. It also makes checking of the language strings against the character encodings simpler. Credits: The original calendar PostScript was Copyright (c) 1987 by Patrick Wood and Pipeline Associates, Inc. with permission to modify and redistribute. The following people contributed to Pcal v4.9.0: Bug fixes, 12 new character encodings, language support, various other fixes: Bill Marr Event deletion capability: Bill Bogstad Czech language support: Peter Cernoch Hungarian language support: Ferenc Kruzslicz Catalan language support: Carles Sadurní Anguita Perl script for HTML/CGI: David Mathog US example calendar: J. Rhett Hooper DOS/DJGPP build fix/support: Thiago F.G. Albuquerque For a list of all known contributors to date, see the 'Authors' section of the 'man' page. Bill Marr (marr99@users.sourceforge.net) 18 Aug 2005 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.8.0 This release of 'pcal' includes additional functionality, some bug fixes, and a thorough update of the associated documentation. Major changes: 1) New functionality: - A method of adding Encapsulated PostScript (EPS) images to any given day(s) on a monthly-format calendar has been incorporated. Now you can have (e.g.) photos of a person on their birthday and/or icons for various holiday events, etc. For details, see the expanded documentation in the 'man' file, but briefly, to add an EPS image (photo, icon, etc) to a day, use an event entry like this (for the Thanksgiving holiday event): 4th Thu in Nov* image:/eps-path/turkey.eps 1.0 1.0 0 0 The 'image:' text is a keyword which precedes the EPS image filename. As shown, a path to the file can be specified. The first 2 values after the EPS image name are X/Y scaling values, in case the output of the EPS file is not sized properly (which is almost always the case) to fit in the 'day box'. The last 2 values are X/Y translations, in case you want to move the EPS image around within the 'day box'. Note: Your EPS images will not be directly usable! As a minimum, you'll first need to remove/comment-out the PostScript 'showpage' command near the end of the EPS image file! Depending upon the source of the EPS image, you may also want to remove/comment-out some of the PostScript 'translate' commands too. Again, much more information about all this can be found in the 'man' page for 'pcal', so please read that first! A sample EPS image (the 'recycle' icon, with 3 green arrows in a circle) has been provided with the 'pcal' distribution (under the 'eps/' directory) as a quick way to test the EPS image embedding capability on one of your calendars. This file was converted from a '.WMF' image file (using the 'libwmf'/'wmf2eps' library/utility mentioned in the 'man' file) and the string '%%% DISABLED: ' was prepended in 3 spots to disable the PostScript 'translate' and 'showpage' commands associated with those lines. This file is intended as a guide for what needs to be done to make your own EPS images usable by 'pcal'. To test with this sample EPS icon, add lines like these to your 'pcal' configuration file: second Sat in all RECYCLE! second Sat in all image:/path-to-eps/recycle.eps 0.029 0.029 66 -28 With the provided X/Y scaling and X/Y translation values, it should place the symbol in the lower right corner of the 'day box', assuming you're using letter-sized paper and landscape orientation on a monthly calendar. - Support for 'legal' (8.5 x 14.0 inch) and 'tabloid' (11.0 x 17.0 inch) paper has been added. Specifying the paper size is now done differently than in the past. See the section 'New command-line options' (below) for details. - Added new automatically-defined symbols based on the current paper size: - "PAPERSIZE_LETTER" - "PAPERSIZE_LEGAL" - "PAPERSIZE_A4" - "PAPERSIZE_TABLOID" These can be useful for providing alternate values in the 'pcal' configuration file for EPS image placement and scaling, based on paper size. - Added new automatically-defined symbols based on the current page orientation: - "ORIENTATION_PORTRAIT" - "ORIENTATION_LANDSCAPE" These can be useful for providing alternate values in the 'pcal' configuration file for EPS image placement and scaling, based on the page orientation. - Support the definition of a symbol value along with a symbol name in 'define' pre-processor directives in the 'pcal' configuration file. For example: define sem_start 8/23 # Beginning of semester sem_start CIS136 Start 7th day after sem_start CIS136 Quiz 1 14th day after sem_start CIS136 Quiz 2 undef sem_start This capability came from an unknown author via the Debian Bug Tracking System for 'pcal'. It was somewhat buggy in the Debian implementation, but was (completely?) repaired prior to inclusion in this release of 'pcal'. - Support for the following languages has been added: - Swedish ("-a sv") - Ukrainian ("-a uk") - Portuguese ("-a pt") - Estonian ("-a et") - Russian ("-a ru") - Latvian ("-a lv") - Lithuanian ("-a lt") Note: The support for Russian, Latvian, and Lithuanian is considered "experimental". The day-of-week names and month names have been provided for these languages, but the character encodings have not been provided. Russian support has been set up to use the KOI8-U (Ukrainian) character encoding instead of the KOI8-R encoding that it should use. Latvian and Lithuanian support have been set up to use the Latin-1 (ISO-8859-1) encoding instead of the ISO-8859-13 character encoding that they should use. From a practical standpoint, this probably means that these languages will appear mostly correct (i.e. for characters which can be displayed/printed in the encoding used) but will not be 100%. Patches would be gratefully accepted from anyone with the expertise to provide the necessary character encodings! UPDATE: As of 'pcal-4.9.0', Russian, Latvian, and Lithuanian language support is no longer considered "experimental" due to the addition of the proper character encodings for those languages. See the 'pcal-4.9.0' release notes (above) for details. - Substantial changes were made to the HTML user interface used to generate calendars. Added the appropriate option for the (already-existing) Finnish language support. Changed the 'Language:' selection in HTML calendar generation files ('pcal.html' and 'pcalw.html') to support the new languages. Also, make this a 'drop-down' list instead of a series of 'radio buttons', which makes for a cleaner interface now that there are 12 language options. Added a new 'Paper Size' option to correspond to the new '-P' option to 'pcal'. Changed the description of the last option ('Holidays:') to 'Bypass Date File Processing:' to more accurately reflect what it really does! Changed the interface for this item to a 'check box' instead of 2 'radio buttons' to match common user interface guidelines and to clean-up the interface. Changed references to 'gray' date numerics to instead say "'date shade' color (default = gray)" to reflect the fact that a user can override the 'grey' default color in his/her 'pcal' options file (via the 'opt -s ...' command/switch). Provide a new 'default' option for all the 'Day Numerics' (Weekday, Sat/Sun, Holiday) selection sets. This allows the CGI script to bypass the specification of the '-g', '-O', '-G', and '-b' options. This is needed because of odd interactions between these switches which prevented the creation of a simple colored calendar. For example, there was no way to generate a monthly or yearly calendar with the defaults (Mon-Fri in black, Sat/Sun in the 'date shade' [gray by default] color, and holidays in the 'date shade' [gray by default] color, even though this is the common case when PostScript calendars are generated from the command line version of 'pcal'. Make separate entries for 'day numerics' font and 'title (etc) font' to the user interface since these are distinct and therefore separately controllable in 'pcal'. Previously, whatever font the user selected was used in both cases. Overhauled each group of 'radio buttons', changing from a horizontal set of options (which was long and difficult to discern for some entries) to a nicer, more-readable set of vertically-aligned options in a clean, captioned table for each group of radio buttons. Provide the user interface option to generate HTML-format calendars instead of PostScript-format calendars. 2) New command-line options: - In the past, the paper size could only be specified via the 'Makefile', which required recompiling if you wanted to change paper sizes. This is somewhat bothersome, but even more so now that 'pcal' supports more paper sizes (i.e. not just 'letter' and 'A4'). Beginning with this release of 'pcal', a new '-P' option is now supported to declare the 'paper size'. This option takes a value which can be any of the following (case-insensitive) values: - "letter" - "legal" - "a4" - "tabloid" This option can be specified using any of the 3 methods: (1) via the 'PCAL_OPTS' environment variable, (2) via the 'pcal' configuration file (aka '.calendar', aka the 'date' file), or (3) via the command line itself. 3) New date file functionality: - Added support for "Friday the 13th" events. Use the keyword 'F13' on the event specification. For example: F13 Avoid black cats! - Added a new 'input-language' directive for the 'pcal' configuration file. It takes a single parameter -- the 2-letter version of the ISO 639 (language code) standard. This 'input language' will be used when deciphering any month names and/or day-of-week names when processing the event entries in the 'pcal' configuration file. The default language is currently the same as the default 'output' language (English). An example entry in the 'pcal' configuration file: input-language fr # interpret event dates in French In previous versions of 'pcal', which had no concept of 'input' and 'output' languages, both the default language (English) and the currently-selected ('output') language were checked when parsing and checking for month names and day-of-week names during event processing. For the same reason as the creation of this new 'input-language' directive (i.e. to avoid conflicts), the default language is no longer checked in addition to the current (input) language. Only the current 'input' language is checked. Note that the input language only makes sense in the 'pcal' configuration file, so it can only be specified there. Note also that the 'input language' can be changed as needed at any time during processing of the 'pcal' configuration file, for the rare case where someone has multiple language event definitions within the same file. 4) Other changes: - The 2-letter language code for Greek was re-assigned from 'gr' to 'el' to be compatible with ISO 639 (2-letter and 3-letter language codes). This means that you need to (for example) use '-a el' on the 'pcal' command line to generate a Greek-language calendar rather than the old '-a gr'. - Added the '-p' and '-l' flags ('portrait' and 'landscape' paper orientations) to the list of those processed from the command line prior to the processing of the 'pcal' configuration file. This is needed so that directives like 'ifdef ORIENTATION_PORTRAIT' in the configuration file work as expected. - Fixed a flaw in the sizing of calendars generated in the 'portrait' page orientation. They were not using as much of the physical page space as they should have been. - Collected all sample 'calendar options' files for various countries (some which were on the 'pcal' website or in the mailing list archives but weren't part of the actual distribution) and named them all 'calendar_XX.txt' where 'XX' is the 2-letter country name code based on the ISO 3166 standard. This required a change to the Greek ('gk' to 'gr') and Estonian ('et' to 'ee') 2-letter codes used in the filenames. Since 'pcal' can be run under DOS, converted sample 'calendar options' files from Unix-style to DOS-style line-endings (as needed) for maximum portability. - The '%a' format specifier (which is used to represent the abbreviated day-of-week name [e.g. 'Wed']) was using a simplified method of generating the abbreviated name from the full name -- by using just the first 3 characters. With the addition of Ukrainian and (later) Estonian language support, this simple scheme became inadequate because those languages don't use 3-character abbreviations for the day-of-week names. Instead, a new array (with entries for each supported language) of the abbreviated day-of-week names was created. The '%a' format specifier uses this new array to derive abbreviated day-of-week names. 5) Bug fixes: - Fixed a design flaw whereby certain languages (like Italian, French, Esperanto, and Spanish) which have a day-of-the-week name with the same first 3 letters as a month name can cause problems detecting events in the 'pcal' configuration file. Aside: When parsing unknown tokens, day-of-week names are compared before month names. For example, French has the day 'Mardi' (Tuesday) and the month 'Mars' (March). Finnish has the day 'Maanantai' (Monday) and the month 'Maaliskuu' (March). The following event in the configuration file will yield an error because the string intended as an abbreviated month name 'Mar' (for 'Mars'/March) is erroneously interpreted as a weekday name 'Mardi': Mar 21 Event for March 21st It should be possible to specify the full month name ('Mars') to avoid the conflict, but 'pcal' was only examining the first 3 letters of the weekday names when looking for a matching token. The code which looks for matching weekday names has now been modified to use the full length of the specified token string from the configuration file, which allows one to specify the full name of the month to avoid any conflict. Note: A similar change was made to the month name comparison, because an event of 'Mars 21' (French) was being erroneously detected in an English-language setting! This ties in with the new 'input-language' directive (described above). - Fix bug whereby 'Holidays:' option in 'pcalw.html' was using older, incorrect name, causing that option to be completely ignored. - Fixed the bug (present since v4.7.1 of 'pcal', and previously documented on the 'pcal' website) whereby use of the '-q' option to generate 1-column-per-month HTML output required one to use the '-F 1' flag to force the day-of-week to begin with 'Monday'. This restriction is now removed and one can generate HTML 1-column-per-month calendars with any value for the '-F' flag (or without using the '-F' flag at all). - Fixed a couple of security holes whereby a malicious calendar file (e.g from an external source) could cause an exploitable buffer overflow attack. 6) Documentation changes: - Made major changes to the 'pcal.man' file to bring it up-to-date and make it more useful and/or readable, both in raw format and as a rendered 'man' page. Those changes are described in detail in a newly-added comment section at the beginning of that file, which acts as a 'ChangeLog' section. See that file for details. - Provided a new sample 'pcal' configuration file ('pcal-cfg.txt') in the new 'examples/' subdirectory. This file attempts to demonstrate the various features that are possible with 'pcal' in a manner which is well-documented and can be easily incorporated by others into their own 'pcal' configuration file(s). It was created with the idea that "an example (or two, or three) is worth a thousand words". Among other things, it demonstrates the use of various format specifiers, the use of the 'Notes' box, the use of pre-processor directives and conditional processing, and the use of some predefined events. - Removed the 'Pcal.hlp' file, which was essentially just a duplicate of the 'pcal.man' content in a human-readable form. The content of the 'pcal.man' file is intended to be pre-rendered (by the 'pcal' maintainer / release manager) into other human-readable forms (PostScript, HTML, ASCII text) as described in the 'Overview:' section at the beginning of this file. Now, there are essentially just 2 files which need to be updated to document 'pcal' operation: 'pcal.man' and 'ReadMe.txt'. Renamed 'ReadMe' to 'ReadMe.txt' and merged all the old versions of 'ReadMe.4.x' into that single file for clarity, consistency, and ease of access. - Moved old 'pscalendar' file into the new 'doc/obsolete/' directory since it only has historical significance. 7) Of interest to 'pcal' hackers and installers: - Created new subdirectories to better organize the 'pcal' distribution files: - 'src/' all 'pcal' source code (*.c, *.h, *.ps) - 'obj/' empty subdirectory which will contain all object code and the single C header file ('pcalinit.h') which is auto-generated at compile time - 'exec/' empty subdirectory which will contain all executable code ('pcal[.exe]' and 'pcalinit[.exe]') - 'doc/' and 'doc/obsolete/' various documentation (current and historical) - 'examples/' several sample 'calendar options' files, mostly for various holidays in each of several countries; also includes various 'calendar options' files used to test the fonts and character mappings - 'html/' files used to generate calendars using the HTML/CGI (web browser) interface - Added build instructions for the various platforms that 'pcal' supports to this file ('ReadMe.txt'). - Added a new compile-time flags setting ('CFLAGS = -O2 -Wall -W') to the Unix 'Makefile'. The first 2 of those flags were already in the OS/2 'make' file (which was almost identical to the Unix 'Makefile'), but for some unknown reason they were not in the Unix 'Makefile'. Added a brief description of each flag ('-O2' and '-Wall' and '-W') used on the 'CFLAGS = ...' line to the Unix 'make' file. For those not familiar with these flags, '-O2' provides code optimization, '-Wall' enables many compile-time warning messages, and '-W' enables more compile-time warning messages. Made several minor code modifications to prevent the compile-time warning messages that resulted from enabling those flags. - Merged the OS/2 'make' file ('Makefile.os2') into the Unix 'make' file ('Makefile'). These files were almost identical and did not merit separate files. Added support for the DOS+DJGPP environment to this same file. Use these commands: Unix/Linux: make OS/2: make OS=OS2 DOS+DJGPP: make OS=DJGPP - Added a (commented-out) '# PACK = gzip' option in the Unix 'make' file for those who don't have the 'compress' utility. - Modified the existing 'man' target in the Unix 'make' file ('Makefile') to generate the content of the 'pcal' 'man' page in HTML, PostScript, and raw text formats. Before a new release of 'pcal', the 'pcal' maintainer should run 'make man' to generate these help files. These files should also be placed on the 'pcal' website, since the main page provides links to these files. - Removed Control-L ('^L', page eject) characters from C and PostScript source code. Who puts that in source files?!? - Remove obsolete, unused targets and definitions (used to compress and 'uuencode' the source) from Unix and OS/2 'Makefile' files. - Changed 'find_sym()' routine to 'find_sym_name()' to be distinct from new 'find_sym_val()' routine in code searches. - Removed extraneous files from previous distribution ('Makefile~' and 'pcal' [pre-built DOS executable binary file]). If anyone really needs a pre-built 'pcal.exe' DOS executable file, it can always be provided separately on the project webpage. - Change sense of and provide proper comment for 'SEARCH_PCAL_DIR' flag setting in Unix and OS/2 'make' files. - Provide comments in the 'Makefile' for the '-DEPS' option, describing what it does and why it's useful. - Removed executable permission from various text files: moon98 Readme writefil.c Pcal.hlp In general, fixed up the permissions on several files. For example, some makefiles had 'rw' permission and others had just 'r' permission! - Changed the misleading name of array 'holidays[]' to 'predef_events[]' to reflect the fact that this is a list of 'predefined events', which are often, but not necessarily, holiday events. For example, this includes the new 'Friday the 13th' events, which, like every other event in this array, are not treated as a 'holiday' event unless the user specifies a '*' after the date portion of the event specification in the 'pcal' options file. - Converted the 'Makefile.DOS' file from Unix-style line-endings to DOS-style. Tweaked the same file to successfully compile under MS-DOS using the Borland C++ v5.0 compiler. Credits: The original calendar PostScript was Copyright (c) 1987 by Patrick Wood and Pipeline Associates, Inc. with permission to modify and redistribute. The following people contributed to Pcal v4.8.0: EPS images, 'paper size' option, new paper sizes, HTML UI update, various other fixes: Bill Marr "Friday the 13th" events: Don Laursen Swedish language support: Joel Fredrikson Ukrainian language support: Volodymyr M. Lisivka Portuguese language support: Pedro Zorzenon Neto Estonian, Russian, Lithuanian, and Latvian language support: Neeme Praks Enhanced 'define' capability: unknown (requested by Louis Taber) French example calendar: Valéry Bruniaux DOS/DJGPP build support: Thiago F.G. Albuquerque Detection of security holes: Danny Lungstrom For a list of all known contributors to date, see the 'Authors' section of the 'man' page. Bill Marr (marr99@users.sourceforge.net) 15 Dec 2004 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.7.1 This is a new release of "Pcal", the PostScript calendar program. It has minor changes to the 4.7 version: the -q flag that allows the printing of a yearplanner and an additional Finnish languages support with the -a flag. The -q flag gives prints out as one column per month resulting in table that gives a quicker overview over several months and which can be used as a yearplanner. As a yearplanner obviously has less space for text, only the first character of the weekday and the first 5 characters of each calendar entry are printed. Holidays are marked red but the text of the calendar entry is not printed. The yearplanner gives output at the moment only in HTML and therefore has effect only when used the -H flag. To print a half-yearplanner of the first six months: pcal -H -q 1 2003 6 > yearplanner_I_2003.html The Finnish language is switched on with "-a fi". For more general information see the readme-file of version 4.7 below. Stefan Fronzek (stefan@fronzek.akshor.com), January 15 2003 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.7 This is a new release of "Pcal", the PostScript calendar program. The major new features are the "-H" flag for generating output in HTML table form, expansion of "%y" in the "include" filename into the last two digits of every applicable year in "year all" mode, and the addition of build-time support for A4 size paper. Major changes: 1) Of interest to Pcal hackers and installers: . Automatically looking for the calendar file in the directory where the Pcal executable lives (Un*x only) is not a Good Thing when there is already another executable named 'calendar' in the same directory. This feature is now optional and may be disabled by #define'ing SEARCH_PCAL_DIR as 0 in pcaldefs.h (or in the Makefile). . The obsolete PRT() and FPR() macros have been scrapped and replaced with simple calls to printf() and fprintf(). . The installer can specify different default output file names for PostScript and HTML output (cf. pcaldefs.h) on those systems (VMS, Amiga) where output is automatically directed to a file. . In case anyone still uses moon files, moon96 and moon97 have been deleted and moon98 added. There are no plans to support moon99. . Support for OS/2 (new Makefile.os2, revised pcallang.h) has been added. . Cleaned up most gcc warnings in "-Wall" mode. This effort revealed one long-unnoticed bug (see below). . Realigned the page so that the top of the calendar boxes is now the Y origin (instead of 35); the origin had not previously corresponded to any physical feature on the page. Note that this changes the default value for the little-used -Y flag from -120 to -85. . Revised Makefile for use in cross-build environment: PCALINIT_CC defines the host compiler for building pcalinit; CC defines the cross-compiler for building pcal itself. For native builds (i.e., host == target), these are the same. . Dropped the "EPSF" designator in the initial PostScript comment since the output is not truly EPS. The special "%%" comments used by some previewers (e.g., ghostview) are still generated when built with -DEPS. . Added support for A4 size paper at build time; see below. 2) New command-line options: . Pcal now supports the -H flag to generate calendars in HTML table format. Most of the other flags are overridden or ignored in HTML mode (moons, note text, Julian dates, small calendars, date color/style, scaling/transformation, font selection, left/right footstrings), but one is overloaded in an appropriate manner: the string specified by the -C flag (PostScript center footstring) is used as the page title and as a centered page heading. Other HTML formatting details - minimum lines per box, color and format of holidays, etc. - can be configured at build time (see the various Makefiles and pcaldefs.h), but not on the command line. The latter is theoretically possible, but would require either a) using up the remaining single-letter flags (all six of them), b) supporting multiple-letter flags (as per many of the GNU utilities), or c) overloading even more of the existing flags - none of which is particularly appealing. As of the 6/19/98 release, the "-w" flag in conjunction with "-H" generates HTML whole-year calendars in a multicolumn format similar to the PostScript equivalents. "-l" and "-p" may be used to specify landscape or portrait mode, respectively. Pcal normally prints only five weeks per row unless at least one month in the row requires six; to print six weeks all the time, build with -DCONSISTENT_SPACING . . Pcal now supports a numeric (0-6) argument for the -F (first day of week) flag, thus allowing this to be specified independently of selected language. 3) New date file functionality: . Pcal attempts to be somewhat smart about converting simple HTML tags (`', '', etc. to PostScript bold/italic fonts, and ` ' etc. to ASCII) when generating non-HTML output from a date file containing these tags. . In "year all" mode, the "include xxx%y" directive expands to include a file corresponding to every applicable year (e.g., if the calendar spans 1997, 1998, and 1999, "include xxx%y" will include xxx97, xxx98, and xxx99 in that order) instead of just the initial year. 4) Other new functionality: . Pcal predefines the symbol `v4_7'; this allows the user to ifdef out v4.7-specific constructs from date files that might also be used by older versions of Pcal. If "-H" is specified, Pcal also predefines the symbol `html'; this allows the user to ifdef out HTML code (e.g. links, font size/color changes, etc.) that is undesirable in PostScript output. . On systems where output is normally written to a file, the -o flag without an argument redirects it to stdout. . Pcal may optionally be built to generate output for A4 size (545x842) paper by adding -DA4PAPER to the COPTS line in the Makefile and rebuilding. There is a block of code in writefil.c that forces the printer to select the appropriate paper tray in environments where multiple trays are available; it is, however, known to confuse some previewers and may be #ifdef'd out if desired (look for "#if 1"). 5) Bug fixes: . I have received reports of a Y2K-related problem on some Un*x systems: when no year is specified on the command line, the year is calculated as 100 instead of 2000. I can't reproduce this problem myself, but incorporated the suggested fix anyway - see pcal.c and pcalutil.c. . Revised pcallang.h to parse the F_HELP, F_USAGE, and F_VERSION flags in the preliminary command line pass (P_CMD0) instead of in the first "real" command line pass (P_CMD1), generating the appropriate message and exiting without attempting to parse any numeric arguments. This fixes an obscure bug where "pcal -v 99999" generates a "year out of range" error instead of the version stamp. . Fixed a long-standing bug where "note/1" text would overwrite the small calendar for the next month if the "-k" flag was specified and the month began on Sunday. See note_box() in pcalutil.c. . Minor tweakage for compatibility with C++ compilers: ensure that "C" prototypes are visible wherever necessary (cf. protos.h); change "template" (C++ reserved word) to "templt" (cf. moonphas.c). . Fixed a long-standing bug where the final month and year were miscalculated when spanning year boundaries in whole-year mode. Credits: The original calendar PostScript was Copyright (c) 1987 by Patrick Wood and Pipeline Associates, Inc. with permission to modify and redistribute. The following people contributed to Pcal v4.7: C and HTML code: Andrew Rogers OS/2 support: Alexander Mai For a list of all known contributors to date, see the Orig.ReadMe file and topline comments in pcal.c. Future updates of Pcal v4.7 will be available at the following URL: http://www.geocities.com/SunsetStrip/Palms/5555/PS/pcal_4_7_tar_Z.txt Andrew W. Rogers (andrew.rogers@east.sun.com) 09 February 2000 PS: Here's something handy - an alphabetical list of the Pcal options (v4.7) and their meanings: (04 Dec 2004 Note: This has been moved to the section corresponding to the current release and updated accordingly.) ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.6 This is a new release of "Pcal", the PostScript calendar program. The major new features are: a) the "-a" flag to select a language other than English; b) the "-T" flag (and \f* escape sequences) to select bold or italic typefaces in date/note box text; c) the "year all" directive to wildcard date file entries against all applicable years; d) the distribution includes .html and .cgi files for setting up a Pcal server using Netscape (maybe others; I haven't tried them) under Un*x; e) the date box height for single-month portrait-mode calendars has been expanded from 80 points to 117; f) the distribution includes moon phase files for 1997 and 1998 g) two new keywords, "nearest_before" and "nearest_after", are supported. h) the default century has been changed from 1900 to the current century. All are described in detail below. Major changes: 1) Of interest to Pcal hackers and installers: . The following new files have been added to the distribution: days.h day names in multiple languages (see -a below) months.h month names in multiple languages calendar.gk calendar with Greek holidays (in Greek) calendar.uk calendar with British holidays fonttest_e test Esperanto font mapping (see -a below) cvt7to8.c To avoid mailer problems, days.h, months.h, cvt8to7.c and calendar.gk are distributed in 7-bit format (8-bit characters are represented as octal escape sequences). cvt7to8.c converts these files to true 8-bit format to facilitate editing by users with 8-bit editors; cvt8to7.c converts them back to 7-bit format for mailing. The distribution also includes the "ReadMe" files from several earlier releases. . moon94 and moon95 have been replaced with moon97 and moon98. . My [AWR] site finally got a color printer, and after playing with it for a while I decided I prefer the appearance of black outlines (dates when -O flag is specified) to color outlines; if you agree, define the symbol OUTLINE_BLACK in the COPTS line of your Makefile. . The Un*x Makefile supports selecting the default language (see -a description below). . The Un*x Makefile has two new targets: "compress" to create a compressed 'tar' file (suitable for installation in a public ftp directory, WWW page, etc.) and "uuencode" to create a uuencoded version thereof. 2) New command-line options: . Pcal now supports the -a flag to generate calendars in the following languages: de German en English [default] eo Esperanto es Spanish fr French gr Greek it Italian In order to display diacritical marks, languages other than English require that the fonts be remapped (Esperanto uses a stripped-down version of ISO 8859-3; the others use "Latin1"). If no remapping is specified, \fIpcal\fP selects a remapping appropriate to the selected language; note that the Greek language also requires an ELOT-928 font (available from Angelo Haritsis, ah@doc.ic.ac.uk). If Esperanto is selected, Pcal converts [cghjsuCGHJSU][xX^] and [uU]~ to the corresponding accented character; e.g. "jxauxdo" "j^au~do", or any equivalent form will print as "j-circumflex a u-breve d o". Day and month names in the date file may be expressed in either the default language specified at compile-time or the language selected on the command line. Pcal predefines the symbol "lang_XX" where XX is the two-character abbreviation for the current language. . Pcal now supports the -T [B|I|R] flag to select the typeface (Bold, Italic, or Roman) for printing date/note text (see below). This flag may be specified multiple times within the date file (via "opt") to reset the font style on the fly - for example, to print all holidays in Bold. (Also see "'troff'-like escape sequences" below.) 3) New date file functionality: . Pcal now supports the "year all" (or "year *") directive to address a long-standing Pcal deficiency: the requirement that recurring dates appear in the date file once for each year. While "year all" is in effect, pcal will wildcard each date specification (and note box entry) in the date file into a date entry for each applicable year, as determined by the starting month/year and number of months. "Year all" is disabled by a date of the form "mm/dd/yy" or a "year yy" directive. . Pcal now supports 'troff'-like escape sequences to change the style of the font used for printing the text: \fB = Bold; \fI = Italic; \fR = Roman; \fP = previous font. (Since there is no consistent means of converting a generic font name to its bold or Italic equivalent, these are simulated through overstrikes and 'makefont' respectively.) Pcal also supports their HTML equivalents: = Bold; = Italic; or = previous font (lower case is also accepted). Each of these escape sequences causes a word break, so the effective granularity is word-level, not character-level. Maybe some day... The font style is reset to Roman following each line break. . Pcal now supports three Orthodox Easter related dates: "GEaster", "Gstgeorge", "Gmarcus". . Pcal now supports the "nearest_before" and "nearest_after" keywords to specify how pcal is to disambiguate between two dates that are equally near; e.g., "nonworkday nearest_before [Wed.] 9/25/96" refers to Sunday, 9/22 and "nonworkday nearest_after 9/25/96" refers to Saturday, 9/28. (Note that in the absence of any such ambiguity, "nearest" takes precedence over "before" or "after": "nonworkday nearest_before 9/26/96" refers to Saturday, 9/28.) 4) Other new functionality: . Pcal predefines the symbol v4_6; this allows the user to ifdef out v4.6-specific constructs from date files that might also be used by older versions of Pcal. . Pcal compresses the date font text as necessary to prevent overflow of extremely long words into the next box. . The distribution now includes pcal.html (HTML form to generate single-month calendars), pcalw.html (HTML form to generate whole-year calendars) and pcal.cgi (common /bin/sh script to parse the options selected on either of the HTML forms and pass them to pcal). (You will need to tweak site-specific paths in all of them.) . The date box height for single-month portrait-mode calendars has been expanded from 80 points to 117. If you prefer the original date box proportions (basically a scaled-down landscape-mode calendar), compile with -DORIG_BOX_HEIGHT. . The default century for two-digit years has been changed from 1900 to the current century. This presumes standard Un*x behavior: that the "tm_year" field in the "tm" struct () represents the current year minus 1900, not the current year itself; if this is not the case on your system, change the TM_YEAR definition (pcaldefs.h) accordingly. 5) Bug fixes: . Fixed a long-standing (but not previously reported) bug in readfile.c which caused Pcal to crash upon an "undef " in the date file. . Depending on the underlying hardware, a bit pattern of all zeroes may not necessarily be a null (or even a valid) pointer; pointers previously assumed initialized by a calloc() call are now initialized explicitly to NULL. . The Un*x "calendar" utility interprets asterisks as wildcards; consequently, v4.6 does not propagate asterisks from the date file to the -c output (note also that holidays with no associated text will not be printed). To retain them (as per v4.5), define the symbol KEEP_ASTERISKS in the COPTS line of your Makefile. . Vestiges of a never-implemented experiment have been deleted from next_token() in exprpars.c. . Fixed a long-standing bug where "note/1" text would overwrite the small calendar for the next month if the "-k" flag was specified and the month began on Sunday. [merged from v4.7 12/21/97] Credits: The original calendar PostScript was Copyright (c) 1987 by Patrick Wood and Pipeline Associates, Inc. with permission to modify and redistribute. The following people contributed to Pcal v4.6: European language and Greek Orthodox calendar support: Angelo Haritsis Esperanto support: Andrew Rogers "nearest_*" suggestion: Brad Knowles Updated VMS help file: Richard Dyson Other C and PostScript code: Andrew Rogers For a list of all known contributors to date, see the Orig.ReadMe file and topline comments in pcal.c. Future updates of pcal v4.6 will be available at the following URL: http://www.geocities.com/SunsetStrip/Palms/5555/pcal.4.6.tar.Z.txt Andrew W. Rogers 21 December 1997 PS: Here's something handy - an alphabetical list of the Pcal options (v4.6) and their meanings: (04 Dec 2004 Note: This has been moved to the section corresponding to the current release and updated accordingly.) ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.5 This is a new release of "Pcal", the PostScript calendar program. (An intermediate version, 4.4, was not released publicly.) Major changes: 1) Of interest to Pcal hackers and installers: . See various comments below regarding options configurable for your site by tweaking various .h files. . "noprotos.h" has been scrapped; K&R-style function declarations are automagically derived from "protos.h" by means of a clever macro, thus eliminating the need to keep two .h files in sync. . Two new files have been added to the distribution: "fonttest_r" and "fontmaps_l" (sample calendar files for testing the Roman8 and Latin1 European language character mappings respectively). This feature is discussed in greater detail below. . The v4.0 moon phase algorithm has pretty much obviated the need for a moon file, but "moon94" and "moon95" have been included nevertheless (replacing "moon91" and "moon92"). The moon file message has been dropped from the on-line help and from the comments in the sample calendar file. The moon file may now contain "opt -A" and "opt -E" lines, thus allowing American-style moon files (those supplied) to be used in Europe without modification. . The Makefiles have been changed: "make clean" leaves pcal intact while removing object files and other debris created on the fly; "make clobber" removes pcal as well (as "make clean" used to do). A new target, "make fresh", has been added to rebuild pcal from scratch. . Selected site-specific defaults (DATEFONT, DATE_STYLE, DOUBLE_SIDED, FIRST_DAY, MAPFONTS, NOTESFONT, TIMEZONE, TITLEFONT, SHADING, EPS) may now be defined in the Un*x Makefile and its VMS equivalent; see Makefile and pcaldefs.h for details. (Be a part of history - tweak the other Makefiles and get your name in the credits for v4.6!) . The Un*x Makefile has been revised: "make install" now installs the executable, raw man page, and packed/compressed man page as per current Un*x conventions. (Thanks to Andrew P. Houghton for these modifications.) . The "help" message is automagically piped through a user-specified filter pointed to by environment variable PAGER (default: "more"), at least on Un*x systems. If your non-Un*x system supports/simulates pipes via the "popen(3)" interface - or if you'd prefer to use a different environment variable or default filter - set/change the PAGER_ENV and PAGER_DEFAULT macros in pcaldefs.h. . The "Generated by..." message confuses some PostScript interpreters (e.g., QMS) and has been converted to an EPS-like comment block. . Additional EPS-isms (page headers and trailers, courtesy of Andrew P. Houghton) may be specified by #define'ing EPS as 1 in pcaldefs.h or in the Makefile. . Pcal now pre-scales all the required fonts/sizes as part of its startup code in order to eliminate the overhead of doing so on the fly (again, thanks to Andrew P. Houghton for this suggestion). The resulting performance improvement will be most apparent on multi-page or whole-year calendars. . The "pcalinit" program now supports #BEGIN .. #END blocks to split the PostScript boilerplate into sub-arrays; writefil.c is now smart enought to generate only the PostScript code required for any given calendar (e.g., if moons are not requested, the moon generation boilerplate will not be generated). Additionally, pcalinit propagates PostScript comments delimited by "%%" to the output file (stripping the first '%'). . It has come to my attention that at least one older compiler sign-extends the expression ( & 0377) when promoting it to int, resulting in an unwanted negative value. The masking constant 0377 has been redefined as CHAR_MSK in pcaldefs.h (and wherever used throughout the source) so that it may easily be redefined if necessary (see the related comments in pcaldefs.h). . VMS changes (thanks to Richard Dyson): 1) the old "Makefile.VMS" has been been replaced by "Makefile.MMS", which works with either the official DEC unbundled product MMS or its public-domain clone MMK; 2) Make_Pcal.com has been replaced by a simpler version generated directly by MMS. 2) New command-line options: . Pcal now supports "-z ", which adjusts the moon phase calculation by hours (where is expressed in hours west of UTC: e.g., Boston = "-z5"). If "-z" is specified - with or without a value - Pcal will use its internal algorithm for the moon phase calculation even in the presence of a moon file. The default for is 0 as shipped, but may be overridden at your site by specifying the appropriate value in TIMEZONE (pcaldefs.h). (Some thought was given to extracting the value from the "TZ" environment variable, but that is far from universal even on Un*x, let alone the other platforms. Maybe next time...) . Pcal generates PostScript code to disable duplex mode (double-sided output) on printers which support this. . Pcal also supports -#, which directs Pcal to print copies of each output page. (Most printer spoolers support this in one form or another, but at some sites - including mine [AWR] - multiple copies of PostScript files are each preceded by a separate banner page, which could be wasteful if you're making, say, 75 copies of your company's holiday calendar.) This may appear in the datefile if '#' is escaped by '\' (see below). . The flags responsible for setting day colors have been expanded and revised: -b and -g now accept "holiday" (or "hol") to set the color for holidays; -G and -O have been expanded to accept all of the -b and -g flags. (For backward compatibility with v4.3, -G and -O alone work more or less as they used to, changing all non-black days to outline-gray or outline; cf. change_color() in pcal.c.) Thus, the user can now specify -O -Ghol to print weekends as outline, holidays in outline-gray, and (by default) other days in black. The "weekday", "workday", and related keywords now use "logical black" - the predominant day color - to define weekdays. The user can thus specify -Gall -Osat -Osun and "weekday" will refer to Monday through Friday, even though none of the dates are actually printed in black. Related issue: If not explicitly specified otherwise, holidays will print in the least- frequently used color of those selected, or in a contrasting color if only one color is used; in the above case, holidays will print as outlines. Pcal also accepts ranges of weekdays, which may wrap around the end of the week: -Gfri-sun prints Friday, Saturday, and Sunday as outline-gray. . The "-s" flag now allows the user to specify a set of red/green/blue values for the dates and fill boxes. If a single value is specified, it is taken to be a gray scale value (as before); if three colon- separated values are specified, they are taken to be red:green:blue respectively; for example, -s1.0:0.0:0.0 directs pcal to print "gray" dates in red. Outline dates will appear in the specified color; "outline-gray" dates will appear in the specified color with a black outline. The fill boxes are probably useless in any but the lightest colors, but for consistency's sake I decided to support r:g:b values for them too. (Thanks to Denis Girou for the idea and sample code.) . The "-r" flag has been added. This flag takes a single argument which is the name of a standard 8-bit character set mapping for printing the diacritical marks common to European languages; at present, this argument may be "roman8" or "latin1" (abbreviated to the first character if desired) to specify the Roman8 or ISO Latin1 mappings respectively. The default is no mapping; this may be overridden by defining MAPFONTS as ROMAN8 or LATIN1 in the Makefile. Note that this flag may not be changed on the fly; the final value specified will be in effect. Since the date font is usually used only for printing numbers, it is not remapped; if any of the secondary fonts are redefined as "datefont", define MAP_DATEFONT as 1 (cf. pcaldefs.h). New files: "fonttest_r" and "fontmaps_l" are sample calendar files for testing the Roman8 and Latin1 character mappings respectively. 3) New date file functionality: . Pcal now handles dates of the form "second Thursday after 12/1". Note that the ordinal must be positive; while it could be argued that "last Thursday before 12/1" is synonymous with "first Thursday before 12/1", what does "last Thursday after 12/1 mean?" . Pcal now supports predefined holidays; at present, it understands "Christmas", "Thanksgiving", "Good_Friday", and "Easter" (cf. pcallang.h). So the date file may contain lines like: Easter* Easter Sunday Wed before 6th Sun before Easter Ash Wednesday day after Thanksgiving* holiday (Algorithms and/or source code to determine the date of other movable holidays - e.g., the Jewish calendar, Chinese New Year, solstices, etc. - would be welcome!) . '#' is no longer treated as start-of-comment if escaped by '\'. . Pcal now accepts two additional European date formats: "dd. mm." and and "dd. mon". 4) Other new functionality: . The user may now override the default font size used in printing the dates, note text, and month/year title (single-month calendars only); for example, "-dCourier/32" sets the date font to 32-point Courier. The font and size may be overridden independently: "-[dnt]" overrides only the font name, while "-[dnt]/" overrides only the size. The PostScript code responsible for positioning dates, text, etc. now does so using actual font sizes, not hard-coded constants. . Calculating the color in which to print each date has been moved from pcalinit.ps to writefil.c, allowing the PostScript code to perform a simple array lookup rather than a weekday/holiday calculation. . All of the font size initialization has been moved from pcalinit.ps to pcaldefs.h and writefil.c. . The grid border is drawn using "closepath" to ensure that the lines meet properly in the corners (yes, this was visible when using a high-resolution printer with repro-grade paper); additionally, the grid lines have been increased in width for the small and medium calendars (to help ensure uniform line width as physically printed). . The note box heading and weekday names are now printed in the same font as the title and footers; it makes more sense to print all the heading text in the same font. Prefer the old way? Just change WEEKDAYFONT in pcaldefs.h, where the initialization has been moved. . The font sizes used in printing the medium (whole-year) calendars can't be overridden by the user, but they have been enlarged yet again for legibility: title = 64, weekdays = 30, dates = 56, footers = 14. . Empty text associated with a date or note entry is propagated to the calendar as a blank line; this is useful for grouping related lines together. If you prefer to ignore such lines (as before), define KEEP_NULL_LINES (pcaldefs.h) as 0. . The "help" message is automagically piped through "more" on Un*x systems (see section 1 above). . The "include?" preprocessing directive has been added; if the specified file cannot be opened, pcal will silently continue instead of terminating with an error. . The earliest valid year has been moved back from 1900 to 1753 (the first full year of the Gregorian calendar in England and her colonies). . The distribution includes "pscalendar", the original shell script/ PostScript boilerplate (by Patrick Wood, King Ables, and Tim Tessin) that would eventually become Pcal. This is provided primarily as a historical curiosity, but it is indeed interesting to reflect on how a 300-line shell script eventually turned into over 10,000 lines of C and PostScript source. 5) Bug fixes: . Pcal now handles date specifications of the form "Friday nearest 12/25"; previously, the "nearest" keyword only worked in conjunction with wildcard weekdays. (This fix has been issued previously as a patch to v4.3.) . PostScript routine "holidaytext" has been revised to calculate the right margin more accurately, avoiding the occasional overflow into the next box. (In fact, all of the margins have been parameterized, as were some hard-coded font sizes in "notetext".) Credits: The original calendar PostScript was Copyright (c) 1987 by Patrick Wood and Pipeline Associates, Inc. with permission to modify and redistribute. The following people contributed to Pcal v4.4 and v4.5: Overall coordinator: Joe Brownlee VMS support: Richard Dyson "-z" support: Steve Grandi Color date support and testing: Denis Girou Un*x makefile revision, EPS assistance and testing, font prescaling: Andrew Houghton Internationalization assistance: Denis Girou (France) Robert Joop (Germany) Other C and PostScript code: Andrew Rogers For a list of all known contributors to date, see the Orig.ReadMe file and topline comments in pcal.c. Andrew W. Rogers 15 November 1994 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.3 This is a new release of "Pcal", the PostScript calendar program. (An earlier release, 4.2, was not distributed publicly.) Major changes: 1) Of interest to Pcal hackers, installers, and power users :-) : . The promised comments about X_OK in pcalutil.c are now actually there. . Pcal now generates debugging information (see -Z flag below). 2) New command-line options: . The "-c" flag has been added; this directs Pcal to generate a date file suitable for input to the Un*x "calendar" utility (instead of a PostScript file). This file may also be used as input for subsequent runs of Pcal, but be forewarned that "opt" lines, preprocessing directives, comments, etc. will be lost. (Idea courtesy of Bruce Mohler.) . The "-k" and "-K" flags have been added. The former moves the two small calendars to the first two boxes (upper-left corner) while the latter splits them so the previous month is in the first box and the next month is in the last. Should there be a conflict with a date, the body of the calendar is moved down one row. (Why "-[kK]"? Well, "k" sort of sounds like "calendar", and anyway all the letters that made any more sense were taken.) . The "-N" flag has been added; this allows the user to override the default "Notes" header in the notes box. If set to "", Pcal will not print a header in the notes box. . The "-u" flag has been added; this prints the version information and parameter usage message to stdout and terminates normally. . The "-s" flag has been added; this allows the user to override the default values for date and/or fill box shading. For example, -s 0.45/0.98 sets the date shading to 0.45 (white = 1, black = 0) and the fill box shading to 0.98; this looks good on the whole-year calendars. The date and fill box shading values may be changed independently; e.g. "-s 0.45" or "-s /0.98". . The "-S" flag has been added; this suppresses generation of the small calendars in the lower right corner, thus freeing two more boxes for notes (cf. "note/" below). . The "-Z" flag has been added to print debugging information of interest primarily to Pcal hackers. This flag is a "hidden" flag; it does not appear on the man page or as part of the usage message. At present, the following options are supported: -ZD print dates and text as read from date file -ZF print date file search paths -ZM print moon phases and identify quarters -ZO print option flags and where set -ZP print "preprocessor" debug info -ZT print dates and text as written to output file -Z turn off all debugging info The subflags may be combined: e.g., "-ZDF" is equivalent to "-ZD -ZF". All of the aforementioned debugging information is written to stderr. (This brings the grand total up to 41 flags; -[aiqrzHPQTVW] are still unused.) 3) New date file functionality: . The file name in the "include" directive may contain the string "%y", which will be replaced by the last two digits of the current year. . Wildcards "new_moon", "first_quarter", "full_moon", and "last_quarter" (plus appropriate synonyms) are now accepted in the date file. . If the "-w" flag has been specified (in PCAL_OPTS, on the command line, or in an "opt" line), Pcal automatically defines the symbol "whole_year". This allows the user to specify different "gray" character styles and densities, alternate foot strings, etc., depending on whether s/he is generating a single month or a full year: ifdef whole_year opt -s 0.45/0.98 # improve contrast in whole-year mode endif . The keyword "nearest" has been added, allowing constructs such as "workday nearest every 10th". (Thanks to Andy Fyfe for the idea and code.) In this example, Pcal would look first at the 10th, then at the 11th, 9th, 12th, 8th, etc. until a workday is found. (If you would prefer to disambiguate "nearest" in favor of the earlier date, see the comments by "NEAREST_INCR" in pcaldefs.h.) . The preprocessor now accepts "if" as a synonym for "ifdef". . The preprocessor now accepts "elif" as per most recent flavors of cpp; "elif A" is true if A is defined. Multiple "elif" clauses are allowed; as in cpp, at most one "if{{n}def}", "elif", or "else" clause will be processed per block. . The user may place "Notes" text in any empty box: Pcal now supports "note/", where is a positive or negative integer. If is positive, Pcal counts forward from the first empty box; if negative, backward from the last. Default is -1 (last empty box: as before, on the bottom row adjacent to the small calendars unless -S is specified). (Thanks to Geoff Kuenning for the idea.) 4) Other new functionality: . A new message, "no match for wildcard", has been added. . The date sizes for the small and medium calendars have been enlarged for legibility. . If Pcal can't find the moon file in the date file's directory, it looks in the directory where the Pcal executable lives. This allows all users to access the same moon file; in fact, they need not even know of its existence. . The "%u" and "%w" format specifiers have been added. These behave much like "%U" and "%W" except that they treat the week containing January 1 (instead of the first full week) as week 01, as done by some companies. . The %{[+-]}[DWMY] format specifiers have been added. These do not print anything per se, but instead adjust the working date by [+-] days (D), weeks (W), months (M), or years (Y); subsequent format specifiers reference the adjusted date. %D or %M alone reset the original date. Since the above format specifiers do not print anything, expand_fmt() and print_word() were revised further to avoid generating null words. . The "moon92" file has been supplied. . The user may now override the default notes font size as well as the font name: pcal -n Helvetica/8 sets the font to 8-point Helvetica. (This is the easy one. User override of the other font sizes may appear later.) 5) Bug fixes: . The algorithm for finding the date file has been changed slightly: pcal searches the current directory before PCAL_DIR for a user- defined date file. More importantly, the man page has been rewritten to accurately describe the search algorithm; the documentation had never been correct. . Pcal no longer requires a space between -[LCRN] and the following quoted string in an "opt" line; loadwords() has been made smart enough to split the flag and the string into separate words. . Pcal has been made much smarter about escape sequences (octal or hex formats) and now handles them on the command line in addition to "opt" lines in the date file. . MIN_ORD_LEN has been expanded from 3 to 4 in order to distinguish "every" from "even". . is_quarter() has been revised to eliminate the occasional duplicate (1/92) or missing (12/92) quarter moon in -m mode. Credits: The original calendar PostScript was Copyright (c) 1987 by Patrick Wood and Pipeline Associates, Inc. with permission to modify and redistribute. Many others have worked on it since; see the Orig.ReadMe file and topline comments in pcal.c. The following people contributed to Pcal v4.2 and v4.3: Overall coordinator: Joe Brownlee "nearest" keyword: Andy Fyfe "note/n" suggestion: Geoff Kuenning VMS support, moon phase algorithm: Richard Dyson "-c" suggestion, new SYNOPSIS for man page: Bruce Mohler Other C and PostScript code: Andrew Rogers Andrew W. Rogers 08 December 1991 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- "Pcal" Version 4.1 This is an intermediate release of "Pcal", the PostScript calendar making program. Major changes: 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 [this has since been dropped since whoever wrote it was no longer around to keep it in sync with the man page - any volunteers?]. 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. Andrew W. Rogers 20 August 1991 ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- Original 'ReadMe' file from "Pcal" "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. The program may be a little System V flavored (getopt, time routines) but should be easily portable to other vintages of UNIX. 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 :-). 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. Ken Keirnan Pacific Bell San Ramon, CA. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- pcal-4.11.0/doc/pcal.man0000644000175000001440000021367210732017670013100 0ustar wusers.\" .\" pcal.man - documentation for Pcal .\" .\" This 'man' page may be generated in alternate formats with any .\" of the following commands: .\" .\" groff -man -Tps pcal.man >pcal-help.ps .\" groff -man -Thtml pcal.man >pcal-help.html .\" groff -man -Tascii pcal.man >pcal-help.txt .\" .\" Revision History: .\" .\" 4.11.0 .\" .\" 2007-12-15 -- changes by Bill Marr (marr99@users.sourceforge.net): .\" .\" Update version number and date. .\" .\" Describe newly-added languages: Slovak and Hawaiian .\" .\" Describe use of newly-added "on" preposition. .\" .\" Describe use of newly-added '-W' option. .\" .\" Remove 'F13' as a pre-defined event, now that the new 'on' .\" preposition allows that event to be specified generically. .\" .\" Add long-missing descriptions of predefined symbols for 'paper size' .\" and 'page orientation'. .\" .\" Mention the 'examples' directory and all the useful files contained .\" within. .\" .\" Mention the 'recycle.eps' EPS image file that comes with the 'pcal' .\" distribution and give an example of how to use it. .\" .\" Mention the use of ImageMagick's 'convert' utility and the 'rsvg' .\" utility to convert SVG images into EPS format. .\" .\" Fix a minor capitalization typo and a minor spelling error. .\" .\" Make various other minor tweaks and updates. .\" .\" 4.10.0 .\" .\" 2006-07-12 -- changes by Bill Marr (marr99@users.sourceforge.net): .\" .\" Update version number and date. .\" .\" Describe newly-added languages: Polish, Dutch, Romanian, and Danish .\" .\" Update 'AUTHORS' credits list. .\" .\" Expand the comments on the use of the time-zone option ('-z'). Also, .\" make it clear that fractional values are allowed for the timezone .\" value specification. .\" .\" Make note of the options/values which can be specified .\" semi-permanently via the makefile. .\" .\" Clarify interpretation of 1-digit or 2-digit specification of the year. .\" .\" Add a link to the website where 'pcal' (and 'lcal') can be found. .\" .\" Add a link to the website where the 'bsdmainutils' package (with the .\" old Unix/BSD 'calendar' program) can be found. .\" .\" Remove now-obsolete comment about having to comment out the .\" 'showpage' command in EPS image files. This only applied to .\" 'pcal' version 4.8.0. .\" .\" Clarify 'character remapping' and 'font use' comments in the '-a' .\" option description section. Mention a useful website that discusses .\" Greek fonts. .\" .\" Update date in reference to Adobe website. .\" .\" 4.9.1 .\" .\" 2005-08-24 -- changes by Bill Marr (marr99@users.sourceforge.net): .\" .\" Update version number and date. .\" .\" 4.9.0 .\" .\" 2005-08-10 -- changes by Bill Marr (marr99@users.sourceforge.net): .\" .\" Remove references to the now-obsolete custom 'Esperanto' character .\" encoding, now that 'Latin3' (ISO 8859-3) is supported. .\" .\" Clarify the use of the options for specification of fonts and font .\" sizes, especially for yearly-format calendars versus monthly-format .\" calendars. .\" .\" 2005-08-01 -- changes by Bill Marr (marr99@users.sourceforge.net): .\" .\" Document the newly-added 'delete' event keyword/capability. .\" .\" Document the fact that the search for the configuration file in the .\" executable directory is now disabled by default in the 'Makefile'. .\" .\" Describe another newly-added language (ca [Catalan]) in the list of .\" those supported by the '-a' option. .\" .\" Mention and include a link to the Open Clip Art Library as a good .\" source of images for event decoration. .\" .\" Document the fact that the 'showpage' command need no longer be .\" disabled in EPS files used by 'pcal'. .\" .\" Fix link to Adobe documentation. .\" .\" Remove the 'experimental' comment for the Lithuanian, Latvian, and .\" Russian languages now that the necessary character encodings are .\" provided. .\" .\" 2005-01-23 -- changes by Bill Marr (marr99@users.sourceforge.net): .\" .\" Describe the newly-added languages (cs [Czech] and hu [Hungarian]) .\" in the list of those supported by the '-a' option. .\" .\" Document the support for the 12 new character encodings. .\" .\" Describe the use of the new `pcal.pl' Perl script for HTML/CGI .\" generation of calendars. .\" .\" Describe the new values available for the '-r' (character set .\" remapping) option, including the old 'KOI8-U' value that was .\" accidentally left out of this file for v4.8.0. .\" .\" 4.8.0 .\" .\" 2004-12-04 -- changes by Bill Marr (marr99@users.sourceforge.net): .\" .\" Provide this commented-out section in the header of this 'pcal.man' .\" file to document the revision history. .\" .\" Provide instructions at the beginning of this file on how to .\" generate the various human-readable forms of this 'man' page. .\" .\" Add a detailed new section ('Encapsulated PostScript (EPS) Images') .\" to document the newly-added ability for embedded EPS images (photos, .\" icons, etc) on monthly PostScript calendars. .\" .\" Add a new section ('Generating PostScript Calendars Via A Web .\" Browser Interface') to document the long-available ability to .\" generate PostScript calendars via a web browser interface using a .\" CGI (Common Gateway Interface) script and a couple of HTML user .\" interface files. .\" .\" In a special section apart from the normal 'pcal' options, document .\" the '-Z' (debug-only) flag, which has been available since version .\" 4.3, but for which the documentation was intentionally left out of .\" the 'man' page. .\" .\" Add the newly-added languages (sv [Swedish], pt [Portuguese], uk .\" [Ukrainian], et [Estonian], ru [Russian], lv [Latvian], and lt .\" [Lithuanian]), to the list of those supported by the '-a' option. .\" .\" Change the '-a' switch option for the Greek language from 'gr' to .\" 'el' to match the ISO 639 (2-letter and 3-letter language codes) .\" standard. .\" .\" Slightly re-order both the list of command-line options and the .\" associated full-length descriptions so that they're in the same .\" order. .\" .\" Use the 'groff'/'man' '.SS' macro (unnumbered secondary section .\" heading) to provide nicer-looking section breaks. .\" .\" Create new 'secondary sections' for existing descriptions of 'Format .\" Specifiers', 'Pre-Processor Functionality', and 'The Moon File'. .\" Previously, these first 2 sections were part of one monolithic .\" section and the third was delineated with a simple bold font rather .\" than being defined in a distinct secondary section. .\" .\" Enhance the description of 'Pre-Processor Functionality' to include .\" the newly added ability to define a symbol value alongside a symbol .\" name with the 'define' directive. .\" .\" Provide additional examples of entries for the 'date file' (i.e. the .\" 'pcal' configuration file). .\" .\" Change a couple of the existing examples of entries for the 'date .\" file' to reflect more-current 'year' values, to make it obvious how .\" to specify post-1999 years. .\" .\" Fix 2 small bugs (from the Debian Bug Tracking List for 'pcal') in .\" the use of escape sequences (e.g. '-\H' changed to '\-H') which was .\" causing the associated hyphenated 'pcal' option descriptions to .\" appear incorrectly. .\" .\" Add an HTML link to the free, online Adobe "PostScript Language .\" Reference Manual" book for those wanting to delve into the .\" PostScript world a bit deeper. .\" .\" Update the 'AUTHORS' section with a list of all known recent .\" contributors. .\" .\" Add commented-out lines which consist of several hypostrophes, .\" merely as a visual aid to the section breaks within this document .\" for future editors. Also, to avoid text colorization problems (in .\" Emacs' 'font-lock-mode', usually because of a line starting with a .\" double-quote character), break certain lines at a different spot, .\" which does not affect the 'man' page output at all. .\" .\" Change parameter names associated with '-s' command-line option from .\" 'date_shade' and 'fill_shade' to 'day_numerics_color' and .\" 'empty_day_box_fill_color' to more accurately reflect their .\" function, especially since the specification of a non-gray-scale .\" (i.e. RGB color) has been possible with this parameter for some time .\" now. .\" .\" Change various references to the color 'gray' to reflect the fact .\" that the colors used are those specified by the '-s' option, with .\" the default for both colors being 'gray'. .\" .\" Document the '-q' flag (print one column per month, for HTML .\" calendars only) which has been available since 'pcal' version 4.7.1. .\" .\" Document the issue of collision of month names and day-of-week names .\" in certain languages (e.g. French and Finnish). .\" .\" To avoid confusion, provide a note about use of no space between an .\" option and its negative value to prevent 'pcal' from misinterpreting .\" the negative option value as an illegal option itself, based on a .\" problem reported by a user on the 'pcal' SourceForge site. .\" .\" Provide various other small cleanups and generally bring the .\" document up-to-date for all the changes which have gone into 'pcal' .\" over the various revisions, including some changes to reflect .\" oversights from previous revisions. .\" .\" Perform general formatting cleanups designed to make the output of .\" this manual page easier to read. .\" .\" .TH PCAL 1 "18 Dec 2007" "Version 4.11.0" "USER COMMANDS" .SH NAME pcal \- generate PostScript (or HTML) calendars .SH SYNOPSIS .na .in +5n .ti -5n .B pcal [\fB\-e\fP|\fB\-f\fP\ \fIcal\fP\|] [\fB\-o\fP\ \fIfile\fP\|] [\fB\-l\fP\ |\ \fB\-p\fP] [\fB\-P\fP\ [letter | legal | a4 | tabloid]] [\fB\-j\fP\ |\ \fB\-J\fP] [\fB\-m\fP\ |\ \fB\-M\fP] [\fB\-g\fP\ \fIweekday\fR[\fI\-weekday\fR]|all|holiday] [\fB\-O\fP\ \fIweekday\fR[\fI\-weekday\fR]|all|holiday] [\fB\-G\fP\ \fIweekday\fR[\fI\-weekday\fR]|all|holiday] [\fB\-b\fP\ \fIweekday\fR[\fI\-weekday\fR]|all|holiday] [\fB\-s\fP\ [\fIday_numerics_color\fP][/\fIempty_day_box_fill_color\fP\|]] [\fB\-F\fP\ \fIday\fP\|] [\fB\-A\fP|\fB\-E\fP] [\fB\-X\fP\ \fIxtrans\fP\|] [\fB\-Y\fP\ \fIytrans\fP\|] [\fB\-x\fP\ \fIxscale\fP\|] [\fB\-y\fP\ \fIyscale\fP\|] [\fB\-t\fP\ [\fItitle_font\fP][/\fIsize\fP\|]] [\fB\-d\fP\ [\fIday_font\fP][/\fIsize\fP\|]] [\fB\-n\fP\ [\fItext_font\fP][/\fIsize\fP\|]] [\fB\-L\fP\ \fIfooter_str\fP\|] [\fB\-C\fP\ \fIfooter_str\fP\|] [\fB\-R\fP\ \fIfooter_str\fP\|] [\fB\-N\fP\ \fInotes_str\fP\|] [\fB\-D\fP\ \fIsymbol\fP\|] [\fB\-U\fP\ \fIsymbol\fP\|] [\fB\-B\fP] [\fB\-#\fP\ \fIn\fP\|] [\fB\-S\fP\ |\ \fB\-k\fP\ |\ \fB\-K\fP] [\fB\-w\fP] [\fB\-I\fP] [\fB\-c\fP\ |\ \fB\-H\fP] [\fB\-q\fP] [\fB\-z\fP\ \fItime_zone\fP\|] [\fB\-h\fP\ |\ \fB\-u\fP\ |\ \fB\-v\fP] [\fB\-a\fP\ \fIoutput_language\fP\|] [\fB\-r\fP\ [\fImapping\fP] [\fB\-T\fP\ [B|I|R]] [\fB\-W\fP\ [left|center|right]] [month] [year] [nmonths] .\" ------------------------------------------------------------------ .SH DESCRIPTION .I Pcal generates PostScript to produce landscape or portrait calendars for any month and year. The arguments .BR month , .BR year , and .BR nmonths , if provided, should be numeric. The .BR month value should be in the range 1 \- 12, and the .BR year value should be specified as 1 or 2 digits (in which case it will be interpreted as that year in the current century) or as the full 4-digit year. If no numeric arguments are provided, the calendar for the current month and year will be generated. .PP If one numeric argument is provided, it is interpreted as the .BR year value, and calendars for the entire year will be generated. Otherwise, .BR nmonths months, starting with .BR month and .BR year , will be generated. .PP For whole-year calendars (i.e. when the .B \-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 .B month argument alone is given, it is expected to be the desired .B year to print, and prints all of the months in the given year. If both .BR month " and " year are given, then 12 consecutive months are printed starting at the given month and year. If the .BR month ", " year ", and " nmonths arguments are all present, printing begins with the given month and year and .B nmonths months are printed, rounded up to the nearest multiple of 12. .\" ------------------------------------------------------------------ .SS The Date File (Configuration File) By default, .I pcal simply prints an empty calendar. Its real power is in its ability to place ``events'' (and, for monthly-format PostScript calendars, Encapsulated PostScript images [e.g. photos and icons]) in appropriate days on the (PostScript or HTML) calendar, thus allowing the user to create personalized calendars. This is achieved through the use of the ``date file'', also known as the ``configuration file''. .PP The default date/configuration file is expected to be named .IR \.calendar " (" pcal.dat under MS-DOS), or .I calendar for compatibility with older versions. .I Pcal will look in several places for such a file. First, if the environment variable .BR PCAL_DIR is defined, .I pcal searches the directory indicated by that variable. Next, .I pcal searches the user's home directory (as specified by the .BR HOME environment variable). If neither .BR PCAL_DIR nor .BR HOME is defined, .I pcal searches the current directory instead. Finally, if enabled (via the `SEARCH_PCAL_DIR' flag) when .I pcal was built, the directory where the .I pcal executable resides will be checked. If no date file is found, an empty calendar is printed; no error is generated. .PP Alternatively, the name of the date file (and, optionally, the path where it can be found) can be specified using the .B \-f command-line option. See the \fBOPTIONS\fP section for more details. .PP Every .I pcal distribution comes with an 'examples' directory. The `pcal-cfg.txt' file that is located there contains a myriad of examples of settings that can be used in your own configuration file. Please check it out for lots of useful ideas. Furthermore, that directory contains several language/country-specific examples (including holiday and other event definitions) in various `calendar_xx.txt' files, where `xx' represents the 2-letter language code (e.g. 'calendar_de.txt' is the German example file). .PP If a date file is found, it will be searched for lines with leading dates matching the requested month and year. .PP Any text following the dates found will be printed on the calendar under the appropriate day of the month. Encapsulated PostScript (EPS) images are handled similarly as described in a later subsection. .PP \fBtroff\fP-style escape sequences \\fB, \\fI, \\fP, and \\fR may be used to set the font style to Bold, Italic, the previous font style, or Roman respectively. For those more familiar with HTML, , , , and may be used instead to enable/disable Bold or Italic font styles. The font style is reset to Roman after each line break. .PP Using the `include' pre-processor directive (described in the section entitled `Pre-Processor Functionality', below), other configuration files can be processed from within an existing configuration file. That is, you can `nest' configuration files as needed. .PP Dates (essentially `events') in the configuration files may be expressed in any of several formats: .RS .LP .IP \(bu 2 in {*} {} .IP \(bu 2 {} {*} {} .IP \(bu 2 {*} {} .IP \(bu 2 {*} {} .RE .LP Where: .PP .\".nf .TP 22 := first 3+ characters of name of month, or ``all'' .IP .B Note: .I pcal looks for names of the days of the week prior to names of months when parsing event date specifications. Furthermore, some languages (e.g. French and Finnish) have a month name whose first 3 letters are the same as the first 3 letters of one of the names of the days of the week. Because of this, the specification in such a language of any month name which collides thusly must use 4 or more letters to distinguish it from the name of the day of the week with which it `collides'. .TP := , or ``year'' .TP := first 3+ characters of name of weekday, ``day'', ``weekday'', ``workday'', ``holiday'', ``nonweekday'', ``nonworkday'', ``nonholiday'', ``new_moon'', ``first_quarter'', ``full_moon'', or ``last_quarter'' .TP := any ordinal number (``1st'', ``2nd'', etc.), ``first'' ... ``fifth'', ``last'', ``odd'', ``even'', or ``all'' .TP := ``on'', ``before'', ``preceding'', ``after'', ``following'', ``on_or_before'' (``oob''), ``on_or_after'' (``ooa''), ``nearest'', ``nearest_before``, or ``nearest_after`` .TP := ``Christmas'', ``Thanksgiving'', ``Easter'', ``Good_Friday'', ``GEaster'' (Orthodox Easter), ``Gstgeorge'' (Orthodox holiday), and ``Gmarcus'' (Orthodox holiday). .TP := one or more non-numeric, non-space, non-`*' characters .TP := a numeric month (1-12) .TP := day of month (1-31) .TP := a numeric year .TP := the text to be displayed for this event; if the text begins with the constant string ``image:'', then it is interpreted as a specification of an Encapsulated PostScript (EPS) image rather than as simple text; more information on specifying EPS images is available in a later section of this document .PP If the .B \-A option (American date formats, the default) is given: .PP .TP 22 := | {} .PP If the .B \-E option (European date formats) is given: .PP .TP 22 := | | {} .PP The ``Notes'' box (see below) uses the first of the current month as the default date. All footer strings use the first of the current month in single-month mode and the first of the starting month in whole-year mode. .PP Examples: .PP .ft CW .nf last Monday in May* Memorial Day Holiday .sp all Fridays in Oct Status Meeting, 11 AM first workday in all %-B progress report due all Fri in all \\fBTime card due,\\fP 3 PM all Monday in all Fiscal week %0W -2nd workday in all Schedule for %+B due %+2D 2nd full_moon in all Blue Moon Fri on_or_before all 15 Pay Day even Fridays in year Pay Day 183rd day of year Mid-year (%l days left) .sp Tue after first Mon in Nov Election Day (USA) .sp 4th Thu in Nov* Thanksgiving Fri after 4th Thu in Nov* Day after Thanksgiving workday nearest 12/25* Holiday .sp 12/25/04* Christmas # American 25.12.04* Christmas # European 25. 12.* Christmas # European .sp Dec 25* Christmas # American 25 Dec* Christmas # European 25. Dec* Christmas # European .sp Fri on all 13 Avoid black cats! # 'Friday the 13th' .fi .ft .PP Any non-numeric character may separate numeric dates. Holidays may be flagged by following the date immediately with `*' as in the examples above; this will cause the date numerics to be printed in the color specified by the .B \-s option (default = gray) and will cause the associated text (on monthly-format calendars) to be placed adjacent to the numeric date in the day box rather than below the numeric date (as is done for all non-holiday events). ``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. ``Nearest'' attempts to match the specified date; if that fails, it tries the day after, then the day before, then two days after, two days before, and so forth until a match occurs. .PP Wildcard day names are also provided. The keyword ``weekday'' applies to any days which are normally printed in "logical black" - the predominant day color - 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 .B CAVEATS below for important notes on using these keywords. Moon phases may also appear as wildcards; ``nm'' is accepted as a synonym for ``new_moon'', ``1q'' and ``fq'' for ``first_quarter'', ``fm'' for ``full_moon'', ``3q'' for ``third_quarter'', and ``lq'' for ``last_quarter''. .PP 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 (e.g. 100th). Negative ordinal numbers may even be used. For example, ``\-2nd'' means ``next to last''. .PP ``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 \(em not to those Fridays falling on odd dates. .PP ``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. .PP ``Nearest'', ``nearest_before'', and ``nearest_after'' refer to the nearest weekday or wildcard day with respect to the specified date. ``Nearest_before'' and ``nearest_after'' allow the user to specify how \fIpcal\fP is to disambiguate between two dates that are equally near: e.g., ``nonweekday nearest_before [Wed.] 9/25/96'' refers to Sunday, 9/22 while ``nonweekday nearest_after 9/25/96'' refers to Saturday, 9/28. (Note that ``nearest_before'' and ``nearest_after'' are equivalent to ``nearest'' when no such ambiguity exists: e.g., ``nonweekday nearest_before [Thu.] 9/26/96'' refers to Saturday, 9/28.) .PP Text in the date file may use C-like escape sequences (i.e. a `\\' followed by a character, 1 \- 3 octal digits, or `x' followed by 1 \- 2 hexadecimal digits). Escaped whitespace (including .B newline ) and the standard ANSI character escapes (`\\a', `\\b', `\\f', `\\n', `\\r', `\\t', `\\v') are all replaced by a single blank. .PP The HTML special characters `<' `>' `"' `&' ` ' and `&#NNN;' (NNN = any three decimal digits) are also supported. These will be propagated intact (be sure to escape the `#' in `&#NNN;') if the output is specified as HTML (see the .B \-H flag); otherwise they will be converted to their ASCII equivalents. This allows a common date file to be used regardless of whether the desired output format is HTML, PostScript, or Un*x .I "calendar(1)" (see the .B \-c flag) input. .PP Lines in the configuration file consisting of .B year #### (where .B #### 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. .PP Lines in the configuration file consisting of .B year all (or, alternatively, \fByear *\fP) direct \fIpcal\fP to wildcard following entries against every applicable year. This assumes that the following entries do not contain a year; any date entries containing year information (or an explicit \fByear ####\fP entry) will set the remembered year to that year. .PP Lines in the configuration file consisting of .B opt can be used to override the defaults for any command-line options except .BR \-c , .BR \-e , .BR \-f , .BR \-h , .BR \-H , .BR \-u , .BR \-v , .BR \-D ", and" .BR \-U . Any options specified in this manner are, in turn, overridden by those specified explicitly on the command line. .PP Lines in the configuration file consisting of .B note{/} can be used to place notes regarding the entire month in one of the unused blocks of the calendar. The .B 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. .B is an optional positive or negative number specifying the empty box where the associated text is to be placed. If positive, .I pcal counts forward from the first empty box; if negative, .I pcal counts backward from the last empty box. Thus, .BR ``note/1'' places the associated text in the first empty box; .BR "note/-3" in the third-to-last. The default is -1 if no is given (last empty box, immediately preceding the small calendars on the bottom row; cf. .BR \-S , .BR \-k , and .BR \-K , below). You can place several notes in the same box. You can also use more than 1 box for the various monthly notes. .PP Lines in the configuration file consisting of .B input-language XX (where .B XX is the 2-letter specification for any of the supported languages) can be used to set the language used for interpretation of the month names and day-of-week names for the remaining event entries. This option may be specified more than once, as needed, if the language used to describe events changes within the file. For backwards compatibility, the default value for `input language' if this directive is never used is 'en' (English). Note that this directive is distinct from the specification of 'output language' as accomplished with the .B \-a option. .PP Comments are supported in the configuration file. Any characters following a `#' character are ignored, through the end of that line, unless the `#' character is escaped by `\\'. .\" ------------------------------------------------------------------ .SS Deleting Events By prepending the .I `delete' keyword to an event specification, one or more events may be deleted from a set of previously-specified events. .PP For example, the following lines might appear in the date file: .PP .RS .LP .nf all Friday in all Poker game delete first Friday in all Poker game .fi .RE .LP This results in an event labeled `Poker game' on every Friday except the first Friday of the month. If you delete an entry which is marked as a holiday, the `holiday' flag for that day will be recalculated. Any `delete' entries which don't match any pre-existing entries are silently ignored. .\" ------------------------------------------------------------------ .SS Format Specifiers .I Pcal allows format specifiers in both the event text and footer strings (see the .BR \-L , .BR \-C , .BR \-R , and .B \-N options below). Each format specifier will be replaced by a corresponding string as outlined in the following table: .PP .nf %a abbreviated weekday %A full weekday %b abbreviated month name %B full month name %d day of month (1-31) %j day of year (1-366) %l days left in year (0-365) %m month (1-12) %U week number (0-53) %W week number (0-53) %u week number (1-54) %w week number (1-54) %y year w/o century (00-99) %Y year w/century %% `%' character %o print number as ordinal %0 print number with leading zeroes %+ use following month or year %\- use previous month or year %{+N}[DWMY] adjust date by +N days/weeks/months/years %{\-N}[DWMY] adjust date by \-N days/weeks/months/years .fi .PP Most of these are derived from the ANSI C .ft CW strftime() .ft function, but the .B %[louwMD] and .B %[o0+\-] format specifiers are specific to .IR pcal . .PP The .B %u specifier considers the week containing 1/1 (Jan 1st) as week 1 and the following logical Sunday (the first day of the week as printed; cf. the .B \-F option below) as the start of week 2; .B %U considers the first logical Sunday as the first day of week 1. .B %w and .B %W behave like .B %u and .B %U respectively, but use the first logical Monday instead. Note that .B %w has a different meaning from .ft CW strftime(). .ft .PP The .B %o format specifier prints a number as an ordinal, with the appropriate suffix (``st'', ``nd'', ``rd'', or ``th'' in English) appended. For example, .B %od prints the day of the month as ``1st'', ``2nd'', ``3rd'', etc. .PP Unlike .ft CW strftime(), .ft .I pcal defaults to printing numbers (except .BR %y ) without leading zeroes. If leading zeroes are desired, the `0' prefix may be used. For example, .B %0j prints the first day of year as ``001''. .PP The .B %+ and .B %\- format specifiers direct .I pcal to substitute the following/previous month/year in the following .B [bBmyY] specifier. For example, .B %+B prints the name of the next month. .PP The .B %{[+\-]N}[DWMY] format specifiers do not print anything, but instead adjust the working date by \(+- .BR N days .RB ( D ), weeks .RB ( W ), months .RB ( M ), or years .RB ( Y ). Subsequent format specifiers use the adjusted date instead of the current date. For example, .B %+1M %B %Y adjusts the date forward by one month and then prints the resulting month and year (``January 1992'' in December, 1991); .B %\-2W %b %d adjusts the date backward by two weeks and prints the resulting month and day (``Jul 26'' on August 9). .PP Such date adjustments are normally cumulative; for example, .B %+1Y%\-1D adjusts the date forward by one year and then backward by one day. If .B %D or .B %M is specified alone (or if .B N is zero), .I pcal restores the original date. Note that .B %M has a different meaning to the .ft CW strftime() .ft function. .PP Here's a common, useful example of an event entry for the .I pcal date file which combines the ability to adjust working dates and the ability to display ordinals. This particular example is used to display text on the birthday of a person born in 1991: .RS .LP May 10 Eric's %-1991Y%oY Birthday .RE .LP That entry would result in the following text being displayed on May 10, 2005: .PP .RS .LP Eric's 14th Birthday .RE .LP .\" ------------------------------------------------------------------ .SS Encapsulated PostScript (EPS) Images For monthly PostScript calendars only, .I pcal supports the embedding of one or more EPS images (photos, icons, etc) into any given day of the month. (EPS image specifications in the .I pcal date file are ignored for yearly PostScript calendars and for all HTML calendars.) In order to associate an image with a given event, you must add one or more entries to the date file. The event date is specified exactly as described previously for simple event text specification lines. However, instead of specifying the text associated with the event, you instead specify the EPS image filename and some additional parameters in the following format: .PP .ft CW .nf image: .fi .ft .PP Where: .PP .TP 28 is the filename (which can include a path) of the Encapsulated PostScript image. .BR "Note:" The EPS image filename must be preceded by the constant text `image:' in order to distinguish an EPS image specification from an ordinary event text specification. .TP is a scaling factor in the horizontal dimension for the EPS image. A value of 1.0 is nominal (i.e. no change to image scale). Values between 0.0 and 1.0 shrink the image in the horizontal dimension while values over 1.0 expand the image in the horizontal dimension. Generally speaking, only positive values should be used. However, in the rare case that you find that your EPS image needs to be flipped about the vertical axis (i.e. left to right), you can use a negative value to achieve this without having to tweak the actual PostScript content within the EPS image file. Use of a negative value will undoubtedly necessitate a corresponding change to the parameter to account for the image's relocated position that occurs when it gets flipped "left-to-right". .TP is a scaling factor in the vertical dimension for the EPS image. Values between 0.0 and 1.0 shrink the image in the vertical dimension while values over 1.0 expand the image in the vertical dimension. Note that a negative value for this parameter can be useful in the less-than-rare case that you find that your EPS image needs to be flipped about the horizontal axis (i.e. top to bottom). In such cases, you can use a negative value to achieve this without having to tweak the actual PostScript content within the EPS image file. Use of a negative value will undoubtedly necessitate a corresponding change to the parameter to account for the image's relocated position that occurs when it gets flipped "upside down". .TP := a horizontal adjustment in typographic `points' (i.e. 72nds of an inch) for the positioning of the EPS image. With offsets of 0 for X and Y, the image will be printed at the extreme left edge of the box for that day, just under the numerics for that day. Positive values move the image to the right and negative values move the image to the left. .TP := a vertical adjustment in typographic `points' (i.e. 72nds of an inch) for the positioning of the EPS image. With offsets of 0 for X and Y, the image will be printed at the extreme left edge of the box for that day, just under the numerics for that day. Positive values move the image up and negative values move the image down. .PP Here's an example of a line from the date file that associates an EPS image with an event: .PP .ft CW .nf 4th Thu in Nov* Thanksgiving 4th Thu in Nov* image:/eps-path/turkey.eps 1.0 1.0 0 0 .fi .ft .PP You can place as many images as you want on a single day of the month by specifying repeated lines in the date file. For example, these lines put icons of George Washington and Abraham Lincoln on the day of the U.S. ``Presidents' Day'' holiday, along with the event text: .PP .ft CW .nf 3rd Monday in Feb* Presidents' Day 3rd Monday in Feb* image:/eps-path/washington.eps 0.08 0.08 8 0 3rd Monday in Feb* image:/eps-path/lincoln.eps 0.22 0.22 48 0 .fi .ft .PP Note that the icon for Lincoln is shifted to the right by 48 typographic points so as not to overlay the first icon. .PP The .I pcal releases come with a single EPS sample file ('eps/recycle.eps') of the ubiquitous 'recycle' icon (3 green arrows in a triangular shape). Such an image might be used with configuration file settings like this: .PP .ft CW .nf second Sat in all RECYCLE! second Sat in all image:/eps-path/recycle.eps 0.039 0.039 34 -9 .fi .ft .PP In cases where you're displaying non-holiday event text (e.g. someone's birthday) and an EPS image, you'll often need to use a negative `Y-delta' value on the EPS image specification line, in order to shift the image down so that it doesn't cover the event text, which appears just below the day's numerics for non-holiday events. (Text for holiday events appears higher up, to the right of the day's numerics, so there's usually no collision with the EPS image.) .PP .BR "Note:" Unfortunately, most EPS images cannot be used directly by .IR pcal . .RS .LP Depending on the EPS image used and how it was created, you may have to remove or comment out some or all of the PostScript `translate' commands, in order to avoid the use of illogical X-delta and Y-delta values when specifying the EPS image in your .I pcal date file. Most programs that generate EPS output (either directly or via conversion from some other graphic format) seem to have these `translate' commands relatively early in the EPS file. .PP It may take some experimentation to get it just right. Preview the .I pcal output using a PostScript viewer as you tweak the PostScript commands in the EPS image file and/or the event entry in the .I pcal date file. .RS .LP .BR "Note:" Depending upon what application you use to preview PostScript content, the monthly calendars may not show any embedded EPS images. Here's a rundown of some popular PostScript-viewing applications and whether they correctly display the embedded EPS images: .RS .LP .IP \(bu 2 gv (version 3.5.8) -- EPS images appear fine .IP \(bu 2 ggv (versions 2.4.0.1 and 2.6.1) -- EPS images appear fine .IP \(bu 2 older kghostview (versions 0.13.2 [KDE 3.1.4] and 0.2.0 [KDE 3.2.3 and 3.3.2]) -- EPS images DO NOT APPEAR! .IP \(bu 2 newer kghostview (version 0.2.0 [KDE 3.4.2 and 3.5.4]) -- EPS images appear fine .RE .LP .RE .LP .RE .LP For converting non-EPS images (e.g. photos) to EPS format, one can use the graphical GNU Image Manipulation Program, a.k.a. `The GIMP': .RS .LP .IR http://www.gimp.org .RE .LP For icons/images in WMF format (which are popular in various 3rd-party, legacy-OS, commercial calendar programs), the `libwmf'/`wmf2eps' library/utility is useful for generating .IR pcal -capable EPS images. It can be found at this site: .RS .LP .IR http://wvware.sourceforge.net/libwmf.html .RE .LP For icons/images in SVG format, the ImageMagick `convert' utility is sometimes useful for generating .IR pcal -capable EPS images. This suite of utilities (which includes other useful ImageMagick utilities like `display' and `identify') may already be available on your Linux distribution. If not, it can be found at this site: .RS .LP .IR http://www.imagemagick.org .RE .LP For cases where ImageMagick's `convert' utility fails to properly convert SVG-format images to EPS format, you can try the method of converting the SVG image into an intermediate format (e.g. PNG) using the `rsvg' utility. This utility may already be available on your Linux distribution. If not, it can be found at this site: .RS .LP .IR http://librsvg.sourceforge.net/ .RE .LP From the PNG format, the image can often then be successfully converted to EPS format, using the above-mentioned ImageMagick `convert' utility. .LP The .I Open Clip Art Library is a good source of freely-usable images (many of which are in SVG format) for decorating your events: .RS .LP .IR http://www.openclipart.org .RE .LP .BR "Note:" The EPS image content is not generated in the PostScript output -- only a reference to the EPS image filename is generated. From a practical standpoint, this means that normally you'll need to print/preview the PostScript output of .I pcal from the same computer/setup as that which was used to run .I pcal in the first place. If you want to generate a calendar with embedded EPS images that will later be printed/viewed on another machine which does not have access to those EPS images, you'll need to run the output through a pre-processor which will put the EPS image content into the PostScript output file. For example, assuming your initial calendar output was generated to a file named `pcal.ps', on most GNU/Linux systems you could run this command, which uses the popular `Ghostscript' interpreter: .RS .LP gs -r300x300 -dBATCH -dNOPAUSE -sDEVICE=pswrite -sOutputFile=out.ps pcal.ps .RE .LP This would generate a PostScript file named `out.ps', at 300x300 dpi resolution, which has the actual EPS image content embedded within, allowing you to transport the `out.ps' file to another computer for viewing/printing. Of course, the new file is substantially larger, but it's portable. Furthermore, the EPS images will be viewable even in PostScript-viewing applications (see above) which don't properly support the display of embedded (by filename only) EPS images. .\" ------------------------------------------------------------------ .SS Pre-Processor Functionality .I Pcal supports rudimentary .IR cpp -like functionality in the date file, allowing the following constructs: .RS .LP .IP \(bu 2 .BR "define | undef" .IP \(bu 2 .B if{{n}def} ... {elif ...}* {else ...} endif .IP \(bu 2 .BR include .RE .LP Note that these are not preceded by `#' as they are in C. .PP Symbol names defined using these keywords (or via the .B -D option) are case-insensitive. It is not an error to .BR undef an undefined symbol, nor to .BR define a previously-defined one. .PP A symbol can be defined with just a name (e.g. ``define MY_SYM'') or it can take on a value (e.g. ``define MY_SYM SOME_VALUE''). Use of symbol values is convenient for defining a starting date then using that symbol to reference that starting date in one or more events. For example, these definitions in the date file might be useful: .PP .ft CW .nf define semester_start 8/23 # Beginning of semester semester_start Class Start 7th day after semester_start 1st Quiz 14th day after semester_start 2nd Quiz undef semester_start .fi .ft .PP Be aware that the substitution of symbol values for symbol names is not robust, so it's wise to use a symbol name that's unlikely to occur in any of your other event text. In other words, if you defined the `semester_start' symbol in the example above as merely `start', then you'd get the undesired effect of having the text `Class 8/23' in your calendar on that day instead of `Class Start'! The use of `undef semester_start' in the above example is optional and is really only useful to prevent any unwanted symbol substitutions later on, which probably won't happen unless you poorly choose your symbol name to begin with. .PP An .BR ifdef alone is always .BR false "; an" .BR ifndef alone is always .BR true . .BR if is accepted as a synonym for .BR ifdef . .PP The name of the file in the .BR 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. If the string "%y" appears in the file name, it is replaced by the last two digits of the current year or, if "year all" is in effect, is expanded to all applicable years. .I Pcal is smart enough to translate .B ~/ to the user's home directory. .PP .I Pcal normally terminates immediately if the file specified in an .BR include directive does not exist. An alternate form of the directive, .BR include? , directs .I pcal to continue silently if the file does not exist or cannot be opened. .PP In addition to pre-processing keywords, .I pcal also accepts boolean expressions in .B if{{n}def} and .B elif directives. These expressions consist of symbol names joined by the boolean operators .BR ! ", " & ", " ^ ", and " .BR | , in order of precedence, high to low. Parentheses may be used to alter the precedence. The synonyms .BR && " and " || are accepted for .BR & " and " | . A symbol name evaluates to .B true if currently defined, .B false if not; thus: .PP .ft CW .nf ifdef A | B | C .fi .ft .PP \&...is .B true if any of the symbols A, B, and C is defined, and: .PP .ft CW .nf ifdef A & B & C .fi .ft .PP \&...is .B true if they all are. Note that .B ifndef is equivalent to .B ifdef !( ). .\" ------------------------------------------------------------------ .SS The Moon File If a file of the name .IR .moon## " (" moon##.dat under MS-DOS), where .B ## is the last two digits of the calendar year, exists in the same directory as the date file (or in the directory where .I pcal resides), .I pcal uses the information contained within to calculate the phase of the moon. If a) no such file exists, b) the .B \-e flag (do not use a date file) is specified, or c) the .B \-z flag (specify time zone) is specified, then .I pcal uses an algorithm to calculate the phase of the moon. .PP Entries in the moon file must conform to the following syntax: .PP If the .B \-A option (American date formats, the default) is given: .PP .ft CW .nf {} .fi .ft .PP If the .B \-E option (European date formats) is given: .PP .ft CW .nf {} .fi .ft .PP Where: .PP .nf := ``nm'', ``fq'' or ``1q'', ``fm'', ``3q'' or ``lq'' (new moon, first quarter, full moon, last quarter) := number 0-23 (24-hour clock) := number 0-59 .fi .PP This file must contain entries for all quarter moons in the year, in chronological order; if any errors are encountered, .I pcal will revert to using its default algorithm. .PP As in the date file, comments start with `#' and run through the end of the given line. .PP The moon file may optionally contain an \fBopt \-A\fR or \fBopt \-E\fR line to specify the format of its own date entries independently of the format used in the date file. No other flags are legal in the moon file. .PP .\" ------------------------------------------------------------------ .SS Generating PostScript Calendars Via A Web Browser Interface PostScript-format .I pcal calendars can be generated and viewed from a web browser interface. .RS .LP .BR "Note:" This is not to be confused with the ability to generate non-PostScript, HTML-format (using the .BR \-H command-line option) calendars, which is a different capability entirely. .RE .LP .I Pcal comes with 4 files that provide this ability: `pcal.cgi' (a Bourne shell script), `pcal.pl' (a Perl equivalent of `pcal.cgi'), `pcal.html', and `pcalw.html'. .PP The CGI file (either `pcal.cgi' or `pcal.pl') must be edited before using it. Change the definition for .I `pcal=' (Bourne shell script) or .I `my $PCAL =' (Perl script) to point to the location of the .I pcal executable file. Change the definition for .I `file=' (Bourne shell script) or .I `my $FILE =' (Perl script) to point to the location of the .I pcal `date file' (e.g. `.calendar'), which contains the options for running .IR pcal . Finally, copy the `pcal.cgi' (or `pcal.pl') file to the location where your web server expects to find such files (e.g. `/var/www/cgi-bin/'). .PP The `pcal.html' and `pcalw.html' files must also be edited. Each one has a line like this: .RS .LP
.RE .LP That line must be edited to point to the host and location of your CGI script file (`pcal.cgi' or `pcal.pl'). .PP Once that's done, point your web browser to the `pcal.html' or `pcalw.html' file to generate monthly/yearly PostScript calendars for viewing within your web browser. .RS .LP .BR "Note:" Depending upon what application your web browser spawns to preview PostScript content, the monthly calendars generated via this web browser interface may not show any embedded EPS images. For a rundown of some popular PostScript-viewing applications and whether they correctly display the embedded EPS images, see the section (above) entitled `Encapsulated PostScript (EPS) Images'. .RE .LP .\" ------------------------------------------------------------------ .SH OPTIONS .TP .B \-e Prints an empty calendar. Do not print entries from a .I \.calendar file even if one exists. .TP .BI \-f " cal" Directs .I pcal to use the file name .I cal as the input file in place of the default .I \.calendar file. Note that the search rules are different when .B \-f is used. If .I cal is an absolute file name (i.e. starting with a `/'), then .I pcal attempts to open only that file. Otherwise, .I pcal looks for .I cal in the current directory, then in the directory indicated by the environment variable .B PCAL_DIR (if defined), and finally, if enabled (via the `SEARCH_PCAL_DIR' flag) when .I pcal was built, in the directory where the .I pcal executable resides. If the given .I cal file is not found, an error results. .TP .BI \-o " file" Directs .I pcal to write the output to .I file instead of to stdout. .TP .B \-l Causes the output to be in landscape mode (default). .PP .IP .I Pcal predefines the symbol `ORIENTATION_LANDSCAPE' whenever `landscape' page orientation is enabled. This can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on the page orientation. .TP .B \-p Causes the output to be in portrait mode. .PP .IP .I Pcal predefines the symbol `ORIENTATION_PORTRAIT' whenever `portrait' page orientation is enabled. This can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on the page orientation. .TP .B \-P Selects the paper size. The following sizes are supported: .RS .RS .LP .IP \(bu 2 letter \(em 8.5 x 11.0 inches .IP \(bu 2 legal \(em 8.5 x 14.0 inches .IP \(bu 2 a4 \(em 210 x 297 mm .IP \(bu 2 tabloid \(em 11.0 x 17.0 inches .RE .RE .LP .RS .I Pcal predefines one of the following symbols based on the current paper size: .RS .LP .IP \(bu 2 PAPERSIZE_LETTER .IP \(bu 2 PAPERSIZE_LEGAL .IP \(bu 2 PAPERSIZE_A4 .IP \(bu 2 PAPERSIZE_TABLOID .RE .LP These symbol definitions can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on paper size. .RE .LP .TP .B \-j Causes the Julian date (day of year) to be printed in each calendar box. .TP .B \-J Causes the Julian date and the number of days remaining in the year to be printed in each calendar box. .TP .B \-m Causes moon icons to be printed on dates corresponding to new, half, and full moons (the default is that no moons are printed). .TP .B \-M Causes moon icons to be printed on all dates (the default is that no moons are printed). .TP .BI \-g " day1\fR[\fI\-day2\fR]" " | all | holiday " Causes all dates falling on weekday .I day1 (through .I day2 if specified) to be printed in the `day numerics color' (i.e. the color specified by the .B \-s option [default = gray]); .B \-g all causes all weekdays (other than holidays) to be printed in the `day numerics color'; .B \-g holiday causes all holidays to be printed in `day numerics color'. \fIday1\fR and \fIday2\fR may wrap around weekends; for example, .B \-g fri\-sun causes Fridays, Saturdays, and Sundays to be printed in the `day numerics color'. .TP .BI \-O " day1\fR[\fI\-day2\fR]" " | all | holiday " Similar to .BR \-g , but the selected days will be printed as outlined characters, using the `day numerics color'. .TP .BI \-G " day1\fR[\fI\-day2\fR]" " | all | holiday " Similar to .BR \-g , but the selected days will be printed in the `day numerics color', outlined in black. .TP .BI \-b " day1\fR[\fI\-day2\fR]" " | all | holiday " Similar to \(em you guessed it \(em .BR \-g , but the selected days will be printed in black. Since black is the default for weekdays, \-b is primarily used to overriding other flags (e.g., .B \-g all \-b sat-sun ). .TP .BR " Note:" The default for the above options is to print Saturdays, Sundays, and holidays in the `day numerics color' and all other days in black. For backward compatibility with earlier versions of .IR pcal , .BR \-O and .BR \-G alone change all non-black days to the specified color. .TP .BI \-s " [day_numerics_color][/empty_day_box_fill_color]" Overrides the default value(s) for the color of the numerics for each day and/or the color of the fill used on boxes for 'empty' days. .B "Note:" This option only applies to PostScript-format calendars, not to HTML-format calendars. These values may be set independently of each other. For use with non-color printers, these values should be in the range 0.0 (black) through 1.0 (white). The default values are 0.8 for day numerics and 0.9 for empty day boxes. For use with color printers, these values may optionally be specified as a set of \fIred\fP:\fIgreen\fP:\fIblue\fP (RGB) values, each of which must in the range 0.0 through 1.0. At least one `:' must be present for these values to be recognized as RGB colors; omitted values are set to 0.0. .IP This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). .TP .BI \-F " day" Selects weekday .I day as the first day of the week. The given day will appear in the left-most column of the calendar. \fIday\fP may be specified either as a weekday name or, optionally, as a number in the range 0 (Sunday) through 6 (Saturday). .IP This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). .TP .B \-A Directs .I pcal to use American date conventions ( .B mm/dd{/yy} and .B month dd ) when parsing the date file. This is the default. .IP This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). .TP .B \-E Directs .I pcal to use European date conventions ( .B dd/mm{/yy} and .B dd month ) when parsing the date file. .IP This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). .TP .BI \-X " xtrans" Specifies the x-axis translation value for positioning the output on the page. Positive values shift the output to the right. Negative values shift the output to the left. .TP .BI \-Y " ytrans" Specifies the y-axis translation value for positioning the output on the page. Positive values shift the output up. Negative values shift the output down. .TP .BI \-x " xscale" Specifies the x-axis scaling factor for the calendar size. .TP .BI \-y " yscale" Specifies the y-axis scaling factor for the calendar size. .TP .BI \-t " \fR[\fItitle_font\fR][\fB/\fIsize\fR]" Specifies the name of a font to use for all the calendar heading text: .RS .RS .LP .IP \(bu 2 the month name and year at the top of the calendar (for monthly-format calendars) or at the top of each month (for yearly-format calendars and for the small previous/next-month calendars [if enabled] on monthly-format calendars) .IP \(bu 2 the day-of-week names .IP \(bu 2 the footer strings (if any) .IP \(bu 2 the ``Notes'' box heading (if any; for monthly calendars only) .RE .RE .LP .IP For monthly calendars only, the user may optionally specify the font size, which applies only to the main month/year heading. For example, .B "pcal \-t Times-Roman/54" sets the font to Times-Roman and the month/year point size to 54. The font size may also be changed independently: .B "pcal \-t /54" changes the point size to 54 without affecting the font name. .IP Note: For yearly calendars, any specification of font .I size is ignored. .IP This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). .TP .BI \-d " \fR[\fIdate_font\fR][\fB/\fIsize\fR]" Similar to the .B \-t option, but selects the font and/or size used for the day numerics (the numbers inside the box for each day). .IP Note: For yearly calendars, any specification of font .I size is ignored. .IP This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). .TP .BI \-n " \fR[\fItext_font\fR][\fB/\fIsize\fR]" Similar to the .B \-t and .B \-d options, but selects the font and/or size used for any `event' text associated with each day and for any text in the monthly ``Notes'' box. .IP Note: This option applies to monthly calendars only. For yearly calendars, this option does not apply. .IP This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). .TP .BI \-L " 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. .TP .BI \-C " string" Similar to .BR \-L , but causes the accompanying string to be printed as a centered footer. If the .B \-H flag (generate calendar as HTML table) was specified, this string will be used as the title and heading. .TP .BI \-R " string" Similar to .BR \-L , but causes the accompanying string to be printed as a right-justified footer. .TP .BI \-N " string" Causes the accompanying string to be printed as the heading for the "Notes" box. Note, however, that .I pcal makes no attempt to ensure that it fits. .TP .BI \-D " symbol [value]" Defines the named symbol and an optional value to be associated with that symbol, prior to reading the date file. .TP .BI \-U " symbol" Un-defines the named symbol prior to reading the date file. .TP .B \-B Causes .I pcal to leave unused calendar day boxes blank as opposed to the default behavior of filling them using the `empty day-box fill color' (i.e. the color specified by the .B \-s option [default = gray]). .TP .BI \-# " n" Causes .I pcal to print .I n copies (maximum: 100) of each output page. .TP .BI \-S Causes .I pcal to suppress printing the small calendars. See the .B CAVEATS section for further details. .TP .BI \-k Causes .I pcal to print the small calendars in the upper left corner (the default is to print them at the lower right). .TP .BI \-K Causes .I pcal to print the small calendar for the previous month in the upper left corner and the next month in the lower right (the default is to print both at the lower right). .TP .BI \-w Causes .I 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 .B CAVEATS section for details on the use of this option with other options. .IP Pcal predefines the symbol \fBwhole_year\fP when the .B \-w flag is in effect, allowing directives like `\fBifdef whole_year\fP' in the configuration file. .TP .B \-I Resets all parameters to the program defaults. .TP .BI \-c Causes .I pcal to generate a date file suitable for use as input to the Un*x .I "calendar(1)" utility. The normal PostScript output is suppressed. .TP .BI \-H Causes .I pcal to generate a calendar in HTML table format. The normal PostScript output is suppressed. .IP The HTML table format does not support moon graphics, Julian date information, `day numerics' color, `empty day' `box fill' color, left or right footer strings (but see the .B \-C flag), alternate fonts/sizes, transformation and scaling factors, or embedded EPS images. .TP .BI \-q This option is only valid when used in conjunction with the .B \-H (generate HTML-format calendar) option. It generates a yearly-planner style of HTML calendar whereby a single column for each month is used, resulting in table that gives a quicker overview of several months. Since there is less space for text, only the first character of the weekday and the first 5 characters of text from each event for that day are printed. The day numerics for holidays are colored red but the text of the holiday event is not printed. The day numerics are grey for Saturdays and bold black for Sundays. .TP .BI \-z " time_zone" Forces .I pcal to ignore the moon file and to use its internal algorithm for moon phase calculations, adjusting the phase by .I time_zone hours (where .I time_zone is expressed in hours west of UTC). .IP For example, New York residents (USA Eastern time zone) would use '-z 5' while on Eastern Standard Time (winter) and '-z 4' while on Eastern Daylight Time (summer). People in India would use '-z-5.5'. Notice that fractional values are allowed. .IP This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). .TP .B \-h Causes .I pcal to write version information, parameter usage message, and full explanation of options and file formats (to .IR stdout ) and terminate. .TP .B \-u Causes .I pcal to write version information and parameter usage message (to .IR stdout ) and terminate. .TP .B \-v Causes .I pcal to write version information only (to .IR stdout ) and terminate. .IP Pcal predefines the symbol \fBvX_Y_Z\fP, where \fBX_Y_Z\fP denotes the current version of Pcal (e.g. version 4.9.0 predefines the symbol \fBv4_9_0\fP). .TP .BI \-a " output_language" Select the output language (for the names of months and days on the calendar). .IP Currently, the following languages are supported: .B ca (Catalan), .B cs (Czech), .B da (Danish), .B de (German), .B el (Greek), .B en (English), .B eo (Esperanto), .B es (Spanish), .B et (Estonian), .B fi (Finnish), .B fr (French), .B ha (Hawaiian), .B hu (Hungarian), .B it (Italian), .B lt (Lithuanian), .B lv (Latvian), .B nl (Dutch), .B pl (Polish), .B pt (Portuguese), .B ro (Romanian), .B ru (Russian), .B sk (Slovak), .B sv (Swedish), and .B uk (Ukrainian). The default is .BR en . .IP Note that this option does \fBnot\fP specify the `input language', which is the language used to process events in the configuration file ('English', by default, unless changed with the .I input-language XX directive). See the section .I The Date File for more details on specifying the `input language'. .IP .B "Note:" In order to display diacritical marks, languages other than English require that the characters be remapped. Normally, no action is required since \fIpcal\fP automatically selects a remapping which is appropriate to the selected language. However, if you want to override the default remapping for a given language, you would use the .BR \-r option (e.g. "-r Latin1"). .IP Furthermore, an appropriate font should be selected as needed using the .BR \-t option (e.g. "-t some-latin1-font-name"). Any language using the "Latin1" remapping (e.g. French, German, Italian, Spanish, etc) requires an ISO 8859-1 ('Latin1') font. The Greek language requires an ISO 8859-7 (similar to ELOT-928) font (available from Angelo Haritsis ; also see http://www.hellenic.net/fonts/). Similarly, Russian requires a KOI8-R font while Ukrainian requires a KOI8-U font. .IP .I Pcal predefines the symbol \fBlang_XX\fP, where \fBXX\fP is the two-character abbreviation for the selected output language. .TP .BI \-r " \fR[\fImapping\fR]" Specifies an 8-bit character set remapping (encoding) for printing the diacritical marks common to European languages. .IP Note: This option is not usually needed since .I pcal will automatically select an appropriate default character encoding (mapping) for the language for which the calendar is being generated. .IP The value specified for \fImapping\fR is case-insensitive and may be abbreviated to the point where it is still unique. The value used may be any of the following: .RS .RS .LP .IP \(bu 2 "none" (use built-in character set) .IP \(bu 2 "Latin1" (ISO 8859-1) .IP \(bu 2 "Latin2" (ISO 8859-2) .IP \(bu 2 "Latin3" (ISO 8859-3) .IP \(bu 2 "Latin4" (ISO 8859-4) .IP \(bu 2 "Cyrillic" (ISO 8859-5) .\" As of Aug 2005, Arabic is not yet supported... .\" .IP \(bu 2 .\" "Arabic" (ISO 8859-6) .IP \(bu 2 "Greek" (ISO 8859-7) .\" As of Aug 2005, Hebrew is not yet supported... .\" .IP \(bu 2 .\" "Hebrew" (ISO 8859-8) .IP \(bu 2 "Latin5" (ISO 8859-9) .IP \(bu 2 "Latin6" (ISO 8859-10) .IP \(bu 2 "Thai" (ISO 8859-11) .IP \(bu 2 "Latin7" (ISO 8859-13) .IP \(bu 2 "Latin8" (ISO 8859-14) .IP \(bu 2 "Latin9" (ISO 8859-15) .\" As of Aug 2005, Latin10 is not yet supported... .\" .IP \(bu 2 .\" "Latin10" (ISO 8859-16) .IP \(bu 2 "KOI8-R" (Russian) .IP \(bu 2 "KOI8-U" (Ukrainian) .IP \(bu 2 "Roman8" .RE .RE .LP .IP This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). .TP .BR \-T " [B|I|R]" Select the default typeface (Bold, Italic, or Roman) for printing date/note text. This flag may be specified multiple times within the date file (via "opt") to reset the font style on the fly \(em for example, to print all holidays in Bold. .TP .BR \-W " [left|center|right]" Specify the horizontal alignment of the month/year heading (left, center, right) (for monthly-format calendars only). .PP Any option taking a negative value (e.g. .BR "\-Y \-###") should be specified with no space between the option and the (negative) value to avoid .I pcal interpreting the value as an illegal flag and aborting. For example, use ` .IR "\-Y\-50" ' instead of ` .IR "\-Y\ \-50" ' on your option specification. .PP Any option (except .B \-G and .BR \-O "," for backward-compatibility) 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 .B \-D option alone clears all the defined symbols, the .B \-U option alone has no effect. The .B \- (or .BR "\-\|\-" " as per" System V) argument may be used to disambiguate command lines such as: .IP .B pcal \-t 9 90 .PP This could be written instead as one of the following: .IP .B pcal \-t \- 9 90 .br .B pcal \-t \-\|\- 9 90 .PP If the environment variable .BR PCAL_OPTS is defined, its contents are parsed as a command line. Flags set via .BR PCAL_OPTS override the program defaults, but are overridden by options set via .B opt lines in the configuration file or explicitly on the command line. .\" ------------------------------------------------------------------ .SS Additional Options For Debugging Only The .B \-Z flag is used to print debugging information which is of interest primarily to .I pcal hackers. This flag is a "hidden" flag; it does not appear as part of the usage message. At present, the following options are supported: .RS .LP .IP \(bu 2 -ZD print dates and text as read from date file .IP \(bu 2 -ZF print date file search paths .IP \(bu 2 -ZM print moon phases and identify quarters .IP \(bu 2 -ZO print option flags and where set .IP \(bu 2 -ZP print "preprocessor" debug info .IP \(bu 2 -ZT print dates and text as written to output file .IP \(bu 2 -Z turn off all debugging info .RE .LP The subflags may be combined: e.g. "-ZDF" is equivalent to "-ZD -ZF". All of the aforementioned debugging information is written to stderr. .\" ------------------------------------------------------------------ .SH CAVEATS .IP \(bu 2 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: .PP .ft CW .nf .ne 7 January 1990 S M Tu W Th F S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 .fi .ft .IP \ 2 If the configuration file looked like this: .PP .ft CW .nf workday on_or_before all 15 payday 3rd Mon in Jan* MLK day .fi .ft .IP \ 2 \&\.\.\. then .I pcal would mark the 15th as ``payday'' since at that point in the configuration 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 .I pcal would work as intended, marking instead the 12th as ``payday''. .IP 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. .PP .IP \(bu 2 Only the positive ordinals may be used in conjunction with prepositions (e.g. "fourth Sunday before 12/25"). (It could be argued that "last Sunday before 12/25" should be accepted as a synonym for "first Sunday before 12/25", but then what does "last Sunday after 12/25" mean?) .PP .IP \(bu 2 When the .B \-w and .B \-p options are used together, .I pcal revises the y-scale factor in order to use the entire portrait page; therefore, the user should avoid using use the .B \-y option when using both the .B \-w and .B \-p options. Use of the .B \-w option in any case effectively disables the .BR \-m ", " \-M ", " \-j ", and " .B \-J options. .PP .IP \(bu 2 The output of the .B \-c option may be used as input to subsequent runs of .IR pcal . Note, however, that .B opt lines (except for an automatic .BR "opt \-[A|E]" ), comments, ``note'' text, and .BR ifdef 'd-out source will be lost. .PP .IP \(bu 2 The .B \-S option interacts with .BR note{/} ; if used, it should be specified either on the command line or prior to the first .B note line in the date file. .LP .\" ------------------------------------------------------------------ .SH SEE ALSO Website for .I pcal and .I lcal (a lunar calendar generation application): .PP .IP http://pcal.sourceforge.net .PP cal(1), calendar(1). .PP The old, simple Unix/BSD 'calendar' program, which can be used with .I pcal and the '-c' option is part of the BSD Main Utilities ('bsdmainutils') package and is available at the Debian site: .RS .LP .IR http://packages.debian.org/stable/source/bsdmainutils .RE .LP This old program does not seem to be included with most GNU/Linux distributions these days. .PP For more information on PostScript, consult the free, online Adobe book entitled .IR "PostScript Language Reference Manual" , which can be found here (as of Dec 2007): .RS .LP .IR http://partners.adobe.com/public/developer/ps/index_specs.html .RE .LP .SH AUTHORS The original PostScript code to generate the calendars was written by Patrick Wood (Copyright \(co 1987 by Patrick Wood of Pipeline Associates, Inc.), and authorized for modification and redistribution. The calendar file inclusion code was originally written in "bs(1)" by Bill Vogel of AT&T. Patrick's original PostScript was modified and enhanced several times by King Ables, Tim Tessin, Joe Wood, Jeff Mogul, Mark Hanson, and others whose names have regrettably been lost. This C version was originally created by Ken Keirnan of Pacific Bell; additional enhancements by Joseph P. Larson, Ed Hand, Andrew Rogers, Mark Kantrowitz, Joe Brownlee, Andy Fyfe, Steve Grandi, Geoff Kuenning, Stefan Fronzek (1-column HTML output), Bill Bogstad (event deletion capability), and Bill Marr (embedded EPS images, command-line paper size specification, new paper sizes [legal & tabloid], additional character mappings for new languages, and various cleanups). The moon routines were originally written by Jef Poskanzer and Craig Leres, and were incorporated into .I pcal by Richard Dyson. International language support was initially added by Angelo Haritsis. Additional languages were added by Andrew Rogers (Esperanto), Lars Wirzenius (Finnish), Pedro Zorzenon Neto (Portuguese), Joel Fredrikson (Swedish), Volodymyr M. Lisivka (Ukrainian), Neeme Praks (Estonian, Russian, Latvian, Lithuanian), Peter Cernoch (Czech), Ferenc Kruzslicz (Hungarian), Carles Sadurní Anguita (Catalan), Dominik 'Chiron' Derlatka (Polish), Ewald Beekman (Dutch), Claudiu Costin (Romanian), Kenneth Geisshirt (Danish), Zdenko Podobny (Slovak), and Eric Nichols (Hawaiian). pcal-4.11.0/doc/pcal-help.html0000644000175000001440000032315710732024127014212 0ustar wusers PCAL

PCAL

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
CAVEATS
SEE ALSO
AUTHORS

NAME

pcal − generate PostScript (or HTML) calendars

SYNOPSIS

pcal [−e|−f cal] [−o file] [−l −p] [−P [letter | legal | a4 | tabloid]] [−j −J] [−m −M] [−g weekday[−weekday]|all|holiday] [−O weekday[−weekday]|all|holiday] [−G weekday[−weekday]|all|holiday] [−b weekday[−weekday]|all|holiday] [−s [day_numerics_color][/empty_day_box_fill_color]] [−F day] [−A|−E] [−X xtrans] [−Y ytrans] [−x xscale] [−y yscale] [−t [title_font][/size]] [−d [day_font][/size]] [−n [text_font][/size]] [−L footer_str] [−C footer_str] [−R footer_str] [−N notes_str] [−D symbol] [−U symbol] [−B] [−# n] [−S −k −K] [−w] [−I] [−c −H] [−q] [−z time_zone] [−h −u −v] [−a output_language] [−r [mapping] [−T [B|I|R]] [−W [left|center|right]] [month] [year] [nmonths]

DESCRIPTION

Pcal generates PostScript to produce landscape or portrait calendars for any month and year. The arguments month, year, and nmonths, if provided, should be numeric. The month value should be in the range 1 − 12, and the year value should be specified as 1 or 2 digits (in which case it will be interpreted as that year in the current century) or as the full 4-digit year. If no numeric arguments are provided, the calendar for the current month and year will be generated.

If one numeric argument is provided, it is interpreted as the year value, and calendars for the entire year will be generated. Otherwise, nmonths months, starting with month and year, will be generated.

For whole-year calendars (i.e. when the −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 month argument alone is given, it is expected to be the desired year to print, and prints all of the months in the given year. If both month and year are given, then 12 consecutive months are printed starting at the given month and year. If the month, year, and nmonths arguments are all present, printing begins with the given month and year and nmonths months are printed, rounded up to the nearest multiple of 12.

The Date File (Configuration File)
By default, pcal simply prints an empty calendar. Its real power is in its ability to place ‘‘events’’ (and, for monthly-format PostScript calendars, Encapsulated PostScript images [e.g. photos and icons]) in appropriate days on the (PostScript or HTML) calendar, thus allowing the user to create personalized calendars. This is achieved through the use of the ‘‘date file’’, also known as the ‘‘configuration file’’.

The default date/configuration file is expected to be named .calendar (pcal.dat under MS-DOS), or calendar for compatibility with older versions. Pcal will look in several places for such a file. First, if the environment variable PCAL_DIR is defined, pcal searches the directory indicated by that variable. Next, pcal searches the user’s home directory (as specified by the HOME environment variable). If neither PCAL_DIR nor HOME is defined, pcal searches the current directory instead. Finally, if enabled (via the ‘SEARCH_PCAL_DIR’ flag) when pcal was built, the directory where the pcal executable resides will be checked. If no date file is found, an empty calendar is printed; no error is generated.

Alternatively, the name of the date file (and, optionally, the path where it can be found) can be specified using the −f command-line option. See the OPTIONS section for more details.

Every pcal distribution comes with an ’examples’ directory. The ‘pcal-cfg.txt’ file that is located there contains a myriad of examples of settings that can be used in your own configuration file. Please check it out for lots of useful ideas. Furthermore, that directory contains several language/country-specific examples (including holiday and other event definitions) in various ‘calendar_xx.txt’ files, where ‘xx’ represents the 2-letter language code (e.g. ’calendar_de.txt’ is the German example file).

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. Encapsulated PostScript (EPS) images are handled similarly as described in a later subsection.

troff-style escape sequences \fB, \fI, \fP, and \fR may be used to set the font style to Bold, Italic, the previous font style, or Roman respectively. For those more familiar with HTML, <B>, <I>, </B>, and </I> may be used instead to enable/disable Bold or Italic font styles. The font style is reset to Roman after each line break.

Using the ‘include’ pre-processor directive (described in the section entitled ‘Pre-Processor Functionality’, below), other configuration files can be processed from within an existing configuration file. That is, you can ‘nest’ configuration files as needed.

Dates (essentially ‘events’) in the configuration files may be expressed in any of several formats:

<ordinal> <day_spec> in <month_spec>{*} {<text>}

{<ordinal>} <day_spec> <prep> <date_spec>{*} {<text>}

<date_spec>{*} {<text>}

<pre_defined_event>{*} {<text>}

Where:

<month_name>

:= first 3+ characters of name of month, or ‘‘all’’

Note: pcal looks for names of the days of the week prior to names of months when parsing event date specifications. Furthermore, some languages (e.g. French and Finnish) have a month name whose first 3 letters are the same as the first 3 letters of one of the names of the days of the week. Because of this, the specification in such a language of any month name which collides thusly must use 4 or more letters to distinguish it from the name of the day of the week with which it ‘collides’.

<month_spec>

:= <month_name>, or ‘‘year’’

<day_spec>

:= first 3+ characters of name of weekday, ‘‘day’’, ‘‘weekday’’, ‘‘workday’’, ‘‘holiday’’, ‘‘nonweekday’’, ‘‘nonworkday’’, ‘‘nonholiday’’, ‘‘new_moon’’, ‘‘first_quarter’’, ‘‘full_moon’’, or ‘‘last_quarter’’

<ordinal>

:= any ordinal number (‘‘1st’’, ‘‘2nd’’, etc.), ‘‘first’’ ... ‘‘fifth’’, ‘‘last’’, ‘‘odd’’, ‘‘even’’, or ‘‘all’’

<prep>

:= ‘‘on’’, ‘‘before’’, ‘‘preceding’’, ‘‘after’’, ‘‘following’’, ‘‘on_or_before’’ (‘‘oob’’), ‘‘on_or_after’’ (‘‘ooa’’), ‘‘nearest’’, ‘‘nearest_before‘‘, or ‘‘nearest_after‘‘

<pre_defined_event>

:= ‘‘Christmas’’, ‘‘Thanksgiving’’, ‘‘Easter’’, ‘‘Good_Friday’’, ‘‘GEaster’’ (Orthodox Easter), ‘‘Gstgeorge’’ (Orthodox holiday), and ‘‘Gmarcus’’ (Orthodox holiday).

<sep>

:= one or more non-numeric, non-space, non-‘*’ characters

<month>

:= a numeric month (1-12)

<day>

:= day of month (1-31)

<year>

:= a numeric year

<text>

:= the text to be displayed for this event; if the text begins with the constant string ‘‘image:’’, then it is interpreted as a specification of an Encapsulated PostScript (EPS) image rather than as simple text; more information on specifying EPS images is available in a later section of this document

If the −A option (American date formats, the default) is given:

<date_spec>

:= <month_name> <day> | <month><sep><day>{<sep><year>}

If the −E option (European date formats) is given:

<date_spec>

:= <day> <month_name> | <day> <month> | <day><sep><month>{<sep><year>}

The ‘‘Notes’’ box (see below) uses the first of the current month as the default date. All footer strings use the first of the current month in single-month mode and the first of the starting month in whole-year mode.

Examples:

     last Monday in May*         Memorial Day Holiday

     all Fridays in Oct          Status Meeting, 11 AM
     first workday in all        %-B progress report due
     all Fri in all              \fBTime card due,\fP 3 PM
     all Monday in all           Fiscal week %0W
     -2nd workday in all         Schedule for %+B due %+2D
     2nd full_moon in all        Blue Moon
     Fri on_or_before all 15     Pay Day
     even Fridays in year        Pay Day
     183rd day of year           Mid-year (%l days left)

     Tue after first Mon in Nov  Election Day (USA)

     4th Thu in Nov*             Thanksgiving
     Fri after 4th Thu in Nov*   Day after Thanksgiving
     workday nearest 12/25*      Holiday

     12/25/04*                   Christmas     # American
     25.12.04*                   Christmas     # European
     25. 12.*                    Christmas     # European

     Dec 25*                     Christmas     # American
     25 Dec*                     Christmas     # European
     25. Dec*                    Christmas     # European


     Fri on all 13               Avoid black cats!   # ’Friday the 13th’

Any non-numeric character may separate numeric dates. Holidays may be flagged by following the date immediately with ‘*’ as in the examples above; this will cause the date numerics to be printed in the color specified by the −s option (default = gray) and will cause the associated text (on monthly-format calendars) to be placed adjacent to the numeric date in the day box rather than below the numeric date (as is done for all non-holiday events). ‘‘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. ‘‘Nearest’’ attempts to match the specified date; if that fails, it tries the day after, then the day before, then two days after, two days before, and so forth until a match occurs.

Wildcard day names are also provided. The keyword ‘‘weekday’’ applies to any days which are normally printed in "logical black" - the predominant day color - 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 CAVEATS below for important notes on using these keywords. Moon phases may also appear as wildcards; ‘‘nm’’ is accepted as a synonym for ‘‘new_moon’’, ‘‘1q’’ and ‘‘fq’’ for ‘‘first_quarter’’, ‘‘fm’’ for ‘‘full_moon’’, ‘‘3q’’ for ‘‘third_quarter’’, and ‘‘lq’’ for ‘‘last_quarter’’.

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 (e.g. 100th). Negative ordinal numbers may even be used. For example, ‘‘−2nd’’ means ‘‘next to last’’.

‘‘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.

‘‘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.

‘‘Nearest’’, ‘‘nearest_before’’, and ‘‘nearest_after’’ refer to the nearest weekday or wildcard day with respect to the specified date. ‘‘Nearest_before’’ and ‘‘nearest_after’’ allow the user to specify how pcal is to disambiguate between two dates that are equally near: e.g., ‘‘nonweekday nearest_before [Wed.] 9/25/96’’ refers to Sunday, 9/22 while ‘‘nonweekday nearest_after 9/25/96’’ refers to Saturday, 9/28. (Note that ‘‘nearest_before’’ and ‘‘nearest_after’’ are equivalent to ‘‘nearest’’ when no such ambiguity exists: e.g., ‘‘nonweekday nearest_before [Thu.] 9/26/96’’ refers to Saturday, 9/28.)

Text in the date file may use C-like escape sequences (i.e. a ‘\’ followed by a character, 1 − 3 octal digits, or ‘x’ followed by 1 − 2 hexadecimal digits). Escaped whitespace (including newline ) and the standard ANSI character escapes (‘\a’, ‘\b’, ‘\f’, ‘\n’, ‘\r’, ‘\t’, ‘\v’) are all replaced by a single blank.

The HTML special characters ‘&lt;’ ‘&gt;’ ‘&quot;’ ‘&amp;’ ‘&nbsp;’ and ‘&#NNN;’ (NNN = any three decimal digits) are also supported. These will be propagated intact (be sure to escape the ‘#’ in ‘&#NNN;’) if the output is specified as HTML (see the −H flag); otherwise they will be converted to their ASCII equivalents. This allows a common date file to be used regardless of whether the desired output format is HTML, PostScript, or Un*x calendar(1) (see the −c flag) input.

Lines in the configuration file consisting of year #### (where #### 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.

Lines in the configuration file consisting of year all (or, alternatively, year *) direct pcal to wildcard following entries against every applicable year. This assumes that the following entries do not contain a year; any date entries containing year information (or an explicit year #### entry) will set the remembered year to that year.

Lines in the configuration file consisting of opt <options> can be used to override the defaults for any command-line options except −c, −e, −f, −h, −H, −u, −v, −D, and −U. Any options specified in this manner are, in turn, overridden by those specified explicitly on the command line.

Lines in the configuration file consisting of note{/<number>} <month> can be used to place notes regarding the entire month in one of the unused blocks of the calendar. The <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. <number> is an optional positive or negative number specifying the empty box where the associated text is to be placed. If positive, pcal counts forward from the first empty box; if negative, pcal counts backward from the last empty box. Thus, ‘‘note/1’’ places the associated text in the first empty box; note/-3 in the third-to-last. The default is -1 if no <number> is given (last empty box, immediately preceding the small calendars on the bottom row; cf. −S, −k, and −K, below). You can place several notes in the same box. You can also use more than 1 box for the various monthly notes.

Lines in the configuration file consisting of input-language XX (where XX is the 2-letter specification for any of the supported languages) can be used to set the language used for interpretation of the month names and day-of-week names for the remaining event entries. This option may be specified more than once, as needed, if the language used to describe events changes within the file. For backwards compatibility, the default value for ‘input language’ if this directive is never used is ’en’ (English). Note that this directive is distinct from the specification of ’output language’ as accomplished with the −a option.

Comments are supported in the configuration file. Any characters following a ‘#’ character are ignored, through the end of that line, unless the ‘#’ character is escaped by ‘\’.

Deleting Events
By prepending the ‘delete’ keyword to an event specification, one or more events may be deleted from a set of previously-specified events.

For example, the following lines might appear in the date file:

all Friday in all Poker game
delete first Friday in all Poker game

This results in an event labeled ‘Poker game’ on every Friday except the first Friday of the month. If you delete an entry which is marked as a holiday, the ‘holiday’ flag for that day will be recalculated. Any ‘delete’ entries which don’t match any pre-existing entries are silently ignored.

Format Specifiers
Pcal
allows format specifiers in both the event text and footer strings (see the −L, −C, −R, and −N options below). Each format specifier will be replaced by a corresponding string as outlined in the following table:

%a

abbreviated weekday

%A

full weekday

%b

abbreviated month name

%B

full month name

%d

day of month (1-31)

%j

day of year (1-366)

%l

days left in year (0-365)

%m

month (1-12)

%U

week number (0-53)

%W

week number (0-53)

%u

week number (1-54)

%w

week number (1-54)

%y

year w/o century (00-99)

%Y

year w/century

%%

‘%’ character

%o

print number as ordinal

%0

print number with leading zeroes

%+

use following month or year

%−

use previous month or year

%{+N}[DWMY]

adjust date by +N days/weeks/months/years

%{−N}[DWMY]

adjust date by −N days/weeks/months/years

Most of these are derived from the ANSI C strftime() function, but the %[louwMD] and %[o0+−] format specifiers are specific to pcal.

The %u specifier considers the week containing 1/1 (Jan 1st) as week 1 and the following logical Sunday (the first day of the week as printed; cf. the −F option below) as the start of week 2; %U considers the first logical Sunday as the first day of week 1. %w and %W behave like %u and %U respectively, but use the first logical Monday instead. Note that %w has a different meaning from strftime().

The %o format specifier prints a number as an ordinal, with the appropriate suffix (‘‘st’’, ‘‘nd’’, ‘‘rd’’, or ‘‘th’’ in English) appended. For example, %od prints the day of the month as ‘‘1st’’, ‘‘2nd’’, ‘‘3rd’’, etc.

Unlike strftime(), pcal defaults to printing numbers (except %y) without leading zeroes. If leading zeroes are desired, the ‘0’ prefix may be used. For example, %0j prints the first day of year as ‘‘001’’.

The %+ and %− format specifiers direct pcal to substitute the following/previous month/year in the following [bBmyY] specifier. For example, %+B prints the name of the next month.

The %{[+−]N}[DWMY] format specifiers do not print anything, but instead adjust the working date by ± Ndays (D), weeks (W), months (M), or years (Y). Subsequent format specifiers use the adjusted date instead of the current date. For example, %+1M %B %Y adjusts the date forward by one month and then prints the resulting month and year (‘‘January 1992’’ in December, 1991); %−2W %b %d adjusts the date backward by two weeks and prints the resulting month and day (‘‘Jul 26’’ on August 9).

Such date adjustments are normally cumulative; for example, %+1Y%−1D adjusts the date forward by one year and then backward by one day. If %D or %M is specified alone (or if N is zero), pcal restores the original date. Note that %M has a different meaning to the strftime() function.

Here’s a common, useful example of an event entry for the pcal date file which combines the ability to adjust working dates and the ability to display ordinals. This particular example is used to display text on the birthday of a person born in 1991:

May 10 Eric’s %-1991Y%oY Birthday

That entry would result in the following text being displayed on May 10, 2005:

Eric’s 14th Birthday

Encapsulated PostScript (EPS) Images
For monthly PostScript calendars only, pcal supports the embedding of one or more EPS images (photos, icons, etc) into any given day of the month. (EPS image specifications in the pcal date file are ignored for yearly PostScript calendars and for all HTML calendars.)

In order to associate an image with a given event, you must add one or more entries to the date file. The event date is specified exactly as described previously for simple event text specification lines. However, instead of specifying the text associated with the event, you instead specify the EPS image filename and some additional parameters in the following format:

     image:<EPS-image-filename> <x-scale> <y-scale> <x-delta> <y-delta>

Where:

<EPS-image-filename>

is the filename (which can include a path) of the Encapsulated PostScript image. Note: The EPS image filename must be preceded by the constant text ‘image:’ in order to distinguish an EPS image specification from an ordinary event text specification.

<x-scale>

is a scaling factor in the horizontal dimension for the EPS image. A value of 1.0 is nominal (i.e. no change to image scale). Values between 0.0 and 1.0 shrink the image in the horizontal dimension while values over 1.0 expand the image in the horizontal dimension. Generally speaking, only positive values should be used. However, in the rare case that you find that your EPS image needs to be flipped about the vertical axis (i.e. left to right), you can use a negative value to achieve this without having to tweak the actual PostScript content within the EPS image file. Use of a negative value will undoubtedly necessitate a corresponding change to the <x-delta> parameter to account for the image’s relocated position that occurs when it gets flipped "left-to-right".

<y-scale>

is a scaling factor in the vertical dimension for the EPS image. Values between 0.0 and 1.0 shrink the image in the vertical dimension while values over 1.0 expand the image in the vertical dimension. Note that a negative value for this parameter can be useful in the less-than-rare case that you find that your EPS image needs to be flipped about the horizontal axis (i.e. top to bottom). In such cases, you can use a negative <y-scale> value to achieve this without having to tweak the actual PostScript content within the EPS image file. Use of a negative value will undoubtedly necessitate a corresponding change to the <y-delta> parameter to account for the image’s relocated position that occurs when it gets flipped "upside down".

<x-delta>

:= a horizontal adjustment in typographic ‘points’ (i.e. 72nds of an inch) for the positioning of the EPS image. With offsets of 0 for X and Y, the image will be printed at the extreme left edge of the box for that day, just under the numerics for that day. Positive values move the image to the right and negative values move the image to the left.

<y-delta>

:= a vertical adjustment in typographic ‘points’ (i.e. 72nds of an inch) for the positioning of the EPS image. With offsets of 0 for X and Y, the image will be printed at the extreme left edge of the box for that day, just under the numerics for that day. Positive values move the image up and negative values move the image down.

Here’s an example of a line from the date file that associates an EPS image with an event:

     4th Thu in Nov*   Thanksgiving
     4th Thu in Nov*   image:/eps-path/turkey.eps 1.0 1.0 0 0

You can place as many images as you want on a single day of the month by specifying repeated lines in the date file. For example, these lines put icons of George Washington and Abraham Lincoln on the day of the U.S. ‘‘Presidents’ Day’’ holiday, along with the event text:

     3rd Monday in Feb*   Presidents’ Day
     3rd Monday in Feb*   image:/eps-path/washington.eps 0.08 0.08 8 0
     3rd Monday in Feb*   image:/eps-path/lincoln.eps 0.22 0.22 48 0

Note that the icon for Lincoln is shifted to the right by 48 typographic points so as not to overlay the first icon.

The pcal releases come with a single EPS sample file (’eps/recycle.eps’) of the ubiquitous ’recycle’ icon (3 green arrows in a triangular shape). Such an image might be used with configuration file settings like this:

     second Sat in all RECYCLE!
     second Sat in all image:/eps-path/recycle.eps 0.039 0.039 34 -9

In cases where you’re displaying non-holiday event text (e.g. someone’s birthday) and an EPS image, you’ll often need to use a negative ‘Y-delta’ value on the EPS image specification line, in order to shift the image down so that it doesn’t cover the event text, which appears just below the day’s numerics for non-holiday events. (Text for holiday events appears higher up, to the right of the day’s numerics, so there’s usually no collision with the EPS image.)

Note: Unfortunately, most EPS images cannot be used directly by pcal.

Depending on the EPS image used and how it was created, you may have to remove or comment out some or all of the PostScript ‘translate’ commands, in order to avoid the use of illogical X-delta and Y-delta values when specifying the EPS image in your pcal date file. Most programs that generate EPS output (either directly or via conversion from some other graphic format) seem to have these ‘translate’ commands relatively early in the EPS file.

It may take some experimentation to get it just right. Preview the pcal output using a PostScript viewer as you tweak the PostScript commands in the EPS image file and/or the event entry in the pcal date file.

Note: Depending upon what application you use to preview PostScript content, the monthly calendars may not show any embedded EPS images. Here’s a rundown of some popular PostScript-viewing applications and whether they correctly display the embedded EPS images:

gv (version 3.5.8) -- EPS images appear fine

ggv (versions 2.4.0.1 and 2.6.1) -- EPS images appear fine

older kghostview (versions 0.13.2 [KDE 3.1.4] and 0.2.0 [KDE 3.2.3 and 3.3.2]) -- EPS images DO NOT APPEAR!

newer kghostview (version 0.2.0 [KDE 3.4.2 and 3.5.4]) -- EPS images appear fine

For converting non-EPS images (e.g. photos) to EPS format, one can use the graphical GNU Image Manipulation Program, a.k.a. ‘The GIMP’:

http://www.gimp.org

For icons/images in WMF format (which are popular in various 3rd-party, legacy-OS, commercial calendar programs), the ‘libwmf’/‘wmf2eps’ library/utility is useful for generating pcal-capable EPS images. It can be found at this site:

http://wvware.sourceforge.net/libwmf.html

For icons/images in SVG format, the ImageMagick ‘convert’ utility is sometimes useful for generating pcal-capable EPS images. This suite of utilities (which includes other useful ImageMagick utilities like ‘display’ and ‘identify’) may already be available on your Linux distribution. If not, it can be found at this site:

http://www.imagemagick.org

For cases where ImageMagick’s ‘convert’ utility fails to properly convert SVG-format images to EPS format, you can try the method of converting the SVG image into an intermediate format (e.g. PNG) using the ‘rsvg’ utility. This utility may already be available on your Linux distribution. If not, it can be found at this site:

http://librsvg.sourceforge.net/

From the PNG format, the image can often then be successfully converted to EPS format, using the above-mentioned ImageMagick ‘convert’ utility.

The Open Clip Art Library is a good source of freely-usable images (many of which are in SVG format) for decorating your events:

http://www.openclipart.org

Note: The EPS image content is not generated in the PostScript output -- only a reference to the EPS image filename is generated. From a practical standpoint, this means that normally you’ll need to print/preview the PostScript output of pcal from the same computer/setup as that which was used to run pcal in the first place. If you want to generate a calendar with embedded EPS images that will later be printed/viewed on another machine which does not have access to those EPS images, you’ll need to run the output through a pre-processor which will put the EPS image content into the PostScript output file. For example, assuming your initial calendar output was generated to a file named ‘pcal.ps’, on most GNU/Linux systems you could run this command, which uses the popular ‘Ghostscript’ interpreter:

gs -r300x300 -dBATCH -dNOPAUSE -sDEVICE=pswrite -sOutputFile=out.ps pcal.ps

This would generate a PostScript file named ‘out.ps’, at 300x300 dpi resolution, which has the actual EPS image content embedded within, allowing you to transport the ‘out.ps’ file to another computer for viewing/printing. Of course, the new file is substantially larger, but it’s portable. Furthermore, the EPS images will be viewable even in PostScript-viewing applications (see above) which don’t properly support the display of embedded (by filename only) EPS images.

Pre-Processor Functionality
Pcal
supports rudimentary cpp-like functionality in the date file, allowing the following constructs:

define | undef

if{{n}def} ... {elif ...}* {else ...} endif

include

Note that these are not preceded by ‘#’ as they are in C.

Symbol names defined using these keywords (or via the -D option) are case-insensitive. It is not an error to undef an undefined symbol, nor to define a previously-defined one.

A symbol can be defined with just a name (e.g. ‘‘define MY_SYM’’) or it can take on a value (e.g. ‘‘define MY_SYM SOME_VALUE’’). Use of symbol values is convenient for defining a starting date then using that symbol to reference that starting date in one or more events. For example, these definitions in the date file might be useful:

     define semester_start 8/23   # Beginning of semester
     semester_start                 Class Start
     7th  day after semester_start  1st Quiz
     14th day after semester_start  2nd Quiz
     undef semester_start

Be aware that the substitution of symbol values for symbol names is not robust, so it’s wise to use a symbol name that’s unlikely to occur in any of your other event text. In other words, if you defined the ‘semester_start’ symbol in the example above as merely ‘start’, then you’d get the undesired effect of having the text ‘Class 8/23’ in your calendar on that day instead of ‘Class Start’! The use of ‘undef semester_start’ in the above example is optional and is really only useful to prevent any unwanted symbol substitutions later on, which probably won’t happen unless you poorly choose your symbol name to begin with.

An ifdef alone is always false; an ifndef alone is always true. if is accepted as a synonym for ifdef.

The name of the file in the 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. If the string "%y" appears in the file name, it is replaced by the last two digits of the current year or, if "year all" is in effect, is expanded to all applicable years. Pcal is smart enough to translate ~/ to the user’s home directory.

Pcal normally terminates immediately if the file specified in an include directive does not exist. An alternate form of the directive, include?, directs pcal to continue silently if the file does not exist or cannot be opened.

In addition to pre-processing keywords, pcal also accepts boolean expressions in if{{n}def} and elif directives. These expressions consist of symbol names joined by the boolean operators !, &, ^, and |, in order of precedence, high to low. Parentheses may be used to alter the precedence. The synonyms && and || are accepted for & and |. A symbol name evaluates to true if currently defined, false if not; thus:

     ifdef A | B | C

...is true if any of the symbols A, B, and C is defined, and:

     ifdef A & B & C

...is true if they all are. Note that ifndef <expr> is equivalent to ifdef !( <expr> ).

The Moon File
If a file of the name .moon## (moon##.dat under MS-DOS), where ## is the last two digits of the calendar year, exists in the same directory as the date file (or in the directory where pcal resides), pcal uses the information contained within to calculate the phase of the moon. If a) no such file exists, b) the −e flag (do not use a date file) is specified, or c) the −z flag (specify time zone) is specified, then pcal uses an algorithm to calculate the phase of the moon.

Entries in the moon file must conform to the following syntax:

If the −A option (American date formats, the default) is given:

     <quarter> <month><sep><day> {<hour><sep><min>}

If the −E option (European date formats) is given:

     <quarter> <day><sep><month> {<hour><sep><min>}

Where:

<quarter> := ‘‘nm’’, ‘‘fq’’ or ‘‘1q’’, ‘‘fm’’, ‘‘3q’’ or ‘‘lq’’ (new moon,

first quarter, full moon, last quarter)
<hour>

:= number 0-23 (24-hour clock)
<min>

:= number 0-59

This file must contain entries for all quarter moons in the year, in chronological order; if any errors are encountered, pcal will revert to using its default algorithm.

As in the date file, comments start with ‘#’ and run through the end of the given line.

The moon file may optionally contain an opt −A or opt −E line to specify the format of its own date entries independently of the format used in the date file. No other flags are legal in the moon file.

Generating PostScript Calendars Via A Web Browser Interface
PostScript-format pcal calendars can be generated and viewed from a web browser interface.

Note: This is not to be confused with the ability to generate non-PostScript, HTML-format (using the −H command-line option) calendars, which is a different capability entirely.

Pcal comes with 4 files that provide this ability: ‘pcal.cgi’ (a Bourne shell script), ‘pcal.pl’ (a Perl equivalent of ‘pcal.cgi’), ‘pcal.html’, and ‘pcalw.html’.

The CGI file (either ‘pcal.cgi’ or ‘pcal.pl’) must be edited before using it. Change the definition for ‘pcal=’ (Bourne shell script) or ‘my $PCAL =’ (Perl script) to point to the location of the pcal executable file. Change the definition for ‘file=’ (Bourne shell script) or ‘my $FILE =’ (Perl script) to point to the location of the pcal ‘date file’ (e.g. ‘.calendar’), which contains the options for running pcal. Finally, copy the ‘pcal.cgi’ (or ‘pcal.pl’) file to the location where your web server expects to find such files (e.g. ‘/var/www/cgi-bin/’).

The ‘pcal.html’ and ‘pcalw.html’ files must also be edited. Each one has a line like this:

<FORM ACTION="http://yourpath/cgi-bin/pcal.cgi" METHOD=GET>

That line must be edited to point to the host and location of your CGI script file (‘pcal.cgi’ or ‘pcal.pl’).

Once that’s done, point your web browser to the ‘pcal.html’ or ‘pcalw.html’ file to generate monthly/yearly PostScript calendars for viewing within your web browser.

Note: Depending upon what application your web browser spawns to preview PostScript content, the monthly calendars generated via this web browser interface may not show any embedded EPS images. For a rundown of some popular PostScript-viewing applications and whether they correctly display the embedded EPS images, see the section (above) entitled ‘Encapsulated PostScript (EPS) Images’.

OPTIONS

−e

Prints an empty calendar. Do not print entries from a .calendar file even if one exists.

−f cal

Directs pcal to use the file name cal as the input file in place of the default .calendar file. Note that the search rules are different when −f is used. If cal is an absolute file name (i.e. starting with a ‘/’), then pcal attempts to open only that file. Otherwise, pcal looks for cal in the current directory, then in the directory indicated by the environment variable PCAL_DIR (if defined), and finally, if enabled (via the ‘SEARCH_PCAL_DIR’ flag) when pcal was built, in the directory where the pcal executable resides. If the given cal file is not found, an error results.

−o file

Directs pcal to write the output to file instead of to stdout.

−l

Causes the output to be in landscape mode (default).

Pcal predefines the symbol ‘ORIENTATION_LANDSCAPE’ whenever ‘landscape’ page orientation is enabled. This can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on the page orientation.

−p

Causes the output to be in portrait mode.

Pcal predefines the symbol ‘ORIENTATION_PORTRAIT’ whenever ‘portrait’ page orientation is enabled. This can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on the page orientation.

−P

Selects the paper size. The following sizes are supported:

letter — 8.5 x 11.0 inches

legal — 8.5 x 14.0 inches

a4 — 210 x 297 mm

tabloid — 11.0 x 17.0 inches

Pcal predefines one of the following symbols based on the current paper size:

PAPERSIZE_LETTER

PAPERSIZE_LEGAL

PAPERSIZE_A4

PAPERSIZE_TABLOID

These symbol definitions can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on paper size.

−j

Causes the Julian date (day of year) to be printed in each calendar box.

−J

Causes the Julian date and the number of days remaining in the year to be printed in each calendar box.

−m

Causes moon icons to be printed on dates corresponding to new, half, and full moons (the default is that no moons are printed).

−M

Causes moon icons to be printed on all dates (the default is that no moons are printed).

−g day1[−day2] | all | holiday

Causes all dates falling on weekday day1 (through day2 if specified) to be printed in the ‘day numerics color’ (i.e. the color specified by the −s option [default = gray]); −g all causes all weekdays (other than holidays) to be printed in the ‘day numerics color’; −g holiday causes all holidays to be printed in ‘day numerics color’. day1 and day2 may wrap around weekends; for example, −g fri−sun causes Fridays, Saturdays, and Sundays to be printed in the ‘day numerics color’.

−O day1[−day2] | all | holiday

Similar to −g, but the selected days will be printed as outlined characters, using the ‘day numerics color’.

−G day1[−day2] | all | holiday

Similar to −g, but the selected days will be printed in the ‘day numerics color’, outlined in black.

−b day1[−day2] | all | holiday

Similar to — you guessed it — −g, but the selected days will be printed in black. Since black is the default for weekdays, −b is primarily used to overriding other flags (e.g., −g all −b sat-sun ).

Note:

The default for the above options is to print Saturdays, Sundays, and holidays in the ‘day numerics color’ and all other days in black. For backward compatibility with earlier versions of pcal, −O and −G alone change all non-black days to the specified color.

−s [day_numerics_color][/empty_day_box_fill_color]

Overrides the default value(s) for the color of the numerics for each day and/or the color of the fill used on boxes for ’empty’ days. Note: This option only applies to PostScript-format calendars, not to HTML-format calendars. These values may be set independently of each other. For use with non-color printers, these values should be in the range 0.0 (black) through 1.0 (white). The default values are 0.8 for day numerics and 0.9 for empty day boxes. For use with color printers, these values may optionally be specified as a set of red:green:blue (RGB) values, each of which must in the range 0.0 through 1.0. At least one ‘:’ must be present for these values to be recognized as RGB colors; omitted values are set to 0.0.

This option may also be set semi-permanently by altering the makefile (‘Makefile’ for most environments, ’Makefile.DOS’ for MS-DOS).

−F day

Selects weekday day as the first day of the week. The given day will appear in the left-most column of the calendar. day may be specified either as a weekday name or, optionally, as a number in the range 0 (Sunday) through 6 (Saturday).

This option may also be set semi-permanently by altering the makefile (‘Makefile’ for most environments, ’Makefile.DOS’ for MS-DOS).

−A

Directs pcal to use American date conventions ( mm/dd{/yy} and month dd ) when parsing the date file. This is the default.

This option may also be set semi-permanently by altering the makefile (‘Makefile’ for most environments, ’Makefile.DOS’ for MS-DOS).

−E

Directs pcal to use European date conventions ( dd/mm{/yy} and dd month ) when parsing the date file.

This option may also be set semi-permanently by altering the makefile (‘Makefile’ for most environments, ’Makefile.DOS’ for MS-DOS).

−X xtrans

Specifies the x-axis translation value for positioning the output on the page. Positive values shift the output to the right. Negative values shift the output to the left.

−Y ytrans

Specifies the y-axis translation value for positioning the output on the page. Positive values shift the output up. Negative values shift the output down.

−x xscale

Specifies the x-axis scaling factor for the calendar size.

−y yscale

Specifies the y-axis scaling factor for the calendar size.

−t [title_font][/size]

Specifies the name of a font to use for all the calendar heading text:

the month name and year at the top of the calendar (for monthly-format calendars) or at the top of each month (for yearly-format calendars and for the small previous/next-month calendars [if enabled] on monthly-format calendars)

the day-of-week names

the footer strings (if any)

the ‘‘Notes’’ box heading (if any; for monthly calendars only)

For monthly calendars only, the user may optionally specify the font size, which applies only to the main month/year heading. For example, pcal −t Times-Roman/54 sets the font to Times-Roman and the month/year point size to 54. The font size may also be changed independently: pcal −t /54 changes the point size to 54 without affecting the font name.

Note: For yearly calendars, any specification of font size is ignored.

This option may also be set semi-permanently by altering the makefile (‘Makefile’ for most environments, ’Makefile.DOS’ for MS-DOS).

−d [date_font][/size]

Similar to the −t option, but selects the font and/or size used for the day numerics (the numbers inside the box for each day).

Note: For yearly calendars, any specification of font size is ignored.

This option may also be set semi-permanently by altering the makefile (‘Makefile’ for most environments, ’Makefile.DOS’ for MS-DOS).

−n [text_font][/size]

Similar to the −t and −d options, but selects the font and/or size used for any ‘event’ text associated with each day and for any text in the monthly ‘‘Notes’’ box.

Note: This option applies to monthly calendars only. For yearly calendars, this option does not apply.

This option may also be set semi-permanently by altering the makefile (‘Makefile’ for most environments, ’Makefile.DOS’ for MS-DOS).

−L 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.

−C string

Similar to −L, but causes the accompanying string to be printed as a centered footer. If the −H flag (generate calendar as HTML table) was specified, this string will be used as the title and heading.

−R string

Similar to −L, but causes the accompanying string to be printed as a right-justified footer.

−N string

Causes the accompanying string to be printed as the heading for the "Notes" box. Note, however, that pcal makes no attempt to ensure that it fits.

−D symbol [value]

Defines the named symbol and an optional value to be associated with that symbol, prior to reading the date file.

−U symbol

Un-defines the named symbol prior to reading the date file.

−B

Causes pcal to leave unused calendar day boxes blank as opposed to the default behavior of filling them using the ‘empty day-box fill color’ (i.e. the color specified by the −s option [default = gray]).

−# n

Causes pcal to print n copies (maximum: 100) of each output page.

−S

Causes pcal to suppress printing the small calendars. See the CAVEATS section for further details.

−k

Causes pcal to print the small calendars in the upper left corner (the default is to print them at the lower right).

−K

Causes pcal to print the small calendar for the previous month in the upper left corner and the next month in the lower right (the default is to print both at the lower right).

−w

Causes 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 CAVEATS section for details on the use of this option with other options.

Pcal predefines the symbol whole_year when the −w flag is in effect, allowing directives like ‘ifdef whole_year’ in the configuration file.

−I

Resets all parameters to the program defaults.

−c

Causes pcal to generate a date file suitable for use as input to the Un*x calendar(1) utility. The normal PostScript output is suppressed.

−H

Causes pcal to generate a calendar in HTML table format. The normal PostScript output is suppressed.

The HTML table format does not support moon graphics, Julian date information, ‘day numerics’ color, ‘empty day’ ‘box fill’ color, left or right footer strings (but see the −C flag), alternate fonts/sizes, transformation and scaling factors, or embedded EPS images.

−q

This option is only valid when used in conjunction with the −H (generate HTML-format calendar) option. It generates a yearly-planner style of HTML calendar whereby a single column for each month is used, resulting in table that gives a quicker overview of several months. Since there is less space for text, only the first character of the weekday and the first 5 characters of text from each event for that day are printed. The day numerics for holidays are colored red but the text of the holiday event is not printed. The day numerics are grey for Saturdays and bold black for Sundays.

−z time_zone

Forces pcal to ignore the moon file and to use its internal algorithm for moon phase calculations, adjusting the phase by time_zone hours (where time_zone is expressed in hours west of UTC).

For example, New York residents (USA Eastern time zone) would use ’-z 5’ while on Eastern Standard Time (winter) and ’-z 4’ while on Eastern Daylight Time (summer). People in India would use ’-z-5.5’. Notice that fractional values are allowed.

This option may also be set semi-permanently by altering the makefile (‘Makefile’ for most environments, ’Makefile.DOS’ for MS-DOS).

−h

Causes pcal to write version information, parameter usage message, and full explanation of options and file formats (to stdout) and terminate.

−u

Causes pcal to write version information and parameter usage message (to stdout) and terminate.

−v

Causes pcal to write version information only (to stdout) and terminate.

Pcal predefines the symbol vX_Y_Z, where X_Y_Z denotes the current version of Pcal (e.g. version 4.9.0 predefines the symbol v4_9_0).

−a output_language

Select the output language (for the names of months and days on the calendar).

Currently, the following languages are supported: ca (Catalan), cs (Czech), da (Danish), de (German), el (Greek), en (English), eo (Esperanto), es (Spanish), et (Estonian), fi (Finnish), fr (French), ha (Hawaiian), hu (Hungarian), it (Italian), lt (Lithuanian), lv (Latvian), nl (Dutch), pl (Polish), pt (Portuguese), ro (Romanian), ru (Russian), sk (Slovak), sv (Swedish), and uk (Ukrainian). The default is en.

Note that this option does not specify the ‘input language’, which is the language used to process events in the configuration file (’English’, by default, unless changed with the input-language XX directive). See the section The Date File for more details on specifying the ‘input language’.

Note: In order to display diacritical marks, languages other than English require that the characters be remapped. Normally, no action is required since pcal automatically selects a remapping which is appropriate to the selected language. However, if you want to override the default remapping for a given language, you would use the −r option (e.g. "-r Latin1").

Furthermore, an appropriate font should be selected as needed using the −t option (e.g. "-t some-latin1-font-name"). Any language using the "Latin1" remapping (e.g. French, German, Italian, Spanish, etc) requires an ISO 8859-1 (’Latin1’) font. The Greek language requires an ISO 8859-7 (similar to ELOT-928) font (available from Angelo Haritsis <ah@doc.ic.ac.uk>; also see http://www.hellenic.net/fonts/). Similarly, Russian requires a KOI8-R font while Ukrainian requires a KOI8-U font.

Pcal predefines the symbol lang_XX, where XX is the two-character abbreviation for the selected output language.

−r [mapping]

Specifies an 8-bit character set remapping (encoding) for printing the diacritical marks common to European languages.

Note: This option is not usually needed since pcal will automatically select an appropriate default character encoding (mapping) for the language for which the calendar is being generated.

The value specified for mapping is case-insensitive and may be abbreviated to the point where it is still unique. The value used may be any of the following:

"none" (use built-in character set)

"Latin1" (ISO 8859-1)

"Latin2" (ISO 8859-2)

"Latin3" (ISO 8859-3)

"Latin4" (ISO 8859-4)

"Cyrillic" (ISO 8859-5)

"Greek" (ISO 8859-7)

"Latin5" (ISO 8859-9)

"Latin6" (ISO 8859-10)

"Thai" (ISO 8859-11)

"Latin7" (ISO 8859-13)

"Latin8" (ISO 8859-14)

"Latin9" (ISO 8859-15)

"KOI8-R" (Russian)

"KOI8-U" (Ukrainian)

"Roman8"

This option may also be set semi-permanently by altering the makefile (‘Makefile’ for most environments, ’Makefile.DOS’ for MS-DOS).

−T [B|I|R]

Select the default typeface (Bold, Italic, or Roman) for printing date/note text. This flag may be specified multiple times within the date file (via "opt") to reset the font style on the fly — for example, to print all holidays in Bold.

−W [left|center|right]

Specify the horizontal alignment of the month/year heading (left, center, right) (for monthly-format calendars only).

Any option taking a negative value (e.g. −Y −###) should be specified with no space between the option and the (negative) value to avoid pcal interpreting the value as an illegal flag and aborting. For example, use ‘ −Y−50’ instead of ‘ −Y −50’ on your option specification.

Any option (except −G and −O, for backward-compatibility) 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 −D option alone clears all the defined symbols, the −U option alone has no effect. The (or −− as per System V) argument may be used to disambiguate command lines such as:

pcal −t 9 90

This could be written instead as one of the following:

pcal −t − 9 90
pcal −t −− 9 90

If the environment variable PCAL_OPTS is defined, its contents are parsed as a command line. Flags set via PCAL_OPTS override the program defaults, but are overridden by options set via opt lines in the configuration file or explicitly on the command line.

Additional Options For Debugging Only
The −Z flag is used to print debugging information which is of interest primarily to pcal hackers. This flag is a "hidden" flag; it does not appear as part of the usage message. At present, the following options are supported:

-ZD

print dates and text as read from date file

-ZF

print date file search paths

-ZM

print moon phases and identify quarters

-ZO

print option flags and where set

-ZP

print "preprocessor" debug info

-ZT

print dates and text as written to output file

-Z

turn off all debugging info

The subflags may be combined: e.g. "-ZDF" is equivalent to "-ZD -ZF". All of the aforementioned debugging information is written to stderr.

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:

                   January 1990
                S  M Tu  W Th  F  S
                   1  2  3  4  5  6
                7  8  9 10 11 12 13
               14 15 16 17 18 19 20
               21 22 23 24 25 26 27
               28 29 30 31

  If the configuration file looked like this:

     workday on_or_before all 15   payday
     3rd Mon in Jan*               MLK day

  ... then pcal would mark the 15th as ‘‘payday’’ since at that point in the configuration 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 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.

Only the positive ordinals may be used in conjunction with prepositions (e.g. "fourth Sunday before 12/25"). (It could be argued that "last Sunday before 12/25" should be accepted as a synonym for "first Sunday before 12/25", but then what does "last Sunday after 12/25" mean?)

When the −w and −p options are used together, pcal revises the y-scale factor in order to use the entire portrait page; therefore, the user should avoid using use the −y option when using both the −w and −p options. Use of the −w option in any case effectively disables the −m, −M, −j, and −J options.

The output of the −c option may be used as input to subsequent runs of pcal. Note, however, that opt lines (except for an automatic opt −[A|E]), comments, ‘‘note’’ text, and ifdef’d-out source will be lost.

The −S option interacts with note{/<number>}; if used, it should be specified either on the command line or prior to the first note line in the date file.

SEE ALSO

Website for pcal and lcal (a lunar calendar generation application):

http://pcal.sourceforge.net

cal(1), calendar(1).

The old, simple Unix/BSD ’calendar’ program, which can be used with pcal and the ’-c’ option is part of the BSD Main Utilities (’bsdmainutils’) package and is available at the Debian site:

http://packages.debian.org/stable/source/bsdmainutils

This old program does not seem to be included with most GNU/Linux distributions these days.

For more information on PostScript, consult the free, online Adobe book entitled PostScript Language Reference Manual, which can be found here (as of Dec 2007):

http://partners.adobe.com/public/developer/ps/index_specs.html

AUTHORS

The original PostScript code to generate the calendars was written by Patrick Wood (Copyright © 1987 by Patrick Wood of Pipeline Associates, Inc.), and authorized for modification and redistribution. The calendar file inclusion code was originally written in "bs(1)" by Bill Vogel of AT&T. Patrick’s original PostScript was modified and enhanced several times by King Ables, Tim Tessin, Joe Wood, Jeff Mogul, Mark Hanson, and others whose names have regrettably been lost. This C version was originally created by Ken Keirnan of Pacific Bell; additional enhancements by Joseph P. Larson, Ed Hand, Andrew Rogers, Mark Kantrowitz, Joe Brownlee, Andy Fyfe, Steve Grandi, Geoff Kuenning, Stefan Fronzek (1-column HTML output), Bill Bogstad (event deletion capability), and Bill Marr (embedded EPS images, command-line paper size specification, new paper sizes [legal & tabloid], additional character mappings for new languages, and various cleanups). The moon routines were originally written by Jef Poskanzer and Craig Leres, and were incorporated into pcal by Richard Dyson. International language support was initially added by Angelo Haritsis. Additional languages were added by Andrew Rogers (Esperanto), Lars Wirzenius (Finnish), Pedro Zorzenon Neto (Portuguese), Joel Fredrikson (Swedish), Volodymyr M. Lisivka (Ukrainian), Neeme Praks (Estonian, Russian, Latvian, Lithuanian), Peter Cernoch (Czech), Ferenc Kruzslicz (Hungarian), Carles Sadurní Anguita (Catalan), Dominik ’Chiron’ Derlatka (Polish), Ewald Beekman (Dutch), Claudiu Costin (Romanian), Kenneth Geisshirt (Danish), Zdenko Podobny (Slovak), and Eric Nichols (Hawaiian).


pcal-4.11.0/doc/pcal-help.ps0000644000175000001440000031772310732024125013670 0ustar wusers%!PS-Adobe-3.0 %%Creator: groff version 1.19.2 %%CreationDate: Tue Dec 18 15:06:45 2007 %%DocumentNeededResources: font Times-Roman %%+ font Times-Bold %%+ font Times-Italic %%+ font Courier %%+ font Symbol %%DocumentSuppliedResources: procset grops 1.19 2 %%Pages: 18 %%PageOrder: Ascend %%DocumentMedia: Default 612 792 0 () () %%Orientation: Portrait %%EndComments %%BeginDefaults %%PageMedia: Default %%EndDefaults %%BeginProlog %%BeginResource: procset grops 1.19 2 %!PS-Adobe-3.0 Resource-ProcSet /setpacking where{ pop currentpacking true setpacking }if /grops 120 dict dup begin /SC 32 def /A/show load def /B{0 SC 3 -1 roll widthshow}bind def /C{0 exch ashow}bind def /D{0 exch 0 SC 5 2 roll awidthshow}bind def /E{0 rmoveto show}bind def /F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def /G{0 rmoveto 0 exch ashow}bind def /H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /I{0 exch rmoveto show}bind def /J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def /K{0 exch rmoveto 0 exch ashow}bind def /L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /M{rmoveto show}bind def /N{rmoveto 0 SC 3 -1 roll widthshow}bind def /O{rmoveto 0 exch ashow}bind def /P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def /Q{moveto show}bind def /R{moveto 0 SC 3 -1 roll widthshow}bind def /S{moveto 0 exch ashow}bind def /T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def /SF{ findfont exch [exch dup 0 exch 0 exch neg 0 0]makefont dup setfont [exch/setfont cvx]cvx bind def }bind def /MF{ findfont [5 2 roll 0 3 1 roll neg 0 0]makefont dup setfont [exch/setfont cvx]cvx bind def }bind def /level0 0 def /RES 0 def /PL 0 def /LS 0 def /MANUAL{ statusdict begin/manualfeed true store end }bind def /PLG{ gsave newpath clippath pathbbox grestore exch pop add exch pop }bind def /BP{ /level0 save def 1 setlinecap 1 setlinejoin 72 RES div dup scale LS{ 90 rotate }{ 0 PL translate }ifelse 1 -1 scale }bind def /EP{ level0 restore showpage }def /DA{ newpath arcn stroke }bind def /SN{ transform .25 sub exch .25 sub exch round .25 add exch round .25 add exch itransform }bind def /DL{ SN moveto SN lineto stroke }bind def /DC{ newpath 0 360 arc closepath }bind def /TM matrix def /DE{ TM currentmatrix pop translate scale newpath 0 0 .5 0 360 arc closepath TM setmatrix }bind def /RC/rcurveto load def /RL/rlineto load def /ST/stroke load def /MT/moveto load def /CL/closepath load def /Fr{ setrgbcolor fill }bind def /setcmykcolor where{ pop /Fk{ setcmykcolor fill }bind def }if /Fg{ setgray fill }bind def /FL/fill load def /LW/setlinewidth load def /Cr/setrgbcolor load def /setcmykcolor where{ pop /Ck/setcmykcolor load def }if /Cg/setgray load def /RE{ findfont dup maxlength 1 index/FontName known not{1 add}if dict begin { 1 index/FID ne{def}{pop pop}ifelse }forall /Encoding exch def dup/FontName exch def currentdict end definefont pop }bind def /DEFS 0 def /EBEGIN{ moveto DEFS begin }bind def /EEND/end load def /CNT 0 def /level1 0 def /PBEGIN{ /level1 save def translate div 3 1 roll div exch scale neg exch neg exch translate 0 setgray 0 setlinecap 1 setlinewidth 0 setlinejoin 10 setmiterlimit []0 setdash /setstrokeadjust where{ pop false setstrokeadjust }if /setoverprint where{ pop false setoverprint }if newpath /CNT countdictstack def userdict begin /showpage{}def /setpagedevice{}def }bind def /PEND{ countdictstack CNT sub{end}repeat level1 restore }bind def end def /setpacking where{ pop setpacking }if %%EndResource %%EndProlog %%BeginSetup %%BeginFeature: *PageSize Default << /PageSize [ 612 792 ] /ImagingBBox null >> setpagedevice %%EndFeature %%IncludeResource: font Times-Roman %%IncludeResource: font Times-Bold %%IncludeResource: font Times-Italic %%IncludeResource: font Courier %%IncludeResource: font Symbol grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron /scaron/zcaron/Ydieresis/trademark/quotesingle/Euro/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent /ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen /period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon /semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O /P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex /underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y /z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft /guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl /endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut /dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash /quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen /brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft /logicalnot/minus/registered/macron/degree/plusminus/twosuperior /threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior /ordmasculine/guilsinglright/onequarter/onehalf/threequarters /questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE /Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn /germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla /egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis /eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash /ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def /Courier@0 ENC0/Courier RE/Times-Italic@0 ENC0/Times-Italic RE /Times-Bold@0 ENC0/Times-Bold RE/Times-Roman@0 ENC0/Times-Roman RE %%EndSetup %%Page: 1 1 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F/F1 10.95/Times-Bold@0 SF -.219(NA)72 84 S(ME) .219 E F0(pcal \255 generate PostScript \(or HTML\) calendars)108 96 Q F1(SYNOPSIS)72 112.8 Q/F2 10/Times-Bold@0 SF(pcal)108 124.8 Q F0([)2.5 E F2A F0(|)A F2A/F3 10/Times-Italic@0 SF(cal)2.5 E F0 2.5(][) 1.666 G F2-2.5 E F3(\214le)2.5 E F0 2.5(][)1.666 G F2-2.5 E F0(|)2.5 E F22.5 E F0 2.5(][)C F2-2.5 E F0([letter | le)2.5 E -.05(ga)-.15 G 2.5(l|a).05 G 2.5(4|t)-2.5 G(abloid]] [)-2.5 E F2 A F0(|)2.5 E F22.5 E F0 2.5(][)C F2-2.5 E F0(|)2.5 E F2 2.5 E F0 2.5(][)C F2-2.5 E F3(week-)2.5 E(day)133 136.8 Q F0 ([)A F3(\255weekday)A F0(]|all|holiday] [)A F2A F3(weekday)2.5 E F0([)A F3(\255weekday)A F0(]|all|holiday] [)A F2A F3(weekday)2.5 E F0([)A F3(\255weekday)A F0(]|all|holi-)A(day] [)133 148.8 Q F2A F3 (weekday)2.5 E F0([)A F3(\255weekday)A F0(]|all|holiday] [)A F2A F0([)2.5 E F3(day_numerics_color)A F0(][/)A F3 (empty_day_box_\214ll_color)A F0(]])1.666 E([)133 160.8 Q F2A F3 (day)2.5 E F0 2.5(][)1.666 G F2-2.5 E F0(|)A F2A F0 2.5(][)C F2-2.5 E F3(xtr)2.5 E(ans)-.15 E F0 2.5(][)1.666 G F2-2.5 E F3(ytr)2.5 E(ans)-.15 E F0 2.5(][)1.666 G F2-2.5 E F3(xscale)2.5 E F0 2.5(][)1.666 G F2-2.5 E F3(yscale)2.5 E F0 2.5(][)1.666 G F2 -2.5 E F0([)2.5 E F3(title_font)A F0(][/)A F3(size)A F0(]])1.666 E ([)133 172.8 Q F2A F0([)2.5 E F3(day_font)A F0(][/)A F3(size)A F0 (]] [)1.666 E F2A F0([)2.5 E F3(te)A(xt_font)-.2 E F0(][/)A F3 (size)A F0(]] [)1.666 E F2A F3(footer_str)2.5 E F0 2.5(][)1.666 G F2-2.5 E F3(footer_str)2.5 E F0 2.5(][)1.666 G F2-2.5 E F3 (footer_str)2.5 E F0(])1.666 E([)133 184.8 Q F2A F3(notes_str)2.5 E F0 2.5(][)1.666 G F2-2.5 E F3(symbol)2.5 E F0 2.5(][)1.666 G F2 -2.5 E F3(symbol)2.5 E F0 2.5(][)1.666 G F2-2.5 E F0 2.5(][) C F2-2.5 E F3(n)2.5 E F0 2.5(][)1.666 G F2-2.5 E F0(|)2.5 E F22.5 E F0(|)2.5 E F22.5 E F0 2.5(][)C F2-2.5 E F0 2.5 (][)C F2-2.5 E F0 2.5(][)C F2-2.5 E F0(|)2.5 E F22.5 E F0 2.5(][)C F2-2.5 E F0(])A([)133 196.8 Q F2A F3(time_zone) 2.5 E F0 2.5(][)1.666 G F2-2.5 E F0(|)2.5 E F22.5 E F0(|)2.5 E F22.5 E F0 2.5(][)C F2-2.5 E F3(output_langua)2.5 E -.1 (ge)-.1 G F0 2.5(][)1.766 G F2-2.5 E F0([)2.5 E F3(mapping)A F0 2.5(][)C F2-2.5 E F0([B|I|R]] [)2.5 E F2A F0([left|cen-)2.5 E(ter|right]] [month] [year] [nmonths])133 208.8 Q F1(DESCRIPTION)72 249.6 Q F3(Pcal)108.5 261.6 Q F0 (generates PostScript to produce landscape or portrait calendars for an) 3.01 E 2.5(ym)-.15 G(onth and year)-2.5 E 5(.T)-.55 G(he ar)-5 E(gu-) -.18 E(ments)108 273.6 Q F2(month)2.5 E F0(,)A F2 -.1(ye)2.5 G(ar).1 E F0 2.5(,a)C(nd)-2.5 E F2(nmonths)2.5 E F0 2.5(,i)C 2.5(fp)-2.5 G(ro)-2.5 E(vided, should be numeric.)-.15 E(The)5 E F2(month)2.5 E F0 -.25(va)2.5 G(lue should be in the).25 E(range 1 \255 12, and the)108 285.6 Q F2 -.1 (ye)2.5 G(ar).1 E F0 -.25(va)2.5 G(lue should be speci\214ed as 1 or 2 \ digits \(in which case it will be interpreted as).25 E (that year in the current century\) or as the full 4-digit year)108 297.6 Q 5(.I)-.55 G 2.5(fn)-5 G 2.5(on)-2.5 G(umeric ar)-2.5 E (guments are pro)-.18 E(vided, the calen-)-.15 E (dar for the current month and year will be generated.)108 309.6 Q (If one numeric ar)108 326.4 Q(gument is pro)-.18 E (vided, it is interpreted as the)-.15 E F2 -.1(ye)2.5 G(ar).1 E F0 -.25 (va)2.5 G(lue, and calendars for the entire year).25 E (will be generated.)108 338.4 Q(Otherwise,)5 E F2(nmonths)2.5 E F0 (months, starting with)2.5 E F2(month)2.5 E F0(and)2.5 E F2 -.1(ye)2.5 G (ar).1 E F0 2.5(,w)C(ill be generated.)-2.5 E -.15(Fo)108 355.2 S 2.5 (rw).15 G(hole-year calendars \(i.e. when the)-2.5 E F22.5 E F0 (option is gi)2.5 E -.15(ve)-.25 G(n\), the command line ar).15 E (guments are interpreted)-.18 E(some)108 367.2 Q(what dif)-.25 E (ferently)-.25 E 5(.B)-.65 G 2.5(yd)-5 G(ef)-2.5 E(ault, all months in \ the current year are printed, starting with January)-.1 E 5(.I)-.65 G 2.5(ft)-5 G(he)-2.5 E F2(month)108 379.2 Q F0(ar)2.5 E (gument alone is gi)-.18 E -.15(ve)-.25 G(n, it is e).15 E (xpected to be the desired)-.15 E F2 -.1(ye)2.5 G(ar).1 E F0 (to print, and prints all of the months in)2.5 E(the gi)108 391.2 Q -.15 (ve)-.25 G 2.5(ny).15 G(ear)-2.5 E 5(.I)-.55 G 2.5(fb)-5 G(oth)-2.5 E F2 (month)2.5 E F0(and)2.5 E F2 -.1(ye)2.5 G(ar).1 E F0(are gi)2.5 E -.15 (ve)-.25 G(n, then 12 consecuti).15 E .3 -.15(ve m)-.25 H (onths are printed starting at the).15 E(gi)108 403.2 Q -.15(ve)-.25 G 2.5(nm).15 G(onth and year)-2.5 E 5(.I)-.55 G 2.5(ft)-5 G(he)-2.5 E F2 (month)2.5 E F0(,)A F2 -.1(ye)2.5 G(ar).1 E F0 2.5(,a)C(nd)-2.5 E F2 (nmonths)2.5 E F0(ar)2.5 E(guments are all present, printing be)-.18 E (gins with the)-.15 E(gi)108 415.2 Q -.15(ve)-.25 G 2.5(nm).15 G (onth and year and)-2.5 E F2(nmonths)2.5 E F0 (months are printed, rounded up to the nearest multiple of 12.)2.5 E F2 (The Date File \(Con\214guration File\))87 456 Q F0(By def)108 468 Q (ault,)-.1 E F3(pcal)3.75 E F0(simply prints an empty calendar)3.01 E 5 (.I)-.55 G(ts real po)-5 E(wer is in its ability to place `)-.25 E(`e) -.74 E -.15(ve)-.25 G(nts').15 E 2.5('\()-.74 G(and, for)-2.5 E(monthly\ -format PostScript calendars, Encapsulated PostScript images [e.g. phot\ os and icons]\) in appropri-)108 480 Q (ate days on the \(PostScript or HTML\) calendar)108 492 Q 2.5(,t)-.4 G (hus allo)-2.5 E(wing the user to create personalized calendars.)-.25 E (This is achie)108 504 Q -.15(ve)-.25 G 2.5(dt).15 G (hrough the use of the `)-2.5 E(`date \214le')-.74 E(', also kno)-.74 E (wn as the `)-.25 E(`con\214guration \214le')-.74 E('.)-.74 E(The def) 108 520.8 Q(ault date/con\214guration \214le is e)-.1 E (xpected to be named)-.15 E F3(.calendar)2.5 E F0(\()3.23 E F3(pcal.dat) 1.25 E F0(under MS-DOS\), or)2.5 E F3(calen-)2.7 E(dar)108 532.8 Q F0 (for compatibility with older v)3.23 E(ersions.)-.15 E F3(Pcal)5.5 E F0 (will look in se)3.01 E -.15(ve)-.25 G(ral places for such a \214le.).15 E(First, if the en)5 E(vi-)-.4 E(ronment v)108 544.8 Q(ariable)-.25 E F2 (PCAL_DIR)2.5 E F0(is de\214ned,)2.5 E F3(pcal)3.75 E F0 (searches the directory indicated by that v)3.01 E 2.5(ariable. Ne)-.25 F(xt,)-.15 E F3(pcal)3.75 E F0(searches the user')108 556.8 Q 2.5(sh) -.55 G(ome directory \(as speci\214ed by the)-2.5 E F2(HOME)2.5 E F0(en) 2.5 E(vironment v)-.4 E 2.5(ariable\). If)-.25 F(neither)2.5 E F2 (PCAL_DIR)108 568.8 Q F0(nor)2.5 E F2(HOME)2.5 E F0(is de\214ned,)2.5 E F3(pcal)3.75 E F0(searches the current directory instead.)3.01 E (Finally)5 E 2.5(,i)-.65 G 2.5(fe)-2.5 G(nabled \(via the)-2.5 E (`SEARCH_PCAL_DIR' \215ag\) when)108 580.8 Q F3(pcal)3.75 E F0 -.1(wa) 3.01 G 2.5(sb).1 G(uilt, the directory where the)-2.7 E F3(pcal)3.75 E F0 -.15(exe)3.01 G(cutable resides will be).15 E(check)108 592.8 Q 2.5 (ed. If)-.1 F(no date \214le is found, an empty calendar is printed; no\ error is generated.)2.5 E(Alternati)108 609.6 Q -.15(ve)-.25 G(ly).15 E 2.5(,t)-.65 G(he name of the date \214le \(and, optionally)-2.5 E 2.5 (,t)-.65 G(he path where it can be found\) can be speci\214ed)-2.5 E (using the)108 621.6 Q F22.5 E F0(command-line option.)2.5 E (See the)5 E F2(OPTIONS)2.5 E F0(section for more details.)2.5 E(Ev)108 638.4 Q(ery)-.15 E F3(pcal)3.75 E F0(distrib)3.01 E (ution comes with an 'e)-.2 E(xamples' directory)-.15 E 5(.T)-.65 G (he `pcal-cfg.txt' \214le that is located there)-5 E (contains a myriad of e)108 650.4 Q (xamples of settings that can be used in your o)-.15 E (wn con\214guration \214le.)-.25 E(Please check it)5 E (out for lots of useful ideas.)108 662.4 Q (Furthermore, that directory contains se)5 E -.15(ve)-.25 G (ral language/country-speci\214c e).15 E(xam-)-.15 E (ples \(including holiday and other e)108 674.4 Q -.15(ve)-.25 G (nt de\214nitions\) in v).15 E (arious `calendar_xx.txt' \214les, where `xx' represents)-.25 E (the 2-letter language code \(e.g. 'calendar_de.txt' is the German e)108 686.4 Q(xample \214le\).)-.15 E(If a date \214le is found, it will be s\ earched for lines with leading dates matching the requested month and) 108 703.2 Q(year)108 715.2 Q(.)-.55 E -1.11(Ve)72 768 S(rsion 4.11.0) 1.11 E(18 Dec 2007)150.4 E(1)203.45 E 0 Cg EP %%Page: 2 2 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F(An)108 84 Q 2.5(yt)-.15 G -.15(ex)-2.5 G 2.5 (tf).15 G(ollo)-2.5 E(wing the dates found will be printed on the calen\ dar under the appropriate day of the month.)-.25 E(Encapsulated PostScr\ ipt \(EPS\) images are handled similarly as described in a later subsec\ tion.)108 96 Q/F1 10/Times-Bold@0 SF(tr)108 112.8 Q(off)-.18 E F0 (-style escape sequences \\fB, \\fI, \\fP)A 2.5(,a)-1.11 G (nd \\fR may be used to set the font style to Bold, Italic, the pre)-2.5 E(vi-)-.25 E(ous font style, or Roman respecti)108 124.8 Q -.15(ve)-.25 G(ly).15 E 5(.F)-.65 G(or those more f)-5.15 E (amiliar with HTML, , , , and may)-.1 E (be used instead to enable/disable Bold or Italic font styles.)108 136.8 Q(The font style is reset to Roman after each line)5 E(break.)108 148.8 Q(Using the `include' pre-processor directi)108 165.6 Q .3 -.15(ve \() -.25 H(described in the section entitled `Pre-Processor Functionality',) .15 E(belo)108 177.6 Q (w\), other con\214guration \214les can be processed from within an e) -.25 E(xisting con\214guration \214le.)-.15 E(That is, you)5 E (can `nest' con\214guration \214les as needed.)108 189.6 Q (Dates \(essentially `e)108 206.4 Q -.15(ve)-.25 G (nts'\) in the con\214guration \214les may be e).15 E(xpressed in an) -.15 E 2.5(yo)-.15 G 2.5(fs)-2.5 G -2.15 -.25(ev e)-2.5 H(ral formats:) .25 E 6.5<833c>144 228 S(ordinal> in {*} {})-.15 E 6.5<837b>144 244.8 S (} {*} {})-.15 E 6.5 <833c>144 261.6 S(date_spec>{*} {})-.15 E 6.5<833c>144 278.4 S(pre_de\214ned_e)-6.5 E -.15(ve)-.25 G(nt>{*} {}) -.15 E(Where:)108 295.2 Q 8( :=)144 316.8 R (\214rst 3+ characters of name of month, or `)2.5 E(`all')-.74 E(')-.74 E F1(Note:)218 333.6 Q/F2 10/Times-Italic@0 SF(pcal)3.75 E F0 (looks for names of the days of the week prior to names of months)3.01 E (when parsing e)218 345.6 Q -.15(ve)-.25 G(nt date speci\214cations.).15 E(Furthermore, some languages \(e.g.)5 E(French and Finnish\) ha)218 357.6 Q .3 -.15(ve a m)-.2 H (onth name whose \214rst 3 letters are the same as the).15 E (\214rst 3 letters of one of the names of the days of the week.)218 369.6 Q(Because of this, the)5 E (speci\214cation in such a language of an)218 381.6 Q 2.5(ym)-.15 G (onth name which collides thusly must)-2.5 E(use 4 or more letters to d\ istinguish it from the name of the day of the week with)218 393.6 Q (which it `collides'.)218 405.6 Q 11.89( :=)144 422.4 R (, or `)2.5 E(`year')-.74 E(')-.74 E 23.01( :=)144 439.2 R(\214rst 3+ characters of name of weekday)2.5 E 2.5(,`)-.65 G (`day')-3.24 E(', `)-.74 E(`weekday')-.74 E(', `)-.74 E(`w)-.74 E (orkday')-.1 E(',)-.74 E -.74(``)218 451.2 S(holiday').74 E(', `)-.74 E (`nonweekday')-.74 E(', `)-.74 E(`nonw)-.74 E(orkday')-.1 E(', `)-.74 E (`nonholiday')-.74 E(', `)-.74 E(`ne)-.74 E(w_moon')-.25 E(',)-.74 E -.74(``)218 463.2 S(\214rst_quarter').74 E(', `)-.74 E(`full_moon')-.74 E(', or `)-.74 E(`last_quarter')-.74 E(')-.74 E 31.89( :=)144 480 R(an)2.5 E 2.5(yo)-.15 G(rdinal number \(`)-2.5 E(`1st')-.74 E(', `) -.74 E(`2nd')-.74 E(', etc.\), `)-.74 E(`\214rst')-.74 E 2.5('.)-.74 G (.. `)-2.5 E(`\214fth')-.74 E(', `)-.74 E(`last')-.74 E(', `)-.74 E (`odd')-.74 E(',)-.74 E -.74(``)218 492 S -2.15 -.25(ev e).74 H(n').25 E (', or `)-.74 E(`all')-.74 E(')-.74 E 42.45( :=)144 508.8 R -.74 (``)2.5 G(on').74 E(', `)-.74 E(`before')-.74 E(', `)-.74 E(`preceding') -.74 E(', `)-.74 E(`after')-.74 E(', `)-.74 E(`follo)-.74 E(wing')-.25 E (', `)-.74 E(`on_or_before')-.74 E(')-.74 E(\(`)218 520.8 Q(`oob')-.74 E ('\), `)-.74 E(`on_or_after')-.74 E 2.5('\()-.74 G -.74(``)-2.5 G(ooa') .74 E('\), `)-.74 E(`nearest')-.74 E(', `)-.74 E(`nearest_before`)-.74 E (`, or `)-.74 E(`near)-.74 E(-)-.2 E(est_after`)218 532.8 Q(`)-.74 E ().15 E(:= `)218 561.6 Q (`Christmas')-.74 E(', `)-.74 E(`Thanksgi)-.74 E(ving')-.25 E(', `)-.74 E(`Easter')-.74 E(', `)-.74 E(`Good_Friday')-.74 E(', `)-.74 E (`GEaster')-.74 E(')-.74 E(\(Orthodox Easter\), `)218 573.6 Q(`Gstgeor) -.74 E(ge')-.18 E 2.5('\()-.74 G(Orthodox holiday\), and `)-2.5 E (`Gmarcus')-.74 E 2.5('\()-.74 G(Ortho-)-2.5 E(dox holiday\).)218 585.6 Q 46.89( :=)144 602.4 R (one or more non-numeric, non-space, non-`*' characters)2.5 E 34.66 ( :=)144 619.2 R 2.5(an)2.5 G(umeric month \(1-12\))-2.5 E 45.78 ( :=)144 636 R(day of month \(1-31\))2.5 E 43.01( :=)144 652.8 R 2.5(an)2.5 G(umeric year)-2.5 E( :=) -.15 F(the te)2.5 E(xt to be displayed for this e)-.15 E -.15(ve)-.25 G (nt; if the te).15 E(xt be)-.15 E(gins with the constant)-.15 E (string `)218 681.6 Q(`image:')-.74 E (', then it is interpreted as a speci\214cation of an Encapsulated)-.74 E(PostScript \(EPS\) image rather than as simple te)218 693.6 Q (xt; more information on specify-)-.15 E(ing EPS images is a)218 705.6 Q -.25(va)-.2 G(ilable in a later section of this document).25 E(If the) 108 722.4 Q F12.5 E F0(option \(American date formats, the def)2.5 E(ault\) is gi)-.1 E -.15(ve)-.25 G(n:).15 E -1.11(Ve)72 768 S (rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(2)203.45 E 0 Cg EP %%Page: 3 3 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F 20.79( :=)144 84 R ( | {})2.5 E(If the)108 100.8 Q/F1 10/Times-Bold@0 SF2.5 E F0 (option \(European date formats\) is gi)2.5 E -.15(ve)-.25 G(n:).15 E 20.79( :=)144 122.4 R( | |) 2.5 E({})218 134.4 Q(The `)108 163.2 Q (`Notes')-.74 E 2.5('b)-.74 G(ox \(see belo)-2.5 E (w\) uses the \214rst of the current month as the def)-.25 E(ault date.) -.1 E(All footer strings use)5 E(the \214rst of the current month in si\ ngle-month mode and the \214rst of the starting month in whole-year mod\ e.)108 175.2 Q(Examples:)108 192 Q/F2 10/Courier@0 SF (last Monday in May*)144 208.8 Q(Memorial Day Holiday)54 E (all Fridays in Oct)144 232.8 Q(Status Meeting, 11 AM)60 E (first workday in all)144 244.8 Q(%-B progress report due)48 E (all Fri in all)144 256.8 Q(\\fBTime card due,\\fP 3 PM)84 E (all Monday in all)144 268.8 Q(Fiscal week %0W)66 E(-2nd workday in all) 144 280.8 Q(Schedule for %+B due %+2D)54 E(2nd full_moon in all)144 292.8 Q(Blue Moon)48 E(Fri on_or_before all 15)144 304.8 Q(Pay Day)30 E (even Fridays in year)144 316.8 Q(Pay Day)48 E(183rd day of year)144 328.8 Q(Mid-year \(%l days left\))66 E(Tue after first Mon in Nov)144 352.8 Q(Election Day \(USA\))12 E(4th Thu in Nov*)144 376.8 Q (Thanksgiving)78 E(Fri after 4th Thu in Nov*)144 388.8 Q (Day after Thanksgiving)18 E(workday nearest 12/25*)144 400.8 Q(Holiday) 36 E 108(12/25/04* Christmas)144 424.8 R 6(#A)30 G(merican)-6 E 108 (25.12.04* Christmas)144 436.8 R 6(#E)30 G(uropean)-6 E(25. 12.*)144 448.8 Q 24(Christmas #)120 F(European)6 E(Dec 25*)144 472.8 Q 24 (Christmas #)126 F(American)6 E(25 Dec*)144 484.8 Q 24(Christmas #)126 F (European)6 E(25. Dec*)144 496.8 Q 24(Christmas #)120 F(European)6 E (Fri on all 13)144 520.8 Q(Avoid black cats!)90 E 6(#')18 G (Friday the 13th')-6 E F0(An)108 537.6 Q 2.5(yn)-.15 G (on-numeric character may separate numeric dates.)-2.5 E (Holidays may be \215agged by follo)5 E(wing the date)-.25 E (immediately with `*' as in the e)108 549.6 Q(xamples abo)-.15 E -.15 (ve)-.15 G 2.5(;t).15 G (his will cause the date numerics to be printed in the color)-2.5 E (speci\214ed by the)108 561.6 Q F12.5 E F0(option \(def)2.5 E (ault = gray\) and will cause the associated te)-.1 E (xt \(on monthly-format calendars\))-.15 E(to be placed adjacent to the\ numeric date in the day box rather than belo)108 573.6 Q 2.5(wt)-.25 G (he numeric date \(as is done for)-2.5 E(all non-holiday e)108 585.6 Q -.15(ve)-.25 G 2.5(nts\). `).15 F(`Each')-.74 E 2.5('a)-.74 G(nd `)-2.5 E(`e)-.74 E -.15(ve)-.25 G(ry').15 E 2.5('a)-.74 G(re accepted as synon) -2.5 E(yms for `)-.15 E(`all')-.74 E(', and an)-.74 E 2.5(yw)-.15 G (ord may be)-2.6 E(used in place of `)108 597.6 Q(`in')-.74 E 2.5 ('. The)-.74 F(abbre)2.5 E(viations `)-.25 E(`oob')-.74 E 2.5('a)-.74 G (nd `)-2.5 E(`ooa')-.74 E 2.5('m)-.74 G(ay be used in place of the k) -2.5 E -.15(ey)-.1 G -.1(wo).15 G(rds).1 E -.74(``)108 609.6 S (on_or_before').74 E 2.5('a)-.74 G(nd `)-2.5 E(`on_or_after')-.74 E (', respecti)-.74 E -.15(ve)-.25 G(ly).15 E 5(.`)-.65 G(`Nearest')-5.74 E 2.5('a)-.74 G(ttempts to match the speci\214ed date; if that)-2.5 E -.1(fa)108 621.6 S(ils, it tries the day after).1 E 2.5(,t)-.4 G (hen the day before, then tw)-2.5 E 2.5(od)-.1 G(ays after)-2.5 E 2.5 (,t)-.4 G .2 -.1(wo d)-2.5 H(ays before, and so forth until a).1 E (match occurs.)108 633.6 Q -.4(Wi)108 650.4 S (ldcard day names are also pro).4 E 2.5(vided. The)-.15 F -.1(ke)2.5 G (yw)-.05 E(ord `)-.1 E(`weekday')-.74 E 2.5('a)-.74 G(pplies to an)-2.5 E 2.5(yd)-.15 G(ays which are normally)-2.5 E(printed in "logical black\ " - the predominant day color - on the calendar)108 662.4 Q 5(.T)-.55 G (he k)-5 E -.15(ey)-.1 G -.1(wo).15 G(rd `).1 E(`w)-.74 E(orkday')-.1 E 2.5('i)-.74 G 2.5(st)-2.5 G(he)-2.5 E(same, b)108 674.4 Q (ut does not include an)-.2 E 2.5(yh)-.15 G 2.5(olidays. The)-2.5 F -.1 (ke)2.5 G(yw)-.05 E(ord `)-.1 E(`holiday')-.74 E 2.5('i)-.74 G (ncludes only those days \215agged as holi-)-2.5 E 2.5(days. The)108 686.4 R -.1(ke)2.5 G(yw)-.05 E(ords `)-.1 E(`nonweekday')-.74 E(', `) -.74 E(`nonw)-.74 E(orkday')-.1 E(', and `)-.74 E(`nonholiday')-.74 E 2.5('a)-.74 G(re also recognized as ne)-2.5 E -.05(ga)-.15 G(tions).05 E (of the abo)108 698.4 Q -.15(ve)-.15 G 5(.S).15 G(ee the)-5 E F1(CA)2.5 E(VEA)-1.45 E(TS)-.95 E F0(belo)2.5 E 2.5(wf)-.25 G (or important notes on using these k)-2.5 E -.15(ey)-.1 G -.1(wo).15 G 2.5(rds. Moon).1 F(phases may)2.5 E(also appear as wildcards; `)108 710.4 Q(`nm')-.74 E 2.5('i)-.74 G 2.5(sa)-2.5 G(ccepted as a synon)-2.5 E(ym for `)-.15 E(`ne)-.74 E(w_moon')-.25 E(', `)-.74 E(`1q')-.74 E 2.5 ('a)-.74 G(nd `)-2.5 E(`fq')-.74 E 2.5('f)-.74 G(or)-2.5 E -.74(``)108 722.4 S(\214rst_quarter').74 E(', `)-.74 E(`fm')-.74 E 2.5('f)-.74 G (or `)-2.5 E(`full_moon')-.74 E(', `)-.74 E(`3q')-.74 E 2.5('f)-.74 G (or `)-2.5 E(`third_quarter')-.74 E(', and `)-.74 E(`lq')-.74 E 2.5('f) -.74 G(or `)-2.5 E(`last_quarter')-.74 E('.)-.74 E -1.11(Ve)72 768 S (rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(3)203.45 E 0 Cg EP %%Page: 4 4 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F (Ordinal day numbers may be used to specify dates, either relati)108 84 Q .3 -.15(ve t)-.25 H 2.5(ot).15 G(he month or to the year)-2.5 E 5(.E) -.55 G(ither w)-5 E(ords)-.1 E(or numeric abbre)108 96 Q (viations may be used for `)-.25 E(`\214rst')-.74 E 2.5('t)-.74 G (hrough `)-2.5 E(`\214fth')-.74 E('; higher numbers must be gi)-.74 E -.15(ve)-.25 G 2.5(nu).15 G(sing the)-2.5 E(numeric equi)108 108 Q -.25 (va)-.25 G(lent \(e.g. 100th\).).25 E(Ne)5 E -.05(ga)-.15 G(ti).05 E .3 -.15(ve o)-.25 H(rdinal numbers may e).15 E -.15(ve)-.25 G 2.5(nb).15 G 2.5(eu)-2.5 G 2.5(sed. F)-2.5 F(or e)-.15 E(xample, `)-.15 E(`\2552nd') -.74 E(')-.74 E(means `)108 120 Q(`ne)-.74 E(xt to last')-.15 E('.)-.74 E -.74(``)108 136.8 S(Odd').74 E 2.5('a)-.74 G(nd `)-2.5 E(`e)-.74 E -.15(ve)-.25 G(n').15 E 2.5('d)-.74 G 2.5(on)-2.5 G (ot refer to the actual date; instead, `)-2.5 E(`odd')-.74 E 2.5('m)-.74 G(eans `)-2.5 E(`alternate, starting with the \214rst')-.74 E(',)-.74 E (and `)108 148.8 Q(`e)-.74 E -.15(ve)-.25 G(n').15 E 2.5('m)-.74 G (eans `)-2.5 E(`alternate, starting with the second')-.74 E 2.5 ('. Thus,)-.74 F -.74(``)2.5 G(odd Fridays in March').74 E 2.5('r)-.74 G (efers to the \214rst,)-2.5 E(third, and \(if present\) \214fth Fridays\ in March \212 not to those Fridays f)108 160.8 Q(alling on odd dates.) -.1 E -.74(``)108 177.6 S(All')-.06 E 2.5('r)-.74 G(efers to each indi) -2.5 E(vidual month; `)-.25 E(`year')-.74 E 2.5('r)-.74 G (efers to the year as an entity)-2.5 E 5(.T)-.65 G(hus `)-5 E (`odd Fridays in all')-.74 E(')-.74 E(refers to the \214rst, third, and\ \214fth Friday of each month, while `)108 189.6 Q (`odd Fridays in year')-.74 E 2.5('r)-.74 G(efers to the \214rst Fri-) -2.5 E(day of January and e)108 201.6 Q -.15(ve)-.25 G (ry other Friday thereafter).15 E(.)-.55 E -.74(``)108 218.4 S(Nearest') .74 E(', `)-.74 E(`nearest_before')-.74 E(', and `)-.74 E (`nearest_after')-.74 E 2.5('r)-.74 G (efer to the nearest weekday or wildcard day with)-2.5 E (respect to the speci\214ed date.)108 230.4 Q -.74(``)5 G (Nearest_before').74 E 2.5('a)-.74 G(nd `)-2.5 E(`nearest_after')-.74 E 2.5('a)-.74 G(llo)-2.5 E 2.5(wt)-.25 G(he user to specify ho)-2.5 E(w) -.25 E/F1 10/Times-Italic@0 SF(pcal)2.5 E F0(is)2.5 E (to disambiguate between tw)108 242.4 Q 2.5(od)-.1 G (ates that are equally near: e.g., `)-2.5 E (`nonweekday nearest_before [W)-.74 E(ed.])-.8 E(9/25/96')108 254.4 Q 2.5('r)-.74 G(efers to Sunday)-2.5 E 2.5(,9)-.65 G(/22 while `)-2.5 E (`nonweekday nearest_after 9/25/96')-.74 E 2.5('r)-.74 G (efers to Saturday)-2.5 E 2.5(,9)-.65 G 2.5(/28. \(Note)-2.5 F(that `) 108 266.4 Q(`nearest_before')-.74 E 2.5('a)-.74 G(nd `)-2.5 E (`nearest_after')-.74 E 2.5('a)-.74 G(re equi)-2.5 E -.25(va)-.25 G (lent to `).25 E(`nearest')-.74 E 2.5('w)-.74 G(hen no such ambiguity e) -2.5 E(xists: e.g.,)-.15 E -.74(``)108 278.4 S (nonweekday nearest_before [Thu.] 9/26/96').74 E 2.5('r)-.74 G (efers to Saturday)-2.5 E 2.5(,9)-.65 G(/28.\))-2.5 E -1.25 -.7(Te x)108 295.2 T 2.5(ti).7 G 2.5(nt)-2.5 G(he date \214le may use C-lik)-2.5 E 2.5(ee)-.1 G(scape sequences \(i.e. a `\\' follo)-2.5 E (wed by a character)-.25 E 2.5(,1\2553o)-.4 G(ctal digits, or)-2.5 E (`x' follo)108 307.2 Q(wed by 1 \255 2 he)-.25 E(xadecimal digits\).) -.15 E(Escaped whitespace \(including)5 E/F2 10/Times-Bold@0 SF(newline) 2.5 E F0 2.5(\)a)2.5 G(nd the standard)-2.5 E (ANSI character escapes \(`\\a', `\\b', `\\f)108 319.2 Q (', `\\n', `\\r', `\\t', `\\v'\) are all replaced by a single blank.).55 E(The HTML special characters `<' `>' `"' `&' ` ' a\ nd `&#NNN;' \(NNN = an)108 336 Q 2.5(yt)-.15 G(hree)-2.5 E (decimal digits\) are also supported.)108 348 Q(These will be propag)5 E (ated intact \(be sure to escape the `#' in `&#NNN;'\))-.05 E (if the output is speci\214ed as HTML \(see the)108 360 Q F22.5 E F0(\215ag\); otherwise the)2.5 E 2.5(yw)-.15 G(ill be con)-2.5 E -.15 (ve)-.4 G(rted to their ASCII equi).15 E(v-)-.25 E 2.5(alents. This)108 372 R(allo)2.5 E(ws a common date \214le to be used re)-.25 E -.05(ga) -.15 G(rdless of whether the desired output format is).05 E (HTML, PostScript, or Un*x)108 384 Q F1(calendar\(1\))2.7 E F0 (\(see the)2.56 E F22.5 E F0(\215ag\) input.)2.5 E (Lines in the con\214guration \214le consisting of)108 400.8 Q F2 -.1 (ye)2.5 G(ar ####).1 E F0(\(where)2.5 E F2(####)2.5 E F0 (is a numeric year\) can be used to set the)2.5 E(year for follo)108 412.8 Q(wing entries.)-.25 E(This assumes that the follo)5 E (wing entries do not contain a year; an)-.25 E 2.5(yd)-.15 G (ate entries)-2.5 E (containing year information will set the remembered year to that year) 108 424.8 Q(.)-.55 E(Lines in the con\214guration \214le consisting of) 108 441.6 Q F2 -.1(ye)2.5 G(ar all).1 E F0(\(or)2.5 E 2.5(,a)-.4 G (lternati)-2.5 E -.15(ve)-.25 G(ly).15 E(,)-.65 E F2 -.1(ye)2.5 G(ar *) .1 E F0 2.5(\)d)C(irect)-2.5 E F1(pcal)2.5 E F0(to wildcard fol-)2.5 E (lo)108 453.6 Q(wing entries ag)-.25 E(ainst e)-.05 E -.15(ve)-.25 G (ry applicable year).15 E 5(.T)-.55 G(his assumes that the follo)-5 E (wing entries do not contain a year;)-.25 E(an)108 465.6 Q 2.5(yd)-.15 G (ate entries containing year information \(or an e)-2.5 E(xplicit)-.15 E F2 -.1(ye)2.5 G(ar ####).1 E F0(entry\) will set the remembered year)2.5 E(to that year)108 477.6 Q(.)-.55 E (Lines in the con\214guration \214le consisting of)108 494.4 Q F2 (opt )2.5 E F0(can be used to o)2.5 E -.15(ve)-.15 G (rride the def).15 E(aults for an)-.1 E 2.5(yc)-.15 G(om-)-2.5 E (mand-line options e)108 506.4 Q(xcept)-.15 E F22.5 E F0(,)A F2 2.5 E F0(,)A F22.5 E F0(,)A F22.5 E F0(,)A F22.5 E F0(,)A F22.5 E F0(,)A F22.5 E F0(,)A F22.5 E F0 2.5 (,a)C(nd)-2.5 E F22.5 E F0 5(.A)C .3 -.15(ny o)-5 H (ptions speci\214ed in this manner).15 E(are, in turn, o)108 518.4 Q -.15(ve)-.15 G(rridden by those speci\214ed e).15 E (xplicitly on the command line.)-.15 E (Lines in the con\214guration \214le consisting of)108 535.2 Q F2 (note{/} )2.5 E F0(can be used to place notes re)2.5 E -.05(ga)-.15 G(rd-).05 E (ing the entire month in one of the unused blocks of the calendar)108 547.2 Q 5(.T)-.55 G(he)-5 E F2()2.5 E F0 (indicator may be either a)2.5 E (number 1 through 12 or an alphabetic month name as described abo)108 559.2 Q -.15(ve)-.15 G 5(;`).15 G(`note all')-5.74 E 2.5('w)-.74 G (ill place the associated)-2.5 E(te)108 571.2 Q (xt in the notes block for each month in the current year)-.15 E(.)-.55 E F2()5 E F0(is an optional positi)2.5 E .3 -.15(ve o)-.25 H 2.5 (rn).15 G -2.25 -.15(eg a)-2.5 H(ti).15 E -.15(ve)-.25 G (number specifying the empty box where the associated te)108 583.2 Q (xt is to be placed.)-.15 E(If positi)5 E -.15(ve)-.25 G(,).15 E F1 (pcal)3.75 E F0(counts forw)3.01 E(ard)-.1 E (from the \214rst empty box; if ne)108 595.2 Q -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G(,).15 E F1(pcal)3.75 E F0(counts backw)3.01 E (ard from the last empty box.)-.1 E(Thus,)5 E F2 -.63(``)2.5 G(note/1') .63 E(')-.63 E F0(places the associated te)108 607.2 Q (xt in the \214rst empty box;)-.15 E F2(note/-3)2.5 E F0 (in the third-to-last.)2.5 E(The def)5 E(ault is -1 if no is gi)108 619.2 Q -.15(ve)-.25 G 2.5(n\().15 G(last empty box, im\ mediately preceding the small calendars on the bottom ro)-2.5 E(w; cf.) -.25 E F25 E F0(,)A F22.5 E F0(,)A(and)108 631.2 Q F2 2.5 E F0 2.5(,b)C(elo)-2.5 E 2.5(w\). Y)-.25 F(ou can place se)-1.1 E -.15(ve)-.25 G(ral notes in the same box.).15 E -1.1(Yo)5 G 2.5(uc)1.1 G (an also use more than 1 box for the)-2.5 E -.25(va)108 643.2 S (rious monthly notes.).25 E (Lines in the con\214guration \214le consisting of)108 660 Q F2 (input-language XX)2.5 E F0(\(where)2.5 E F2(XX)2.5 E F0 (is the 2-letter speci\214cation for)2.5 E(an)108 672 Q 2.5(yo)-.15 G 2.5(ft)-2.5 G(he supported languages\) can be used to set the language \ used for interpretation of the month names)-2.5 E (and day-of-week names for the remaining e)108 684 Q -.15(ve)-.25 G (nt entries.).15 E(This option may be speci\214ed more than once, as)5 E (needed, if the language used to describe e)108 696 Q -.15(ve)-.25 G (nts changes within the \214le.).15 E -.15(Fo)5 G 2.5(rb).15 G(ackw)-2.5 E(ards compatibility)-.1 E 2.5(,t)-.65 G(he)-2.5 E(def)108 708 Q(ault v) -.1 E(alue for `input language' if this directi)-.25 E .3 -.15(ve i)-.25 H 2.5(sn).15 G -2.15 -.25(ev e)-2.5 H 2.5(ru).25 G (sed is 'en' \(English\).)-2.5 E(Note that this directi)5 E .3 -.15 (ve i)-.25 H(s).15 E(distinct from the speci\214cation of 'output langu\ age' as accomplished with the)108 720 Q F22.5 E F0(option.)2.5 E -1.11(Ve)72 768 S(rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(4)203.45 E 0 Cg EP %%Page: 5 5 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F (Comments are supported in the con\214guration \214le.)108 84 Q(An)5 E 2.5(yc)-.15 G(haracters follo)-2.5 E(wing a `#' character are ignored,) -.25 E(through the end of that line, unless the `#' character is escape\ d by `\\'.)108 96 Q/F1 10/Times-Bold@0 SF(Deleting Ev)87 136.8 Q(ents) -.1 E F0(By prepending the)108 148.8 Q/F2 10/Times-Italic@0 SF(`delete') 1.29 E F0 -.1(ke)2.57 G(yw)-.05 E(ord to an e)-.1 E -.15(ve)-.25 G (nt speci\214cation, one or more e).15 E -.15(ve)-.25 G (nts may be deleted from a set).15 E(of pre)108 160.8 Q (viously-speci\214ed e)-.25 E -.15(ve)-.25 G(nts.).15 E -.15(Fo)108 189.6 S 2.5(re).15 G(xample, the follo)-2.65 E (wing lines might appear in the date \214le:)-.25 E(all Friday in all) 144 211.2 Q(Pok)5 E(er g)-.1 E(ame)-.05 E(delete \214rst Friday in all) 144 223.2 Q(Pok)5 E(er g)-.1 E(ame)-.05 E(This results in an e)108 240 Q -.15(ve)-.25 G(nt labeled `Pok).15 E(er g)-.1 E(ame' on e)-.05 E -.15 (ve)-.25 G(ry Friday e).15 E(xcept the \214rst Friday of the month.)-.15 E(If you)5 E(delete an entry which is mark)108 252 Q(ed as a holiday)-.1 E 2.5(,t)-.65 G(he `holiday' \215ag for that day will be recalculated.) -2.5 E(An)5 E(y)-.15 E(`delete' entries which don')108 264 Q 2.5(tm)-.18 G(atch an)-2.5 E 2.5(yp)-.15 G(re-e)-2.5 E (xisting entries are silently ignored.)-.15 E F1 -.25(Fo)87 304.8 S (rmat Speci\214ers).25 E F2(Pcal)108.5 316.8 Q F0(allo)3.01 E (ws format speci\214ers in both the e)-.25 E -.15(ve)-.25 G(nt te).15 E (xt and footer strings \(see the)-.15 E F12.5 E F0(,)A F12.5 E F0(,)A F12.5 E F0 2.5(,a)C(nd)-2.5 E F12.5 E F0(options) 2.5 E(belo)108 328.8 Q(w\). Each format speci\214er will be replaced by\ a corresponding string as outlined in the follo)-.25 E(wing table:)-.25 E 20.73(%a abbre)144 345.6 R(viated weekday)-.25 E 17.95(%A full)144 357.6 R(weekday)2.5 E 20.17(%b abbre)144 369.6 R(viated month name)-.25 E 18.5(%B full)144 381.6 R(month name)2.5 E 20.17(%d day)144 393.6 R (of month \(1-31\))2.5 E 22.39(%j day)144 405.6 R(of year \(1-366\))2.5 E 22.39(%l days)144 417.6 R(left in year \(0-365\))2.5 E 17.39(%m month) 144 429.6 R(\(1-12\))2.5 E 17.95(%U week)144 441.6 R(number \(0-53\))2.5 E 15.73(%W week)144 453.6 R(number \(0-53\))2.5 E 20.17(%u week)144 465.6 R(number \(1-54\))2.5 E 17.95(%w week)144 477.6 R(number \(1-54\)) 2.5 E 20.17(%y year)144 489.6 R(w/o century \(00-99\))2.5 E 17.95 (%Y year)144 501.6 R(w/century)2.5 E 16.84(%% `%')144 513.6 R(character) 2.5 E 20.17(%o print)144 537.6 R(number as ordinal)2.5 E 20.17(%0 print) 144 549.6 R(number with leading zeroes)2.5 E 19.53(%+ use)144 561.6 R (follo)2.5 E(wing month or year)-.25 E 19.53(%\255 use)144 573.6 R(pre) 2.5 E(vious month or year)-.25 E(%{+N}[D)144 585.6 Q -.42(WMY] adjust) -.3 F(date by +N days/weeks/months/years)2.5 E(%{\255N}[D)144 597.6 Q -.42(WMY] adjust)-.3 F(date by \255N days/weeks/months/years)2.5 E (Most of these are deri)108 614.4 Q -.15(ve)-.25 G 2.5(df).15 G (rom the ANSI C)-2.5 E/F3 10/Courier@0 SF(strftime\(\))2.5 E F0 (function, b)6 E(ut the)-.2 E F1(%[louwMD])2.5 E F0(and)2.5 E F1 (%[o0+\255])2.5 E F0(format speci\214ers are speci\214c to)108 626.4 Q F2(pcal)2.5 E F0(.).51 E(The)108 643.2 Q F1(%u)2.5 E F0(speci\214er con\ siders the week containing 1/1 \(Jan 1st\) as week 1 and the follo)2.5 E (wing logical Sunday)-.25 E (\(the \214rst day of the week as printed; cf. the)108 655.2 Q F1 2.5 E F0(option belo)2.5 E(w\) as the start of week 2;)-.25 E F1(%U)2.5 E F0(considers the \214rst)2.5 E (logical Sunday as the \214rst day of week 1.)108 667.2 Q F1(%w)5 E F0 (and)2.5 E F1(%W)2.5 E F0(beha)2.5 E .3 -.15(ve l)-.2 H(ik).15 E(e)-.1 E F1(%u)2.5 E F0(and)2.5 E F1(%U)2.5 E F0(respecti)2.5 E -.15(ve)-.25 G (ly).15 E 2.5(,b)-.65 G(ut use the)-2.7 E (\214rst logical Monday instead.)108 679.2 Q(Note that)5 E F1(%w)2.5 E F0(has a dif)2.5 E(ferent meaning from)-.25 E F3(strftime\(\).)2.5 E F0 (The)108 696 Q F1(%o)2.5 E F0(format speci\214er prints a number as an \ ordinal, with the appropriate suf)2.5 E(\214x \(`)-.25 E(`st')-.74 E (', `)-.74 E(`nd')-.74 E(', `)-.74 E(`rd')-.74 E(', or)-.74 E -.74(``) 108 708 S(th').74 E 2.5('i)-.74 G 2.5(nE)-2.5 G(nglish\) appended.)-2.5 E -.15(Fo)5 G 2.5(re).15 G(xample,)-2.65 E F1(%od)2.5 E F0 (prints the day of the month as `)2.5 E(`1st')-.74 E(', `)-.74 E(`2nd') -.74 E(', `)-.74 E(`3rd')-.74 E(', etc.)-.74 E(Unlik)108 724.8 Q(e)-.1 E F3(strftime\(\),)2.5 E F2(pcal)7.25 E F0(def)3.01 E (aults to printing numbers \(e)-.1 E(xcept)-.15 E F1(%y)2.5 E F0 2.5 (\)w)C(ithout leading zeroes.)-2.5 E(If leading)5 E -1.11(Ve)72 768 S (rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(5)203.45 E 0 Cg EP %%Page: 6 6 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F (zeroes are desired, the `0' pre\214x may be used.)108 84 Q -.15(Fo)5 G 2.5(re).15 G(xample,)-2.65 E/F1 10/Times-Bold@0 SF(%0j)2.5 E F0 (prints the \214rst day of year as `)2.5 E(`001')-.74 E('.)-.74 E(The) 108 100.8 Q F1(%+)2.5 E F0(and)2.5 E F1<25ad>2.5 E F0 (format speci\214ers direct)2.5 E/F2 10/Times-Italic@0 SF(pcal)3.75 E F0 (to substitute the follo)3.01 E(wing/pre)-.25 E (vious month/year in the fol-)-.25 E(lo)108 112.8 Q(wing)-.25 E F1 ([bBmyY])2.5 E F0(speci\214er)2.5 E 5(.F)-.55 G(or e)-5.15 E(xample,) -.15 E F1(%+B)2.5 E F0(prints the name of the ne)2.5 E(xt month.)-.15 E (The)108 129.6 Q F1(%{[+\255]N}[D)2.5 E(WMY])-.4 E F0 (format speci\214ers do not print an)2.5 E(ything, b)-.15 E (ut instead adjust the w)-.2 E(orking date by)-.1 E/F3 10/Symbol SF 2.5 E F1(N)108 141.6 Q F0(days \()A F1(D)A F0(\), weeks \()A F1(W)A F0 (\), months \()A F1(M)A F0(\), or years \()A F1(Y)A F0 2.5 (\). Subsequent)B(format speci\214ers use the adjusted date)2.5 E (instead of the current date.)108 153.6 Q -.15(Fo)5 G 2.5(re).15 G (xample,)-2.65 E F1(%+1M %B %Y)2.5 E F0(adjusts the date forw)2.5 E (ard by one month and then)-.1 E (prints the resulting month and year \(`)108 165.6 Q(`January 1992')-.74 E 2.5('i)-.74 G 2.5(nD)-2.5 G(ecember)-2.5 E 2.5(,1)-.4 G(991\);)-2.5 E F1(%\2552W %b %d)2.5 E F0(adjusts the date)2.5 E(backw)108 177.6 Q (ard by tw)-.1 E 2.5(ow)-.1 G (eeks and prints the resulting month and day \(`)-2.5 E(`Jul 26')-.74 E 2.5('o)-.74 G 2.5(nA)-2.5 G(ugust 9\).)-2.5 E (Such date adjustments are normally cumulati)108 194.4 Q -.15(ve)-.25 G 2.5(;f).15 G(or e)-2.5 E(xample,)-.15 E F1(%+1Y%\2551D)2.5 E F0 (adjusts the date forw)2.5 E(ard by one)-.1 E(year and then backw)108 206.4 Q(ard by one day)-.1 E 5(.I)-.65 G(f)-5 E F1(%D)2.5 E F0(or)2.5 E F1(%M)2.5 E F0(is speci\214ed alone \(or if)2.5 E F1(N)2.5 E F0 (is zero\),)2.5 E F2(pcal)3.75 E F0(restores the)3.01 E(original date.) 108 218.4 Q(Note that)5 E F1(%M)2.5 E F0(has a dif)2.5 E (ferent meaning to the)-.25 E/F4 10/Courier@0 SF(strftime\(\))2.5 E F0 (function.)6 E(Here')108 235.2 Q 2.5(sac)-.55 G(ommon, useful e)-2.5 E (xample of an e)-.15 E -.15(ve)-.25 G(nt entry for the).15 E F2(pcal) 3.75 E F0(date \214le which combines the ability to)3.01 E(adjust w)108 247.2 Q(orking dates and the ability to display ordinals.)-.1 E (This particular e)5 E(xample is used to display te)-.15 E(xt on)-.15 E (the birthday of a person born in 1991:)108 259.2 Q(May 10 Eric')144 276 Q 2.5(s%)-.55 G(-1991Y%oY Birthday)-2.5 E(That entry w)108 292.8 Q (ould result in the follo)-.1 E(wing te)-.25 E (xt being displayed on May 10, 2005:)-.15 E(Eric')144 314.4 Q 2.5(s1) -.55 G(4th Birthday)-2.5 E F1(Encapsulated P)87 360 Q (ostScript \(EPS\) Images)-.2 E F0 -.15(Fo)108 372 S 2.5(rm).15 G (onthly PostScript calendars only)-2.5 E(,)-.65 E F2(pcal)3.75 E F0 (supports the embedding of one or more EPS images \(photos,)3.01 E (icons, etc\) into an)108 384 Q 2.5(yg)-.15 G -2.15 -.25(iv e)-2.5 H 2.5 (nd).25 G(ay of the month.)-2.5 E(\(EPS image speci\214cations in the)5 E F2(pcal)3.75 E F0(date \214le are ignored for)3.01 E (yearly PostScript calendars and for all HTML calendars.\))108 396 Q (In order to associate an image with a gi)108 420 Q -.15(ve)-.25 G 2.5 (ne).15 G -.15(ve)-2.75 G (nt, you must add one or more entries to the date \214le.).15 E(The)5 E -2.15 -.25(ev e)108 432 T(nt date is speci\214ed e).25 E (xactly as described pre)-.15 E(viously for simple e)-.25 E -.15(ve)-.25 G(nt te).15 E(xt speci\214cation lines.)-.15 E(Ho)5 E(we)-.25 E -.15(ve) -.25 G -.4(r,).15 G(instead of specifying the te)108 444 Q (xt associated with the e)-.15 E -.15(ve)-.25 G (nt, you instead specify the EPS image \214lename and).15 E (some additional parameters in the follo)108 456 Q(wing format:)-.25 E F4(image: ) 144 472.8 Q F0(Where:)108 489.6 Q 7.45( is)144 511.2 R(the \214lename \(which can include a path\) of the Encapsulated\ PostScript)2.5 E(image.)248 523.2 Q F1(Note:)5 E F0 (The EPS image \214lename must be preceded by the con-)2.5 E(stant te) 248 535.2 Q (xt `image:' in order to distinguish an EPS image speci\214cation)-.15 E (from an ordinary e)248 547.2 Q -.15(ve)-.25 G(nt te).15 E (xt speci\214cation.)-.15 E 61.9( is)144 564 R 2.5(as)2.5 G (caling f)-2.5 E(actor in the horizontal dimension for the EPS image.) -.1 E(A)5 E -.25(va)248 576 S (lue of 1.0 is nominal \(i.e. no change to image scale\).).25 E -1.11 (Va)5 G(lues between)1.11 E (0.0 and 1.0 shrink the image in the horizontal dimension while v)248 588 Q(alues)-.25 E -.15(ove)248 600 S 2.5(r1).15 G(.0 e)-2.5 E (xpand the image in the horizontal dimension.)-.15 E(Generally)5 E (speaking, only positi)248 612 Q .3 -.15(ve v)-.25 H (alues should be used.)-.1 E(Ho)5 E(we)-.25 E -.15(ve)-.25 G .8 -.4 (r, i).15 H 2.5(nt).4 G(he rare case)-2.5 E (that you \214nd that your EPS image needs to be \215ipped about the v) 248 624 Q(ertical)-.15 E(axis \(i.e. left to right\), you can use a ne) 248 636 Q -.05(ga)-.15 G(ti).05 E .3 -.15(ve v)-.25 H(alue to achie)-.1 E .3 -.15(ve t)-.25 H(his with-).15 E(out ha)248 648 Q (ving to tweak the actual PostScript content within the EPS image)-.2 E 2.5(\214le. Use)248 660 R(of a ne)2.5 E -.05(ga)-.15 G(ti).05 E .3 -.15 (ve v)-.25 H(alue will undoubtedly necessitate a correspond-)-.1 E (ing change to the parameter to account for the image')248 672 Q 2.5(sr)-.55 G(elo-)-2.5 E (cated position that occurs when it gets \215ipped "left-to-right".)248 684 Q 61.9( is)144 700.8 R 2.5(as)2.5 G(caling f)-2.5 E (actor in the v)-.1 E(ertical dimension for the EPS image.)-.15 E -1.11 (Va)5 G(lues)1.11 E(between 0.0 and 1.0 shrink the image in the v)248 712.8 Q(ertical dimension while)-.15 E -.25(va)248 724.8 S(lues o).25 E -.15(ve)-.15 G 2.5(r1).15 G(.0 e)-2.5 E(xpand the image in the v)-.15 E (ertical dimension.)-.15 E(Note that a)5 E -1.11(Ve)72 768 S (rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(6)203.45 E 0 Cg EP %%Page: 7 7 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F(ne)248 84 Q -.05(ga)-.15 G(ti).05 E .3 -.15 (ve v)-.25 H (alue for this parameter can be useful in the less-than-rare case)-.1 E (that you \214nd that your EPS image needs to be \215ipped about the ho\ rizon-)248 96 Q(tal axis \(i.e. top to bottom\).)248 108 Q (In such cases, you can use a ne)5 E -.05(ga)-.15 G(ti).05 E .3 -.15 (ve <)-.25 H(y-).15 E(scale> v)248 120 Q(alue to achie)-.25 E .3 -.15 (ve t)-.25 H(his without ha).15 E(ving to tweak the actual Post-)-.2 E (Script content within the EPS image \214le.)248 132 Q(Use of a ne)5 E -.05(ga)-.15 G(ti).05 E .3 -.15(ve v)-.25 H(alue will)-.1 E (undoubtedly necessitate a corresponding change to the param-) 248 144 Q(eter to account for the image')248 156 Q 2.5(sr)-.55 G (elocated position that occurs when it)-2.5 E(gets \215ipped "upside do) 248 168 Q(wn".)-.25 E 62.45( :=)144 184.8 R 2.5(ah)2.5 G (orizontal adjustment in typographic `points' \(i.e. 72nds of an inch\)) -2.5 E(for the positioning of the EPS image.)248 196.8 Q -.4(Wi)5 G (th of).4 E(fsets of 0 for X and Y)-.25 E 2.5(,t)-1.29 G(he)-2.5 E (image will be printed at the e)248 208.8 Q (xtreme left edge of the box for that day)-.15 E 2.5(,j)-.65 G(ust)-2.5 E(under the numerics for that day)248 220.8 Q 5(.P)-.65 G(ositi)-5 E .3 -.15(ve v)-.25 H(alues mo)-.1 E .3 -.15(ve t)-.15 H(he image to the).15 E(right and ne)248 232.8 Q -.05(ga)-.15 G(ti).05 E .3 -.15(ve v)-.25 H (alues mo)-.1 E .3 -.15(ve t)-.15 H(he image to the left.).15 E 62.45 ( :=)144 249.6 R 2.5(av)2.5 G (ertical adjustment in typographic `points' \(i.e. 72nds of an inch\)) -2.65 E(for the positioning of the EPS image.)248 261.6 Q -.4(Wi)5 G (th of).4 E(fsets of 0 for X and Y)-.25 E 2.5(,t)-1.29 G(he)-2.5 E (image will be printed at the e)248 273.6 Q (xtreme left edge of the box for that day)-.15 E 2.5(,j)-.65 G(ust)-2.5 E(under the numerics for that day)248 285.6 Q 5(.P)-.65 G(ositi)-5 E .3 -.15(ve v)-.25 H(alues mo)-.1 E .3 -.15(ve t)-.15 H(he image up and).15 E(ne)248 297.6 Q -.05(ga)-.15 G(ti).05 E .3 -.15(ve v)-.25 H(alues mo) -.1 E .3 -.15(ve t)-.15 H(he image do).15 E(wn.)-.25 E(Here')108 314.4 Q 2.5(sa)-.55 G 2.5(ne)-2.5 G(xample of a line from the date \214le that \ associates an EPS image with an e)-2.65 E -.15(ve)-.25 G(nt:).15 E/F1 10 /Courier@0 SF(4th Thu in Nov*)144 331.2 Q(Thanksgiving)18 E (4th Thu in Nov*)144 343.2 Q(image:/eps-path/turkey.eps 1.0 1.0 0 0)18 E F0 -1.1(Yo)108 360 S 2.5(uc)1.1 G(an place as man)-2.5 E 2.5(yi)-.15 G (mages as you w)-2.5 E (ant on a single day of the month by specifying repeated lines in the) -.1 E(date \214le.)108 372 Q -.15(Fo)5 G 2.5(re).15 G (xample, these lines put icons of Geor)-2.65 E(ge W)-.18 E (ashington and Abraham Lincoln on the day of the)-.8 E(U.S. `)108 384 Q (`Presidents' Day')-.74 E 2.5('h)-.74 G(oliday)-2.5 E 2.5(,a)-.65 G (long with the e)-2.5 E -.15(ve)-.25 G(nt te).15 E(xt:)-.15 E F1 (3rd Monday in Feb*)144 400.8 Q(Presidents' Day)18 E(3rd Monday in Feb*) 144 412.8 Q(image:/eps-path/washington.eps 0.08 0.08 8 0)18 E (3rd Monday in Feb*)144 424.8 Q (image:/eps-path/lincoln.eps 0.22 0.22 48 0)18 E F0(Note that the icon \ for Lincoln is shifted to the right by 48 typographic points so as not \ to o)108 441.6 Q -.15(ve)-.15 G(rlay the \214rst).15 E(icon.)108 453.6 Q (The)108 470.4 Q/F2 10/Times-Italic@0 SF(pcal)3.75 E F0 (releases come with a single EPS sample \214le \('eps/rec)3.01 E (ycle.eps'\) of the ubiquitous ')-.15 E(rec)-.5 E(ycle' icon \(3)-.15 E (green arro)108 482.4 Q(ws in a triangular shape\).)-.25 E (Such an image might be used with con\214guration \214le settings lik)5 E 2.5(et)-.1 G(his:)-2.5 E F1(second Sat in all RECYCLE!)144 499.2 Q (second Sat in all image:/eps-path/recycle.eps 0.039 0.039 34 -9)144 511.2 Q F0(In cases where you')108 528 Q(re displaying non-holiday e)-.5 E -.15(ve)-.25 G(nt te).15 E(xt \(e.g. someone')-.15 E 2.5(sb)-.55 G (irthday\) and an EPS image, you')-2.5 E(ll)-.1 E (often need to use a ne)108 540 Q -.05(ga)-.15 G(ti).05 E .3 -.15(ve `) -.25 H -1.11(Y-).15 G(delta' v)1.11 E(alue on the EPS image speci\214ca\ tion line, in order to shift the image)-.25 E(do)108 552 Q (wn so that it doesn')-.25 E 2.5(tc)-.18 G -.15(ove)-2.5 G 2.5(rt).15 G (he e)-2.5 E -.15(ve)-.25 G(nt te).15 E(xt, which appears just belo)-.15 E 2.5(wt)-.25 G(he day')-2.5 E 2.5(sn)-.55 G(umerics for non-holiday) -2.5 E -2.15 -.25(ev e)108 564 T 2.5(nts. \(T).25 F -.15(ex)-.7 G 2.5 (tf).15 G(or holiday e)-2.5 E -.15(ve)-.25 G (nts appears higher up, to the right of the day').15 E 2.5(sn)-.55 G (umerics, so there')-2.5 E 2.5(su)-.55 G(sually no)-2.5 E (collision with the EPS image.\))108 576 Q/F3 10/Times-Bold@0 SF(Note:) 108 592.8 Q F0(Unfortunately)2.5 E 2.5(,m)-.65 G (ost EPS images cannot be used directly by)-2.5 E F2(pcal)2.5 E F0(.).51 E(Depending on the EPS image used and ho)144 621.6 Q 2.5(wi)-.25 G 2.5 (tw)-2.5 G(as created, you may ha)-2.6 E .3 -.15(ve t)-.2 H 2.5(or).15 G (emo)-2.5 E .3 -.15(ve o)-.15 H 2.5(rc).15 G(omment)-2.5 E (out some or all of the PostScript `translate' commands, in order to a) 144 633.6 Q -.2(vo)-.2 G(id the use of illogical X-).2 E(delta and Y)144 645.6 Q(-delta v)-1.11 E(alues when specifying the EPS image in your) -.25 E F2(pcal)3.75 E F0(date \214le. Most programs that)3.01 E (generate EPS output \(either directly or via con)144 657.6 Q -.15(ve) -.4 G(rsion from some other graphic format\) seem to).15 E(ha)144 669.6 Q .3 -.15(ve t)-.2 H(hese `translate' commands relati).15 E -.15(ve)-.25 G(ly early in the EPS \214le.).15 E(It may tak)144 686.4 Q 2.5(es)-.1 G (ome e)-2.5 E(xperimentation to get it just right.)-.15 E(Pre)5 E(vie) -.25 E 2.5(wt)-.25 G(he)-2.5 E F2(pcal)3.75 E F0 (output using a PostScript)3.01 E(vie)144 698.4 Q(wer as you tweak the \ PostScript commands in the EPS image \214le and/or the e)-.25 E -.15(ve) -.25 G(nt entry in the).15 E F2(pcal)145.25 710.4 Q F0(date \214le.)3.01 E F3(Note:)180 727.2 Q F0 (Depending upon what application you use to pre)2.5 E(vie)-.25 E 2.5(wP) -.25 G(ostScript content, the)-2.5 E -1.11(Ve)72 768 S(rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(7)203.45 E 0 Cg EP %%Page: 8 8 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F(monthly calendars may not sho)180 84 Q 2.5(wa) -.25 G .3 -.15(ny e)-2.5 H(mbedded EPS images.).15 E(Here')5 E 2.5(sar) -.55 G(undo)-2.5 E(wn of some)-.25 E(popular PostScript-vie)180 96 Q (wing applications and whether the)-.25 E 2.5(yc)-.15 G (orrectly display the embedded)-2.5 E(EPS images:)180 108 Q 6.5<8367>216 129.6 S 2.5(v\()-6.5 G -.15(ve)-2.5 G (rsion 3.5.8\) -- EPS images appear \214ne).15 E 6.5<8367>216 146.4 S (gv \(v)-6.5 E(ersions 2.4.0.1 and 2.6.1\) -- EPS images appear \214ne) -.15 E 6.5<836f>216 163.2 S(lder kghostvie)-6.5 E 2.5(w\()-.25 G -.15 (ve)-2.5 G(rsions 0.13.2 [KDE 3.1.4] and 0.2.0 [KDE 3.2.3 and).15 E (3.3.2]\) -- EPS images DO NO)226 175.2 Q 2.5(TA)-.4 G(PPEAR!)-2.5 E 6.5 <836e>216 192 S -.25(ew)-6.5 G(er kghostvie).25 E 2.5(w\()-.25 G -.15 (ve)-2.5 G(rsion 0.2.0 [KDE 3.4.2 and 3.5.4]\) -- EPS images).15 E (appear \214ne)226 204 Q -.15(Fo)108 230.4 S 2.5(rc).15 G(on)-2.5 E -.15 (ve)-.4 G(rting non-EPS images \(e.g. photos\) to EPS format, one can u\ se the graphical GNU Image Manip-).15 E (ulation Program, a.k.a. `The GIMP':)108 242.4 Q/F1 10/Times-Italic@0 SF (http://www)144 259.2 Q(.gimp.or)-.74 E(g)-.37 E F0 -.15(Fo)108 288 S 2.5(ri).15 G(cons/images in WMF format \(which are popular in v)-2.5 E (arious 3rd-party)-.25 E 2.5(,l)-.65 G -2.25 -.15(eg a)-2.5 H -.15(cy) .15 G(-OS, commercial calendar).15 E(programs\), the `libwmf)108 300 Q ('/`wmf2eps' library/utility is useful for generating).55 E F1(pcal)2.5 E F0(-capable EPS images.).51 E(It can)5 E(be found at this site:)108 312 Q F1(http://wvwar)144 328.8 Q -.15(e.)-.37 G(sour).15 E(cefor)-.37 E -.1(ge)-.37 G(.net/libwmf)-.05 E(.html)-.15 E F0 -.15(Fo)108 357.6 S 2.5 (ri).15 G(cons/images in SV)-2.5 E 2.5(Gf)-.15 G (ormat, the ImageMagick `con)-2.5 E -.15(ve)-.4 G (rt' utility is sometimes useful for generating).15 E F1(pcal)108 369.6 Q F0(-capable EPS images.).51 E(This suite of utilities \(which include\ s other useful ImageMagick utilities lik)5 E(e)-.1 E (`display' and `identify'\) may already be a)108 381.6 Q -.25(va)-.2 G (ilable on your Linux distrib).25 E 2.5(ution. If)-.2 F (not, it can be found at this)2.5 E(site:)108 393.6 Q F1(http://www)144 410.4 Q(.ima)-.74 E -.1(ge)-.1 G(ma).1 E(gic)-.1 E(k.or)-.2 E(g)-.37 E F0 -.15(Fo)108 439.2 S 2.5(rc).15 G(ases where ImageMagick')-2.5 E 2.5 (s`)-.55 G(con)-2.5 E -.15(ve)-.4 G(rt' utility f).15 E (ails to properly con)-.1 E -.15(ve)-.4 G(rt SV).15 E (G-format images to EPS for)-.15 E(-)-.2 E (mat, you can try the method of con)108 451.2 Q -.15(ve)-.4 G (rting the SV).15 E 2.5(Gi)-.15 G (mage into an intermediate format \(e.g. PNG\) using the)-2.5 E (`rsvg' utility)108 463.2 Q 5(.T)-.65 G(his utility may already be a)-5 E -.25(va)-.2 G(ilable on your Linux distrib).25 E 2.5(ution. If)-.2 F (not, it can be found at)2.5 E(this site:)108 475.2 Q F1(http://libr)144 492 Q(svg)-.1 E(.sour)-.15 E(cefor)-.37 E -.1(ge)-.37 G(.net/)-.05 E F0 (From the PNG format, the image can often then be successfully con)108 508.8 Q -.15(ve)-.4 G(rted to EPS format, using the abo).15 E -.15(ve) -.15 G(-).15 E(mentioned ImageMagick `con)108 520.8 Q -.15(ve)-.4 G (rt' utility).15 E(.)-.65 E(The)108 549.6 Q F1(Open Clip Art Libr)2.4 E (ary)-.15 E F0(is a good source of freely-usable images \(man)2.82 E 2.5 (yo)-.15 G 2.5(fw)-2.5 G(hich are in SV)-2.5 E 2.5(Gf)-.15 G (ormat\) for)-2.5 E(decorating your e)108 561.6 Q -.15(ve)-.25 G(nts:) .15 E F1(http://www)144 578.4 Q(.openclipart.or)-.74 E(g)-.37 E/F2 10 /Times-Bold@0 SF(Note:)108 607.2 Q F0(The EPS image content is not gene\ rated in the PostScript output -- only a reference to the EPS image)2.5 E(\214lename is generated.)108 619.2 Q (From a practical standpoint, this means that normally you')5 E (ll need to print/pre)-.1 E(vie)-.25 E(w)-.25 E (the PostScript output of)108 631.2 Q F1(pcal)3.75 E F0 (from the same computer/setup as that which w)3.01 E(as used to run)-.1 E F1(pcal)3.75 E F0(in the \214rst)3.01 E 2.5(place. If)108 643.2 R (you w)2.5 E(ant to generate a calendar with embedded EPS images that w\ ill later be printed/vie)-.1 E(wed on)-.25 E (another machine which does not ha)108 655.2 Q .3 -.15(ve a)-.2 H (ccess to those EPS images, you').15 E (ll need to run the output through a)-.1 E(pre-processor which will put\ the EPS image content into the PostScript output \214le.)108 667.2 Q -.15(Fo)5 G 2.5(re).15 G(xample, assuming)-2.65 E (your initial calendar output w)108 679.2 Q(as generated to a \214le na\ med `pcal.ps', on most GNU/Linux systems you could)-.1 E (run this command, which uses the popular `Ghostscript' interpreter:)108 691.2 Q(gs -r300x300 -dB)144 708 Q -1.11(AT)-.35 G(CH -dNOP)1.11 E -.55 (AU)-.92 G(SE -sDEVICE=pswrite -sOutputFile=out.ps pcal.ps).55 E(This w) 108 724.8 Q(ould generate a PostScript \214le named `out.ps', at 300x30\ 0 dpi resolution, which has the actual EPS)-.1 E -1.11(Ve)72 768 S (rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(8)203.45 E 0 Cg EP %%Page: 9 9 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F(image content embedded within, allo)108 84 Q (wing you to transport the `out.ps' \214le to another computer for vie) -.25 E(w-)-.25 E 2.5(ing/printing. Of)108 96 R(course, the ne)2.5 E 2.5 <778c>-.25 G(le is substantially lar)-2.5 E(ger)-.18 E 2.5(,b)-.4 G (ut it')-2.7 E 2.5(sp)-.55 G(ortable. Furthermore, the EPS images)-2.5 E (will be vie)108 108 Q -.1(wa)-.25 G(ble e).1 E -.15(ve)-.25 G 2.5(ni) .15 G 2.5(nP)-2.5 G(ostScript-vie)-2.5 E(wing applications \(see abo) -.25 E -.15(ve)-.15 G 2.5(\)w).15 G(hich don')-2.5 E 2.5(tp)-.18 G (roperly support the dis-)-2.5 E (play of embedded \(by \214lename only\) EPS images.)108 120 Q/F1 10 /Times-Bold@0 SF(Pr)87 160.8 Q(e-Pr)-.18 E(ocessor Functionality)-.18 E /F2 10/Times-Italic@0 SF(Pcal)108.5 172.8 Q F0(supports rudimentary)3.01 E F2(cpp)2.5 E F0(-lik).19 E 2.5(ef)-.1 G (unctionality in the date \214le, allo)-2.5 E(wing the follo)-.25 E (wing constructs:)-.25 E<83>144 194.4 Q F1(de\214ne | undef)6.5 E F0<83> 144 211.2 Q F1(if{{n}def} ... {elif ...}* {else ...} endif)6.5 E F0<83> 144 228 Q F1(include)6.5 E F0 (Note that these are not preceded by `#' as the)108 244.8 Q 2.5(ya)-.15 G(re in C.)-2.5 E(Symbol names de\214ned using these k)108 261.6 Q -.15 (ey)-.1 G -.1(wo).15 G(rds \(or via the).1 E F1(-D)2.5 E F0 (option\) are case-insensiti)2.5 E -.15(ve)-.25 G 5(.I).15 G 2.5(ti)-5 G 2.5(sn)-2.5 G(ot an error to)-2.5 E F1(undef)108 273.6 Q F0 (an unde\214ned symbol, nor to)2.5 E F1(de\214ne)2.5 E F0 2.5(ap)2.5 G (re)-2.5 E(viously-de\214ned one.)-.25 E 2.5(As)108 290.4 S (ymbol can be de\214ned with just a name \(e.g. `)-2.5 E (`de\214ne MY_SYM')-.74 E('\) or it can tak)-.74 E 2.5(eo)-.1 G 2.5(nav) -2.5 G(alue \(e.g. `)-2.75 E(`de\214ne)-.74 E(MY_SYM SOME_V)108 302.4 Q (ALUE')-1.35 E 2.5('\). Use)-.74 F(of symbol v)2.5 E(alues is con)-.25 E -.15(ve)-.4 G(nient for de\214ning a starting date then using).15 E (that symbol to reference that starting date in one or more e)108 314.4 Q -.15(ve)-.25 G 2.5(nts. F).15 F(or e)-.15 E (xample, these de\214nitions in the date)-.15 E(\214le might be useful:) 108 326.4 Q/F3 10/Courier@0 SF(define semester_start 8/23)144 343.2 Q 6 (#B)18 G(eginning of semester)-6 E 96(semester_start Class)144 355.2 R (Start)6 E 6(7th day)144 367.2 R(after semester_start)6 E(1st Quiz)12 E (14th day after semester_start)144 379.2 Q(2nd Quiz)12 E (undef semester_start)144 391.2 Q F0(Be a)108 408 Q -.1(wa)-.15 G (re that the substitution of symbol v).1 E (alues for symbol names is not rob)-.25 E(ust, so it')-.2 E 2.5(sw)-.55 G(ise to use a symbol)-2.5 E(name that')108 420 Q 2.5(su)-.55 G(nlik) -2.5 E(ely to occur in an)-.1 E 2.5(yo)-.15 G 2.5(fy)-2.5 G(our other e) -2.5 E -.15(ve)-.25 G(nt te).15 E 2.5(xt. In)-.15 F(other w)2.5 E (ords, if you de\214ned the `semes-)-.1 E(ter_start' symbol in the e)108 432 Q(xample abo)-.15 E .3 -.15(ve a)-.15 H 2.5(sm).15 G (erely `start', then you')-2.5 E 2.5(dg)-.5 G(et the undesired ef)-2.5 E (fect of ha)-.25 E(ving the)-.2 E(te)108 444 Q (xt `Class 8/23' in your calendar on that day instead of `Class Start'!) -.15 E(The use of `undef semester_start' in)5 E(the abo)108 456 Q .3 -.15(ve ex)-.15 H(ample is optional and is really only useful to pre).15 E -.15(ve)-.25 G(nt an).15 E 2.5(yu)-.15 G(nw)-2.5 E (anted symbol substitutions later)-.1 E(on, which probably w)108 468 Q (on')-.1 E 2.5(th)-.18 G (appen unless you poorly choose your symbol name to be)-2.5 E(gin with.) -.15 E(An)108 484.8 Q F1(ifdef)2.5 E F0(alone is al)2.5 E -.1(wa)-.1 G (ys).1 E F1(false)2.5 E F0 2.5(;a)C(n)-2.5 E F1(ifndef)2.5 E F0 (alone is al)2.5 E -.1(wa)-.1 G(ys).1 E F1(true)2.5 E F0(.)A F1(if)5 E F0(is accepted as a synon)2.5 E(ym for)-.15 E F1(ifdef)2.5 E F0(.)A (The name of the \214le in the)108 501.6 Q F1(include)2.5 E F0(directi) 2.5 E .3 -.15(ve m)-.25 H (ay optionally be surrounded by either "" or <>, both of).15 E (which are ignored.)108 513.6 Q (If the name is not an absolute path, it is tak)5 E(en to be relati)-.1 E .3 -.15(ve t)-.25 H 2.5(ot).15 G(he directory where the)-2.5 E (\214le containing the directi)108 525.6 Q .3 -.15(ve i)-.25 H 2.5(sl) .15 G 2.5(ocated. If)-2.5 F (the string "%y" appears in the \214le name, it is replaced by the last) 2.5 E(tw)108 537.6 Q 2.5(od)-.1 G(igits of the current year or)-2.5 E 2.5(,i)-.4 G 2.5(f")-2.5 G(year all" is in ef)-2.5 E(fect, is e)-.25 E (xpanded to all applicable years.)-.15 E F2(Pcal)5.5 E F0(is smart)3.01 E(enough to translate)108 549.6 Q F1(~/)2.5 E F0(to the user')2.5 E 2.5 (sh)-.55 G(ome directory)-2.5 E(.)-.65 E F2(Pcal)108.5 566.4 Q F0 (normally terminates immediately if the \214le speci\214ed in an)3.01 E F1(include)2.5 E F0(directi)2.5 E .3 -.15(ve d)-.25 H(oes not e).15 E 2.5(xist. An)-.15 F(alter)2.5 E(-)-.2 E(nate form of the directi)108 578.4 Q -.15(ve)-.25 G(,).15 E F1(include?)2.5 E F0 2.5(,d)C(irects)-2.5 E F2(pcal)3.75 E F0(to continue silently if the \214le does not e)3.01 E (xist or cannot be)-.15 E(opened.)108 590.4 Q (In addition to pre-processing k)108 607.2 Q -.15(ey)-.1 G -.1(wo).15 G (rds,).1 E F2(pcal)3.75 E F0(also accepts boolean e)3.01 E (xpressions in)-.15 E F1(if{{n}def})2.5 E F0(and)2.5 E F1(elif)2.5 E F0 (direc-)2.5 E(ti)108 619.2 Q -.15(ve)-.25 G 2.5(s. These).15 F -.15(ex) 2.5 G(pressions consist of symbol names joined by the boolean operators) .15 E F1(!)2.5 E F0(,)A F1(&)2.5 E F0(,)A F1(^)2.5 E F0 2.5(,a)C(nd)-2.5 E F1(|)2.5 E F0 2.5(,i)C 2.5(no)-2.5 G(rder of)-2.5 E (precedence, high to lo)108 631.2 Q 3.8 -.65(w. P)-.25 H (arentheses may be used to alter the precedence.).5 E(The synon)5 E(yms) -.15 E F1(&&)2.5 E F0(and)2.5 E F1(||)2.5 E F0(are)2.5 E(accepted for) 108 643.2 Q F1(&)2.5 E F0(and)2.5 E F1(|)2.5 E F0 5(.A)C(symbol name e) -2.5 E -.25(va)-.25 G(luates to).25 E F1(true)2.5 E F0 (if currently de\214ned,)2.5 E F1(false)2.5 E F0(if not; thus:)2.5 E F3 (ifdef A | B | C)144 660 Q F0(...is)108 676.8 Q F1(true)2.5 E F0(if an) 2.5 E 2.5(yo)-.15 G 2.5(ft)-2.5 G (he symbols A, B, and C is de\214ned, and:)-2.5 E F3(ifdef A & B & C)144 693.6 Q F0(...is)108 710.4 Q F1(true)2.5 E F0(if the)2.5 E 2.5(ya)-.15 G (ll are.)-2.5 E(Note that)5 E F1(ifndef )2.5 E F0(is equi)2.5 E -.25(va)-.25 G(lent to).25 E F1(ifdef !\( \).)2.5 E F0 -1.11(Ve) 72 768 S(rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(9)203.45 E 0 Cg EP %%Page: 10 10 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F/F1 10/Times-Bold@0 SF(The Moon File)87 84 Q F0 (If a \214le of the name)108 96 Q/F2 10/Times-Italic@0 SF(.moon##)2.5 E F0(\()3.4 E F2(moon##.dat).38 E F0(under MS-DOS\), where)2.5 E F1(##)2.5 E F0(is the last tw)2.5 E 2.5(od)-.1 G(igits of the calendar)-2.5 E (year)108 108 Q 2.5(,e)-.4 G(xists in the same directory as the date \ \214le \(or in the directory where)-2.65 E F2(pcal)3.75 E F0(resides\),) 3.01 E F2(pcal)3.75 E F0(uses the)3.01 E (information contained within to calculate the phase of the moon.)108 120 Q(If a\) no such \214le e)5 E(xists, b\) the)-.15 E F12.5 E F0 (\215ag \(do)2.5 E(not use a date \214le\) is speci\214ed, or c\) the) 108 132 Q F12.5 E F0 (\215ag \(specify time zone\) is speci\214ed, then)2.5 E F2(pcal)3.75 E F0(uses an algo-)3.01 E(rithm to calculate the phase of the moon.)108 144 Q(Entries in the moon \214le must conform to the follo)108 160.8 Q (wing syntax:)-.25 E(If the)108 177.6 Q F12.5 E F0 (option \(American date formats, the def)2.5 E(ault\) is gi)-.1 E -.15 (ve)-.25 G(n:).15 E/F3 10/Courier@0 SF ( {})144 194.4 Q F0(If the) 108 211.2 Q F12.5 E F0(option \(European date formats\) is gi)2.5 E -.15(ve)-.25 G(n:).15 E F3 ( {})144 228 Q F0(Where:)108 244.8 Q 29.9( :=)144 261.6 R -.74(``)2.5 G(nm').74 E(', `)-.74 E(`fq')-.74 E 2.5('o)-.74 G 2.5(r`)-2.5 G(`1q')-3.24 E(', `)-.74 E(`fm') -.74 E(', `)-.74 E(`3q')-.74 E 2.5('o)-.74 G 2.5(r`)-2.5 G(`lq')-3.24 E 2.5('\()-.74 G(ne)-2.5 E 2.5(wm)-.25 G(oon,)-2.5 E(\214rst quarter)252 273.6 Q 2.5(,f)-.4 G(ull moon, last quarter\))-2.5 E 39.89( :=)144 285.6 R(number 0-23 \(24-hour clock\))2.5 E 42.66( :=)144 297.6 R (number 0-59)2.5 E (This \214le must contain entries for all quarter moons in the year)108 314.4 Q 2.5(,i)-.4 G 2.5(nc)-2.5 G(hronological order; if an)-2.5 E 2.5 (ye)-.15 G(rrors are)-2.5 E(encountered,)108 326.4 Q F2(pcal)3.75 E F0 (will re)3.01 E -.15(ve)-.25 G(rt to using its def).15 E (ault algorithm.)-.1 E(As in the date \214le, comments start with `#' a\ nd run through the end of the gi)108 343.2 Q -.15(ve)-.25 G 2.5(nl).15 G (ine.)-2.5 E(The moon \214le may optionally contain an)108 360 Q F1 (opt \255A)2.5 E F0(or)2.5 E F1(opt \255E)2.5 E F0 (line to specify the format of its o)2.5 E(wn date entries)-.25 E (independently of the format used in the date \214le.)108 372 Q (No other \215ags are le)5 E -.05(ga)-.15 G 2.5(li).05 G 2.5(nt)-2.5 G (he moon \214le.)-2.5 E F1(Generating P)87 417.6 Q (ostScript Calendars V)-.2 E(ia A W)-.37 E(eb Br)-.65 E -.1(ow)-.18 G (ser Interface).1 E F0(PostScript-format)108 429.6 Q F2(pcal)3.75 E F0 (calendars can be generated and vie)3.01 E(wed from a web bro)-.25 E (wser interf)-.25 E(ace.)-.1 E F1(Note:)144 446.4 Q F0(This is not to b\ e confused with the ability to generate non-PostScript, HTML-format \(u\ sing)2.5 E(the)144 458.4 Q F12.5 E F0 (command-line option\) calendars, which is a dif)2.5 E (ferent capability entirely)-.25 E(.)-.65 E F2(Pcal)108.5 475.2 Q F0 (comes with 4 \214les that pro)3.01 E(vide this ability: `pcal.cgi' \(a\ Bourne shell script\), `pcal.pl' \(a Perl equi)-.15 E(v-)-.25 E (alent of `pcal.cgi'\), `pcal.html', and `pcal)108 487.2 Q -.65(w.)-.1 G (html'.).65 E(The CGI \214le \(either `pcal.cgi' or `pcal.pl'\) must be\ edited before using it. Change the de\214nition for)108 504 Q F2 (`pcal=')1.29 E F0(\(Bourne shell script\) or)108 516 Q F2(`my $PCAL =') 1.29 E F0(\(Perl script\) to point to the location of the)2.57 E F2 (pcal)3.75 E F0 -.15(exe)3.01 G(cutable \214le.).15 E (Change the de\214nition for)108 528 Q F2(`\214le=')1.29 E F0 (\(Bourne shell script\) or)2.57 E F2(`my $FILE =')1.29 E F0 (\(Perl script\) to point to the location)2.57 E(of the)108 540 Q F2 (pcal)3.75 E F0(`date \214le' \(e.g. `.calendar'\), which contains the \ options for running)3.01 E F2(pcal)2.5 E F0 5(.F).51 G(inally)-5 E 2.5 (,c)-.65 G(op)-2.5 E 2.5(yt)-.1 G(he)-2.5 E (`pcal.cgi' \(or `pcal.pl'\) \214le to the location where your web serv) 108 552 Q(er e)-.15 E(xpects to \214nd such \214les \(e.g.)-.15 E(`/v) 108 564 Q(ar/www/cgi-bin/'\).)-.25 E(The `pcal.html' and `pcal)108 580.8 Q -.65(w.)-.1 G(html' \214les must also be edited.).65 E (Each one has a line lik)5 E 2.5(et)-.1 G(his:)-2.5 E()-.4 E(That line \ must be edited to point to the host and location of your CGI script \ \214le \(`pcal.cgi' or `pcal.pl'\).)108 614.4 Q(Once that')108 631.2 Q 2.5(sd)-.55 G(one, point your web bro)-2.5 E (wser to the `pcal.html' or `pcal)-.25 E -.65(w.)-.1 G (html' \214le to generate monthly/yearly).65 E (PostScript calendars for vie)108 643.2 Q(wing within your web bro)-.25 E(wser)-.25 E(.)-.55 E F1(Note:)144 660 Q F0 (Depending upon what application your web bro)2.5 E(wser spa)-.25 E (wns to pre)-.15 E(vie)-.25 E 2.5(wP)-.25 G(ostScript content,)-2.5 E (the monthly calendars generated via this web bro)144 672 Q(wser interf) -.25 E(ace may not sho)-.1 E 2.5(wa)-.25 G .3 -.15(ny e)-2.5 H (mbedded EPS).15 E 2.5(images. F)144 684 R(or a rundo)-.15 E (wn of some popular PostScript-vie)-.25 E (wing applications and whether the)-.25 E 2.5(yc)-.15 G(or)-2.5 E(-)-.2 E(rectly display the embedded EPS images, see the section \(abo)144 696 Q -.15(ve)-.15 G 2.5(\)e).15 G(ntitled `Encapsulated PostScript)-2.5 E (\(EPS\) Images'.)144 708 Q -1.11(Ve)72 768 S(rsion 4.11.0)1.11 E (18 Dec 2007)150.4 E(10)198.45 E 0 Cg EP %%Page: 11 11 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F/F1 10.95/Times-Bold@0 SF(OPTIONS)72 84 Q/F2 10 /Times-Bold@0 SF108 96 Q F0(Prints an empty calendar)25.86 E 5(.D) -.55 G 2.5(on)-5 G(ot print entries from a)-2.5 E/F3 10/Times-Italic@0 SF(.calendar)2.73 E F0(\214le e)3.23 E -.15(ve)-.25 G 2.5(ni).15 G 2.5 (fo)-2.5 G(ne e)-2.5 E(xists.)-.15 E F2108 112.8 Q F3(cal)2.5 E F0 (Directs)12.25 E F3(pcal)3.75 E F0(to use the \214le name)3.01 E F3(cal) 2.7 E F0(as the input \214le in place of the def)3.01 E(ault)-.1 E F3 (.calendar)2.73 E F0 2.5(\214le. Note)3.23 F (that the search rules are dif)144 124.8 Q(ferent when)-.25 E F2 2.5 E F0(is used.)2.5 E(If)5 E F3(cal)2.7 E F0 (is an absolute \214le name \(i.e. starting with)3.01 E 2.5(a`)144 136.8 S(/'\), then)-2.5 E F3(pcal)3.75 E F0 (attempts to open only that \214le.)3.01 E(Otherwise,)5 E F3(pcal)3.75 E F0(looks for)3.01 E F3(cal)2.7 E F0(in the current direc-)3.01 E(tory) 144 148.8 Q 2.5(,t)-.65 G(hen in the directory indicated by the en)-2.5 E(vironment v)-.4 E(ariable)-.25 E F2(PCAL_DIR)2.5 E F0 (\(if de\214ned\), and)2.5 E(\214nally)144 160.8 Q 2.5(,i)-.65 G 2.5(fe) -2.5 G(nabled \(via the `SEARCH_PCAL_DIR' \215ag\) when)-2.5 E F3(pcal) 3.75 E F0 -.1(wa)3.01 G 2.5(sb).1 G(uilt, in the directory)-2.7 E (where the)144 172.8 Q F3(pcal)3.75 E F0 -.15(exe)3.01 G (cutable resides.).15 E(If the gi)5 E -.15(ve)-.25 G(n).15 E F3(cal)2.7 E F0(\214le is not found, an error results.)3.01 E F2108 189.6 Q F3(\214le)2.5 E F0(Directs)10.58 E F3(pcal)3.75 E F0 (to write the output to)3.01 E F3(\214le)4.41 E F0 (instead of to stdout.)2.68 E F2108 206.4 Q F0 (Causes the output to be in landscape mode \(def)27.52 E(ault\).)-.1 E F3(Pcal)144.5 240 Q F0(prede\214nes the symbol `ORIENT)3.01 E -1.11(AT) -.93 G(ION_LANDSCAPE' whene)1.11 E -.15(ve)-.25 G 2.5(r`).15 G (landscape' page orienta-)-2.5 E(tion is enabled.)144 252 Q (This can be useful for pro)5 E(viding alternate v)-.15 E (alues in the con\214guration \214le for EPS)-.25 E (image placement and scaling, based on the page orientation.)144 264 Q F2108 292.8 Q F0(Causes the output to be in portrait mode.)24.74 E F3(Pcal)144.5 326.4 Q F0(prede\214nes the symbol `ORIENT)3.01 E -1.11 (AT)-.93 G(ION_POR)1.11 E(TRAIT' whene)-.6 E -.15(ve)-.25 G 2.5(r`).15 G (portrait' page orientation is)-2.5 E 2.5(enabled. This)144 338.4 R (can be useful for pro)2.5 E(viding alternate v)-.15 E (alues in the con\214guration \214le for EPS image)-.25 E (placement and scaling, based on the page orientation.)144 350.4 Q F2 108 379.2 Q F0(Selects the paper size.)24.19 E(The follo)5 E (wing sizes are supported:)-.25 E 6.5<836c>180 400.8 S (etter \212 8.5 x 11.0 inches)-6.5 E 6.5<836c>180 417.6 S -2.25 -.15 (eg a)-6.5 H 2.5(l\2128).15 G(.5 x 14.0 inches)-2.5 E 6.5<8361>180 434.4 S 2.5(4\2122)-6.5 G(10 x 297 mm)-2.5 E 6.5<8374>180 451.2 S (abloid \212 11.0 x 17.0 inches)-6.5 E F3(Pcal)144.5 480 Q F0 (prede\214nes one of the follo)3.01 E (wing symbols based on the current paper size:)-.25 E 6.5<8350>180 501.6 S(APERSIZE_LETTER)-7.42 E 6.5<8350>180 518.4 S(APERSIZE_LEGAL)-7.42 E 6.5<8350>180 535.2 S(APERSIZE_A4)-7.42 E 6.5<8350>180 552 S(APERSIZE_T) -7.42 E(ABLOID)-.93 E(These symbol de\214nitions can be useful for pro) 144 568.8 Q(viding alternate v)-.15 E (alues in the con\214guration \214le for)-.25 E (EPS image placement and scaling, based on paper size.)144 580.8 Q F2 108 614.4 Q F0(Causes the Julian date \(day of year\) to be print\ ed in each calendar box.)26.97 E F2108 631.2 Q F0(Causes the Juli\ an date and the number of days remaining in the year to be printed in e\ ach calendar)25.3 E(box.)144 643.2 Q F2108 660 Q F0 (Causes moon icons to be printed on dates corresponding to ne)21.97 E 1.3 -.65(w, h)-.25 H(alf, and full moons \(the def).65 E(ault)-.1 E (is that no moons are printed\).)144 672 Q F2108 688.8 Q F0 (Causes moon icons to be printed on all dates \(the def)20.86 E (ault is that no moons are printed\).)-.1 E F2108 705.6 Q F3(day1) 2.5 E F0([)A F3(\255day2)A F0(])A F2 2.5(|a)2.5 G(ll | holiday)-2.5 E F0 (Causes all dates f)144 717.6 Q(alling on weekday)-.1 E F3(day1)2.85 E F0(\(through)2.5 E F3(day2)2.85 E F0 (if speci\214ed\) to be printed in the `day)2.52 E (numerics color' \(i.e. the color speci\214ed by the)144 729.6 Q F2 2.5 E F0(option [def)2.5 E(ault = gray]\);)-.1 E F2(\255g all)2.5 E F0(causes all)2.5 E -1.11(Ve)72 768 S(rsion 4.11.0)1.11 E(18 Dec 2007) 150.4 E(11)198.45 E 0 Cg EP %%Page: 12 12 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F(weekdays \(other than holidays\) to be printe\ d in the `day numerics color';)144 84 Q/F1 10/Times-Bold@0 SF (\255g holiday)2.5 E F0(causes all)2.5 E (holidays to be printed in `day numerics color'.)144 96 Q/F2 10 /Times-Italic@0 SF(day1)5 E F0(and)2.5 E F2(day2)2.5 E F0 (may wrap around week)2.5 E(ends; for)-.1 E -.15(ex)144 108 S(ample,).15 E F1(\255g fri\255sun)2.5 E F0(causes Fridays, Saturdays, and Sundays t\ o be printed in the `day numerics)2.5 E(color'.)144 120 Q F1108 136.8 Q F2(day1)2.5 E F0([)A F2(\255day2)A F0(])A F1 2.5(|a)2.5 G (ll | holiday)-2.5 E F0(Similar to)144 148.8 Q F12.5 E F0 2.5(,b)C (ut the selected days will be printed as outlined characters, using the\ `day numerics)-2.7 E(color'.)144 160.8 Q F1108 177.6 Q F2(day1) 2.5 E F0([)A F2(\255day2)A F0(])A F1 2.5(|a)2.5 G(ll | holiday)-2.5 E F0 (Similar to)144 189.6 Q F12.5 E F0 2.5(,b)C(ut the selected days \ will be printed in the `day numerics color', outlined in black.)-2.7 E F1108 206.4 Q F2(day1)2.5 E F0([)A F2(\255day2)A F0(])A F1 2.5(|a) 2.5 G(ll | holiday)-2.5 E F0(Similar to \212 you guessed it \212)144 218.4 Q F12.5 E F0 2.5(,b)C (ut the selected days will be printed in black.)-2.7 E(Since black is)5 E(the def)144 230.4 Q(ault for weekdays, \255b is primarily used to o) -.1 E -.15(ve)-.15 G(rriding other \215ags \(e.g.,).15 E F1 (\255g all \255b sat-sun)2.5 E F0(\).)2.5 E F1(Note:)118 247.2 Q F0 (The def)144 259.2 Q(ault for the abo)-.1 E .3 -.15(ve o)-.15 H(ptions \ is to print Saturdays, Sundays, and holidays in the `day numerics).15 E (color' and all other days in black.)144 271.2 Q -.15(Fo)5 G 2.5(rb).15 G(ackw)-2.5 E(ard compatibility with earlier v)-.1 E(ersions of)-.15 E F2(pcal)2.5 E F0(,).51 E F12.5 E F0(and)144 283.2 Q F12.5 E F0(alone change all non-black days to the speci\214ed color)2.5 E(.)-.55 E F1108 300 Q F2 ([day_numerics_color][/empty_day_box_\214ll_color])2.5 E F0(Ov)144 312 Q (errides the def)-.15 E(ault v)-.1 E(alue\(s\) for the color of the num\ erics for each day and/or the color of the \214ll)-.25 E(used on box)144 324 Q(es for 'empty' days.)-.15 E F1(Note:)5 E F0 (This option only applies to PostScript-format calendars,)2.5 E (not to HTML-format calendars.)144 336 Q(These v)5 E (alues may be set independently of each other)-.25 E 5(.F)-.55 G(or use) -5.15 E(with non-color printers, these v)144 348 Q (alues should be in the range 0.0 \(black\) through 1.0 \(white\).)-.25 E(The)5 E(def)144 360 Q(ault v)-.1 E (alues are 0.8 for day numerics and 0.9 for empty day box)-.25 E 2.5 (es. F)-.15 F(or use with color printers,)-.15 E(these v)144 372 Q (alues may optionally be speci\214ed as a set of)-.25 E F2 -.37(re)2.5 G (d).37 E F0(:)A F2(gr)A(een)-.37 E F0(:)A F2(blue)A F0(\(RGB\) v)2.5 E (alues, each of which)-.25 E(must in the range 0.0 through 1.0.)144 384 Q(At least one `:' must be present for these v)5 E(alues to be recog-) -.25 E(nized as RGB colors; omitted v)144 396 Q(alues are set to 0.0.) -.25 E(This option may also be set semi-permanently by altering the mak) 144 412.8 Q(e\214le \(`Mak)-.1 E(e\214le' for most en)-.1 E(vi-)-.4 E (ronments, 'Mak)144 424.8 Q(e\214le.DOS' for MS-DOS\).)-.1 E F1108 441.6 Q F2(day)2.5 E F0(Selects weekday)7.25 E F2(day)2.85 E F0 (as the \214rst day of the week.)2.82 E(The gi)5 E -.15(ve)-.25 G 2.5 (nd).15 G(ay will appear in the left-most col-)-2.5 E (umn of the calendar)144 453.6 Q(.)-.55 E F2(day)5 E F0 (may be speci\214ed either as a weekday name or)2.5 E 2.5(,o)-.4 G (ptionally)-2.5 E 2.5(,a)-.65 G 2.5(san)-2.5 G(umber in)-2.5 E (the range 0 \(Sunday\) through 6 \(Saturday\).)144 465.6 Q (This option may also be set semi-permanently by altering the mak)144 482.4 Q(e\214le \(`Mak)-.1 E(e\214le' for most en)-.1 E(vi-)-.4 E (ronments, 'Mak)144 494.4 Q(e\214le.DOS' for MS-DOS\).)-.1 E F1108 511.2 Q F0(Directs)23.08 E F2(pcal)3.75 E F0(to use American date con) 3.01 E -.15(ve)-.4 G(ntions \().15 E F1(mm/dd{/yy})2.5 E F0(and)2.5 E F1 (month dd)2.5 E F0 2.5(\)w)2.5 G(hen parsing the)-2.5 E(date \214le.)144 523.2 Q(This is the def)5 E(ault.)-.1 E (This option may also be set semi-permanently by altering the mak)144 540 Q(e\214le \(`Mak)-.1 E(e\214le' for most en)-.1 E(vi-)-.4 E (ronments, 'Mak)144 552 Q(e\214le.DOS' for MS-DOS\).)-.1 E F1108 568.8 Q F0(Directs)23.63 E F2(pcal)3.75 E F0(to use European date con) 3.01 E -.15(ve)-.4 G(ntions \().15 E F1(dd/mm{/yy})2.5 E F0(and)2.5 E F1 (dd month)2.5 E F0 2.5(\)w)2.5 G(hen parsing the)-2.5 E(date \214le.)144 580.8 Q (This option may also be set semi-permanently by altering the mak)144 597.6 Q(e\214le \(`Mak)-.1 E(e\214le' for most en)-.1 E(vi-)-.4 E (ronments, 'Mak)144 609.6 Q(e\214le.DOS' for MS-DOS\).)-.1 E F1108 626.4 Q F2(xtr)2.5 E(ans)-.15 E F0(Speci\214es the x-axis translation v) 144 638.4 Q(alue for positioning the output on the page.)-.25 E(Positi)5 E .3 -.15(ve v)-.25 H(alues shift)-.1 E(the output to the right.)144 650.4 Q(Ne)5 E -.05(ga)-.15 G(ti).05 E .3 -.15(ve v)-.25 H (alues shift the output to the left.)-.1 E F1108 667.2 Q F2(ytr) 2.5 E(ans)-.15 E F0(Speci\214es the y-axis translation v)144 679.2 Q (alue for positioning the output on the page.)-.25 E(Positi)5 E .3 -.15 (ve v)-.25 H(alues shift)-.1 E(the output up.)144 691.2 Q(Ne)5 E -.05 (ga)-.15 G(ti).05 E .3 -.15(ve v)-.25 H(alues shift the output do)-.1 E (wn.)-.25 E -1.11(Ve)72 768 S(rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E (12)198.45 E 0 Cg EP %%Page: 13 13 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F/F1 10/Times-Bold@0 SF108 84 Q/F2 10 /Times-Italic@0 SF(xscale)2.5 E F0(Speci\214es the x-axis scaling f)144 96 Q(actor for the calendar size.)-.1 E F1108 112.8 Q F2(yscale) 2.5 E F0(Speci\214es the y-axis scaling f)144 124.8 Q (actor for the calendar size.)-.1 E F1108 141.6 Q F0([)2.5 E F2 (title_font)A F0(][)A F1(/)A F2(size)A F0(])A (Speci\214es the name of a font to use for all the calendar heading te) 144 153.6 Q(xt:)-.15 E 6.5<8374>180 175.2 S(he month name and year at t\ he top of the calendar \(for monthly-format calendars\) or)-6.5 E(at th\ e top of each month \(for yearly-format calendars and for the small pre) 190 187.2 Q(vious/ne)-.25 E(xt-)-.15 E (month calendars [if enabled] on monthly-format calendars\))190 199.2 Q 6.5<8374>180 216 S(he day-of-week names)-6.5 E 6.5<8374>180 232.8 S (he footer strings \(if an)-6.5 E(y\))-.15 E 6.5<8374>180 249.6 S(he `) -6.5 E(`Notes')-.74 E 2.5('b)-.74 G(ox heading \(if an)-2.5 E (y; for monthly calendars only\))-.15 E -.15(Fo)144 271.2 S 2.5(rm).15 G (onthly calendars only)-2.5 E 2.5(,t)-.65 G (he user may optionally specify the font size, which applies only to) -2.5 E(the main month/year heading.)144 283.2 Q -.15(Fo)5 G 2.5(re).15 G (xample,)-2.65 E F1(pcal \255t T)2.5 E(imes-Roman/54)-.18 E F0 (sets the font to T)2.5 E(imes-)-.35 E (Roman and the month/year point size to 54.)144 295.2 Q (The font size may also be changed independently:)5 E F1(pcal \255t /54) 144 307.2 Q F0(changes the point size to 54 without af)2.5 E (fecting the font name.)-.25 E(Note: F)144 324 Q (or yearly calendars, an)-.15 E 2.5(ys)-.15 G(peci\214cation of font) -2.5 E F2(size)2.84 E F0(is ignored.)2.68 E (This option may also be set semi-permanently by altering the mak)144 340.8 Q(e\214le \(`Mak)-.1 E(e\214le' for most en)-.1 E(vi-)-.4 E (ronments, 'Mak)144 352.8 Q(e\214le.DOS' for MS-DOS\).)-.1 E F1108 369.6 Q F0([)2.5 E F2(date_font)A F0(][)A F1(/)A F2(size)A F0(])A (Similar to the)144 381.6 Q F12.5 E F0(option, b)2.5 E(ut selects\ the font and/or size used for the day numerics \(the numbers)-.2 E (inside the box for each day\).)144 393.6 Q(Note: F)144 410.4 Q (or yearly calendars, an)-.15 E 2.5(ys)-.15 G(peci\214cation of font) -2.5 E F2(size)2.84 E F0(is ignored.)2.68 E (This option may also be set semi-permanently by altering the mak)144 427.2 Q(e\214le \(`Mak)-.1 E(e\214le' for most en)-.1 E(vi-)-.4 E (ronments, 'Mak)144 439.2 Q(e\214le.DOS' for MS-DOS\).)-.1 E F1108 456 Q F0([)2.5 E F2(te)A(xt_font)-.2 E F0(][)A F1(/)A F2(size)A F0(])A (Similar to the)144 468 Q F12.5 E F0(and)2.5 E F12.5 E F0 (options, b)2.5 E(ut selects the font and/or size used for an)-.2 E 2.5 (y`)-.15 G -2.15 -.25(ev e)-2.5 H(nt' te).25 E(xt associ-)-.15 E (ated with each day and for an)144 480 Q 2.5(yt)-.15 G -.15(ex)-2.5 G 2.5(ti).15 G 2.5(nt)-2.5 G(he monthly `)-2.5 E(`Notes')-.74 E 2.5('b) -.74 G(ox.)-2.5 E(Note: This option applies to monthly calendars only) 144 496.8 Q 2.5(.F)-.65 G(or yearly calendars, this option does not) -2.65 E(apply)144 508.8 Q(.)-.65 E (This option may also be set semi-permanently by altering the mak)144 525.6 Q(e\214le \(`Mak)-.1 E(e\214le' for most en)-.1 E(vi-)-.4 E (ronments, 'Mak)144 537.6 Q(e\214le.DOS' for MS-DOS\).)-.1 E F1108 554.4 Q F2(string)2.5 E F0(Causes the accompan)144 566.4 Q (ying string to be printed as a left-justi\214ed footer)-.15 E 5(.F)-.55 G(ormat speci\214ers denoting)-5.15 E (the month and/or year may appear in the string; the appropriate v)144 578.4 Q(alues will be substituted upon)-.25 E(printing.)144 590.4 Q F1 108 607.2 Q F2(string)2.5 E F0(Similar to)144 619.2 Q F12.5 E F0 2.5(,b)C(ut causes the accompan)-2.7 E (ying string to be printed as a centered footer)-.15 E 5(.I)-.55 G 2.5 (ft)-5 G(he)-2.5 E F12.5 E F0 (\215ag \(generate calendar as HTML table\) w)144 631.2 Q (as speci\214ed, this string will be used as the title and head-)-.1 E (ing.)144 643.2 Q F1108 660 Q F2(string)2.5 E F0(Similar to)144 672 Q F12.5 E F0 2.5(,b)C(ut causes the accompan)-2.7 E (ying string to be printed as a right-justi\214ed footer)-.15 E(.)-.55 E F1108 688.8 Q F2(string)2.5 E F0(Causes the accompan)144 700.8 Q (ying string to be printed as the heading for the "Notes" box.)-.15 E (Note, ho)5 E(we)-.25 E -.15(ve)-.25 G -.4(r,).15 G(that)144 712.8 Q F2 (pcal)3.75 E F0(mak)3.01 E(es no attempt to ensure that it \214ts.)-.1 E -1.11(Ve)72 768 S(rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(13)198.45 E 0 Cg EP %%Page: 14 14 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F/F1 10/Times-Bold@0 SF108 84 Q/F2 10 /Times-Italic@0 SF(symbol [value])2.5 E F0 (De\214nes the named symbol and an optional v)144 96 Q (alue to be associated with that symbol, prior to read-)-.25 E (ing the date \214le.)144 108 Q F1108 124.8 Q F2(symbol)2.5 E F0 (Un-de\214nes the named symbol prior to reading the date \214le.)144 136.8 Q F1108 153.6 Q F0(Causes)23.63 E F2(pcal)3.75 E F0(to lea) 3.01 E .3 -.15(ve u)-.2 H(nused calendar day box).15 E (es blank as opposed to the def)-.15 E(ault beha)-.1 E (vior of \214lling)-.2 E(them using the `empty day-box \214ll color' \(\ i.e. the color speci\214ed by the)144 165.6 Q F12.5 E F0 (option [def)2.5 E(ault =)-.1 E(gray]\).)144 177.6 Q F1108 194.4 Q F2(n)2.5 E F0(Causes)17.8 E F2(pcal)3.75 E F0(to print)3.01 E F2(n)2.86 E F0(copies \(maximum: 100\) of each output page.)2.74 E F1108 211.2 Q F0(Causes)24.74 E F2(pcal)3.75 E F0 (to suppress printing the small calendars.)3.01 E(See the)5 E F1(CA)2.5 E(VEA)-1.45 E(TS)-.95 E F0(section for further)2.5 E(details.)144 223.2 Q F1108 240 Q F0(Causes)24.74 E F2(pcal)3.75 E F0 (to print the small calendars in the upper left corner \(the def)3.01 E (ault is to print them at the)-.1 E(lo)144 252 Q(wer right\).)-.25 E F1 108 268.8 Q F0(Causes)22.52 E F2(pcal)3.75 E F0 (to print the small calendar for the pre)3.01 E (vious month in the upper left corner and the ne)-.25 E(xt)-.15 E (month in the lo)144 280.8 Q(wer right \(the def)-.25 E (ault is to print both at the lo)-.1 E(wer right\).)-.25 E F1108 297.6 Q F0(Causes)23.08 E F2(pcal)3.75 E F0 (to print a calendar for 12 consecuti)3.01 E .3 -.15(ve m)-.25 H (onths: 3 ro).15 E(ws / 4 columns in landscape mode,)-.25 E 2.5(4r)144 309.6 S -.25(ow)-2.5 G 2.5(s/3c).25 G(olumns in portrait mode.)-2.5 E (See the)5 E F1(CA)2.5 E(VEA)-1.45 E(TS)-.95 E F0 (section for details on the use of this)2.5 E (option with other options.)144 321.6 Q(Pcal prede\214nes the symbol)144 338.4 Q F1(whole_y)2.5 E(ear)-.1 E F0(when the)2.5 E F12.5 E F0 (\215ag is in ef)2.5 E(fect, allo)-.25 E(wing directi)-.25 E -.15(ve) -.25 G 2.5(sl).15 G(ik)-2.5 E(e)-.1 E(`)144 350.4 Q F1(ifdef whole_y)A (ear)-.1 E F0 2.5('i)C 2.5(nt)-2.5 G(he con\214guration \214le.)-2.5 E F1108 367.2 Q F0(Resets all parameters to the program def)26.41 E (aults.)-.1 E F1108 384 Q F0(Causes)25.86 E F2(pcal)3.75 E F0 (to generate a date \214le suitable for use as input to the Un*x)3.01 E F2(calendar\(1\))2.7 E F0(utility)2.56 E 5(.T)-.65 G(he)-5 E (normal PostScript output is suppressed.)144 396 Q F1108 412.8 Q F0(Causes)22.52 E F2(pcal)3.75 E F0 (to generate a calendar in HTML table format.)3.01 E (The normal PostScript output is sup-)5 E(pressed.)144 424.8 Q(The HTML\ table format does not support moon graphics, Julian date information, \ `day numerics')144 441.6 Q(color)144 453.6 Q 2.5(,`)-.4 G (empty day' `box \214ll' color)-2.5 E 2.5(,l)-.4 G (eft or right footer strings \(b)-2.5 E(ut see the)-.2 E F12.5 E F0(\215ag\), alternate)2.5 E(fonts/sizes, transformation and scaling f) 144 465.6 Q(actors, or embedded EPS images.)-.1 E F1108 482.4 Q F0 (This option is only v)24.74 E(alid when used in conjunction with the) -.25 E F12.5 E F0(\(generate HTML-format calendar\))2.5 E 2.5 (option. It)144 494.4 R(generates a yearly-planner style of HTML calend\ ar whereby a single column for each)2.5 E (month is used, resulting in table that gi)144 506.4 Q -.15(ve)-.25 G 2.5(saq).15 G(uick)-2.5 E(er o)-.1 E -.15(ve)-.15 G(rvie).15 E 2.5(wo) -.25 G 2.5(fs)-2.5 G -2.15 -.25(ev e)-2.5 H(ral months.).25 E (Since there is)5 E(less space for te)144 518.4 Q(xt, only the \214rst \ character of the weekday and the \214rst 5 characters of te)-.15 E (xt from)-.15 E(each e)144 530.4 Q -.15(ve)-.25 G(nt for that day are p\ rinted. The day numerics for holidays are colored red b).15 E(ut the te) -.2 E(xt of)-.15 E(the holiday e)144 542.4 Q -.15(ve)-.25 G (nt is not printed.).15 E(The day numerics are gre)5 E 2.5(yf)-.15 G (or Saturdays and bold black for Sun-)-2.5 E(days.)144 554.4 Q F1 108 571.2 Q F2(time_zone)2.5 E F0 -.15(Fo)144 583.2 S(rces).15 E F2 (pcal)3.75 E F0(to ignore the moon \214le and to use its internal algor\ ithm for moon phase calculations,)3.01 E(adjusting the phase by)144 595.2 Q F2(time_zone)2.63 E F0(hours \(where)2.68 E F2(time_zone)2.63 E F0(is e)2.68 E(xpressed in hours west of UTC\).)-.15 E -.15(Fo)144 612 S 2.5(re).15 G(xample, Ne)-2.65 E 2.5(wY)-.25 G (ork residents \(USA Eastern time zone\) w)-3.6 E (ould use '-z 5' while on Eastern)-.1 E(Standard T)144 624 Q (ime \(winter\) and '-z 4' while on Eastern Daylight T)-.35 E (ime \(summer\).)-.35 E(People in India)5 E -.1(wo)144 636 S (uld use '-z-5.5'.).1 E(Notice that fractional v)5 E(alues are allo)-.25 E(wed.)-.25 E (This option may also be set semi-permanently by altering the mak)144 652.8 Q(e\214le \(`Mak)-.1 E(e\214le' for most en)-.1 E(vi-)-.4 E (ronments, 'Mak)144 664.8 Q(e\214le.DOS' for MS-DOS\).)-.1 E F1108 681.6 Q F0(Causes)24.74 E F2(pcal)3.75 E F0(to write v)3.01 E (ersion information, parameter usage message, and full e)-.15 E (xplanation of)-.15 E(options and \214le formats \(to)144 693.6 Q F2 (stdout)2.5 E F0 2.5(\)a).68 G(nd terminate.)-2.5 E F1108 710.4 Q F0(Causes)24.74 E F2(pcal)3.75 E F0(to write v)3.01 E (ersion information and parameter usage message \(to)-.15 E F2(stdout) 2.5 E F0 2.5(\)a).68 G(nd terminate.)-2.5 E -1.11(Ve)72 768 S (rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(14)198.45 E 0 Cg EP %%Page: 15 15 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F/F1 10/Times-Bold@0 SF108 84 Q F0(Causes) 25.3 E/F2 10/Times-Italic@0 SF(pcal)3.75 E F0(to write v)3.01 E (ersion information only \(to)-.15 E F2(stdout)2.5 E F0 2.5(\)a).68 G (nd terminate.)-2.5 E(Pcal prede\214nes the symbol)144 100.8 Q F1 (vX_Y_Z)2.5 E F0 2.5(,w)C(here)-2.5 E F1(X_Y_Z)2.5 E F0 (denotes the current v)2.5 E(ersion of Pcal \(e.g. v)-.15 E(er)-.15 E(-) -.2 E(sion 4.9.0 prede\214nes the symbol)144 112.8 Q F1(v4_9_0)2.5 E F0 (\).)A F1108 129.6 Q F2(output_langua)2.5 E -.1(ge)-.1 G F0(Selec\ t the output language \(for the names of months and days on the calenda\ r\).)144 141.6 Q(Currently)144 158.4 Q 2.5(,t)-.65 G(he follo)-2.5 E (wing languages are supported:)-.25 E F1(ca)2.5 E F0(\(Catalan\),)2.5 E F1(cs)2.5 E F0(\(Czech\),)2.5 E F1(da)2.5 E F0(\(Danish\),)2.5 E F1(de) 2.5 E F0(\(Ger)2.5 E(-)-.2 E(man\),)144 170.4 Q F1(el)2.5 E F0 (\(Greek\),)2.5 E F1(en)2.5 E F0(\(English\),)2.5 E F1(eo)2.5 E F0 (\(Esperanto\),)2.5 E F1(es)2.5 E F0(\(Spanish\),)2.5 E F1(et)2.5 E F0 (\(Estonian\),)2.5 E F1<8c>2.5 E F0(\(Finnish\),)2.5 E F1(fr)2.5 E F0 (\(French\),)144 182.4 Q F1(ha)2.5 E F0(\(Ha)2.5 E -.1(wa)-.15 G (iian\),).1 E F1(hu)2.5 E F0(\(Hung)2.5 E(arian\),)-.05 E F1(it)2.5 E F0 (\(Italian\),)2.5 E F1(lt)2.5 E F0(\(Lithuanian\),)2.5 E F1(lv)2.5 E F0 (\(Latvian\),)2.5 E F1(nl)2.5 E F0(\(Dutch\),)2.5 E F1(pl)2.5 E F0 (\(Polish\),)144 194.4 Q F1(pt)2.5 E F0(\(Portuguese\),)2.5 E F1 -.18 (ro)2.5 G F0(\(Romanian\),)2.68 E F1(ru)2.5 E F0(\(Russian\),)2.5 E F1 (sk)2.5 E F0(\(Slo)2.5 E -.25(va)-.15 G(k\),).25 E F1(sv)2.5 E F0 (\(Swedish\), and)2.5 E F1(uk)2.5 E F0 2.5(\(Ukrainian\). The)144 206.4 R(def)2.5 E(ault is)-.1 E F1(en)2.5 E F0(.)A(Note that this option does) 144 223.2 Q F1(not)2.5 E F0 (specify the `input language', which is the language used to process)2.5 E -2.15 -.25(ev e)144 235.2 T (nts in the con\214guration \214le \('English', by def).25 E (ault, unless changed with the)-.1 E F2(input-langua)2.51 E .2 -.1(ge X) -.1 H(X).1 E F0(directi)144 247.2 Q -.15(ve)-.25 G 2.5(\). See).15 F (the section)2.5 E F2(The Date F)2.41 E(ile)-.45 E F0 (for more details on specifying the `input language'.)2.68 E F1(Note:) 144 264 Q F0(In order to display diacritical marks, languages other tha\ n English require that the characters)2.5 E(be remapped.)144 276 Q (Normally)5 E 2.5(,n)-.65 G 2.5(oa)-2.5 G(ction is required since)-2.5 E F2(pcal)2.5 E F0(automatically selects a remapping which)2.5 E (is appropriate to the selected language.)144 288 Q(Ho)5 E(we)-.25 E -.15(ve)-.25 G .8 -.4(r, i).15 H 2.5(fy).4 G(ou w)-2.5 E(ant to o)-.1 E -.15(ve)-.15 G(rride the def).15 E(ault remapping)-.1 E(for a gi)144 300 Q -.15(ve)-.25 G 2.5(nl).15 G(anguage, you w)-2.5 E(ould use the)-.1 E F12.5 E F0(option \(e.g. "-r Latin1"\).)2.5 E(Furthermore, an app\ ropriate font should be selected as needed using the)144 316.8 Q F1 2.5 E F0(option \(e.g. "-t some-)2.5 E 2.5 (latin1-font-name"\). An)144 328.8 R 2.5(yl)-.15 G (anguage using the "Latin1" remapping \(e.g. French, German, Italian,) -2.5 E(Spanish, etc\) requires an ISO 8859-1 \('Latin1'\) font.)144 340.8 Q(The Greek language requires an ISO 8859-7)5 E(\(similar to ELO) 144 352.8 Q -.92(T-)-.4 G(928\) font \(a).92 E -.25(va)-.2 G (ilable from Angelo Haritsis ; also see).25 E (http://www)144 364.8 Q 2.5(.hellenic.net/fonts/\). Similarly)-.65 F 2.5 (,R)-.65 G(ussian requires a K)-2.5 E(OI8-R font while Ukrainian)-.3 E (requires a K)144 376.8 Q(OI8-U font.)-.3 E F2(Pcal)144.5 393.6 Q F0 (prede\214nes the symbol)3.01 E F1(lang_XX)2.5 E F0 2.5(,w)C(here)-2.5 E F1(XX)2.5 E F0(is the tw)2.5 E(o-character abbre)-.1 E (viation for the selected)-.25 E(output language.)144 405.6 Q F1 108 422.4 Q F0([)2.5 E F2(mapping)A F0(])A(Speci\214es an 8-bit charact\ er set remapping \(encoding\) for printing the diacritical marks common\ to)144 434.4 Q(European languages.)144 446.4 Q (Note: This option is not usually needed since)144 463.2 Q F2(pcal)3.75 E F0(will automatically select an appropriate def)3.01 E(ault)-.1 E(cha\ racter encoding \(mapping\) for the language for which the calendar is \ being generated.)144 475.2 Q(The v)144 492 Q(alue speci\214ed for)-.25 E F2(mapping)2.5 E F0(is case-insensiti)2.5 E .3 -.15(ve a)-.25 H (nd may be abbre).15 E(viated to the point where it is)-.25 E (still unique.)144 504 Q(The v)5 E(alue used may be an)-.25 E 2.5(yo) -.15 G 2.5(ft)-2.5 G(he follo)-2.5 E(wing:)-.25 E 6.5<8322>180 525.6 S (none" \(use b)-6.5 E(uilt-in character set\))-.2 E 6.5<8322>180 542.4 S (Latin1" \(ISO 8859-1\))-6.5 E 6.5<8322>180 559.2 S (Latin2" \(ISO 8859-2\))-6.5 E 6.5<8322>180 576 S (Latin3" \(ISO 8859-3\))-6.5 E 6.5<8322>180 592.8 S (Latin4" \(ISO 8859-4\))-6.5 E 6.5<8322>180 609.6 S (Cyrillic" \(ISO 8859-5\))-6.5 E 6.5<8322>180 626.4 S (Greek" \(ISO 8859-7\))-6.5 E 6.5<8322>180 643.2 S (Latin5" \(ISO 8859-9\))-6.5 E 6.5<8322>180 660 S (Latin6" \(ISO 8859-10\))-6.5 E 6.5<8322>180 676.8 S (Thai" \(ISO 8859-11\))-6.5 E 6.5<8322>180 693.6 S (Latin7" \(ISO 8859-13\))-6.5 E 6.5<8322>180 710.4 S (Latin8" \(ISO 8859-14\))-6.5 E -1.11(Ve)72 768 S(rsion 4.11.0)1.11 E (18 Dec 2007)150.4 E(15)198.45 E 0 Cg EP %%Page: 16 16 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F 6.5<8322>180 84 S(Latin9" \(ISO 8859-15\))-6.5 E 6.5<8322>180 100.8 S -.3(KO)-6.5 G(I8-R" \(Russian\)).3 E 6.5<8322>180 117.6 S -.3(KO)-6.5 G(I8-U" \(Ukrainian\)).3 E 6.5<8322>180 134.4 S (Roman8")-6.5 E (This option may also be set semi-permanently by altering the mak)144 168 Q(e\214le \(`Mak)-.1 E(e\214le' for most en)-.1 E(vi-)-.4 E (ronments, 'Mak)144 180 Q(e\214le.DOS' for MS-DOS\).)-.1 E/F1 10 /Times-Bold@0 SF108 208.8 Q F0([B|I|R])2.5 E(Select the def)144 220.8 Q(ault typef)-.1 E (ace \(Bold, Italic, or Roman\) for printing date/note te)-.1 E 2.5 (xt. This)-.15 F(\215ag may be)2.5 E(speci\214ed multiple times within \ the date \214le \(via "opt"\) to reset the font style on the \215y \212\ for)144 232.8 Q -.15(ex)144 244.8 S (ample, to print all holidays in Bold.).15 E F1108 273.6 Q F0 ([left|center|right])2.5 E(Specify the horizontal alignment of the mont\ h/year heading \(left, center)144 285.6 Q 2.5(,r)-.4 G (ight\) \(for monthly-for)-2.5 E(-)-.2 E(mat calendars only\).)144 297.6 Q(An)108 326.4 Q 2.5(yo)-.15 G(ption taking a ne)-2.5 E -.05(ga)-.15 G (ti).05 E .3 -.15(ve v)-.25 H(alue \(e.g.)-.1 E F1(\255Y \255###)5 E F0 2.5(\)s)C(hould be speci\214ed with no space between the option)-2.5 E (and the \(ne)108 338.4 Q -.05(ga)-.15 G(ti).05 E -.15(ve)-.25 G 2.5 (\)v).15 G(alue to a)-2.75 E -.2(vo)-.2 G(id).2 E/F2 10/Times-Italic@0 SF(pcal)3.75 E F0(interpreting the v)3.01 E(alue as an ille)-.25 E -.05 (ga)-.15 G 2.5<6c8d>.05 G(ag and aborting.)-2.5 E -.15(Fo)5 G 2.5(re).15 G(xample,)-2.65 E(use `)108 350.4 Q F22.5 E F0 2.5('i).47 G (nstead of `)-2.5 E F2(\255Y \25550)2.5 E F0 2.5('o).47 G 2.5(ny)-2.5 G (our option speci\214cation.)-2.5 E(An)108 367.2 Q 2.5(yo)-.15 G (ption \(e)-2.5 E(xcept)-.15 E F12.5 E F0(and)2.5 E F12.5 E F0 2.5(,f)C(or backw)-2.5 E(ard-compatibility\) which normally tak)-.1 E (es an ar)-.1 E(gument may be)-.18 E(speci\214ed without the ar)108 379.2 Q(gument in order to reset the v)-.18 E(alue to the program def) -.25 E 2.5(ault. Note)-.1 F(that while the)2.5 E F12.5 E F0 (option alone clears all the de\214ned symbols, the)108 391.2 Q F1 2.5 E F0(option alone has no ef)2.5 E 2.5(fect. The)-.25 F F12.5 E F0(\(or)2.5 E F1 1.6662.5 G F0(as per System).834 E(V\) ar)108 403.2 Q(gument may be used to disambiguate command lines such as:)-.18 E F1(pcal \255t 9 90)144 420 Q F0 (This could be written instead as one of the follo)108 436.8 Q(wing:) -.25 E F1(pcal \255t \255 9 90)144 453.6 Q(pcal \255t \255)144 465.6 Q 2.5(\25599)1.666 G(0)-2.5 E F0(If the en)108 482.4 Q(vironment v)-.4 E (ariable)-.25 E F1(PCAL_OPTS)2.5 E F0 (is de\214ned, its contents are parsed as a command line.)2.5 E (Flags set)5 E(via)108 494.4 Q F1(PCAL_OPTS)2.5 E F0 -.15(ove)2.5 G (rride the program def).15 E(aults, b)-.1 E(ut are o)-.2 E -.15(ve)-.15 G(rridden by options set via).15 E F1(opt)2.5 E F0(lines in the con-)2.5 E(\214guration \214le or e)108 506.4 Q(xplicitly on the command line.) -.15 E F1(Additional Options F)87 547.2 Q(or Deb)-.25 E(ugging Only)-.2 E F0(The)108 559.2 Q F12.5 E F0(\215ag is used to print deb)2.5 E (ugging information which is of interest primarily to)-.2 E F2(pcal)3.75 E F0(hack)3.01 E 2.5(ers. This)-.1 F(\215ag)2.5 E (is a "hidden" \215ag; it does not appear as part of the usage message.) 108 571.2 Q(At present, the follo)5 E(wing options are)-.25 E (supported:)108 583.2 Q 6.5<832d>144 604.8 S 16.84(ZD print)-6.5 F (dates and te)2.5 E(xt as read from date \214le)-.15 E 6.5<832d>144 621.6 S 18.5(ZF print)-6.5 F(date \214le search paths)2.5 E 6.5<832d>144 638.4 S 15.17(ZM print)-6.5 F(moon phases and identify quarters)2.5 E 6.5<832d>144 655.2 S 16.84(ZO print)-6.5 F(option \215ags and where set) 2.5 E 6.5<832d>144 672 S 18.5(ZP print)-6.5 F("preprocessor" deb)2.5 E (ug info)-.2 E 6.5<832d>144 688.8 S 17.95(ZT print)-6.5 F(dates and te) 2.5 E(xt as written to output \214le)-.15 E 6.5<832d>144 705.6 S 26.56 (Zt)-6.5 G(urn of)-26.56 E 2.5(fa)-.25 G(ll deb)-2.5 E(ugging info)-.2 E (The sub\215ags may be combined: e.g. "-ZDF" is equi)108 722.4 Q -.25 (va)-.25 G(lent to "-ZD -ZF".).25 E(All of the aforementioned)5 E -1.11 (Ve)72 768 S(rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(16)198.45 E 0 Cg EP %%Page: 17 17 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F(deb)108 84 Q (ugging information is written to stderr)-.2 E(.)-.55 E/F1 10.95 /Times-Bold@0 SF(CA)72 124.8 Q(VEA)-1.588 E(TS)-1.04 E F0 6.5<8354>108 136.8 S(he `)-6.5 E(`w)-.74 E(orkday')-.1 E 2.5('a)-.74 G(nd `)-2.5 E (`holiday')-.74 E 2.5('k)-.74 G -.15(ey)-2.6 G -.1(wo).15 G(rds are a).1 E -.1(wa)-.15 G(re of only those holidays which ha).1 E .3 -.15(ve a)-.2 H(lready been).15 E(\215agged at the point where the)118 148.8 Q 2.5(ya) -.15 G(ppear)-2.5 E 5(.F)-.55 G(or e)-5.15 E (xample, consider January 1990:)-.15 E/F2 10/Courier@0 SF(January 1990) 240 165.6 Q 12(SM)222 177.6 S 6(Tu W)-6 F 6(Th F S)6 F 12(123456)240 189.6 S 12(789)222 201.6 S(10 11 12 13)-6 E(14 15 16 17 18 19 20)216 213.6 Q(21 22 23 24 25 26 27)216 225.6 Q(28 29 30 31)216 237.6 Q F0 (If the con\214guration \214le look)118 254.4 Q(ed lik)-.1 E 2.5(et)-.1 G(his:)-2.5 E F2(workday on_or_before all 15)144 271.2 Q(payday)18 E (3rd Mon in Jan*)144 283.2 Q(MLK day)90 E F0(... then)118 300 Q/F3 10 /Times-Italic@0 SF(pcal)3.75 E F0 -.1(wo)3.01 G(uld mark the 15th as `) .1 E(`payday')-.74 E 2.5('s)-.74 G (ince at that point in the con\214guration \214le it has no w)-2.5 E(ay) -.1 E(of kno)118 312 Q (wing that January 15th will later be \215agged as a holiday)-.25 E 5 (.I)-.65 G 2.5(ft)-5 G(he tw)-2.5 E 2.5(ol)-.1 G(ines were re)-2.5 E -.15(ve)-.25 G(rsed, such that).15 E(the holiday preceded the `)118 324 Q(`w)-.74 E(orkday')-.1 E 2.5('w)-.74 G(ildcard, then)-2.5 E F3(pcal) 3.75 E F0 -.1(wo)3.01 G(uld w).1 E(ork as intended, marking instead the) -.1 E(12th as `)118 336 Q(`payday')-.74 E('.)-.74 E(Also, be)118 352.8 Q -.1(wa)-.25 G(re of year boundaries which af).1 E (fect the handling of all of the day wildcard k)-.25 E -.15(ey)-.1 G -.1 (wo).15 G 2.5(rds. In).1 F(gen-)2.5 E (eral, it is best to place monthly wildcards such as the e)118 364.8 Q (xample abo)-.15 E .3 -.15(ve a)-.15 H 2.5(tt).15 G (he end of each year to achie)-2.5 E -.15(ve)-.25 G(the desired ef)118 376.8 Q(fect.)-.25 E 6.5<834f>108 398.4 S(nly the positi)-6.5 E .3 -.15 (ve o)-.25 H(rdinals may be used in conjunction with prepositions \(e.g\ . "fourth Sunday before).15 E 2.5(12/25"\). \(It)118 410.4 R (could be ar)2.5 E (gued that "last Sunday before 12/25" should be accepted as a synon)-.18 E(ym for "\214rst)-.15 E(Sunday before 12/25", b)118 422.4 Q (ut then what does "last Sunday after 12/25" mean?\))-.2 E 6.5<8357>108 444 S(hen the)-6.5 E/F4 10/Times-Bold@0 SF2.5 E F0(and)2.5 E F4 2.5 E F0(options are used together)2.5 E(,)-.4 E F3(pcal)3.75 E F0 (re)3.01 E(vises the y-scale f)-.25 E(actor in order to use the entire) -.1 E(portrait page; therefore, the user should a)118 456 Q -.2(vo)-.2 G (id using use the).2 E F42.5 E F0(option when using both the)2.5 E F42.5 E F0(and)2.5 E F42.5 E F0 2.5(options. Use)118 468 R (of the)2.5 E F42.5 E F0(option in an)2.5 E 2.5(yc)-.15 G(ase ef) -2.5 E(fecti)-.25 E -.15(ve)-.25 G(ly disables the).15 E F42.5 E F0(,)A F42.5 E F0(,)A F42.5 E F0 2.5(,a)C(nd)-2.5 E F4 2.5 E F0(options.)2.5 E 6.5<8354>108 489.6 S(he output of the)-6.5 E F4 2.5 E F0(option may be used as input to subsequent runs of)2.5 E F3(pcal)2.5 E F0 5(.N).51 G(ote, ho)-5 E(we)-.25 E -.15(ve)-.25 G .8 -.4 (r, t).15 H(hat).4 E F4(opt)2.5 E F0(lines \(e)118 501.6 Q (xcept for an automatic)-.15 E F4(opt \255[A|E])2.5 E F0 (\), comments, `)A(`note')-.74 E 2.5('t)-.74 G -.15(ex)-2.5 G(t, and).15 E F4(ifdef)2.5 E F0 -.5('d)C(-out source will be lost.).5 E 6.5<8354>108 523.2 S(he)-6.5 E F42.5 E F0(option interacts with)2.5 E F4 (note{/})2.5 E F0 2.5(;i)C 2.5(fu)-2.5 G (sed, it should be speci\214ed either on the command)-2.5 E (line or prior to the \214rst)118 535.2 Q F4(note)2.5 E F0 (line in the date \214le.)2.5 E F1(SEE ALSO)72 580.8 Q F0 -.8(We)108 592.8 S(bsite for).8 E F3(pcal)3.75 E F0(and)3.01 E F3(lcal)2.59 E F0 (\(a lunar calendar generation application\):)3.01 E (http://pcal.sourcefor)144 614.4 Q(ge.net)-.18 E (cal\(1\), calendar\(1\).)108 631.2 Q (The old, simple Unix/BSD 'calendar' program, which can be used with)108 648 Q F3(pcal)3.75 E F0(and the '-c' option is part of)3.01 E (the BSD Main Utilities \('bsdmainutils'\) package and is a)108 660 Q -.25(va)-.2 G(ilable at the Debian site:).25 E F3(http://pac)144 676.8 Q (ka)-.2 E -.1(ge)-.1 G(s.debian.or).1 E(g/stable/sour)-.37 E (ce/bsdmainutils)-.37 E F0(This old program does not seem to be include\ d with most GNU/Linux distrib)108 693.6 Q(utions these days.)-.2 E -.15 (Fo)108 710.4 S 2.5(rm).15 G(ore information on PostScript, consult the\ free, online Adobe book entitled)-2.5 E F3 -.8(Po)2.5 G (stScript Langua).8 E .2 -.1(ge R)-.1 H(ef-).1 E(er)108 722.4 Q (ence Manual)-.37 E F0 2.5(,w).51 G (hich can be found here \(as of Dec 2007\):)-2.5 E -1.11(Ve)72 768 S (rsion 4.11.0)1.11 E(18 Dec 2007)150.4 E(17)198.45 E 0 Cg EP %%Page: 18 18 %%BeginPageSetup BP %%EndPageSetup /F0 10/Times-Roman@0 SF 150.805(PCAL\(1\) USER)72 48 R 150.805 (COMMANDS PCAL\(1\))2.5 F/F1 10/Times-Italic@0 SF(http://partner)144 84 Q(s.adobe)-.1 E(.com/public/de)-.15 E(veloper/ps/inde)-.15 E (x_specs.html)-.2 E/F2 10.95/Times-Bold@0 SF -.548(AU)72 117.6 S(THORS) .548 E F0(The original PostScript code to generate the calendars w)108 129.6 Q(as written by P)-.1 E(atrick W)-.15 E(ood \(Cop)-.8 E (yright \251 1987 by)-.1 E -.15(Pa)108 141.6 S(trick W).15 E(ood of Pip\ eline Associates, Inc.\), and authorized for modi\214cation and redistr\ ib)-.8 E 2.5(ution. The)-.2 F(calen-)2.5 E(dar \214le inclusion code w) 108 153.6 Q(as originally written in "bs\(1\)" by Bill V)-.1 E (ogel of A)-1.29 E(T&T)-1.11 E 5(.P)-.74 G(atrick')-5.15 E 2.5(so)-.55 G (riginal Post-)-2.5 E(Script w)108 165.6 Q (as modi\214ed and enhanced se)-.1 E -.15(ve)-.25 G (ral times by King Ables, T).15 E(im T)-.35 E(essin, Joe W)-.7 E (ood, Jef)-.8 E 2.5(fM)-.25 G(ogul, Mark)-2.5 E (Hanson, and others whose names ha)108 177.6 Q .3 -.15(ve r)-.2 H -.15 (eg).15 G(rettably been lost.).15 E(This C v)5 E(ersion w)-.15 E (as originally created by K)-.1 E(en)-.25 E -.25(Ke)108 189.6 S (irnan of P).25 E(aci\214c Bell; additional enhancements by Joseph P) -.15 E 2.5(.L)-1.11 G(arson, Ed Hand, Andre)-2.5 E 2.5(wR)-.25 G (ogers, Mark)-2.5 E(Kantro)108 201.6 Q(witz, Joe Bro)-.25 E (wnlee, Andy Fyfe, Ste)-.25 E .3 -.15(ve G)-.25 H(randi, Geof).15 E 2.5 (fK)-.25 G(uenning, Stef)-2.65 E(an Fronzek \(1-column HTML)-.1 E (output\), Bill Bogstad \(e)108 213.6 Q -.15(ve)-.25 G(nt deletion capa\ bility\), and Bill Marr \(embedded EPS images, command-line).15 E (paper size speci\214cation, ne)108 225.6 Q 2.5(wp)-.25 G (aper sizes [le)-2.5 E -.05(ga)-.15 G 2.5(l&t).05 G (abloid], additional character mappings for ne)-2.5 E 2.5(wl)-.25 G(an-) -2.5 E(guages, and v)108 237.6 Q(arious cleanups\).)-.25 E (The moon routines were originally written by Jef Poskanzer and Craig)5 E(Leres, and were incorporated into)108 249.6 Q F1(pcal)3.75 E F0 (by Richard Dyson.)3.01 E(International language support w)5 E (as initially)-.1 E(added by Angelo Haritsis.)108 261.6 Q (Additional languages were added by Andre)5 E 2.5(wR)-.25 G (ogers \(Esperanto\), Lars W)-2.5 E(irze-)-.4 E(nius \(Finnish\), Pedro\ Zorzenon Neto \(Portuguese\), Joel Fredrikson \(Swedish\), V)108 273.6 Q(olodymyr M. Lisi)-1.29 E(vka)-.25 E(\(Ukrainian\), Neeme Praks \(Esto\ nian, Russian, Latvian, Lithuanian\), Peter Cernoch \(Czech\), Ferenc K\ ruzs-)108 285.6 Q(licz \(Hung)108 297.6 Q(arian\), Carles Sadurn\355 An\ guita \(Catalan\), Dominik 'Chiron' Derlatka \(Polish\), Ew)-.05 E (ald Beekman)-.1 E(\(Dutch\), Claudiu Costin \(Romanian\), K)108 309.6 Q (enneth Geisshirt \(Danish\), Zdenk)-.25 E 2.5(oP)-.1 G(odobn)-2.5 E 2.5 (y\()-.15 G(Slo)-2.5 E -.25(va)-.15 G(k\), and Eric).25 E(Nichols \(Ha) 108 321.6 Q -.1(wa)-.15 G(iian\).).1 E -1.11(Ve)72 768 S(rsion 4.11.0) 1.11 E(18 Dec 2007)150.4 E(18)198.45 E 0 Cg EP %%Trailer end %%EOF pcal-4.11.0/doc/pcal-help.txt0000644000175000001440000022202510732024127014055 0ustar wusersPCAL(1) USER COMMANDS PCAL(1) NNAAMMEE pcal - generate PostScript (or HTML) calendars SSYYNNOOPPSSIISS ppccaall [--ee|--ff _c_a_l] [--oo _f_i_l_e] [--ll | --pp] [--PP [letter | legal | a4 | tabloid]] [--jj | --JJ] [--mm | --MM] [--gg _w_e_e_k_d_a_y[_-_w_e_e_k_d_a_y]|all|holiday] [--OO _w_e_e_k_d_a_y[_-_w_e_e_k_d_a_y]|all|holiday] [--GG _w_e_e_k_d_a_y[_-_w_e_e_k_d_a_y]|all|holi- day] [--bb _w_e_e_k_d_a_y[_-_w_e_e_k_d_a_y]|all|holiday] [--ss [_d_a_y___n_u_m_e_r_- _i_c_s___c_o_l_o_r][/_e_m_p_t_y___d_a_y___b_o_x___f_i_l_l___c_o_l_o_r]] [--FF _d_a_y] [--AA|--EE] [--XX _x_t_r_a_n_s] [--YY _y_t_r_a_n_s] [--xx _x_s_c_a_l_e] [--yy _y_s_c_a_l_e] [--tt [_t_i_t_l_e___f_o_n_t][/_s_i_z_e]] [--dd [_d_a_y___f_o_n_t][/_s_i_z_e]] [--nn [_t_e_x_t___f_o_n_t][/_s_i_z_e]] [--LL _f_o_o_t_e_r___s_t_r] [--CC _f_o_o_t_e_r___s_t_r] [--RR _f_o_o_t_e_r___s_t_r] [--NN _n_o_t_e_s___s_t_r] [--DD _s_y_m_b_o_l] [--UU _s_y_m_b_o_l] [--BB] [--## _n] [--SS | --kk | --KK] [--ww] [--II] [--cc | --HH] [--qq] [--zz _t_i_m_e___z_o_n_e] [--hh | --uu | --vv] [--aa _o_u_t_p_u_t___l_a_n_g_u_a_g_e] [--rr [_m_a_p_p_i_n_g] [--TT [B|I|R]] [--WW [left|center|right]] [month] [year] [nmonths] DDEESSCCRRIIPPTTIIOONN _P_c_a_l generates PostScript to produce landscape or portrait calendars for any month and year. The arguments mmoonntthh, yyeeaarr, and nnmmoonntthhss, if provided, should be numeric. The mmoonntthh value should be in the range 1 - 12, and the yyeeaarr value should be specified as 1 or 2 digits (in which case it will be interpreted as that year in the current century) or as the full 4-digit year. If no numeric arguments are provided, the cal- endar for the current month and year will be generated. If one numeric argument is provided, it is interpreted as the yyeeaarr value, and calendars for the entire year will be generated. Otherwise, nnmmoonntthhss months, starting with mmoonntthh and yyeeaarr, will be generated. For whole-year calendars (i.e. when the --ww option is given), the com- mand line arguments are interpreted somewhat differently. By default, all months in the current year are printed, starting with January. If the mmoonntthh argument alone is given, it is expected to be the desired yyeeaarr to print, and prints all of the months in the given year. If both mmoonntthh and yyeeaarr are given, then 12 consecutive months are printed start- ing at the given month and year. If the mmoonntthh, yyeeaarr, and nnmmoonntthhss argu- ments are all present, printing begins with the given month and year and nnmmoonntthhss months are printed, rounded up to the nearest multiple of 12. TThhee DDaattee FFiillee ((CCoonnffiigguurraattiioonn FFiillee)) By default, _p_c_a_l simply prints an empty calendar. Its real power is in its ability to place ``events'' (and, for monthly-format PostScript calendars, Encapsulated PostScript images [e.g. photos and icons]) in appropriate days on the (PostScript or HTML) calendar, thus allowing the user to create personalized calendars. This is achieved through the use of the ``date file'', also known as the ``configuration file''. The default date/configuration file is expected to be named _._c_a_l_e_n_d_a_r (_p_c_a_l_._d_a_t under MS-DOS), or _c_a_l_e_n_d_a_r for compatibility with older ver- sions. _P_c_a_l will look in several places for such a file. First, if the environment variable PPCCAALL__DDIIRR is defined, _p_c_a_l searches the direc- tory indicated by that variable. Next, _p_c_a_l searches the user's home directory (as specified by the HHOOMMEE environment variable). If neither PPCCAALL__DDIIRR nor HHOOMMEE is defined, _p_c_a_l searches the current directory instead. Finally, if enabled (via the `SEARCH_PCAL_DIR' flag) when _p_c_a_l was built, the directory where the _p_c_a_l executable resides will be checked. If no date file is found, an empty calendar is printed; no error is generated. Alternatively, the name of the date file (and, optionally, the path where it can be found) can be specified using the --ff command-line option. See the OOPPTTIIOONNSS section for more details. Every _p_c_a_l distribution comes with an 'examples' directory. The `pcal- cfg.txt' file that is located there contains a myriad of examples of settings that can be used in your own configuration file. Please check it out for lots of useful ideas. Furthermore, that directory contains several language/country-specific examples (including holiday and other event definitions) in various `calendar_xx.txt' files, where `xx' rep- resents the 2-letter language code (e.g. 'calendar_de.txt' is the Ger- man example file). 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. Encapsulated PostScript (EPS) images are handled similarly as described in a later subsection. ttrrooffff-style escape sequences \fB, \fI, \fP, and \fR may be used to set the font style to Bold, Italic, the previous font style, or Roman respectively. For those more familiar with HTML, , , , and may be used instead to enable/disable Bold or Italic font styles. The font style is reset to Roman after each line break. Using the `include' pre-processor directive (described in the section entitled `Pre-Processor Functionality', below), other configuration files can be processed from within an existing configuration file. That is, you can `nest' configuration files as needed. Dates (essentially `events') in the configuration files may be expressed in any of several formats: +o in {*} {} +o {} {*} {} +o {*} {} +o {*} {} Where: := first 3+ characters of name of month, or ``all'' NNoottee:: _p_c_a_l looks for names of the days of the week prior to names of months when parsing event date specifications. Furthermore, some languages (e.g. French and Finnish) have a month name whose first 3 letters are the same as the first 3 let- ters of one of the names of the days of the week. Because of this, the specification in such a lan- guage of any month name which collides thusly must use 4 or more letters to distinguish it from the name of the day of the week with which it `collides'. := , or ``year'' := first 3+ characters of name of weekday, ``day'', ``weekday'', ``workday'', ``holiday'', ``nonweekday'', ``nonworkday'', ``nonholiday'', ``new_moon'', ``first_quarter'', ``full_moon'', or ``last_quarter'' := any ordinal number (``1st'', ``2nd'', etc.), ``first'' ... ``fifth'', ``last'', ``odd'', ``even'', or ``all'' := ``on'', ``before'', ``preceding'', ``after'', ``following'', ``on_or_before'' (``oob''), ``on_or_after'' (``ooa''), ``nearest'', ``near- est_before``, or ``nearest_after`` := ``Christmas'', ``Thanksgiving'', ``Easter'', ``Good_Friday'', ``GEaster'' (Orthodox Easter), ``Gstgeorge'' (Orthodox holiday), and ``Gmarcus'' (Orthodox holiday). := one or more non-numeric, non-space, non-`*' characters := a numeric month (1-12) := day of month (1-31) := a numeric year := the text to be displayed for this event; if the text begins with the constant string ``image:'', then it is interpreted as a specifi- cation of an Encapsulated PostScript (EPS) image rather than as simple text; more information on specifying EPS images is available in a later section of this document If the --AA option (American date formats, the default) is given: := | {} If the --EE option (European date formats) is given: := | | {} The ``Notes'' box (see below) uses the first of the current month as the default date. All footer strings use the first of the current month in single-month mode and the first of the starting month in whole-year mode. Examples: last Monday in May* Memorial Day Holiday all Fridays in Oct Status Meeting, 11 AM first workday in all %-B progress report due all Fri in all \fBTime card due,\fP 3 PM all Monday in all Fiscal week %0W -2nd workday in all Schedule for %+B due %+2D 2nd full_moon in all Blue Moon Fri on_or_before all 15 Pay Day even Fridays in year Pay Day 183rd day of year Mid-year (%l days left) Tue after first Mon in Nov Election Day (USA) 4th Thu in Nov* Thanksgiving Fri after 4th Thu in Nov* Day after Thanksgiving workday nearest 12/25* Holiday 12/25/04* Christmas # American 25.12.04* Christmas # European 25. 12.* Christmas # European Dec 25* Christmas # American 25 Dec* Christmas # European 25. Dec* Christmas # European Fri on all 13 Avoid black cats! # 'Friday the 13th' Any non-numeric character may separate numeric dates. Holidays may be flagged by following the date immediately with `*' as in the examples above; this will cause the date numerics to be printed in the color specified by the --ss option (default = gray) and will cause the associ- ated text (on monthly-format calendars) to be placed adjacent to the numeric date in the day box rather than below the numeric date (as is done for all non-holiday events). ``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 key- words ``on_or_before'' and ``on_or_after'', respectively. ``Nearest'' attempts to match the specified date; if that fails, it tries the day after, then the day before, then two days after, two days before, and so forth until a match occurs. Wildcard day names are also provided. The keyword ``weekday'' applies to any days which are normally printed in "logical black" - the predom- inant day color - 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 ``nonweek- day'', ``nonworkday'', and ``nonholiday'' are also recognized as nega- tions of the above. See the CCAAVVEEAATTSS below for important notes on using these keywords. Moon phases may also appear as wildcards; ``nm'' is accepted as a synonym for ``new_moon'', ``1q'' and ``fq'' for ``first_quarter'', ``fm'' for ``full_moon'', ``3q'' for ``third_quar- ter'', and ``lq'' for ``last_quarter''. 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 (e.g. 100th). Negative ordinal numbers may even be used. For example, ``-2nd'' means ``next to last''. ``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. ``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. ``Nearest'', ``nearest_before'', and ``nearest_after'' refer to the nearest weekday or wildcard day with respect to the specified date. ``Nearest_before'' and ``nearest_after'' allow the user to specify how _p_c_a_l is to disambiguate between two dates that are equally near: e.g., ``nonweekday nearest_before [Wed.] 9/25/96'' refers to Sunday, 9/22 while ``nonweekday nearest_after 9/25/96'' refers to Saturday, 9/28. (Note that ``nearest_before'' and ``nearest_after'' are equivalent to ``nearest'' when no such ambiguity exists: e.g., ``nonweekday near- est_before [Thu.] 9/26/96'' refers to Saturday, 9/28.) Text in the date file may use C-like escape sequences (i.e. a `\' fol- lowed by a character, 1 - 3 octal digits, or `x' followed by 1 - 2 hexadecimal digits). Escaped whitespace (including nneewwlliinnee ) and the standard ANSI character escapes (`\a', `\b', `\f', `\n', `\r', `\t', `\v') are all replaced by a single blank. The HTML special characters `<' `>' `"' `&' ` ' and `&#NNN;' (NNN = any three decimal digits) are also supported. These will be propagated intact (be sure to escape the `#' in `&#NNN;') if the output is specified as HTML (see the --HH flag); otherwise they will be converted to their ASCII equivalents. This allows a common date file to be used regardless of whether the desired output format is HTML, PostScript, or Un*x _c_a_l_e_n_d_a_r_(_1_) (see the --cc flag) input. Lines in the configuration file consisting of yyeeaarr ######## (where ######## 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. Lines in the configuration file consisting of yyeeaarr aallll (or, alterna- tively, yyeeaarr **) direct _p_c_a_l to wildcard following entries against every applicable year. This assumes that the following entries do not con- tain a year; any date entries containing year information (or an explicit yyeeaarr ######## entry) will set the remembered year to that year. Lines in the configuration file consisting of oopptt <> can be used to override the defaults for any command-line options except --cc, --ee, --ff, --hh, --HH, --uu, --vv, --DD, and --UU. Any options specified in this manner are, in turn, overridden by those specified explicitly on the command line. Lines in the configuration file consisting of nnoottee{{//<>}} <> can be used to place notes regarding the entire month in one of the unused blocks of the calendar. The <> 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. <> is an optional positive or nega- tive number specifying the empty box where the associated text is to be placed. If positive, _p_c_a_l counts forward from the first empty box; if negative, _p_c_a_l counts backward from the last empty box. Thus, ````nnoottee//11'''' places the associated text in the first empty box; nnoottee//--33 in the third-to-last. The default is -1 if no is given (last empty box, immediately preceding the small calendars on the bottom row; cf. --SS, --kk, and --KK, below). You can place several notes in the same box. You can also use more than 1 box for the various monthly notes. Lines in the configuration file consisting of iinnppuutt--llaanngguuaaggee XXXX (where XXXX is the 2-letter specification for any of the supported languages) can be used to set the language used for interpretation of the month names and day-of-week names for the remaining event entries. This option may be specified more than once, as needed, if the language used to describe events changes within the file. For backwards compatibil- ity, the default value for `input language' if this directive is never used is 'en' (English). Note that this directive is distinct from the specification of 'output language' as accomplished with the --aa option. Comments are supported in the configuration file. Any characters fol- lowing a `#' character are ignored, through the end of that line, unless the `#' character is escaped by `\'. DDeelleettiinngg EEvveennttss By prepending the _`_d_e_l_e_t_e_' keyword to an event specification, one or more events may be deleted from a set of previously-specified events. For example, the following lines might appear in the date file: all Friday in all Poker game delete first Friday in all Poker game This results in an event labeled `Poker game' on every Friday except the first Friday of the month. If you delete an entry which is marked as a holiday, the `holiday' flag for that day will be recalculated. Any `delete' entries which don't match any pre-existing entries are silently ignored. FFoorrmmaatt SSppeecciiffiieerrss _P_c_a_l allows format specifiers in both the event text and footer strings (see the --LL, --CC, --RR, and --NN options below). Each format specifier will be replaced by a corresponding string as outlined in the following ta- ble: %a abbreviated weekday %A full weekday %b abbreviated month name %B full month name %d day of month (1-31) %j day of year (1-366) %l days left in year (0-365) %m month (1-12) %U week number (0-53) %W week number (0-53) %u week number (1-54) %w week number (1-54) %y year w/o century (00-99) %Y year w/century %% `%' character %o print number as ordinal %0 print number with leading zeroes %+ use following month or year %- use previous month or year %{+N}[DWMY] adjust date by +N days/weeks/months/years %{-N}[DWMY] adjust date by -N days/weeks/months/years Most of these are derived from the ANSI C strftime() function, but the %%[[lloouuwwMMDD]] and %%[[oo00++--]] format specifiers are specific to _p_c_a_l. The %%uu specifier considers the week containing 1/1 (Jan 1st) as week 1 and the following logical Sunday (the first day of the week as printed; cf. the --FF option below) as the start of week 2; %%UU considers the first logical Sunday as the first day of week 1. %%ww and %%WW behave like %%uu and %%UU respectively, but use the first logical Monday instead. Note that %%ww has a different meaning from strftime(). The %%oo format specifier prints a number as an ordinal, with the appro- priate suffix (``st'', ``nd'', ``rd'', or ``th'' in English) appended. For example, %%oodd prints the day of the month as ``1st'', ``2nd'', ``3rd'', etc. Unlike strftime(), _p_c_a_l defaults to printing numbers (except %%yy) with- out leading zeroes. If leading zeroes are desired, the `0' prefix may be used. For example, %%00jj prints the first day of year as ``001''. The %%++ and %%-- format specifiers direct _p_c_a_l to substitute the follow- ing/previous month/year in the following [[bbBBmmyyYY]] specifier. For exam- ple, %%++BB prints the name of the next month. The %%{{[[++--]]NN}}[[DDWWMMYY]] format specifiers do not print anything, but instead adjust the working date by +- NNdays (DD), weeks (WW), months (MM), or years (YY). Subsequent format specifiers use the adjusted date instead of the current date. For example, %%++11MM %%BB %%YY adjusts the date forward by one month and then prints the resulting month and year (``January 1992'' in December, 1991); %%--22WW %%bb %%dd adjusts the date backward by two weeks and prints the resulting month and day (``Jul 26'' on August 9). Such date adjustments are normally cumulative; for example, %%++11YY%%--11DD adjusts the date forward by one year and then backward by one day. If %%DD or %%MM is specified alone (or if NN is zero), _p_c_a_l restores the origi- nal date. Note that %%MM has a different meaning to the strftime() func- tion. Here's a common, useful example of an event entry for the _p_c_a_l date file which combines the ability to adjust working dates and the ability to display ordinals. This particular example is used to display text on the birthday of a person born in 1991: May 10 Eric's %-1991Y%oY Birthday That entry would result in the following text being displayed on May 10, 2005: Eric's 14th Birthday EEnnccaappssuullaatteedd PPoossttSSccrriipptt ((EEPPSS)) IImmaaggeess For monthly PostScript calendars only, _p_c_a_l supports the embedding of one or more EPS images (photos, icons, etc) into any given day of the month. (EPS image specifications in the _p_c_a_l date file are ignored for yearly PostScript calendars and for all HTML calendars.) In order to associate an image with a given event, you must add one or more entries to the date file. The event date is specified exactly as described previously for simple event text specification lines. How- ever, instead of specifying the text associated with the event, you instead specify the EPS image filename and some additional parameters in the following format: image: Where: is the filename (which can include a path) of the Encapsulated PostScript image. NNoottee:: The EPS image filename must be pre- ceded by the constant text `image:' in order to distinguish an EPS image specifi- cation from an ordinary event text specifi- cation. is a scaling factor in the horizontal dimension for the EPS image. A value of 1.0 is nominal (i.e. no change to image scale). Values between 0.0 and 1.0 shrink the image in the horizontal dimension while values over 1.0 expand the image in the horizontal dimension. Generally speaking, only positive values should be used. How- ever, in the rare case that you find that your EPS image needs to be flipped about the vertical axis (i.e. left to right), you can use a negative value to achieve this without having to tweak the actual Post- Script content within the EPS image file. Use of a negative value will undoubtedly necessitate a corresponding change to the parameter to account for the image's relocated position that occurs when it gets flipped "left-to-right". is a scaling factor in the vertical dimen- sion for the EPS image. Values between 0.0 and 1.0 shrink the image in the vertical dimension while values over 1.0 expand the image in the vertical dimension. Note that a negative value for this parameter can be useful in the less-than-rare case that you find that your EPS image needs to be flipped about the horizontal axis (i.e. top to bottom). In such cases, you can use a negative value to achieve this without having to tweak the actual Post- Script content within the EPS image file. Use of a negative value will undoubtedly necessitate a corresponding change to the parameter to account for the image's relocated position that occurs when it gets flipped "upside down". := a horizontal adjustment in typographic `points' (i.e. 72nds of an inch) for the positioning of the EPS image. With offsets of 0 for X and Y, the image will be printed at the extreme left edge of the box for that day, just under the numerics for that day. Positive values move the image to the right and negative values move the image to the left. := a vertical adjustment in typographic `points' (i.e. 72nds of an inch) for the positioning of the EPS image. With offsets of 0 for X and Y, the image will be printed at the extreme left edge of the box for that day, just under the numerics for that day. Positive values move the image up and negative values move the image down. Here's an example of a line from the date file that associates an EPS image with an event: 4th Thu in Nov* Thanksgiving 4th Thu in Nov* image:/eps-path/turkey.eps 1.0 1.0 0 0 You can place as many images as you want on a single day of the month by specifying repeated lines in the date file. For example, these lines put icons of George Washington and Abraham Lincoln on the day of the U.S. ``Presidents' Day'' holiday, along with the event text: 3rd Monday in Feb* Presidents' Day 3rd Monday in Feb* image:/eps-path/washington.eps 0.08 0.08 8 0 3rd Monday in Feb* image:/eps-path/lincoln.eps 0.22 0.22 48 0 Note that the icon for Lincoln is shifted to the right by 48 typo- graphic points so as not to overlay the first icon. The _p_c_a_l releases come with a single EPS sample file ('eps/recy- cle.eps') of the ubiquitous 'recycle' icon (3 green arrows in a trian- gular shape). Such an image might be used with configuration file set- tings like this: second Sat in all RECYCLE! second Sat in all image:/eps-path/recycle.eps 0.039 0.039 34 -9 In cases where you're displaying non-holiday event text (e.g. someone's birthday) and an EPS image, you'll often need to use a negative `Y- delta' value on the EPS image specification line, in order to shift the image down so that it doesn't cover the event text, which appears just below the day's numerics for non-holiday events. (Text for holiday events appears higher up, to the right of the day's numerics, so there's usually no collision with the EPS image.) NNoottee:: Unfortunately, most EPS images cannot be used directly by _p_c_a_l. Depending on the EPS image used and how it was created, you may have to remove or comment out some or all of the PostScript `translate' commands, in order to avoid the use of illogical X- delta and Y-delta values when specifying the EPS image in your _p_c_a_l date file. Most programs that generate EPS output (either directly or via conversion from some other graphic format) seem to have these `translate' commands relatively early in the EPS file. It may take some experimentation to get it just right. Preview the _p_c_a_l output using a PostScript viewer as you tweak the Post- Script commands in the EPS image file and/or the event entry in the _p_c_a_l date file. NNoottee:: Depending upon what application you use to preview PostScript content, the monthly calendars may not show any embedded EPS images. Here's a rundown of some popu- lar PostScript-viewing applications and whether they cor- rectly display the embedded EPS images: +o gv (version 3.5.8) -- EPS images appear fine +o ggv (versions 2.4.0.1 and 2.6.1) -- EPS images appear fine +o older kghostview (versions 0.13.2 [KDE 3.1.4] and 0.2.0 [KDE 3.2.3 and 3.3.2]) -- EPS images DO NOT APPEAR! +o newer kghostview (version 0.2.0 [KDE 3.4.2 and 3.5.4]) -- EPS images appear fine For converting non-EPS images (e.g. photos) to EPS format, one can use the graphical GNU Image Manipulation Program, a.k.a. `The GIMP': _h_t_t_p_:_/_/_w_w_w_._g_i_m_p_._o_r_g For icons/images in WMF format (which are popular in various 3rd-party, legacy-OS, commercial calendar programs), the `libwmf'/`wmf2eps' library/utility is useful for generating _p_c_a_l-capable EPS images. It can be found at this site: _h_t_t_p_:_/_/_w_v_w_a_r_e_._s_o_u_r_c_e_f_o_r_g_e_._n_e_t_/_l_i_b_w_m_f_._h_t_m_l For icons/images in SVG format, the ImageMagick `convert' utility is sometimes useful for generating _p_c_a_l-capable EPS images. This suite of utilities (which includes other useful ImageMagick utilities like `dis- play' and `identify') may already be available on your Linux distribu- tion. If not, it can be found at this site: _h_t_t_p_:_/_/_w_w_w_._i_m_a_g_e_m_a_g_i_c_k_._o_r_g For cases where ImageMagick's `convert' utility fails to properly con- vert SVG-format images to EPS format, you can try the method of con- verting the SVG image into an intermediate format (e.g. PNG) using the `rsvg' utility. This utility may already be available on your Linux distribution. If not, it can be found at this site: _h_t_t_p_:_/_/_l_i_b_r_s_v_g_._s_o_u_r_c_e_f_o_r_g_e_._n_e_t_/ From the PNG format, the image can often then be successfully converted to EPS format, using the above-mentioned ImageMagick `convert' utility. The _O_p_e_n _C_l_i_p _A_r_t _L_i_b_r_a_r_y is a good source of freely-usable images (many of which are in SVG format) for decorating your events: _h_t_t_p_:_/_/_w_w_w_._o_p_e_n_c_l_i_p_a_r_t_._o_r_g NNoottee:: The EPS image content is not generated in the PostScript output -- only a reference to the EPS image filename is generated. From a practical standpoint, this means that normally you'll need to print/preview the PostScript output of _p_c_a_l from the same computer/set- up as that which was used to run _p_c_a_l in the first place. If you want to generate a calendar with embedded EPS images that will later be printed/viewed on another machine which does not have access to those EPS images, you'll need to run the output through a pre-processor which will put the EPS image content into the PostScript output file. For example, assuming your initial calendar output was generated to a file named `pcal.ps', on most GNU/Linux systems you could run this command, which uses the popular `Ghostscript' interpreter: gs -r300x300 -dBATCH -dNOPAUSE -sDEVICE=pswrite -sOutput- File=out.ps pcal.ps This would generate a PostScript file named `out.ps', at 300x300 dpi resolution, which has the actual EPS image content embedded within, allowing you to transport the `out.ps' file to another computer for viewing/printing. Of course, the new file is substantially larger, but it's portable. Furthermore, the EPS images will be viewable even in PostScript-viewing applications (see above) which don't properly sup- port the display of embedded (by filename only) EPS images. PPrree--PPrroocceessssoorr FFuunnccttiioonnaalliittyy _P_c_a_l supports rudimentary _c_p_p-like functionality in the date file, allowing the following constructs: +o ddeeffiinnee || uunnddeeff +o iiff{{{{nn}}ddeeff}} ...... {{eelliiff ......}}** {{eellssee ......}} eennddiiff +o iinncclluuddee Note that these are not preceded by `#' as they are in C. Symbol names defined using these keywords (or via the --DD option) are case-insensitive. It is not an error to uunnddeeff an undefined symbol, nor to ddeeffiinnee a previously-defined one. A symbol can be defined with just a name (e.g. ``define MY_SYM'') or it can take on a value (e.g. ``define MY_SYM SOME_VALUE''). Use of symbol values is convenient for defining a starting date then using that sym- bol to reference that starting date in one or more events. For exam- ple, these definitions in the date file might be useful: define semester_start 8/23 # Beginning of semester semester_start Class Start 7th day after semester_start 1st Quiz 14th day after semester_start 2nd Quiz undef semester_start Be aware that the substitution of symbol values for symbol names is not robust, so it's wise to use a symbol name that's unlikely to occur in any of your other event text. In other words, if you defined the `se- mester_start' symbol in the example above as merely `start', then you'd get the undesired effect of having the text `Class 8/23' in your calen- dar on that day instead of `Class Start'! The use of `undef semes- ter_start' in the above example is optional and is really only useful to prevent any unwanted symbol substitutions later on, which probably won't happen unless you poorly choose your symbol name to begin with. An iiffddeeff alone is always ffaallssee; an iiffnnddeeff alone is always ttrruuee. iiff is accepted as a synonym for iiffddeeff. The name of the file in the iinncclluuddee directive may optionally be sur- rounded 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. If the string "%y" appears in the file name, it is replaced by the last two digits of the current year or, if "year all" is in effect, is expanded to all appli- cable years. _P_c_a_l is smart enough to translate ~~// to the user's home directory. _P_c_a_l normally terminates immediately if the file specified in an iinncclluuddee directive does not exist. An alternate form of the directive, iinncclluuddee??, directs _p_c_a_l to continue silently if the file does not exist or cannot be opened. In addition to pre-processing keywords, _p_c_a_l also accepts boolean expressions in iiff{{{{nn}}ddeeff}} and eelliiff directives. These expressions con- sist of symbol names joined by the boolean operators !!, &&, ^^, and ||, in order of precedence, high to low. Parentheses may be used to alter the precedence. The synonyms &&&& and |||| are accepted for && and ||. A symbol name evaluates to ttrruuee if currently defined, ffaallssee if not; thus: ifdef A | B | C ...is ttrruuee if any of the symbols A, B, and C is defined, and: ifdef A & B & C ...is ttrruuee if they all are. Note that iiffnnddeeff <> is equivalent to iiffddeeff !!(( <> )).. TThhee MMoooonn FFiillee If a file of the name _._m_o_o_n_#_# (_m_o_o_n_#_#_._d_a_t under MS-DOS), where #### is the last two digits of the calendar year, exists in the same directory as the date file (or in the directory where _p_c_a_l resides), _p_c_a_l uses the information contained within to calculate the phase of the moon. If a) no such file exists, b) the --ee flag (do not use a date file) is specified, or c) the --zz flag (specify time zone) is specified, then _p_c_a_l uses an algorithm to calculate the phase of the moon. Entries in the moon file must conform to the following syntax: If the --AA option (American date formats, the default) is given: {} If the --EE option (European date formats) is given: {} Where: := ``nm'', ``fq'' or ``1q'', ``fm'', ``3q'' or ``lq'' (new moon, first quarter, full moon, last quarter) := number 0-23 (24-hour clock) := number 0-59 This file must contain entries for all quarter moons in the year, in chronological order; if any errors are encountered, _p_c_a_l will revert to using its default algorithm. As in the date file, comments start with `#' and run through the end of the given line. The moon file may optionally contain an oopptt --AA or oopptt --EE line to spec- ify the format of its own date entries independently of the format used in the date file. No other flags are legal in the moon file. GGeenneerraattiinngg PPoossttSSccrriipptt CCaalleennddaarrss VViiaa AA WWeebb BBrroowwsseerr IInntteerrffaaccee PostScript-format _p_c_a_l calendars can be generated and viewed from a web browser interface. NNoottee:: This is not to be confused with the ability to generate non-PostScript, HTML-format (using the --HH command-line option) calendars, which is a different capability entirely. _P_c_a_l comes with 4 files that provide this ability: `pcal.cgi' (a Bourne shell script), `pcal.pl' (a Perl equivalent of `pcal.cgi'), `pcal.html', and `pcalw.html'. The CGI file (either `pcal.cgi' or `pcal.pl') must be edited before using it. Change the definition for _`_p_c_a_l_=_' (Bourne shell script) or _`_m_y _$_P_C_A_L _=_' (Perl script) to point to the location of the _p_c_a_l exe- cutable file. Change the definition for _`_f_i_l_e_=_' (Bourne shell script) or _`_m_y _$_F_I_L_E _=_' (Perl script) to point to the location of the _p_c_a_l `date file' (e.g. `.calendar'), which contains the options for running _p_c_a_l. Finally, copy the `pcal.cgi' (or `pcal.pl') file to the location where your web server expects to find such files (e.g. `/var/www/cgi- bin/'). The `pcal.html' and `pcalw.html' files must also be edited. Each one has a line like this: That line must be edited to point to the host and location of your CGI script file (`pcal.cgi' or `pcal.pl'). Once that's done, point your web browser to the `pcal.html' or `pcalw.html' file to generate monthly/yearly PostScript calendars for viewing within your web browser. NNoottee:: Depending upon what application your web browser spawns to preview PostScript content, the monthly calendars generated via this web browser interface may not show any embedded EPS images. For a rundown of some popular PostScript-viewing applications and whether they correctly display the embedded EPS images, see the section (above) entitled `Encapsulated PostScript (EPS) Images'. OOPPTTIIOONNSS --ee Prints an empty calendar. Do not print entries from a _._c_a_l_e_n_d_a_r file even if one exists. --ff _c_a_l Directs _p_c_a_l to use the file name _c_a_l as the input file in place of the default _._c_a_l_e_n_d_a_r file. Note that the search rules are different when --ff is used. If _c_a_l is an absolute file name (i.e. starting with a `/'), then _p_c_a_l attempts to open only that file. Otherwise, _p_c_a_l looks for _c_a_l in the current directory, then in the directory indicated by the environment variable PPCCAALL__DDIIRR (if defined), and finally, if enabled (via the `SEARCH_PCAL_DIR' flag) when _p_c_a_l was built, in the directory where the _p_c_a_l executable resides. If the given _c_a_l file is not found, an error results. --oo _f_i_l_e Directs _p_c_a_l to write the output to _f_i_l_e instead of to stdout. --ll Causes the output to be in landscape mode (default). _P_c_a_l predefines the symbol `ORIENTATION_LANDSCAPE' whenever `landscape' page orientation is enabled. This can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on the page orientation. --pp Causes the output to be in portrait mode. _P_c_a_l predefines the symbol `ORIENTATION_PORTRAIT' whenever `por- trait' page orientation is enabled. This can be useful for pro- viding alternate values in the configuration file for EPS image placement and scaling, based on the page orientation. --PP Selects the paper size. The following sizes are supported: +o letter -- 8.5 x 11.0 inches +o legal -- 8.5 x 14.0 inches +o a4 -- 210 x 297 mm +o tabloid -- 11.0 x 17.0 inches _P_c_a_l predefines one of the following symbols based on the cur- rent paper size: +o PAPERSIZE_LETTER +o PAPERSIZE_LEGAL +o PAPERSIZE_A4 +o PAPERSIZE_TABLOID These symbol definitions can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on paper size. --jj Causes the Julian date (day of year) to be printed in each cal- endar box. --JJ Causes the Julian date and the number of days remaining in the year to be printed in each calendar box. --mm Causes moon icons to be printed on dates corresponding to new, half, and full moons (the default is that no moons are printed). --MM Causes moon icons to be printed on all dates (the default is that no moons are printed). --gg _d_a_y_1[_-_d_a_y_2] || aallll || hhoolliiddaayy Causes all dates falling on weekday _d_a_y_1 (through _d_a_y_2 if speci- fied) to be printed in the `day numerics color' (i.e. the color specified by the --ss option [default = gray]); --gg aallll causes all weekdays (other than holidays) to be printed in the `day numer- ics color'; --gg hhoolliiddaayy causes all holidays to be printed in `day numerics color'. _d_a_y_1 and _d_a_y_2 may wrap around weekends; for example, --gg ffrrii--ssuunn causes Fridays, Saturdays, and Sundays to be printed in the `day numerics color'. --OO _d_a_y_1[_-_d_a_y_2] || aallll || hhoolliiddaayy Similar to --gg, but the selected days will be printed as outlined characters, using the `day numerics color'. --GG _d_a_y_1[_-_d_a_y_2] || aallll || hhoolliiddaayy Similar to --gg, but the selected days will be printed in the `day numerics color', outlined in black. --bb _d_a_y_1[_-_d_a_y_2] || aallll || hhoolliiddaayy Similar to -- you guessed it -- --gg, but the selected days will be printed in black. Since black is the default for weekdays, -b is primarily used to overriding other flags (e.g., --gg aallll --bb ssaatt--ssuunn ). NNoottee:: The default for the above options is to print Saturdays, Sun- days, and holidays in the `day numerics color' and all other days in black. For backward compatibility with earlier versions of _p_c_a_l, --OO and --GG alone change all non-black days to the speci- fied color. --ss _[_d_a_y___n_u_m_e_r_i_c_s___c_o_l_o_r_]_[_/_e_m_p_t_y___d_a_y___b_o_x___f_i_l_l___c_o_l_o_r_] Overrides the default value(s) for the color of the numerics for each day and/or the color of the fill used on boxes for 'empty' days. NNoottee:: This option only applies to PostScript-format cal- endars, not to HTML-format calendars. These values may be set independently of each other. For use with non-color printers, these values should be in the range 0.0 (black) through 1.0 (white). The default values are 0.8 for day numerics and 0.9 for empty day boxes. For use with color printers, these values may optionally be specified as a set of _r_e_d:_g_r_e_e_n:_b_l_u_e (RGB) values, each of which must in the range 0.0 through 1.0. At least one `:' must be present for these values to be recognized as RGB colors; omitted values are set to 0.0. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --FF _d_a_y Selects weekday _d_a_y as the first day of the week. The given day will appear in the left-most column of the calendar. _d_a_y may be specified either as a weekday name or, optionally, as a number in the range 0 (Sunday) through 6 (Saturday). This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --AA Directs _p_c_a_l to use American date conventions ( mmmm//dddd{{//yyyy}} and mmoonntthh dddd ) when parsing the date file. This is the default. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --EE Directs _p_c_a_l to use European date conventions ( dddd//mmmm{{//yyyy}} and dddd mmoonntthh ) when parsing the date file. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --XX _x_t_r_a_n_s Specifies the x-axis translation value for positioning the out- put on the page. Positive values shift the output to the right. Negative values shift the output to the left. --YY _y_t_r_a_n_s Specifies the y-axis translation value for positioning the out- put on the page. Positive values shift the output up. Negative values shift the output down. --xx _x_s_c_a_l_e Specifies the x-axis scaling factor for the calendar size. --yy _y_s_c_a_l_e Specifies the y-axis scaling factor for the calendar size. --tt [_t_i_t_l_e___f_o_n_t][//_s_i_z_e] Specifies the name of a font to use for all the calendar heading text: +o the month name and year at the top of the calendar (for monthly-format calendars) or at the top of each month (for yearly-format calendars and for the small previ- ous/next-month calendars [if enabled] on monthly-format calendars) +o the day-of-week names +o the footer strings (if any) +o the ``Notes'' box heading (if any; for monthly calen- dars only) For monthly calendars only, the user may optionally specify the font size, which applies only to the main month/year heading. For example, ppccaall --tt TTiimmeess--RRoommaann//5544 sets the font to Times-Roman and the month/year point size to 54. The font size may also be changed independently: ppccaall --tt //5544 changes the point size to 54 without affecting the font name. Note: For yearly calendars, any specification of font _s_i_z_e is ignored. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --dd [_d_a_t_e___f_o_n_t][//_s_i_z_e] Similar to the --tt option, but selects the font and/or size used for the day numerics (the numbers inside the box for each day). Note: For yearly calendars, any specification of font _s_i_z_e is ignored. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --nn [_t_e_x_t___f_o_n_t][//_s_i_z_e] Similar to the --tt and --dd options, but selects the font and/or size used for any `event' text associated with each day and for any text in the monthly ``Notes'' box. Note: This option applies to monthly calendars only. For yearly calendars, this option does not apply. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --LL _s_t_r_i_n_g 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. --CC _s_t_r_i_n_g Similar to --LL, but causes the accompanying string to be printed as a centered footer. If the --HH flag (generate calendar as HTML table) was specified, this string will be used as the title and heading. --RR _s_t_r_i_n_g Similar to --LL, but causes the accompanying string to be printed as a right-justified footer. --NN _s_t_r_i_n_g Causes the accompanying string to be printed as the heading for the "Notes" box. Note, however, that _p_c_a_l makes no attempt to ensure that it fits. --DD _s_y_m_b_o_l _[_v_a_l_u_e_] Defines the named symbol and an optional value to be associated with that symbol, prior to reading the date file. --UU _s_y_m_b_o_l Un-defines the named symbol prior to reading the date file. --BB Causes _p_c_a_l to leave unused calendar day boxes blank as opposed to the default behavior of filling them using the `empty day-box fill color' (i.e. the color specified by the --ss option [default = gray]). --## _n Causes _p_c_a_l to print _n copies (maximum: 100) of each output page. --SS Causes _p_c_a_l to suppress printing the small calendars. See the CCAAVVEEAATTSS section for further details. --kk Causes _p_c_a_l to print the small calendars in the upper left cor- ner (the default is to print them at the lower right). --KK Causes _p_c_a_l to print the small calendar for the previous month in the upper left corner and the next month in the lower right (the default is to print both at the lower right). --ww Causes _p_c_a_l to print a calendar for 12 consecutive months: 3 rows / 4 columns in landscape mode, 4 rows / 3 columns in por- trait mode. See the CCAAVVEEAATTSS section for details on the use of this option with other options. Pcal predefines the symbol wwhhoollee__yyeeaarr when the --ww flag is in effect, allowing directives like `iiffddeeff wwhhoollee__yyeeaarr' in the con- figuration file. --II Resets all parameters to the program defaults. --cc Causes _p_c_a_l to generate a date file suitable for use as input to the Un*x _c_a_l_e_n_d_a_r_(_1_) utility. The normal PostScript output is suppressed. --HH Causes _p_c_a_l to generate a calendar in HTML table format. The normal PostScript output is suppressed. The HTML table format does not support moon graphics, Julian date information, `day numerics' color, `empty day' `box fill' color, left or right footer strings (but see the --CC flag), alternate fonts/sizes, transformation and scaling factors, or embedded EPS images. --qq This option is only valid when used in conjunction with the --HH (generate HTML-format calendar) option. It generates a yearly- planner style of HTML calendar whereby a single column for each month is used, resulting in table that gives a quicker overview of several months. Since there is less space for text, only the first character of the weekday and the first 5 characters of text from each event for that day are printed. The day numerics for holidays are colored red but the text of the holiday event is not printed. The day numerics are grey for Saturdays and bold black for Sundays. --zz _t_i_m_e___z_o_n_e Forces _p_c_a_l to ignore the moon file and to use its internal algorithm for moon phase calculations, adjusting the phase by _t_i_m_e___z_o_n_e hours (where _t_i_m_e___z_o_n_e is expressed in hours west of UTC). For example, New York residents (USA Eastern time zone) would use '-z 5' while on Eastern Standard Time (winter) and '-z 4' while on Eastern Daylight Time (summer). People in India would use '-z-5.5'. Notice that fractional values are allowed. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --hh Causes _p_c_a_l to write version information, parameter usage mes- sage, and full explanation of options and file formats (to _s_t_d_- _o_u_t) and terminate. --uu Causes _p_c_a_l to write version information and parameter usage message (to _s_t_d_o_u_t) and terminate. --vv Causes _p_c_a_l to write version information only (to _s_t_d_o_u_t) and terminate. Pcal predefines the symbol vvXX__YY__ZZ, where XX__YY__ZZ denotes the cur- rent version of Pcal (e.g. version 4.9.0 predefines the symbol vv44__99__00). --aa _o_u_t_p_u_t___l_a_n_g_u_a_g_e Select the output language (for the names of months and days on the calendar). Currently, the following languages are supported: ccaa (Catalan), ccss (Czech), ddaa (Danish), ddee (German), eell (Greek), eenn (English), eeoo (Esperanto), eess (Spanish), eett (Estonian), ffii (Finnish), ffrr (French), hhaa (Hawaiian), hhuu (Hungarian), iitt (Italian), lltt (Lithuanian), llvv (Latvian), nnll (Dutch), ppll (Polish), pptt (Por- tuguese), rroo (Romanian), rruu (Russian), sskk (Slovak), ssvv (Swedish), and uukk (Ukrainian). The default is eenn. Note that this option does nnoott specify the `input language', which is the language used to process events in the configura- tion file ('English', by default, unless changed with the _i_n_p_u_t_- _l_a_n_g_u_a_g_e _X_X directive). See the section _T_h_e _D_a_t_e _F_i_l_e for more details on specifying the `input language'. NNoottee:: In order to display diacritical marks, languages other than English require that the characters be remapped. Normally, no action is required since _p_c_a_l automatically selects a remap- ping which is appropriate to the selected language. However, if you want to override the default remapping for a given language, you would use the --rr option (e.g. "-r Latin1"). Furthermore, an appropriate font should be selected as needed using the --tt option (e.g. "-t some-latin1-font-name"). Any lan- guage using the "Latin1" remapping (e.g. French, German, Ital- ian, Spanish, etc) requires an ISO 8859-1 ('Latin1') font. The Greek language requires an ISO 8859-7 (similar to ELOT-928) font (available from Angelo Haritsis ; also see http://www.hellenic.net/fonts/). Similarly, Russian requires a KOI8-R font while Ukrainian requires a KOI8-U font. _P_c_a_l predefines the symbol llaanngg__XXXX, where XXXX is the two-charac- ter abbreviation for the selected output language. --rr [_m_a_p_p_i_n_g] Specifies an 8-bit character set remapping (encoding) for print- ing the diacritical marks common to European languages. Note: This option is not usually needed since _p_c_a_l will automat- ically select an appropriate default character encoding (map- ping) for the language for which the calendar is being gener- ated. The value specified for _m_a_p_p_i_n_g is case-insensitive and may be abbreviated to the point where it is still unique. The value used may be any of the following: +o "none" (use built-in character set) +o "Latin1" (ISO 8859-1) +o "Latin2" (ISO 8859-2) +o "Latin3" (ISO 8859-3) +o "Latin4" (ISO 8859-4) +o "Cyrillic" (ISO 8859-5) +o "Greek" (ISO 8859-7) +o "Latin5" (ISO 8859-9) +o "Latin6" (ISO 8859-10) +o "Thai" (ISO 8859-11) +o "Latin7" (ISO 8859-13) +o "Latin8" (ISO 8859-14) +o "Latin9" (ISO 8859-15) +o "KOI8-R" (Russian) +o "KOI8-U" (Ukrainian) +o "Roman8" This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --TT [B|I|R] Select the default typeface (Bold, Italic, or Roman) for print- ing date/note text. This flag may be specified multiple times within the date file (via "opt") to reset the font style on the fly -- for example, to print all holidays in Bold. --WW [left|center|right] Specify the horizontal alignment of the month/year heading (left, center, right) (for monthly-format calendars only). Any option taking a negative value (e.g. --YY --######) should be specified with no space between the option and the (negative) value to avoid _p_c_a_l interpreting the value as an illegal flag and aborting. For example, use ` _-_Y_-_5_0' instead of ` _-_Y _-_5_0' on your option specification. Any option (except --GG and --OO, for backward-compatibility) which nor- mally takes an argument may be specified without the argument in order to reset the value to the program default. Note that while the --DD option alone clears all the defined symbols, the --UU option alone has no effect. The -- (or ---- as per System V) argument may be used to disam- biguate command lines such as: ppccaall --tt 99 9900 This could be written instead as one of the following: ppccaall --tt -- 99 9900 ppccaall --tt ---- 99 9900 If the environment variable PPCCAALL__OOPPTTSS is defined, its contents are parsed as a command line. Flags set via PPCCAALL__OOPPTTSS override the program defaults, but are overridden by options set via oopptt lines in the con- figuration file or explicitly on the command line. AAddddiittiioonnaall OOppttiioonnss FFoorr DDeebbuuggggiinngg OOnnllyy The --ZZ flag is used to print debugging information which is of interest primarily to _p_c_a_l hackers. This flag is a "hidden" flag; it does not appear as part of the usage message. At present, the following options are supported: +o -ZD print dates and text as read from date file +o -ZF print date file search paths +o -ZM print moon phases and identify quarters +o -ZO print option flags and where set +o -ZP print "preprocessor" debug info +o -ZT print dates and text as written to output file +o -Z turn off all debugging info The subflags may be combined: e.g. "-ZDF" is equivalent to "-ZD -ZF". All of the aforementioned debugging information is written to stderr. CCAAVVEEAATTSS +o The ``workday'' and ``holiday'' keywords are aware of only those hol- idays which have already been flagged at the point where they appear. For example, consider January 1990: January 1990 S M Tu W Th F S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 If the configuration file looked like this: workday on_or_before all 15 payday 3rd Mon in Jan* MLK day ... then _p_c_a_l would mark the 15th as ``payday'' since at that point in the configuration 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 _p_c_a_l 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. +o Only the positive ordinals may be used in conjunction with preposi- tions (e.g. "fourth Sunday before 12/25"). (It could be argued that "last Sunday before 12/25" should be accepted as a synonym for "first Sunday before 12/25", but then what does "last Sunday after 12/25" mean?) +o When the --ww and --pp options are used together, _p_c_a_l revises the y- scale factor in order to use the entire portrait page; therefore, the user should avoid using use the --yy option when using both the --ww and --pp options. Use of the --ww option in any case effectively disables the --mm, --MM, --jj, and --JJ options. +o The output of the --cc option may be used as input to subsequent runs of _p_c_a_l. Note, however, that oopptt lines (except for an automatic oopptt --[[AA||EE]]), comments, ``note'' text, and iiffddeeff'd-out source will be lost. +o The --SS option interacts with nnoottee{{//<>}}; if used, it should be specified either on the command line or prior to the first nnoottee line in the date file. SSEEEE AALLSSOO Website for _p_c_a_l and _l_c_a_l (a lunar calendar generation application): http://pcal.sourceforge.net cal(1), calendar(1). The old, simple Unix/BSD 'calendar' program, which can be used with _p_c_a_l and the '-c' option is part of the BSD Main Utilities ('bsdmainu- tils') package and is available at the Debian site: _h_t_t_p_:_/_/_p_a_c_k_a_g_e_s_._d_e_b_i_a_n_._o_r_g_/_s_t_a_b_l_e_/_s_o_u_r_c_e_/_b_s_d_m_a_i_n_u_t_i_l_s This old program does not seem to be included with most GNU/Linux dis- tributions these days. For more information on PostScript, consult the free, online Adobe book entitled _P_o_s_t_S_c_r_i_p_t _L_a_n_g_u_a_g_e _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, which can be found here (as of Dec 2007): _h_t_t_p_:_/_/_p_a_r_t_n_e_r_s_._a_d_o_b_e_._c_o_m_/_p_u_b_l_i_c_/_d_e_v_e_l_o_p_e_r_/_p_s_/_i_n_d_e_x___s_p_e_c_s_._h_t_m_l AAUUTTHHOORRSS The original PostScript code to generate the calendars was written by Patrick Wood (Copyright (C) 1987 by Patrick Wood of Pipeline Asso- ciates, Inc.), and authorized for modification and redistribution. The calendar file inclusion code was originally written in "bs(1)" by Bill Vogel of AT&T. Patrick's original PostScript was modified and enhanced several times by King Ables, Tim Tessin, Joe Wood, Jeff Mogul, Mark Hanson, and others whose names have regrettably been lost. This C ver- sion was originally created by Ken Keirnan of Pacific Bell; additional enhancements by Joseph P. Larson, Ed Hand, Andrew Rogers, Mark Kantrowitz, Joe Brownlee, Andy Fyfe, Steve Grandi, Geoff Kuenning, Ste- fan Fronzek (1-column HTML output), Bill Bogstad (event deletion capa- bility), and Bill Marr (embedded EPS images, command-line paper size specification, new paper sizes [legal & tabloid], additional character mappings for new languages, and various cleanups). The moon routines were originally written by Jef Poskanzer and Craig Leres, and were incorporated into _p_c_a_l by Richard Dyson. International language sup- port was initially added by Angelo Haritsis. Additional languages were added by Andrew Rogers (Esperanto), Lars Wirzenius (Finnish), Pedro Zorzenon Neto (Portuguese), Joel Fredrikson (Swedish), Volodymyr M. Lisivka (Ukrainian), Neeme Praks (Estonian, Russian, Latvian, Lithua- nian), Peter Cernoch (Czech), Ferenc Kruzslicz (Hungarian), Carles Sadurn Anguita (Catalan), Dominik 'Chiron' Derlatka (Polish), Ewald Beekman (Dutch), Claudiu Costin (Romanian), Kenneth Geisshirt (Danish), Zdenko Podobny (Slovak), and Eric Nichols (Hawaiian). Version 4.11.0 18 Dec 2007 PCAL(1) pcal-4.11.0/doc/pcal.cat0000644000175000001440000022165710732024124013066 0ustar wusersPCAL(1) USER COMMANDS PCAL(1) NNAAMMEE pcal - generate PostScript (or HTML) calendars SSYYNNOOPPSSIISS ppccaall [--ee|--ff _c_a_l] [--oo _f_i_l_e] [--ll | --pp] [--PP [letter | legal | a4 | tabloid]] [--jj | --JJ] [--mm | --MM] [--gg _w_e_e_k_d_a_y[_-_w_e_e_k_d_a_y]|all|holiday] [--OO _w_e_e_k_d_a_y[_-_w_e_e_k_d_a_y]|all|holiday] [--GG _w_e_e_k_d_a_y[_-_w_e_e_k_d_a_y]|all|holi- day] [--bb _w_e_e_k_d_a_y[_-_w_e_e_k_d_a_y]|all|holiday] [--ss [_d_a_y___n_u_m_e_r_- _i_c_s___c_o_l_o_r][/_e_m_p_t_y___d_a_y___b_o_x___f_i_l_l___c_o_l_o_r]] [--FF _d_a_y] [--AA|--EE] [--XX _x_t_r_a_n_s] [--YY _y_t_r_a_n_s] [--xx _x_s_c_a_l_e] [--yy _y_s_c_a_l_e] [--tt [_t_i_t_l_e___f_o_n_t][/_s_i_z_e]] [--dd [_d_a_y___f_o_n_t][/_s_i_z_e]] [--nn [_t_e_x_t___f_o_n_t][/_s_i_z_e]] [--LL _f_o_o_t_e_r___s_t_r] [--CC _f_o_o_t_e_r___s_t_r] [--RR _f_o_o_t_e_r___s_t_r] [--NN _n_o_t_e_s___s_t_r] [--DD _s_y_m_b_o_l] [--UU _s_y_m_b_o_l] [--BB] [--## _n] [--SS | --kk | --KK] [--ww] [--II] [--cc | --HH] [--qq] [--zz _t_i_m_e___z_o_n_e] [--hh | --uu | --vv] [--aa _o_u_t_p_u_t___l_a_n_g_u_a_g_e] [--rr [_m_a_p_p_i_n_g] [--TT [B|I|R]] [--WW [left|center|right]] [month] [year] [nmonths] DDEESSCCRRIIPPTTIIOONN _P_c_a_l generates PostScript to produce landscape or portrait calendars for any month and year. The arguments mmoonntthh, yyeeaarr, and nnmmoonntthhss, if provided, should be numeric. The mmoonntthh value should be in the range 1 - 12, and the yyeeaarr value should be specified as 1 or 2 digits (in which case it will be interpreted as that year in the current century) or as the full 4-digit year. If no numeric arguments are provided, the cal- endar for the current month and year will be generated. If one numeric argument is provided, it is interpreted as the yyeeaarr value, and calendars for the entire year will be generated. Otherwise, nnmmoonntthhss months, starting with mmoonntthh and yyeeaarr, will be generated. For whole-year calendars (i.e. when the --ww option is given), the com- mand line arguments are interpreted somewhat differently. By default, all months in the current year are printed, starting with January. If the mmoonntthh argument alone is given, it is expected to be the desired yyeeaarr to print, and prints all of the months in the given year. If both mmoonntthh and yyeeaarr are given, then 12 consecutive months are printed start- ing at the given month and year. If the mmoonntthh, yyeeaarr, and nnmmoonntthhss argu- ments are all present, printing begins with the given month and year and nnmmoonntthhss months are printed, rounded up to the nearest multiple of 12. TThhee DDaattee FFiillee ((CCoonnffiigguurraattiioonn FFiillee)) By default, _p_c_a_l simply prints an empty calendar. Its real power is in its ability to place ``events'' (and, for monthly-format PostScript calendars, Encapsulated PostScript images [e.g. photos and icons]) in appropriate days on the (PostScript or HTML) calendar, thus allowing the user to create personalized calendars. This is achieved through the use of the ``date file'', also known as the ``configuration file''. The default date/configuration file is expected to be named _._c_a_l_e_n_d_a_r (_p_c_a_l_._d_a_t under MS-DOS), or _c_a_l_e_n_d_a_r for compatibility with older ver- sions. _P_c_a_l will look in several places for such a file. First, if the environment variable PPCCAALL__DDIIRR is defined, _p_c_a_l searches the direc- tory indicated by that variable. Next, _p_c_a_l searches the user's home directory (as specified by the HHOOMMEE environment variable). If neither PPCCAALL__DDIIRR nor HHOOMMEE is defined, _p_c_a_l searches the current directory instead. Finally, if enabled (via the `SEARCH_PCAL_DIR' flag) when _p_c_a_l was built, the directory where the _p_c_a_l executable resides will be checked. If no date file is found, an empty calendar is printed; no error is generated. Alternatively, the name of the date file (and, optionally, the path where it can be found) can be specified using the --ff command-line option. See the OOPPTTIIOONNSS section for more details. Every _p_c_a_l distribution comes with an 'examples' directory. The `pcal- cfg.txt' file that is located there contains a myriad of examples of settings that can be used in your own configuration file. Please check it out for lots of useful ideas. Furthermore, that directory contains several language/country-specific examples (including holiday and other event definitions) in various `calendar_xx.txt' files, where `xx' rep- resents the 2-letter language code (e.g. 'calendar_de.txt' is the Ger- man example file). 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. Encapsulated PostScript (EPS) images are handled similarly as described in a later subsection. ttrrooffff-style escape sequences \fB, \fI, \fP, and \fR may be used to set the font style to Bold, Italic, the previous font style, or Roman respectively. For those more familiar with HTML, , , , and may be used instead to enable/disable Bold or Italic font styles. The font style is reset to Roman after each line break. Using the `include' pre-processor directive (described in the section entitled `Pre-Processor Functionality', below), other configuration files can be processed from within an existing configuration file. That is, you can `nest' configuration files as needed. Dates (essentially `events') in the configuration files may be expressed in any of several formats: ˇ in {*} {} ˇ {} {*} {} ˇ {*} {} ˇ {*} {} Where: := first 3+ characters of name of month, or ``all'' NNoottee:: _p_c_a_l looks for names of the days of the week prior to names of months when parsing event date specifications. Furthermore, some languages (e.g. French and Finnish) have a month name whose first 3 letters are the same as the first 3 let- ters of one of the names of the days of the week. Because of this, the specification in such a lan- guage of any month name which collides thusly must use 4 or more letters to distinguish it from the name of the day of the week with which it `collides'. := , or ``year'' := first 3+ characters of name of weekday, ``day'', ``weekday'', ``workday'', ``holiday'', ``nonweekday'', ``nonworkday'', ``nonholiday'', ``new_moon'', ``first_quarter'', ``full_moon'', or ``last_quarter'' := any ordinal number (``1st'', ``2nd'', etc.), ``first'' ... ``fifth'', ``last'', ``odd'', ``even'', or ``all'' := ``on'', ``before'', ``preceding'', ``after'', ``following'', ``on_or_before'' (``oob''), ``on_or_after'' (``ooa''), ``nearest'', ``near- est_before``, or ``nearest_after`` := ``Christmas'', ``Thanksgiving'', ``Easter'', ``Good_Friday'', ``GEaster'' (Orthodox Easter), ``Gstgeorge'' (Orthodox holiday), and ``Gmarcus'' (Orthodox holiday). := one or more non-numeric, non-space, non-`*' characters := a numeric month (1-12) := day of month (1-31) := a numeric year := the text to be displayed for this event; if the text begins with the constant string ``image:'', then it is interpreted as a specifi- cation of an Encapsulated PostScript (EPS) image rather than as simple text; more information on specifying EPS images is available in a later section of this document If the --AA option (American date formats, the default) is given: := | {} If the --EE option (European date formats) is given: := | | {} The ``Notes'' box (see below) uses the first of the current month as the default date. All footer strings use the first of the current month in single-month mode and the first of the starting month in whole-year mode. Examples: last Monday in May* Memorial Day Holiday all Fridays in Oct Status Meeting, 11 AM first workday in all %-B progress report due all Fri in all \fBTime card due,\fP 3 PM all Monday in all Fiscal week %0W -2nd workday in all Schedule for %+B due %+2D 2nd full_moon in all Blue Moon Fri on_or_before all 15 Pay Day even Fridays in year Pay Day 183rd day of year Mid-year (%l days left) Tue after first Mon in Nov Election Day (USA) 4th Thu in Nov* Thanksgiving Fri after 4th Thu in Nov* Day after Thanksgiving workday nearest 12/25* Holiday 12/25/04* Christmas # American 25.12.04* Christmas # European 25. 12.* Christmas # European Dec 25* Christmas # American 25 Dec* Christmas # European 25. Dec* Christmas # European Fri on all 13 Avoid black cats! # 'Friday the 13th' Any non-numeric character may separate numeric dates. Holidays may be flagged by following the date immediately with `*' as in the examples above; this will cause the date numerics to be printed in the color specified by the --ss option (default = gray) and will cause the associ- ated text (on monthly-format calendars) to be placed adjacent to the numeric date in the day box rather than below the numeric date (as is done for all non-holiday events). ``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 key- words ``on_or_before'' and ``on_or_after'', respectively. ``Nearest'' attempts to match the specified date; if that fails, it tries the day after, then the day before, then two days after, two days before, and so forth until a match occurs. Wildcard day names are also provided. The keyword ``weekday'' applies to any days which are normally printed in "logical black" - the predom- inant day color - 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 ``nonweek- day'', ``nonworkday'', and ``nonholiday'' are also recognized as nega- tions of the above. See the CCAAVVEEAATTSS below for important notes on using these keywords. Moon phases may also appear as wildcards; ``nm'' is accepted as a synonym for ``new_moon'', ``1q'' and ``fq'' for ``first_quarter'', ``fm'' for ``full_moon'', ``3q'' for ``third_quar- ter'', and ``lq'' for ``last_quarter''. 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 (e.g. 100th). Negative ordinal numbers may even be used. For example, ``-2nd'' means ``next to last''. ``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. ``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. ``Nearest'', ``nearest_before'', and ``nearest_after'' refer to the nearest weekday or wildcard day with respect to the specified date. ``Nearest_before'' and ``nearest_after'' allow the user to specify how _p_c_a_l is to disambiguate between two dates that are equally near: e.g., ``nonweekday nearest_before [Wed.] 9/25/96'' refers to Sunday, 9/22 while ``nonweekday nearest_after 9/25/96'' refers to Saturday, 9/28. (Note that ``nearest_before'' and ``nearest_after'' are equivalent to ``nearest'' when no such ambiguity exists: e.g., ``nonweekday near- est_before [Thu.] 9/26/96'' refers to Saturday, 9/28.) Text in the date file may use C-like escape sequences (i.e. a `\' fol- lowed by a character, 1 - 3 octal digits, or `x' followed by 1 - 2 hexadecimal digits). Escaped whitespace (including nneewwlliinnee ) and the standard ANSI character escapes (`\a', `\b', `\f', `\n', `\r', `\t', `\v') are all replaced by a single blank. The HTML special characters `<' `>' `"' `&' ` ' and `&#NNN;' (NNN = any three decimal digits) are also supported. These will be propagated intact (be sure to escape the `#' in `&#NNN;') if the output is specified as HTML (see the --HH flag); otherwise they will be converted to their ASCII equivalents. This allows a common date file to be used regardless of whether the desired output format is HTML, PostScript, or Un*x _c_a_l_e_n_d_a_r_(_1_) (see the --cc flag) input. Lines in the configuration file consisting of yyeeaarr ######## (where ######## 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. Lines in the configuration file consisting of yyeeaarr aallll (or, alterna- tively, yyeeaarr **) direct _p_c_a_l to wildcard following entries against every applicable year. This assumes that the following entries do not con- tain a year; any date entries containing year information (or an explicit yyeeaarr ######## entry) will set the remembered year to that year. Lines in the configuration file consisting of oopptt <> can be used to override the defaults for any command-line options except --cc, --ee, --ff, --hh, --HH, --uu, --vv, --DD, and --UU. Any options specified in this manner are, in turn, overridden by those specified explicitly on the command line. Lines in the configuration file consisting of nnoottee{{//<>}} <> can be used to place notes regarding the entire month in one of the unused blocks of the calendar. The <> 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. <> is an optional positive or nega- tive number specifying the empty box where the associated text is to be placed. If positive, _p_c_a_l counts forward from the first empty box; if negative, _p_c_a_l counts backward from the last empty box. Thus, ````nnoottee//11'''' places the associated text in the first empty box; nnoottee//--33 in the third-to-last. The default is -1 if no is given (last empty box, immediately preceding the small calendars on the bottom row; cf. --SS, --kk, and --KK, below). You can place several notes in the same box. You can also use more than 1 box for the various monthly notes. Lines in the configuration file consisting of iinnppuutt--llaanngguuaaggee XXXX (where XXXX is the 2-letter specification for any of the supported languages) can be used to set the language used for interpretation of the month names and day-of-week names for the remaining event entries. This option may be specified more than once, as needed, if the language used to describe events changes within the file. For backwards compatibil- ity, the default value for `input language' if this directive is never used is 'en' (English). Note that this directive is distinct from the specification of 'output language' as accomplished with the --aa option. Comments are supported in the configuration file. Any characters fol- lowing a `#' character are ignored, through the end of that line, unless the `#' character is escaped by `\'. DDeelleettiinngg EEvveennttss By prepending the _`_d_e_l_e_t_e_' keyword to an event specification, one or more events may be deleted from a set of previously-specified events. For example, the following lines might appear in the date file: all Friday in all Poker game delete first Friday in all Poker game This results in an event labeled `Poker game' on every Friday except the first Friday of the month. If you delete an entry which is marked as a holiday, the `holiday' flag for that day will be recalculated. Any `delete' entries which don't match any pre-existing entries are silently ignored. FFoorrmmaatt SSppeecciiffiieerrss _P_c_a_l allows format specifiers in both the event text and footer strings (see the --LL, --CC, --RR, and --NN options below). Each format specifier will be replaced by a corresponding string as outlined in the following ta- ble: %a abbreviated weekday %A full weekday %b abbreviated month name %B full month name %d day of month (1-31) %j day of year (1-366) %l days left in year (0-365) %m month (1-12) %U week number (0-53) %W week number (0-53) %u week number (1-54) %w week number (1-54) %y year w/o century (00-99) %Y year w/century %% `%' character %o print number as ordinal %0 print number with leading zeroes %+ use following month or year %- use previous month or year %{+N}[DWMY] adjust date by +N days/weeks/months/years %{-N}[DWMY] adjust date by -N days/weeks/months/years Most of these are derived from the ANSI C strftime() function, but the %%[[lloouuwwMMDD]] and %%[[oo00++--]] format specifiers are specific to _p_c_a_l. The %%uu specifier considers the week containing 1/1 (Jan 1st) as week 1 and the following logical Sunday (the first day of the week as printed; cf. the --FF option below) as the start of week 2; %%UU considers the first logical Sunday as the first day of week 1. %%ww and %%WW behave like %%uu and %%UU respectively, but use the first logical Monday instead. Note that %%ww has a different meaning from strftime(). The %%oo format specifier prints a number as an ordinal, with the appro- priate suffix (``st'', ``nd'', ``rd'', or ``th'' in English) appended. For example, %%oodd prints the day of the month as ``1st'', ``2nd'', ``3rd'', etc. Unlike strftime(), _p_c_a_l defaults to printing numbers (except %%yy) with- out leading zeroes. If leading zeroes are desired, the `0' prefix may be used. For example, %%00jj prints the first day of year as ``001''. The %%++ and %%-- format specifiers direct _p_c_a_l to substitute the follow- ing/previous month/year in the following [[bbBBmmyyYY]] specifier. For exam- ple, %%++BB prints the name of the next month. The %%{{[[++--]]NN}}[[DDWWMMYY]] format specifiers do not print anything, but instead adjust the working date by ą NNdays (DD), weeks (WW), months (MM), or years (YY). Subsequent format specifiers use the adjusted date instead of the current date. For example, %%++11MM %%BB %%YY adjusts the date forward by one month and then prints the resulting month and year (``January 1992'' in December, 1991); %%--22WW %%bb %%dd adjusts the date backward by two weeks and prints the resulting month and day (``Jul 26'' on August 9). Such date adjustments are normally cumulative; for example, %%++11YY%%--11DD adjusts the date forward by one year and then backward by one day. If %%DD or %%MM is specified alone (or if NN is zero), _p_c_a_l restores the origi- nal date. Note that %%MM has a different meaning to the strftime() func- tion. Here's a common, useful example of an event entry for the _p_c_a_l date file which combines the ability to adjust working dates and the ability to display ordinals. This particular example is used to display text on the birthday of a person born in 1991: May 10 Eric's %-1991Y%oY Birthday That entry would result in the following text being displayed on May 10, 2005: Eric's 14th Birthday EEnnccaappssuullaatteedd PPoossttSSccrriipptt ((EEPPSS)) IImmaaggeess For monthly PostScript calendars only, _p_c_a_l supports the embedding of one or more EPS images (photos, icons, etc) into any given day of the month. (EPS image specifications in the _p_c_a_l date file are ignored for yearly PostScript calendars and for all HTML calendars.) In order to associate an image with a given event, you must add one or more entries to the date file. The event date is specified exactly as described previously for simple event text specification lines. How- ever, instead of specifying the text associated with the event, you instead specify the EPS image filename and some additional parameters in the following format: image: Where: is the filename (which can include a path) of the Encapsulated PostScript image. NNoottee:: The EPS image filename must be pre- ceded by the constant text `image:' in order to distinguish an EPS image specifi- cation from an ordinary event text specifi- cation. is a scaling factor in the horizontal dimension for the EPS image. A value of 1.0 is nominal (i.e. no change to image scale). Values between 0.0 and 1.0 shrink the image in the horizontal dimension while values over 1.0 expand the image in the horizontal dimension. Generally speaking, only positive values should be used. How- ever, in the rare case that you find that your EPS image needs to be flipped about the vertical axis (i.e. left to right), you can use a negative value to achieve this without having to tweak the actual Post- Script content within the EPS image file. Use of a negative value will undoubtedly necessitate a corresponding change to the parameter to account for the image's relocated position that occurs when it gets flipped "left-to-right". is a scaling factor in the vertical dimen- sion for the EPS image. Values between 0.0 and 1.0 shrink the image in the vertical dimension while values over 1.0 expand the image in the vertical dimension. Note that a negative value for this parameter can be useful in the less-than-rare case that you find that your EPS image needs to be flipped about the horizontal axis (i.e. top to bottom). In such cases, you can use a negative value to achieve this without having to tweak the actual Post- Script content within the EPS image file. Use of a negative value will undoubtedly necessitate a corresponding change to the parameter to account for the image's relocated position that occurs when it gets flipped "upside down". := a horizontal adjustment in typographic `points' (i.e. 72nds of an inch) for the positioning of the EPS image. With offsets of 0 for X and Y, the image will be printed at the extreme left edge of the box for that day, just under the numerics for that day. Positive values move the image to the right and negative values move the image to the left. := a vertical adjustment in typographic `points' (i.e. 72nds of an inch) for the positioning of the EPS image. With offsets of 0 for X and Y, the image will be printed at the extreme left edge of the box for that day, just under the numerics for that day. Positive values move the image up and negative values move the image down. Here's an example of a line from the date file that associates an EPS image with an event: 4th Thu in Nov* Thanksgiving 4th Thu in Nov* image:/eps-path/turkey.eps 1.0 1.0 0 0 You can place as many images as you want on a single day of the month by specifying repeated lines in the date file. For example, these lines put icons of George Washington and Abraham Lincoln on the day of the U.S. ``Presidents' Day'' holiday, along with the event text: 3rd Monday in Feb* Presidents' Day 3rd Monday in Feb* image:/eps-path/washington.eps 0.08 0.08 8 0 3rd Monday in Feb* image:/eps-path/lincoln.eps 0.22 0.22 48 0 Note that the icon for Lincoln is shifted to the right by 48 typo- graphic points so as not to overlay the first icon. The _p_c_a_l releases come with a single EPS sample file ('eps/recy- cle.eps') of the ubiquitous 'recycle' icon (3 green arrows in a trian- gular shape). Such an image might be used with configuration file set- tings like this: second Sat in all RECYCLE! second Sat in all image:/eps-path/recycle.eps 0.039 0.039 34 -9 In cases where you're displaying non-holiday event text (e.g. someone's birthday) and an EPS image, you'll often need to use a negative `Y- delta' value on the EPS image specification line, in order to shift the image down so that it doesn't cover the event text, which appears just below the day's numerics for non-holiday events. (Text for holiday events appears higher up, to the right of the day's numerics, so there's usually no collision with the EPS image.) NNoottee:: Unfortunately, most EPS images cannot be used directly by _p_c_a_l. Depending on the EPS image used and how it was created, you may have to remove or comment out some or all of the PostScript `translate' commands, in order to avoid the use of illogical X- delta and Y-delta values when specifying the EPS image in your _p_c_a_l date file. Most programs that generate EPS output (either directly or via conversion from some other graphic format) seem to have these `translate' commands relatively early in the EPS file. It may take some experimentation to get it just right. Preview the _p_c_a_l output using a PostScript viewer as you tweak the Post- Script commands in the EPS image file and/or the event entry in the _p_c_a_l date file. NNoottee:: Depending upon what application you use to preview PostScript content, the monthly calendars may not show any embedded EPS images. Here's a rundown of some popu- lar PostScript-viewing applications and whether they cor- rectly display the embedded EPS images: ˇ gv (version 3.5.8) -- EPS images appear fine ˇ ggv (versions 2.4.0.1 and 2.6.1) -- EPS images appear fine ˇ older kghostview (versions 0.13.2 [KDE 3.1.4] and 0.2.0 [KDE 3.2.3 and 3.3.2]) -- EPS images DO NOT APPEAR! ˇ newer kghostview (version 0.2.0 [KDE 3.4.2 and 3.5.4]) -- EPS images appear fine For converting non-EPS images (e.g. photos) to EPS format, one can use the graphical GNU Image Manipulation Program, a.k.a. `The GIMP': _h_t_t_p_:_/_/_w_w_w_._g_i_m_p_._o_r_g For icons/images in WMF format (which are popular in various 3rd-party, legacy-OS, commercial calendar programs), the `libwmf'/`wmf2eps' library/utility is useful for generating _p_c_a_l-capable EPS images. It can be found at this site: _h_t_t_p_:_/_/_w_v_w_a_r_e_._s_o_u_r_c_e_f_o_r_g_e_._n_e_t_/_l_i_b_w_m_f_._h_t_m_l For icons/images in SVG format, the ImageMagick `convert' utility is sometimes useful for generating _p_c_a_l-capable EPS images. This suite of utilities (which includes other useful ImageMagick utilities like `dis- play' and `identify') may already be available on your Linux distribu- tion. If not, it can be found at this site: _h_t_t_p_:_/_/_w_w_w_._i_m_a_g_e_m_a_g_i_c_k_._o_r_g For cases where ImageMagick's `convert' utility fails to properly con- vert SVG-format images to EPS format, you can try the method of con- verting the SVG image into an intermediate format (e.g. PNG) using the `rsvg' utility. This utility may already be available on your Linux distribution. If not, it can be found at this site: _h_t_t_p_:_/_/_l_i_b_r_s_v_g_._s_o_u_r_c_e_f_o_r_g_e_._n_e_t_/ From the PNG format, the image can often then be successfully converted to EPS format, using the above-mentioned ImageMagick `convert' utility. The _O_p_e_n _C_l_i_p _A_r_t _L_i_b_r_a_r_y is a good source of freely-usable images (many of which are in SVG format) for decorating your events: _h_t_t_p_:_/_/_w_w_w_._o_p_e_n_c_l_i_p_a_r_t_._o_r_g NNoottee:: The EPS image content is not generated in the PostScript output -- only a reference to the EPS image filename is generated. From a practical standpoint, this means that normally you'll need to print/preview the PostScript output of _p_c_a_l from the same computer/set- up as that which was used to run _p_c_a_l in the first place. If you want to generate a calendar with embedded EPS images that will later be printed/viewed on another machine which does not have access to those EPS images, you'll need to run the output through a pre-processor which will put the EPS image content into the PostScript output file. For example, assuming your initial calendar output was generated to a file named `pcal.ps', on most GNU/Linux systems you could run this command, which uses the popular `Ghostscript' interpreter: gs -r300x300 -dBATCH -dNOPAUSE -sDEVICE=pswrite -sOutput- File=out.ps pcal.ps This would generate a PostScript file named `out.ps', at 300x300 dpi resolution, which has the actual EPS image content embedded within, allowing you to transport the `out.ps' file to another computer for viewing/printing. Of course, the new file is substantially larger, but it's portable. Furthermore, the EPS images will be viewable even in PostScript-viewing applications (see above) which don't properly sup- port the display of embedded (by filename only) EPS images. PPrree--PPrroocceessssoorr FFuunnccttiioonnaalliittyy _P_c_a_l supports rudimentary _c_p_p-like functionality in the date file, allowing the following constructs: ˇ ddeeffiinnee || uunnddeeff ˇ iiff{{{{nn}}ddeeff}} ...... {{eelliiff ......}}** {{eellssee ......}} eennddiiff ˇ iinncclluuddee Note that these are not preceded by `#' as they are in C. Symbol names defined using these keywords (or via the --DD option) are case-insensitive. It is not an error to uunnddeeff an undefined symbol, nor to ddeeffiinnee a previously-defined one. A symbol can be defined with just a name (e.g. ``define MY_SYM'') or it can take on a value (e.g. ``define MY_SYM SOME_VALUE''). Use of symbol values is convenient for defining a starting date then using that sym- bol to reference that starting date in one or more events. For exam- ple, these definitions in the date file might be useful: define semester_start 8/23 # Beginning of semester semester_start Class Start 7th day after semester_start 1st Quiz 14th day after semester_start 2nd Quiz undef semester_start Be aware that the substitution of symbol values for symbol names is not robust, so it's wise to use a symbol name that's unlikely to occur in any of your other event text. In other words, if you defined the `se- mester_start' symbol in the example above as merely `start', then you'd get the undesired effect of having the text `Class 8/23' in your calen- dar on that day instead of `Class Start'! The use of `undef semes- ter_start' in the above example is optional and is really only useful to prevent any unwanted symbol substitutions later on, which probably won't happen unless you poorly choose your symbol name to begin with. An iiffddeeff alone is always ffaallssee; an iiffnnddeeff alone is always ttrruuee. iiff is accepted as a synonym for iiffddeeff. The name of the file in the iinncclluuddee directive may optionally be sur- rounded 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. If the string "%y" appears in the file name, it is replaced by the last two digits of the current year or, if "year all" is in effect, is expanded to all appli- cable years. _P_c_a_l is smart enough to translate ~~// to the user's home directory. _P_c_a_l normally terminates immediately if the file specified in an iinncclluuddee directive does not exist. An alternate form of the directive, iinncclluuddee??, directs _p_c_a_l to continue silently if the file does not exist or cannot be opened. In addition to pre-processing keywords, _p_c_a_l also accepts boolean expressions in iiff{{{{nn}}ddeeff}} and eelliiff directives. These expressions con- sist of symbol names joined by the boolean operators !!, &&, ^^, and ||, in order of precedence, high to low. Parentheses may be used to alter the precedence. The synonyms &&&& and |||| are accepted for && and ||. A symbol name evaluates to ttrruuee if currently defined, ffaallssee if not; thus: ifdef A | B | C ...is ttrruuee if any of the symbols A, B, and C is defined, and: ifdef A & B & C ...is ttrruuee if they all are. Note that iiffnnddeeff <> is equivalent to iiffddeeff !!(( <> )).. TThhee MMoooonn FFiillee If a file of the name _._m_o_o_n_#_# (_m_o_o_n_#_#_._d_a_t under MS-DOS), where #### is the last two digits of the calendar year, exists in the same directory as the date file (or in the directory where _p_c_a_l resides), _p_c_a_l uses the information contained within to calculate the phase of the moon. If a) no such file exists, b) the --ee flag (do not use a date file) is specified, or c) the --zz flag (specify time zone) is specified, then _p_c_a_l uses an algorithm to calculate the phase of the moon. Entries in the moon file must conform to the following syntax: If the --AA option (American date formats, the default) is given: {} If the --EE option (European date formats) is given: {} Where: := ``nm'', ``fq'' or ``1q'', ``fm'', ``3q'' or ``lq'' (new moon, first quarter, full moon, last quarter) := number 0-23 (24-hour clock) := number 0-59 This file must contain entries for all quarter moons in the year, in chronological order; if any errors are encountered, _p_c_a_l will revert to using its default algorithm. As in the date file, comments start with `#' and run through the end of the given line. The moon file may optionally contain an oopptt --AA or oopptt --EE line to spec- ify the format of its own date entries independently of the format used in the date file. No other flags are legal in the moon file. GGeenneerraattiinngg PPoossttSSccrriipptt CCaalleennddaarrss VViiaa AA WWeebb BBrroowwsseerr IInntteerrffaaccee PostScript-format _p_c_a_l calendars can be generated and viewed from a web browser interface. NNoottee:: This is not to be confused with the ability to generate non-PostScript, HTML-format (using the --HH command-line option) calendars, which is a different capability entirely. _P_c_a_l comes with 4 files that provide this ability: `pcal.cgi' (a Bourne shell script), `pcal.pl' (a Perl equivalent of `pcal.cgi'), `pcal.html', and `pcalw.html'. The CGI file (either `pcal.cgi' or `pcal.pl') must be edited before using it. Change the definition for _`_p_c_a_l_=_' (Bourne shell script) or _`_m_y _$_P_C_A_L _=_' (Perl script) to point to the location of the _p_c_a_l exe- cutable file. Change the definition for _`_f_i_l_e_=_' (Bourne shell script) or _`_m_y _$_F_I_L_E _=_' (Perl script) to point to the location of the _p_c_a_l `date file' (e.g. `.calendar'), which contains the options for running _p_c_a_l. Finally, copy the `pcal.cgi' (or `pcal.pl') file to the location where your web server expects to find such files (e.g. `/var/www/cgi- bin/'). The `pcal.html' and `pcalw.html' files must also be edited. Each one has a line like this: That line must be edited to point to the host and location of your CGI script file (`pcal.cgi' or `pcal.pl'). Once that's done, point your web browser to the `pcal.html' or `pcalw.html' file to generate monthly/yearly PostScript calendars for viewing within your web browser. NNoottee:: Depending upon what application your web browser spawns to preview PostScript content, the monthly calendars generated via this web browser interface may not show any embedded EPS images. For a rundown of some popular PostScript-viewing applications and whether they correctly display the embedded EPS images, see the section (above) entitled `Encapsulated PostScript (EPS) Images'. OOPPTTIIOONNSS --ee Prints an empty calendar. Do not print entries from a _._c_a_l_e_n_d_a_r file even if one exists. --ff _c_a_l Directs _p_c_a_l to use the file name _c_a_l as the input file in place of the default _._c_a_l_e_n_d_a_r file. Note that the search rules are different when --ff is used. If _c_a_l is an absolute file name (i.e. starting with a `/'), then _p_c_a_l attempts to open only that file. Otherwise, _p_c_a_l looks for _c_a_l in the current directory, then in the directory indicated by the environment variable PPCCAALL__DDIIRR (if defined), and finally, if enabled (via the `SEARCH_PCAL_DIR' flag) when _p_c_a_l was built, in the directory where the _p_c_a_l executable resides. If the given _c_a_l file is not found, an error results. --oo _f_i_l_e Directs _p_c_a_l to write the output to _f_i_l_e instead of to stdout. --ll Causes the output to be in landscape mode (default). _P_c_a_l predefines the symbol `ORIENTATION_LANDSCAPE' whenever `landscape' page orientation is enabled. This can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on the page orientation. --pp Causes the output to be in portrait mode. _P_c_a_l predefines the symbol `ORIENTATION_PORTRAIT' whenever `por- trait' page orientation is enabled. This can be useful for pro- viding alternate values in the configuration file for EPS image placement and scaling, based on the page orientation. --PP Selects the paper size. The following sizes are supported: ˇ letter -- 8.5 x 11.0 inches ˇ legal -- 8.5 x 14.0 inches ˇ a4 -- 210 x 297 mm ˇ tabloid -- 11.0 x 17.0 inches _P_c_a_l predefines one of the following symbols based on the cur- rent paper size: ˇ PAPERSIZE_LETTER ˇ PAPERSIZE_LEGAL ˇ PAPERSIZE_A4 ˇ PAPERSIZE_TABLOID These symbol definitions can be useful for providing alternate values in the configuration file for EPS image placement and scaling, based on paper size. --jj Causes the Julian date (day of year) to be printed in each cal- endar box. --JJ Causes the Julian date and the number of days remaining in the year to be printed in each calendar box. --mm Causes moon icons to be printed on dates corresponding to new, half, and full moons (the default is that no moons are printed). --MM Causes moon icons to be printed on all dates (the default is that no moons are printed). --gg _d_a_y_1[_-_d_a_y_2] || aallll || hhoolliiddaayy Causes all dates falling on weekday _d_a_y_1 (through _d_a_y_2 if speci- fied) to be printed in the `day numerics color' (i.e. the color specified by the --ss option [default = gray]); --gg aallll causes all weekdays (other than holidays) to be printed in the `day numer- ics color'; --gg hhoolliiddaayy causes all holidays to be printed in `day numerics color'. _d_a_y_1 and _d_a_y_2 may wrap around weekends; for example, --gg ffrrii--ssuunn causes Fridays, Saturdays, and Sundays to be printed in the `day numerics color'. --OO _d_a_y_1[_-_d_a_y_2] || aallll || hhoolliiddaayy Similar to --gg, but the selected days will be printed as outlined characters, using the `day numerics color'. --GG _d_a_y_1[_-_d_a_y_2] || aallll || hhoolliiddaayy Similar to --gg, but the selected days will be printed in the `day numerics color', outlined in black. --bb _d_a_y_1[_-_d_a_y_2] || aallll || hhoolliiddaayy Similar to -- you guessed it -- --gg, but the selected days will be printed in black. Since black is the default for weekdays, -b is primarily used to overriding other flags (e.g., --gg aallll --bb ssaatt--ssuunn ). NNoottee:: The default for the above options is to print Saturdays, Sun- days, and holidays in the `day numerics color' and all other days in black. For backward compatibility with earlier versions of _p_c_a_l, --OO and --GG alone change all non-black days to the speci- fied color. --ss _[_d_a_y___n_u_m_e_r_i_c_s___c_o_l_o_r_]_[_/_e_m_p_t_y___d_a_y___b_o_x___f_i_l_l___c_o_l_o_r_] Overrides the default value(s) for the color of the numerics for each day and/or the color of the fill used on boxes for 'empty' days. NNoottee:: This option only applies to PostScript-format cal- endars, not to HTML-format calendars. These values may be set independently of each other. For use with non-color printers, these values should be in the range 0.0 (black) through 1.0 (white). The default values are 0.8 for day numerics and 0.9 for empty day boxes. For use with color printers, these values may optionally be specified as a set of _r_e_d:_g_r_e_e_n:_b_l_u_e (RGB) values, each of which must in the range 0.0 through 1.0. At least one `:' must be present for these values to be recognized as RGB colors; omitted values are set to 0.0. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --FF _d_a_y Selects weekday _d_a_y as the first day of the week. The given day will appear in the left-most column of the calendar. _d_a_y may be specified either as a weekday name or, optionally, as a number in the range 0 (Sunday) through 6 (Saturday). This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --AA Directs _p_c_a_l to use American date conventions ( mmmm//dddd{{//yyyy}} and mmoonntthh dddd ) when parsing the date file. This is the default. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --EE Directs _p_c_a_l to use European date conventions ( dddd//mmmm{{//yyyy}} and dddd mmoonntthh ) when parsing the date file. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --XX _x_t_r_a_n_s Specifies the x-axis translation value for positioning the out- put on the page. Positive values shift the output to the right. Negative values shift the output to the left. --YY _y_t_r_a_n_s Specifies the y-axis translation value for positioning the out- put on the page. Positive values shift the output up. Negative values shift the output down. --xx _x_s_c_a_l_e Specifies the x-axis scaling factor for the calendar size. --yy _y_s_c_a_l_e Specifies the y-axis scaling factor for the calendar size. --tt [_t_i_t_l_e___f_o_n_t][//_s_i_z_e] Specifies the name of a font to use for all the calendar heading text: ˇ the month name and year at the top of the calendar (for monthly-format calendars) or at the top of each month (for yearly-format calendars and for the small previ- ous/next-month calendars [if enabled] on monthly-format calendars) ˇ the day-of-week names ˇ the footer strings (if any) ˇ the ``Notes'' box heading (if any; for monthly calen- dars only) For monthly calendars only, the user may optionally specify the font size, which applies only to the main month/year heading. For example, ppccaall --tt TTiimmeess--RRoommaann//5544 sets the font to Times-Roman and the month/year point size to 54. The font size may also be changed independently: ppccaall --tt //5544 changes the point size to 54 without affecting the font name. Note: For yearly calendars, any specification of font _s_i_z_e is ignored. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --dd [_d_a_t_e___f_o_n_t][//_s_i_z_e] Similar to the --tt option, but selects the font and/or size used for the day numerics (the numbers inside the box for each day). Note: For yearly calendars, any specification of font _s_i_z_e is ignored. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --nn [_t_e_x_t___f_o_n_t][//_s_i_z_e] Similar to the --tt and --dd options, but selects the font and/or size used for any `event' text associated with each day and for any text in the monthly ``Notes'' box. Note: This option applies to monthly calendars only. For yearly calendars, this option does not apply. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --LL _s_t_r_i_n_g 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. --CC _s_t_r_i_n_g Similar to --LL, but causes the accompanying string to be printed as a centered footer. If the --HH flag (generate calendar as HTML table) was specified, this string will be used as the title and heading. --RR _s_t_r_i_n_g Similar to --LL, but causes the accompanying string to be printed as a right-justified footer. --NN _s_t_r_i_n_g Causes the accompanying string to be printed as the heading for the "Notes" box. Note, however, that _p_c_a_l makes no attempt to ensure that it fits. --DD _s_y_m_b_o_l _[_v_a_l_u_e_] Defines the named symbol and an optional value to be associated with that symbol, prior to reading the date file. --UU _s_y_m_b_o_l Un-defines the named symbol prior to reading the date file. --BB Causes _p_c_a_l to leave unused calendar day boxes blank as opposed to the default behavior of filling them using the `empty day-box fill color' (i.e. the color specified by the --ss option [default = gray]). --## _n Causes _p_c_a_l to print _n copies (maximum: 100) of each output page. --SS Causes _p_c_a_l to suppress printing the small calendars. See the CCAAVVEEAATTSS section for further details. --kk Causes _p_c_a_l to print the small calendars in the upper left cor- ner (the default is to print them at the lower right). --KK Causes _p_c_a_l to print the small calendar for the previous month in the upper left corner and the next month in the lower right (the default is to print both at the lower right). --ww Causes _p_c_a_l to print a calendar for 12 consecutive months: 3 rows / 4 columns in landscape mode, 4 rows / 3 columns in por- trait mode. See the CCAAVVEEAATTSS section for details on the use of this option with other options. Pcal predefines the symbol wwhhoollee__yyeeaarr when the --ww flag is in effect, allowing directives like `iiffddeeff wwhhoollee__yyeeaarr' in the con- figuration file. --II Resets all parameters to the program defaults. --cc Causes _p_c_a_l to generate a date file suitable for use as input to the Un*x _c_a_l_e_n_d_a_r_(_1_) utility. The normal PostScript output is suppressed. --HH Causes _p_c_a_l to generate a calendar in HTML table format. The normal PostScript output is suppressed. The HTML table format does not support moon graphics, Julian date information, `day numerics' color, `empty day' `box fill' color, left or right footer strings (but see the --CC flag), alternate fonts/sizes, transformation and scaling factors, or embedded EPS images. --qq This option is only valid when used in conjunction with the --HH (generate HTML-format calendar) option. It generates a yearly- planner style of HTML calendar whereby a single column for each month is used, resulting in table that gives a quicker overview of several months. Since there is less space for text, only the first character of the weekday and the first 5 characters of text from each event for that day are printed. The day numerics for holidays are colored red but the text of the holiday event is not printed. The day numerics are grey for Saturdays and bold black for Sundays. --zz _t_i_m_e___z_o_n_e Forces _p_c_a_l to ignore the moon file and to use its internal algorithm for moon phase calculations, adjusting the phase by _t_i_m_e___z_o_n_e hours (where _t_i_m_e___z_o_n_e is expressed in hours west of UTC). For example, New York residents (USA Eastern time zone) would use '-z 5' while on Eastern Standard Time (winter) and '-z 4' while on Eastern Daylight Time (summer). People in India would use '-z-5.5'. Notice that fractional values are allowed. This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --hh Causes _p_c_a_l to write version information, parameter usage mes- sage, and full explanation of options and file formats (to _s_t_d_- _o_u_t) and terminate. --uu Causes _p_c_a_l to write version information and parameter usage message (to _s_t_d_o_u_t) and terminate. --vv Causes _p_c_a_l to write version information only (to _s_t_d_o_u_t) and terminate. Pcal predefines the symbol vvXX__YY__ZZ, where XX__YY__ZZ denotes the cur- rent version of Pcal (e.g. version 4.9.0 predefines the symbol vv44__99__00). --aa _o_u_t_p_u_t___l_a_n_g_u_a_g_e Select the output language (for the names of months and days on the calendar). Currently, the following languages are supported: ccaa (Catalan), ccss (Czech), ddaa (Danish), ddee (German), eell (Greek), eenn (English), eeoo (Esperanto), eess (Spanish), eett (Estonian), ffii (Finnish), ffrr (French), hhaa (Hawaiian), hhuu (Hungarian), iitt (Italian), lltt (Lithuanian), llvv (Latvian), nnll (Dutch), ppll (Polish), pptt (Por- tuguese), rroo (Romanian), rruu (Russian), sskk (Slovak), ssvv (Swedish), and uukk (Ukrainian). The default is eenn. Note that this option does nnoott specify the `input language', which is the language used to process events in the configura- tion file ('English', by default, unless changed with the _i_n_p_u_t_- _l_a_n_g_u_a_g_e _X_X directive). See the section _T_h_e _D_a_t_e _F_i_l_e for more details on specifying the `input language'. NNoottee:: In order to display diacritical marks, languages other than English require that the characters be remapped. Normally, no action is required since _p_c_a_l automatically selects a remap- ping which is appropriate to the selected language. However, if you want to override the default remapping for a given language, you would use the --rr option (e.g. "-r Latin1"). Furthermore, an appropriate font should be selected as needed using the --tt option (e.g. "-t some-latin1-font-name"). Any lan- guage using the "Latin1" remapping (e.g. French, German, Ital- ian, Spanish, etc) requires an ISO 8859-1 ('Latin1') font. The Greek language requires an ISO 8859-7 (similar to ELOT-928) font (available from Angelo Haritsis ; also see http://www.hellenic.net/fonts/). Similarly, Russian requires a KOI8-R font while Ukrainian requires a KOI8-U font. _P_c_a_l predefines the symbol llaanngg__XXXX, where XXXX is the two-charac- ter abbreviation for the selected output language. --rr [_m_a_p_p_i_n_g] Specifies an 8-bit character set remapping (encoding) for print- ing the diacritical marks common to European languages. Note: This option is not usually needed since _p_c_a_l will automat- ically select an appropriate default character encoding (map- ping) for the language for which the calendar is being gener- ated. The value specified for _m_a_p_p_i_n_g is case-insensitive and may be abbreviated to the point where it is still unique. The value used may be any of the following: ˇ "none" (use built-in character set) ˇ "Latin1" (ISO 8859-1) ˇ "Latin2" (ISO 8859-2) ˇ "Latin3" (ISO 8859-3) ˇ "Latin4" (ISO 8859-4) ˇ "Cyrillic" (ISO 8859-5) ˇ "Greek" (ISO 8859-7) ˇ "Latin5" (ISO 8859-9) ˇ "Latin6" (ISO 8859-10) ˇ "Thai" (ISO 8859-11) ˇ "Latin7" (ISO 8859-13) ˇ "Latin8" (ISO 8859-14) ˇ "Latin9" (ISO 8859-15) ˇ "KOI8-R" (Russian) ˇ "KOI8-U" (Ukrainian) ˇ "Roman8" This option may also be set semi-permanently by altering the makefile (`Makefile' for most environments, 'Makefile.DOS' for MS-DOS). --TT [B|I|R] Select the default typeface (Bold, Italic, or Roman) for print- ing date/note text. This flag may be specified multiple times within the date file (via "opt") to reset the font style on the fly -- for example, to print all holidays in Bold. --WW [left|center|right] Specify the horizontal alignment of the month/year heading (left, center, right) (for monthly-format calendars only). Any option taking a negative value (e.g. --YY --######) should be specified with no space between the option and the (negative) value to avoid _p_c_a_l interpreting the value as an illegal flag and aborting. For example, use ` _-_Y_-_5_0' instead of ` _-_Y _-_5_0' on your option specification. Any option (except --GG and --OO, for backward-compatibility) which nor- mally takes an argument may be specified without the argument in order to reset the value to the program default. Note that while the --DD option alone clears all the defined symbols, the --UU option alone has no effect. The -- (or ---- as per System V) argument may be used to disam- biguate command lines such as: ppccaall --tt 99 9900 This could be written instead as one of the following: ppccaall --tt -- 99 9900 ppccaall --tt ---- 99 9900 If the environment variable PPCCAALL__OOPPTTSS is defined, its contents are parsed as a command line. Flags set via PPCCAALL__OOPPTTSS override the program defaults, but are overridden by options set via oopptt lines in the con- figuration file or explicitly on the command line. AAddddiittiioonnaall OOppttiioonnss FFoorr DDeebbuuggggiinngg OOnnllyy The --ZZ flag is used to print debugging information which is of interest primarily to _p_c_a_l hackers. This flag is a "hidden" flag; it does not appear as part of the usage message. At present, the following options are supported: ˇ -ZD print dates and text as read from date file ˇ -ZF print date file search paths ˇ -ZM print moon phases and identify quarters ˇ -ZO print option flags and where set ˇ -ZP print "preprocessor" debug info ˇ -ZT print dates and text as written to output file ˇ -Z turn off all debugging info The subflags may be combined: e.g. "-ZDF" is equivalent to "-ZD -ZF". All of the aforementioned debugging information is written to stderr. CCAAVVEEAATTSS ˇ The ``workday'' and ``holiday'' keywords are aware of only those hol- idays which have already been flagged at the point where they appear. For example, consider January 1990: January 1990 S M Tu W Th F S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 If the configuration file looked like this: workday on_or_before all 15 payday 3rd Mon in Jan* MLK day ... then _p_c_a_l would mark the 15th as ``payday'' since at that point in the configuration 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 _p_c_a_l 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. ˇ Only the positive ordinals may be used in conjunction with preposi- tions (e.g. "fourth Sunday before 12/25"). (It could be argued that "last Sunday before 12/25" should be accepted as a synonym for "first Sunday before 12/25", but then what does "last Sunday after 12/25" mean?) ˇ When the --ww and --pp options are used together, _p_c_a_l revises the y- scale factor in order to use the entire portrait page; therefore, the user should avoid using use the --yy option when using both the --ww and --pp options. Use of the --ww option in any case effectively disables the --mm, --MM, --jj, and --JJ options. ˇ The output of the --cc option may be used as input to subsequent runs of _p_c_a_l. Note, however, that oopptt lines (except for an automatic oopptt --[[AA||EE]]), comments, ``note'' text, and iiffddeeff'd-out source will be lost. ˇ The --SS option interacts with nnoottee{{//<>}}; if used, it should be specified either on the command line or prior to the first nnoottee line in the date file. SSEEEE AALLSSOO Website for _p_c_a_l and _l_c_a_l (a lunar calendar generation application): http://pcal.sourceforge.net cal(1), calendar(1). The old, simple Unix/BSD 'calendar' program, which can be used with _p_c_a_l and the '-c' option is part of the BSD Main Utilities ('bsdmainu- tils') package and is available at the Debian site: _h_t_t_p_:_/_/_p_a_c_k_a_g_e_s_._d_e_b_i_a_n_._o_r_g_/_s_t_a_b_l_e_/_s_o_u_r_c_e_/_b_s_d_m_a_i_n_u_t_i_l_s This old program does not seem to be included with most GNU/Linux dis- tributions these days. For more information on PostScript, consult the free, online Adobe book entitled _P_o_s_t_S_c_r_i_p_t _L_a_n_g_u_a_g_e _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, which can be found here (as of Dec 2007): _h_t_t_p_:_/_/_p_a_r_t_n_e_r_s_._a_d_o_b_e_._c_o_m_/_p_u_b_l_i_c_/_d_e_v_e_l_o_p_e_r_/_p_s_/_i_n_d_e_x___s_p_e_c_s_._h_t_m_l AAUUTTHHOORRSS The original PostScript code to generate the calendars was written by Patrick Wood (Copyright Š 1987 by Patrick Wood of Pipeline Associates, Inc.), and authorized for modification and redistribution. The calen- dar file inclusion code was originally written in "bs(1)" by Bill Vogel of AT&T. Patrick's original PostScript was modified and enhanced sev- eral times by King Ables, Tim Tessin, Joe Wood, Jeff Mogul, Mark Han- son, and others whose names have regrettably been lost. This C version was originally created by Ken Keirnan of Pacific Bell; additional enhancements by Joseph P. Larson, Ed Hand, Andrew Rogers, Mark Kantrowitz, Joe Brownlee, Andy Fyfe, Steve Grandi, Geoff Kuenning, Ste- fan Fronzek (1-column HTML output), Bill Bogstad (event deletion capa- bility), and Bill Marr (embedded EPS images, command-line paper size specification, new paper sizes [legal & tabloid], additional character mappings for new languages, and various cleanups). The moon routines were originally written by Jef Poskanzer and Craig Leres, and were incorporated into _p_c_a_l by Richard Dyson. International language sup- port was initially added by Angelo Haritsis. Additional languages were added by Andrew Rogers (Esperanto), Lars Wirzenius (Finnish), Pedro Zorzenon Neto (Portuguese), Joel Fredrikson (Swedish), Volodymyr M. Lisivka (Ukrainian), Neeme Praks (Estonian, Russian, Latvian, Lithua- nian), Peter Cernoch (Czech), Ferenc Kruzslicz (Hungarian), Carles Sadurní Anguita (Catalan), Dominik 'Chiron' Derlatka (Polish), Ewald Beekman (Dutch), Claudiu Costin (Romanian), Kenneth Geisshirt (Danish), Zdenko Podobny (Slovak), and Eric Nichols (Hawaiian). Version 4.11.0 18 Dec 2007 PCAL(1) pcal-4.11.0/eps/0000755000175000001440000000000010732023355011470 5ustar wuserspcal-4.11.0/eps/recycle.eps0000644000175000001440000001651110732017670013636 0ustar wusers%!PS-Adobe-2.0 EPSF-2.0 %%BoundingBox: 0 0 1020 1020 save gsave %%% DISABLED: 0 1020 translate 1 -1 scale %%% DISABLED: -0.474218 -0.548977 translate 1.000017 1.000383 scale gsave % begin clip gsave % wmf_[eps_]draw_polygon 684.371643 7.682744 694.601379 13.170418 704.831177 21.950697 709.946045 29.633440 782.577393 140.484451 858.277710 115.241158 754.957031 332.553040 475.684326 286.456604 553.430542 238.165054 539.108887 210.726685 522.741272 184.385849 508.419586 162.435150 496.143860 144.874603 361.110901 366.576630 141.170822 245.847809 292.571442 13.170418 297.686310 8.780278 300.755249 6.585209 304.847168 4.390139 310.985016 2.195070 316.099915 1.097535 654.705322 1.097535 664.935059 2.195070 675.164856 4.390139 684.371643 7.682744 newpath moveto 2 1 25 { pop lineto } for closepath 1.000000 1.000000 1.000000 setrgbcolor fill grestore gsave % wmf_[eps_]draw_polygon 0.932068 1 scale 734.250793 7.682744 724.372986 4.390139 713.397644 2.195070 702.422302 1.097535 339.138275 1.097535 333.650604 2.195070 327.065399 4.390139 322.675232 6.585209 319.382629 8.780278 313.894989 13.170418 151.459793 245.847809 387.429810 366.576630 532.304382 144.874603 545.474792 162.435150 560.840332 184.385849 578.400879 210.726685 593.766296 238.165054 510.353699 286.456604 809.980713 332.553040 920.831726 115.241158 839.614136 140.484451 761.689148 29.633440 756.201538 21.950697 745.226135 13.170418 734.250793 7.682744 newpath moveto 2 1 25 { pop lineto } for closepath 1.097535 setlinewidth 0.000000 0.000000 0.000000 setrgbcolor 1 setlinecap 1 setlinejoin [] 0 setdash stroke grestore gsave % wmf_[eps_]draw_polygon 654.705322 13.170418 664.935059 15.365488 674.141846 16.463022 682.325684 20.853163 690.509460 25.243301 704.831177 40.608788 777.462524 154.752411 838.841187 132.801712 746.773254 316.090027 507.396606 278.773834 567.752258 246.945343 551.384644 210.726685 530.925049 177.800644 508.419586 144.874603 476.707306 107.558411 437.834167 69.144691 408.167847 38.413719 378.501495 13.170418 654.705322 13.170418 newpath moveto 2 1 19 { pop lineto } for closepath 0.000000 0.501961 0.000000 setrgbcolor fill grestore gsave % wmf_[eps_]draw_polygon 366.225769 13.170418 376.455536 23.048231 404.075928 46.096462 432.719269 73.534836 467.500488 109.753487 487.960052 134.996780 355.996002 352.308685 160.607391 243.652740 295.640350 28.535906 302.801208 21.950697 309.962036 16.463022 318.145844 13.170418 366.225769 13.170418 newpath moveto 2 1 13 { pop lineto } for closepath 0.000000 0.501961 0.000000 setrgbcolor fill grestore gsave % wmf_[eps_]draw_polygon 7.160839 578.400879 7.160839 565.230469 8.183816 552.059998 12.275724 543.279724 60.355644 418.160767 1.022977 362.186493 227.100906 341.333344 338.605408 619.009644 259.836151 574.010742 245.514481 601.449097 232.215790 629.984985 223.008987 655.228271 215.848145 674.983948 466.477509 680.471619 486.937073 942.782410 218.917084 928.514465 213.802200 926.319397 208.687317 925.221863 205.618378 923.026794 200.503494 918.636658 196.411591 914.246521 17.390610 606.936768 12.275724 597.058960 9.206793 587.181152 7.160839 578.400879 newpath moveto 2 1 25 { pop lineto } for closepath 1.000000 1.000000 1.000000 setrgbcolor fill grestore gsave % wmf_[eps_]draw_polygon 0.932068 1 scale 7.682744 578.400879 9.877813 587.181152 13.170418 597.058960 18.658092 606.936768 210.726685 914.246521 215.116821 918.636658 220.604492 923.026794 223.897110 925.221863 229.384781 926.319397 234.872452 928.514465 522.426575 942.782410 500.475861 680.471619 231.579849 674.983948 239.262589 655.228271 249.140411 629.984985 263.408356 601.449097 278.773834 574.010742 363.284058 619.009644 243.652740 341.333344 1.097535 362.186493 64.754555 418.160767 13.170418 543.279724 8.780278 552.059998 7.682744 565.230469 7.682744 578.400879 newpath moveto 2 1 25 { pop lineto } for closepath 1.097535 setlinewidth 0.000000 0.000000 0.000000 setrgbcolor 1 setlinecap 1 setlinejoin [] 0 setdash stroke grestore gsave % wmf_[eps_]draw_polygon 26.597403 600.351562 22.505495 590.473755 19.436563 581.693481 18.413586 572.913208 18.413586 563.035339 19.436563 552.059998 22.505495 541.084656 73.654343 415.965698 24.551449 370.966766 218.917084 357.796356 316.099915 593.766357 258.813202 556.450134 239.376617 589.376221 223.008987 626.692383 209.710297 662.911011 198.457550 705.714905 185.158844 764.981750 175.952042 811.078247 172.883118 849.491943 26.597403 600.351562 newpath moveto 2 1 20 { pop lineto } for closepath 0.000000 0.501961 0.000000 setrgbcolor fill grestore gsave % wmf_[eps_]draw_polygon 180.043961 862.662354 182.089905 847.296875 187.204788 811.078247 193.342651 769.371948 204.595398 718.885315 211.756241 688.154358 455.224762 691.446960 471.592407 926.319397 229.146851 917.539124 219.940063 915.344055 212.779221 912.051453 205.618378 906.563782 180.043961 862.662354 newpath moveto 2 1 13 { pop lineto } for closepath 0.000000 0.501961 0.000000 setrgbcolor fill grestore gsave % wmf_[eps_]draw_polygon 867.484497 319.382629 1010.701294 534.499451 1015.816162 547.669861 1018.885132 558.645203 1019.908081 575.108276 1018.885132 589.376221 1015.816162 601.449097 1010.701294 616.814575 910.449524 825.346191 906.357666 836.321533 897.150879 846.199341 885.898132 860.467285 871.576416 876.930359 860.323669 887.905701 843.956055 898.881042 826.565430 907.661316 798.945068 915.344055 701.762268 920.831726 695.624390 1019.609863 549.338684 785.834961 685.394592 567.425537 690.509460 659.618408 822.473511 655.228271 664.935059 423.648438 867.484497 319.382629 newpath moveto 2 1 25 { pop lineto } for closepath 1.000000 1.000000 1.000000 setrgbcolor fill grestore gsave % wmf_[eps_]draw_polygon 0.932068 1 scale 930.709534 319.382629 713.397644 423.648438 882.417969 655.228271 740.835999 659.618408 735.348328 567.425537 589.376221 785.834961 746.323730 1019.609863 752.908936 920.831726 857.174744 915.344055 886.808167 907.661316 905.466248 898.881042 923.026794 887.905701 935.099670 876.930359 950.465210 860.467285 962.538086 846.199341 972.415894 836.321533 976.805969 825.346191 1084.364380 616.814575 1089.852051 601.449097 1093.144653 589.376221 1094.242188 575.108276 1093.144653 558.645203 1089.852051 547.669861 1084.364380 534.499451 930.709534 319.382629 newpath moveto 2 1 25 { pop lineto } for closepath 1.097535 setlinewidth 0.000000 0.000000 0.000000 setrgbcolor 1 setlinecap 1 setlinejoin [] 0 setdash stroke grestore gsave % wmf_[eps_]draw_polygon 864.415588 334.748138 1001.494507 538.889587 1005.586426 548.767395 1008.655334 563.035339 1008.655334 574.010742 1007.632385 590.473755 1003.540466 601.449097 903.288696 815.468384 888.967041 772.664551 867.484497 717.787781 841.910095 666.203674 806.105896 604.741699 757.002991 531.206848 724.267761 487.305481 700.739258 452.184357 683.348633 429.136108 864.415588 334.748138 newpath moveto 2 1 17 { pop lineto } for closepath 0.000000 0.501961 0.000000 setrgbcolor fill grestore gsave % wmf_[eps_]draw_polygon 678.233765 670.593811 828.611389 665.106079 839.864136 685.959290 856.231750 722.177917 881.806213 778.152222 896.127869 827.541260 885.898132 841.809204 869.530457 862.662354 849.070923 880.222961 831.680298 892.295837 803.036987 902.173645 773.370605 906.563782 692.555420 906.563782 687.440552 989.976440 565.706299 785.834961 677.210815 600.351562 678.233765 670.593811 newpath moveto 2 1 17 { pop lineto } for closepath 0.000000 0.501961 0.000000 setrgbcolor fill grestore grestore % end clip grestore restore showpage pcal-4.11.0/examples/0000755000175000001440000000000010732023355012517 5ustar wuserspcal-4.11.0/examples/calendar_au.txt0000644000175000001440000000231110160142735015512 0ustar wusers# Bank holidays for Australia # taken from http://www.vergenet.net/~conrad/tmp Jan 28 Australia Day Holiday (Australia, except NSW, Vic) Jun 10 Queen's Birthday Holiday (Australia, except WA) # # ACT, NSW, common # Mar 18 Canberra Day (ACT) 1st Monday in Aug Bank Holiday (ACT, NSW) 1st Monday in Oct Labour Day (ACT, NSW, SA) # # Victoria # 2nd Monday in Mar Labour Day (Vic) 1st Tuesday in Nov Melbourne Cup (Vic) # # Tasmania # Feb 11 Regatta Day (Tas) Feb 27 Launceston Cup (Tas) Mar 11 Eight Hours Day (Tas) Oct 10 Launceston Show Day (Tas) Oct 24 Hobart Show Day (Tas) Nov 04 Recreation Day (N Tas) # # South Australia # May 20 Adelaide Cup (SA) Dec 26 Proclamation Day (SA) # # Western Australia # 1st Monday in Mar Labour Day (WA) 1st Monday in Jun Foundation Day (WA) Sep 30 Queen's Birthday (WA) # # Northern Territory # 1st Monday in May May Day (NT) 1st Friday in Jul Alice Springs Show Day (NT) 2nd Friday in Jul Tennant Creek Show Day (NT) 3rd Friday in Jul Katherine Show Day (NT) last Friday in Jul Darwin Show Day (NT) 1st Monday in Aug Picnic Day (NT) # # Queensland # 1st Monday in May Labour Day (Qld) Aug 14 RNA Show Day (Brisbane metro) pcal-4.11.0/examples/calendar_de.txt0000644000175000001440000000213510301157346015502 0ustar wusers# Bank holidays in Germany # Holidays in Germany differ between regions. This file contains the # main holidays that exist in all regions. No warrenty for them being # correct. # # last modified Thu Apr 10 16:21:06 GTBDT 2003 by Stefan Fronzek # # add an asterisk (*) to the date to specify a bank holiday # OVERRIDE THE PROGRAM DEFAULTS opt -E # European date format opt -a de # print out German days and months # print the week and day number on each Sunday #all Sunday in all* Tag %j, Woche %w 1 Jan* Neujahr # Easter is a predefined holiday, calculated by Pcal for each year Good_Friday* Karfreitag Easter Ostersonntag Mon after Easter* Ostermontag 6th Thursday after Easter* Himmelfahrt # last Sunday in March Mother's Day last Sunday in March Sommerzeit (+1h) 1 May* 1. Mai 3 October* Tag der dt. Einheit last Sunday in Oct Winterzeit (-1h) # Thanksgiving and Christmas are also predefined holidays day before Christmas* Heilig Abend Christmas* 1. Weihnachtstag day after Christmas* 2. Weihnachtstag #last day in Dec Sylvester pcal-4.11.0/examples/calendar_ee.txt0000644000175000001440000000350610301157346015506 0ustar wusers# National holidays in Estonia as of Jan 2004. # # Created by Neeme Praks # A bit of copy-and-paste from the Finnish settings # # add an asterisk (*) to the date to specify a non-work holiday # OVERRIDE THE PROGRAM DEFAULTS opt -E # European date format opt -F Monday # starting day should be Monday opt -z 2 # time zone should be GMT+2 opt -a et # print out Estonian days and months # print the week and day number on each Sunday #all Sunday in all* P\344ev %j, n\344dal %w 1 Jan* uusaasta 6 Jan kolmekuningap\344ev 2 Feb Tartu rahulepingu aastap\344ev 16 Feb Leedu iseseisvusp\344ev 24 Feb* iseseisvusp\344ev 24 Feb Eesti Vabariigi aastap\344ev 14 Mar emakeelep\344ev last Sunday in Mar suveaeg (+1t) # Easter is a predefined holiday, calculated by Pcal for each year 7th Tue before Easter vastlap\344ev Good_Friday* suur reede Easter* \374lest\365usmisp\374hade 1. p\374ha Mon after Easter \374lest\365usmisp\374hade 2. p\374ha 7th Sun after Easter* nelip\374hade 1. p\374ha last day in Apr volbri\366\366 1 May* kevadp\374ha 1 May volber 2nd Sun in May emadep\344ev 14 Jun leinap\344ev 23 Jun* v\365idup\374ha 24 Jun* jaanip\344ev 20 Aug* taasiseseisvumisp\344ev last Sunday in Oct talveaeg (-1t) 2 Nov hingedep\344ev 2nd Sun in Nov isadep\344ev 16 Nov taass\374nni p\344ev 18 Nov L\344ti iseseisvusp\344ev 6 Dec Soome iseseisvusp\344ev 25 Dec* 1. j\365ulupp\374ha 26 Dec* 2. j\365ulupp\374ha pcal-4.11.0/examples/calendar_es.txt0000644000175000001440000000354710732020573015530 0ustar wusers# National holidays in Spain (.calendar file for pcal) # This file must be encoded in Latin1 # Author: Francisco José Marín Pérez (pacogeek@gmail.com) (http://www.tverde.blogspot.com) # ========== # Changelog # ========== # (dd/mm/yy) # 3/8/2007 First version of this file. # 16/12/2007 B. Marr -- remove unneeded 'opt -r' line; fix spelling typo. # # Holidays in Spain differ between regions. This file contains only the official holidays in # all Spain (I take them from http://spain.info) # ============ # SOME OPTIONS # ============ opt -E # Parse European dates ("dd/mm/{/yy}" and "dd month") opt -a es # Spanish for the day/month names opt -n Times-Bold/10 # Make the notes more clear opt -F Monday # Start the week on Monday opt -s 1:0:0 # holidays in red color # ============================= # OFICIAL HOLIDAYS IN ALL SPAIN # ============================= 1 1* Ańo Nuevo 6 1* Epifanía Friday before Easter* Viernes Santo # La semana santa es la semana anterior a la Pascua 1 5* Día del trabajo 15 8* Asunción de la Virgen 12 10* Virgen del Pilar 1 11* Festividad de Todos los Santos 6 12* Día de la Constitución 8 12* Festividad de la Inmaculada Concepción 25 12* Dia de Navidad # *** PLEASE, COMMENT YOUR LOCAL HOLIDAYS *** # ============================= # OFICIAL HOLIDAY IN ANDALUCÍA # ============================= # 28 2* Día de Andalucía # ============= # OTHERS EVENTS # ============= 14 2 San Valentín 19 3 Día del Padre first Sunday in May Día de la Madre 31 10 Hallowen 24 12 Nochebuena 28 12 Día de los Inocentes 31 12 Nochevieja # ==================== # DAYLIGHT SAVING TIME # ==================== last Sunday in March Horario de verano, se adelanta una hora, a las 2:00 serán las 3:00 last Sunday in October Horario de invierno, se atrasa una hora, a las 3:00 serán las 2:00 pcal-4.11.0/examples/calendar_fi.txt0000644000175000001440000000205610301157346015512 0ustar wusers# Bank holidays in Finland # This file contains the main holidays. No warrenty for them being # correct or complete. # # last modified Thu Apr 10 16:32:06 GTBDT 2003 by Stefan Fronzek # # add an asterisk (*) to the date to specify a bank holiday # OVERRIDE THE PROGRAM DEFAULTS opt -E # European date format opt -a fi # print out Finnish days and months # print the week and day number on each Sunday #all Sunday in all* Päivä %j, viiko %w 1 Jan* Uudenvuodenpäivä 6 Jan* Loppiainen # Easter is a predefined holiday, calculated by Pcal for each year Good_Friday* Pitkäperjantaina Easter Pääsiäispäivä Mon after Easter* 2. pääsiäspäivä 6th Thursday after Easter* Helatorstai last Sunday in March Kesäaika (+1t) 1 May* Vappu 21 June* Juhannus last Sunday in Oct Talviaika (-1t) 6 December* Itsenäisyyspäivä # Thanksgiving and Christmas are also predefined holidays day before Christmas* Jouluaatto Christmas* Joulupäivä day after Christmas* Tapaninpäivä last day in Dec Uudenvuodenaatto pcal-4.11.0/examples/calendar_fr.txt0000644000175000001440000000376410301157346015532 0ustar wusers# National holidays in France # # Created by Valéry Bruniaux on 2004-06-16 # # Taken from 'pcal' mailing list archives: # # Hello. # # Here is a file containing the french "jours fériés" and some events like # time changing, mother's day , etc... # # If you find it interesting, you could put it in the contribs on the # web... # # Thanks a lot for very very nice pcal... # # ======================================================================= # Valéry Bruniaux - 43 B Avenue St. Exupéry - 13800 Istres # Email : valery.bruniaux@if... # # ======= # options # ======= opt -a fr # output language = French opt -G samedi-dimanche -E -F lundi -K # opt -d Palatino-Bold/14 -n Helvetica-Narrow/8 -t Avant-Garde-Bold-Italic/24 # ===== # Notes # ===== note year Mettez vos notes ici # ============= # Anniversaires # ============= 20.04 \fB Anniversaire Valéry # ============ # Jours fériés # ============ 01 jan* \fI Jour de l'an 01 may* \fI Fęte du travail 08 may* \fI Armistice 1918 14 jul* \fI Fęte nationale 15 aug* \fI Assomption 01 nov* \fI Toussaint 11 nov* \fI Armistice 1945 25 dec* \fI Noël monday after easter* \fI Lundi de Paques 6th thursday after easter* \fI Ascension 8th monday after easter* \fI Lundi de la Pentecôte # =================== # Fętes et évčnements # =================== 14 feb \fI St Valentin 31 oct \fI Hallowen easter \fI Pâques Friday before Easter \fI Vendredi saint 7th sunday after easter \fI Pentecôte 7th Tuesday before Easter \fI Mardi Gras last Sunday in March \fI heure d'été (+1h) last Sunday in Oct \fI heure d'hiver (-1h) 1st Sunday in June \fI Fęte des mčres 3rd Sunday in June \fI Fęte des pčres # ======== # Vacances # ======== #all days in July* #all days in Aug* # ========== # Calendrier # ========== # Affiche les numéros de semaine le lundi all monday in all \fI Semaine %w # Commencez votre calendrier ici ... pcal-4.11.0/examples/calendar_gr.txt0000644000175000001440000004106310301157346015525 0ustar wusers# # Greek Dates (Namedays, Holidays) for use with pcal 4.x + # # # NB: + YOU NEED AN 8-BIT CLEAN EDITOR TO EDIT THIS (and proper fonts) # + GREEK IS IN ELOT-928 # # Copyright (c) 1995 Angelo Haritsis # Used information for Greek Dates/Holidays from gpscal by: # Dimitri Konstantas # # Please send any comments/corrections/additions to: ah@doc.ic.ac.uk # # DISTRIBUTE FREELY, PROVIDED THE ABOVE COPYRIGHT IS KEPT. NO WARRANTIES. # # --------- # Preamble # --------- opt -a el # output language = Greek opt -E # European format # You must have a greek elot PS font to preview or print this !!! # I might be able to send you one ... #opt -t Greek-Arial-Plain -n Greek-Arial-Plain # override default fonts # -------------------- # Fixed Dates/Holidays # -------------------- 1 Jan \320\345\361\351\364\357\354\336 \327\361\351\363\364\357\375 .p \314\345\343\334\353\357\365 \302\341\363\351\353\345\337\357\365 .p \315\335\357 \270\364\357\362 6 Jan \324\341 \266\343\351\341 \310\345\357\366\334\355\345\351\341 7 Jan \311\371\334\355\355\357\365 \320\361\357\344\361\374\354\357\365 8 Jan \310\345\357\366\337\353\357\365 9 Jan \305\365\363\364\361\341\364\337\357\365 11 Jan \310\345\357\344\357\363\337\357\365 12 Jan \324\341\364\351\341\355\336\362 17 Jan \301\355\364\371\355\337\357\365 \314\345\343\334\353\357\365 18 Jan \301\350\341\355\341\363\337\357\365 \352\341\351 \312\365\361\337\353\353\357\365 20 Jan \305\365\350\365\354\337\357\365 21 Jan \314\341\356\337\354\357\365, \315\345\357\366\375\364\357\365 .p \301\343\355\336\362, \306\371\363\337\354\357\365 22 Jan \324\351\354\357\350\335\357\365 25 Jan \303\361\347\343\357\361\337\357\365 \310\345\357\353\374\343\357\365 26 Jan \316\345\355\357\366\376\355\364\357\362 27 Jan \311\371\334\355\355\357\365 \327\361\365\363\357\363\364\374\354\357\365 (\341\355\341\352\357\354) 30 Jan \324\361\351\376\355 \311\345\361\341\361\367\376\355 31 Jan \312\375\361\357\365 \352\341\351 \311\371\334\355\355\357\365 \301\355\341\361\343\375\361\371\355 1 Feb \324\361\375\366\371\355\357\362 2 Feb \325\360\341\360\341\355\364\336 \364\357\365 \312\365\361\337\357\365 4 Feb \311\363\351\344\376\361\357\365 \317\363\337\357\365 5 Feb \301\343\341\350\336\362 6 Feb \326\371\364\337\357\365 \312\371\355/\360\374\353\345\371\362 9 Feb \315\351\352\347\366\374\361\357\365 10 Feb \327\341\361\341\353\334\354\360\357\365\362, \306\336\355\371\355\357\362 11 Feb \302\353\341\363\337\357\365 19 Feb \326\351\353\357\350\335\347\362 21 Feb \324\351\354\357\350\335\357\365 \352\341\351 \305\365\363\364\341\350\337\357\365 27 Feb \320\361\357\352\357\360\337\357\365 1 Mar \305\365\344\357\352\337\341\362 2 Mar \310\345\357\344\374\364\357\365 13 Mar \315\351\352\347\366\374\361\357\365 \312\371\355/\353\345\371\362 14 Mar \302\345\355\345\344\337\352\364\357\365 15 Mar \301\343\341\360\337\357\365, \301\361\351\363\364\357\342\357\375\353\357\365 16 Mar \327\361\351\363\364\357\344\357\375\353\357\365 \345\355 \320\334\364\354\371 17 Mar \301\353\345\356\337\357\365 \317\363\337\357\365 23 Mar \315\337\352\371\355\357\362 \317\363\351\357\354. 25 Mar \305\365\341\343\343\345\353\351\363\354\374\362 \310\345\357\364\374\352\357\365 .p \270\355\341\361\356\347 \364\347\362 \305\360\341\355\334\363\364\341\363\347\362 1821 30 Mar \311\371\334\355\355\357\365 \364\347\362 \312\353\337\354\341\352\357\362 1 Apr \320\361\371\364\341\360\361\351\353\351\334 2 Apr \324\337\364\357\365 6 Apr \305\365\364\365\367\337\357\365 24 Apr \323\334\342\342\341 \364\357\365 \323\364\361\341\364\347\353\334\364\357\365 .p \305\353\351\363\334\342\345\364 \364\347\362 \310\341\365\354\341\364\357\365\361\343\357\375 29 Apr \311\334\363\371\355\357\362 30 Apr \311\341\352\376\342\357\365 \301\360\357\363\364\374\353\357\365 .p \301\361\343\365\361\336\362 1 May \311\345\361\345\354\337\357\365, \311\363\351\344\376\361\341\362 .p \320\361\371\364\357\354\341\343\351\334 4 May \320\345\353\341\343\337\341\362 # XXX Confirm: if Eir before easter => easter + 3 5 May \305\351\361\336\355\347\362 \364\347\362 \314\345\343\357\353\357\354\334\361\364\365\361\357\362 .p \312\357\361\355\347\353\337\341\362 6 May \323\345\361\341\366\345\337\354 8 May \311\371\334\355\355\357\365 \364\357\365 \310\345\357\353\374\343\357\365 10 May \323\337\354\371\355\357\362 11 May \314\345\350\357\344\337\357\365 \352\341\351 \312\365\361\337\353\353\357\365 13 May \303\353\365\352\345\361\337\341\362 16 May \310\345\357\344\376\361\357\365 19 May \320\341\364\361\351\352\337\357\365 21 May \312\371\355\363\364\341\355\364\337\355\357\365 \352\341\351 \305\353\335\355\347\362 24 May \323\365\354\345\376\355 .p \314\345\353\345\364\337\357\365 29 May \310\345\357\344\357\363\337\341\362 4 Jun \314\334\361\350\341\362 5 Jun \304\371\361\357\350\335\357\365 \324\375\361\357\365 8 Jun \312\341\353\353\351\374\360\347\362 11 Jun \302\341\361\350\357\353\357\354\341\337\357\365, \315\341\350\341\355\341\336\353 \352\341\351 .p \302\341\361\355\334\342\341 \364\371\355 \301\360\357\363\364\374\353\371\355 17 Jun \311\371\363\336\366 21 Jun \301\366\361\357\344\337\364\347\362 \352\341\351 \311\357\365\353\351\341\355\357\375 27 Jun \323\341\354\370\376\355 29 Jun \320\335\364\361\357\365 \352\341\351 \320\341\375\353\357\365 30 Jun \323\375\355\341\356\347 \304\376\344\345\352\341 \301\360\357\363\364\374\353\371\355 1 Jul \312\357\363\354\334, \304\341\354\351\341\355\357\375 \301\355\341\361\343\375\361\371\355 7 Jul \312\365\361\351\341\352\336\362 \314\345\343\357\353\357\354\334\361\364\365\361\357\362 8 Jul \320\361\357\352\357\360\337\357\365 \314\345\343\341\353\357\354. 11 Jul \305\365\366\347\354\337\341\362 .p \274\353\343\341\362 12 Jul \302\345\361\357\355\337\352\347\362 17 Jul \314\341\361\337\355\347\362 \314\345\343\341\353\357\354\334\361\364\365\361\357\362 20 Jul \320\361\357\366\336\364\347 \307\353\337\341 22 Jul \314\341\361\352\335\353\353\341\362 25 Jul \312\357\337\354\347\363\351\362 \301\343\337\341\362 \266\355\355\347\362 26 Jul \320\341\361\341\363\352\345\365\336\362 27 Jul \320\341\355\364\345\353\345\336\354\357\355\357\362 6 Aug \314\345\364\341\354\374\361\366\371\363\347 \364\357\365 \323\371\364\336\361\357\362 15 Aug \307 \312\357\337\354\347\363\347 \364\347\362 \310\345\357\364\374\352\357\365 17 Aug \314\375\361\371\355\357\362, \311\357\365\353\351\341\355\336\362 .p \312\365\360\361\351\341\355\357\375 19 Aug \310\345\357\366\334\355\357\365\362 24 Aug \312\357\363\354\334 \364\357\365 \301\351\364\371\353\357\375, \305\365\364\365\367\357\375\362 26 Aug \301\344\361\351\341\355\357\375 \352\341\351 \315\341\364\341\353\337\341\362 27 Aug \326\341\355\357\365\361\337\357\365 28 Aug \314\371\373\363\335\371\362 \301\351\350\337\357\360\357\362 .p \304\351\357\354\336\344\357\365\362 29 Aug \301\360\357\364\357\354\336 \312\345\366\341\353\336\362 \320\361\357\344\361\374\354\357\365 30 Aug \301\353\345\356\334\355\344\361\357\365 4 Sep \314\371\373\363\335\371\362 \320\361\357\366\336\364\357\365, \305\361\354\351\374\355\347\362 5 Feb \306\341\367\341\361\337\357\365 \320\361\357\366\336\364\357\365 8 Sep \303\345\355\335\350\353\351\357\355 \310\345\357\364\374\352\357\365 9 Sep \311\371\341\352\345\337\354 \352\341\351 \266\355\355\347\362 14 Sep \276\370\371\363\347 \324\351\354\337\357\365 \323\364\341\365\361\357\375 15 Sep \315\351\352\336\364\341 \314\345\343\341\353\357\354\334\361\364\365\361\357\362 16 Sep \305\365\366\347\354\337\341\362 17 Sep \323\357\366\337\341\362 \352\341\351 \364\371\355 \350\365\343\341\364\335\361\371\355 \364\347\362: .p \320\337\363\364\347\362, \301\343\334\360\347\362 \352\341\351 \305\353\360\337\344\341\362 18 Sep \301\361\351\334\344\355\347\362 20 Sep \305\365\363\364\341\350\337\357\365 \314\345\343\341\353\357\354\334\361\364\365\361\357\362 21 Sep \311\371\355\334 \320\361\357\366\336\364\357\365 24 Sep \310\335\352\353\347\362 \320\361\371\364\357\354\334\361\364\365\361\357\362 25 Sep \305\365\366\361\357\363\375\355\347\362 26 Sep \314\345\364\334\363\364\341\363\347 \305\365\341\343\343 \311\371\334\355\355\347 1 Oct \321\371\354\341\355\357\375 \364\357\365 \314\345\353\371\344\357\375 3 Oct \304\351\357\355\365\363\337\357\365 \301\361\345\357\360\341\343\337\364\357\365 4 Oct \311\345\361\357\350\335\357\365 5 Oct \327\341\361\351\364\337\355\347\362 6 Oct \310\371\354\334 \301\360\357\363\364\374\353\357\365 7 Oct \323\345\361\343\337\357\365 \352\341\351 \302\334\352\367\357\365 .p \320\357\353\365\367\361\357\355\337\357\365 \311\345\361\357\354\334\361\364\365\361\357\362 8 Oct \320\345\353\341\343\337\341\362 9 Oct \311\341\352\376\342\357\365 \364\357\365 \301\353\366\341\337\357\365 10 Oct \305\365\353\341\354\360\337\357\365 \352\341\351 \305\365\353\341\354\360\337\341\362 11 Oct \326\351\353\337\360\360\357\365 \364\357\365 \304\351\341\352\374\355\357\365 12 Oct \301\355\344\361\357\355\337\352\357\365 \352\341\351 \301\355\344\361\357\354\334\367\347\362 18 Oct \313\357\365\352\334 \364\357\365 \305\365\341\343\343\345\353\351\363\364\357\375 20 Oct \301\361\364\345\354\337\357\365, \303\345\361\341\363\337\354\357\365 \317\363\337\357\365 23 Oct \311\341\352\376\342\357\365 \364\357\365 \301\344\345\353\366\357\350\335\357\365 26 Oct \304\347\354\347\364\361\337\357\365 \364\357\365 \314\365\361\357\342\353\336\364\357\365 27 Oct \315\335\363\364\357\361\357\362 \314\334\361\364\365\361\357\362 28 Oct \301\343\337\341\362 \323\352\335\360\347\362 .p \324\357 \317\327\311 \364\357\365 1940 1 Nov \312\357\363\354\334, \304\341\354\351\341\355\357\375 \301\355\341\361\343\375\361\371\355 8 Nov \324\341\356\351\341\361\367\376\355 \314\351\367\341\336\353 \352\341\351 \303\341\342\361\351\336\353 9 Nov \315\345\352\364\341\361\337\357\365 \320\345\355\364\341\360\374\353\345\371\362 11 Nov \314\347\355\334 .p \302\337\352\364\371\361\357\362 \352\341\351 \302\351\352\345\355\364\337\357\365 13 Nov \311\371\334\355\355\357\365 \364\357\365 \327\361\365\363\357\363\364\374\354\357\365 14 Nov \326\351\353\337\360\360\357\365 \301\360\357\363\364\374\353\357\365 16 Nov \314\341\364\350\341\337\357\365 \364\357\365 \305\365\341\343\343\345\353\351\363\364\357\375 .p \311\366\351\343\345\355\345\337\341\362 18 Nov \320\353\334\364\371\355\357\362, \306\341\352\367\341\337\357\365 21 Nov \305\351\363\374\344\351\341 \364\347\362 \310\345\357\364\374\352\357\365 25 Nov \301\351\352\341\364\345\361\337\355\347\362 \314\345\343\341\353\357\354\334\361\364\365\361\357\362 26 Nov \323\364\365\353\351\341\355\357\375 30 Nov \301\355\344\361\335\341 \301\360\357\363\364\374\353\357\365 1 Dec \315\341\357\375\354 \320\361\357\366\336\364\357\365 4 Dec \302\341\361\342\334\361\341\362 \314\345\343\341\353\357\354\334\361\364\365\361\357\362 .p \304\341\354\341\363\352\347\355\357\375 5 Dec \323\334\342\342\341, \304\351\357\343\335\355\357\365\362 6 Dec \315\351\352\357\353\334\357\365 7 Dec \301\354\342\361\357\363\337\357\365 \314\345\344\351\357\353\334\355\371\355 .p \303\345\361\341\363\337\354\357\365 \317\363\337\357\365 9 Dec \323\375\353\353\347\370\351\362 \301\343\337\341\362 \266\355\355\347\362 10 Dec \314\347\355\334 11 Dec \304\341\355\351\336\353 12 Dec \323\360\365\361\337\344\371\355\357\362 13 Dec \305\365\343\345\355\337\357\365, \305\365\363\364\361\341\364\337\357\365, .p \301\365\356\345\355\364\337\357\365, .p \317\361\335\363\364\357\365 \352\341\351 \313\357\365\352\337\341\362 15 Dec \305\353\345\365\350\345\361\337\357\365 17 Dec \304\351\357\355\365\363\337\357\365 \301\351\343\337\355\347\362 19 Dec \301\343\353\341\300\341\362 20 Dec \311\343\355\341\364\337\357\365 \310\345\357\366\374\361\357\365 21 Dec \311\357\365\353\351\341\355\336\362 \352\341\351 \310\345\354\351\363\364\357\352\353\335\357\365\362 22 Dec \301\355\341\363\364\341\363\337\341\362 \326\341\361\354\341\352\357\353\375\364\361\351\341\362 24 Dec \305\365\343\345\355\337\341\362 25 Dec \327\321\311\323\324\317\325\303\305\315\315\301 26 Dec \323\375\355\341\356\347 \364\347\362 \310\345\357\364\374\352\357\365 27 Dec \323\364\345\366\334\355\357\365 \364\357\365 \320\361\371\364\357\354\334\361\364\365\361\357\362 # --------------------------------------------- # Greek Easter dependent holidays. 0 = GEaster # --------------------------------------------- 10th Sun before GEaster \312\365\361\351\341\352\336 \324\345\353\376\355\357\365 & \326\341\361\351\363\341\337\357\365 .p \301\361\367\336 \324\361\351\371\344\337\357\365 9th Sun before GEaster \312\365\361\351\341\352\336 \364\357\365 \301\363\376\364\357\365 9th Thu before GEaster \324\363\351\352\355\357\360\335\354\360\364\347 8th Sun before GEaster \312\365\361\351\341\352\336 \364\347\362 \301\360\374\352\361\345\371 8th Sat before GEaster \330\365\367\357\363\334\342\342\341\364\357 7th Sun before GEaster \312\365\361\351\341\352\336 \364\347\362 \324\365\361\351\355\336\362 7th Mon before GEaster \312\341\350\341\361\334 \304\345\365\364\335\361\341 7th Fri before GEaster \301' \327\341\351\361\345\364\351\363\354\357\337 43rd day before GEaster \301\355\334\354\355 \350\341\375\354\341\364\357\362 \301\343 \310\345\357\344\376\361\357\365 6th Sun before GEaster \312\365\361\351\341\352\336 \301' \315\347\363\364\345\351\376\355 .p \364\347\362 \317\361\350\357\344\357\356\337\341\362 6th Fri before GEaster \302' \327\341\351\361\345\364\351\363\354\357\337 5th Sun before GEaster \312\365\361\351\341\352\336 \302' \315\347\363\364\345\351\376\355 5th Fri before GEaster \303' \327\341\351\361\345\364\351\363\354\357\337 4th Sun before GEaster \312\365\361\351\341\352\336 \303' \315\347\363\364\345\351\376\355 .p \364\347\362 \323\364\341\365\361\357\360\361\357\363\352\375\355\347\363\347\362 4th Fri before GEaster \304' \327\341\351\361\345\364\351\363\354\357\337 3rd Sun before GEaster \312\365\361\351\341\352\336 \304' \315\347\363\364\345\351\376\355 3rd Wed before GEaster \314\335\343\341\362 \312\341\355\376\355 3rd Fri before GEaster \301\352\334\350\351\363\364\357\362 \276\354\355\357\362 2nd Sun before GEaster \312\365\361\351\341\352\336 \305' \315\347\363\364\345\351\376\355 2nd Sat before GEaster \301\355\334\363\364\341\363\347 \364\357\365 \313\341\346\334\361\357\365 Sun before GEaster \324\371\355 \302\341\300\371\355 Mon before GEaster \314\345\343\334\353\347 \304\345\365\364\335\361\341 Tue before GEaster \314\345\343\334\353\347 \324\361\337\364\347 Wed before GEaster \314\345\343\334\353\347 \324\345\364\334\361\364\347 Thu before GEaster \314\345\343\334\353\347 \320\335\354\360\364\347 Fri before GEaster \314\345\343\334\353\347 \320\341\361\341\363\352\345\365\336 Sat before GEaster \314\345\343\334\353\357 \323\334\342\342\341\364\357 GEaster \324\317 \301\303\311\317\315 \320\301\323\327\301 1st day after GEaster \304\351\341\352\341\351\355\351\363\337\354\357\365 5th day after GEaster \306\371\357\344\374\367\357\365 \320\347\343\336\362 1st Sun after GEaster \312\365\361\351\341\352\336 \364\357\365 \310\371\354\334 2nd Sun after GEaster \312\365\361\351\341\352\336 \364\371\355 \314\365\361\357\366\374\361\371\355 3rd Sun after GEaster \312\365\361\351\341\352\336 \364\357\365 \320\341\361\341\353\375\364\357\365 4th Sun after GEaster \312\365\361\351\341\352\336 \364\347\362 \323\341\354\341\361\345\337\364\351\344\341\362 5th Sun after GEaster \312\365\361\351\341\352\336 \364\357\365 \324\365\366\353\357\375 39th day after GEaster \324\347\362 \301\355\341\353\336\370\345\371\362 6th Sun after GEaster \312\365\361\351\341\352\336 \364\371\355 \301\343\337\371\355 \320\341\364\335\361\371\355 7th Sat after GEaster \330\365\367\357\363\334\342\342\341\364\357 7th Sun after GEaster \312\365\361\351\341\352\336 \364\347\362 \320\345\355\364\347\352\357\363\364\336\362 50th day after GEaster \324\357\365 \301\343\337\357\365 \320\355\345\375\354\341\364\357\362 8th Sun after GEaster \312\365\361\351\341\352\336 \364\371\355 \301\343\337\371\355 \320\334\355\364\371\355 # Special (semi-movable) # 23 apr or easter monday Gstgeorge \303\345\371\361\343\337\357\365 \314\345\343\341\353\357\354\334\361\364\365\361\357\362 # 25 apr or easter tue Gmarcus \314\334\361\352\357\365 \305\365\341\343\343\345\353\351\363\364\357\375 # ------------- # Miscellaneous # ------------- last Sun in Mar \301\353\353\341\343\336 \277\361\341\362 (+1) last Sun in Sep \301\353\353\341\343\336 \277\361\341\362 (-1) second Sun in May \303\351\357\361\364\336 \364\347\362 \314\347\364\335\361\341\362 pcal-4.11.0/examples/calendar_hu.txt0000644000175000001440000000376310301206423015525 0ustar wusers# National holidays in Hungary of Jan 2005. # # Created by Ferenc Kruzslicz # A bit of copy-and-paste from the Finnish settings # # add an asterisk (*) to the date to specify a non-work holiday # opt -d AvantGarde-Book/30 -t AvantGarde-Book -n Helvetica/8 opt -a hu # set hungarian language opt -F Monday # weeks start with Monday opt -s 0.6/0.97 # override default date/fill box shading opt -z 1 # time zone should be GMT+1 # print the week and day number on each Sunday all Sunday in all* %w. h\351t, %j. nap ifndef whole_year opt -Oall -gsat-sun -bholiday # print outlined characters if "-w" NOT specified endif undef no_such_sym # not an error to undef nonexistent symbol # Predefined holidays were used wherever it was possible opt -A # dates below are American-style year * # following entries apply to every year if lang_hu Jan 01* \332j\351v Feb 14 B\341lint nap Easter* H\372sv\351t vas\341rnap Mar 8 N\365nap Mar 15* Nemzeti \374nnep - az 1848-as szabads\341gharc kit\366r\351s\351nek \351vfordul\363ja Apr 01 Bolondok napja Easter H\372sv\351t day after Easter* H\372sv\351th\351tf\365 first Sunday in May Any\341k napja last Sunday in May Gyermeknap # 50 days after Easter P\374nk\366sd (vas\341rnap) 7th Sunday after Easter P\374nk\366sd 8th Monday after Easter* P\374nk\366sdh\351tf\365 May 01* A munka \374nnepe Aug 20* Nemzeti \374nnep - a magyar \341llamalap\355t\341s \351vfordul\363ja Oct 23* Nemzeti \374nnep - az 1956-os forradalom kit\366r\351s\351nek \351vfordul\363ja Nov 01* Mindenszentek day before Christmas Szenteste Christmas* Kar\341csony day after Christmas* Kar\341csony m\341snapja Dec 31 Szilveszter endif pcal-4.11.0/examples/calendar_nl.txt0000644000175000001440000000166610732017670015536 0ustar wusers# pcal .calender file # # Europeese notatie, Nederlandse taal, A4 formaat, maanstanden, # en Julian date (dag v/h jaar) klein rechtsonder opt -E -a nl -P a4 -m -j # # Verjaardag voorbeeld: ##12 Jan Ewald's %-1963Y%Ye Verjaardag # 1 Jan Nieuwjaarsdag 1 April een April 1 May* Dag van de Arbeid 183rd day of year Halverwege (%l dagen over) Good_Friday Goede Vrijdag Easter* Pasen 6th Thursday after Easter* Hemelvaart Monday after Easter* 2e Paasdag 7th Sunday after Easter Pinksteren Monday after 7th Sunday after Easter 2e Pinksterdag 3 Oct* Leids ontzet 5 Dec PakjesAvond 6 Dec Sinterklaas day before Christmas* KerstAvond Christmas* 1e Kerstdag day after Christmas* 2e Kerstdag 31 December* Oudjaar # last Sunday in March Begin zomertijd (+1 hour) last Sunday in October Einde zomertijd (-1 hour) # ifdef v4_8_0 | v4_9_0 | v4_9_1 | v4_10_0 F13 Vrijdag de 13e!! else Fri on all 13 Vrijdag de 13e!! endif pcal-4.11.0/examples/calendar_no.txt0000644000175000001440000000277710160142735015541 0ustar wusers# This file was posted to no.it.os.unix.linux.diverse by Aron Gurski #------------------------------------------------------------------------------- # # ${HOME}/.calendar - date file for pcal (specific to Norway) # #------------------------------------------------------------------------------- opt -E # # Holidays relative to Roman Catholic Easter # 7th Tuesday before Easter Mardi Gras 7th Wednesday before Easter Ash Wednesday Sunday before Easter* Palm Sunday Thursday before Easter* Maundy Thursday Friday before Easter* Good Friday Easter* Easter Sunday Monday after Easter* Easter Monday 6th Thursday after Easter* Ascension Day 7th Sunday after Easter* Whitsun 8th Monday after Easter* Whitsun Monday # # Summer time # last Sunday in March Summer time begins (+1 hour) last Sunday in October Summer time ends (-1 hour) # # Fixed date holidays # 1 January* New Year's Day 1 April April Fool's Day 1 May* Workers Day 17 May* Constitution Day day before Christmas* Christmas Eve Christmas* Christmas Day day after Christmas* Boxing Day 31 December* New Year's Eve # # Just for fun # 2nd full_moon in all [blue moon] pcal-4.11.0/examples/calendar_nz.txt0000644000175000001440000000107610160142735015543 0ustar wusers# Bank holidays in New Zealand # from http://www.vergenet.net/~conrad/tmp/ Jan 02 New Year Holiday (NZ) Jan 14 Anniversary Day (Southland) Jan 21 Anniversary Day (Wellington) Jan 28 Anniversary Day (Auckland) Feb 06 Waitangi Day (NZ) Mar 11 Anniversary Day (Taranaki) Mar 25 Anniversary Day (Otago) Jun 03 Queen's Birthday (NZ) Sep 23 Anniversary Day (South Canterbury) Oct 25 Anniversary Day (Hawke's Bay) Oct 28 Labour Day (NZ) Nov 04 Anniversary Day (Marlborough) Nov 15 Anniversary Day (Canterbury) Dec 02 Anniversary Day (Chatham Islands) pcal-4.11.0/examples/calendar_pl.txt0000644000175000001440000000200410465401216015517 0ustar wusers# Polish Dates # # Created by Dominik 'Chiron' Derlatka opt -E opt -a pl opt -F Monday opt -z 1 # opt -z 2 CEST opt -P a4 define christian define national define pagan if christian Easter Niedziela Wielkanocna Mon after Easter* Poniedzia\263ek Wielkanocny 3 May* Naj\266wi\352tszej Marii Panny Thu after 59th day after Easter* Bo\277e Cia\263o 1 Nov* Wszystkich \246wi\352tych day before Christmas Wigilia Christmas* Bo\277e Narodzenie day after Christmas* Bo\277e Narodzenie endif if national 1 Jan* Nowy Rok 1 May* \246wi\352to Pracy 2 May Dzie\361 Flagi Rzeczypospolitej Polskiej 3 May* \246wi\352to Konstytucji 3 Maja 15 Aug* \246wi\352to Wojska Polskiego 11 Nov* \246wi\352to Niepodleg\263o\266ci endif if pagan 21 Mar Jare \246wi\352to 21 Jun \246wi\352to Ognia i Wody 22 Jun \246wi\352to Ognia i Wody 23 Sep \246wi\352to Plon\363w 2 Nov Zaduszki 21 Dec Godowe \246wi\352to 22 Dec Godowe \246wi\352to last day in Dec Sylwester endif pcal-4.11.0/examples/calendar_sk.txt0000644000175000001440000000721210732020454015525 0ustar wusers# # Sk Holidays # # Sources: # http://www-8.vlada.gov.sk/index.php?ID=1010 # # For pcal created by Zdenko Podobny opt -a sk # Slovak for the day/month names opt -E # Europe date format opt -F Monday # Week start on Monday opt -P a4 # paper size: A4 opt -m # draw 'moon phase' icon at full/new/quarter moons # opt -l # generate landscape-style calendar (default) opt -p # generate portrait-style calendar year all # Reset the year to wildcard ###opt -d Helvetica-Bold/30 -t Helvetica-Bold -n Helvetica/8 ###opt -d Times-Roman/18 -t Times-Roman/30 -n Times-Roman/ ###opt -d AvantGarde-Book/30 -t AvantGarde-Book -n Helvetica/8 opt -d Helvetica-Bold/30 -t Helvetica-Bold -n Helvetica-Narrow/10 # # Override the default colors for the 'date numerics' (i.e. the numbers # printed in the day box) (enabled with the '-g', '-G', or '-O' options) and # for the fill color of empty (unused) 'day' boxes. # opt -s 1.0:0.0:0.0/1.0:1.0:0.8 # red numerals / light yellowish boxes ## ## Statne sviatky/Public Holidays ## 1 Jan* \fBNov\375 Rok\fP # New Year Day 1 Jan* De\362 vzniku Slovenskej republiky (1993) # Independence Day (1993) 5 Jul* \fBSviatok sv\344t\351ho Cyrila a Metoda # Cyril, Metod (their arrival into Great-Moravia's Empire in 863) 29 Aug* \fBV\375ro\350ie SNP # Slovak National Uprising (1944) 1 Sep* \fBDe\362 Ústavy Slovenskej republiky # Constitution Day (1992) 17 Nov* \fBDe\362 boja za slobodu a demokraciu # Day of Fight for Democracy ## ## Dni pracovneho pokoja/Bank Holidays ## 6 Jan* Zjavenie P\341na (Traja kr\341li) # Epiphany 1 May* Sviatok Pr\341ce # Labor Day 8 May* De\362 v\355\273azstva na fa\271iznom (1945) # Victory over Fascism Day (1945) 15 Sep* Sedembolestn\341 Panna M\341ria # Our Lady of Sorrows 1 Nov* Sviatok v\271etk\375ch sv\344t\375ch # All Saints' Day 24 Dec* \251tedr\375 de\362 # 25 Dec* Prv\375 sviatok viano\350n\375 # 1st Christmas Day 26 Dec* Druh\375 sviatok viano\350n\375 # 2nd Christmas Day ## ## Pohyblive sviatky ## Good_Friday* Ve\265k\375 piatok # Good Friday Easter* Ve\265kono\350n\341 nede\265a # Easter Sunday Mon after Easter* Ve\265kono\350n\375 pondelok # Easter Monday ## ## Cirkevne sviatky ## Sun before Easter Kvetn\341 nede\265a # Palm Sunday ## ## Memorial Days/Pamatne dni ## ## http://www.calendar.sk/nameday-sksklin.php 25 May De\362 z\341pasu za \265udsk\351 pr\341va 13 Apr De\362 nespravodlivo st\355han\375ch 4 May V\375ro\350ie \372mrtia M.R. \251tef\341nika 7 Jun V\375ro\350ie Memoranda n\341roda slovensk\351ho 5 Jul De\362 zahrani\350n\375ch Slov\341kov 17 Jul V\375ro\350ie Deklar\341cie o zvrchovanosti SR 4 Aug De\362 Matice slovenskej 9 Sep De\362 obet\355 holokaustu a rasov\351ho n\341silia 19 Sep De\362 vzniku Slovenskej n\341rodnej rady 6 Oct De\362 obet\355 Dukly 27 Oct De\362 \350ernovskej trag\351die 28 Oct De\362 vzniku samostatn\351ho \306esko-slovensk\351ho \271t\341tu 29 Oct De\362 narodenia \245udov\355ta \251t\372ra 30 Oct V\375ro\350ie Deklar\341cie slovensk\351ho n\341roda 31 Oct De\362 reform\341cie 30 Dec De\362 vyhl\341senia Slovenska za samostatn\372 cirkevn\372 provinciu ## ## Selected Secular Holidays ## 14 Feb Sviatok Sv. Valent\355na # Valentine's Day 1 Apr Prv\375 apr\355l # April Fool's Day second Sun in May De\362 matiek # Mother's Day last day in Dec Silvester # New Year's Eve ## ## Daylight Savings ## first Sun in Apr Letn\375 \350as (+1h) # DST begins (+1h) last Sun in Oct Zimn\375 \350as (-1h) # DST ends (-1h) input-language sk pcal-4.11.0/examples/calendar_uk.txt0000644000175000001440000000206410160142735015531 0ustar wusers# # British Dates (not complete) # opt -E 1 Jan* New Year's Day # reset year implicitly 2 Jan* Bank Holiday 3 Jan Scottish Bank Holiday 6 Jan Epiphany 14 Feb Valentine's Day 17 Mar St. Patrick's Day 17 Mar Irish Bank Holiday # Easter is a predefined holiday, calculated by Pcal for each year Good_Friday* Good Friday Easter EASTER Sunday Mon after Easter* Easter Monday last Sunday in March Mother's Day last Sunday in March DST begins (+1h) ifdef QUEEN 21 April Queen's Birthday 10 June Queen's Official Birthday endif first Monday in May* Bank Holiday (May Day) last Monday in May* Spring Bank Holiday 3rd Sunday in June Father's Day last Monday in August* Summer Bank Holiday 15 Sep Battle of Britain Day last Sunday in Oct DST ends (-1h) 31 Oct Halloween 5 Nov Guy Fawkes' Day # Thanksgiving and Christmas are also predefined holidays day before Christmas Christmas Eve Christmas* Christmas Day day after Christmas* Boxing Day last day in Dec New Year's Eve pcal-4.11.0/examples/calendar_us.txt0000644000175000001440000001042610732017670015546 0ustar wusers# # US Holidays # # Sources: # http://aa.usno.navy.mil/faq/docs/holidays.html # http://www.smart.net/~mmontes/ushols.html # http://www4.law.cornell.edu/uscode/html/uscode36/usc_sup_01_36_06_I_08_A_10_1.html # # Originally by J. Rhett Hooper, with minor updates and corrections by Bill Marr opt -A # American date format year all # Reset the year to wildcard ## ## Federal Holidays ## see http://www4.law.cornell.edu/uscode/html/uscode05/usc_sec_05_00006103----000-.html ## Jan 1* New Year's Day Jul 4* Independence Day Nov 11* Veterans Day Dec 25* Christmas Day # Where any of above fall on a weekend, most institutions will observe a # holiday on the nearest weekday (Fri, or Mon.). The following will mark # those days as holidays. This doesn't seem to work as I expect for New # Year's. It seems to be a problem with spanning a year boundary, since # the holiday to be marked may fall in the previous year (for an example # see: Dec. 31, 2004.) weekday nearest Jan 1* # nonworkday in observance of New Year's Day weekday nearest Jul 4* # nonworkday in observance of Independence Day weekday nearest Nov 11* # nonworkday in observance of Veterans Day weekday nearest Dec 25* # nonworkday in observance of Christmas Day # Martin Luther King, Jr.'s actual birthdate is January 15, 1929, but US # Code specifies the holiday fall on the third Monday in January. January # 15 and the third Monday will only coincide if January 1 is a Monday. third Mon in Jan* Birthday of Martin Luther King, Jr. (observed) # George Washington's actual birthdate is February 22, 1732, (February 11, # 1732 in the Julian calendar system that was in use at the time) but US # Code specifies that the holiday fall on the third Monday in February. # February 22 can never be the third Monday. This holiday is often referred # to as "Presidents' Day" to also honor Abraham Lincoln. third Mon in Feb* Washington's Birthday (observed) last Mon in May* Memorial Day first Mon in Sep* Labor Day second Mon in Oct* Columbus Day fourth Thu in Nov* Thanksgiving ## ## Other civic dates ## weekday on_or_after Apr 15 Federal Income Taxes due Tue after first Mon in Nov General Election Day # Inauguration Day is Jan 20 of every fourth year after 1965, unless it # falls on a Sunday, in which case another day is selected. I'm not sure # how it is selected, and since it next happens in 2013, I'll just list a # couple. 1-20-2005 Inauguration Day 1-20-2009 Inauguration Day year all # Reset the year to wildcard ## ## Selected Religious Holidays ## Sun before Easter Palm Sunday Good_Friday Good Friday Easter Easter Sunday day before Christmas Christmas Eve ## ## Selected Secular Holidays ## Feb 2 Groundhog Day Feb 12 Lincoln's Birthday Feb 14 Valentine's Day Feb 22 Washington's Birthday Mar 17 St. Patrick's Day Apr 1 April Fool's Day Apr 22 Earth Day Wed before last Sat in Apr Administrative Assistants' Day last Fri in Apr Arbor Day second Sun in May Mother's Day third Sun in Jun Father's Day fourth Sun in Jul Parents' Day Sun after first Mon in Sep National Grandparents Day Oct 31 Halloween last day in Dec New Year's Eve ## ## Daylight Savings ## # # Pre-2007: # # first Sun in Apr DST begins (+1h) # last Sun in Oct DST ends (-1h) # # 2007 and beyond: # second Sun in Mar DST begins (+1h) first Sun in Nov DST ends (-1h) ## ## Selected Patriotic Observances ## See http://www4.law.cornell.edu/uscode/html/uscode36/usc_sup_01_36_06_I_08_A_10_1.html ## Feb 1 National Freedom Day Apr 13 Thomas Jefferson's birthday May 15 Peace Officers Memorial Day first Thu in May National Day of Prayer Jun 14 Flag Day Sun on_or_before Jun 14 National Flag Week Mon after Sun on_or_before Jun 14 National Flag Week Tue after Sun on_or_before Jun 14 National Flag Week Wed after Sun on_or_before Jun 14 National Flag Week Thu after Sun on_or_before Jun 14 National Flag Week Fri after Sun on_or_before Jun 14 National Flag Week Sat after Sun on_or_before Jun 14 National Flag Week Sep 11 Patriot Day Sep 17 Citizenship Day Sep 17 Constitution Week Sep 18 Constitution Week Sep 19 Constitution Week Sep 20 Constitution Week Sep 21 Constitution Week Sep 22 Constitution Week Sep 23 Constitution Week Dec 7 National Pearl Harbor Remembrance Day pcal-4.11.0/examples/fonttest_arabic0000644000175000001440000000107510301204703015602 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_arabic # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Arabic # force the proper character set encoding opt -C "ISO 8859-6 (Arabic) character mappings" # centered 'footer' string # # This encoding is not currently supported by 'pcal'! # ifdef sort else endif pcal-4.11.0/examples/fonttest_cyrillic0000644000175000001440000000601110301204703016166 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_cyrillic # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Cyrillic # force the proper character set encoding opt -C "ISO 8859-5 (Cyrillic) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 afii10023 all 01 242 \242 afii10051 all 01 243 \243 afii10052 all 02 244 \244 afii10053 all 02 245 \245 afii10054 all 02 246 \246 afii10055 all 02 247 \247 afii10056 all 03 250 \250 afii10057 all 03 251 \251 afii10058 all 03 252 \252 afii10059 all 03 253 \253 afii10060 all 04 254 \254 afii10061 all 04 255 \255 uni00AD all 04 256 \256 afii10062 all 04 257 \257 afii10145 all 05 260 \260 afii10017 all 05 261 \261 afii10018 all 05 262 \262 afii10019 all 05 263 \263 afii10020 all 06 264 \264 afii10021 all 06 265 \265 afii10022 all 06 266 \266 afii10024 all 06 267 \267 afii10025 all 07 270 \270 afii10026 all 07 271 \271 afii10027 all 07 272 \272 afii10028 all 07 273 \273 afii10029 all 08 274 \274 afii10030 all 08 275 \275 afii10031 all 08 276 \276 afii10032 all 08 277 \277 afii10033 all 09 300 \300 afii10034 all 09 301 \301 afii10035 all 09 302 \302 afii10036 all 09 303 \303 afii10037 all 10 304 \304 afii10038 all 10 305 \305 afii10039 all 10 306 \306 afii10040 all 10 307 \307 afii10041 all 11 310 \310 afii10042 all 11 311 \311 afii10043 all 11 312 \312 afii10044 all 11 313 \313 afii10045 all 12 314 \314 afii10046 all 12 315 \315 afii10047 all 12 316 \316 afii10048 all 12 317 \317 afii10049 all 13 320 \320 afii10065 all 13 321 \321 afii10066 all 13 322 \322 afii10067 all 13 323 \323 afii10068 all 14 324 \324 afii10069 all 14 325 \325 afii10070 all 14 326 \326 afii10072 all 14 327 \327 afii10073 all 15 330 \330 afii10074 all 15 331 \331 afii10075 all 15 332 \332 afii10076 all 15 333 \333 afii10077 all 16 334 \334 afii10078 all 16 335 \335 afii10079 all 16 336 \336 afii10080 all 16 337 \337 afii10081 all 17 340 \340 afii10082 all 17 341 \341 afii10083 all 17 342 \342 afii10084 all 17 343 \343 afii10085 all 18 344 \344 afii10086 all 18 345 \345 afii10087 all 18 346 \346 afii10088 all 18 347 \347 afii10089 all 19 350 \350 afii10090 all 19 351 \351 afii10091 all 19 352 \352 afii10092 all 19 353 \353 afii10093 all 20 354 \354 afii10094 all 20 355 \355 afii10095 all 20 356 \356 afii10096 all 20 357 \357 afii10097 all 21 360 \360 afii61352 all 21 361 \361 afii10071 all 21 362 \362 afii10099 all 21 363 \363 afii10100 all 22 364 \364 afii10101 all 22 365 \365 afii10102 all 22 366 \366 afii10103 all 22 367 \367 afii10104 all 23 370 \370 afii10105 all 23 371 \371 afii10106 all 23 372 \372 afii10107 all 23 373 \373 afii10108 all 24 374 \374 afii10109 all 24 375 \375 section all 24 376 \376 afii10110 all 24 377 \377 afii10193 pcal-4.11.0/examples/fonttest_greek0000644000175000001440000000553610301204703015464 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_greek # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Greek # force the proper character set encoding opt -C "ISO 8859-7 (Greek) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 afii64937 all 01 242 \242 afii57929 all 01 243 \243 sterling all 02 244 \244 currency all 02 245 \245 yen all 02 246 \246 brokenbar all 02 247 \247 section all 03 250 \250 dieresis all 03 251 \251 copyright all 03 252 \252 ordfeminine all 03 253 \253 guillemotleft all 04 254 \254 logicalnot all 04 255 \255 uni00AD all 04 256 \256 registered all 04 257 \257 afii00208 all 05 260 \260 degree all 05 261 \261 plusminus all 05 262 \262 twosuperior all 05 263 \263 threesuperior all 06 264 \264 tonos all 06 265 \265 dieresistonos all 06 266 \266 Alphatonos all 06 267 \267 periodcentered all 07 270 \270 Epsilontonos all 07 271 \271 Etatonos all 07 272 \272 Iotatonos all 07 273 \273 guillemotright all 08 274 \274 Omicrontonos all 08 275 \275 onehalf all 08 276 \276 Upsilontonos all 08 277 \277 Omegatonos all 09 300 \300 iotadieresistonos all 09 301 \301 Alpha all 09 302 \302 Beta all 09 303 \303 Gamma all 10 304 \304 uni0394 all 10 305 \305 Epsilon all 10 306 \306 Zeta all 10 307 \307 Eta all 11 310 \310 Theta all 11 311 \311 Iota all 11 312 \312 Kappa all 11 313 \313 Lambda all 12 314 \314 Mu all 12 315 \315 Nu all 12 316 \316 Xi all 12 317 \317 Omicron all 13 320 \320 Pi all 13 321 \321 Rho all 13 322 \322 Ograve all 13 323 \323 Sigma all 14 324 \324 Tau all 14 325 \325 Upsilon all 14 326 \326 Phi all 14 327 \327 Chi all 15 330 \330 Psi all 15 331 \331 uni03A9 all 15 332 \332 Iotadieresis all 15 333 \333 Upsilondieresis all 16 334 \334 alphatonos all 16 335 \335 epsilontonos all 16 336 \336 etatonos all 16 337 \337 iotatonos all 17 340 \340 upsilondieresistonos all 17 341 \341 alpha all 17 342 \342 beta all 17 343 \343 gamma all 18 344 \344 delta all 18 345 \345 epsilon all 18 346 \346 zeta all 18 347 \347 eta all 19 350 \350 theta all 19 351 \351 iota all 19 352 \352 kappa all 19 353 \353 lambda all 20 354 \354 uni03BC all 20 355 \355 nu all 20 356 \356 xi all 20 357 \357 omicron all 21 360 \360 pi all 21 361 \361 rho all 21 362 \362 sigma1 all 21 363 \363 sigma all 22 364 \364 tau all 22 365 \365 upsilon all 22 366 \366 phi all 22 367 \367 chi all 23 370 \370 psi all 23 371 \371 omega all 23 372 \372 iotadieresis all 23 373 \373 upsilondieresis all 24 374 \374 omicrontonos all 24 375 \375 upsilontonos all 24 376 \376 omegatonos all 24 377 \377 ydieresis pcal-4.11.0/examples/fonttest_hebrew0000644000175000001440000000107510301204703015635 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_hebrew # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Hebrew # force the proper character set encoding opt -C "ISO 8859-8 (Hebrew) character mappings" # centered 'footer' string # # This encoding is not currently supported by 'pcal'! # ifdef sort else endif pcal-4.11.0/examples/fonttest_koi8r0000644000175000001440000000745310301204703015423 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_koi8r # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r KOI8-R # force the proper character set encoding opt -C "KOI8-R (Russian) character mappings" # centered 'footer' string all 01 200 \200 SF100000 all 01 201 \201 SF110000 all 01 202 \202 SF010000 all 01 203 \203 SF030000 all 02 204 \204 SF020000 all 02 205 \205 SF040000 all 02 206 \206 SF080000 all 02 207 \207 SF090000 all 03 210 \210 SF060000 all 03 211 \211 SF070000 all 03 212 \212 SF050000 all 03 213 \213 upblock all 04 214 \214 dnblock all 04 215 \215 block all 04 216 \216 lfblock all 04 217 \217 rtblock all 05 220 \220 ltshade all 05 221 \221 shade all 05 222 \222 dkshade all 05 223 \223 integraltp all 06 224 \224 filledbox all 06 225 \225 uni2219 all 06 226 \226 radical all 06 227 \227 approxequal all 07 230 \230 lessequal all 07 231 \231 greaterequal all 07 232 \232 uni00A0 all 07 233 \233 integralbt all 08 234 \234 degree all 08 235 \235 twosuperior all 08 236 \236 periodcentered all 08 237 \237 divide all 09 240 \240 SF430000 all 09 241 \241 SF240000 all 09 242 \242 SF510000 all 09 243 \243 afii10071 all 10 244 \244 SF520000 all 10 245 \245 SF390000 all 10 246 \246 SF220000 all 10 247 \247 SF210000 all 11 250 \250 SF250000 all 11 251 \251 SF500000 all 11 252 \252 SF490000 all 11 253 \253 SF380000 all 12 254 \254 SF280000 all 12 255 \255 SF270000 all 12 256 \256 SF260000 all 12 257 \257 SF360000 all 13 260 \260 SF370000 all 13 261 \261 SF420000 all 13 262 \262 SF190000 all 13 263 \263 afii10023 all 13 264 \264 SF200000 all 14 265 \265 SF230000 all 14 266 \266 SF470000 all 14 267 \267 SF480000 all 14 270 \270 SF410000 all 14 271 \271 SF450000 all 15 272 \272 SF460000 all 15 273 \273 SF400000 all 15 274 \274 SF540000 all 15 275 \275 SF530000 all 15 276 \276 SF440000 all 16 277 \277 copyright all 16 300 \300 afii10096 all 16 301 \301 afii10065 all 16 302 \302 afii10066 all 16 303 \303 afii10088 all 17 304 \304 afii10069 all 17 305 \305 afii10070 all 17 306 \306 afii10086 all 17 307 \307 afii10068 all 17 310 \310 afii10087 all 18 311 \311 afii10074 all 18 312 \312 afii10075 all 18 313 \313 afii10076 all 18 314 \314 afii10077 all 18 315 \315 afii10078 all 19 316 \316 afii10079 all 19 317 \317 afii10080 all 19 320 \320 afii10081 all 19 321 \321 afii10097 all 19 322 \322 afii10082 all 20 323 \323 afii10083 all 20 324 \324 afii10084 all 20 325 \325 afii10085 all 20 326 \326 afii10072 all 20 327 \327 afii10067 all 21 330 \330 afii10094 all 21 331 \331 afii10093 all 21 332 \332 afii10073 all 21 333 \333 afii10090 all 21 334 \334 afii10095 all 22 335 \335 afii10091 all 22 336 \336 afii10089 all 22 337 \337 afii10092 all 22 340 \340 afii10048 all 22 341 \341 afii10017 all 23 342 \342 afii10018 all 23 343 \343 afii10040 all 23 344 \344 afii10021 all 23 345 \345 afii10022 all 23 346 \346 afii10038 all 24 347 \347 afii10020 all 24 350 \350 afii10039 all 24 351 \351 afii10026 all 24 352 \352 afii10027 all 24 353 \353 afii10028 all 25 354 \354 afii10029 all 25 355 \355 afii10030 all 25 356 \356 afii10031 all 25 357 \357 afii10032 all 25 360 \360 afii10033 all 26 361 \361 afii10049 all 26 362 \362 afii10034 all 26 363 \363 afii10035 all 26 364 \364 afii10036 all 26 365 \365 afii10037 all 27 366 \366 afii10024 all 27 367 \367 afii10019 all 27 370 \370 afii10046 all 27 371 \371 afii10045 all 27 372 \372 afii10025 all 28 373 \373 afii10042 all 28 374 \374 afii10047 all 28 375 \375 afii10043 all 28 376 \376 afii10041 all 28 377 \377 afii10044 pcal-4.11.0/examples/fonttest_koi8u0000644000175000001440000000747210301204407015430 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_koi8u # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r KOI8-U # force the proper character set encoding opt -C "KOI8-U (Ukrainian) character mappings" # centered 'footer' string all 01 200 \200 SF100000 all 01 201 \201 SF110000 all 01 202 \202 SF010000 all 01 203 \203 SF030000 all 02 204 \204 SF020000 all 02 205 \205 SF040000 all 02 206 \206 SF080000 all 02 207 \207 SF090000 all 03 210 \210 SF060000 all 03 211 \211 SF070000 all 03 212 \212 SF050000 all 03 213 \213 upblock all 04 214 \214 dnblock all 04 215 \215 block all 04 216 \216 lfblock all 04 217 \217 rtblock all 05 220 \220 ltshade all 05 221 \221 shade all 05 222 \222 dkshade all 05 223 \223 integraltp all 06 224 \224 filledbox all 06 225 \225 periodcentered all 06 226 \226 radical all 06 227 \227 approxequal all 07 230 \230 lessequal all 07 231 \231 greaterequal all 07 232 \232 space all 07 233 \233 integralbt all 08 234 \234 degree all 08 235 \235 twosuperior all 08 236 \236 periodcentered all 08 237 \237 divide all 09 240 \240 SF430000 all 09 241 \241 SF240000 all 09 242 \242 SF510000 all 09 243 \243 afii10071 all 10 244 \244 afii10101 all 10 245 \245 SF390000 all 10 246 \246 afii10103 all 10 247 \247 afii10104 all 11 250 \250 SF250000 all 11 251 \251 SF500000 all 11 252 \252 SF490000 all 11 253 \253 SF380000 all 12 254 \254 SF280000 all 12 255 \255 afii10098 all 12 256 \256 SF260000 all 12 257 \257 SF360000 all 13 260 \260 SF370000 all 13 261 \261 SF420000 all 13 262 \262 SF190000 all 13 263 \263 afii10023 all 13 264 \264 afii10053 all 14 265 \265 SF230000 all 14 266 \266 afii10055 all 14 267 \267 afii10056 all 14 270 \270 SF410000 all 14 271 \271 SF450000 all 15 272 \272 SF460000 all 15 273 \273 SF400000 all 15 274 \274 SF540000 all 15 275 \275 afii10050 all 15 276 \276 SF440000 all 16 277 \277 copyright all 16 300 \300 afii10096 all 16 301 \301 afii10065 all 16 302 \302 afii10066 all 16 303 \303 afii10088 all 17 304 \304 afii10069 all 17 305 \305 afii10070 all 17 306 \306 afii10086 all 17 307 \307 afii10068 all 17 310 \310 afii10087 all 18 311 \311 afii10074 all 18 312 \312 afii10075 all 18 313 \313 afii10076 all 18 314 \314 afii10077 all 18 315 \315 afii10078 all 19 316 \316 afii10079 all 19 317 \317 afii10080 all 19 320 \320 afii10081 all 19 321 \321 afii10097 all 19 322 \322 afii10082 all 20 323 \323 afii10083 all 20 324 \324 afii10084 all 20 325 \325 afii10085 all 20 326 \326 afii10072 all 20 327 \327 afii10067 all 21 330 \330 afii10094 all 21 331 \331 afii10093 all 21 332 \332 afii10073 all 21 333 \333 afii10090 all 21 334 \334 afii10095 all 22 335 \335 afii10091 all 22 336 \336 afii10089 all 22 337 \337 afii10092 all 22 340 \340 afii10048 all 22 341 \341 afii10017 all 23 342 \342 afii10018 all 23 343 \343 afii10040 all 23 344 \344 afii10021 all 23 345 \345 afii10022 all 23 346 \346 afii10038 all 24 347 \347 afii10020 all 24 350 \350 afii10039 all 24 351 \351 afii10026 all 24 352 \352 afii10027 all 24 353 \353 afii10028 all 25 354 \354 afii10029 all 25 355 \355 afii10030 all 25 356 \356 afii10031 all 25 357 \357 afii10032 all 25 360 \360 afii10033 all 26 361 \361 afii10049 all 26 362 \362 afii10034 all 26 363 \363 afii10035 all 26 364 \364 afii10036 all 26 365 \365 afii10037 all 27 366 \366 afii10024 all 27 367 \367 afii10019 all 27 370 \370 afii10046 all 27 371 \371 afii10045 all 27 372 \372 afii10025 all 28 373 \373 afii10042 all 28 374 \374 afii10047 all 28 375 \375 afii10043 all 28 376 \376 afii10041 all 28 377 \377 afii10044 pcal-4.11.0/examples/fonttest_latin10000644000175000001440000001400110301204703015542 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal [ -D sort ] -f fonttest_latin1 # # The characters are printed in ascending numeric order unless the symbol # "sort" is defined, in which case they are sorted by character name. # # Note that octal codes 231 and 234 are undefined and do not appear when the # characters are sorted by character name. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin1 # force the proper character set encoding opt -C "ISO 8859-1 (Latin1) character mappings" # centered 'footer' string ifdef sort all 01 306 \306 AE all 01 301 \301 Aacute all 01 302 \302 Acircumflex all 01 304 \304 Adieresis all 02 300 \300 Agrave all 02 305 \305 Aring all 02 303 \303 Atilde all 02 307 \307 Ccedilla all 03 311 \311 Eacute all 03 312 \312 Ecircumflex all 03 313 \313 Edieresis all 03 310 \310 Egrave all 04 320 \320 Eth all 04 315 \315 Iacute all 04 316 \316 Icircumflex all 04 317 \317 Idieresis all 05 314 \314 Igrave all 05 321 \321 Ntilde all 05 323 \323 Oacute all 05 324 \324 Ocircumflex all 06 326 \326 Odieresis all 06 322 \322 Ograve all 06 330 \330 Oslash all 06 325 \325 Otilde all 07 336 \336 Thorn all 07 332 \332 Uacute all 07 333 \333 Ucircumflex all 07 334 \334 Udieresis all 08 331 \331 Ugrave all 08 335 \335 Yacute all 08 341 \341 aacute all 08 342 \342 acircumflex all 09 222 \222 acute all 09 264 \264 acute all 09 344 \344 adieresis all 09 346 \346 ae all 10 340 \340 agrave all 10 345 \345 aring all 10 343 \343 atilde all 10 226 \226 breve all 11 246 \246 brokenbar all 11 237 \237 caron all 11 347 \347 ccedilla all 11 233 \233 cedilla all 12 270 \270 cedilla all 12 242 \242 cent all 12 223 \223 circumflex all 12 251 \251 copyright all 13 244 \244 currency all 13 260 \260 degree all 13 230 \230 dieresis all 13 250 \250 dieresis all 14 367 \367 divide all 14 227 \227 dotaccent all 14 351 \351 eacute all 14 352 \352 ecircumflex all 15 353 \353 edieresis all 15 350 \350 egrave all 15 360 \360 eth all 15 241 \241 exclamdown all 16 337 \337 germandbls all 16 221 \221 grave all 16 253 \253 guillemotleft all 16 273 \273 guillemotright all 17 235 \235 hungarumlaut all 17 255 \255 hyphen all 17 355 \355 iacute all 17 356 \356 icircumflex all 18 357 \357 idieresis all 18 354 \354 igrave all 18 254 \254 logicalnot all 18 225 \225 macron all 19 257 \257 macron all 19 265 \265 mu all 19 327 \327 multiply all 19 361 \361 ntilde all 20 363 \363 oacute all 20 364 \364 ocircumflex all 20 366 \366 odieresis all 20 236 \236 ogonek all 21 362 \362 ograve all 21 275 \275 onehalf all 21 274 \274 onequarter all 21 271 \271 onesuperior all 22 252 \252 ordfeminine all 22 272 \272 ordmasculine all 22 370 \370 oslash all 22 365 \365 otilde all 23 266 \266 paragraph all 23 267 \267 periodcentered all 23 261 \261 plusminus all 23 277 \277 questiondown all 24 256 \256 registered all 24 232 \232 ring all 24 247 \247 section all 24 240 \240 space all 25 243 \243 sterling all 25 376 \376 thorn all 25 276 \276 threequarters all 25 263 \263 threesuperior all 26 224 \224 tilde all 26 262 \262 twosuperior all 26 372 \372 uacute all 26 373 \373 ucircumflex all 27 374 \374 udieresis all 27 371 \371 ugrave all 27 375 \375 yacute all 27 377 \377 ydieresis all 28 245 \245 yen else all 01 221 \221 grave all 01 222 \222 acute all 01 223 \223 circumflex all 01 224 \224 tilde all 02 225 \225 macron all 02 226 \226 breve all 02 227 \227 dotaccent all 02 230 \230 dieresis all 03 231 \231 .notdef all 03 232 \232 ring all 03 233 \233 cedilla all 03 234 \234 .notdef all 04 235 \235 hungarumlaut all 04 236 \236 ogonek all 04 237 \237 caron all 04 240 \240 space all 05 241 \241 exclamdown all 05 242 \242 cent all 05 243 \243 sterling all 05 244 \244 currency all 06 245 \245 yen all 06 246 \246 brokenbar all 06 247 \247 section all 06 250 \250 dieresis all 07 251 \251 copyright all 07 252 \252 ordfeminine all 07 253 \253 guillemotleft all 07 254 \254 logicalnot all 08 255 \255 hyphen all 08 256 \256 registered all 08 257 \257 macron all 08 260 \260 degree all 09 261 \261 plusminus all 09 262 \262 twosuperior all 09 263 \263 threesuperior all 09 264 \264 acute all 10 265 \265 mu all 10 266 \266 paragraph all 10 267 \267 periodcentered all 10 270 \270 cedilla all 11 271 \271 onesuperior all 11 272 \272 ordmasculine all 11 273 \273 guillemotright all 11 274 \274 onequarter all 12 275 \275 onehalf all 12 276 \276 threequarters all 12 277 \277 questiondown all 12 300 \300 Agrave all 13 301 \301 Aacute all 13 302 \302 Acircumflex all 13 303 \303 Atilde all 13 304 \304 Adieresis all 14 305 \305 Aring all 14 306 \306 AE all 14 307 \307 Ccedilla all 14 310 \310 Egrave all 15 311 \311 Eacute all 15 312 \312 Ecircumflex all 15 313 \313 Edieresis all 15 314 \314 Igrave all 16 315 \315 Iacute all 16 316 \316 Icircumflex all 16 317 \317 Idieresis all 16 320 \320 Eth all 17 321 \321 Ntilde all 17 322 \322 Ograve all 17 323 \323 Oacute all 17 324 \324 Ocircumflex all 18 325 \325 Otilde all 18 326 \326 Odieresis all 18 327 \327 multiply all 18 330 \330 Oslash all 19 331 \331 Ugrave all 19 332 \332 Uacute all 19 333 \333 Ucircumflex all 19 334 \334 Udieresis all 20 335 \335 Yacute all 20 336 \336 Thorn all 20 337 \337 germandbls all 20 340 \340 agrave all 21 341 \341 aacute all 21 342 \342 acircumflex all 21 343 \343 atilde all 21 344 \344 adieresis all 22 345 \345 aring all 22 346 \346 ae all 22 347 \347 ccedilla all 22 350 \350 egrave all 23 351 \351 eacute all 23 352 \352 ecircumflex all 23 353 \353 edieresis all 23 354 \354 igrave all 24 355 \355 iacute all 24 356 \356 icircumflex all 24 357 \357 idieresis all 24 360 \360 eth all 25 361 \361 ntilde all 25 362 \362 ograve all 25 363 \363 oacute all 25 364 \364 ocircumflex all 26 365 \365 otilde all 26 366 \366 odieresis all 26 367 \367 divide all 26 370 \370 oslash all 27 371 \371 ugrave all 27 372 \372 uacute all 27 373 \373 ucircumflex all 27 374 \374 udieresis all 28 375 \375 yacute all 28 376 \376 thorn all 28 377 \377 ydieresis endif pcal-4.11.0/examples/fonttest_latin100000644000175000001440000000107710301204703015633 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_latin10 # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin10 # force the proper character set encoding opt -C "ISO 8859-16 (Latin10) character mappings" # centered 'footer' string # # This encoding is not currently supported by 'pcal'! # ifdef sort else endif pcal-4.11.0/examples/fonttest_latin20000644000175000001440000000554510301204703015560 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_latin2 # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin2 # force the proper character set encoding opt -C "ISO 8859-2 (Latin2) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 Aogonek all 01 242 \242 breve all 01 243 \243 Lslash all 02 244 \244 currency all 02 245 \245 Lcaron all 02 246 \246 Sacute all 02 247 \247 section all 03 250 \250 dieresis all 03 251 \251 Scaron all 03 252 \252 Scedilla all 03 253 \253 Tcaron all 04 254 \254 Zacute all 04 255 \255 uni00AD all 04 256 \256 Zcaron all 04 257 \257 Zdotaccent all 05 260 \260 degree all 05 261 \261 aogonek all 05 262 \262 ogonek all 05 263 \263 lslash all 06 264 \264 acute all 06 265 \265 lcaron all 06 266 \266 sacute all 06 267 \267 caron all 07 270 \270 cedilla all 07 271 \271 scaron all 07 272 \272 scedilla all 07 273 \273 tcaron all 08 274 \274 zacute all 08 275 \275 hungarumlaut all 08 276 \276 zcaron all 08 277 \277 zdotaccent all 09 300 \300 Racute all 09 301 \301 Aacute all 09 302 \302 Acircumflex all 09 303 \303 Abreve all 10 304 \304 Adieresis all 10 305 \305 Lacute all 10 306 \306 Cacute all 10 307 \307 Ccedilla all 11 310 \310 Ccaron all 11 311 \311 Eacute all 11 312 \312 Eogonek all 11 313 \313 Edieresis all 12 314 \314 Ecaron all 12 315 \315 Iacute all 12 316 \316 Icircumflex all 12 317 \317 Dcaron all 13 320 \320 Dcroat all 13 321 \321 Nacute all 13 322 \322 Ncaron all 13 323 \323 Oacute all 14 324 \324 Ocircumflex all 14 325 \325 Ohungarumlaut all 14 326 \326 Odieresis all 14 327 \327 multiply all 15 330 \330 Rcaron all 15 331 \331 Uring all 15 332 \332 Uacute all 15 333 \333 Uhungarumlaut all 16 334 \334 Udieresis all 16 335 \335 Yacute all 16 336 \336 uni0162 all 16 337 \337 germandbls all 17 340 \340 racute all 17 341 \341 aacute all 17 342 \342 acircumflex all 17 343 \343 abreve all 18 344 \344 adieresis all 18 345 \345 lacute all 18 346 \346 cacute all 18 347 \347 ccedilla all 19 350 \350 ccaron all 19 351 \351 eacute all 19 352 \352 eogonek all 19 353 \353 edieresis all 20 354 \354 ecaron all 20 355 \355 iacute all 20 356 \356 icircumflex all 20 357 \357 dcaron all 21 360 \360 dcroat all 21 361 \361 nacute all 21 362 \362 ncaron all 21 363 \363 oacute all 22 364 \364 ocircumflex all 22 365 \365 ohungarumlaut all 22 366 \366 odieresis all 22 367 \367 divide all 23 370 \370 rcaron all 23 371 \371 uring all 23 372 \372 uacute all 23 373 \373 uhungarumlaut all 24 374 \374 udieresis all 24 375 \375 yacute all 24 376 \376 uni0163 all 24 377 \377 dotaccent pcal-4.11.0/examples/fonttest_latin30000644000175000001440000000566310301204703015562 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_latin3 # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin3 # force the proper character set encoding opt -C "ISO 8859-3 (Latin3) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 Hbar all 01 242 \242 breve all 01 243 \243 sterling all 02 244 \244 currency all 02 245 \245 yen all 02 246 \246 Hcircumflex all 02 247 \247 section all 03 250 \250 dieresis all 03 251 \251 Idotaccent all 03 252 \252 Scedilla all 03 253 \253 Gbreve all 04 254 \254 Jcircumflex all 04 255 \255 uni00AD all 04 256 \256 registered all 04 257 \257 Zdotaccent all 05 260 \260 degree all 05 261 \261 hbar all 05 262 \262 twosuperior all 05 263 \263 threesuperior all 06 264 \264 acute all 06 265 \265 mu all 06 266 \266 hcircumflex all 06 267 \267 periodcentered all 07 270 \270 cedilla all 07 271 \271 dotlessi all 07 272 \272 scedilla all 07 273 \273 gbreve all 08 274 \274 jcircumflex all 08 275 \275 onehalf all 08 276 \276 threequarters all 08 277 \277 zdotaccent all 09 300 \300 Agrave all 09 301 \301 Aacute all 09 302 \302 Acircumflex all 09 303 \303 Atilde all 10 304 \304 Adieresis all 10 305 \305 Cdotaccent all 10 306 \306 Ccircumflex all 10 307 \307 Ccedilla all 11 310 \310 Egrave all 11 311 \311 Eacute all 11 312 \312 Ecircumflex all 11 313 \313 Edieresis all 12 314 \314 Igrave all 12 315 \315 Iacute all 12 316 \316 Icircumflex all 12 317 \317 Idieresis all 13 320 \320 Eth all 13 321 \321 Ntilde all 13 322 \322 Ograve all 13 323 \323 Oacute all 14 324 \324 Ocircumflex all 14 325 \325 Gdotaccent all 14 326 \326 Odieresis all 14 327 \327 multiply all 15 330 \330 Gcircumflex all 15 331 \331 Ugrave all 15 332 \332 Uacute all 15 333 \333 Ucircumflex all 16 334 \334 Udieresis all 16 335 \335 Ubreve all 16 336 \336 Scircumflex all 16 337 \337 germandbls all 17 340 \340 agrave all 17 341 \341 aacute all 17 342 \342 acircumflex all 17 343 \343 atilde all 18 344 \344 adieresis all 18 345 \345 cdotaccent all 18 346 \346 ccircumflex all 18 347 \347 ccedilla all 19 350 \350 egrave all 19 351 \351 eacute all 19 352 \352 ecircumflex all 19 353 \353 edieresis all 20 354 \354 igrave all 20 355 \355 iacute all 20 356 \356 icircumflex all 20 357 \357 idieresis all 21 360 \360 eth all 21 361 \361 ntilde all 21 362 \362 ograve all 21 363 \363 oacute all 22 364 \364 ocircumflex all 22 365 \365 gdotaccent all 22 366 \366 odieresis all 22 367 \367 divide all 23 370 \370 gcircumflex all 23 371 \371 ugrave all 23 372 \372 uacute all 23 373 \373 ucircumflex all 24 374 \374 udieresis all 24 375 \375 ubreve all 24 376 \376 scircumflex all 24 377 \377 dotaccent pcal-4.11.0/examples/fonttest_latin40000644000175000001440000000560210301204703015554 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_latin4 # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin4 # force the proper character set encoding opt -C "ISO 8859-4 (Latin4) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 Aogonek all 01 242 \242 kgreenlandic all 01 243 \243 Rcommaaccent all 02 244 \244 currency all 02 245 \245 Itilde all 02 246 \246 Lcommaaccent all 02 247 \247 section all 03 250 \250 dieresis all 03 251 \251 Scaron all 03 252 \252 Emacron all 03 253 \253 Gcommaaccent all 04 254 \254 Tbar all 04 255 \255 uni00AD all 04 256 \256 Zcaron all 04 257 \257 macron all 05 260 \260 degree all 05 261 \261 aogonek all 05 262 \262 ogonek all 05 263 \263 rcommaaccent all 06 264 \264 acute all 06 265 \265 itilde all 06 266 \266 lcommaaccent all 06 267 \267 caron all 07 270 \270 cedilla all 07 271 \271 scaron all 07 272 \272 emacron all 07 273 \273 gcommaaccent all 08 274 \274 tbar all 08 275 \275 Eng all 08 276 \276 zcaron all 08 277 \277 eng all 09 300 \300 Amacron all 09 301 \301 Aacute all 09 302 \302 Acircumflex all 09 303 \303 Atilde all 10 304 \304 Adieresis all 10 305 \305 Aring all 10 306 \306 AE all 10 307 \307 Iogonek all 11 310 \310 Ccaron all 11 311 \311 Eacute all 11 312 \312 Eogonek all 11 313 \313 Edieresis all 12 314 \314 Edotaccent all 12 315 \315 Iacute all 12 316 \316 Icircumflex all 12 317 \317 Imacron all 13 320 \320 Dcroat all 13 321 \321 Ncommaaccent all 13 322 \322 Omacron all 13 323 \323 Kcommaaccent all 14 324 \324 Ocircumflex all 14 325 \325 Otilde all 14 326 \326 Odieresis all 14 327 \327 multiply all 15 330 \330 Oslash all 15 331 \331 Uogonek all 15 332 \332 Uacute all 15 333 \333 Ucircumflex all 16 334 \334 Udieresis all 16 335 \335 Utilde all 16 336 \336 Umacron all 16 337 \337 germandbls all 17 340 \340 amacron all 17 341 \341 aacute all 17 342 \342 acircumflex all 17 343 \343 atilde all 18 344 \344 adieresis all 18 345 \345 aring all 18 346 \346 ae all 18 347 \347 iogonek all 19 350 \350 ccaron all 19 351 \351 eacute all 19 352 \352 eogonek all 19 353 \353 edieresis all 20 354 \354 edotaccent all 20 355 \355 iacute all 20 356 \356 icircumflex all 20 357 \357 imacron all 21 360 \360 dcroat all 21 361 \361 ncommaaccent all 21 362 \362 omacron all 21 363 \363 kcommaaccent all 22 364 \364 ocircumflex all 22 365 \365 otilde all 22 366 \366 odieresis all 22 367 \367 divide all 23 370 \370 oslash all 23 371 \371 uogonek all 23 372 \372 uacute all 23 373 \373 ucircumflex all 24 374 \374 udieresis all 24 375 \375 utilde all 24 376 \376 umacron all 24 377 \377 dotaccent pcal-4.11.0/examples/fonttest_latin50000644000175000001440000000564510301204703015564 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_latin5 # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin5 # force the proper character set encoding opt -C "ISO 8859-9 (Latin5) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 exclamdown all 01 242 \242 cent all 01 243 \243 sterling all 02 244 \244 currency all 02 245 \245 yen all 02 246 \246 brokenbar all 02 247 \247 section all 03 250 \250 dieresis all 03 251 \251 copyright all 03 252 \252 ordfeminine all 03 253 \253 guillemotleft all 04 254 \254 logicalnot all 04 255 \255 uni00AD all 04 256 \256 registered all 04 257 \257 macron all 05 260 \260 degree all 05 261 \261 plusminus all 05 262 \262 twosuperior all 05 263 \263 threesuperior all 06 264 \264 acute all 06 265 \265 mu all 06 266 \266 paragraph all 06 267 \267 periodcentered all 07 270 \270 cedilla all 07 271 \271 onesuperior all 07 272 \272 ordmasculine all 07 273 \273 guillemotright all 08 274 \274 onequarter all 08 275 \275 onehalf all 08 276 \276 threequarters all 08 277 \277 questiondown all 09 300 \300 Agrave all 09 301 \301 Aacute all 09 302 \302 Acircumflex all 09 303 \303 Atilde all 10 304 \304 Adieresis all 10 305 \305 Aring all 10 306 \306 AE all 10 307 \307 Ccedilla all 11 310 \310 Egrave all 11 311 \311 Eacute all 11 312 \312 Ecircumflex all 11 313 \313 Edieresis all 12 314 \314 Igrave all 12 315 \315 Iacute all 12 316 \316 Icircumflex all 12 317 \317 Idieresis all 13 320 \320 Gbreve all 13 321 \321 Ntilde all 13 322 \322 Ograve all 13 323 \323 Oacute all 14 324 \324 Ocircumflex all 14 325 \325 Otilde all 14 326 \326 Odieresis all 14 327 \327 multiply all 15 330 \330 Oslash all 15 331 \331 Ugrave all 15 332 \332 Uacute all 15 333 \333 Ucircumflex all 16 334 \334 Udieresis all 16 335 \335 Idotaccent all 16 336 \336 Scedilla all 16 337 \337 germandbls all 17 340 \340 agrave all 17 341 \341 aacute all 17 342 \342 acircumflex all 17 343 \343 atilde all 18 344 \344 adieresis all 18 345 \345 aring all 18 346 \346 ae all 18 347 \347 ccedilla all 19 350 \350 egrave all 19 351 \351 eacute all 19 352 \352 ecircumflex all 19 353 \353 edieresis all 20 354 \354 igrave all 20 355 \355 iacute all 20 356 \356 icircumflex all 20 357 \357 idieresis all 21 360 \360 gbreve all 21 361 \361 ntilde all 21 362 \362 ograve all 21 363 \363 oacute all 22 364 \364 ocircumflex all 22 365 \365 otilde all 22 366 \366 odieresis all 22 367 \367 divide all 23 370 \370 oslash all 23 371 \371 ugrave all 23 372 \372 uacute all 23 373 \373 ucircumflex all 24 374 \374 udieresis all 24 375 \375 dotlessi all 24 376 \376 scedilla all 24 377 \377 ydieresis pcal-4.11.0/examples/fonttest_latin60000644000175000001440000000555710301204703015567 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_latin6 # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin6 # force the proper character set encoding opt -C "ISO 8859-10 (Latin6) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 Aogonek all 01 242 \242 Emacron all 01 243 \243 Gcommaaccent all 02 244 \244 Imacron all 02 245 \245 Itilde all 02 246 \246 Kcommaaccent all 02 247 \247 section all 03 250 \250 Lcommaaccent all 03 251 \251 Dcroat all 03 252 \252 Scaron all 03 253 \253 Tbar all 04 254 \254 Zcaron all 04 255 \255 uni00AD all 04 256 \256 Umacron all 04 257 \257 Eng all 05 260 \260 degree all 05 261 \261 aogonek all 05 262 \262 emacron all 05 263 \263 gcommaaccent all 06 264 \264 imacron all 06 265 \265 itilde all 06 266 \266 kcommaaccent all 06 267 \267 periodcentered all 07 270 \270 lcommaaccent all 07 271 \271 dcroat all 07 272 \272 scaron all 07 273 \273 tbar all 08 274 \274 zcaron all 08 275 \275 macron all 08 276 \276 umacron all 08 277 \277 eng all 09 300 \300 Amacron all 09 301 \301 Aacute all 09 302 \302 Acircumflex all 09 303 \303 Atilde all 10 304 \304 Adieresis all 10 305 \305 Aring all 10 306 \306 AE all 10 307 \307 Iogonek all 11 310 \310 Ccaron all 11 311 \311 Eacute all 11 312 \312 Eogonek all 11 313 \313 Edieresis all 12 314 \314 Emacron all 12 315 \315 Iacute all 12 316 \316 Icircumflex all 12 317 \317 Idieresis all 13 320 \320 Eth all 13 321 \321 Ncommaaccent all 13 322 \322 Omacron all 13 323 \323 Oacute all 14 324 \324 Ocircumflex all 14 325 \325 Otilde all 14 326 \326 Odieresis all 14 327 \327 Utilde all 15 330 \330 Oslash all 15 331 \331 Uogonek all 15 332 \332 Uacute all 15 333 \333 Ucircumflex all 16 334 \334 Udieresis all 16 335 \335 Yacute all 16 336 \336 Thorn all 16 337 \337 germandbls all 17 340 \340 amacron all 17 341 \341 aacute all 17 342 \342 acircumflex all 17 343 \343 atilde all 18 344 \344 adieresis all 18 345 \345 aring all 18 346 \346 ae all 18 347 \347 iogonek all 19 350 \350 ccaron all 19 351 \351 eacute all 19 352 \352 eogonek all 19 353 \353 edieresis all 20 354 \354 emacron all 20 355 \355 iacute all 20 356 \356 icircumflex all 20 357 \357 idieresis all 21 360 \360 eth all 21 361 \361 ncommaaccent all 21 362 \362 omacron all 21 363 \363 oacute all 22 364 \364 ocircumflex all 22 365 \365 otilde all 22 366 \366 odieresis all 22 367 \367 utilde all 23 370 \370 oslash all 23 371 \371 uogonek all 23 372 \372 uacute all 23 373 \373 ucircumflex all 24 374 \374 udieresis all 24 375 \375 yacute all 24 376 \376 thorn all 24 377 \377 kgreenlandic pcal-4.11.0/examples/fonttest_latin70000644000175000001440000000567310301204703015567 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_latin7 # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin7 # force the proper character set encoding opt -C "ISO 8859-13 (Latin7) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 quotedblright all 01 242 \242 cent all 01 243 \243 sterling all 02 244 \244 currency all 02 245 \245 quotedblbase all 02 246 \246 brokenbar all 02 247 \247 section all 03 250 \250 Oslash all 03 251 \251 copyright all 03 252 \252 rcommaaccent all 03 253 \253 guillemotleft all 04 254 \254 logicalnot all 04 255 \255 uni00AD all 04 256 \256 registered all 04 257 \257 AE all 05 260 \260 degree all 05 261 \261 plusminus all 05 262 \262 twosuperior all 05 263 \263 threesuperior all 06 264 \264 quotedblleft all 06 265 \265 mu all 06 266 \266 paragraph all 06 267 \267 periodcentered all 07 270 \270 oslash all 07 271 \271 onesuperior all 07 272 \272 .notdef all 07 273 \273 guillemotright all 08 274 \274 onequarter all 08 275 \275 onehalf all 08 276 \276 threequarters all 08 277 \277 ae all 09 300 \300 Aogonek all 09 301 \301 Iogonek all 09 302 \302 Amacron all 09 303 \303 Cacute all 10 304 \304 Adieresis all 10 305 \305 Aring all 10 306 \306 Eogonek all 10 307 \307 Emacron all 11 310 \310 Ccaron all 11 311 \311 Eacute all 11 312 \312 Zacute all 11 313 \313 Edotaccent all 12 314 \314 Gcommaaccent all 12 315 \315 Kcommaaccent all 12 316 \316 Imacron all 12 317 \317 Lcommaaccent all 13 320 \320 Scaron all 13 321 \321 Nacute all 13 322 \322 Ncommaaccent all 13 323 \323 Oacute all 14 324 \324 Omacron all 14 325 \325 Otilde all 14 326 \326 Odieresis all 14 327 \327 multiply all 15 330 \330 Uogonek all 15 331 \331 Lslash all 15 332 \332 Uacute all 15 333 \333 Ucircumflex all 16 334 \334 Udieresis all 16 335 \335 Zdotaccent all 16 336 \336 Zcaron all 16 337 \337 germandbls all 17 340 \340 aogonek all 17 341 \341 Iogonek all 17 342 \342 amacron all 17 343 \343 cacute all 18 344 \344 adieresis all 18 345 \345 aring all 18 346 \346 eogonek all 18 347 \347 emacron all 19 350 \350 ccaron all 19 351 \351 eacute all 19 352 \352 zacute all 19 353 \353 edotaccent all 20 354 \354 gcommaaccent all 20 355 \355 kcommaaccent all 20 356 \356 imacron all 20 357 \357 lcommaaccent all 21 360 \360 scaron all 21 361 \361 nacute all 21 362 \362 ncommaaccent all 21 363 \363 oacute all 22 364 \364 omacron all 22 365 \365 otilde all 22 366 \366 odieresis all 22 367 \367 divide all 23 370 \370 uogonek all 23 371 \371 lslash all 23 372 \372 uacute all 23 373 \373 ucircumflex all 24 374 \374 udieresis all 24 375 \375 zdotaccent all 24 376 \376 zcaron all 24 377 \377 quoteright pcal-4.11.0/examples/fonttest_latin80000644000175000001440000000560710301204703015565 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_latin8 # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin8 # force the proper character set encoding opt -C "ISO 8859-14 (Latin8) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 uni1E02 all 01 242 \242 uni1E03 all 01 243 \243 sterling all 02 244 \244 Cdotaccent all 02 245 \245 cdotaccent all 02 246 \246 uni1E0A all 02 247 \247 section all 03 250 \250 Wgrave all 03 251 \251 copyright all 03 252 \252 Wacute all 03 253 \253 uni1E0B all 04 254 \254 Ygrave all 04 255 \255 uni00AD all 04 256 \256 registered all 04 257 \257 Ydieresis all 05 260 \260 uni1E1E all 05 261 \261 uni1E1F all 05 262 \262 Gdotaccent all 05 263 \263 gdotaccent all 06 264 \264 uni1E40 all 06 265 \265 uni1E41 all 06 266 \266 paragraph all 06 267 \267 uni1E56 all 07 270 \270 wgrave all 07 271 \271 uni1E57 all 07 272 \272 wacute all 07 273 \273 uni1E60 all 08 274 \274 ygrave all 08 275 \275 Wdieresis all 08 276 \276 wdieresis all 08 277 \277 uni1E61 all 09 300 \300 Agrave all 09 301 \301 Aacute all 09 302 \302 Acircumflex all 09 303 \303 Atilde all 10 304 \304 Adieresis all 10 305 \305 Aring all 10 306 \306 AE all 10 307 \307 Ccedilla all 11 310 \310 Egrave all 11 311 \311 Eacute all 11 312 \312 Ecircumflex all 11 313 \313 Edieresis all 12 314 \314 Igrave all 12 315 \315 Iacute all 12 316 \316 Icircumflex all 12 317 \317 Idieresis all 13 320 \320 Wcircumflex all 13 321 \321 Ntilde all 13 322 \322 Ograve all 13 323 \323 Oacute all 14 324 \324 Ocircumflex all 14 325 \325 Otilde all 14 326 \326 Odieresis all 14 327 \327 uni1E6A all 15 330 \330 Oslash all 15 331 \331 Ugrave all 15 332 \332 Uacute all 15 333 \333 Ucircumflex all 16 334 \334 Udieresis all 16 335 \335 Yacute all 16 336 \336 Ycircumflex all 16 337 \337 germandbls all 17 340 \340 agrave all 17 341 \341 aacute all 17 342 \342 acircumflex all 17 343 \343 atilde all 18 344 \344 adieresis all 18 345 \345 aring all 18 346 \346 ae all 18 347 \347 ccedilla all 19 350 \350 egrave all 19 351 \351 eacute all 19 352 \352 ecircumflex all 19 353 \353 edieresis all 20 354 \354 igrave all 20 355 \355 iacute all 20 356 \356 icircumflex all 20 357 \357 idieresis all 21 360 \360 wcircumflex all 21 361 \361 ntilde all 21 362 \362 ograve all 21 363 \363 oacute all 22 364 \364 ocircumflex all 22 365 \365 otilde all 22 366 \366 odieresis all 22 367 \367 uni1E6B all 23 370 \370 oslash all 23 371 \371 ugrave all 23 372 \372 uacute all 23 373 \373 ucircumflex all 24 374 \374 udieresis all 24 375 \375 yacute all 24 376 \376 ycircumflex all 24 377 \377 ydieresis pcal-4.11.0/examples/fonttest_latin90000644000175000001440000000560510301204703015564 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_latin9 # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Latin9 # force the proper character set encoding opt -C "ISO 8859-15 (Latin9 aka Latin0) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 exclamdown all 01 242 \242 cent all 01 243 \243 sterling all 02 244 \244 Euro all 02 245 \245 yen all 02 246 \246 Scaron all 02 247 \247 section all 03 250 \250 scaron all 03 251 \251 copyright all 03 252 \252 ordfeminine all 03 253 \253 guillemotleft all 04 254 \254 logicalnot all 04 255 \255 uni00AD all 04 256 \256 registered all 04 257 \257 macron all 05 260 \260 degree all 05 261 \261 plusminus all 05 262 \262 twosuperior all 05 263 \263 threesuperior all 06 264 \264 Zcaron all 06 265 \265 mu all 06 266 \266 paragraph all 06 267 \267 periodcentered all 07 270 \270 zcaron all 07 271 \271 onesuperior all 07 272 \272 ordmasculine all 07 273 \273 guillemotright all 08 274 \274 OE all 08 275 \275 oe all 08 276 \276 Ydieresis all 08 277 \277 questiondown all 09 300 \300 Agrave all 09 301 \301 Aacute all 09 302 \302 Acircumflex all 09 303 \303 Atilde all 10 304 \304 Adieresis all 10 305 \305 Aring all 10 306 \306 AE all 10 307 \307 Ccedilla all 11 310 \310 Egrave all 11 311 \311 Eacute all 11 312 \312 Ecircumflex all 11 313 \313 Edieresis all 12 314 \314 Igrave all 12 315 \315 Iacute all 12 316 \316 Icircumflex all 12 317 \317 Idieresis all 13 320 \320 Eth all 13 321 \321 Ntilde all 13 322 \322 Ograve all 13 323 \323 Oacute all 14 324 \324 Ocircumflex all 14 325 \325 Otilde all 14 326 \326 Odieresis all 14 327 \327 multiply all 15 330 \330 Oslash all 15 331 \331 Ugrave all 15 332 \332 Uacute all 15 333 \333 Ucircumflex all 16 334 \334 Udieresis all 16 335 \335 Yacute all 16 336 \336 Thorn all 16 337 \337 germandbls all 17 340 \340 agrave all 17 341 \341 aacute all 17 342 \342 acircumflex all 17 343 \343 atilde all 18 344 \344 adieresis all 18 345 \345 aring all 18 346 \346 ae all 18 347 \347 ccedilla all 19 350 \350 egrave all 19 351 \351 eacute all 19 352 \352 ecircumflex all 19 353 \353 edieresis all 20 354 \354 igrave all 20 355 \355 iacute all 20 356 \356 icircumflex all 20 357 \357 idieresis all 21 360 \360 eth all 21 361 \361 ntilde all 21 362 \362 ograve all 21 363 \363 oacute all 22 364 \364 ocircumflex all 22 365 \365 otilde all 22 366 \366 odieresis all 22 367 \367 divide all 23 370 \370 oslash all 23 371 \371 ugrave all 23 372 \372 uacute all 23 373 \373 ucircumflex all 24 374 \374 udieresis all 24 375 \375 yacute all 24 376 \376 thorn all 24 377 \377 ydieresis pcal-4.11.0/examples/fonttest_roman80000644000175000001440000001210710301204703015563 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal [ -D sort ] -f fonttest_roman8 # # The characters are printed in ascending numeric order unless the symbol # "sort" is defined, in which case they are sorted by character name. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Roman8 # force the proper character set encoding opt -C "Roman8 character mappings" # centered 'footer' string ifdef sort all 01 323 \323 AE all 01 340 \340 Aacute all 01 242 \242 Acircumflex all 01 330 \330 Adieresis all 02 241 \241 Agrave all 02 320 \320 Aring all 02 341 \341 Atilde all 02 264 \264 Ccedilla all 03 334 \334 Eacute all 03 244 \244 Ecircumflex all 03 245 \245 Edieresis all 03 243 \243 Egrave all 04 343 \343 Eth all 04 345 \345 Iacute all 04 246 \246 Icircumflex all 04 247 \247 Idieresis all 05 346 \346 Igrave all 05 266 \266 Ntilde all 05 347 \347 Oacute all 05 337 \337 Ocircumflex all 06 332 \332 Odieresis all 06 350 \350 Ograve all 06 322 \322 Oslash all 06 351 \351 Otilde all 07 353 \353 Scaron all 07 361 \361 Thorn all 07 355 \355 Uacute all 07 256 \256 Ucircumflex all 08 333 \333 Udieresis all 08 255 \255 Ugrave all 08 261 \261 Yacute all 08 356 \356 Ydieresis all 09 304 \304 aacute all 09 300 \300 acircumflex all 09 250 \250 acute all 09 314 \314 adieresis all 10 327 \327 ae all 10 310 \310 agrave all 10 324 \324 aring all 10 342 \342 atilde all 11 374 \374 bullet all 11 265 \265 ccedilla all 11 277 \277 cent all 11 252 \252 circumflex all 12 272 \272 currency all 12 263 \263 degree all 12 253 \253 dieresis all 12 362 \362 dotaccent all 13 305 \305 eacute all 13 301 \301 ecircumflex all 13 315 \315 edieresis all 13 311 \311 egrave all 14 344 \344 eth all 14 270 \270 exclamdown all 14 276 \276 florin all 14 336 \336 germandbls all 15 251 \251 grave all 15 373 \373 guillemotleft all 15 375 \375 guillemotright all 15 366 \366 hyphen all 16 325 \325 iacute all 16 321 \321 icircumflex all 16 335 \335 idieresis all 16 331 \331 igrave all 17 260 \260 macron all 17 363 \363 mu all 17 267 \267 ntilde all 17 306 \306 oacute all 18 302 \302 ocircumflex all 18 316 \316 odieresis all 18 312 \312 ograve all 18 370 \370 onehalf all 19 367 \367 onequarter all 19 371 \371 ordfeminine all 19 372 \372 ordmasculine all 19 326 \326 oslash all 20 352 \352 otilde all 20 364 \364 paragraph all 20 376 \376 plusminus all 20 271 \271 questiondown all 21 354 \354 scaron all 21 275 \275 section all 21 257 \257 sterling all 21 273 \273 sterling all 22 360 \360 thorn all 22 365 \365 threequarters all 22 254 \254 tilde all 22 307 \307 uacute all 23 303 \303 ucircumflex all 23 317 \317 udieresis all 23 313 \313 ugrave all 23 262 \262 yacute all 24 357 \357 ydieresis all 24 274 \274 yen else all 01 241 \241 Agrave all 01 242 \242 Acircumflex all 01 243 \243 Egrave all 01 244 \244 Ecircumflex all 02 245 \245 Edieresis all 02 246 \246 Icircumflex all 02 247 \247 Idieresis all 02 250 \250 acute all 03 251 \251 grave all 03 252 \252 circumflex all 03 253 \253 dieresis all 03 254 \254 tilde all 04 255 \255 Ugrave all 04 256 \256 Ucircumflex all 04 257 \257 sterling all 04 260 \260 macron all 05 261 \261 Yacute all 05 262 \262 yacute all 05 263 \263 degree all 05 264 \264 Ccedilla all 06 265 \265 ccedilla all 06 266 \266 Ntilde all 06 267 \267 ntilde all 06 270 \270 exclamdown all 07 271 \271 questiondown all 07 272 \272 currency all 07 273 \273 sterling all 07 274 \274 yen all 08 275 \275 section all 08 276 \276 florin all 08 277 \277 cent all 08 300 \300 acircumflex all 09 301 \301 ecircumflex all 09 302 \302 ocircumflex all 09 303 \303 ucircumflex all 09 304 \304 aacute all 10 305 \305 eacute all 10 306 \306 oacute all 10 307 \307 uacute all 10 310 \310 agrave all 11 311 \311 egrave all 11 312 \312 ograve all 11 313 \313 ugrave all 11 314 \314 adieresis all 12 315 \315 edieresis all 12 316 \316 odieresis all 12 317 \317 udieresis all 12 320 \320 Aring all 13 321 \321 icircumflex all 13 322 \322 Oslash all 13 323 \323 AE all 13 324 \324 aring all 14 325 \325 iacute all 14 326 \326 oslash all 14 327 \327 ae all 14 330 \330 Adieresis all 15 331 \331 igrave all 15 332 \332 Odieresis all 15 333 \333 Udieresis all 15 334 \334 Eacute all 16 335 \335 idieresis all 16 336 \336 germandbls all 16 337 \337 Ocircumflex all 16 340 \340 Aacute all 17 341 \341 Atilde all 17 342 \342 atilde all 17 343 \343 Eth all 17 344 \344 eth all 18 345 \345 Iacute all 18 346 \346 Igrave all 18 347 \347 Oacute all 18 350 \350 Ograve all 19 351 \351 Otilde all 19 352 \352 otilde all 19 353 \353 Scaron all 19 354 \354 scaron all 20 355 \355 Uacute all 20 356 \356 Ydieresis all 20 357 \357 ydieresis all 20 360 \360 thorn all 21 361 \361 Thorn all 21 362 \362 dotaccent all 21 363 \363 mu all 21 364 \364 paragraph all 22 365 \365 threequarters all 22 366 \366 hyphen all 22 367 \367 onequarter all 22 370 \370 onehalf all 23 371 \371 ordfeminine all 23 372 \372 ordmasculine all 23 373 \373 guillemotleft all 23 374 \374 bullet all 24 375 \375 guillemotright all 24 376 \376 plusminus endif pcal-4.11.0/examples/fonttest_thai0000644000175000001440000000550410301204703015307 0ustar wusers# # This is a 'pcal' input file to test character mappings (PostScript 'vector # encodings') for a single character set: # # pcal -f fonttest_thai # # The characters are printed in ascending numeric order. # opt -S # suppress small prev/next monthly calendars opt -B # leave unused boxes blank opt -b all # use black for all days' numerics opt -r Thai # force the proper character set encoding opt -C "ISO 8859-11 (Thai) character mappings" # centered 'footer' string all 01 240 \240 uni00A0 all 01 241 \241 uni0E01 all 01 242 \242 uni0E02 all 01 243 \243 uni0E03 all 02 244 \244 uni0E04 all 02 245 \245 uni0E05 all 02 246 \246 uni0E06 all 02 247 \247 uni0E07 all 03 250 \250 uni0E08 all 03 251 \251 uni0E09 all 03 252 \252 uni0E0A all 03 253 \253 uni0E0B all 04 254 \254 uni0E0C all 04 255 \255 uni0E0D all 04 256 \256 uni0E0E all 04 257 \257 uni0E0F all 05 260 \260 uni0E10 all 05 261 \261 uni0E11 all 05 262 \262 uni0E12 all 05 263 \263 uni0E13 all 06 264 \264 uni0E14 all 06 265 \265 uni0E15 all 06 266 \266 uni0E16 all 06 267 \267 uni0E17 all 07 270 \270 uni0E18 all 07 271 \271 uni0E19 all 07 272 \272 uni0E1A all 07 273 \273 uni0E1B all 08 274 \274 uni0E1C all 08 275 \275 uni0E1D all 08 276 \276 uni0E1E all 08 277 \277 uni0E1F all 09 300 \300 uni0E20 all 09 301 \301 uni0E21 all 09 302 \302 uni0E22 all 09 303 \303 uni0E23 all 10 304 \304 uni0E24 all 10 305 \305 uni0E25 all 10 306 \306 uni0E26 all 10 307 \307 uni0E27 all 11 310 \310 uni0E28 all 11 311 \311 uni0E29 all 11 312 \312 uni0E2A all 11 313 \313 uni0E2B all 12 314 \314 uni0E2C all 12 315 \315 uni0E2D all 12 316 \316 uni0E2E all 12 317 \317 uni0E2F all 13 320 \320 uni0E30 all 13 321 \321 uni0E31 all 13 322 \322 uni0E32 all 13 323 \323 uni0E33 all 14 324 \324 uni0E34 all 14 325 \325 uni0E35 all 14 326 \326 uni0E36 all 14 327 \327 uni0E37 all 15 330 \330 uni0E38 all 15 331 \331 uni0E39 all 15 332 \332 uni0E3A all 15 333 \333 .notdef all 16 334 \334 space all 16 335 \335 .notdef all 16 336 \336 .notdef all 16 337 \337 uni0E3F all 17 340 \340 uni0E40 all 17 341 \341 uni0E41 all 17 342 \342 uni0E42 all 17 343 \343 uni0E43 all 18 344 \344 uni0E44 all 18 345 \345 uni0E45 all 18 346 \346 uni0E46 all 18 347 \347 uni0E47 all 19 350 \350 uni0E48 all 19 351 \351 uni0E49 all 19 352 \352 uni0E4A all 19 353 \353 uni0E4B all 20 354 \354 uni0E4C all 20 355 \355 uni0E4D all 20 356 \356 uni0E4E all 20 357 \357 uni0E4F all 21 360 \360 uni0E50 all 21 361 \361 uni0E51 all 21 362 \362 uni0E52 all 21 363 \363 uni0E53 all 22 364 \364 uni0E54 all 22 365 \365 uni0E55 all 22 366 \366 uni0E56 all 22 367 \367 uni0E57 all 23 370 \370 uni0E58 all 23 371 \371 uni0E59 all 23 372 \372 uni0E5A all 23 373 \373 .notdef all 24 374 \374 .notdef all 24 375 \375 .notdef all 24 376 \376 .notdef all 24 377 \377 .notdef pcal-4.11.0/examples/pcal-cfg.txt0000644000175000001440000002762010732017670014746 0ustar wusers# ----------------------------------------------------------------------------- # # This file contains examples of various options, directives, and event # definitions for the 'pcal' calendar-generation program: # # http://pcal.sourceforge.net # # For full details on the available commands and the associated syntax, # view the 'pcal.man' file (or one of the 'pcal-help.*' files which are # generated from the 'man' page) using an appropriate viewer application. # # Revision History: # # 4.11.0 # # 2007-12-15 -- changes by Bill Marr (marr99@users.sourceforge.net): # # Account for the new version number in areas that check it. # # Fix Daylight Saving Time start/end dates to account for new rules in # United States, starting in 2007. # # Add 2 new languages. # # Allow "Friday the 13th" event specification using both old (now # obsolete) and new methods. # # Clarify comment associated with example of '-m' (moon icons) option. # # Add the project URL to the header comment section. # # Add various enhancements. # # Fix some minor comment errors. # # 4.10.0 # # 2006-08-05 -- changes by Bill Marr (marr99@users.sourceforge.net): # # Account for the new version number in areas that check it. # # Add 4 new languages. # # 4.9.0 # # 2005-08-10 -- changes by Bill Marr (marr99@users.sourceforge.net): # # Account for the new version number in areas that check it. # # Add 3 new languages. # # Add useful examples for the 'nearest' keyword and for display of a # week number, both based on ideas taken from sample calendars provided # by users. # # Add an example for the new 'delete' keyword, to demonstrate the # deletion of specific events. # # 4.8.0 # # 2004-12-05 -- changes by Bill Marr (marr99@users.sourceforge.net): # # Created this file with useful examples of various 'pcal' configuration # options. # # ----------------------------------------------------------------------------- # # Define the paper size... # # 'Letter' = 8.5 x 11.0 inches # 'Legal' = 8.5 x 14.0 inches # 'A4' = 210 x 297 mm # 'Tabloid' (aka 'Ledger') = 11.0 x 17.0 inches # opt -P letter ### opt -P legal ### opt -P a4 ### opt -P tabloid # # Select alternate fonts... # # (Try the Helvetica fonts if your printer doesn't support AvantGarde.) # -d = date numbers font # -t = title (at page top) font # -n = notes (in day boxes and 'Notes' box) font # ### opt -d AvantGarde-Book/30 -t AvantGarde-Book -n Helvetica/8 ### opt -d Helvetica-Bold/30 -t Helvetica-Bold -n Helvetica/8 opt -d Times-Roman/18 -t Times-Roman/30 -n Times-Roman/8 # # Display moon phase icons on every day of the month. # # Beginning with version 4.11.0, this works on yearly-format (1 year per page) # calendars too. But it can be disabled as shown below. # ifndef whole_year opt -M endif # # Display moon phase icons only on the days when the moon is at the 'new', # 'first quarter', 'full', or 'last quarter' stage. # # Beginning with version 4.11.0, this works on yearly-format (1 year per page) # calendars too. # ### opt -m # # Display Julian dates (numeric sequence of days in year) on every day of a # monthly calendar. # # Beginning with version 4.11.0, this works on yearly-format (1 year per page) # calendars too. # # opt -j # # Display Julian dates and 'days remaining in year' on every day of a monthly # calendar. # # Beginning with version 4.11.0, this works on yearly-format (1 year per page) # calendars too. But it can be disabled as shown below. # ifndef whole_year opt -J endif # # Interpret dates in this file as 'American' style. # opt -A # # Interpret dates in this file as 'European' style. # # opt -E # # Override the default colors for the 'date numerics' (i.e. the numbers # printed in the day box) (enabled with the '-g', '-G', or '-O' options) and # for the fill color of empty (unused) 'day' boxes. # opt -s 1.0:0.0:0.0/1.0:1.0:0.8 # red numerals / light yellowish boxes # # This directive causes the following entries to apply to every year, rather # than just applying to the current year. # year all # # Demonstrate use of the 'Notes' box. This is a way to display notes in one # of the empty, unused 'day boxes' on a monthly calendar. # # Put the same note in all months, with the abbreviated month name as part of # the note. # # The '/2' means that this note should go in the 2nd empty 'day box' counting # from the beginning of the month. Use of '/-3' instead (for example) would # cause this note to go in the 3rd empty 'day box' from the end of the month. # The default position if no '/#' is specified is the last empty box of the # month. # # It is possible to place more than 1 note in the same box. It is also # possible to use more than 1 box for the various monthly notes. # note/2 all \fBEnjoy life\fP during %b! # # Put a note in some specific months, showing the full month name... # # Those living in the Southern Hemisphere can reverse the months so it makes # more sense. :^) # note Jan Brr... It's cold in %B! note Jul Whew, it's hot in %B! # # Demonstrate the ability to display someone's age on their birthday. # # This example is for someone born in 1991. It will display the text "Eric's # 14th Birthday" on May 10, 2005. # May 10 Eric's %-1991Y%oY Birthday # # Demonstrate the ability to distinguish between different versions of 'pcal'. # # Version 4.8.0 added the ability to display embedded EPS images on monthly # calendars, so we'll display a photo of the "birthday boy" if we're running # 4.8.0 or higher. # # We scale the image by 0.50 in the X and Y dimensions, and we use a X and Y # offsets of 0 and -8 typographic points, respectively. The non-zero Y offset # moves the EPS image down slightly to leave room for the "Eric's 14th # Birthday" text which will appear below the day's numerics. # ifdef v4_8_0 | v4_9_0 | v4_9_1 | v4_10_0 | v4_11_0 May 10 image:/path-to-eps/eric.eps 0.50 0.50 0 -8 endif # # Demonstrate some simple 'pre-processor'-like functionality: # define MINI_EPS_IMAGE ifdef MINI_EPS_IMAGE Dec 25 image:/path-to-eps/xmas.eps 0.75 0.75 0 0 else Dec 25 image:/path-to-eps/xmas.eps 1.00 1.00 0 0 endif undef MINI_EPS_IMAGE # # Demonstrate the ability to define a symbol and associate a value with that # symbol. # ### # This version seems to break (turns off) the 'year all' ### # (or 'year *') command: ### define sem_start 8/23/2004 # Beginning of semester define semester_start 8/23 # Beginning of semester semester_start Class Start 7th day after semester_start 1st Quiz 14th day after semester_start 2nd Quiz undef semester_start # # If the symbol "whole_year" has been defined (either implicitly via the '-w' # option or explicitly), print a centered footer string containing the first # and last dates of the year... # ifdef whole_year opt -C "%B %d, %Y - %+1Y%-1D%B %d, %Y" endif # # Demonstrate the ability to distinguish between different languages, in a # silly way, by writing the name of the language as a centered footer for the # calendar, but only on monthly-format (1 month per page) calendars. # ifndef whole_year if lang_en opt -C "English" elif lang_el opt -C "Greek" elif lang_it opt -C "Italian" elif lang_fr opt -C "French" elif lang_de opt -C "German" elif lang_eo opt -C "Esperanto" elif lang_es opt -C "Spanish" elif lang_fi opt -C "Finnish" elif lang_sv opt -C "Swedish" elif lang_pt opt -C "Portuguese" elif lang_uk opt -C "Ukrainian" elif lang_et opt -C "Estonian" elif lang_ru opt -C "Russian" elif lang_lv opt -C "Latvian" elif lang_lt opt -C "Lithuanian" elif lang_cs opt -C "Czech" elif lang_hu opt -C "Hungarian" elif lang_ca opt -C "Catalan" elif lang_pl opt -C "Polish" elif lang_nl opt -C "Dutch" elif lang_ro opt -C "Romanian" elif lang_da opt -C "Danish" elif lang_sk opt -C "Slovak" elif lang_ha opt -C "Hawaiian" endif endif # # Demonstrate the ability to distinguish between different paper sizes, in a # silly way, by writing the name of the paper size as a left-justified footer # for the calendar. # ifdef papersize_letter opt -L "LETTER paper" elifdef papersize_legal opt -L "LEGAL paper" elifdef papersize_a4 opt -L "A4 paper" elifdef papersize_tabloid opt -L "TABLOID paper" endif # # Demonstrate the ability to distinguish between different page orientations, # in a silly way, by writing the name of the page orientation as a # right-justified footer for the calendar. # ifdef orientation_portrait opt -R "PORTRAIT mode" elifdef orientation_landscape opt -R "LANDSCAPE mode" endif # # Some sample (non-holiday) events... # # Daylight Savings Time # # # Pre-2007: # # first Sun in Apr Begin DST # last Sun in Oct End DST # # 2007 and beyond: # second Sun in Mar Begin DST first Sun in Nov End DST # # Demonstrate some simple holiday events with embedded EPS images. # # 'Thanksgiving' and 'Christmas' are predefined events. # # The '*' following the event day specification indicates that this is a # holiday, which causes the text to appear to the right of the numerics (not # below the numerics, as for non-holiday events) and may cause the numerics to # be colored uniquely depending on other options. # Thanksgiving* Thanksgiving Day Thanksgiving* image:/path-to-eps/turkey.eps 1.0 1.0 0 0 day after Thanksgiving* day before Christmas* Christmas Eve Christmas* Christmas Day Christmas* image:/path-to-eps/xmastree.eps 0.225 0.225 15 0 # # For this event, we demonstrate the modified X positioning of the event's EPS # icon based on the selected paper size... # last day in Dec* New Year's Eve ifdef papersize_letter last day in Dec* image:/path-to-eps/party.eps 0.32 0.32 5 0 elifdef papersize_legal last day in Dec* image:/path-to-eps/party.eps 0.32 0.32 35 0 endif # # Demonstrate a more complex holiday, using the 'nearest' keyword... # weekday nearest Jul 4* # nonworkday in observance of U.S. Independence Day # # Print a warning on 'Friday the 13th' dates, for the superstitious among # us. :^) # # Note that this is a good example of a predefined event which we do not mark # ('*') as a holiday because we don't want the day numerics to be colorized # differently. # ifdef v4_8_0 | v4_9_0 | v4_9_1 | v4_10_0 # # Old way, no longer available as of version 4.11.0: # F13 Avoid black cats! else # # New, generic way, using the new 'on' preposition, available beginning # with version 4.11.0: # Fri on all 13 Avoid black cats! endif # # Display the week number (i.e. 1-52) on every Monday... # all monday in all Week %w # # Demonstrate a recurring monthly event. # # The 'recycle.eps' file is an icon of the 3 green arrows which represents the # 'Recycle' symbol. This EPS file is included in the 'pcal' distribution. # second Sat in all RECYCLE! second Sat in all image:/path-to-eps/recycle.eps 0.039 0.039 34 -9 # # Demonstrate a recurring weekly event. # # Also demonstrate use of format specifiers to get things like day-of-week # name into the event text... # every Wed in all %A poker game # # Version 4.9.0 added the ability to delete specific events, thereby allowing # you to exclude one or more events that were inserted as a group of events. # # This example provides a weekly event on Thursdays that is excluded on every # 2nd Thursday of any given month. # all Thursday in all %A golf game ifdef v4_9_0 | v4_9_1 | v4_10_0 | v4_11_0 delete second Thursday in all %A golf game endif # # Demonstrate the use of an input language other than the default (English)... # input-language fr # French every Mardi in all %A Paris LUG Meeting # every Tuesday Avr 1 April Fools Day # 'Avril' = April input-language en # switch back to English every Fri in all %A Wales LUG Meeting # every Friday pcal-4.11.0/exec/0000755000175000001440000000000010732023355011625 5ustar wuserspcal-4.11.0/exec/unused.txt0000644000175000001440000000052610160143024013663 0ustar wusersThis file exists only to ensure that this otherwise-empty directory is properly created when you extract the files in the 'tar' file. You may safely remove it once the 'tar' files have been extracted. This problem seems to exist only with extraction utilities (e.g. WinZip) that fail to create a subdirectory when there are no files in it. pcal-4.11.0/html/0000755000175000001440000000000010732023355011645 5ustar wuserspcal-4.11.0/html/pcal.cgi0000755000175000001440000000752110160143100013242 0ustar wusers#!/bin/sh # # Bourne shell script to decode QUERY_STRING (as set up by pcal.html or # pcalw.html) and run 'pcal' with selected options; must be installed # with execute permission for all # # expects QUERY_STRING to contain one or more of the following variables: # # datefile "-e" (empty calendar) or null (use default file) # htmlout "-H" (HTML output) or null (PostScript output) # dflag optional "-D" flag to be passed to pcal ( # should not contain any special characters) # dstyle default day style ("-[bgGO]" or null) # dfont day numerics font name (can be null) # tfont title font name (can be null) # hstyle holiday style ("-[bgGO]" or null) # jdates Julian dates ("-[jJ]" or null) # lang language ("-a" or null) # mode landscape/portrait mode ("-[lp]" or null) # month starting month (1-12; use current month if null) # nmonths number of months (1-99; use 1 if null) # smcal small calendar position ("-[kKS]" or null) # wflag "-w" or null ("-w" overrides 'month' and 'nmonths') # wstyle weekend (Sat/Sun) style ("-[bgGO]" or null) # year two- or four-digit year; use current year if null # # N.B.: edit these to point to the location of the pcal executable and # common calendar file on your system (note that the user can't use his/her # own calendar file since most servers will execute pcal.cgi as 'nobody') pcal=/yourpath/pcal file=/yourpath/calendar # set DEBUG=1 to echo debugging output as HTML text # DEBUG=0 DEBUG=0 datefile=; htmlout=; dflag=; dstyle=; dfont=; tfont=; hstyle=; jdates=; lang=; # defaults mode=; month=; moons=; nmonths=; smcal=; wflag=; wstyle=; year=; papersize=; # convert QUERY_STRING from HTML-supplied "var1=val1&var2=val2..." to /bin/sh # "var1=val1;var2=val2..." commands; 'eval' result to set local variables # (note that 'eval' is vulnerable to attacks from clever hackers who could # sneak other shell commands into the request string; you may want to replace # this with any of several more robust parsing scripts publicly available) set -f # disable file name expansion eval `echo $QUERY_STRING | sed -e 's/&/;/g'` # fill in default values as needed if [ "$month" = "" ] ; then month=`date +%m` # use current month fi case "$year" in [1-9][0-9][0-9][0-9]) # valid 4-digit year ;; [0-9][0-9]) # valid 2-digit year (pcal supplies century) ;; *) # null or invalid - use current year year=`date +%y` ;; esac case "$nmonths" in [0-9][0-9]) # valid 2-digit number ;; [0-9]) # valid 1-digit number ;; *) # null or invalid - print single month nmonths=1 ;; esac # additional tweaks as required by certain flags if [ "$wflag" = "-w" ] ; then # whole-year mode: override month and nmonths month=; nmonths=; fi if [ "$datefile" = "" ] ; then # use path to calendar file datefile="-f $file" fi if [ "$dstyle" != "" ] ; then # append 'all' to -[bgGO] flag (default) dstyle=$dstyle"all" fi if [ "$hstyle" != "" ] ; then # append 'hol' to -[bgGO] flag (holidays) hstyle=$hstyle"hol" fi if [ "$wstyle" != "" ] ; then # append 'sat-sun' to -[bgGO] flag (weekends) wstyle=$wstyle"sat-sun" fi # write header describing content as PostScript; run pcal (sending output # to stdout) if [ $DEBUG -eq 0 ] ; then if [ "$htmlout" != "" ] ; then # use HTML output echo "Content-type: text/html" else echo "Content-type: application/PostScript" fi echo "" $pcal $mode $htmlout $dflag -d$dfont -t$tfont $wstyle $dstyle $hstyle $moons \ $jdates $datefile $lang $smcal $wflag $month $year $nmonths $papersize else echo "Content-type: text/html" # write debugging output as HTML echo "" echo "pcal debugging information" echo "

QUERY_STRING = "$QUERY_STRING"

" echo $pcal $mode $htmlout $dflag -d$dfont -t$tfont $wstyle $dstyle $hstyle $moons \ $jdates $datefile $lang $smcal $wflag $month $year $nmonths $papersize fi exit 0 pcal-4.11.0/html/pcal.html0000644000175000001440000002056110732017670013461 0ustar wusers pcal (single-month mode)

Generate Monthly Calendar

Month: Year: No. of months:

Language:
Output Format
PostScript (PS)
HTML

Orientation (PS only)
landscape
portrait

Paper Size (PS Only):

Moon Phase Graphics (PS only)
none
only on full / new / half (1st and last quarter) moon days
every day

Julian Date Annotation (PS only)
none
'day of year' ordinal
'day of year' ordinal and 'days left in year'

Prev/Next Month Mini-Calendars (PS only)
last two boxes
first two boxes
first and last box
neither

Font Selections (PS only)
Title Font Day Numerics Font
Avant-Garde
Helvetica
Palatino
Times
Avant-Garde
Helvetica
Palatino
Times

Overall Day Numerics Style (PS only)
default
solid 'day numerics' color (default = gray)
solid black
outline in 'day numerics' color (default = gray)
black outline filled with 'day numerics' color (default = gray)

Sat/Sun Numerics Style (PS only)
default
solid 'day numerics' color (default = gray)
solid black
outline in 'day numerics' color (default = gray)
black outline filled with 'day numerics' color (default = gray)

Holiday Numerics Style (PS only)
default
solid 'day numerics' color (default = gray)
solid black
outline in 'day numerics' color (default = gray)
black outline filled with 'day numerics' color (default = gray)

Bypass 'Date File' Processing (for a plain calendar)

pcal-4.11.0/html/pcal.pl0000755000175000001440000001372510301203504013120 0ustar wusers#!/usr/bin/perl -wT # this is close to a 1:1 translation from the original pcal.cgi sh script. # except that this one does a better job of tainted data. # # Bourne shell script to decode QUERY_STRING (as set up by pcal.html or # pcalw.html) and run 'pcal' with selected options; must be installed # with execute permission for all # # expects QUERY_STRING to contain one or more of the following variables: # # datefile "-e" (empty calendar) or null (use default file) # dflag optional "-D" flag to be passed to pcal ( # should not contain any special characters) # dstyle default day style ("-[bgGO]" or null) # font font name (can be null) # hstyle holiday style ("-[bgGO]" or null) # jdates Julian dates ("-[jJ]" or null) # lang language ("-a" or null) # mode landscape/portrait mode ("-[lp]" or null) # month starting month (1-12; use current month if null) # nmonths number of months (1-99; use 1 if null) # smcal small calendar position ("-[kKS]" or null) # wflag "-w" or null ("-w" overrides 'month' and 'nmonths') # wstyle weekend (Sat/Sun) style ("-[bgGO]" or null) # year two- or four-digit year; use current year if null # ostyle -H for html tables, or nothing, for postscript # use vars qw(%category %form); use strict; use CGI; $ENV{PATH} = '/usr/bin:/usr/local/bin'; # set DEBUG=1 to echo debugging output as HTML text my $DEBUG=0; if ($DEBUG != 0){ print "Content-type: text/html\n\n", "
pcal debugging information
\n", "\n"; } # N.B.: edit these to point to the location of the pcal executable and # common calendar file on your system (note that the user can't use his/her # own calendar file since most servers will execute pcal.cgi as 'nobody') my $PCAL = '/usr/local/bin/pcal'; my $FILE = '/usr/local/bin/calendar'; # my $THECAL; my @NOWTIME = localtime(time()) ; my $NOWYEAR = $NOWTIME[5] + 1900; #>2001 is 101 in time structure. my $NOWMONTH = $NOWTIME[4] + 1; #C numbers from 0, pcal from 1 # # defaults my $q = new CGI; my $DATEFILE =&cleanalphanumeric($q->param('datefile')); my $DFLAG =&cleanalphanumeric($q->param('dflag')); my $DSTYLE =&cleanalphanumeric($q->param('dstyle')); my $FONT =&cleanalphanumeric($q->param('font')); my $HSTYLE =&cleanalphanumeric($q->param('hstyle')); my $JDATES =&cleanalphanumeric($q->param('jdates')); my $LANG =&cleanalphanumeric($q->param('lang')); my $MODE =&cleanalphanumeric($q->param('mode')); my $MONTH =&cleannumeric($q->param('month')); my $MOONS =&cleanalphanumeric($q->param('moons')); my $NMONTHS =&cleannumeric($q->param('nmonths')); my $SMCAL =&cleanalphanumeric($q->param('smcal')); my $WFLAG =&cleanalphanumeric($q->param('wflag')); my $WSTYLE =&cleanalphanumeric($q->param('wstyle')); my $YEAR =&cleannumeric($q->param('year')); my $OSTYLE =&cleanalphanumeric($q->param('ostyle')); # convert QUERY_STRING from HTML-supplied "var1=val1&var2=val2..." to /bin/sh # "var1=val1;var2=val2..." commands; 'eval' result to set local variables # (note that 'eval' is vulnerable to attacks from clever hackers who could # sneak other shell commands into the request string; you may want to replace # this with any of several more robust parsing scripts publicly available) # fill in default values as needed if( $MONTH eq ""){ $MONTH = $NOWMONTH; } if( $YEAR eq ""){ $YEAR = $NOWYEAR; } if( $NMONTHS eq ""){ $NMONTHS = "1"; } # additional tweaks as required by certain flags if ( $WFLAG eq "-w" ){ $MONTH=""; $NMONTHS=""; } if ($DATEFILE eq "" ){ $DATEFILE="-f $FILE"; } if ( $DSTYLE ne "" ){ # append 'all' to -[bgGO] flag (default) $DSTYLE = join '',$DSTYLE,"all"; } if ( $HSTYLE ne "" ){ # append 'hol' to -[bgGO] flag (holidays) $HSTYLE = join '',$HSTYLE,"hol"; } if ( $WSTYLE ne "" ){ # append 'sat-sun' to -[bgGO] flag (weekends) $WSTYLE = join '',$WSTYLE,"sat-sun"; } # write header describing content as PostScript; run pcal (sending output # to stdout) if ( $DEBUG == 0 ){ if ($OSTYLE eq ""){ print "Content-type: application/PostScript\n\n"; } else { print "Content-type: text/html\n\n"; } $THECAL=`$PCAL $MODE $DFLAG -d$FONT -t$FONT $WSTYLE $DSTYLE $HSTYLE $MOONS $JDATES $DATEFILE $OSTYLE $LANG $SMCAL $WFLAG $MONTH $YEAR $NMONTHS`; print $THECAL; } else { # write debugging output as HTML print "

command will be:

\n", " $PCAL $MODE $DFLAG -d$FONT -t$FONT $WSTYLE $DSTYLE $HSTYLE $MOONS $JDATES $DATEFILE $OSTYLE $LANG $SMCAL $WFLAG $MONTH $YEAR $NMONTHS\n", "
running it
\n", "
\n";
    
    $THECAL=`$PCAL $MODE $DFLAG -d$FONT -t$FONT $WSTYLE $DSTYLE $HSTYLE $MOONS $JDATES $DATEFILE $OSTYLE $LANG $SMCAL $WFLAG $MONTH $YEAR $NMONTHS`;
    print $THECAL;
    
  print "
\n"; } # # this satisfies the -T option and also restricts string to alphanumeric # of no more than 20 characters. It also allows a leading "-". # sub cleanalphanumeric{ unless (defined $_[0]){ return(""); } my $LOCALSTR; my $PREFIX; my $BODY; $LOCALSTR=$_[0]; # # the next one is a little tricky, it first looks for something # like "-g" -> "-" + "g" # but if it doesn't find the leading - it will also handle # "text" -> "" + "text" # $LOCALSTR=~/(^\-|^)(.*)($)/; $PREFIX=$1; $BODY=$2; $BODY=~s/\W//g; $LOCALSTR= join '',$PREFIX,$BODY; $LOCALSTR=&limitstring($LOCALSTR,20); return($LOCALSTR); } # # this satisfies the -T option and also restricts string to numeric # of no more than 4 characters # sub cleannumeric{ unless (defined $_[0]){ return(""); } my $LOCALSTR; $LOCALSTR=$_[0]; $LOCALSTR=~s/\D//g; $LOCALSTR=~/(^)(.*)($)/; $LOCALSTR=&limitstring($LOCALSTR,4); return($2); } # # restrict string length # sub limitstring { my $LIMSTRING; my $LIMIT; if(defined $_[0]){ $LIMSTRING = $_[0] ; $LIMIT = $_[1] ; #this should always exist if( length($LIMSTRING) > $_[1] ){ $LIMSTRING = substr ($LIMSTRING, 0, $LIMIT); } return $LIMSTRING; } else { return ""; } } pcal-4.11.0/html/pcalw.html0000644000175000001440000001444110732017670013650 0ustar wusers pcal (single-year mode)

Generate Yearly Calendar

Year:

Language:
Output Format
PostScript (PS)
HTML

Orientation (PS only)
landscape
portrait

Paper Size (PS Only):

Font Selections (PS only)
Title Font Day Numerics Font
Avant-Garde
Helvetica
Palatino
Times
Avant-Garde
Helvetica
Palatino
Times

Overall Day Numerics Style (PS only)
default
solid 'day numerics' color (default = gray)
solid black
outline in 'day numerics' color (default = gray)
black outline filled with 'day numerics' color (default = gray)

Sat/Sun Numerics Style (PS only)
default
solid 'day numerics' color (default = gray)
solid black
outline in 'day numerics' color (default = gray)
black outline filled with 'day numerics' color (default = gray)

Holiday Numerics Style (PS only)
default
solid 'day numerics' color (default = gray)
solid black
outline in 'day numerics' color (default = gray)
black outline filled with 'day numerics' color (default = gray)

Bypass 'Date File' Processing (for a plain calendar)

pcal-4.11.0/obj/0000755000175000001440000000000010732023355011453 5ustar wuserspcal-4.11.0/obj/unused.txt0000644000175000001440000000052610160143024013511 0ustar wusersThis file exists only to ensure that this otherwise-empty directory is properly created when you extract the files in the 'tar' file. You may safely remove it once the 'tar' files have been extracted. This problem seems to exist only with extraction utilities (e.g. WinZip) that fail to create a subdirectory when there are no files in it. pcal-4.11.0/scripts/0000755000175000001440000000000010732023355012370 5ustar wuserspcal-4.11.0/scripts/group_calendaring.sh0000644000175000001440000001026310732021107016402 0ustar wusers#!/bin/bash # Simple script to generate personal, group calendars # # Copyright Kristofer Bergstrom 2007 # # Released under the terms of the GNU GPL. # # # Usage: # Run from the command line, the script prompts the user to: # Display calendar? # Print calendar? # Send significant other calendar? # Upload new group calendar? # (if yes) Email group? # # # Future features -- anyone want to help? # Support for 1/1/07 type date entries in .calendar # Improve ease of adoption, adaptation for others # # # Before using: # The script references the following external programs, # not installed by default on most systems: # pcal, gv, ps2pdf, mutt # # Read through the whole script! There are lots of references # to my system that need to be changed. # You must at least adjust the following references below to match # your system: # replace "/home//.calendar" with your .calendar location # Signif. other section # personalize echo message # change signif. other's email address # upload section # change scp line to send the file to your server # personalize the group email echo line # change email addresses to be your group members' addresses # change test line email address to be your email address # myMonth=$(date +%m) myYear=$(date +%Y) myPdfGenerated=0 myGroupEmailed=0 cd /tmp/ cp /home//.calendar /tmp/.calendar.tmp pcal -E -f /tmp/.calendar.tmp -o /tmp/cal.ps $myMonth $myYear 12 grep ON /tmp/.calendar.tmp > /tmp/grpCal.tmp pcal -E -f /tmp/grpCal.tmp -o /tmp/grpCal.ps $myMonth $myYear 12 pcal -E -H -f /tmp/grpCal.tmp -o /tmp/grpCal.html $myMonth $myYear 12 ed -s /tmp/grpCal.html <<< $'6a\nGroup calendar, updated '"$(date)"$'\n.\nw' echo -e "Personal calendar generated... \nGroup calendar generated... \n12-months, beginning" $myMonth $myYear # Display calendar with ghostview read -n 1 -p "Display calendar? " if [ "$REPLY" = "y" ]; then gv /tmp/cal.ps fi echo "" # Print calendar read -n 1 -p "Print calendar? " if [ "$REPLY" = "y" ]; then lp /tmp/cal.ps fi echo "" # Send calendar to signif. other read -n 1 -p "Send calendar to signif. other? " if [ "$REPLY" = "y" ]; then ps2pdf /tmp/cal.ps echo -e "This message is generated automatically...\n\nAttached is my newest calendar.\n\n Kris" | mutt -a /tmp/cal.pdf -s "'s newest calendar" signif@other.com myPdfGenerated=1 fi echo "" # Upload calendar to server and email group members read -n 1 -p "Upload new group calendar? " if [ "$REPLY" = "y" ]; then scp /tmp/grpCal.html user@server://var/www/grpCal.html echo "" read -n 1 -p "Email group? " if [ "$REPLY" = "y" ]; then myGroupEmailed=1 ps2pdf /tmp/grpCal.ps # build email text touch /tmp/myEmailContents.txt echo -e "This message automatically generated...\n\nThe group calendar has been updated.\nEvents have been added, changed, or deleted on the following dates.\n\n" >> /tmp/myEmailContents.txt diff /home//grpCal.prev /tmp/grpCal.tmp | grep '[0-9][0-9]/[0-9][0-9]/[0-9][0-9]' | cut -c 3-10 | awk -F/ '{print "20"$3"/"$2"/"$1}' | sort | uniq >> /tmp/myEmailContents.txt # Comparison of old group calendar with newly-generated group calendar echo -e "\n\nPlease see /grpCal.html for the updated version, or the attached PDF.\n\n\nPS - Any new personal dates I should know about?" >> /tmp/myEmailContents.txt # send email # mutt -a /tmp/grpCal.pdf -s "Group calendar update" group@member1.com group@member2.com group@member3.com < /tmp/myEmailContents.txt mutt -a /tmp/grpCal.pdf -s "Group calendar update - TEST" your@email.com < /tmp/myEmailContents.txt # testing version fi mv /tmp/grpCal.tmp /home//grpCal.prev fi echo "" # move the most recent calendar to safe keeping, remove all # remaining temporary files rm /tmp/.calendar.tmp /tmp/cal.ps /tmp/grpCal.html /tmp/myEmailContents.txt if [ $myPdfGenerated = 1 ]; then rm /tmp/grpCal.pdf fi if [ $myGroupEmailed = 1 ]; then rm /tmp/myEmailContents.txt fi echo "Returning to dir: " cd - pcal-4.11.0/scripts/my_daily_reminder_script.sh0000644000175000001440000000404710732021107020002 0ustar wusers#!/bin/bash # Simple script to get the three dates (today, tomorrow, # one week from today) in the proper format and search for # them in the pcal .calendar file. # # Copyright Kristofer Bergstrom 2007 # # Released under the terms of the GNU GPL. # # # Four lines must be adjusted before use! # Change "/home//.calendar" to represent the path to # *your* pcal calendar. # Change the "email@domain.org" address near the bottom to # be the address where you would like to receive the daily # reminders. # # Future additions -- anyone want to help? # Support for dates like 1/1/07 in .calendar file # "Upcoming birthdays" section in daily email my_date=$(date +%d/%m) my_tomorrow_date=$(date --date="+1 day" +%d/%m) my_next_week_date=$(date --date="+7 day" +%d/%m) # Do the actual searches through the pcal .calendar file. # The dates are specified in "European format" -- 25/12/07 # for Christmas for example. Note that the date command # would output 01/01/07 for new years, so in the .calendar # file, make sure to include the leading 0's. (1/1/07 is # acceptable to pcal but would not be found with this # script.) # # The caret preceeding the variables makes sure that grep # is searching for a line that *begins* with the date # (day/month). On third of July, for example, we don't # want the entry for 01/03/07 to be accidentally returned. today_events=$(grep -e "^$my_date" /home//.calendar) tomorrow_events=$(grep -e "^$my_tomorrow_date" /home//.calendar) next_week_events=$(grep -e "^$my_next_week_date" /home//.calendar) # create a temporary file to hold our email contents touch my_email_tmp # one long echo command to generate email contents echo -e "TODAY'S EVENTS (`(date +"%b %d, %Y")`):\n\n$today_events\n\n\nTOMORROW'S EVENTS (`(date +"%b %d, %Y" --date="+1 day")`):\n\n$tomorrow_events\n\n\nONE WEEK FROM TODAY (`(date --date="+7 days" +"%b %d, %Y")`):\n\n$next_week_events" > my_email_tmp # send the email and clean up cat my_email_tmp | mail -s "Today's events and to-do" email@domain.org rm my_email_tmp pcal-4.11.0/scripts/readme.txt0000644000175000001440000001202310732021107014355 0ustar wusersThe content of this file is essentially a Dec 2007 replica of this web page, which should be considered the authoritative reference: http://pcal.sourceforge.net/scripts.html Bill Marr (marr99@users.sourceforge.net) 17 Dec 2007 ------------------------------------------------------------------------------ Useful PCAL Shell Scripts Overview: Kristofer Bergstrom of the band On Ensemble (http://onensemble.org) has written and generously provided these useful Unix shell scripts which help automate his usage of pcal. Background: In Kris' words: Notes on Free Software-based calendaring Why I love pcal I have recently switched to using pcal to manage my personal and work schedules, and am very pleased with the results. I used a Palm Pilot for years but it was difficult to interface with gnu/linux (at that time) and all my calendar and schedule data was in the palm's proprietary format. I switched to simple text files for a while, but missed the graphical display of a calendar. With pcal, I feel like I have the best of both worlds. I maintain the calendar electronically, benefitting from fast input, clear organization, and safe backup. I carry a printed version, meaning I always have my calendar with me, using it doesn't require batteries (only a pen or pencil), and it's not a big deal if I misplace it. pcal produces very simple, clear calendars that I enjoy using. And because pcal's .calendar file is a simple text file, it is viewable on any system, and through simple ssh, and is compatible with standard unix utilities. There are two scripts that I use alongside pcal. One sends me daily emails containing that day's and upcoming events. The second is a script that automates the things I do often with pcal, namely --- generating a personal and a group calendar, viewing, printing, emailing the calendars to people, uploading the group calendar to a web server, etc. Daily Email Schedule Reminders with PCAL: Download: 'Daily Reminder' shell script (http://pcal.sourceforge.net/my_daily_reminder_script.sh) Here is Kris' description of the operation of the script: The following bash script can be put in a cron job to parse a pcal .calendar file once a day (mine does it at 4am) and send an email containing the today's, tomorrow's, and one week from today's events. An example email from the script: TODAY'S EVENTS (Sep 30, 2007): 30/09/07 Hiro's parents leave? TOMORROW'S EVENTS (Oct 01, 2007): 01/10/07 11:30-18 Work at JACCC ticket office ONE WEEK FROM TODAY (Oct 07, 2007): 07/10/07 Jason lesson at practice space 07/10/07 Maz to go to Japan? 07/10/07 Shoj out with Hiroshima I have this script saved as my_daily_reminder_script.sh in my /usr/local/bin directory. Note that the permissions must allow the program to be executed (I ran "chmod 750 /usr/local/bin/my_daily_reminder_script.sh" and "chown /usr/local/bin/my_daily_reminder_script.sh" as root.) Test the script by running it. Make sure there are entries for today, tomorrow, and one week from today in your .calendar file so the three searches performed in the script will all return something. If the script is working properly, you should receive an email containing the events. Once the script appears to be working properly, put an entry in crontab (crontab -e) to run the script at a set time every day. Mine runs the script at 4am and looks like this: xuxa@chappa:/tmp$ crontab -l 00 4 * * * /usr/local/bin/my_daily_reminder_script.sh That should do it! Let me know if you have any questions or suggestions. kris at k--b <.> org Simple Group Calendaring with PCAL: Download: 'Group Calendaring' shell script (http://pcal.sourceforge.net/group_calendaring.sh) Here is Kris' description of the operation of the script: I'm in a band and am responsible for the band's schedule. I'm using pcal and a simple script to keep the members up to date with the group's performance schedule. The script generates a calendar of the band's gigs, uploads it to our web server, and alerts the members that a new version is available. The script sends an email to all the members (and our agent) that includes the dates that have changed since the last update. Members use these updates to keep their personal calendars (both electronic and hand-written in our case) up to date. Group-relevant entries in the .calendar file include a searchable tag ("ON", for On Ensemble, in our case). The script first pulls out the tagged entries (with grep) and then uses pcal to generate the group's calendar. Let me know if you have any questions or suggestions! kris at k--b <.> org ------------------------------------------------------------------------------ pcal-4.11.0/src/0000755000175000001440000000000010732023355011470 5ustar wuserspcal-4.11.0/src/encvec.c0000644000175000001440000016112710461257344013115 0ustar wusers/* --------------------------------------------------------------------------- encvec.c Notes: This file contains routines which generate each of the PostScript enccoding vectors necessary to support the various languages. Revision history: 4.10.0 B.Marr 2006-07-19 Created. */ /* --------------------------------------------------------------------------- Header Files */ #include /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ /* --------------------------------------------------------------------------- Constant Declarations */ /* --------------------------------------------------------------------------- Macro Definitions */ /* --------------------------------------------------------------------------- Data Declarations (including externals) */ /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ /* --------------------------------------------------------------------------- Misc Notes: Here are the mappings for the lower-order characters, which are common among the following vector encodings and will therefore not be output as part of those encodings... - ISO 8859-2 (Latin2) - ISO 8859-3 (Latin3) - ISO 8859-4 (Latin4) - ISO 8859-5 (Cyrillic) - ISO 8859-7 (Greek) - ISO 8859-9 (Latin5) - ISO 8859-10 (Latin6) - ISO 8859-11 (Thai) - ISO 8859-13 (Latin7) - ISO 8859-14 (Latin8) - ISO 8859-15 (Latin9 aka Latin0) printf(" 8#000 /.notdef 8#001 /.notdef 8#002 /.notdef 8#003 /.notdef\n"); printf(" 8#004 /.notdef 8#005 /.notdef 8#006 /.notdef 8#007 /.notdef\n"); printf(" 8#010 /.notdef 8#011 /.notdef 8#012 /.notdef 8#013 /.notdef\n"); printf(" 8#014 /.notdef 8#015 /.notdef 8#016 /.notdef 8#017 /.notdef\n"); printf(" 8#020 /.notdef 8#021 /.notdef 8#022 /.notdef 8#023 /.notdef\n"); printf(" 8#024 /.notdef 8#025 /.notdef 8#026 /.notdef 8#027 /.notdef\n"); printf(" 8#030 /.notdef 8#031 /.notdef 8#032 /.notdef 8#033 /.notdef\n"); printf(" 8#034 /.notdef 8#035 /.notdef 8#036 /.notdef 8#037 /.notdef\n"); printf(" 8#040 /space 8#041 /exclam 8#042 /quotedbl 8#043 /numbersign\n"); printf(" 8#044 /dollar 8#045 /percent 8#046 /ampersand 8#047 /quotesingle\n"); printf(" 8#050 /parenleft 8#051 /parenright 8#052 /asterisk 8#053 /plus\n"); printf(" 8#054 /comma 8#055 /hyphen 8#056 /period 8#057 /slash\n"); printf(" 8#060 /zero 8#061 /one 8#062 /two 8#063 /three\n"); printf(" 8#064 /four 8#065 /five 8#066 /six 8#067 /seven\n"); printf(" 8#070 /eight 8#071 /nine 8#072 /colon 8#073 /semicolon\n"); printf(" 8#074 /less 8#075 /equal 8#076 /greater 8#077 /question\n"); printf(" 8#100 /at 8#101 /A 8#102 /B 8#103 /C\n"); printf(" 8#104 /D 8#105 /E 8#106 /F 8#107 /G\n"); printf(" 8#110 /H 8#111 /I 8#112 /J 8#113 /K\n"); printf(" 8#114 /L 8#115 /M 8#116 /N 8#117 /O\n"); printf(" 8#120 /P 8#121 /Q 8#122 /R 8#123 /S\n"); printf(" 8#124 /T 8#125 /U 8#126 /V 8#127 /W\n"); printf(" 8#130 /X 8#131 /Y 8#132 /Z 8#133 /bracketleft\n"); printf(" 8#134 /backslash 8#135 /bracketright 8#136 /asciicircum 8#137 /underscore\n"); printf(" 8#140 /grave 8#141 /a 8#142 /b 8#143 /c\n"); printf(" 8#144 /d 8#145 /e 8#146 /f 8#147 /g\n"); printf(" 8#150 /h 8#151 /i 8#152 /j 8#153 /k\n"); printf(" 8#154 /l 8#155 /m 8#156 /n 8#157 /o\n"); printf(" 8#160 /p 8#161 /q 8#162 /r 8#163 /s\n"); printf(" 8#164 /t 8#165 /u 8#166 /v 8#167 /w\n"); printf(" 8#170 /x 8#171 /y 8#172 /z 8#173 /braceleft\n"); printf(" 8#174 /bar 8#175 /braceright 8#176 /asciitilde 8#177 /.notdef\n"); printf(" 8#200 /.notdef 8#201 /.notdef 8#202 /.notdef 8#203 /.notdef\n"); printf(" 8#204 /.notdef 8#205 /.notdef 8#206 /.notdef 8#207 /.notdef\n"); printf(" 8#210 /.notdef 8#211 /.notdef 8#212 /.notdef 8#213 /.notdef\n"); printf(" 8#214 /.notdef 8#215 /.notdef 8#216 /.notdef 8#217 /.notdef\n"); printf(" 8#220 /.notdef 8#221 /.notdef 8#222 /.notdef 8#223 /.notdef\n"); printf(" 8#224 /.notdef 8#225 /.notdef 8#226 /.notdef 8#227 /.notdef\n"); printf(" 8#230 /.notdef 8#231 /.notdef 8#232 /.notdef 8#233 /.notdef\n"); printf(" 8#234 /.notdef 8#235 /.notdef 8#236 /.notdef 8#237 /.notdef\n"); -------------------------------------------- Note that for the ISO 8859-1 (Latin1) encoding, the first 145 characters (octal 0-220) are the same as those defined above. Unlike most of the other Latin encodings, the characters at positions 145-159 (decimal [221-237 octal]) are _not_ undefined (i.e. they are something other than '.notdef') for ISO 8859-1 (Latin1). -------------------------------------------- Note that for the KOI8-R and KOI8-U encodings, the first 128 characters (octal 0-177) are the same as those defined above. Unlike most of the Latin encodings, the characters at positions 128-159 (decimal [200-237 octal]) are _not_ undefined (i.e. they are something other than '.notdef') for KOI8-R and KOI8-U. -------------------------------------------- There is one other minor discrepancy. The PostScript encoding vector for KOI8-U provided with the Ukrainian patch used this definition: 8#047 /quoteright whereas all other encodings seem to use this definition: 8#047 /quotesingle It probably makes no difference, however. */ /* --------------------------------------------------------------------------- encvec_iso8859_1 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_1 (void) { printf("%%\n"); printf("%% ISO 8859-1 (Latin1) character mappings\n"); printf("%%\n"); printf("/alt_mappings [\n"); printf(" 8#221 /grave 8#222 /acute 8#223 /circumflex\n"); printf(" 8#224 /tilde 8#225 /macron 8#226 /breve 8#227 /dotaccent\n"); printf(" 8#230 /dieresis 8#231 /.notdef 8#232 /ring 8#233 /cedilla\n"); printf(" 8#234 /.notdef 8#235 /hungarumlaut 8#236 /ogonek 8#237 /caron\n"); printf(" 8#240 /space 8#241 /exclamdown 8#242 /cent 8#243 /sterling\n"); printf(" 8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section\n"); printf(" 8#250 /dieresis 8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft\n"); printf(" 8#254 /logicalnot 8#255 /hyphen 8#256 /registered 8#257 /macron\n"); printf(" 8#260 /degree 8#261 /plusminus 8#262 /twosuperior 8#263 /threesuperior\n"); printf(" 8#264 /acute 8#265 /mu 8#266 /paragraph 8#267 /periodcentered\n"); printf(" 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine 8#273 /guillemotright\n"); printf(" 8#274 /onequarter 8#275 /onehalf 8#276 /threequarters 8#277 /questiondown\n"); printf(" 8#300 /Agrave 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde\n"); printf(" 8#304 /Adieresis 8#305 /Aring 8#306 /AE 8#307 /Ccedilla\n"); printf(" 8#310 /Egrave 8#311 /Eacute 8#312 /Ecircumflex 8#313 /Edieresis\n"); printf(" 8#314 /Igrave 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis\n"); printf(" 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve 8#323 /Oacute\n"); printf(" 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply\n"); printf(" 8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex\n"); printf(" 8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls\n"); printf(" 8#340 /agrave 8#341 /aacute 8#342 /acircumflex 8#343 /atilde\n"); printf(" 8#344 /adieresis 8#345 /aring 8#346 /ae 8#347 /ccedilla\n"); printf(" 8#350 /egrave 8#351 /eacute 8#352 /ecircumflex 8#353 /edieresis\n"); printf(" 8#354 /igrave 8#355 /iacute 8#356 /icircumflex 8#357 /idieresis\n"); printf(" 8#360 /eth 8#361 /ntilde 8#362 /ograve 8#363 /oacute\n"); printf(" 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide\n"); printf(" 8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex\n"); printf(" 8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_2 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_2 (void) { printf("%%\n"); printf("%% ISO 8859-2 (Latin2) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /Aogonek 8#242 /breve 8#243 /Lslash\n"); printf(" 8#244 /currency 8#245 /Lcaron 8#246 /Sacute 8#247 /section\n"); printf(" 8#250 /dieresis 8#251 /Scaron 8#252 /Scedilla 8#253 /Tcaron\n"); printf(" 8#254 /Zacute 8#255 /uni00AD 8#256 /Zcaron 8#257 /Zdotaccent\n"); printf(" 8#260 /degree 8#261 /aogonek 8#262 /ogonek 8#263 /lslash\n"); printf(" 8#264 /acute 8#265 /lcaron 8#266 /sacute 8#267 /caron\n"); printf(" 8#270 /cedilla 8#271 /scaron 8#272 /scedilla 8#273 /tcaron\n"); printf(" 8#274 /zacute 8#275 /hungarumlaut 8#276 /zcaron 8#277 /zdotaccent\n"); printf(" 8#300 /Racute 8#301 /Aacute 8#302 /Acircumflex 8#303 /Abreve\n"); printf(" 8#304 /Adieresis 8#305 /Lacute 8#306 /Cacute 8#307 /Ccedilla\n"); printf(" 8#310 /Ccaron 8#311 /Eacute 8#312 /Eogonek 8#313 /Edieresis\n"); printf(" 8#314 /Ecaron 8#315 /Iacute 8#316 /Icircumflex 8#317 /Dcaron\n"); printf(" 8#320 /Dcroat 8#321 /Nacute 8#322 /Ncaron 8#323 /Oacute\n"); printf(" 8#324 /Ocircumflex 8#325 /Ohungarumlaut 8#326 /Odieresis 8#327 /multiply\n"); printf(" 8#330 /Rcaron 8#331 /Uring 8#332 /Uacute 8#333 /Uhungarumlaut\n"); printf(" 8#334 /Udieresis 8#335 /Yacute 8#336 /uni0162 8#337 /germandbls\n"); printf(" 8#340 /racute 8#341 /aacute 8#342 /acircumflex 8#343 /abreve\n"); printf(" 8#344 /adieresis 8#345 /lacute 8#346 /cacute 8#347 /ccedilla\n"); printf(" 8#350 /ccaron 8#351 /eacute 8#352 /eogonek 8#353 /edieresis\n"); printf(" 8#354 /ecaron 8#355 /iacute 8#356 /icircumflex 8#357 /dcaron\n"); printf(" 8#360 /dcroat 8#361 /nacute 8#362 /ncaron 8#363 /oacute\n"); printf(" 8#364 /ocircumflex 8#365 /ohungarumlaut 8#366 /odieresis 8#367 /divide\n"); printf(" 8#370 /rcaron 8#371 /uring 8#372 /uacute 8#373 /uhungarumlaut\n"); printf(" 8#374 /udieresis 8#375 /yacute 8#376 /uni0163 8#377 /dotaccent\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_3 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_3 (void) { printf("%%\n"); printf("%% ISO 8859-3 (Latin3) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /Hbar 8#242 /breve 8#243 /sterling\n"); printf(" 8#244 /currency 8#245 /yen 8#246 /Hcircumflex 8#247 /section\n"); printf(" 8#250 /dieresis 8#251 /Idotaccent 8#252 /Scedilla 8#253 /Gbreve\n"); printf(" 8#254 /Jcircumflex 8#255 /uni00AD 8#256 /registered 8#257 /Zdotaccent\n"); printf(" 8#260 /degree 8#261 /hbar 8#262 /twosuperior 8#263 /threesuperior\n"); printf(" 8#264 /acute 8#265 /mu 8#266 /hcircumflex 8#267 /periodcentered\n"); printf(" 8#270 /cedilla 8#271 /dotlessi 8#272 /scedilla 8#273 /gbreve\n"); printf(" 8#274 /jcircumflex 8#275 /onehalf 8#276 /threequarters 8#277 /zdotaccent\n"); printf(" 8#300 /Agrave 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde\n"); printf(" 8#304 /Adieresis 8#305 /Cdotaccent 8#306 /Ccircumflex 8#307 /Ccedilla\n"); printf(" 8#310 /Egrave 8#311 /Eacute 8#312 /Ecircumflex 8#313 /Edieresis\n"); printf(" 8#314 /Igrave 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis\n"); printf(" 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve 8#323 /Oacute\n"); printf(" 8#324 /Ocircumflex 8#325 /Gdotaccent 8#326 /Odieresis 8#327 /multiply\n"); printf(" 8#330 /Gcircumflex 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex\n"); printf(" 8#334 /Udieresis 8#335 /Ubreve 8#336 /Scircumflex 8#337 /germandbls\n"); printf(" 8#340 /agrave 8#341 /aacute 8#342 /acircumflex 8#343 /atilde\n"); printf(" 8#344 /adieresis 8#345 /cdotaccent 8#346 /ccircumflex 8#347 /ccedilla\n"); printf(" 8#350 /egrave 8#351 /eacute 8#352 /ecircumflex 8#353 /edieresis\n"); printf(" 8#354 /igrave 8#355 /iacute 8#356 /icircumflex 8#357 /idieresis\n"); printf(" 8#360 /eth 8#361 /ntilde 8#362 /ograve 8#363 /oacute\n"); printf(" 8#364 /ocircumflex 8#365 /gdotaccent 8#366 /odieresis 8#367 /divide\n"); printf(" 8#370 /gcircumflex 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex\n"); printf(" 8#374 /udieresis 8#375 /ubreve 8#376 /scircumflex 8#377 /dotaccent\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_4 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_4 (void) { printf("%%\n"); printf("%% ISO 8859-4 (Latin4) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /Aogonek 8#242 /kgreenlandic 8#243 /Rcommaaccent\n"); printf(" 8#244 /currency 8#245 /Itilde 8#246 /Lcommaaccent 8#247 /section\n"); printf(" 8#250 /dieresis 8#251 /Scaron 8#252 /Emacron 8#253 /Gcommaaccent\n"); printf(" 8#254 /Tbar 8#255 /uni00AD 8#256 /Zcaron 8#257 /macron\n"); printf(" 8#260 /degree 8#261 /aogonek 8#262 /ogonek 8#263 /rcommaaccent\n"); printf(" 8#264 /acute 8#265 /itilde 8#266 /lcommaaccent 8#267 /caron\n"); printf(" 8#270 /cedilla 8#271 /scaron 8#272 /emacron 8#273 /gcommaaccent\n"); printf(" 8#274 /tbar 8#275 /Eng 8#276 /zcaron 8#277 /eng\n"); printf(" 8#300 /Amacron 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde\n"); printf(" 8#304 /Adieresis 8#305 /Aring 8#306 /AE 8#307 /Iogonek\n"); printf(" 8#310 /Ccaron 8#311 /Eacute 8#312 /Eogonek 8#313 /Edieresis\n"); printf(" 8#314 /Edotaccent 8#315 /Iacute 8#316 /Icircumflex 8#317 /Imacron\n"); printf(" 8#320 /Dcroat 8#321 /Ncommaaccent 8#322 /Omacron 8#323 /Kcommaaccent\n"); printf(" 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply\n"); printf(" 8#330 /Oslash 8#331 /Uogonek 8#332 /Uacute 8#333 /Ucircumflex\n"); printf(" 8#334 /Udieresis 8#335 /Utilde 8#336 /Umacron 8#337 /germandbls\n"); printf(" 8#340 /amacron 8#341 /aacute 8#342 /acircumflex 8#343 /atilde\n"); printf(" 8#344 /adieresis 8#345 /aring 8#346 /ae 8#347 /iogonek\n"); printf(" 8#350 /ccaron 8#351 /eacute 8#352 /eogonek 8#353 /edieresis\n"); printf(" 8#354 /edotaccent 8#355 /iacute 8#356 /icircumflex 8#357 /imacron\n"); printf(" 8#360 /dcroat 8#361 /ncommaaccent 8#362 /omacron 8#363 /kcommaaccent\n"); printf(" 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide\n"); printf(" 8#370 /oslash 8#371 /uogonek 8#372 /uacute 8#373 /ucircumflex\n"); printf(" 8#374 /udieresis 8#375 /utilde 8#376 /umacron 8#377 /dotaccent\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_5 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_5 (void) { printf("%%\n"); printf("%% ISO 8859-5 (Cyrillic) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /afii10023 8#242 /afii10051 8#243 /afii10052\n"); printf(" 8#244 /afii10053 8#245 /afii10054 8#246 /afii10055 8#247 /afii10056\n"); printf(" 8#250 /afii10057 8#251 /afii10058 8#252 /afii10059 8#253 /afii10060\n"); printf(" 8#254 /afii10061 8#255 /uni00AD 8#256 /afii10062 8#257 /afii10145\n"); printf(" 8#260 /afii10017 8#261 /afii10018 8#262 /afii10019 8#263 /afii10020\n"); printf(" 8#264 /afii10021 8#265 /afii10022 8#266 /afii10024 8#267 /afii10025\n"); printf(" 8#270 /afii10026 8#271 /afii10027 8#272 /afii10028 8#273 /afii10029\n"); printf(" 8#274 /afii10030 8#275 /afii10031 8#276 /afii10032 8#277 /afii10033\n"); printf(" 8#300 /afii10034 8#301 /afii10035 8#302 /afii10036 8#303 /afii10037\n"); printf(" 8#304 /afii10038 8#305 /afii10039 8#306 /afii10040 8#307 /afii10041\n"); printf(" 8#310 /afii10042 8#311 /afii10043 8#312 /afii10044 8#313 /afii10045\n"); printf(" 8#314 /afii10046 8#315 /afii10047 8#316 /afii10048 8#317 /afii10049\n"); printf(" 8#320 /afii10065 8#321 /afii10066 8#322 /afii10067 8#323 /afii10068\n"); printf(" 8#324 /afii10069 8#325 /afii10070 8#326 /afii10072 8#327 /afii10073\n"); printf(" 8#330 /afii10074 8#331 /afii10075 8#332 /afii10076 8#333 /afii10077\n"); printf(" 8#334 /afii10078 8#335 /afii10079 8#336 /afii10080 8#337 /afii10081\n"); printf(" 8#340 /afii10082 8#341 /afii10083 8#342 /afii10084 8#343 /afii10085\n"); printf(" 8#344 /afii10086 8#345 /afii10087 8#346 /afii10088 8#347 /afii10089\n"); printf(" 8#350 /afii10090 8#351 /afii10091 8#352 /afii10092 8#353 /afii10093\n"); printf(" 8#354 /afii10094 8#355 /afii10095 8#356 /afii10096 8#357 /afii10097\n"); printf(" 8#360 /afii61352 8#361 /afii10071 8#362 /afii10099 8#363 /afii10100\n"); printf(" 8#364 /afii10101 8#365 /afii10102 8#366 /afii10103 8#367 /afii10104\n"); printf(" 8#370 /afii10105 8#371 /afii10106 8#372 /afii10107 8#373 /afii10108\n"); printf(" 8#374 /afii10109 8#375 /section 8#376 /afii10110 8#377 /afii10193\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_6 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_6 (void) { printf("%%%%%% %%\n"); printf("%%%%%% %% ISO 8859-6 (Arabic) character mappings\n"); printf("%%%%%% %% \n"); printf("%%%%%% %% This PostScript encoding vector is currently undefined because the\n"); printf("%%%%%% %% information needed to create it was not found.\n"); printf("%%%%%% %% \n"); printf("%%%%%% /alt_mappings [\n"); printf("%%%%%% ] readonly def\n"); printf("\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_7 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_7 (void) { printf("%%\n"); printf("%% ISO 8859-7 (Greek) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /afii64937 8#242 /afii57929 8#243 /sterling\n"); printf(" 8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section\n"); printf(" 8#250 /dieresis 8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft\n"); printf(" 8#254 /logicalnot 8#255 /uni00AD 8#256 /registered 8#257 /afii00208\n"); printf(" 8#260 /degree 8#261 /plusminus 8#262 /twosuperior 8#263 /threesuperior\n"); printf(" 8#264 /tonos 8#265 /dieresistonos 8#266 /Alphatonos 8#267 /periodcentered\n"); printf(" 8#270 /Epsilontonos 8#271 /Etatonos 8#272 /Iotatonos 8#273 /guillemotright\n"); printf(" 8#274 /Omicrontonos 8#275 /onehalf 8#276 /Upsilontonos 8#277 /Omegatonos\n"); printf(" 8#300 /iotadieresistonos 8#301 /Alpha 8#302 /Beta 8#303 /Gamma\n"); printf(" 8#304 /uni0394 8#305 /Epsilon 8#306 /Zeta 8#307 /Eta\n"); printf(" 8#310 /Theta 8#311 /Iota 8#312 /Kappa 8#313 /Lambda\n"); printf(" 8#314 /Mu 8#315 /Nu 8#316 /Xi 8#317 /Omicron\n"); printf(" 8#320 /Pi 8#321 /Rho 8#322 /Ograve 8#323 /Sigma\n"); printf(" 8#324 /Tau 8#325 /Upsilon 8#326 /Phi 8#327 /Chi\n"); printf(" 8#330 /Psi 8#331 /uni03A9 8#332 /Iotadieresis 8#333 /Upsilondieresis\n"); printf(" 8#334 /alphatonos 8#335 /epsilontonos 8#336 /etatonos 8#337 /iotatonos\n"); printf(" 8#340 /upsilondieresistonos 8#341 /alpha 8#342 /beta 8#343 /gamma\n"); printf(" 8#344 /delta 8#345 /epsilon 8#346 /zeta 8#347 /eta\n"); printf(" 8#350 /theta 8#351 /iota 8#352 /kappa 8#353 /lambda\n"); printf(" 8#354 /uni03BC 8#355 /nu 8#356 /xi 8#357 /omicron\n"); printf(" 8#360 /pi 8#361 /rho 8#362 /sigma1 8#363 /sigma\n"); printf(" 8#364 /tau 8#365 /upsilon 8#366 /phi 8#367 /chi\n"); printf(" 8#370 /psi 8#371 /omega 8#372 /iotadieresis 8#373 /upsilondieresis\n"); printf(" 8#374 /omicrontonos 8#375 /upsilontonos 8#376 /omegatonos 8#377 /ydieresis\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_8 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_8 (void) { printf("%%%%%% %%\n"); printf("%%%%%% %% ISO 8859-8 (Hebrew) character mappings\n"); printf("%%%%%% %% \n"); printf("%%%%%% %% This PostScript encoding vector is currently undefined because the\n"); printf("%%%%%% %% information needed to create it was not found.\n"); printf("%%%%%% %% \n"); printf("%%%%%% /alt_mappings [\n"); printf("%%%%%% ] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_9 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_9 (void) { printf("%%\n"); printf("%% ISO 8859-9 (Latin5) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /exclamdown 8#242 /cent 8#243 /sterling\n"); printf(" 8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section\n"); printf(" 8#250 /dieresis 8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft\n"); printf(" 8#254 /logicalnot 8#255 /uni00AD 8#256 /registered 8#257 /macron\n"); printf(" 8#260 /degree 8#261 /plusminus 8#262 /twosuperior 8#263 /threesuperior\n"); printf(" 8#264 /acute 8#265 /mu 8#266 /paragraph 8#267 /periodcentered\n"); printf(" 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine 8#273 /guillemotright\n"); printf(" 8#274 /onequarter 8#275 /onehalf 8#276 /threequarters 8#277 /questiondown\n"); printf(" 8#300 /Agrave 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde\n"); printf(" 8#304 /Adieresis 8#305 /Aring 8#306 /AE 8#307 /Ccedilla\n"); printf(" 8#310 /Egrave 8#311 /Eacute 8#312 /Ecircumflex 8#313 /Edieresis\n"); printf(" 8#314 /Igrave 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis\n"); printf(" 8#320 /Gbreve 8#321 /Ntilde 8#322 /Ograve 8#323 /Oacute\n"); printf(" 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply\n"); printf(" 8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex\n"); printf(" 8#334 /Udieresis 8#335 /Idotaccent 8#336 /Scedilla 8#337 /germandbls\n"); printf(" 8#340 /agrave 8#341 /aacute 8#342 /acircumflex 8#343 /atilde\n"); printf(" 8#344 /adieresis 8#345 /aring 8#346 /ae 8#347 /ccedilla\n"); printf(" 8#350 /egrave 8#351 /eacute 8#352 /ecircumflex 8#353 /edieresis\n"); printf(" 8#354 /igrave 8#355 /iacute 8#356 /icircumflex 8#357 /idieresis\n"); printf(" 8#360 /gbreve 8#361 /ntilde 8#362 /ograve 8#363 /oacute\n"); printf(" 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide\n"); printf(" 8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex\n"); printf(" 8#374 /udieresis 8#375 /dotlessi 8#376 /scedilla 8#377 /ydieresis\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_10 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_10 (void) { printf("%%\n"); printf("%% ISO 8859-10 (Latin6) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /Aogonek 8#242 /Emacron 8#243 /Gcommaaccent\n"); printf(" 8#244 /Imacron 8#245 /Itilde 8#246 /Kcommaaccent 8#247 /section\n"); printf(" 8#250 /Lcommaaccent 8#251 /Dcroat 8#252 /Scaron 8#253 /Tbar\n"); printf(" 8#254 /Zcaron 8#255 /uni00AD 8#256 /Umacron 8#257 /Eng\n"); printf(" 8#260 /degree 8#261 /aogonek 8#262 /emacron 8#263 /gcommaaccent\n"); printf(" 8#264 /imacron 8#265 /itilde 8#266 /kcommaaccent 8#267 /periodcentered\n"); printf(" 8#270 /lcommaaccent 8#271 /dcroat 8#272 /scaron 8#273 /tbar\n"); printf(" 8#274 /zcaron 8#275 /macron 8#276 /umacron 8#277 /eng\n"); printf(" 8#300 /Amacron 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde\n"); printf(" 8#304 /Adieresis 8#305 /Aring 8#306 /AE 8#307 /Iogonek\n"); printf(" 8#310 /Ccaron 8#311 /Eacute 8#312 /Eogonek 8#313 /Edieresis\n"); printf(" 8#314 /Emacron 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis\n"); printf(" 8#320 /Eth 8#321 /Ncommaaccent 8#322 /Omacron 8#323 /Oacute\n"); printf(" 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /Utilde\n"); printf(" 8#330 /Oslash 8#331 /Uogonek 8#332 /Uacute 8#333 /Ucircumflex\n"); printf(" 8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls\n"); printf(" 8#340 /amacron 8#341 /aacute 8#342 /acircumflex 8#343 /atilde\n"); printf(" 8#344 /adieresis 8#345 /aring 8#346 /ae 8#347 /iogonek\n"); printf(" 8#350 /ccaron 8#351 /eacute 8#352 /eogonek 8#353 /edieresis\n"); printf(" 8#354 /emacron 8#355 /iacute 8#356 /icircumflex 8#357 /idieresis\n"); printf(" 8#360 /eth 8#361 /ncommaaccent 8#362 /omacron 8#363 /oacute\n"); printf(" 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /utilde\n"); printf(" 8#370 /oslash 8#371 /uogonek 8#372 /uacute 8#373 /ucircumflex\n"); printf(" 8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /kgreenlandic\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_11 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_11 (void) { printf("%%\n"); printf("%% ISO 8859-11 (Thai) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /uni0E01 8#242 /uni0E02 8#243 /uni0E03\n"); printf(" 8#244 /uni0E04 8#245 /uni0E05 8#246 /uni0E06 8#247 /uni0E07\n"); printf(" 8#250 /uni0E08 8#251 /uni0E09 8#252 /uni0E0A 8#253 /uni0E0B\n"); printf(" 8#254 /uni0E0C 8#255 /uni0E0D 8#256 /uni0E0E 8#257 /uni0E0F\n"); printf(" 8#260 /uni0E10 8#261 /uni0E11 8#262 /uni0E12 8#263 /uni0E13\n"); printf(" 8#264 /uni0E14 8#265 /uni0E15 8#266 /uni0E16 8#267 /uni0E17\n"); printf(" 8#270 /uni0E18 8#271 /uni0E19 8#272 /uni0E1A 8#273 /uni0E1B\n"); printf(" 8#274 /uni0E1C 8#275 /uni0E1D 8#276 /uni0E1E 8#277 /uni0E1F\n"); printf(" 8#300 /uni0E20 8#301 /uni0E21 8#302 /uni0E22 8#303 /uni0E23\n"); printf(" 8#304 /uni0E24 8#305 /uni0E25 8#306 /uni0E26 8#307 /uni0E27\n"); printf(" 8#310 /uni0E28 8#311 /uni0E29 8#312 /uni0E2A 8#313 /uni0E2B\n"); printf(" 8#314 /uni0E2C 8#315 /uni0E2D 8#316 /uni0E2E 8#317 /uni0E2F\n"); printf(" 8#320 /uni0E30 8#321 /uni0E31 8#322 /uni0E32 8#323 /uni0E33\n"); printf(" 8#324 /uni0E34 8#325 /uni0E35 8#326 /uni0E36 8#327 /uni0E37\n"); printf(" 8#330 /uni0E38 8#331 /uni0E39 8#332 /uni0E3A 8#333 /.notdef\n"); printf(" 8#334 /space 8#335 /.notdef 8#336 /.notdef 8#337 /uni0E3F\n"); printf(" 8#340 /uni0E40 8#341 /uni0E41 8#342 /uni0E42 8#343 /uni0E43\n"); printf(" 8#344 /uni0E44 8#345 /uni0E45 8#346 /uni0E46 8#347 /uni0E47\n"); printf(" 8#350 /uni0E48 8#351 /uni0E49 8#352 /uni0E4A 8#353 /uni0E4B\n"); printf(" 8#354 /uni0E4C 8#355 /uni0E4D 8#356 /uni0E4E 8#357 /uni0E4F\n"); printf(" 8#360 /uni0E50 8#361 /uni0E51 8#362 /uni0E52 8#363 /uni0E53\n"); printf(" 8#364 /uni0E54 8#365 /uni0E55 8#366 /uni0E56 8#367 /uni0E57\n"); printf(" 8#370 /uni0E58 8#371 /uni0E59 8#372 /uni0E5A 8#373 /.notdef\n"); printf(" 8#374 /.notdef 8#375 /.notdef 8#376 /.notdef 8#377 /.notdef\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_13 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_13 (void) { printf("%%\n"); printf("%% ISO 8859-13 (Latin7) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /quotedblright 8#242 /cent 8#243 /sterling\n"); printf(" 8#244 /currency 8#245 /quotedblbase 8#246 /brokenbar 8#247 /section\n"); printf(" 8#250 /Oslash 8#251 /copyright 8#252 /rcommaaccent 8#253 /guillemotleft\n"); printf(" 8#254 /logicalnot 8#255 /uni00AD 8#256 /registered 8#257 /AE\n"); printf(" 8#260 /degree 8#261 /plusminus 8#262 /twosuperior 8#263 /threesuperior\n"); printf(" 8#264 /quotedblleft 8#265 /mu 8#266 /paragraph 8#267 /periodcentered\n"); printf(" 8#270 /oslash 8#271 /onesuperior 8#272 /.notdef 8#273 /guillemotright\n"); printf(" 8#274 /onequarter 8#275 /onehalf 8#276 /threequarters 8#277 /ae\n"); printf(" 8#300 /Aogonek 8#301 /Iogonek 8#302 /Amacron 8#303 /Cacute\n"); printf(" 8#304 /Adieresis 8#305 /Aring 8#306 /Eogonek 8#307 /Emacron\n"); printf(" 8#310 /Ccaron 8#311 /Eacute 8#312 /Zacute 8#313 /Edotaccent\n"); printf(" 8#314 /Gcommaaccent 8#315 /Kcommaaccent 8#316 /Imacron 8#317 /Lcommaaccent\n"); printf(" 8#320 /Scaron 8#321 /Nacute 8#322 /Ncommaaccent 8#323 /Oacute\n"); printf(" 8#324 /Omacron 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply\n"); printf(" 8#330 /Uogonek 8#331 /Lslash 8#332 /Uacute 8#333 /Ucircumflex\n"); printf(" 8#334 /Udieresis 8#335 /Zdotaccent 8#336 /Zcaron 8#337 /germandbls\n"); printf(" 8#340 /aogonek 8#341 /Iogonek 8#342 /amacron 8#343 /cacute\n"); printf(" 8#344 /adieresis 8#345 /aring 8#346 /eogonek 8#347 /emacron\n"); printf(" 8#350 /ccaron 8#351 /eacute 8#352 /zacute 8#353 /edotaccent\n"); printf(" 8#354 /gcommaaccent 8#355 /kcommaaccent 8#356 /imacron 8#357 /lcommaaccent\n"); printf(" 8#360 /scaron 8#361 /nacute 8#362 /ncommaaccent 8#363 /oacute\n"); printf(" 8#364 /omacron 8#365 /otilde 8#366 /odieresis 8#367 /divide\n"); printf(" 8#370 /uogonek 8#371 /lslash 8#372 /uacute 8#373 /ucircumflex\n"); printf(" 8#374 /udieresis 8#375 /zdotaccent 8#376 /zcaron 8#377 /quoteright\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_14 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_14 (void) { printf("%%\n"); printf("%% ISO 8859-14 (Latin8) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /uni1E02 8#242 /uni1E03 8#243 /sterling\n"); printf(" 8#244 /Cdotaccent 8#245 /cdotaccent 8#246 /uni1E0A 8#247 /section\n"); printf(" 8#250 /Wgrave 8#251 /copyright 8#252 /Wacute 8#253 /uni1E0B\n"); printf(" 8#254 /Ygrave 8#255 /uni00AD 8#256 /registered 8#257 /Ydieresis\n"); printf(" 8#260 /uni1E1E 8#261 /uni1E1F 8#262 /Gdotaccent 8#263 /gdotaccent\n"); printf(" 8#264 /uni1E40 8#265 /uni1E41 8#266 /paragraph 8#267 /uni1E56\n"); printf(" 8#270 /wgrave 8#271 /uni1E57 8#272 /wacute 8#273 /uni1E60\n"); printf(" 8#274 /ygrave 8#275 /Wdieresis 8#276 /wdieresis 8#277 /uni1E61\n"); printf(" 8#300 /Agrave 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde\n"); printf(" 8#304 /Adieresis 8#305 /Aring 8#306 /AE 8#307 /Ccedilla\n"); printf(" 8#310 /Egrave 8#311 /Eacute 8#312 /Ecircumflex 8#313 /Edieresis\n"); printf(" 8#314 /Igrave 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis\n"); printf(" 8#320 /Wcircumflex 8#321 /Ntilde 8#322 /Ograve 8#323 /Oacute\n"); printf(" 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /uni1E6A\n"); printf(" 8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex\n"); printf(" 8#334 /Udieresis 8#335 /Yacute 8#336 /Ycircumflex 8#337 /germandbls\n"); printf(" 8#340 /agrave 8#341 /aacute 8#342 /acircumflex 8#343 /atilde\n"); printf(" 8#344 /adieresis 8#345 /aring 8#346 /ae 8#347 /ccedilla\n"); printf(" 8#350 /egrave 8#351 /eacute 8#352 /ecircumflex 8#353 /edieresis\n"); printf(" 8#354 /igrave 8#355 /iacute 8#356 /icircumflex 8#357 /idieresis\n"); printf(" 8#360 /wcircumflex 8#361 /ntilde 8#362 /ograve 8#363 /oacute\n"); printf(" 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /uni1E6B\n"); printf(" 8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex\n"); printf(" 8#374 /udieresis 8#375 /yacute 8#376 /ycircumflex 8#377 /ydieresis\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_15 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_15 (void) { printf("%%\n"); printf("%% ISO 8859-15 (Latin9 aka Latin0) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#240 /uni00A0 8#241 /exclamdown 8#242 /cent 8#243 /sterling\n"); printf(" 8#244 /Euro 8#245 /yen 8#246 /Scaron 8#247 /section\n"); printf(" 8#250 /scaron 8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft\n"); printf(" 8#254 /logicalnot 8#255 /uni00AD 8#256 /registered 8#257 /macron\n"); printf(" 8#260 /degree 8#261 /plusminus 8#262 /twosuperior 8#263 /threesuperior\n"); printf(" 8#264 /Zcaron 8#265 /mu 8#266 /paragraph 8#267 /periodcentered\n"); printf(" 8#270 /zcaron 8#271 /onesuperior 8#272 /ordmasculine 8#273 /guillemotright\n"); printf(" 8#274 /OE 8#275 /oe 8#276 /Ydieresis 8#277 /questiondown\n"); printf(" 8#300 /Agrave 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde\n"); printf(" 8#304 /Adieresis 8#305 /Aring 8#306 /AE 8#307 /Ccedilla\n"); printf(" 8#310 /Egrave 8#311 /Eacute 8#312 /Ecircumflex 8#313 /Edieresis\n"); printf(" 8#314 /Igrave 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis\n"); printf(" 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve 8#323 /Oacute\n"); printf(" 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply\n"); printf(" 8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex\n"); printf(" 8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls\n"); printf(" 8#340 /agrave 8#341 /aacute 8#342 /acircumflex 8#343 /atilde\n"); printf(" 8#344 /adieresis 8#345 /aring 8#346 /ae 8#347 /ccedilla\n"); printf(" 8#350 /egrave 8#351 /eacute 8#352 /ecircumflex 8#353 /edieresis\n"); printf(" 8#354 /igrave 8#355 /iacute 8#356 /icircumflex 8#357 /idieresis\n"); printf(" 8#360 /eth 8#361 /ntilde 8#362 /ograve 8#363 /oacute\n"); printf(" 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide\n"); printf(" 8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex\n"); printf(" 8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_16 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_iso8859_16 (void) { printf("%%%%%% %%\n"); printf("%%%%%% %% ISO 8859-16 (Latin10) character mappings\n"); printf("%%%%%% %% \n"); printf("%%%%%% %% This PostScript encoding vector is currently undefined because the\n"); printf("%%%%%% %% information needed to create it was not found.\n"); printf("%%%%%% %% \n"); printf("%%%%%% /alt_mappings [\n"); printf("%%%%%% ] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_koi8_r Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_koi8_r (void) { printf("%%\n"); printf("%% KOI8-R (Russian) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector was derived from the information at the following\n"); printf("%% website (circa Jan 2005), which covers several character mappings:\n"); printf("%% \n"); printf("%% http://bibliofile.mc.duke.edu/gww/fonts/postscript-utilities/encoding-vectors.html\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#200 /SF100000 8#201 /SF110000 8#202 /SF010000 8#203 /SF030000\n"); printf(" 8#204 /SF020000 8#205 /SF040000 8#206 /SF080000 8#207 /SF090000\n"); printf(" 8#210 /SF060000 8#211 /SF070000 8#212 /SF050000 8#213 /upblock\n"); printf(" 8#214 /dnblock 8#215 /block 8#216 /lfblock 8#217 /rtblock\n"); printf(" 8#220 /ltshade 8#221 /shade 8#222 /dkshade 8#223 /integraltp\n"); printf(" 8#224 /filledbox 8#225 /uni2219 8#226 /radical 8#227 /approxequal\n"); printf(" 8#230 /lessequal 8#231 /greaterequal 8#232 /uni00A0 8#233 /integralbt\n"); printf(" 8#234 /degree 8#235 /twosuperior 8#236 /periodcentered 8#237 /divide\n"); printf(" 8#240 /SF430000 8#241 /SF240000 8#242 /SF510000 8#243 /afii10071\n"); printf(" 8#244 /SF520000 8#245 /SF390000 8#246 /SF220000 8#247 /SF210000\n"); printf(" 8#250 /SF250000 8#251 /SF500000 8#252 /SF490000 8#253 /SF380000\n"); printf(" 8#254 /SF280000 8#255 /SF270000 8#256 /SF260000 8#257 /SF360000\n"); printf(" 8#260 /SF370000 8#261 /SF420000 8#262 /SF190000 8#263 /afii10023\n"); printf(" 8#264 /SF200000 8#265 /SF230000 8#266 /SF470000 8#267 /SF480000\n"); printf(" 8#270 /SF410000 8#271 /SF450000 8#272 /SF460000 8#273 /SF400000\n"); printf(" 8#274 /SF540000 8#275 /SF530000 8#276 /SF440000 8#277 /copyright\n"); printf(" 8#300 /afii10096 8#301 /afii10065 8#302 /afii10066 8#303 /afii10088\n"); printf(" 8#304 /afii10069 8#305 /afii10070 8#306 /afii10086 8#307 /afii10068\n"); printf(" 8#310 /afii10087 8#311 /afii10074 8#312 /afii10075 8#313 /afii10076\n"); printf(" 8#314 /afii10077 8#315 /afii10078 8#316 /afii10079 8#317 /afii10080\n"); printf(" 8#320 /afii10081 8#321 /afii10097 8#322 /afii10082 8#323 /afii10083\n"); printf(" 8#324 /afii10084 8#325 /afii10085 8#326 /afii10072 8#327 /afii10067\n"); printf(" 8#330 /afii10094 8#331 /afii10093 8#332 /afii10073 8#333 /afii10090\n"); printf(" 8#334 /afii10095 8#335 /afii10091 8#336 /afii10089 8#337 /afii10092\n"); printf(" 8#340 /afii10048 8#341 /afii10017 8#342 /afii10018 8#343 /afii10040\n"); printf(" 8#344 /afii10021 8#345 /afii10022 8#346 /afii10038 8#347 /afii10020\n"); printf(" 8#350 /afii10039 8#351 /afii10026 8#352 /afii10027 8#353 /afii10028\n"); printf(" 8#354 /afii10029 8#355 /afii10030 8#356 /afii10031 8#357 /afii10032\n"); printf(" 8#360 /afii10033 8#361 /afii10049 8#362 /afii10034 8#363 /afii10035\n"); printf(" 8#364 /afii10036 8#365 /afii10037 8#366 /afii10024 8#367 /afii10019\n"); printf(" 8#370 /afii10046 8#371 /afii10045 8#372 /afii10025 8#373 /afii10042\n"); printf(" 8#374 /afii10047 8#375 /afii10043 8#376 /afii10041 8#377 /afii10044\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_iso8859_koi8_u Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_koi8_u (void) { printf("%%\n"); printf("%% KOI8-U (Ukrainian) character mappings\n"); printf("%% \n"); printf("%% This PostScript encoding vector came from the Ukrainian language patch\n"); printf("%% provided by Volodymyr M. Lisivka .\n"); printf("%% \n"); printf("/alt_mappings [\n"); printf(" 8#200 /SF100000 8#201 /SF110000 8#202 /SF010000 8#203 /SF030000\n"); printf(" 8#204 /SF020000 8#205 /SF040000 8#206 /SF080000 8#207 /SF090000\n"); printf(" 8#210 /SF060000 8#211 /SF070000 8#212 /SF050000 8#213 /upblock\n"); printf(" 8#214 /dnblock 8#215 /block 8#216 /lfblock 8#217 /rtblock\n"); printf(" 8#220 /ltshade 8#221 /shade 8#222 /dkshade 8#223 /integraltp\n"); printf(" 8#224 /filledbox 8#225 /periodcentered 8#226 /radical 8#227 /approxequal\n"); printf(" 8#230 /lessequal 8#231 /greaterequal 8#232 /space 8#233 /integralbt\n"); printf(" 8#234 /degree 8#235 /twosuperior 8#236 /periodcentered 8#237 /divide\n"); printf(" 8#240 /SF430000 8#241 /SF240000 8#242 /SF510000 8#243 /afii10071\n"); printf(" 8#244 /afii10101 8#245 /SF390000 8#246 /afii10103 8#247 /afii10104\n"); printf(" 8#250 /SF250000 8#251 /SF500000 8#252 /SF490000 8#253 /SF380000\n"); printf(" 8#254 /SF280000 8#255 /afii10098 8#256 /SF260000 8#257 /SF360000\n"); printf(" 8#260 /SF370000 8#261 /SF420000 8#262 /SF190000 8#263 /afii10023\n"); printf(" 8#264 /afii10053 8#265 /SF230000 8#266 /afii10055 8#267 /afii10056\n"); printf(" 8#270 /SF410000 8#271 /SF450000 8#272 /SF460000 8#273 /SF400000\n"); printf(" 8#274 /SF540000 8#275 /afii10050 8#276 /SF440000 8#277 /copyright\n"); printf(" 8#300 /afii10096 8#301 /afii10065 8#302 /afii10066 8#303 /afii10088\n"); printf(" 8#304 /afii10069 8#305 /afii10070 8#306 /afii10086 8#307 /afii10068\n"); printf(" 8#310 /afii10087 8#311 /afii10074 8#312 /afii10075 8#313 /afii10076\n"); printf(" 8#314 /afii10077 8#315 /afii10078 8#316 /afii10079 8#317 /afii10080\n"); printf(" 8#320 /afii10081 8#321 /afii10097 8#322 /afii10082 8#323 /afii10083\n"); printf(" 8#324 /afii10084 8#325 /afii10085 8#326 /afii10072 8#327 /afii10067\n"); printf(" 8#330 /afii10094 8#331 /afii10093 8#332 /afii10073 8#333 /afii10090\n"); printf(" 8#334 /afii10095 8#335 /afii10091 8#336 /afii10089 8#337 /afii10092\n"); printf(" 8#340 /afii10048 8#341 /afii10017 8#342 /afii10018 8#343 /afii10040\n"); printf(" 8#344 /afii10021 8#345 /afii10022 8#346 /afii10038 8#347 /afii10020\n"); printf(" 8#350 /afii10039 8#351 /afii10026 8#352 /afii10027 8#353 /afii10028\n"); printf(" 8#354 /afii10029 8#355 /afii10030 8#356 /afii10031 8#357 /afii10032\n"); printf(" 8#360 /afii10033 8#361 /afii10049 8#362 /afii10034 8#363 /afii10035\n"); printf(" 8#364 /afii10036 8#365 /afii10037 8#366 /afii10024 8#367 /afii10019\n"); printf(" 8#370 /afii10046 8#371 /afii10045 8#372 /afii10025 8#373 /afii10042\n"); printf(" 8#374 /afii10047 8#375 /afii10043 8#376 /afii10041 8#377 /afii10044\n"); printf("] readonly def\n"); return; } /* --------------------------------------------------------------------------- encvec_roman8 Notes: This routine outputs a particular PostScript encoding vector, used to support any languages which use that encoding. */ void encvec_roman8 (void) { printf("%%\n"); printf("%% Roman8 character mappings\n"); printf("%%\n"); printf("/alt_mappings [\n"); printf(" 8#241 /Agrave 8#242 /Acircumflex 8#243 /Egrave\n"); printf(" 8#244 /Ecircumflex 8#245 /Edieresis 8#246 /Icircumflex 8#247 /Idieresis\n"); printf(" 8#250 /acute 8#251 /grave 8#252 /circumflex 8#253 /dieresis\n"); printf(" 8#254 /tilde 8#255 /Ugrave 8#256 /Ucircumflex 8#257 /sterling\n"); printf(" 8#260 /macron 8#261 /Yacute 8#262 /yacute 8#263 /degree\n"); printf(" 8#264 /Ccedilla 8#265 /ccedilla 8#266 /Ntilde 8#267 /ntilde\n"); printf(" 8#270 /exclamdown 8#271 /questiondown 8#272 /currency 8#273 /sterling\n"); printf(" 8#274 /yen 8#275 /section 8#276 /florin 8#277 /cent\n"); printf(" 8#300 /acircumflex 8#301 /ecircumflex 8#302 /ocircumflex 8#303 /ucircumflex\n"); printf(" 8#304 /aacute 8#305 /eacute 8#306 /oacute 8#307 /uacute\n"); printf(" 8#310 /agrave 8#311 /egrave 8#312 /ograve 8#313 /ugrave\n"); printf(" 8#314 /adieresis 8#315 /edieresis 8#316 /odieresis 8#317 /udieresis\n"); printf(" 8#320 /Aring 8#321 /icircumflex 8#322 /Oslash 8#323 /AE\n"); printf(" 8#324 /aring 8#325 /iacute 8#326 /oslash 8#327 /ae\n"); printf(" 8#330 /Adieresis 8#331 /igrave 8#332 /Odieresis 8#333 /Udieresis\n"); printf(" 8#334 /Eacute 8#335 /idieresis 8#336 /germandbls 8#337 /Ocircumflex\n"); printf(" 8#340 /Aacute 8#341 /Atilde 8#342 /atilde 8#343 /Eth\n"); printf(" 8#344 /eth 8#345 /Iacute 8#346 /Igrave 8#347 /Oacute\n"); printf(" 8#350 /Ograve 8#351 /Otilde 8#352 /otilde 8#353 /Scaron\n"); printf(" 8#354 /scaron 8#355 /Uacute 8#356 /Ydieresis 8#357 /ydieresis\n"); printf(" 8#360 /thorn 8#361 /Thorn 8#362 /dotaccent 8#363 /mu\n"); printf(" 8#364 /paragraph 8#365 /threequarters 8#366 /hyphen 8#367 /onequarter\n"); printf(" 8#370 /onehalf 8#371 /ordfeminine 8#372 /ordmasculine 8#373 /guillemotleft\n"); printf(" 8#374 /bullet 8#375 /guillemotright 8#376 /plusminus 8#377 /.notdef\n"); printf("] readonly def\n"); return; } pcal-4.11.0/src/exprpars.c0000644000175000001440000002667210461264660013522 0ustar wusers/* --------------------------------------------------------------------------- exprpars.c Notes: This file contains routines for parsing 'if{n}def'-style expressions. Revision history: 4.10.0 B.Marr 2006-07-19 Reformatted comments and code to match my standards. B.Marr 2006-07-12 Provide explicit casting in several spots to avoid warnings in a "gcc 3.4.2 on Solaris 8" environment, based on a report from David Mathog . Get rid of all the '#ifdef PROTOS' checks, which are pretty much obsolete these days and just needlessly clutter up the code. 4.8.0 B.Marr 2004-11-15 Remove Ctl-L (page eject) characters from source file. Rename 'find_sym()' routine to 'find_sym_name()' for unambiguous searches now that we have new 'find_sym_val()' routine. 4.7 AWR 02/24/1998 add prototypes (using PROTO macro) to function pointer declarations 12/21/1997 clean up gcc warnings in -Wall mode 07/27/1997 delete obsolete FPR and PRT macros 4.6 AWR 12/05/1995 delete vestiges of never-pursued idea from next_token(): permit "if -" syntax, which would have determined whether or not "-" had been set 4.5 AWR 04/28/1993 restructure function definitions so function name appears in first column (to facilitate searching for definition by name) 4.0 AWR 02/06/1991 Author */ /* --------------------------------------------------------------------------- Header Files */ #include #include #include #include "pcaldefs.h" #include "protos.h" /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ typedef short OPERAND; /* types for operand and operator stacks */ typedef short OPERATOR; typedef struct { char *name; /* token spelling */ short type; /* token type code */ short value; /* associated value */ } TOKEN; typedef struct { short prec; /* precedence */ short type; /* token type (TK_UNARYOP or TK_BINARYOP) */ OPERAND (*pfcn) (OPERAND *); /* dispatch function */ } OPR; /* --------------------------------------------------------------------------- Constant Declarations */ /* * token type code definitions: */ #define TK_UNKNOWN 0 /* codes returned by next_token() */ #define TK_IDENT 1 #define TK_LPAREN 2 #define TK_RPAREN 3 #define TK_UNARYOP 4 #define TK_BINARYOP 5 #define TK_ENDINPUT 6 #define TK_STARTINPUT 7 /* special code for start symbol */ /* bit position for token type codes (cf. where_ok[] below) */ #define ID_OK (1 << TK_IDENT) #define LP_OK (1 << TK_LPAREN) #define RP_OK (1 << TK_RPAREN) #define UO_OK (1 << TK_UNARYOP) #define BO_OK (1 << TK_BINARYOP) #define ST_OK (1 << TK_STARTINPUT) #define NEVER_OK 0 /* * operator-related definitions: */ #define OP_AND 0 /* operator subcodes */ #define OP_OR 1 #define OP_XOR 2 #define OP_NEGATE 3 #define ENDINPUT_PREC -1 /* arbitrary number < lowest op. prec */ #define OR_PREC 1 /* operator precedence levels */ #define XOR_PREC 2 #define AND_PREC 3 #define NEGATE_PREC 4 #define PAREN_PREC 8 /* arbitrary number > highest op. prec */ /* lower bits of operator stack entry are code; higher are precedence */ #define OPR_BITS 4 #define OPR_MASK ((1 << OPR_BITS) - 1) #define PREC(op) ((op) >> OPR_BITS) #define OPCODE(op) ((op) & OPR_MASK) #define MAKE_OPR(p, o) (((p) << OPR_BITS) | (o)) /* size of operand and operator stacks */ #define MAX_OP 20 /* --------------------------------------------------------------------------- Macro Definitions */ /* is token "curr" legal after "prev"? (cf. where_ok[] below) */ #define IS_LEGAL(curr, prev) (where_ok[curr] & (1 << (prev))) #define NT_RETURN(p, t, v) do { *ptype = t; *pvalue = v; return p; } while (0) /* --------------------------------------------------------------------------- Data Declarations (including externals) */ /* prototypes for dispatch functions, declared early for use in operator table... */ static OPERAND do_and(OPERAND *); static OPERAND do_or(OPERAND *); static OPERAND do_xor(OPERAND *); static OPERAND do_negate(OPERAND *); /* operator table - entries must be in same order as 'OP_XXX' constants */ OPR opr_tbl[] = { { AND_PREC, TK_BINARYOP, do_and }, { OR_PREC, TK_BINARYOP, do_or }, { XOR_PREC, TK_BINARYOP, do_xor }, { NEGATE_PREC, TK_UNARYOP, do_negate } }; /* set of tokens which each token may legally follow (in TK_XXX order) */ int where_ok[] = { NEVER_OK , /* TK_UNKNOWN */ ST_OK | LP_OK | UO_OK | BO_OK , /* TK_IDENT */ ST_OK | LP_OK | UO_OK | BO_OK , /* TK_LPAREN */ ID_OK | LP_OK | RP_OK , /* TK_RPAREN */ ST_OK | LP_OK | BO_OK , /* TK_UNARYOP */ ID_OK | RP_OK , /* TK_BINARYOP */ ST_OK | ID_OK | RP_OK /* TK_ENDINPUT */ }; /* token table - note that substrings must follow longer strings */ TOKEN token_tbl[] = { { "&&", TK_BINARYOP, OP_AND }, /* synonym for "&" */ { "&", TK_BINARYOP, OP_AND }, { "||", TK_BINARYOP, OP_OR }, /* synonym for "|" */ { "|", TK_BINARYOP, OP_OR }, { "!", TK_UNARYOP, OP_NEGATE }, { "^", TK_BINARYOP, OP_XOR }, { "(", TK_LPAREN, 0 }, { ")", TK_RPAREN, 0 }, { NULL, TK_UNKNOWN, 0 } /* must be last entry */ }; /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ /* --------------------------------------------------------------------------- do_and Notes: This routine is a dispatch function for a specific operator. */ static OPERAND do_and (OPERAND *ptop) { return ptop[0] && ptop[-1]; } /* --------------------------------------------------------------------------- do_and Notes: This routine is a dispatch function for a specific operator. */ static OPERAND do_or (OPERAND *ptop) { return ptop[0] || ptop[-1]; } /* --------------------------------------------------------------------------- do_and Notes: This routine is a dispatch function for a specific operator. */ static OPERAND do_xor (OPERAND *ptop) { return (ptop[0] ^ ptop[-1]) != 0; } /* --------------------------------------------------------------------------- do_and Notes: This routine is a dispatch function for a specific operator. */ static OPERAND do_negate (OPERAND *ptop) { return ! ptop[0]; } /* --------------------------------------------------------------------------- lookup_token Notes: This routine looks up a token in the table. It returns a pointer to the table entry. */ static TOKEN * lookup_token (char *p) { TOKEN *ptok; for (ptok = token_tbl; ptok->name && strncmp(p, ptok->name, strlen(ptok->name)); ptok++) ; return ptok; } /* --------------------------------------------------------------------------- next_token Notes: This routine fetchs the next token from the input string. It fills in its type and value and returns a pointer to the following character. */ static char *next_token (char *p, int *ptype, int *pvalue) { TOKEN *ptok; char tokbuf[STRSIZ], *pb; while (*p && isspace((int)*p)) p++; /* skip whitespace */ if (*p == '\0') { /* end of input? */ NT_RETURN(p, TK_ENDINPUT, 0); } if (isalpha((int)*p)) { /* identifier */ pb = tokbuf; /* make local copy and look up */ while (*p && (isalpha((int)*p) || isdigit((int)*p) || *p == '_')) { *pb++ = *p++; } *pb = '\0'; NT_RETURN(p, TK_IDENT, find_sym_name(tokbuf)); } ptok = lookup_token(p); /* other token */ NT_RETURN(p + (ptok->name ? strlen(ptok->name) : 1), ptok->type, ptok->value); } /* --------------------------------------------------------------------------- parse_expr Notes: This routine parses an expression consisting of identifiers and logical operators. It returns 'TRUE' if the expression is true (identifier defined => true), 'FALSE' if false, and 'EXPR_ERR' if there's a syntax error in the expression. */ int parse_expr (char *pbuf) { OPERAND opd_stack[MAX_OP]; /* operand stack - TRUE/FALSE values */ OPERATOR opr_stack[MAX_OP]; /* operator stack - precedence | op */ int value, token, plevel, prec, result, npop, opr, opd, prev_token, op; plevel = 0; /* paren nesting level */ opd = opr = -1; /* indices of stack tops */ prev_token = TK_STARTINPUT; /* to detect null expressions */ if (DEBUG(DEBUG_PP)) fprintf(stderr, "evaluating expression '%s'\n", pbuf); do { pbuf = next_token(pbuf, &token, &value); /* check that the current token may follow the previous one */ if (! IS_LEGAL(token, prev_token)) return EXPR_ERR; switch(token) { case TK_IDENT: /* identifier => 1 if def, 0 if not */ opd_stack[++opd] = value != PP_SYM_UNDEF; break; case TK_LPAREN: /* left paren - bump nesting level */ ++plevel; break; case TK_RPAREN: /* right paren - decrement nesting */ if (--plevel < 0) return EXPR_ERR; break; case TK_ENDINPUT: /* end-of-input - treat as operator */ if (prev_token == TK_STARTINPUT) return FALSE; /* null expr => FALSE */ /* fall through */ case TK_UNARYOP: case TK_BINARYOP: /* get precedence of operator, adjusting for paren * nesting (TK_ENDINPUT has the lowest precedence * of all, to unwind operand/operator stacks at end) */ prec = token == TK_ENDINPUT ? ENDINPUT_PREC : (plevel * PAREN_PREC) + opr_tbl[value].prec; /* pop (and perform) any equal- or higher-precedence * operators on operator stack: extract operator, * check for operand stack underflow, execute * operator, adjust operand stack height and place * result of operator on top */ for ( ; opr >= 0 && PREC(opr_stack[opr]) >= prec; opr--) { op = OPCODE(opr_stack[opr]); npop = opr_tbl[op].type == TK_UNARYOP ? 0 : 1; if (opd < npop) return EXPR_ERR; result = (*opr_tbl[op].pfcn)(opd_stack + opd); opd_stack[opd -= npop] = result; } /* push operator (if any) onto stack */ if (token != TK_ENDINPUT) opr_stack[++opr] = MAKE_OPR(prec, value); break; default: /* should never get here */ return EXPR_ERR; break; } prev_token = token; } while (token != TK_ENDINPUT); /* done - check for dangling parens, and leftover operand/operators */ if (DEBUG(DEBUG_PP)) { fprintf(stderr, "evaluated to %s\n", opd_stack[0] ? "TRUE" : "FALSE"); } return plevel != 0 || opd != 0 || opr != -1 ? EXPR_ERR : /* leftover junk - return error */ opd_stack[0]; /* all OK - return final value */ } pcal-4.11.0/src/moonphas.c0000644000175000001440000003265310732017670013474 0ustar wusers/* --------------------------------------------------------------------------- moonphas.c Notes: This file contains routines for performing moon phase calculations. The following suite of routines are to calculate the phase of the moon for a given month, day, year. They compute the phase of the moon for noon (UT) on the day requested, the start of the Julian day. Revision history: 4.11.0 B.Marr 2007-12-15 Fix long-standing bug that only manifested itself in a DOS build environment whereby the phases of the moon were being erroneously detected on adjacent days. Remove long-obsolete external 'moon file' concept. Now, we depend solely on the algorithmic determination of moon phases. Rename some variables, structures, and/or routines to be clearer about their purpose and/or to allow easier searching with fewer "false positives". 4.10.0 B.Marr 2006-07-19 Rename macro 'CALC_PHASE()' to 'CALC_MOON_PHASE()' to avoid search collisions with routine 'calc_phase()'. Reformatted comments and code to match my standards. B.Marr 2006-07-12 Rename old 'getline()' routine to 'get_pcal_line()' to avoid a compile-time namespace collision with the standard C library, which seems to manifest itself only in Windows+Cygwin build environments. Fix longstanding bugs in the timezone offset ('-z' option) calculations. Use explicit units as part of variable name ('utc_offset' becomes 'utc_offset_days') to avoid confusion. Get rid of all the '#ifdef PROTOS' checks, which are pretty much obsolete these days and just needlessly clutter up the code. Use common definition of PI already provided by 'math.h'. 4.8.0 B.Marr 2004-11-15 Remove Ctl-L (page eject) characters from source file. Remove spaces embedded within tab fields. 4.7 AWR 02/24/1998 rename "template" (C++ reserved word) as "templt" (cf. make_moonfile()) 12/21/1997 clean up gcc warnings in -Wall mode 07/27/1997 delete obsolete FPR and PRT macros 4.5 AWR 11/06/1993 accept "opt -[AE]" in the moon file 06/25/1993 revise for pre-ANSI math libraries without fmod() 04/28/1993 restructure function definitions so function name appears in first column (to facilitate searching for definition by name) 04/22/1992 eliminated some unused variables and calculations 4.4 AWR 01/20/1992 use alternate timezone spec (-z) 12/16/1991 Revise find_moonfile() for efficiency 4.3 AWR 12/05/1991 Search for moon file in Pcal's path as well as in calendar file's path 10/25/1991 Many changes for support of moon phase wildcards and -Z flag 4.11 AWR 08/23/1991 Revise is_quarter() to eliminate occasional missing or duplicate quarter-moons in "-m" mode; add gen_phases() 4.1 AWR 08/02/1991 Fix bug in julday() where result is calculated incorrectly if floor() has no prototype 4.01 RLD 03/19/91 Upgraded calc_phase() to accurately calculate the lunar phase for any day without needing to resort to a moon file. 4.0 AWR 03/07/1991 Add find_moonfile() 01/15/1991 Author: translated PostScript routines to C and added moon file routines */ /* --------------------------------------------------------------------------- Header Files */ #include #include #include #include #include "pcaldefs.h" #include "pcallang.h" #include "protos.h" /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ /* --------------------------------------------------------------------------- Constant Declarations */ /* Astronomical constants. */ #define epoch 2444238.5 /* 1980 January 0.0 */ /* Constants defining the Sun's apparent orbit. */ #define elonge 278.833540 /* ecliptic longitude of the Sun at epoch 1980.0 */ #define elongp 282.596403 /* ecliptic longitude of the Sun at perigee */ #define eccent 0.016718 /* eccentricity of Earth's orbit */ /* Elements of the Moon's orbit, epoch 1980.0. */ #define mmlong 64.975464 /* moon's mean lonigitude at the epoch */ #define mmlongp 349.383063 /* mean longitude of the perigee at the epoch */ #define mlnode 151.950429 /* mean longitude of the node at the epoch */ #define synmonth 29.53058868 /* synodic month (new Moon to new Moon) */ /* --------------------------------------------------------------------------- Macro Definitions */ /* Handy mathematical functions. */ #define sgn(x) (((x) < 0) ? -1 : ((x) > 0 ? 1 : 0)) /* extract sign */ #ifndef abs #define abs(x) ((x) < 0 ? (-(x)) : (x)) /* absolute val */ #endif #define fixangle(a) ((a) - 360.0 * (floor((a) / 360.0))) /* fix angle */ #define torad(d) ((d) * (M_PI / 180.0)) /* deg->rad */ #define todeg(d) ((d) * (180.0 / M_PI)) /* rad->deg */ #define FNITG(x) (sgn (x) * floor (abs (x))) /* --------------------------------------------------------------------------- Data Declarations (including externals) */ /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ /* --------------------------------------------------------------------------- * Routines to accurately calculate the phase of the moon * * Originally adapted from "moontool.c" by John Walker, Release 2.0. * * This routine (calc_phase) and its support routines were adapted from * phase.c (v 1.2 88/08/26 22:29:42 jef) in the program "xphoon" * (v 1.9 88/08/26 22:29:47 jef) by Jef Poskanzer and Craig Leres. * The necessary notice follows... * * Copyright (C) 1988 by Jef Poskanzer and Craig Leres. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, * provided that the above copyright notice appear in all copies and that * both that copyright notice and this permission notice appear in * supporting documentation. This software is provided "as is" without * express or implied warranty. * * These were added to "pcal" by RLD on 19-MAR-1991 */ /* --------------------------------------------------------------------------- * julday -- calculate the julian date from input month, day, year * N.B. - The Julian date is computed for noon UT. * * Adopted from Peter Duffett-Smith's book `Astronomy With Your * Personal Computer' by Rick Dyson 18-MAR-1991 */ static double julday (int month, int day, int year) { int mn1, yr1; double a, b, c, d, djd; mn1 = month; yr1 = year; if ( yr1 < 0 ) yr1 = yr1 + 1; if ( month < 3 ) { mn1 = month + 12; yr1 = yr1 - 1; } if (( year < 1582 ) || ( year == 1582 && month < 10 ) || ( year == 1582 && month == 10 && day < 15.0 )) { b = 0; } else { a = floor (yr1 / 100.0); b = 2 - a + floor (a / 4); } if ( yr1 >= 0 ) c = floor (365.25 * yr1) - 694025; else c = FNITG ((365.25 * yr1) - 0.75) - 694025; d = floor (30.6001 * (mn1 + 1)); djd = b + c + d + day + 2415020.0; return djd; } /* --------------------------------------------------------------------------- * kepler - solve the equation of Kepler */ static double kepler (double m, double ecc) { double e, delta; #define EPSILON 1E-6 e = m = torad(m); do { delta = e - ecc * sin(e) - m; e -= delta / (1 - ecc * cos(e)); } while (abs(delta) > EPSILON); return e; } /* --------------------------------------------------------------------------- * calc_phase - calculate phase of moon as a fraction: * * The argument is the time for which the phase is requested, * expressed as the month, day and year. It returns the phase of * the moon (0.0 -> 0.99) with the ordering as New Moon, First Quarter, * Full Moon, and Last Quarter. * * Converted from the subroutine phase.c used by "xphoon.c" (see * above disclaimer) into calc_phase() for use in "moonphas.c" * by Rick Dyson 18-MAR-1991 */ double calc_phase (int month, int inday, int year) { double Day, N, M, Ec, Lambdasun, ml, MM; double Ev, Ae, A3, MmP, mEc, A4, lP, V, lPP, MoonAge, pdate, moon_phase; static int first = TRUE; static double utc_offset_days; /* Get the UTC offset on the first pass. The original code used to normalize the UTC offset to +/- 12 hours. But it was bug-ridden and also failed to take into account that some parts of the world have offsets from UTC greater than 12 hours! Therefore, beginning with v2.0.0, we don't attempt to normalize the user-specified UTC timezone offset at all. */ if (first) { utc_offset_days = atof(time_zone) / 24.0; if (DEBUG(DEBUG_MOON)) { fprintf(stderr, "time_zone='%s' utc_offset_days = %.5lf\n", time_zone, utc_offset_days); } first = FALSE; } /* need to convert month, day, year into a Julian pdate */ pdate = julday(month, inday, year) + utc_offset_days; /* Calculation of the Sun's position. */ Day = pdate - epoch; /* date within epoch */ N = fixangle((360 / 365.2422) * Day); /* mean anomaly of the Sun */ M = fixangle(N + elonge - elongp); /* convert from perigee co-ordinates to epoch 1980.0 */ Ec = kepler(M, eccent); /* solve equation of Kepler */ Ec = sqrt((1 + eccent) / (1 - eccent)) * tan(Ec / 2); Ec = 2 * todeg(atan(Ec)); /* true anomaly */ Lambdasun = fixangle(Ec + elongp); /* Sun's geocentric ecliptic longitude */ /* Calculation of the Moon's position. */ /* Moon's mean longitude. */ ml = fixangle(13.1763966 * Day + mmlong); /* Moon's mean anomaly. */ MM = fixangle(ml - 0.1114041 * Day - mmlongp); /* Moon's ascending node mean longitude. */ /* Not used -- commented out. */ /* MN = fixangle(mlnode - 0.0529539 * Day); */ /* Evection. */ Ev = 1.2739 * sin(torad(2 * (ml - Lambdasun) - MM)); /* Annual equation. */ Ae = 0.1858 * sin(torad(M)); /* Correction term. */ A3 = 0.37 * sin(torad(M)); /* Corrected anomaly. */ MmP = MM + Ev - Ae - A3; /* Correction for the equation of the centre. */ mEc = 6.2886 * sin(torad(MmP)); /* Another correction term. */ A4 = 0.214 * sin(torad(2 * MmP)); /* Corrected longitude. */ lP = ml + Ev + mEc - Ae + A4; /* Variation. */ V = 0.6583 * sin(torad(2 * (lP - Lambdasun))); /* True longitude. */ lPP = lP + V; /* Calculation of the phase of the Moon. */ /* Age of the Moon in degrees. */ MoonAge = lPP - Lambdasun; moon_phase = fixangle(MoonAge) / 360.0; if (moon_phase < 0.0) moon_phase += 1.0; /* fprintf(stderr, "Moon phase on %04d-%02d-%02d: %.5lf\n", year, month, inday, moon_phase); */ return (moon_phase); } /* --------------------------------------------------------------------------- * is_quarter - if current phase of moon coincides with quarter moon, return * MOON_NM, MOON_1Q, etc.; otherwise return MOON_OTHER; * */ static int is_quarter (double prev, double curr, double next) { int quarter; double phase, diff; /* adjust phases for 1 -> 0 wraparound */ if (curr < prev) curr++; if (next < prev) next++; /* if a quarter moon has occurred between "prev" and "next", return TRUE if * "curr" is closer to it than "prev" or "next" is */ for (quarter = 1; quarter <= 4; quarter++) { if (prev < (phase = quarter/4.0) && next > phase && (diff = fabs(curr - phase)) < phase - prev && diff < next - phase) { return quarter % 4; /* MOON_NM == 0 */ } } return MOON_OTHER; } /* --------------------------------------------------------------------------- * gen_phases - fill array with moon phases for all days in month/year (plus * extra entries at beginning and end for last day of previous month and * first day of next month, respectively) */ static void gen_phases (double phase[], int month, int year) { int day, len; date_str date; /* start with moon phase for last day of previous month */ MAKE_DATE(date, month, 0, year); normalize(&date); phase[0] = calc_phase(date.mm, date.dd, date.yy); /* add the moon phases for all days in the current month */ for (day = 1, len = LENGTH_OF(month, year); day <= len; day++) { phase[day] = calc_phase(month, day, year); } /* append the moon phase for the first day of next month */ MAKE_DATE(date, month, len + 1, year); normalize(&date); phase[len + 1] = calc_phase(date.mm, date.dd, date.yy); } /* --------------------------------------------------------------------------- * find_phase - calculate phase of moon using calc_phase() above. Sets * *pquarter to MOON_NM, MOON_1Q, etc. if quarter moon, MOON_OTHER if not */ double find_phase (int month, int day, int year, int *pquarter) { static int sv_year = 0, sv_month = 0; static double mphase[33]; /* 31 days + 2 dummies */ double phase; /* calculate moon phase */ /* new month? fill mphase[] with moon phases */ if (month != sv_month || year != sv_year) { gen_phases(mphase, month, year); sv_month = month; sv_year = year; } phase = mphase[day]; *pquarter = is_quarter(mphase[day-1], phase, mphase[day+1]); return phase; } pcal-4.11.0/src/pcal.c0000644000175000001440000022264510732017670012571 0ustar wusersstatic char VERSION_STRING[] = "@(#)pcal v4.11.0 - generate PostScript calendars"; #ifdef AMIGA #ifndef __AMIGADATE__ #define __AMIGADATE__ "("__DATE__")" #endif const char VERsion_STRING[] = "$VER: pcal 4.11.0 "__AMIGADATE__; #endif /* --------------------------------------------------------------------------- pcal.c Notes: This file contains routines to generate a PostScript file to print a calendar for any month and year. For information on this application, see the 'ReadMe.txt' file. 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 "bs(1)" by Bill Vogel of AT&T. Patrick's original PostScript was modified and enhanced several times by King Ables, Tim Tessin, Joe Wood, Jeff Mogul, Mark Hanson, and others whose names have regrettably been lost. This C version was originally created by Ken Keirnan of Pacific Bell; additional enhancements by Joseph P. Larson, Ed Hand, Andrew Rogers, Mark Kantrowitz, Joe Brownlee, Andy Fyfe, Steve Grandi, and Geoff Kuenning. The moon routines were originally written by Jef Poskanzer and Craig Leres, and were incorporated into Pcal by Richard Dyson. Note: Beginning with version 4.8.0, the 'man' page for 'pcal' is the most up-to-date source of authors and contributors to 'pcal'. Revision history: 4.11.0 B.Marr 2007-12-16 Allow the drawing of moon phase icons ('-m' or '-M') and Julian dates ('-j' or '-J') on yearly-format calendars. B.Marr 2007-12-15 Update version number in version string. Add support for new "on" preposition, thanks to a request from and in part to a patch from Erkki Petsalo. Eliminate the now-needless "F13" ("Friday the 13th") special event trigger and the associated processing of it. Add support for new '-W' option, to specify horizontal alignment of the "Month/Year" title on monthly-format calendars, thanks to a patch from Todd Foster. Add support for building on Amiga, thanks to a patch from Stefan Haubenthal. 4.10.0 B.Marr 2006-07-19 Merged 'pcalpapr.c' code into this file. Reformatted comments and code to match my standards. B.Marr 2006-07-12 Update version number in version string. Clarify 'pcal -h' output generation ('display_usage()' routine) with improved comments. Remove massive block of partially-obsolete comments describing 'pcal' options and usage. This information is adequately covered in other sources (e.g. 'man pcal') which are kept up-to-date. Remove unneeded code to tell user where output file was written. Drop support for obsolete platforms (Amiga, VMS, OS/2). Get rid of all the '#ifdef PROTOS' checks, which are pretty much obsolete these days and just needlessly clutter up the code. 4.9.1 B.Marr 2005-08-24 Update version number in version string. 4.9.0 B.Marr 2005-08-08 Eliminate the hack to support Esperanto via a custom, dedicated character encoding. Esperanto is now handled generically by the 'Latin3' (ISO 8859-3) character encoding. B.Marr 2005-01-24 Update version number in version string. Add support for several new character mappings (PostScript encoding vectors) in order to support a wider variety of languages. Rename enumerations for existing encodings to be more consistent (and easily searchable). 4.8.0 B.Marr 2004-12-04 Support new paper sizes. Support specification of paper size via run-time option (command-line, etc). Define new pre-processor symbols for paper size and page orientation. Remove spaces embedded within tab fields. Create and support concept of 'input' language versus 'output' language. Create separate variables for X/Y scaling and X/Y translation done by the program to distinguish from the X/Y scaling and X/Y translation specified by the user. Remove spaces embedded within tab fields. B.Marr 2004-11-13 Update version number in version string. Use new KOI8U mapping for newly-added Ukrainian language support. Remove Ctl-L (page eject) characters from source file. 4.7.1 SF 01/06/2003 added q-flag for 1-column output 4.7 AWR 01/25/2000 look for calendar file in directory where Pcal executable lives only if SEARCH_PCAL_DIR (cf. pcaldefs.h) is non-zero; this avoids conflicts if a program named 'calendar' has also been installed there revised default year calculation to fix Y2K-related problems reported under some flavors of Un*x 12/15/1998 postpone calculation of final_month and final_year until adjusted value of nmonths is known 06/19/1998 allow numeric (0-6) argument to -F (first day) flag 03/08/1998 treat scaling/translation factors and copy count as numeric values instead of strings (cf. pcaldefs.h) 03/08/1998 redefine several globals as numeric instead of string (cf. pcaldefs.h) 12/21/1997 clean up gcc warnings in -Wall mode 07/27/1997 revise for -H (generate HTML output) support (cf. writefil.c); delete obsolete FPR and PRT macros 07/27/1997 replace calendar_out global with output_type (PostScript, HTML, or Un*x 'calendar' utility output) 4.6 AWR 05/14/1997 replace obsolete CENTURY macro with call to century() (cf. pcalutil.c) 12/11/1995 predefine version symbol "vN_M" for pcal release vN.M (cf. init_misc()) 11/10/1995 support -T flag to select default font style (Bold/Italic/Roman) 10/31/1995 define "lang_XX" when language is set to XX (-a XX) 10/03/1995 use globals for initial and final month and year 10/03/1995 Add globals "init_month", "init_year", "nmonths", "final_month", "final_year" 09/21/1995 support "year all" syntax (calculate and save last year printed - cf. check_numargs()) 05/09/1995 support troff-style escape sequences in text (cf. pcalutil.c, pcalinit.ps) to set font style to bold/Italic/Roman 4.5 AWR 11/01/1994 update top-line comments to credit additional early Pcal hackers 11/16/1993 support red:green:blue shading value syntax (cf. writefil.c, pcalutil.ps) 11/03/1993 widen flag/argument field in usage() 10/01/1993 use define_font() and define_shading() (cf. pcalutil.c; latter replaces old gen_shading()) for font and shading redefinition 09/09/1993 predefine alternate character set mapping name (cf. writefil.c, fontmaps.ps, pcaldefs.h) 04/28/1993 restructure function definitions so function name appears in first column (to facilitate searching for definition by name) 02/05/1993 support -# flag (generate multiple copies of each page) 11/16/1992 Use common "protos.h" file (q.v.) 02/11/1992 Add support for predefined holidays (cf. pcallang.h, readfile.c) 4.4 AWR 02/10/1992 Pipe "help" message through filter defined by environment variable PAGER_ENV (cf. pcaldefs.h) 01/20/1992 Add -z flag (extension of change suggested by Steve Grandi) 01/15/1992 Add "holiday" to -b, -g; expand -b, -g functionality to -G, -O; allow range of weekday names in all 01/13/1992 Support alternate date and title font sizes (single-month calendars only) 01/05/1992 Support "{} " (cf. readfile.c) 4.3 AWR 12/06/1991 Attempted to simplify some of the mysteries surrounding command-line parsing; moved some processing from get_args() to new check_numargs() 12/05/1991 Search for moon file in directory where Pcal lives (cf. moonphas.c) 12/03/1991 Add -s flag to override default values for date/fill box shading 11/22/1991 Use cvt_escape() (new; cf. pcalutil.c) to convert escape sequences in command line strings 11/18/1991 Improve documentation; add init_misc() as catch-all for various initializations 10/25/1991 Support moon phases as wildcards 10/17/1991 Add -Z flag to generate debugging information; add a pre-pass through command line flags to detect -ZO prior to parsing PCAL_OPTS 10/15/1991 Revise logic of date file search 4.2 AWR 10/08/1991 Add -k and -K flags to control positioning of small calendars 10/03/1991 Add "note{/}" to select box for note text (as per Geoff Kuenning) Add -S flag to suppress generation of the small calendars 10/02/1991 Add -N flag to specify alternate heading for notes box Allow user to specify alternate notes font size (-n /) 10/01/1991 Add -u flag to generate version info and parameter usage message 09/30/1991 Support "if" and "elif" in date file 09/19/1991 Add -c flag to generate input file for Un*x "calendar" utility 4.11 AWR 08/20/1991 Add support for "nearest" keyword (as per Andy Fyfe) define "whole_year" when -w set 08/21/1991 Support %u, %w, %D, %M format specs and optional number following %[+-] (cf. writefil.c) 4.1 AWR 08/16/1991 Add -G flag to print "gray" dates as outlined, gray-filled characters Fix potential bug in julday() (cf. moonphas.c) 4.02 AWR 07/02/1991 Add -v flag to print version info only; call find_executable() to get true program pathname (cf. pcalutil.c); add format specifiers to text strings (cf. writefil.c) 4.01 AWR 03/19/1991 Incorporate revised moonphas.c (q.v.) 4.0 AWR 02/24/1991 Add alt_fopen() to search for file in alternate path; use to look for date file in same directory as Pcal executable (as per Floyd Miller) Support negative ordinals (cf. readfile.c, pcalutil.c) Support expressions in preprocessor "if{n}def" lines (cf. exprpars.c) Support "even", "odd" ordinals (cf. readfile.c) and ordinals > 5th Support -B (leave unused boxes blank) flag Separated into moonphas.c, pcal.c, pcalutil.c, readfile.c, and writefil.c; added support for moon phase file Support -w (whole year) flag; fix various bugs and nonportable constructs 4.0 AWR 01/28/1991 Added support for -b and -w flags */ /* --------------------------------------------------------------------------- Header Files */ #include #include #include #include #include "pcaldefs.h" #include "pcallang.h" #include "protos.h" /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ /* --------------------------------------------------------------------------- Constant Declarations */ /* --------------------------------------------------------------------------- Macro Definitions */ /* --------------------------------------------------------------------------- Data Declarations (including externals) */ static int nargs = 0; /* count of non-flag args */ static int numargs[MAXARGS]; /* non-flag (numeric) args */ static int map_default = TRUE; /* use default mapping */ static int oflag = FALSE; /* -o flag specified */ /* * Misc. globals */ year_info *head = NULL; /* head of internal data structure */ int curr_year; /* current default year for date file entries */ int init_month; /* starting month */ int init_year; /* starting year */ int nmonths; /* number of months */ int final_month; /* ending month (calculated) */ int final_year; /* ending year (calculated) */ double xsval_pgm; /* X scaling value calculated by program */ double ysval_pgm; /* Y scaling value calculated by program*/ int xtval_pgm; /* X translation value calculated by program */ int ytval_pgm; /* Y translation value calculated by program */ char *words[MAXWORD]; /* maximum number of words per date file line */ char lbuf[LINSIZ]; /* date file source line buffer */ char progname[STRSIZ]; /* program name (for error messages) */ char progpath[STRSIZ]; /* directory where executable lives */ char version[20]; /* program version (for info messages) */ /* lengths and offsets of months in common year */ char month_len[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; short month_off[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; /* dispatch table of functions for wildcard matching routines */ int (*pdatefcn[]) (int, int, int) = { is_anyday, is_weekday, is_workday, is_holiday, not_weekday, not_workday, not_holiday, is_newmoon, is_firstq, is_fullmoon, is_lastq }; /* * Default values for command-line options: */ char default_color[] = DAY_COLOR; /* -b, -g, -G, -O */ char day_color[7]; int holiday_color; int weekday_color = WEEKDAY_COLOR; int datefile_type = SYS_DATEFILE; /* -e, -f */ char datefile[STRSIZ] = ""; int rotate = ROTATE; /* -l, -p */ int draw_moons = DRAW_MOONS; /* -m, -M */ char datefont[STRSIZ] = DATEFONT; /* -d, -t, -n */ char titlefont[STRSIZ] = TITLEFONT; char notesfont[STRSIZ] = NOTESFONT; int mapfonts = MAPFONTS; /* -r */ char shading[STRSIZ] = SHADING; /* -s */ char lfoot[STRSIZ] = LFOOT; /* -L, -C, -R */ char cfoot[STRSIZ] = CFOOT; char rfoot[STRSIZ] = RFOOT; char notes_hdr[STRSIZ]; /* -N (initialized in main()) */ int first_day_of_week = FIRST_DAY; /* -F */ int date_style = DATE_STYLE; /* -A, -E */ char outfile[STRSIZ] = ""; /* -o */ double xsval_user = 1.0; /* -x, -y, -X, -Y */ double ysval_user = 1.0; int xtval_user = 0; int ytval_user = 0; int julian_dates = JULIAN_DATES; /* -j */ int do_whole_year = DO_WHOLE_YEAR; /* -w */ int output_type = OUTPUT_TYPE; /* -c, -H */ int one_column = 0; /* -q */ int blank_boxes = BLANK_BOXES; /* -B */ int ncopy = NCOPY; /* -# */ int small_cal_pos = SMALL_CAL_POS; /* -k, -K, -S */ int prev_cal_box[4] = PREV_CAL_BOX; int next_cal_box[4] = NEXT_CAL_BOX; char time_zone[STRSIZ] = TIMEZONE; /* -z */ int tz_flag = FALSE; char title_align[STRSIZ] = TITLE_ALIGN; /* -W */ int debug_flags = 0; /* -Z */ /* must be in same order as color definitions in pcaldefs.h; also see * "prtday{}" in pcalinit.ps */ char *color_names[] = { W_BLACK, W_GRAY, W_OUTLINE, W_OUTLINE_GRAY }; /* Must be a 2-D array so address within may be used as an initializer; * wildcard names must be in same order as symbolic names in pcaldefs.h * Note that the weekday names were superseded by days_ml[][] throughout * as of v4.6; only the wildcards are still used */ char *days[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", /* weekday names */ "day", "weekday", "workday", HOLIDAY, "nonweekday", "nonworkday", "nonholiday" /* wildcards */ }; /* preprocessor tokens: token name, token code, dispatch routine; note that * substring "if" must follow "ifdef" and "ifndef" for proper matching */ KWD_F pp_info[] = { { "define", PP_DEFINE, do_define }, { "elif", PP_ELIF, do_ifdef }, { "else", PP_ELSE, NULL }, { "endif", PP_ENDIF, NULL }, { "ifdef", PP_IFDEF, do_ifdef }, { "ifndef", PP_IFNDEF, do_ifndef }, { "if", PP_IFDEF, do_ifdef }, /* "ifdef" synonym */ { "include", PP_INCLUDE, NULL }, /* do_include */ { "undef", PP_UNDEF, do_undef }, { NULL, PP_OTHER, NULL } /* must be last */ }; /* ordinal numbers - e.g. "first Monday in September": ordinal name, * ordinal code, ordinal value; note that "all" is parsed as a keyword * and (depending on context) may be subsequently treated as an ordinal */ KWD_O ordinals[] = { { "first", ORD_POSNUM, FIRST }, { "second", ORD_POSNUM, SECOND }, { "third", ORD_POSNUM, THIRD }, { "fourth", ORD_POSNUM, FOURTH }, { "fifth", ORD_POSNUM, FIFTH }, { "last", ORD_NEGNUM, LAST }, { "odd", ORD_ODD, 0 }, { "even", ORD_EVEN, 0 }, { NULL, ORD_OTHER, 0 } /* must be last */ }; /* predefined events (often, but not always, holiday events): event name, * definition, and dispatch function. The definition and dispatch function * are mutually exclusive; those events which can easily be redefined as an * equivalent Pcal date are translated in-line by parse_date() using the * definition string, while the "hard" ones - e.g., Easter - each use a * dedicated dispatch function instead. (The syntax for Christmas is awkward, * but unlike the obvious "12/25" it is independent of American/European date * parsing conventions.) */ KWD_H predef_events[] = { { "Christmas", "25th day of December", NULL }, { "Thanksgiving", "Fourth Thu in November", NULL }, { "Easter", NULL, find_easter }, { "Good_Friday", "Friday before Easter", NULL }, #ifndef NO_ORTHODOX /* Orthodox Easter related */ { "GEaster", NULL, find_odox_easter }, { "Gstgeorge", NULL, find_odox_stgeorge }, { "Gmarcus", NULL, find_odox_marcus }, #endif /* !NO_ORTHODOX */ { NULL, NULL, NULL } /* must be last */ }; /* allowable suffixes for ordinal numbers - these must be in order 0, 1, 2... * according to the rules of the target language; cf. ordinal_suffix() below */ char *ord_suffix[] = { "th", "st", "nd", "rd", NULL }; /* prepositions - e.g., "Friday after fourth Thursday in November" */ KWD preps[] = { { "before", PR_BEFORE }, { "preceding", PR_BEFORE }, { "on_or_before", PR_ON_BEFORE }, { "oob", PR_ON_BEFORE }, { "after", PR_AFTER }, { "following", PR_AFTER }, { "on_or_after", PR_ON_AFTER }, { "ooa", PR_ON_AFTER }, { "nearest", PR_NEAREST }, { "nearest_before", PR_NEAREST_BEFORE }, { "nearest_after", PR_NEAREST_AFTER }, { "on", PR_ON }, { NULL, PR_OTHER } /* must be last */ }; /* other keywords */ KWD keywds[] = { { ALL, DT_ALL }, { "each", DT_ALL }, { "every", DT_ALL }, { "note", DT_NOTE }, { "opt", DT_OPT }, { "input-language", DT_INPUT_LANGUAGE }, { "year", DT_YEAR }, { "delete", DT_DELETE }, { NULL, DT_OTHER } /* must be last */ }; /* moon phases (for moon file) */ KWD phases[] = { { "new_moon", MOON_NM }, /* new moon */ { "nm", MOON_NM }, { "first_quarter", MOON_1Q }, /* first quarter */ { "1Q", MOON_1Q }, { "FQ", MOON_1Q }, { "full_moon", MOON_FM }, /* full moon */ { "FM", MOON_FM }, { "last_quarter", MOON_3Q }, /* last (third) quarter */ { "LQ", MOON_3Q }, { "third_quarter", MOON_3Q }, { "3Q", MOON_3Q }, { NULL, MOON_OTHER } /* must be last */ }; /* default notes box header */ char default_notes_hdr[] = "Notes"; /* default font style (must be Roman) */ char fontstyle[] = W_ROMAN; /* * Flag usage information - not strictly language-dependent, but here anyway * (N.B.: all flags must be represented by an entry in this table!) * * Flags may appear in any of three places: in environment variable * PCAL_OPTS, on the command line, or in "opt" lines in the date file. * The command line is actually parsed twice: once before reading the date * file to get the flags needed in processing it (-[bcefgklpwADEKSU]), and * and again after reading the date file to give the user one last chance * to override any of the other flags set earlier. (Note, however, that * the only way to turn off -J|-j [Julian dates], -M|-m [moons], -w [whole * year], or -G|-O [outline "gray" dates] once selected is to use -I to * reinitialize all program defaults.) * * The table below supplies the following information about each flag: * * - Its name (cf. symbolic definitions above) * * - Whether or not it can take an (optional) argument * * - Which passes parse it - in order, they are: P_CMD0 ("pre-pass" of * command line to find debugging flags), P_ENV (environment variable), * P_CMD1 (first command line pass), P_OPT ("opt" lines in date file), * and P_CMD2 (second command line pass). * * The basic idea here is that some flags need to be in effect prior * to reading the date file (e.g., -E, -A) while the user should * be able to override other flags set in the date file (e.g., -d, * -n, -t) on the command line if desired. Two flags - F_OUTLINE * and F_OUTLINE_GRAY - are processed in both command-line passes, for * backward compatibility with earlier versions of Pcal (cf. pcal.c). */ FLAG_USAGE flag_tbl[] = { /* flag name arg? passes where parsed */ { F_INITIALIZE, FALSE, P_ENV | P_CMD1 | P_OPT | P_CMD2 }, { F_BLACK_DAY, TRUE, P_ENV | P_CMD1 | P_OPT }, { F_GRAY_DAY, TRUE, P_ENV | P_CMD1 | P_OPT }, { F_OUTLINE, TRUE, P_ENV | P_CMD1 | P_OPT | P_CMD2 }, { F_OUTLINE_GRAY, TRUE, P_ENV | P_CMD1 | P_OPT | P_CMD2 }, { F_DAY_FONT, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_NOTES_FONT, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_TITLE_FONT, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_REMAP_FONT, TRUE, P_ENV | P_CMD1 | P_OPT }, { F_PAPERSIZE, TRUE, P_ENV | P_CMD1 | P_OPT }, { F_EMPTY_CAL, FALSE, P_ENV | P_CMD1 }, { F_DATE_FILE, TRUE, P_ENV | P_CMD1 }, { F_OUT_FILE, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_LANDSCAPE, FALSE, P_ENV | P_CMD1 | P_OPT | P_CMD2 }, { F_PORTRAIT, FALSE, P_ENV | P_CMD1 | P_OPT | P_CMD2 }, { F_HELP, FALSE, P_CMD0 }, { F_USAGE, FALSE, P_CMD0 }, { F_VERSION, FALSE, P_CMD0 }, { F_MOON_4, FALSE, P_ENV | P_OPT | P_CMD2 }, { F_MOON_ALL, FALSE, P_ENV | P_OPT | P_CMD2 }, { F_DEFINE, TRUE, P_ENV | P_CMD1 }, { F_UNDEF, TRUE, P_ENV | P_CMD1 }, { F_L_FOOT, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_C_FOOT, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_R_FOOT, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_NOTES_HDR, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_FIRST_DAY, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_USA_DATES, FALSE, P_ENV | P_CMD1 | P_OPT }, { F_EUR_DATES, FALSE, P_ENV | P_CMD1 | P_OPT }, { F_X_TRANS, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_Y_TRANS, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_X_SCALE, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_Y_SCALE, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_JULIAN, FALSE, P_ENV | P_OPT | P_CMD2 }, { F_JULIAN_ALL, FALSE, P_ENV | P_OPT | P_CMD2 }, { F_WHOLE_YEAR, FALSE, P_ENV | P_CMD1 | P_OPT }, { F_BLANK_BOXES, FALSE, P_ENV | P_OPT | P_CMD2 }, { F_NUM_PAGES, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_SC_NONE, FALSE, P_ENV | P_CMD1 | P_OPT }, { F_SC_FIRST, FALSE, P_ENV | P_CMD1 | P_OPT }, { F_SC_SPLIT, FALSE, P_ENV | P_CMD1 | P_OPT }, { F_SHADING, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_CALENDAR, FALSE, P_ENV | P_CMD1 }, { F_HTML, FALSE, P_ENV | P_CMD1 }, { F_1COLUMN, FALSE, P_ENV | P_CMD1 }, { F_TIMEZONE, TRUE, P_ENV | P_OPT | P_CMD2 }, { F_SETLANG, TRUE, P_ENV | P_CMD1 | P_OPT }, { F_TYPEFACE, TRUE, P_ENV | P_CMD1 | P_OPT }, { F_TITLEALIGN, TRUE, P_ENV | P_CMD1 | P_OPT }, { F_DEBUG, TRUE, P_CMD0 | P_ENV | P_OPT }, { '-', FALSE, P_ENV | P_CMD1 | P_OPT | P_CMD2 }, { '\0', FALSE, P_ENV | P_CMD1 | P_OPT | P_CMD2 } /* must be last */ }; /* subflags for debug info flag F_DEBUG */ DEBUG_INFO debug_info[] = { { D_DATES, DEBUG_DATES }, { D_FILE_PATHS, DEBUG_PATHS }, { D_MOON, DEBUG_MOON }, { D_OPT, DEBUG_OPTS }, { D_PREPROCESSOR, DEBUG_PP }, { D_TEXT, DEBUG_TEXT }, { '\0', 0 } /* must be last */ }; /* to be filled in by display_usage() */ static char Xtval[VALSIZ], Ytval[VALSIZ], Xsval[VALSIZ], Ysval[VALSIZ], Ncopy[VALSIZ]; /* * Message strings to be printed by usage() - translate as necessary */ FLAG_MSG flag_msg[] = { /* flag name metasyntax description default */ { F_INITIALIZE, NULL, "initialize all parameters to program defaults", NULL }, { END_GROUP }, { F_BLACK_DAY, W_DAY2, "print specified day(s) in black", NULL }, { F_GRAY_DAY, W_DAY2, "print specified day(s) in day-numerics color ('-s')", NULL }, { F_OUTLINE, W_DAY2, "print specified day(s) as outline", NULL }, { F_OUTLINE_GRAY, W_DAY2, "print specified day(s) as filled outline", NULL }, { END_GROUP }, { F_SHADING, W_SHADING, "specify colors for day-numerics and empty-box-fill", NULL }, { ' ', NULL, " ", SHADING }, { END_GROUP }, { F_DAY_FONT, W_FONT_SIZE, "specify alternate date font and optional size ", NULL }, { ' ', NULL, " ", DATEFONT }, { F_NOTES_FONT, W_FONT_SIZE, "specify alternate notes font and optional size ", NULL }, { ' ', NULL, " ", NOTESFONT }, { F_TITLE_FONT, W_FONT_SIZE, "specify alternate title font and optional size ", NULL }, { ' ', NULL, " ", TITLEFONT }, { END_GROUP }, { F_REMAP_FONT, W_MAPPING, "remap 8-bit characters (Latin1, KOI8-U, Roman8, etc)", NULL }, #if MAPFONTS == ENC_LATIN_1 { GROUP_DEFAULT, MAPPING_LATIN_1 }, #elif MAPFONTS == ENC_LATIN_2 { GROUP_DEFAULT, MAPPING_LATIN_2 }, #elif MAPFONTS == ENC_LATIN_3 { GROUP_DEFAULT, MAPPING_LATIN_3 }, #elif MAPFONTS == ENC_LATIN_4 { GROUP_DEFAULT, MAPPING_LATIN_4 }, #elif MAPFONTS == ENC_CYRILLIC { GROUP_DEFAULT, MAPPING_CYRILLIC }, /* #elif MAPFONTS == ENC_ARABIC */ /* currently unsupported */ /* { GROUP_DEFAULT, MAPPING_ARABIC }, */ #elif MAPFONTS == ENC_GREEK { GROUP_DEFAULT, MAPPING_GREEK }, /* #elif MAPFONTS == ENC_HEBREW */ /* currently unsupported */ /* { GROUP_DEFAULT, MAPPING_HEBREW }, */ #elif MAPFONTS == ENC_LATIN_5 { GROUP_DEFAULT, MAPPING_LATIN_5 }, #elif MAPFONTS == ENC_LATIN_6 { GROUP_DEFAULT, MAPPING_LATIN_6 }, #elif MAPFONTS == ENC_THAI { GROUP_DEFAULT, MAPPING_THAI }, #elif MAPFONTS == ENC_LATIN_7 { GROUP_DEFAULT, MAPPING_LATIN_7 }, #elif MAPFONTS == ENC_LATIN_8 { GROUP_DEFAULT, MAPPING_LATIN_8 }, #elif MAPFONTS == ENC_LATIN_9 { GROUP_DEFAULT, MAPPING_LATIN_9 }, /* #elif MAPFONTS == ENC_LATIN_10 */ /* currently unsupported */ /* { GROUP_DEFAULT, MAPPING_LATIN_10 }, */ #elif MAPFONTS == ENC_KOI8_R { GROUP_DEFAULT, MAPPING_KOI8_R }, #elif MAPFONTS == ENC_KOI8_U { GROUP_DEFAULT, MAPPING_KOI8_U }, #elif MAPFONTS == ENC_ROMAN8 { GROUP_DEFAULT, MAPPING_ROMAN8 }, #else { GROUP_DEFAULT, "language-specific mapping" }, #endif { END_GROUP }, { F_EMPTY_CAL, NULL, "generate empty calendar (ignore date file)", NULL }, { END_GROUP }, { F_DATE_FILE, W_FILE, "specify alternate date file", DATEFILE }, { END_GROUP }, #ifdef DEFAULT_OUTFILE { F_OUT_FILE, W_FILE, "specify alternate output file", DEFAULT_OUTFILE }, #else { F_OUT_FILE, W_FILE, "specify alternate output file", "stdout" }, #endif { END_GROUP }, { F_LANDSCAPE, NULL, "generate landscape-style calendar", NULL }, { F_PORTRAIT, NULL, "generate portrait-style calendar", NULL }, #if ROTATE == LANDSCAPE { GROUP_DEFAULT, "landscape" }, #else { GROUP_DEFAULT, "portrait" }, #endif { END_GROUP }, { F_PAPERSIZE, W_PAPERSIZE, "specify paper size (letter, legal, a4, tabloid)", NULL }, { END_GROUP }, { F_HELP, NULL, "print this help message", NULL }, { F_USAGE, NULL, "print parameter usage message", NULL }, { F_VERSION, NULL, "print version information", NULL }, { END_GROUP }, { F_MOON_4, NULL, "draw 'moon phase' icon at full/new/quarter moons", NULL }, { F_MOON_ALL, NULL, "draw 'moon phase' icon every day", NULL }, #if DRAW_MOONS == NO_MOONS { GROUP_DEFAULT, "no moons" }, #else #if DRAW_MOONS == SOME_MOONS { GROUP_DEFAULT, "full/new/quarter moons" }, #else { GROUP_DEFAULT, "every day" }, #endif #endif { END_GROUP }, { F_DEFINE, W_SYMBOL, "define preprocessor symbol", NULL }, { F_UNDEF, W_SYMBOL, "undefine preprocessor symbol", NULL }, { END_GROUP }, { F_L_FOOT, W_STRING, "specify left foot string", LFOOT }, { F_C_FOOT, W_STRING, "specify center foot string", CFOOT }, { F_R_FOOT, W_STRING, "specify right foot string", RFOOT }, { END_GROUP }, { F_NOTES_HDR, W_STRING, "specify header for notes box", default_notes_hdr }, { END_GROUP }, { F_FIRST_DAY, W_DAY, "specify starting day of week", days_ml[LANG_DEFAULT][FIRST_DAY] }, { END_GROUP }, { F_USA_DATES, NULL, "parse American dates (\"mm/dd{/yy}\" and/or \"month dd\")", NULL }, { F_EUR_DATES, NULL, "parse European dates (\"dd/mm{/yy}\" and/or \"dd month\")", NULL }, #if DATE_STYLE == USA_DATES { GROUP_DEFAULT, "American" }, #else { GROUP_DEFAULT, "European" }, #endif { END_GROUP }, { F_X_TRANS, W_VALUE, "specify x-axis translation", Xtval }, { F_Y_TRANS, W_VALUE, "specify y-axis translation", Ytval }, { F_X_SCALE, W_VALUE, "specify x-axis scale factor", Xsval }, { F_Y_SCALE, W_VALUE, "specify y-axis scale factor", Ysval }, { END_GROUP }, { F_JULIAN, NULL, "print Julian day (day of year)", NULL }, { F_JULIAN_ALL, NULL, "print Julian day and days remaining in year", NULL }, #if JULIAN_DATES == NO_JULIANS { GROUP_DEFAULT, "neither" }, #else #if JULIAN_DATES == SOME_JULIANS { GROUP_DEFAULT, "Julian day" }, #else { GROUP_DEFAULT, "both" }, #endif #endif { END_GROUP }, #if DO_WHOLE_YEAR == FALSE { F_WHOLE_YEAR, NULL, "print whole year (12 consecutive months) per page", NULL }, #else { F_WHOLE_YEAR, NULL, "print individual months one per page", NULL }, #endif { END_GROUP }, #if BLANK_BOXES == FALSE { F_BLANK_BOXES, NULL, "leave unused boxes blank", NULL }, #else { F_BLANK_BOXES, NULL, "shade unused boxes", NULL }, #endif { END_GROUP }, { F_NUM_PAGES, W_N, "print copies of each output page", Ncopy }, { END_GROUP }, { F_SC_NONE, NULL, "suppress generation of small calendars", NULL }, { F_SC_FIRST, NULL, "print small calendars in first two boxes", NULL }, { F_SC_SPLIT, NULL, "print previous month in first box, next in last", NULL }, #if SMALL_CAL_POS == SC_LAST { GROUP_DEFAULT, "last two boxes" }, #else #if SMALL_CAL_POS == SC_FIRST { GROUP_DEFAULT, "first two boxes" }, #else #if SMALL_CAL_POS == SC_SPLIT { GROUP_DEFAULT, "first/last boxes" }, #else { GROUP_DEFAULT, "suppress small calendars" }, #endif #endif #endif { END_GROUP }, { F_CALENDAR, NULL, "generate input for Unix calendar(1) utility", NULL }, { F_HTML, NULL, "generate calendar as HTML table", NULL }, { END_GROUP }, { F_1COLUMN, NULL, "print one column per month (HTML)", NULL }, { END_GROUP }, { F_TIMEZONE, W_VALUE, "specify time zone in hours west of GMT/UTC", NULL }, { GROUP_DEFAULT, TIMEZONE }, { END_GROUP }, { F_SETLANG, W_LANG, "specify output language for day/month names", NULL }, { GROUP_DEFAULT, lang_id[LANG_DEFAULT] }, { END_GROUP }, { F_TYPEFACE, W_TYPEFACE, "specify font style (Bold | Italic | Roman)", NULL }, { GROUP_DEFAULT, W_ROMAN }, { END_GROUP }, { F_TITLEALIGN, W_TITLEALIGN, "specify title alignment", NULL }, { GROUP_DEFAULT, "center" }, { END_GROUP }, { END_LIST } /* must be last */ }; /* Numeric parameter descriptions and text */ PARAM_MSG param_msg[] = { { "YY", "generate calendar for year YY (20YY if YY < 100)" }, { "MM YY", "generate calendar for month MM (Jan = 1), year YY" }, { "MM YY N", "generate calendars for N months, starting at MM/YY" }, { "(default)", "generate calendar for current month and year" }, { "", "" }, { "if -w specified:", "" }, { "", "" }, { "YY", "generate calendar for year YY (20YY if YY < 100)" }, { "MM YY", "generate calendar for 12 months, starting at MM/YY" }, { "MM YY N", "generate calendars for N months, starting at MM/YY" }, { "", " (N rounded up to next multiple of 12)" }, { "(default)", "generate calendar for current year" }, { NULL, NULL } /* must be last */ }; /* Define the values associated with each of the supported paper sizes. All dimensions are provided in typographic points (72nds of an inch). Values defined here include the common name associated with that paper size, the page dimensions (shortest first), and the dimensions (width, height) of a 'day box' on a monthly-format calendar printed in landscape orientation. */ paper_info_str_typ paper_info[] = { { "Letter", /* name of this paper size */ 612, 792, /* U.S. 'Letter' = 8.5 x 11.0 inches */ 100, 80 /* 'daybox' width and height */ }, { "Legal", /* name of this paper size */ 612, 1008, /* U.S. 'Legal' = 8.5 x 14.0 inches */ 130, 80 /* 'daybox' width and height */ }, { "A4", /* name of this paper size */ 595, 842, /* International 'A4' = 210 x 297 mm */ 108, 77 /* 'daybox' width and height */ }, { "Tabloid", /* name of this paper size */ 792, 1224, /* 'Tabloid'/'Ledger' = 11.0 x 17.0 inches */ 161, 110 /* 'daybox' width and height */ }, }; /* Define the default paper size. */ int paper_size = PAPERSIZE_DEFAULT; /* These variables keep track of the page dimensions in typographic points (72nds of an inch). Note: Because of the possibility of different page orientations ('portrait' and 'landscape'), to avoid confusion, these variables are named and used independently of page orientation. That is, they're not termed 'width' and 'height' (which change depending on the orientation) but instead refer to the 'long' and 'short' axes of the paper (which don't change with orientation). */ int page_dim_short_axis_pts, page_dim_long_axis_pts; /* Define the width and height of a 'day box' (i.e. a box which represents a single day within a given month) in typographic points. Note: These values change depending on whether the selected orientation is 'portrait' or 'landscape'. */ int daybox_width_pts, daybox_height_pts; /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ /* --------------------------------------------------------------------------- init_misc Notes: This routine performs various initializations not easily handled in the header files. */ void init_misc (void) { char tmp[STRSIZ], *p; INIT_COLORS; /* copy default_color to day_color */ strcpy(notes_hdr, default_notes_hdr); /* initialize notes_hdr */ /* define preprocessor symbol "lang_XX" for default language XX */ do_define(gen_lang_sym(LANG_DEFAULT)); /* Define 'PAPERSIZE_XXX' (where XXX is the name of the selected paper * size). */ sprintf(tmp, "PAPERSIZE_%s", paper_info[paper_size].name); do_define(tmp); /* Define 'ORIENTATION_XXX' (where XXX is the name of the current paper * orientation -- 'portrait' or 'landscape'). */ sprintf(tmp, "ORIENTATION_%s", (rotate == PORTRAIT) ? "PORTRAIT" : "LANDSCAPE"); do_define(tmp); /* define preprocessor symbol vN_N for Pcal version vN.N */ strcpy(tmp, version); for (p = tmp; *p; p++) { if (*p == '.') *p = '_'; } do_define(tmp); return; } /* --------------------------------------------------------------------------- set_color Notes: This routine sets one or all weekdays (or all holidays) to print in the specified color. It can also accept ranges such as "mon-fri" or "sat-sun". The first parameter is the day-of-week name (or "all" or "holiday"). The second parameter is used to select black / gray / outline / outline-gray. */ void set_color (char *day, int col) { int i, j, max, count[NUM_COLORS]; char tmp[STRSIZ], *p; if (ci_strncmp(day, ALL, strlen(ALL)) == 0) { /* set all days */ for (i = 0; i < 7; i++) day_color[i] = col; } else if (ci_strncmp(day, HOLIDAY, MIN_DAY_LEN) == 0) { /* set holidays */ holiday_color = col; } else { /* set range of days */ strcpy(tmp, day); if ((p = strchr(tmp, '-')) != NULL) *p++ = '\0'; /* parse single day or range of days - return if error */ if ((i = get_weekday(tmp, FALSE)) == NOT_WEEKDAY || (j = p ? get_weekday(p, FALSE) : i) == NOT_WEEKDAY) { return; } /* set day colors, wrapping around end of week */ for (j = (i > j) ? j + 7 : j; i <= j; i++) day_color[i % 7] = col; } /* reset weekday_color to most prevalent color */ for (i = 0; i < NUM_COLORS; i++) { /* clear counts */ count[i] = 0; } for (i = SUN; i <= SAT; i++) { /* count colors */ count[(int)day_color[i]]++; } for (i = max = 0; i < NUM_COLORS; i++) { /* get most prevalent */ if (count[i] > max) max = count[weekday_color = i]; } return; } /* --------------------------------------------------------------------------- change_color Notes: This routine resets existing non-black colors to the specified color (for backward-compatibility with pre-v4.4 -G and -O flags). */ void change_color (int col) { int i; for (i = SUN; i <= SAT; i++) { if (day_color[i] != BLACK) day_color[i] = col; } if (holiday_color != BLACK && holiday_color != HOLIDAY_DEFAULT) { holiday_color = col; } return; } /* --------------------------------------------------------------------------- get_flag Notes: This routine looks up "flag" in 'flag_tbl'. It returns a pointer to its entry (or NULL if not found). */ FLAG_USAGE * get_flag (char flag) { FLAG_USAGE *pflag; for (pflag = flag_tbl; pflag->flag; pflag++) { if (flag == pflag->flag) return pflag; } return flag ? NULL : pflag; /* '\0' is a valid flag */ } /* --------------------------------------------------------------------------- set_debug_flag Notes: This routine looks up "flag" in the debug flag table and sets selected bits in the debug flag word (clearing word if "flag" is NULL). */ void set_debug_flag (char *flag) { char f; DEBUG_INFO *pd; if (!flag) { /* clear all if NULL */ debug_flags = 0; return; } /* loop through all characters in "flag", setting corresponding * bits in debug_flags */ while ((f = *flag++) != '\0') { for (pd = debug_info; pd->flag; pd++) { if (pd->flag == f) debug_flags |= pd->value; } } return; } /* --------------------------------------------------------------------------- display_usage Notes: This routine prints a message explaining correct usage of the command-line arguments and flags. If "fullmsg" is true, it print associated detailed text. */ void display_usage (FILE *fp, /* destination of usage message */ int fullmsg) /* print complete message? */ { FLAG_MSG *pflag; PARAM_MSG *ppar; char buf[30], *p, flag, *meta; int nchars, first, i, indent, n; sprintf(buf, "%s: %s", W_USAGE, progname); nchars = indent = strlen(buf); first = TRUE; meta = p = NULL; fprintf(fp, "\n%s", buf); /* convert various values to strings for printing (cf. pcallang.h) */ sprintf(Xtval, "%d", 0); sprintf(Ytval, "%d", 0); sprintf(Xsval, "%.3f", 1.0); sprintf(Ysval, "%.3f", 1.0); sprintf(Ncopy, "%d", NCOPY); /* Display the basic command-line syntax message (by group of flags)... */ for (pflag = flag_msg; (flag = pflag->flag) != '\0'; pflag++) { if (flag == '\n') { /* end of group? */ if (p) *p = '\0'; if (meta) { /* append metavariable name */ strcat(buf, " "); strcat(buf, meta); } strcat(buf, "]"); n = strlen(buf); if (nchars + n > SCREENWIDTH) { /* does it fit on line? */ fprintf(fp, "\n"); /* no - start new one */ for (nchars = 0; nchars < indent; nchars++) fprintf(fp, " "); } fprintf(fp, "%s", buf); nchars += n; first = TRUE; } else if (flag != ' ') { /* accumulate flags for group */ if (first) { sprintf(buf, " ["); p = buf + strlen(buf); } else *p++ = '|'; *p++ = '-'; *p++ = flag; meta = pflag->meta; /* save metavariable name */ first = FALSE; } } /* After displaying all the possible flag options, we now loop to append a display of the various possible formats of the numeric parameter descriptions (starting year, starting month, and number of months, in various permutations)... */ for (i = 0; i < PARAM_MSGS; i++) { sprintf(buf, " [%s]%s", param_msg[i].desc, i < PARAM_MSGS - 1 ? " |" : ""); n = strlen(buf); if (nchars + n > SCREENWIDTH) { /* does it fit on line? */ fprintf(fp, "\n"); /* no - start new one */ for (nchars = 0; nchars < indent; nchars++) fprintf(fp, " "); } fprintf(fp, "%s", buf); nchars += n; } fprintf(fp, "\n\n"); if (! fullmsg) { fprintf(fp, USAGE_MSG, progname, F_HELP); return; } /* Display detailed descriptions of each of the possible command-line flags... */ for (pflag = flag_msg; (flag = pflag->flag) != '\0'; pflag++) { if (flag == '\n') { /* newline? print and quit */ fprintf(fp, "\n"); continue; } p = buf; /* copy flag and metavariable to buffer */ if (flag != ' ') *p++ = '-'; *p++ = flag; *p = '\0'; if (pflag->meta) sprintf(p, " %s", pflag->meta); fprintf(fp, "\t%-20.20s", buf); if (pflag->text) fprintf(fp, "%s", pflag->text); /* print default value if specified */ if (pflag->def) { fprintf(fp, " (%s: %s)", W_DEFAULT, pflag->def[0] ? pflag->def : "\"\"" ); } fprintf(fp, "\n"); /* special case - print color messages after F_OUTLINE_GRAY */ if (flag == F_OUTLINE_GRAY) { fprintf(fp, "\t%20s (%s: %s)\n", "", W_DEFAULT, color_msg()); } } /* now print the information about the numeric parameters */ for (ppar = param_msg; ppar->desc; ppar++) { fprintf(fp, "\t%-16.16s%s\n", ppar->desc, ppar->text); } fprintf(fp, "\n"); return; } /* --------------------------------------------------------------------------- recalc_paper_parameters Notes: This routine sets up all the variables which are associated with a new setting of 'paper size'. */ void recalc_paper_parameters (int paper_size_idx) { page_dim_short_axis_pts = paper_info[paper_size_idx].page_dim_short_axis_pts; page_dim_long_axis_pts = paper_info[paper_size_idx].page_dim_long_axis_pts; daybox_width_pts = paper_info[paper_size_idx].daybox_width_pts; daybox_height_pts = paper_info[paper_size_idx].daybox_height_pts; xsval_pgm = ysval_pgm = (double)page_dim_short_axis_pts / (double)page_dim_long_axis_pts; xtval_pgm = (page_dim_long_axis_pts - (7 * daybox_width_pts)) / 2; if ((rotate == PORTRAIT) && do_whole_year) { ytval_pgm = page_dim_short_axis_pts + TOP_OF_CAL_BOXES_PTS + 6 * (daybox_height_pts - paper_info[paper_size_idx].daybox_height_pts); } else if ((rotate == PORTRAIT) && !do_whole_year) { /* * Copied from the 'ReadMe' file for v4.6: * * The date box height for single-month portrait-mode calendars has * been expanded from 80 points to 117. If you prefer the original * date box proportions (basically a scaled-down landscape-mode * calendar), compile with -DORIG_BOX_HEIGHT. */ #ifndef ORIG_BOX_HEIGHT daybox_height_pts = (page_dim_long_axis_pts - DEFAULT_MARGIN_BOTTOM_PTS + TOP_OF_CAL_BOXES_PTS) / 6 / ysval_pgm; #endif ytval_pgm = (page_dim_long_axis_pts + TOP_OF_CAL_BOXES_PTS) / ysval_pgm; } else { /* landscape mode */ xsval_pgm = ysval_pgm = 1.0; ytval_pgm = TOP_OF_CAL_BOXES_PTS; } return; } /* --------------------------------------------------------------------------- get_args Notes: This routine walks the argument list, parsing all arguments but processing only those specified (in 'flag_tbl[]') to be processed this pass. It returns TRUE if OK, FALSE if invalid flag was found. The first parameter is the argument list. The second parameter is the current pas ('P_xxx'). The third parameter is for error messages. The fourth parameter is a flag to indicate that this routine should parse and save the numeric arguments. */ int get_args (char **argv, int curr_pass, char *where, int get_numargs) { char *parg, *opt, *p, *pass, tmpbuf[STRSIZ], c, sym[STRSIZ]; FLAG_USAGE *pflag, *pf; int i, flag, sv_debug; int flags_ok = TRUE; /* return value */ FILE *fp = stdout; /* for piping "help" message */ /* * If argument follows flag (immediately or as next parameter), return * pointer to it (and bump argv if necessary); else return NULL */ #define GETARG() (*(*argv + 2) ? *argv + 2 : \ (*(argv+1) && **(argv+1) != '-' ? *++argv : NULL)) /* set up pass name to print in debug messages */ pass = where ? where : curr_pass == P_CMD0 ? "CMD0" : curr_pass == P_ENV ? "ENV" : curr_pass == P_CMD1 ? "CMD1" : curr_pass == P_CMD2 ? "CMD2" : "OPT" ; /* Walk argument list, ignoring first element (program name) */ while ((opt = *++argv) != NULL) { /* Assume that any non-flag argument is a numeric argument */ if (*opt != '-') { if (get_numargs && nargs < MAXARGS) { if (! IS_NUMERIC(opt)) goto bad_par; numargs[nargs++] = atoi(opt); if (DEBUG(DEBUG_OPTS)) fprintf(stderr, "%s: %s\n", pass, opt); } continue; } /* Check that flag is legal */ if (! (pflag = get_flag(flag = opt[1])) ) goto bad_par; /* get optional argument even if flag not processed this pass */ parg = pflag->has_arg ? GETARG() : NULL; /* skip to next flag if not to be processed this pass */ if (! (pflag->passes & curr_pass)) { if (curr_pass == P_OPT) { fprintf(stderr, E_FLAG_IGNORED, progname, flag, DATE_FILE, where); } continue; } /* echo pass name and flag if debugging on */ if (DEBUG(DEBUG_OPTS)) { fprintf(stderr, "%s: -%c%s%s\n", pass, flag, parg ? " " : "", parg ? parg : ""); } /* convert escape sequences in command-line parameters */ if (parg && (curr_pass == P_CMD1 || curr_pass == P_CMD2)) { cvt_escape(tmpbuf, parg); parg = tmpbuf; } switch (flag) { case F_INITIALIZE: /* reset all flags to defaults */ /* set up a command line to reset all of the flags; call get_args() * recursively to parse it (note that some of the flags must be reset * explicitly, as no command-line flags exist to reset them) */ /* reset flags described above */ julian_dates = JULIAN_DATES; draw_moons = DRAW_MOONS; do_whole_year = DO_WHOLE_YEAR; blank_boxes = BLANK_BOXES; output_type = OUTPUT_TYPE; small_cal_pos = SMALL_CAL_POS; /* select program default for landscape/portrait mode (must be done * first because -[xXyY] depend on it) and US/European date styles */ sprintf(lbuf, "pcal -%c -%c", #if (ROTATE == LANDSCAPE) F_LANDSCAPE, #else F_PORTRAIT, #endif #if (DATE_STYLE == USA_DATES) F_USA_DATES #else F_EUR_DATES #endif ); p = lbuf + strlen(lbuf); /* all other flags take arguments and are reset by specifying the * flag without an argument */ for (pf = flag_tbl; pf->flag; pf++) { if ((pf->passes & curr_pass) && pf->has_arg) { sprintf(p, " -%c", pf->flag); p += strlen(p); } } /* split new command line into words; parse it */ (void) loadwords(words, lbuf); (void) get_args(words, curr_pass, NULL, FALSE); /* -G and -O without arguments change some day colors (for * backward-compatibility with pre-v4.4 versions), so initialize the * day colors explicitly */ INIT_COLORS; /* also disable the time zone flag explicitly */ tz_flag = FALSE; break; case F_BLACK_DAY: /* print day in black or gray */ case F_GRAY_DAY: if (parg) set_color(parg, flag == F_BLACK_DAY ? BLACK : GRAY); else INIT_COLORS; /* reset to defaults */ break; case F_OUTLINE: /* print day in outline or outline-gray */ case F_OUTLINE_GRAY: /* ignore "-Gall" etc. on second command-line pass; this is to avoid * changing the definition of "weekday", et. al. after the date file * has already been read */ if (parg) { if (curr_pass != P_CMD2) { set_color(parg, flag == F_OUTLINE ? OUTLINE : OUTLINE_GRAY); } } else { /* special hack for backward compatibility with v4.3 and earlier: * -G or -O alone change all non-black days to the selected color */ change_color(flag == F_OUTLINE ? OUTLINE : OUTLINE_GRAY); } break; case F_DAY_FONT: /* specify alternate day font */ define_font(datefont, parg, DATEFONT); break; case F_NOTES_FONT: /* specify alternate notes font */ define_font(notesfont, parg, NOTESFONT); break; case F_TITLE_FONT: /* specify alternate title font */ define_font(titlefont, parg, TITLEFONT); break; case F_REMAP_FONT: /* specify 8-bit font mapping */ if (parg) { if (ci_strncmp(parg, MAPPING_LATIN_1, strlen(parg)) == 0) mapfonts = ENC_LATIN_1; else if (ci_strncmp(parg, MAPPING_LATIN_2, strlen(parg)) == 0) mapfonts = ENC_LATIN_2; else if (ci_strncmp(parg, MAPPING_LATIN_3, strlen(parg)) == 0) mapfonts = ENC_LATIN_3; else if (ci_strncmp(parg, MAPPING_LATIN_4, strlen(parg)) == 0) mapfonts = ENC_LATIN_4; else if (ci_strncmp(parg, MAPPING_CYRILLIC, strlen(parg)) == 0) mapfonts = ENC_CYRILLIC; /* else if (ci_strncmp(parg, MAPPING_ARABIC, strlen(parg)) == 0) */ /* mapfonts = ENC_ARABIC; */ else if (ci_strncmp(parg, MAPPING_GREEK, strlen(parg)) == 0) mapfonts = ENC_GREEK; /* else if (ci_strncmp(parg, MAPPING_HEBREW, strlen(parg)) == 0) */ /* mapfonts = ENC_HEBREW; */ else if (ci_strncmp(parg, MAPPING_LATIN_5, strlen(parg)) == 0) mapfonts = ENC_LATIN_5; else if (ci_strncmp(parg, MAPPING_LATIN_6, strlen(parg)) == 0) mapfonts = ENC_LATIN_6; else if (ci_strncmp(parg, MAPPING_THAI, strlen(parg)) == 0) mapfonts = ENC_THAI; else if (ci_strncmp(parg, MAPPING_LATIN_7, strlen(parg)) == 0) mapfonts = ENC_LATIN_7; else if (ci_strncmp(parg, MAPPING_LATIN_8, strlen(parg)) == 0) mapfonts = ENC_LATIN_8; else if (ci_strncmp(parg, MAPPING_LATIN_9, strlen(parg)) == 0) mapfonts = ENC_LATIN_9; /* else if (ci_strncmp(parg, MAPPING_LATIN_10, strlen(parg)) == 0) */ /* mapfonts = ENC_LATIN_10; */ else if (ci_strncmp(parg, MAPPING_KOI8_R, strlen(parg)) == 0) mapfonts = ENC_KOI8_R; else if (ci_strncmp(parg, MAPPING_KOI8_U, strlen(parg)) == 0) mapfonts = ENC_KOI8_U; else if (ci_strncmp(parg, MAPPING_ROMAN8, strlen(parg)) == 0) mapfonts = ENC_ROMAN8; else mapfonts = ENC_NONE; } else /* Use the value defined in the 'Makefile' */ mapfonts = MAPFONTS; map_default = !parg; break; case F_EMPTY_CAL: /* generate empty calendar */ datefile_type = NO_DATEFILE; strcpy(datefile, ""); break; case F_DATE_FILE: /* specify alternate date file */ datefile_type = parg ? USER_DATEFILE : SYS_DATEFILE; strcpy(datefile, parg ? parg : ""); break; case F_OUT_FILE: /* specify alternate output file */ oflag = TRUE; strcpy(outfile, parg ? parg : ""); break; case F_LANDSCAPE: /* generate landscape calendar */ rotate = LANDSCAPE; recalc_paper_parameters(paper_size); /* Undefine any old paper orientation symbol and define a new symbol * to match the new paper orientation. */ do_undef("ORIENTATION_PORTRAIT"); do_define("ORIENTATION_LANDSCAPE"); break; case F_PORTRAIT: /* generate portrait calendar */ rotate = PORTRAIT; recalc_paper_parameters(paper_size); /* Undefine any old paper orientation symbol and define a new symbol * to match the new paper orientation. */ do_undef("ORIENTATION_LANDSCAPE"); do_define("ORIENTATION_PORTRAIT"); break; case F_PAPERSIZE: /* specify paper size */ /* Undefine 'papersize_XXX' (where XXX is the name of the * previously-selected paper size). */ sprintf(sym, "papersize_%s", paper_info[paper_size].name); do_undef(sym); paper_size = PAPERSIZE_DEFAULT; if (parg) { int found = FALSE; for (i = 0; i < NUM_PAPER_SIZES; i++) { if (ci_strncmp(paper_info[i].name, parg, strlen(paper_info[i].name)) == 0) { paper_size = i; found = TRUE; break; } } if (!found) { fprintf(stderr, E_ILL_PAPERSIZE, progname, parg); } } recalc_paper_parameters(paper_size); /* Define 'papersize_XXX' (where XXX is the name of the * newly-selected paper size). */ sprintf(sym, "papersize_%s", paper_info[paper_size].name); do_define(sym); break; case F_HELP: /* request version info and/or help */ case F_USAGE: case F_VERSION: /* PAGER_ENV (cf. pcaldefs.h) defines the name of an environment * variable which, if set, points to the appropriate pager (e.g., * "more", "less", "pg") for piping the "help" message (Un*x systems * only) */ #ifdef PAGER_ENV if (flag == F_HELP) { FILE *pfp; char *pager, *p; pager = (p = getenv(PAGER_ENV)) ? p : PAGER_DEFAULT; /* null pointer or string: no paging */ if (pager && *pager && (pfp = popen(pager, "w")) != (FILE *)NULL) { fp = pfp; } } #endif fprintf(fp, "%s\n", VERSION_STRING + 4); if (flag != F_VERSION) display_usage(fp, flag == F_HELP); fflush(fp); #ifdef PAGER_ENV if (fp != stdout) pclose(fp); #endif exit(EXIT_SUCCESS); break; case F_MOON_4: /* draw four moons */ case F_MOON_ALL: /* draw a moon for each day */ draw_moons = flag == F_MOON_ALL ? ALL_MOONS : SOME_MOONS; break; case F_DEFINE: /* define preprocessor symbol */ (void) do_define(parg); break; case F_UNDEF: /* undef preprocessor symbol */ (void) do_undef(parg); break; case F_L_FOOT: /* specify alternate left foot */ strcpy(lfoot, parg ? parg : LFOOT); break; case F_C_FOOT: /* specify alternate center foot */ strcpy(cfoot, parg ? parg : CFOOT); break; case F_R_FOOT: /* specify alternate right foot */ strcpy(rfoot, parg ? parg : RFOOT); break; case F_NOTES_HDR: /* specify alternate notes header */ strcpy(notes_hdr, parg ? parg : default_notes_hdr); break; case F_FIRST_DAY: /* select starting day of week */ if (parg) { if ((i = get_weekday(parg, FALSE)) != NOT_WEEKDAY) { first_day_of_week = i; } else if (parg[0] >= '0' && parg[0] <= '6') { first_day_of_week = parg[0] - '0'; } } else first_day_of_week = FIRST_DAY; break; case F_USA_DATES: /* select American date style */ case F_EUR_DATES: /* select European date style */ date_style = flag == F_USA_DATES ? USA_DATES : EUR_DATES; break; case F_X_TRANS: /* set x-axis translation factor */ if (parg) xtval_user = atoi(parg); break; case F_Y_TRANS: /* set y-axis translation factor */ if (parg) ytval_user = atoi(parg); break; case F_X_SCALE: /* set x-axis scaling factor */ if (parg) xsval_user = atof(parg); break; case F_Y_SCALE: /* set y-axis scaling factor */ if (parg) ysval_user = atof(parg); break; case F_JULIAN: /* display Julian dates */ case F_JULIAN_ALL: /* Julian date/days remaining */ julian_dates = flag == F_JULIAN_ALL ? ALL_JULIANS : SOME_JULIANS; break; case F_WHOLE_YEAR: /* print whole year at once */ do_whole_year = !(DO_WHOLE_YEAR); /* toggle default */ if (do_whole_year) (void) do_define(DEF_WHOLE_YEAR); recalc_paper_parameters(paper_size); break; case F_CALENDAR: /* generate "calendar(1)" input */ output_type = OUTPUT_CAL; break; case F_HTML: /* generate HTML table */ output_type = OUTPUT_HTML; do_define(DEF_HTML); break; case F_1COLUMN: /* print one column per month (HTML) */ one_column = 1; break; case F_BLANK_BOXES: /* suppress shading unused boxes */ blank_boxes = !(BLANK_BOXES); break; case F_NUM_PAGES: /* print multiple copies of each page */ ncopy = parg ? atoi(parg) : NCOPY; break; case F_SC_NONE: /* suppress small calendars */ small_cal_pos = SC_NONE; break; case F_SC_FIRST: /* reposition of small calendars */ case F_SC_SPLIT: small_cal_pos = flag == F_SC_FIRST ? SC_FIRST : SC_SPLIT; break; case F_SHADING: /* set date/fill shading levels */ define_shading(shading, parg, SHADING); break; case F_TIMEZONE: /* select alternate time zone */ strcpy(time_zone, parg ? parg : TIMEZONE); tz_flag = TRUE; break; case F_SETLANG: /* select output lang for month/days */ /* undefine lang_XX (where XX is current language) */ do_undef(gen_lang_sym(output_language)); output_language = LANG_DEFAULT; if (parg) { for (i = 0; i < NUM_LANGUAGES; i++) { if (ci_strncmp(lang_id[i], parg, MIN_LANG_LEN) == 0 ) { output_language = i; break; } } } /* define lang_XX (where XX is new current language) */ do_define(gen_lang_sym(output_language)); break; case F_TYPEFACE: /* select font style (Bold/Italic) */ c = parg ? toupper(parg[0]) : ROMAN; fontstyle[0] = (c == BOLD || c == ITALIC) ? c : ROMAN; fontstyle[1] = '\0'; /* just in case */ break; case F_TITLEALIGN: /* specify title alignment (left/center/right) */ strcpy (title_align, parg && IS_TITLE_ALIGN(parg) ? parg : TITLE_ALIGN); break; case F_DEBUG: /* turn on debugging (undocumented) */ sv_debug = DEBUG(DEBUG_OPTS); set_debug_flag(parg); /* print -ZO flag if first time set */ if (!sv_debug && DEBUG(DEBUG_OPTS)) { fprintf(stderr, "%s: -%c%s\n", pass, flag, parg ? parg : ""); } break; case '-' : /* accept - and -- as dummy flags */ case '\0': break; default: /* missing case label if reached!!! */ bad_par: /* unrecognized parameter */ fprintf(stderr, E_ILL_OPT, progname, opt); if (where) { fprintf(stderr, E_ILL_OPT2, curr_pass == P_ENV ? ENV_VAR : curr_pass == P_OPT ? DATE_FILE : "", where); } fprintf(stderr, "\n"); flags_ok = FALSE; break; } } /* if we read the numeric arguments, validate and interpret them */ if (get_numargs) flags_ok &= check_numargs(); return flags_ok; } /* --------------------------------------------------------------------------- check_numargs Notes: This routine validates and interprets numeric command-line parameters. It returns 'TRUE' if all are OK. It prints an error message and returns 'FALSE' if not. */ int check_numargs (void) { /* Validate non-flag (numeric) parameters */ struct tm *p_tm; /* for getting current month/year */ time_t tmp; int params_ok = TRUE; /* return value */ switch (nargs) { case 0: /* no arguments - print current month and/or year */ time(&tmp); p_tm = localtime(&tmp); init_month = p_tm->tm_mon + 1; /* revised to conform to standard Un*x behavior 01/25/00 */ /* init_year = century() + (p_tm->tm_year % 100); */ init_year = TM_YEAR + p_tm->tm_year; nmonths = 1; break; case 1: /* one argument - print entire year */ init_month = JAN; init_year = numargs[0]; nmonths = 12; break; default: /* two or three arguments - print one or more months */ init_month = numargs[0]; init_year = numargs[1]; nmonths = nargs > 2 ? numargs[2] : 1; break; } if (nmonths < 1) nmonths = 1; /* ensure at least one month */ /* check range of month and year */ if (init_month < JAN || init_month > DEC) { fprintf(stderr, E_ILL_MONTH, progname, init_month, JAN, DEC); params_ok = FALSE; } if (init_year >= 0 && init_year < 100) { /* treat nn as CCnn */ init_year += century(); } if (init_year < MIN_YR || init_year > MAX_YR) { fprintf(stderr, E_ILL_YEAR, progname, init_year, MIN_YR, MAX_YR); params_ok = FALSE; } return params_ok; } /* --------------------------------------------------------------------------- color_msg Notes: This routine returns a character string explaining the default day colors. It assumes that defaults consist of black and at most one other color. */ char *color_msg (void) { int i, ngray = 0, others, gray = GRAY; static char msg[80], *alt_color; for (i = SUN; i <= SAT; i++) { /* count "logical gray" weekdays */ if (default_color[i] != BLACK) { gray = default_color[i]; ngray++; } } alt_color = color_names[gray]; /* map "logical gray" to its name */ if (ngray == 0 || ngray == 7) { /* all same color? */ sprintf(msg, COLOR_MSG_1, ngray ? alt_color : W_BLACK); return msg; } others = ngray <= 3 ? BLACK : gray; /* no - get predominant color */ msg[0] = '\0'; for (i = SUN; i <= SAT; i++) { if (default_color[i] != others) { strncat(msg, days_ml[LANG_DEFAULT][i], MIN_DAY_LEN); strcat(msg, "/"); } } LASTCHAR(msg) = ' '; sprintf(msg + strlen(msg), COLOR_MSG_2, others == BLACK ? alt_color : W_BLACK, others == BLACK ? W_BLACK : alt_color); return msg; } /* --------------------------------------------------------------------------- alt_fopen Notes: This routine attempts to open a file in one of several paths in a NULL-terminated path list. If successful, it returns the (opened) file pointer and fills in the full path name. If unsuccessful, it returns NULL. The first parameter is the full (output) path name. The second parameter is the base name (or full path spec). The third parameter is the NULL-terminated path list. The fourth parameter is the permission level requested. */ FILE *alt_fopen (char *fullpath, char *name, char *pathlist[], char *access) { char **path; FILE *fp; /* print complete list of paths if debugging path names */ if (DEBUG(DEBUG_PATHS)) { fprintf(stderr, "Searching for %s in the following paths:\n", name); for (path = pathlist; *path; path++) { fprintf(stderr, " %s\n", **path ? *path : "."); } } /* search path list for requested file */ for (path = pathlist; *path; path++) { mk_filespec(fullpath, *path, name); if ((fp = fopen(fullpath, access)) != NULL) { if (DEBUG(DEBUG_PATHS)) fprintf(stderr, "found %s\n", fullpath); return fp; } } fullpath[0] = '\0'; /* file not found */ return NULL; } /* --------------------------------------------------------------------------- gen_lang_sym Notes: This routine creates a symbol name "lang_XX" corresponding to the language code passed as an argument (e.g., LANG_ENGLISH => "lang_en"). */ char *gen_lang_sym (int lang) { static char buf[sizeof(DEF_LANG) + MIN_LANG_LEN + 1]; char *p; int i; strcpy(buf, DEF_LANG); p = buf + strlen(buf); for (i = 0; i < MIN_LANG_LEN; i++) p[i] = lang_id[lang][i]; p[i] = '\0'; return buf; } /* --------------------------------------------------------------------------- main Notes: Main program - parse and validate command-line arguments, open files, generate PostScript boilerplate and code to generate calendars. Program structure: For maximum user flexibility, Pcal gives the user several different ways to set program flags and/or override earlier choices. This necessitates that main() call get_args() (directly or indirectly) several times: a) to parse the command line, looking only for -Z flags (which turn on debugging information) and numeric parameters b) to parse environment variable PCAL_OPTS, if defined c) to parse the command line a second time, looking for options related to finding/interpreting the date file: -[cefhuvDU] d) main() calls read_datefile() to read and parse the date file; it in turn calls get_args() once per "opt" line in the date file e) to parse the command line one final time, allowing the user to override any flags other than those listed in c) above The rest of it is straightforward: main() attempts to open the output file (if any), and, if successful, calls write_psfile() to generate the PostScript output (or write_calfile() to generate the "calendar" input). Some minor housekeeping and we're done. */ int main (int argc GCC_UNUSED, char **argv) { FILE *dfp = NULL; /* date file pointer */ char *p, *pathlist[10]; char tmp[STRSIZ]; int n; /* get version from VERSION_STRING (for PostScript comments and version * symbol predefined in init_misc()) */ strcpy(tmp, VERSION_STRING + 4); p = strchr(tmp, ' ') + 1; /* skip program name */ *strchr(p, ' ') = '\0'; /* terminate after version */ strcpy(version, p); init_misc(); /* handle initialization warts */ /* extract root program name and program path - note that some systems * supply the full pathname and others just the root */ strcpy(progname, **argv ? *argv : "pcal"); if ((p = strrchr(progname, END_PATH)) != NULL) strcpy(progname, ++p); #ifndef BUILD_ENV_UNIX if ((p = strchr(progname, '.')) != NULL) *p = '\0'; /* strip suffix if non-Un*x */ #endif mk_path(progpath, find_executable(*argv)); /* * Get the arguments from a) the command line (pre-pass to pick up debug * and usage flags), b) the environment variable PCAL_OPTS, c) the first * command line pass, d) "opt" lines in the date file, and e) a final * command line pass, in that order */ /* Make a preliminary pass to look for the debug flags (to ensure that -ZO * will print any flags set in PCAL_OPTS) and the usage flags (-h, -u, and * -v). If none of the latter is specified, this pass will also validate * any numeric command-line arguments. */ if (!get_args(argv, P_CMD0, NULL, TRUE)) { display_usage(stderr, FALSE); /* invalid flag or param */ exit(EXIT_FAILURE); } /* parse environment variable PCAL_OPTS as a command line */ if ((p = getenv(PCAL_OPTS)) != NULL) { strcpy(lbuf, "pcal "); /* dummy program name */ strcat(lbuf, p); (void) loadwords(words, lbuf); /* split string into words */ if (! get_args(words, P_ENV, PCAL_OPTS, FALSE)) { display_usage(stderr, FALSE); exit(EXIT_FAILURE); } } /* parse command-line arguments once to find name of date file, etc. */ (void) get_args(argv, P_CMD1, NULL, FALSE); /* if in whole-year mode, round number of months up to full year and set * default starting month to January of current year */ if (do_whole_year) { nmonths = ((nmonths + 11) / 12) * 12; if (nargs == 0) init_month = JAN; } /* recalculate final month and year (latter needed for "year all") */ final_month = (init_month + (nmonths - 1) - 1) % 12 + 1; final_year = init_year + ((nmonths - 1 + init_month - 1) / 12); /* Attempt to open the date file as specified by the [-e | -f] flags */ switch (datefile_type) { case NO_DATEFILE: dfp = NULL; break; case USER_DATEFILE: /* Attempt to open user-specified calendar file: search first in the * current directory, then in PCAL_DIR (if defined), and finally in the * directory where the Pcal executable lives (if SEARCH_PCAL_DIR != 0). * It is a fatal error if the user-specified date file cannot be found. */ n = 0; pathlist[n++] = ""; if ((p = getenv(PCAL_DIR)) != NULL) pathlist[n++] = p; #if (SEARCH_PCAL_DIR != 0) pathlist[n++] = progpath; #endif pathlist[n] = NULL; strcpy(tmp, datefile); /* save original name for error msg */ if ((dfp = alt_fopen(datefile, tmp, pathlist, "r")) == NULL) { fprintf(stderr, E_FOPEN_ERR, progname, tmp); exit(EXIT_FAILURE); } break; case SYS_DATEFILE: /* Attempt to open system-specified calendar file: search first in * PCAL_DIR, then in HOME_DIR (current directory if neither is defined) * and finally in the directory where the Pcal executable lives (if * SEARCH_PCAL_DIR != 0). It is not an error if the system-specified * date file cannot be opened; Pcal will simply generate an empty * calendar. */ n = 0; if ((p = getenv(PCAL_DIR)) != NULL) pathlist[n++] = p; if ((p = getenv(HOME_DIR)) != NULL) pathlist[n++] = p; if (n == 0) pathlist[n++] = ""; #if (SEARCH_PCAL_DIR != 0) pathlist[n++] = progpath; #endif pathlist[n] = NULL; dfp = alt_fopen(datefile, DATEFILE, pathlist, "r"); /* if the date file has not been found and ALT_DATEFILE is defined, * search same paths for ALT_DATEFILE before giving up */ #ifdef ALT_DATEFILE if (!dfp) dfp = alt_fopen(datefile, ALT_DATEFILE, pathlist, "r"); #endif break; } /* read the date file (if any) and build internal data structure */ if (dfp) { curr_year = init_year; read_datefile(dfp, datefile); fclose(dfp); } else datefile[0] = '\0'; /* for PostScript comment */ /* reparse command line - flags there supersede those in date file */ (void) get_args(argv, P_CMD2, NULL, FALSE); /* if the user has not explicitly selected a mapping, choose one based on * the chosen language */ if (map_default == TRUE) mapfonts = lang_mapping[output_language]; /* fprintf(stderr, "Font mapping is %d\n", mapfonts); */ /* select an appropriate color for holidays if not set explicitly */ if (holiday_color == HOLIDAY_DEFAULT) holiday_color = select_color(); /* done with the arguments and flags - try to open the output file */ /* use default output files (cf. pcaldefs.h) if -o flag not used */ if (!oflag && output_type == OUTPUT_PS) strcpy(outfile, PS_OUTFILE); if (!oflag && output_type == OUTPUT_HTML) strcpy(outfile, HTML_OUTFILE); /* reopen stdout as alternate file if one was specified */ if (*outfile && freopen(outfile, "w", stdout) == (FILE *) NULL) { fprintf(stderr, E_FOPEN_ERR, progname, outfile); exit(EXIT_FAILURE); } /* Set up the initial page-related values based on the default paper * size. */ recalc_paper_parameters(paper_size); /* generate the "calendar", HTML, or PostScript code (cf. writefil.c) */ if (output_type == OUTPUT_CAL) write_calfile(); else if (output_type == OUTPUT_HTML) write_htmlfile(); else write_psfile(); cleanup(); /* free allocated data */ exit(EXIT_SUCCESS); } pcal-4.11.0/src/pcaldefs.h0000644000175000001440000011744510732017670013441 0ustar wusers/* --------------------------------------------------------------------------- pcaldefs.h Notes: This file contains various definitions and declarations of items used throughout the application. Revision history: 4.11.0 B.Marr 2007-12-15 Add support for new '-W' option, to specify horizontal alignment of the "Month/Year" title on monthly-format calendars, thanks to a patch from Todd Foster. Add support for building on Amiga, thanks to a patch from Stefan Haubenthal. Add support for new "on" preposition, thanks to a request from and in part to a patch from Erkki Petsalo. Enhance some comments. Rename some variables, structures, and/or routines to be clearer about their purpose and/or to allow easier searching with fewer "false positives". 4.10.0 B.Marr 2006-07-19 Provide a definition of the 'pcal' website URL so that it can be added to the PostScript output. Change the date/time stamp format in the PostScript output. Provide support for the DOS+DJGPP build environment, adding '%%For: xxx' in the PostScript output. Reformatted comments and code to match my standards. B.Marr 2006-07-12 Provide explicit casting in several spots to avoid warnings in a "gcc 3.4.2 on Solaris 8" environment, based on a report from David Mathog . Increase the value of the defined constant 'MAXWORD' from 100 to 300. This prevents a crash in the rare case when the number of 'words' on a single line in the calendar configuration file exceeds 100. Get rid of all the '#ifdef PROTOS' checks, which are pretty much obsolete these days and just needlessly clutter up the code. Drop support for obsolete platforms (Amiga, VMS, OS/2). Merged 'pcalpapr.h' code into this file. 4.9.0 B.Marr 2005-08-02 Add enumeration for new 'delete' keyword, from Bill Bogstad's 'event deletion' patch. B.Marr 2005-01-04 Provide 12 new character encodings (KOI8-R and several 'ISO 8859-*' encodings) to correspond to new PostScript encoding vectors in order to support a wider diversity of languages. 4.8.0 B.Marr 2004-12-05 Fix misleading references to "holiday" to instead refer to "predefined event" (i.e. not all pre-defined events are 'holidays'). Create and support concept of 'input' language versus 'output' language. Support specification of paper size via run-time option (command-line, etc). Remove spaces embedded within tab fields. Perform various other cosmetic and/or comment cleanups. B.Marr 2004-11-13 Use new KOI8U mapping for newly-added Ukrainian language support. Provide support for "Friday the 13th" events, based on a patch from Don Laursen (donrl at users dot sourceforge dot net). 4.7 AWR 01/25/2000 add SEARCH_PCAL_DIR to control whether or not Pcal looks for the calendar file in the same directory where Pcal itself lives (not desirable if an executable named 'calendar' has been installed there) 04/19/1999 add DIVIDE_BLANK_SPACE (cf. writefil.c) to control style of blank date boxes beginning and end of HTML calendars 06/19/1998 add support for generating full-year HTML calendars 03/08/1998 add alternate scaling and translation factors for A4 size paper (-DA4PAPER); express all such factors as numbers instead of character strings (cf. pcal.c, pcalglob.h, pcallang.h, writefil.c); reposition Y origin as top of calendar boxes 12/21/1997 add OS/2 definitions (as suggested by Alexander Mai) 07/27/1997 add support for -H flag (HTML-specific macro definitions); delete obsolete FPR and PRT macros 4.6 AWR 05/14/1997 replace CENTURY with TM_YEAR (cf. ) 09/13/1996 support "nearest_before" and "nearest_after" keywords 04/30/1996 define NOBODY pseudo-account (Un*x only) to suppress various inapplicable comments when pcal is run anonymously from a CGI script (cf. writefil.c) 04/22/1996 specify alternate (taller) date box height, used when printing single-month portrait-mode calendars 11/29/1995 add ARRAYSIZE() macro (cf. readfile.c) 11/10/1995 add safe TOUPPER() macro 4.5 AWR 08/24/1994 Define CHAR_MSK (instead of hard-coded 0377) to avoid negative result when promoting char to int (see comments) 12/21/1993 Removed obsolete COLOR_MIN, COLOR_MAX definitions 11/08/1993 Add IS_EURDATE() macro to support "nn." style of date specifications 09/09/1993 Support Roman8 and ISO Latin1 character mappings (cf. fontmaps.ps, writefil.c) Redefine MIN_YR from 1900 to 1753 03/20/1993 Allow several site-specific program defaults to be set in Makefile 03/05/1993 add MAPFONTS for optional mapping to 8-bit fonts (for European languages) 12/29/1992 add PS_RELEASE to define PostScript version (for Encapsulated PostScript) 04/07/1992 Revise PUTCHAR macro: add function/macro name and file pointer as arguments 02/11/1992 Many new declarations to help support predefined holidays 4.4 AWR 02/10/1992 Add PAGER_ENV (environment variable used in piping "help" message output [Un*x only]) 01/20/1992 Added support for -z flag and revised versions of -[bgGO] 01/13/1992 Add default font size to DATEFONT and TITLEFONT; move initialization of all font sizes here (from pcalinit.ps); enlarge medium calendar font sizes 4.3 AWR 12/05/1991 Revise moonfile name templates for consistency with current standards for substituting year in strings 12/03/1991 Add support for -s flag 10/17/1991 Add support for -Z flag and subflags; removed obsolete PUTSTR macro 4.2 AWR 10/08/1991 Add support for -[kK] flags; renamed START_DAY as START_BOX for clarity 10/03/1991 Add various definitions relating to "note/" 09/30/1991 Add MAX_IF_NESTING (related to "elif"; cf. read_datefile() in readfile.c) 4.11 AWR 08/20/1991 Add "nearest" keyword (as per Andy Fyfe) 4.1 AWR 08/16/1991 Add support for -G flag 4.0 AWR 03/01/1991 Add STDLIB macro for systems which support 02/22/1991 add definitions for MS-DOS support (as per Floyd Miller) 02/19/1991 revise ORD_XXX to support negative ordinals add definitions for Amiga support (as per Bill Hogsett) 02/06/1991 additional defs for expression processing 02/04/1991 support "year" as additional month name; use negative numbers for special ordinal codes (reserve positive numbers for ordinals) 01/28/1991 miscellaneous new constants/macros 01/07/1991 add FEB_29_OK (cf. enter_day_info()) */ /* --------------------------------------------------------------------------- Header Files */ #include /* --------------------------------------------------------------------------- (Early) Constant Declarations */ #define NOTE_DEFAULT -1 /* default note box number (-1 = last box) */ #define FIRST_NOTE_BOX 0 /* first box position for notes text */ #define LAST_NOTE_BOX 41 /* last position (w/o small calendars) */ #define NULL_NOTE_BOX -1 /* negative number for nonexistent box */ /* number and range of dummy days for notes text */ #define NUM_NOTE_DAYS (LAST_NOTE_BOX - 28 + 1) #define FIRST_NOTE_DAY 32 #define LAST_NOTE_DAY (FIRST_NOTE_DAY + NUM_NOTE_DAYS - 1) /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ /* * Define the structure which holds the information about the various settings * for the various paper sizes. */ typedef struct { char *name; int page_dim_short_axis_pts; int page_dim_long_axis_pts; int daybox_width_pts; int daybox_height_pts; } paper_info_str_typ; /* * The internal data structure consists of a series of linked lists as * pictured below (for clarity, only one instance of each node is shown): * * * head * | * | year_info * | ----------------- month_info * -->| year | ----------------- day_info * | month_info*[0] |----->| holidays | ---------------- * | ... | | day_info*[0] |----->| is_holiday | * | month_info*[11] |---> | ... | | text_string* |---> * | next year_info* |-- | day_info*[30] |---> | next day_info* |-- * ----------------- | | day_info*[NOTE] |---> ---------------- | * | | ... | | * | ----------------- | * ... <-- ... <-- * * * Each year_info node consists of the year, 12 pointers (Jan .. Dec) to * month_info nodes, and a pointer to the next year_info node in the chain. * (The year_info chain is maintained in ascending order by year.) * * Each month_info node consists of a bitmap of the holidays for that month, * a pointer to the day_info chain for all 31 possible days of the month, and * N additional pointers to the day_info chains for the "Notes" pseudo-days. * (A day_info chain is a linked list of all the text entries for a given * day, in the order in which they were encountered in the date file.) * * Each day_info node consists of a flag indicating whether the associated * text string is holiday or non-holiday text (any given day may have both), * a pointer to the text string itself, and a pointer to the next day_info * node in the chain. * */ typedef struct d_i { int is_holiday; char *text; struct d_i *next; } day_info; typedef struct m_i { unsigned long holidays; day_info *day[LAST_NOTE_DAY]; /* including extra days for notes */ } month_info; typedef struct y_i { int year; month_info *month[12]; struct y_i *next; } year_info; /* * Global typedef declaration for date structure (cf. parse_ord()) */ typedef struct { int mm; int dd; int yy; } date_str; /* * Global typedef declarations for keyword descriptors (cf. pcallang.h) */ typedef struct { char *name; int code; } KWD; typedef struct { char *name; int code; int value; } KWD_O; /* keyword plus ordinal value */ typedef struct { char *name; int code; int (*pfcn)(char *); } KWD_F; /* keyword plus dispatch function */ typedef struct { char *name; char *def; /* "def" and "pfcn" are mutually exclusive */ int (*pfcn)(date_str *); } KWD_H; /* keyword, equivalent string, dispatch fcn */ /* * Global typedef declaration for flag usage struct (cf. pcallang.h, get_args()) */ typedef struct { char flag; /* name of flag */ char has_arg; /* TRUE if flag takes (optional) arg */ char passes; /* "or" of P_xxx for relevant passes */ } FLAG_USAGE; /* * Global typedef declaration for debugging info struct (cf. pcallang.h) */ typedef struct { char flag; /* name of flag */ int value; /* value corresponding to flag (1 << n) */ } DEBUG_INFO; /* * Global typedef declarations for usage message (cf. pcallang.h, usage()) */ typedef struct { char flag; /* name of flag */ char *meta; /* metaname for argument (if any) */ char *text; /* associated text */ char *def; /* default value (if any) */ } FLAG_MSG; typedef struct { char *desc; /* description of param */ char *text; /* associated text */ } PARAM_MSG; typedef char *DATE_MSG; /* date file syntax message */ /* --------------------------------------------------------------------------- Constant Declarations */ /* Special definitions for a DOS environment */ #if defined (BUILD_ENV_MSDOS) || defined (BUILD_ENV_DJGPP) #define DATEFILE "pcal.dat" #define MOONFILE "moon%y.dat" /* '%y' replaced with year */ #define START_PATH '\\' #define END_PATH '\\' #define HOME_DIR "HOME" #define ALT_DATEFILE "calendar" /* for backward compatibility */ #else /* not DOS -- assume Unix */ /* Special definitions for a Unix environment */ #define HOME_DIR "HOME" #define DATEFILE ".calendar" #define ALT_DATEFILE "calendar" /* for backward compatibility */ #define MOONFILE ".moon%y" /* '%y' replaced with year */ #define ALT_MOONFILE "moon%y" /* analogous to ALT_DATEFILE */ #define START_PATH '/' #define END_PATH '/' #ifndef AMIGA #define PAGER_ENV "PAGER" /* points to help message pager */ #define PAGER_DEFAULT "more" /* default pager (NULL = none) */ #endif #endif /* * Define enumerations for the supported paper sizes. The order of entries in * the 'paper_info[]' array must correspond to these enumerations. */ #define NUM_PAPER_SIZES 4 /* *** Change this if adding a new paper size. *** */ #define PAPERSIZE_LETTER 0 #define PAPERSIZE_LEGAL 1 #define PAPERSIZE_A4 2 #define PAPERSIZE_TABLOID 3 #define PAPERSIZE_DEFAULT PAPERSIZE_LETTER /* * Define the distance (in typographic points) from the top edge of the paper * to the top of the calendar boxes for a monthly calendar in landscape * orientation. * * The value defined here includes the top margin, rather than defining proper * margins and using them generically. This is rather a inelegant way of * doing it, but it's been done that way for a long time. */ #define TOP_OF_CAL_BOXES_PTS (-85) /* * Define the default left, right, top, and bottom margins (in typographic * points). * * Some of these values are not currently used, but are left here for a time * when 'pcal' might be modified to provide proper, flexible margins. */ #define DEFAULT_MARGIN_LEFT_PTS 46 #define DEFAULT_MARGIN_RIGHT_PTS 46 #define DEFAULT_MARGIN_TOP_PTS 46 #define DEFAULT_MARGIN_BOTTOM_PTS 46 #define ALL "all" /* command-line or date file keywords */ #define HOLIDAY "holiday" /* names of colors used in printing dates (cf. flag_msg[] below) */ #define W_BLACK "black" #define W_GRAY "gray" #define W_OUTLINE "outline" #define W_OUTLINE_GRAY "outline-gray" #define W_ROMAN "Roman" /* for -T usage message */ /* Define PS_OUTFILE and HTML_OUTFILE as DEFAULT_*_OUTFILE if defined; otherwise define as "" (stdout) */ #ifdef DEFAULT_PS_OUTFILE #define PS_OUTFILE DEFAULT_PS_OUTFILE #else #define PS_OUTFILE "" #endif #ifdef DEFAULT_HTML_OUTFILE #define HTML_OUTFILE DEFAULT_HTML_OUTFILE #else #define HTML_OUTFILE "" #endif /* EXIT_SUCCESS and EXIT_FAILURE should be defined in * (or above if non-standard); define here if necessary */ #ifndef EXIT_SUCCESS #define EXIT_SUCCESS 0 #endif #ifndef EXIT_FAILURE #define EXIT_FAILURE 1 #endif /* definition of NULL (if needed) */ #ifndef NULL #define NULL 0 #endif /* * Environment variables (global symbol, logical name on VMS): */ #define PCAL_OPTS "PCAL_OPTS" /* command-line flags */ #define PCAL_DIR "PCAL_DIR" /* calendar file directory */ #define PATH_ENV_VAR "PATH" /* cf. find_executable() (pcalutil.c) */ /* * mask to avoid sign extension when promoting char to int (as in the PUTCHAR * macro below); some older compilers may sign-extend this mask anyway, in * which case you may want to try defining it as ((int) 0377) or even 255 : */ #define CHAR_MSK 0377 /* debug subflag codes (must be distinct) - cf. pcallang.h */ #define DEBUG_DATES (1 << 1) #define DEBUG_MOON (1 << 2) #define DEBUG_PATHS (1 << 3) #define DEBUG_OPTS (1 << 4) #define DEBUG_PP (1 << 5) #define DEBUG_TEXT (1 << 6) /* preprocessor token codes - cf. get_token(), pcallang.h */ #define PP_DEFINE 0 #define PP_ELIF 1 #define PP_ELSE 2 #define PP_ENDIF 3 #define PP_IFDEF 4 #define PP_IFNDEF 5 #define PP_INCLUDE 6 #define PP_UNDEF 7 #define PP_OTHER -1 /* not pp token */ /* ordinal number codes - cf. get_ordinal(), pcallang.h */ #define ORD_NEGNUM -1 /* negative ordinal (-2nd == next to last) */ #define ORD_POSNUM 1 /* positive ordinal */ #define ORD_ODD 2 /* special codes for "odd" and "even" */ #define ORD_EVEN 3 #define ORD_ALL 4 /* special code for "all" used as ordinal */ #define ORD_OTHER 0 /* not ordinal token */ /* ordinal numbers themselves - added for predefined holiday routines */ #define FIRST 1 #define SECOND 2 #define THIRD 3 #define FOURTH 4 #define FIFTH 5 #define LAST -1 /* moon phase codes - cf. pcallang.h and moonphas.c; these must take the * values 0 (NM) .. 3 (3Q) since they are used in phase calculations */ #define MOON_NM 0 /* new moon */ #define MOON_1Q 1 /* first quarter */ #define MOON_FM 2 /* full moon */ #define MOON_3Q 3 /* last quarter */ #define MOON_OTHER -1 /* unrecognizable */ /* date type codes - cf. date_type(), get_keywd(), and pcallang.h */ #define DT_ALL 0 /* "all" keyword" */ #define DT_NOTE 1 /* "note" keyword */ #define DT_OPT 2 /* "opt" keyword */ #define DT_INPUT_LANGUAGE 3 /* "input-language" keyword */ #define DT_YEAR 4 /* "year" keyword */ #define DT_MONTH 5 /* name of month */ #define DT_DATE 6 /* date of form dd/mm{/yy} or mm/dd{/yy} */ #define DT_EURDATE 7 /* European date of form dd */ #define DT_ORDINAL 8 /* ordinal (first, 1st, ... last) */ #define DT_WEEKDAY 9 /* weekday name */ #define DT_PREDEF_EVENT 10 /* predefined event (often a holiday) */ #define DT_DELETE 11 /* delete date entry following on this line */ #define DT_OTHER -1 /* unrecognizable first token */ /* preposition token codes - cf. get_prep(), pcallang.h */ #define PR_BEFORE 0 #define PR_ON_BEFORE 1 #define PR_AFTER 2 #define PR_ON_AFTER 3 #define PR_NEAREST 4 #define PR_NEAREST_BEFORE 5 #define PR_NEAREST_AFTER 6 #define PR_ON 7 #define PR_OTHER -1 /* not a preposition */ /* * Miscellaneous other constants: */ #define COMMENT_CHAR '#' /* delimiter for datefile comments */ #define RGB_CHAR ':' /* delimiter for red/green/blue values */ #ifndef TRUE #define FALSE 0 /* pseudo-Booleans */ #define TRUE 1 #endif #define MAX_FILE_NESTING 10 /* maximum nesting level for file inclusion */ #define MAX_IF_NESTING 20 /* maximum nesting level for if{n}def */ #define MAX_PP_SYMS 100 /* number of definable preprocessor symbols */ #define PP_SYM_UNDEF -1 /* flag for undefined symbol */ #define EXPR_ERR -1 /* expression parsing error */ #define MIN_YR 1753 /* significant years (calendar limits) */ #define MAX_YR 9999 #define ALL_YEARS -1 /* wildcard for years */ #define TM_YEAR 1900 /* offset for tm_year field of struct tm */ /* (cf. ); may need to be changed */ /* for non-Unix implementations */ #define SCREENWIDTH 78 /* command-line message in usage() */ #define FEB_29_OK 1 /* if != 0, ignore 2/29 of common year */ /* Empty text associated with an event entry or a 'note' entry is propagated to the calendar as a blank line. This is useful for grouping related lines together. If you prefer to ignore such lines, define 'KEEP_NULL_LINES' as 0 here. */ #define KEEP_NULL_LINES 1 #define NEAREST_INCR 1 /* if 1, disambiguate "nearest" as later */ /* date; if -1, to earlier (cf. readfile.c) */ #ifndef SEARCH_PCAL_DIR #define SEARCH_PCAL_DIR 1 /* if 1, look for the calendar file in the */ /* same directory where the pcal executable */ /* lives; if 0, avoid this (e.g., in case a */ /* program named 'calendar' has also been */ /* installed in this directory) */ #endif #define JAN 1 /* months (for predefined holiday routines) */ #define FEB 2 #define MAR 3 #define APR 4 #define MAY 5 #define JUN 6 #define JUL 7 #define AUG 8 #define SEP 9 #define OCT 10 #define NOV 11 #define DEC 12 #define NOT_MONTH -1 /* not valid month */ #define ALL_MONTHS 0 /* select all months */ #define ENTIRE_YEAR 13 /* select entire year as one entity */ #define SUN 0 /* weekdays - cf. wildcard codes below */ #define MON 1 #define TUE 2 #define WED 3 #define THU 4 #define FRI 5 #define SAT 6 #define NOT_WEEKDAY -1 /* not valid weekday */ #define NOT_PREDEF_EVENT -1 /* flag for end of 'pre-defined event' list */ /* wildcards - cf. days[] in pcallang.h and pdatefcn[] in pcalglob.h */ #define ANY_DAY 7 /* special - matches any day */ #define ANY_WEEKDAY 8 /* matches any weekday (including holidays) */ #define ANY_WORKDAY 9 /* matches any weekday (excluding holidays) */ #define ANY_HOLIDAY 10 /* matches any holiday */ #define ANY_NONWEEKDAY 11 /* converses of above three */ #define ANY_NONWORKDAY 12 #define ANY_NONHOLIDAY 13 /* moon phase wildcards - must be in same order as MOON_* below */ #define ANY_NM 14 /* matches any new moon, etc. */ #define ANY_1Q 15 #define ANY_FM 16 #define ANY_3Q 17 #define WILD_FIRST ANY_DAY #define WILD_FIRST_WKD ANY_DAY #define WILD_LAST_WKD ANY_NONHOLIDAY #define WILD_FIRST_MOON ANY_NM #define WILD_LAST_MOON ANY_3Q #define WILD_LAST ANY_3Q #define DAY_TEXT 0 /* types of text in data structure */ #define HOLIDAY_TEXT 1 #define NOTE_TEXT 2 #define MAX_DATES 366 /* maximum "wildcard" dates */ #define MAXWORD 300 /* maximum words in date file line */ #define STRSIZ 200 /* size of misc. strings */ #define VALSIZ 12 /* size of numeric value strings */ #define LINSIZ 512 /* size of source line buffer */ #define MAXARGS 3 /* numeric command-line args */ #define WHITESPACE " \t" /* token delimiters in date file */ #define DIGITS "0123456789" /* passes where flags may be recognized (cf. get_args(), pcallang.h) */ #define P_CMD0 (1 << 1) /* parsed in command line pre-pass (-Z only) */ #define P_ENV (1 << 2) /* parsed from environment variable */ #define P_CMD1 (1 << 3) /* parsed in first command-line pass */ #define P_OPT (1 << 4) /* parsed on "opt" lines in date file */ #define P_CMD2 (1 << 5) /* parsed in second command-line pass */ /* * Defaults for calendar layout: */ /* Define strings for comments in PostScript output file... */ #ifdef EPS /* generate EPS-like comments */ #define PS_RELEASE "PS-Adobe-2.0" #else #define PS_RELEASE "PS-Adobe-1.0" #endif #define PCAL_WEBSITE "http://pcal.sourceforge.net" /* default font names and sizes (large calendars) */ #ifndef TITLEFONT #define TITLEFONT "Times-Bold/48" /* month/year title */ #endif #ifndef DATEFONT #define DATEFONT "Times-Bold/25" /* dates */ #endif #ifndef NOTESFONT #define NOTESFONT "Helvetica-Narrow/6" /* notes in boxes */ #endif /* define secondary fonts in terms of main fonts */ #define WEEKDAYFONT "titlefont" /* weekday names */ #define FOOTFONT "titlefont" /* footer strings */ #define HEADINGFONT "titlefont" /* notes box heading */ /* define MAP_DATEFONT as 1 if any secondary font (above) is defined as * "datefont" (cf. writefil.c); otherwise, define as 0 */ #define MAP_DATEFONT 0 /* re-map date font? */ /* font sizes (small, medium, large calendars respectively) - moved here * from pcalinit.ps; enlarged (again) for medium (whole-year) calendars */ #define SMALL 0 #define MEDIUM 1 #define LARGE 2 #define CALSIZE { "small", "medium", "large" }; #define TITLEFONTSIZE { 60, 64, 48 } /* month/year (cf. TITLEFONT above) */ #define DATEFONTSIZE { 60, 56, 25 } /* dates (cf. DATEFONT above) */ #define WEEKDAYFONTSIZE { 0, 30, 12 } /* weekdays */ #define FOOTFONTSIZE { 0, 14, 12 } /* footer strings */ #define HEADINGFONTSIZE 12 /* same as large weekdays */ #define GRIDLINEWIDTH {2.5, 2, 1 } /* grid lines */ #define DATEMARGIN { 10, 8, 4 } /* top/side date margin */ #ifndef SHADING #define SHADING "0.8/0.9" /* default shading (dates/fill boxes) */ #endif #define IS_TITLE_ALIGN(s) (strcmp(s,"left") == 0 || strcmp(s,"center") == 0 || strcmp(s,"right") == 0) #define TITLE_ALIGN "center" /* default monthly title alignment */ #define LFOOT "" /* default foot strings */ #define CFOOT "" #define RFOOT "" #define LANDSCAPE 90 /* degrees to rotate */ #define PORTRAIT 0 #define ROTATE LANDSCAPE /* default */ #define NCOPY 1 /* copies of each output page */ #define MAXCOPY 100 /* just in case... */ #define USA_DATES 0 /* date styles */ #define EUR_DATES 1 #ifndef DATE_STYLE #define DATE_STYLE USA_DATES /* default */ #endif #ifndef FIRST_DAY #define FIRST_DAY SUN /* first day of logical week */ #endif /* values below must be in sync with color_names[] in pcallang.h and also * with prtday{} in pcalinit.ps */ #define BLACK 0 /* colors for dates */ #define GRAY 1 #define OUTLINE 2 #define OUTLINE_GRAY 3 #define NUM_COLORS 4 /* total number of colors */ #define HOLIDAY_DEFAULT -1 /* use same color as weekends */ #define HOLIDAY_COLOR HOLIDAY_DEFAULT /* default time zone for -z flag; you may optionally define this as * (say) "5 [Boston]" (note space) to print the city in the -h message */ #ifndef TIMEZONE #define TIMEZONE "0" /* hours west of GMT/UTC */ #endif /* default colors for weekdays (presumes black and at most one other color - * cf. color_msg() in pcal.c) */ #define DAY_COLOR { GRAY, BLACK, BLACK, BLACK, BLACK, BLACK, GRAY } #define WEEKDAY_COLOR BLACK /* prevalent color in DAY_COLOR */ #define NO_DATEFILE 0 /* date file (if any) to use */ #define USER_DATEFILE 1 #define SYS_DATEFILE 2 /* position of small calendars */ #define SC_NONE 0 /* suppress small calendars */ #define SC_LAST 1 /* use last two boxes */ #define SC_FIRST 2 /* use first two boxes */ #define SC_SPLIT 3 /* split between first and last */ #define SMALL_CAL_POS SC_LAST /* default */ /* box numbers for small calendars - must conform to order defined above */ #define PREV_CAL_BOX \ { NULL_NOTE_BOX, LAST_NOTE_BOX - 1, FIRST_NOTE_BOX, FIRST_NOTE_BOX } #define NEXT_CAL_BOX \ { NULL_NOTE_BOX, LAST_NOTE_BOX, FIRST_NOTE_BOX + 1, LAST_NOTE_BOX } /* values below must be in sync with cond[] in writefil.c */ #define NO_MOONS 0 /* no moon icons */ #define ALL_MOONS 1 /* moon icon on every day */ #define SOME_MOONS 2 /* icons on full, half, new moons */ #define DRAW_MOONS NO_MOONS /* default */ #define NO_JULIANS 0 /* no Julian dates */ #define ALL_JULIANS 1 /* Julian date + days left */ #define SOME_JULIANS 2 /* just Julian dates */ #define JULIAN_DATES NO_JULIANS /* default: none */ #define DO_WHOLE_YEAR FALSE /* -w default */ #define BLANK_BOXES FALSE /* -B default */ #define OUTPUT_PS 0 /* output PostScript */ #define OUTPUT_CAL 1 /* -c: output Un*x calendar(1) input */ #define OUTPUT_HTML 2 /* -H: output HTML table */ #define OUTPUT_TYPE OUTPUT_PS /* default for above */ /* * HTML definitions - may be changed according to local requirements either * here or on the C compiler command line (cf. Makefile) */ /* attributes for tag (cf. body_attributes[] in writefil.c) */ #ifndef BGCOLOR #define BGCOLOR "ffffff" /* background color */ #endif #ifndef BACKGROUND #define BACKGROUND NULL /* background pattern */ #endif #ifndef TEXT #define TEXT NULL /* text color */ #endif #ifndef LINK #define LINK NULL /* link color */ #endif #ifndef ALINK #define ALINK NULL /* active link color */ #endif #ifndef VLINK #define VLINK NULL /* viewed link color */ #endif /* definitions for HTML table format */ #ifndef BORDER #define BORDER 1 /* border width attribute */ #endif #ifndef TEXTLINES #define TEXTLINES 2 /* min. text lines per box */ #endif /* HTML sequences preceding/following holiday dates and headings */ /* holiday dates are bold and red for HTML calendars */ #if !(defined(HOLIDAY_PRE) && defined(HOLIDAY_POST)) #define HOLIDAY_PRE "" #define HOLIDAY_POST "" #endif /* month/year heading (single-month mode) */ #if !(defined(MONTHYEAR_PRE) && defined(MONTHYEAR_POST)) #define MONTHYEAR_PRE "
" #define MONTHYEAR_POST "
 " #endif /* month/year heading (whole-year mode) */ #if !(defined(MONTHYEAR_W_PRE) && defined(MONTHYEAR_W_POST)) #define MONTHYEAR_W_PRE "" #define MONTHYEAR_W_POST "" #endif /* page heading (-C flag) */ #if !(defined(HEADING_PRE) && defined(HEADING_POST)) #define HEADING_PRE "

" #define HEADING_POST "

" #endif /* print blank space (vacant date boxes) at beginning/end of HTML calendars * as N single-column boxes (1) or one N-column box (0) according to your * preference */ #ifndef DIVIDE_BLANK_SPACE #define DIVIDE_BLANK_SPACE 0 #endif /* minimum size of abbreviations - adjust as appropriate for target language */ #define MIN_DAY_LEN 3 /* distinguish "Thursday" from "third" */ #define ABBR_DAY_LEN 3 /* length of abbreviated day names */ #define ABBR_MONTH_LEN 3 /* length of abbreviated month names */ #define MIN_PPTOK_LEN 3 /* minimum length of a pre-processor token */ #define MIN_PREP_LEN 9 /* distinguish "nearest", "nearest_before", "nearest_after" */ #define MIN_ORD_LEN 4 /* distinguish "every" from "even" */ #define MIN_LANG_LEN 2 /* effective size of language names */ /* * Symbolic names for command-line flags. These may be changed * as desired in order to be meaningful in languages other than * English. */ #define F_INITIALIZE 'I' /* re-initialize program defaults */ #define F_BLACK_DAY 'b' /* print day in black */ #define F_GRAY_DAY 'g' /* print day in gray */ #define F_OUTLINE 'O' /* draw "gray" dates as outlines */ #define F_OUTLINE_GRAY 'G' /* outline and fill "gray" dates */ #define F_DAY_FONT 'd' /* select alternate day font */ #define F_NOTES_FONT 'n' /* select alternate notes font */ #define F_TITLE_FONT 't' /* select alternate title font */ #define F_REMAP_FONT 'r' /* remap font for 8-bit characters */ #define F_EMPTY_CAL 'e' /* print empty calendar */ #define F_DATE_FILE 'f' /* select alternate date file */ #define F_OUT_FILE 'o' /* select alternate output file */ #define F_LANDSCAPE 'l' /* landscape mode */ #define F_PORTRAIT 'p' /* portrait mode */ #define F_PAPERSIZE 'P' /* paper size */ #define F_HELP 'h' /* generate full help message */ #define F_USAGE 'u' /* generate parameter usage message */ #define F_VERSION 'v' /* generate version ID */ #define F_MOON_4 'm' /* print new/quarter/full moons */ #define F_MOON_ALL 'M' /* print all moons */ #define F_DEFINE 'D' /* define preprocessor symbol */ #define F_UNDEF 'U' /* undefine preprocessor symbol */ #define F_L_FOOT 'L' /* define left foot string */ #define F_C_FOOT 'C' /* define center foot string */ #define F_R_FOOT 'R' /* define right foot string */ #define F_NOTES_HDR 'N' /* define heading for notes box */ #define F_FIRST_DAY 'F' /* define alternate starting day */ #define F_USA_DATES 'A' /* parse American date format */ #define F_EUR_DATES 'E' /* parse European date format */ #define F_X_TRANS 'X' /* X-axis transformation */ #define F_Y_TRANS 'Y' /* Y-axis transformation */ #define F_X_SCALE 'x' /* X-axis scale factor */ #define F_Y_SCALE 'y' /* Y-axis scale factor */ #define F_JULIAN 'j' /* print Julian day (day of year) */ #define F_JULIAN_ALL 'J' /* print Julian day and days left */ #define F_WHOLE_YEAR 'w' /* print whole year per page */ /* (cf. W_WYFLAG below) */ #define F_BLANK_BOXES 'B' /* don't fill unused boxes */ #define F_NUM_PAGES '#' /* print multiple copies of each page */ #define F_SC_NONE 'S' /* suppress small calendars */ #define F_SC_FIRST 'k' /* prev/next in first two boxes */ #define F_SC_SPLIT 'K' /* split between first and last boxes */ #define F_SHADING 's' /* define date/fill box shading */ #define F_CALENDAR 'c' /* generate "calendar" utility input */ #define F_HTML 'H' /* generate calendar in HTML */ #define F_1COLUMN 'q' /* print one column per month (HTML) */ #define F_TIMEZONE 'z' /* specify time zone for moon phase */ #define F_SETLANG 'a' /* set output lang for months/days */ #define F_TYPEFACE 'T' /* set fontstyle (Bold/Roman/Italic) */ #define F_TITLEALIGN 'W' /* set title alignment (left/center/right) */ /* special "hidden" flag (and subflags) for debug info generation */ #define F_DEBUG 'Z' /* generate debugging information */ #define D_DATES 'D' /* debug dates as read */ #define D_FILE_PATHS 'F' /* debug date file paths */ #define D_MOON 'M' /* debug moon phases */ #define D_TEXT 'T' /* debug dates/text as written */ #define D_OPT 'O' /* debug option flags */ #define D_PREPROCESSOR 'P' /* debug "preprocessor" operation */ /* * Words used in usage() message - translate as necessary */ #define W_DEFAULT "default" /* translate as required */ #define W_USAGE "Usage" #define W_FONT_SIZE "{}{/}" /* names of metavariables */ #define W_DAY "" #define W_DAY2 "{-}" #define W_STRING "" #define W_FILE "" #define W_SYMBOL "" #define W_VALUE "" #define W_LANG "" #define W_PAPERSIZE "" #define W_TYPEFACE "B|I|R" #define W_TITLEALIGN "left|center|right" #define W_MAPPING "" #define W_N "" #define W_SHADING "{}{/}" /* special flag_msg[] entries for end of option group, etc. */ #define END_GROUP '\n', NULL, NULL, NULL /* end of option group */ #define END_LIST '\0', NULL, NULL, NULL /* end of list */ #define GROUP_DEFAULT ' ', NULL, " " /* group default */ /* Specify the number of entries from the 'param_msg[]' array to be printed in the 'pcal -h' output as part of the command-line syntax message... */ #define PARAM_MSGS 3 /* format strings for color_msg() - translate as necessary */ #define COLOR_MSG_1 "all days in %s" #define COLOR_MSG_2 "in %s; others in %s" /* format string for short usage() message */ #define USAGE_MSG "\"%s -%c\" prints full description of flags, parameters, and file formats\n" /* font style special characters: \f[BIR] => " .[bir] " (cf. pcalutil.c) */ #define BOLD 'B' /* in calendar file (\fB[BIR]) */ #define ITALIC 'I' #define ROMAN 'R' #define PREVFONT 'P' #define BOLD_FONT ".b" /* in PostScript output */ #define ITALIC_FONT ".i" #define ROMAN_FONT ".r" #define LINE_SEP ".p" /* text line separator */ /* strings used in error messages */ #define ENV_VAR "environment variable " #define DATE_FILE "date file " /* Error and information messages - translate as necessary */ /* program error messages */ #define E_ALLOC_ERR "%s: calloc() failed - out of memory\n" #define E_FOPEN_ERR "%s: can't open file %s\n" #define E_ILL_LINE "%s: %s in file %s, line %d\n" #define E_ILL_MONTH "%s: month %d not in range %d .. %d\n" #define E_ILL_OPT "%s: unrecognized flag %s" #define E_ILL_OPT2 " (%s\"%s\")" #define E_ILL_YEAR "%s: year %d not in range %d .. %d\n" #define E_SYMFULL "%s: symbol table full - can't define %s\n" #define E_UNT_IFDEF "%s: unterminated if{n}def..{else..}endif in file %s\n" #define E_FLAG_IGNORED "%s: -%c flag ignored (%s\"%s\")\n" #define E_ILL_PAPERSIZE "%s: unrecognized paper size '%s'\n" /* preprocessor error strings */ #define E_ELSE_ERR "unmatched \"else\"" #define E_ELIF_ERR "unmatched \"elif\"" #define E_END_ERR "unmatched \"endif\"" #define E_GARBAGE "extraneous data on \"%s\" line" #define E_INV_DATE "invalid date" #define E_NO_MATCH "no match for wildcard" #define E_INV_LINE "unrecognized line" #define E_FILE_NESTING "maximum file nesting level exceeded" #define E_IF_NESTING "maximum \"if{n}def\" nesting level exceeded" #define E_EXPR_SYNTAX "syntax error in expression" /* moon file error strings */ #define E_DATE_SEQ "date or phase out of sequence" #define E_PREM_EOF "premature EOF" /* predefined macro names */ #define DEF_WHOLE_YEAR "whole_year" /* defined when -w set */ #define DEF_HTML "html" /* defined when -H set */ #define DEF_LANG "lang_" /* lang_XX defined when -aXX set */ /* --------------------------------------------------------------------------- Macro Definitions */ /* Define a 'convenience' macro used to explicitly declare arguments as 'unused' where intentionally-unused function parameters are declared. This prevents warnings by the 'gcc' GNU C compiler that would otherwise appear because of using the '-W' compile option. The Unix and DOS+DJGPP build environments support this ability. We assume that all other build environments do not support it, so this macro is defined as a null value in such cases. */ #if defined (BUILD_ENV_UNIX) || defined (BUILD_ENV_DJGPP) #define GCC_UNUSED __attribute__ ((unused)) #else #define GCC_UNUSED #endif /* write character _c to file _fp; print as octal escape if _fc(_c) is FALSE */ #define PUTCHAR(_fc, _c, _fp) \ fprintf((_fp), (_c) == ' ' || _fc((_c) & CHAR_MSK) ? "%c" : "\\%03o" , (_c) & CHAR_MSK) #define PUTSTR(_fc, _s, _fp) \ do { char *_p; for (_p = (_s); *_p; _p++) PUTCHAR(_fc, *_p, _fp); } while (0) #define IS_LEAP(y) ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0)) #define LENGTH_OF(m, y) (month_len[(m)-1] + ((m) == FEB && IS_LEAP(y))) #define YEAR_LEN(y) (IS_LEAP(y) ? 366 : 365) #define DAY_OF_YEAR(m, d, y) ((month_off[(m)-1] + ((m) > FEB && IS_LEAP(y))) + d) #define OFFSET_OF(m, y) ((month_off[(m)-1] + ((m) > FEB && IS_LEAP(y))) % 7) #define FIRST_OF(m, y) calc_weekday(m, 1, y) #define START_BOX(m, y) ((FIRST_OF(m, y) - first_day_of_week + 7) % 7) #define PREV_MONTH(m, y) ((m) == JAN ? DEC : (m) - 1) #define PREV_YEAR(m, y) ((m) == JAN ? (y) - 1 : (y)) #define NEXT_MONTH(m, y) ((m) == DEC ? JAN : (m) + 1) #define NEXT_YEAR(m, y) ((m) == DEC ? (y) + 1 : (y)) #define BUMP_MONTH_AND_YEAR(m, y) (((m) == DEC) ? (++(y), (m) = JAN) : (++(m))) #define INIT_COLORS do { \ memcpy(day_color, default_color, sizeof(day_color)); \ holiday_color = HOLIDAY_COLOR; \ weekday_color = WEEKDAY_COLOR; \ } while (0) #define P_LASTCHAR(p) ((p) && *(p) ? (p) + strlen(p) - 1 : NULL) #define LASTCHAR(p) (p)[strlen(p) - 1] #define IS_NUMERIC(p) ((p)[strspn((p), DIGITS)] == '\0') #define IS_EURDATE(p) ((ispunct((int)(p)[strspn((p), DIGITS)])) && \ ((p)[strspn((p), DIGITS)+1] == '\0')) #define IS_WILD(w) ((w) >= WILD_FIRST && (w) <= WILD_LAST) #define MAKE_DATE(dt, m, d, y) \ do { (dt).mm = m; (dt).dd = d; (dt).yy = y; } while (0) #define ERR(errmsg) \ fprintf(stderr, E_ILL_LINE, progname, errmsg, filename, line); #define DEBUG(f) ((debug_flags & f) != 0) #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0])) #ifndef isodigit /* rare */ #define isodigit(c) ((c) >= '0' && (c) <= '7') #endif #ifndef isxdigit /* ANSI standard */ #define isxdigit(c) \ (isdigit(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) #endif /* --------------------------------------------------------------------------- Data Declarations (including externals) */ extern year_info *head; extern int curr_year; extern int init_month; extern int init_year; extern int nmonths; extern int final_month; extern int final_year; extern double xsval_pgm; extern double ysval_pgm; extern int xtval_pgm; extern int ytval_pgm; extern char *words[]; extern char lbuf[]; extern char progname[]; extern char progpath[]; extern char version[]; extern char month_len[]; extern short month_off[]; extern int (*pdatefcn[])(int, int, int); extern char default_color[]; extern char day_color[]; extern int holiday_color; extern int weekday_color; extern int datefile_type; extern char datefile[]; extern int rotate; extern int draw_moons; extern char datefont[]; extern char titlefont[]; extern char notesfont[]; extern int mapfonts; extern char shading[]; extern char lfoot[]; extern char cfoot[]; extern char rfoot[]; extern char notes_hdr[]; extern int first_day_of_week; extern int date_style; extern char outfile[]; extern double xsval_user; extern double ysval_user; extern int xtval_user; extern int ytval_user; extern int julian_dates; extern int do_whole_year; extern int output_type; extern int one_column; extern int blank_boxes; extern int ncopy; extern int small_cal_pos; extern int prev_cal_box[]; extern int next_cal_box[]; extern char time_zone[]; extern int tz_flag; extern char title_align[]; extern int debug_flags; extern char *color_names[]; extern char *days[]; extern char *esp_accent; extern KWD_F pp_info[]; extern KWD_H predef_events[]; extern KWD preps[]; extern KWD_O ordinals[]; extern char *ord_suffix[]; extern KWD keywds[]; extern KWD phases[]; extern char default_notes_hdr[]; extern char fontstyle[]; extern FLAG_USAGE flag_tbl[]; extern DEBUG_INFO debug_info[]; extern FLAG_MSG flag_msg[]; extern PARAM_MSG param_msg[]; extern paper_info_str_typ paper_info[]; extern int paper_size; extern int page_dim_short_axis_pts, page_dim_long_axis_pts; extern int daybox_width_pts, daybox_height_pts; /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ pcal-4.11.0/src/pcallang.c0000644000175000001440000005542310732017670013431 0ustar wusers/* --------------------------------------------------------------------------- pcallang.c Notes: This file contains routines and data associated with supporting the various languages. Revision history: 4.11.0 B.Marr 2007-12-15 Add support for Slovak language, thanks to Zdenko Podobny. Add support for Hawaiian language, thanks to Eric Nichols. 4.10.0 B.Marr 2006-07-19 Created. Split actual data definitions from 'pcallang.h', moving them here, and left just the external references in that header file. Since most of the comments in the old 'pcallang.h' file apply to the items in this new file, those comments were moved to this file (see below). B.Marr 2006-07-12 Support new languages: Polish (thanks to Dominik 'Chiron' Derlatka ), Dutch (thanks to Ewald Beekman , Romanian (thanks to Claudiu Costin ), and Danish (thanks to Kenneth Geisshirt ). Eliminate redundant line, commented out in C++ style ('//'). Made semi-extensive changes to 'pcal -h' output. Remove unneeded definitions. Get rid of all the '#ifdef PROTOS' checks, which are pretty much obsolete these days and just needlessly clutter up the code. 4.9.0 B.Marr 2005-08-08 Eliminate the hack to support Esperanto via a custom, dedicated character encoding. Esperanto is now handled generically by the 'Latin3' (ISO 8859-3) character encoding. Fix long-standing error in Spanish 'Saturday' string (the first 'a' needed an acute accent). Replace certain uses of 'u'+circumflex with the proper 'u'+macron in certain Latvian and Lithuanian month names. B.Marr 2005-08-02 Support new 'delete' keyword, from Bill Bogstad's 'event deletion' patch. Support new language: Catalan (thanks to Carles Sadurní Anguita ). To be consistent, convert all high-order characters in the language string specifications to simple octal format, to match the octal format used in the PostScript encoding vector specifications of 'pcalinit.ps'. This makes it easier to edit this ('pcallang.h') file in any editor. It also makes checking of the language strings against the character encodings simpler. B.Marr 2005-01-04 Support new character encodings (KOI8-R and several 'ISO 8859-*' encodings). Use new KOI8-R character mapping to properly support Russian langauge. Use new Latin-4 character mapping to properly support Lithuanian and Latvian langauges. Support new languages: Czech (thanks to Peter Cernoch ) and Hungarian (thanks to Ferenc Kruzslicz ) 4.8.0 B.Marr 2004-12-12 Add Russian, Latvian, and Lithuanian language support all based on patches from Neeme Praks (nemecec at users dot sourceforge dot net). B.Marr 2004-12-04 Fix misleading references to "holiday" to instead refer to "predefined event" (i.e. not all pre-defined events are 'holidays'). Create and support concept of 'input' language versus 'output' language. Support new paper sizes. Support specification of paper size via run-time option (command-line, etc). Remove spaces embedded within tab fields. Clarify help text output ('pcal -h'). B.Marr 2004-11-11 Add Swedish, Ukrainian, Portuguese, and Estonian languages based respectively on patches from Joel Fredrikson (joel at it dot uu dot se), Volodymyr M. Lisivka (lvm at mystery dot lviv dot net), Pedro Zorzenon Neto (pzn at terra dot com dot br), and Neeme Praks (nemecec at users dot sourceforge dot net). Provide support for "Friday the 13th" events, based on a patch from Don Laursen (donrl at users dot sourceforge dot net). Merge content from (now-obsolete) files 'months.h' and 'days.h' into this file. 4.7.1 SF 01/06/2003 added F_1COLUMN and Finnish language 4.7 AWR 01/26/2000 move F_USAGE, F_VERSION, and F_HELP flags from first command line pass (P_CMD1) to preliminary command line pass (P_CMD0) in order to parse these flags (and exit) prior to parsing any numeric arguments 03/08/1998 introduce static strings for conversion of numeric defaults (cf. pcaldefs.h, usage() in pcal.c) 12/21/1997 add braces around subarray definitions support -H flag to generate calendar as HTML table 4.6 AWR 09/13/1996 support "nearest_before" and "nearest_after" keywords AWR 11/10/1995 support -T flag to select default font style (Bold/Italic/Roman) AWR 05/17/1995 added Esperanto support AWR 05/09/1995 add support for bold/Italic/Roman font styles using troff-style \f[BIR] escape sequences AH 02/03/1995 added more languages for headers added orthodox special dates 4.5 AWR 12/21/1993 removed references to obsolete COLOR_MIN, COLOR_MAX (cf. pcaldefs.h) 11/09/1993 parameterize maximum length of entries in days[] (DAYSIZE) 09/30/1993 revise flag descriptions for [-dnt] to reflect independent specification of font name and point size 07/09/1993 revise PostScript comment block AWR 02/05/1993 support -# flag (specify multiple copies of each output page) AWR 02/11/1992 scrap moon file message add support for predefined holidays 4.4 AWR 01/20/1992 support -z flag (specify time zone) AWR 01/13/1992 support optional font size on -d, -t move color names here; change semantics, messages, etc. for -[bgOG] 4.3 AWR 12/03/1991 support -s flag (override default shading of dates and fill boxes) AWR 10/17/1991 support -Z flag to generate debugging information 4.2 AWR 10/08/1991 support -[kK] flags (select position of small calendars AWR 10/03/1991 support "note/" (new message only) support -S flag (no small calendars) AWR 10/02/1991 support -N flag (user-specified notes heading) change message for -n to reflect optional notes font size AWR 09/30/1991 support "if" (synonym for "ifdef") and "elif" in date file AWR 09/19/1991 support -c flag (generate input file suitable for use with Un*x "calendar" utility and Pcal) support "elif" in "if{n}def" block 4.11 AWR 08/20/1991 support "nearest" keyword as per Andy Fyfe changed MIN_ORD_LEN from 3 to 4 (to distinguish "even" from "every") add ABBR_DAY_LEN and ABBR_MONTH_LEN (cf. writefil.c) for length of abbreviated day/month names document %u and %w formats and number following %[+-] (cf. writefil.c) add DEF_WHOLE_YEAR (predefined when -w flag specified - cf. pcal.c) 4.1 AWR 08/16/1991 support -G flag (outlined gray) 4.02 AWR 07/02/1991 support -v flag (version number); add ordinal_suffix(); add format specifiers to help message 4.0 AWR 03/01/1991 expand parameter message to explain parameter meaning when -w specified AWR 02/19/1991 revise ordinal definitions for support of negative ordinals AWR 02/06/1991 add text describing expression syntax AWR 02/04/1991 support "odd" and "even" ordinals AWR 01/28/1991 support -B (blank fill squares) flag and -O (outline "gray" dates) flag AWR 01/16/1991 added moon file support (tokens, help file text, error messages); define note block heading here AWR 01/07/1991 added support for -w (whole year) flag */ /* --------------------------------------------------------------------------- Header Files */ #include "pcaldefs.h" #include "pcallang.h" /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ /* --------------------------------------------------------------------------- Constant Declarations */ /* --------------------------------------------------------------------------- Macro Definitions */ /* --------------------------------------------------------------------------- Data Declarations (including externals) */ /* Define the default 'input' language (for interpretation of dates on events in the configuration file) and the default 'output' language (for the month names and day-of-week names on the output). */ int input_language = LANG_DEFAULT; int output_language = LANG_DEFAULT; /* Provide month names and full/abbreviated day-of-week names in each of the supported languages. Support for almost any language is possible. Note: The order of the languages used here must match the order defined by the 'LANG_xxx' enumerations (defined in 'pcallang.h')! Each language is specified in the appropriate encoding. See the 'lang_mapping[]' array below. For example, Greek uses ISO 8859-7 (similar to ELOT-928) while Russian uses KOI8-R and Hungarian uses ISO8859-2 (aka 'Latin2'). Any characters outside the normal range of simple ASCII representations should be entered as a 3-digit octal code corresponding to the value for that character in that language's encoding. For example, the "a" in the German month "March" is the octal character '\344' (decimal 228). German uses the Latin1 (ISO 8859-1) character encoding. Octal 344 in ISO 8859-1 (see 'encvec.c' for all the PostScript character encoding vectors) corresponds to the PostScript character known as "/adieresis" -- an "a" with a dieresis (two dots) over it. */ char *months_ml[NUM_LANGUAGES][12] = { /* English */ { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }, /* Greek */ { "\311\341\355\357\365\334\361\351\357\362", "\326\345\342\361\357\365\334\361\351\357\362", "\314\334\361\364\351\357\362", "\301\360\361\337\353\351\357\362", "\314\334\351\357\362", "\311\357\375\355\351\357\362", "\311\357\375\353\351\357\362", "\301\375\343\357\365\363\364\357\362", "\323\345\360\364\335\354\342\361\351\357\362", "\317\352\364\376\342\361\351\357\362", "\315\357\335\354\342\361\351\357\362", "\304\345\352\335\354\342\361\351\357\362" }, /* Italian */ { "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" }, /* French */ { "Janvier", "F\351vrier", "Mars", "Avril", "Mai", "Juin", "Juillet", "Ao\373t", "Septembre", "Octobre", "Novembre", "D\351cembre" }, /* German */ { "Januar", "Februar", "M\344rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember" }, /* Esperanto */ { "Januaro", "Februaro", "Marto", "Aprilo", "Majo", "Junio", "Julio", "A\375gusto", "Septembro", "Oktobro", "Novembro", "Decembro" }, /* Spanish */ { "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" }, /* Finnish */ { "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kes\344kuu", "Hein\344kuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" }, /* Swedish */ { "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" }, /* Portuguese */ { "Janeiro", "Fevereiro", "Mar\347o", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" }, /* Ukrainian */ { "\323\246\336\305\316\330", "\314\300\324\311\312", "\302\305\322\305\332\305\316\330", "\313\327\246\324\305\316\330", "\324\322\301\327\305\316\330", "\336\305\322\327\305\316\330", "\314\311\320\305\316\330", "\323\305\322\320\305\316\330", "\327\305\322\305\323\305\316\330", "\326\317\327\324\305\316\330", "\314\311\323\324\317\320\301\304", "\307\322\325\304\305\316\330" }, /* Estonian */ { "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember" }, /* Russian */ { "\321\316\327\301\322\330", "\306\305\327\322\301\314\330", "\315\301\322\324", "\301\320\322\305\314\330", "\315\301\312", "\311\300\316\330", "\311\300\314\330", "\301\327\307\325\323\324", "\323\305\316\324\321\302\322\330", "\317\313\324\321\302\322\330", "\316\317\321\302\322\330", "\304\305\313\301\302\322\330" }, /* Latvian */ { "janv\340ris", "febru\340ris", "marts", "apr\357lis", "maijs", "j\376nijs", "j\376lijs", "augusts", "septembris", "oktobris", "novembris", "decembris" }, /* Lithuanian */ { "Sausis", "Vasaris", "Kovas", "Balandis", "Gegu\276\354", "Bir\276elis", "Liepa", "Rugpj\376tis", "Rugs\354jis", "Spalis", "Lapkritis", "Gruodis" }, /* Czech */ { "Leden", "\332nor", "B\370ezen", "Duben", "Kv\354ten", "\310erven", "\310ervenec", "Srpen", "Z\341\370\355", "\330\355jen", "Listopad", "Prosinec" }, /* Hungarian */ { "Janu\341r", "Febru\341r", "M\341rcius", "\301prilis", "M\341jus", "J\372nius", "J\372lius", "Augusztus", "Szeptember", "Okt\363ber", "November", "December" }, /* Catalan */ { "Gener", "Febrer", "Mar\347", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre" }, /* Polish */ { "Stycze\361", "Luty", "Marzec", "Kwiecie\361", "Maj", "Czerwiec", "Lipiec", "Sierpie\361", "Wrzesie\361", "Pa\274dziernik", "Listopad", "Grudzie\361"}, /* Dutch */ { "Januari", "Februari", "Maart", "April", "Mei", "Juni", "Juli", "Augustus", "September", "October", "November", "December" }, /* Romanian */ { "Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie" }, /* Danish */ { "Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December" }, /* Slovak */ { "Janu\341r", "Febru\341r", "Marec", "Apr\355l", "M\341j", "J\372n", "J\372l", "August", "September", "Okt\363ber", "November", "December" }, /* Hawaiian */ { "Ianuali", "Pepeluali", "Malaki", "`Apelila", "Mei", "Iune", "Iulai", "`Aukake", "Kepakemapa", "`Okakopa", "Nowemapa", "K\272k\272mapa" }, }; /* Provide full day-of-week names in each of the supported languages. Must be a 3-D array so address within may be used as an initializer. */ char days_ml[NUM_LANGUAGES][7][DAY_LENGTH_MAX_CHARS] = { /* English */ { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }, /* Greek */ { "\312\365\361\351\341\352\336", "\304\345\365\364\335\361\341", "\324\361\337\364\347", "\324\345\364\334\361\364\347", "\320\335\354\360\364\347", "\320\341\361\341\363\352\345\365\336", "\323\334\342\342\341\364\357" }, /* Italian */ { "Domenica", "Luned\354", "Marted\354", "Mercoled\354", "Gioved\354", "Venerd\354", "Sabato" }, /* French */ { "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" }, /* German */ { "Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag" }, /* Esperanto */ { "Diman\346o", "Lundo", "Mardo", "Merkredo", "\254a\375do", "Vendredo", "Sabato" }, /* Spanish */ { "Domingo", "Lunes", "Martes", "Mi\351rcoles", "Jueves", "Viernes", "S\341bado" }, /* Finnish */ { "Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai" }, /* Swedish */ { "S\366ndag", "M\345ndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "L\366rdag" }, /* Portuguese */ { "Domingo", "Segunda", "Ter\347a", "Quarta", "Quinta", "Sexta", "S\341bado" }, /* Ukrainian */ { "\316\305\304\246\314\321", "\320\317\316\305\304\246\314\317\313", "\327\246\327\324\317\322\317\313", "\323\305\322\305\304\301", "\336\305\324\327\305\322", "\320\047\321\324\316\311\303\321", "\323\325\302\317\324\301" }, /* Estonian */ { "P\374hap\344ev", "Esmasp\344ev", "Teisip\344ev", "Kolmap\344ev", "Neljap\344ev", "Reede", "Laup\344ev" }, /* Russian */ { "\327\317\323\313\322\305\323\305\316\330\305", "\320\317\316\305\304\305\314\330\316\311\313", "\327\324\317\322\316\311\313", "\323\322\305\304\301", "\336\305\324\327\305\322\307", "\320\321\324\316\311\303\301", "\323\325\302\302\317\324\301" }, /* Latvian */ { "Sv\272tdiena", "Pirmdiena", "Otrdiena", "Tre\271diena", "Ceturtdiena", "Piektdiena", "Sestdiena" }, /* Lithuanian */ { "Sekmadienis", "Pirmadienis", "Antradienis", "Tre\350iadienis", "Ketvirtadienis", "Penktadienis", "\251e\271tadienis" }, /* Czech */ { "Ned\354le", "Pond\354l\355", "\332ter\375", "St\370eda", "\310tvrtek", "P\341tek", "Sobota" }, /* Hungarian */ { "Vas\341rnap", "H\351tf\365", "Kedd", "Szerda", "Cs\374t\366rt\366k", "P\351ntek", "Szombat" }, /* Catalan */ { "Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte" }, /* Polish */ { "Niedziela", "Poniedzia\263ek", "Wtorek", "\246roda", "Czwartek", "Pi\261tek", "Sobota" }, /* Dutch */ { "Zondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag" }, /* Romanian */ { "Duminic\343", "Luni", "Mar\376i", "Miercuri", "Joi", "Vineri", "S\356mb\343t\343" }, /* Danish */ { "S\370ndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "L\370rdag" }, /* Slovak */ { "Nede\265a", "Pondelok", "Utorok", "Streda", "\251tvrtok", "Piatok", "Sobota" }, /* Hawaiian */ { "L\340pule", "P\362`akahi", "P\362`alua", "P\362`akolu", "P\362`ah\340", "P\362`alima", "P\362`aono" }, }; /* Provide abbreviated day-of-week names in each of the supported languages. These names are used on yearly-format calendars only. */ char days_ml_short[NUM_LANGUAGES][7][DAY_LENGTH_MAX_CHARS] = { /* English */ { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }, /* Greek */ { "\312\365\361", "\304\345\365", "\324\361\337", "\324\345\364", "\320\335\354", "\320\341\361", "\323\334\342" }, /* Italian */ { "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" }, /* French */ { "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" }, /* German */ { "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" }, /* Esperanto */ { "Dim", "Lun", "Mar", "Mer", "\254a\375", "Ven", "Sab" }, /* Spanish */ { "Dom", "Lun", "Mar", "Mi\351", "Jue", "Vie", "S\341b" }, /* Finnish */ { "Su", "Ma", "Ti", "Ke", "To", "Pe", "La" }, /* Swedish */ { "S\366n", "M\345n", "Tis", "Ons", "Tor", "Fre", "L\366r" }, /* Portuguese */ { "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S\341b" }, /* Ukrainian */ { "\316\304", "\320\316", "\327\324", "\323\322", "\336\324", "\320\324", "\323\302" }, /* Estonian */ { "P", "E", "T", "K", "N", "R", "L" }, /* Russian */ { "\367\323", "\360\316", "\367\324", "\363\322", "\376\324", "\360\324", "\363\302" }, /* Latvian */ { "Sv", "Pm", "Ot", "Tr", "Ce", "Pt", "Se" }, /* Lithuanian */ { "S", "Pr", "A", "T", "K", "P", "\251" }, /* Czech */ { "Ne", "Po", "\332t", "St", "\310t", "P\341", "So" }, /* Hungarian */ { "V", "H", "K", "Sze", "Cs", "P", "Szo" }, /* Catalan */ { "Dg", "Dl", "Dm", "Dc", "Dj", "Dv", "Ds" }, /* Polish */ { "Nd", "Pn", "Wt", "\246r", "Cz", "Pt", "Sb" }, /* Dutch */ { "Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za" }, /* Romanian */ { "Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "S\356m" }, /* Danish */ { "S\370", "Ma", "Ti", "On", "To", "Fr", "L\370" }, /* Slovak */ { "Ne", "Po", "Ut", "St", "\251t", "Pi", "So" }, /* Hawaiian */ { "LP", "P1", "P2", "P3", "P4", "P5", "P6" }, }; /* Provide the various 2-character abbreviations for each of the supported languages. These abbreviations are used in conjunction with the '-a' flag to specify the desired output language. Note: The order of the languages used here must match the order defined by the 'LANG_xxx' enumerations (defined in 'pcallang.h')! Must be a 2-D array so address within may be used as an initializer. The full language name (in brackets) is used only when printing the default in the usage message (see 'MIN_LANG_LEN'). The codes used here should match the 2-letter version of the ISO 639 (language code) standard. Do not use the ISO 3166 (country code) standard since those values are often different from the language code values (e.g. Sweden country code = 'se', Swedish language code = 'sv'). NOTE: Unfortunately, while the Hawaiian language has a 3-letter ISO 639 code ('haw'), it appears to have no 2-letter ISO 639 code. Therefore, I (Bill Marr) decided to use 'ha' (the code for the language known as 'Hausa') since I don't suspect that will cause any problems. */ char lang_id[NUM_LANGUAGES][LANG_LENGTH_MAX_CHARS] = { "en [English]", "el [Greek]", "it [Italian]", "fr [French]", "de [German]", "eo [Esperanto]", "es [Spanish]", "fi [Finnish]", "sv [Swedish]", "pt [Portuguese]", "uk [Ukrainian]", "et [Estonian]", "ru [Russian]", "lv [Latvian]", "lt [Lithuanian]", "cs [Czech]", "hu [Hungarian]", "ca [Catalan]", "pl [Polish]", "nl [Dutch]", "ro [Romanian]", "da [Danish]", "sk [Slovak]", "ha [Hawaiian]", }; /* Associate a default character mapping (corresponding to the PostScript encoding vector defined in 'encvec.c') with each of the supported languages. Note: The order of the languages used here must match the order defined by the 'LANG_xxx' enumerations (defined in 'pcallang.h')! */ int lang_mapping[NUM_LANGUAGES] = { ENC_NONE, /* English */ ENC_GREEK, /* Greek */ ENC_LATIN_1, /* Italian */ ENC_LATIN_1, /* French */ ENC_LATIN_1, /* German */ ENC_LATIN_3, /* Esperanto */ ENC_LATIN_1, /* Spanish */ ENC_LATIN_1, /* Finnish */ ENC_LATIN_1, /* Swedish */ ENC_LATIN_1, /* Portuguese */ ENC_KOI8_U, /* Ukrainian */ ENC_LATIN_1, /* Estonian */ ENC_KOI8_R, /* Russian */ ENC_LATIN_4, /* Latvian */ ENC_LATIN_4, /* Lithuanian */ ENC_LATIN_2, /* Czech */ ENC_LATIN_2, /* Hungarian */ ENC_LATIN_1, /* Catalan */ ENC_LATIN_2, /* Polish */ ENC_LATIN_1, /* Dutch */ ENC_LATIN_2, /* Romanian */ ENC_LATIN_1, /* Danish */ ENC_LATIN_2, /* Slovak */ ENC_LATIN_4, /* Hawaiian */ }; /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ pcal-4.11.0/src/pcallang.h0000644000175000001440000001762710732017670013442 0ustar wusers/* --------------------------------------------------------------------------- pcallang.h Notes: This file contains various definitions and declarations of items associated with supporting the various languages. Revision history: 4.11.0 B.Marr 2007-12-15 Add support for Slovak language, thanks to Zdenko Podobny. Add support for Hawaiian language, thanks to Eric Nichols. 4.10.0 B.Marr 2006-07-19 Split actual data definitions from 'pcallang.h', moving them to new file 'pcallang.c', and left just the external references here. Since most of the comments in this file apply to the items moved to 'pcallang.c', those comments were moved to that file. Reformatted comments and code to match my standards. */ /* --------------------------------------------------------------------------- Header Files */ /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ /* --------------------------------------------------------------------------- Constant Declarations */ #define NUM_LANGUAGES 24 /* *** Change this if adding languages *** */ #define LANG_ENGLISH 0 #define LANG_GREEK 1 #define LANG_ITALIAN 2 #define LANG_FRENCH 3 #define LANG_GERMAN 4 #define LANG_ESPERANTO 5 #define LANG_SPANISH 6 #define LANG_FINNISH 7 #define LANG_SWEDISH 8 #define LANG_PORTUGUESE 9 #define LANG_UKRAINIAN 10 #define LANG_ESTONIAN 11 #define LANG_RUSSIAN 12 #define LANG_LATVIAN 13 #define LANG_LITHUANIAN 14 #define LANG_CZECH 15 #define LANG_HUNGARIAN 16 #define LANG_CATALAN 17 #define LANG_POLISH 18 #define LANG_DUTCH 19 #define LANG_ROMANIAN 20 #define LANG_DANISH 21 #define LANG_SLOVAK 22 #define LANG_HAWAIIAN 23 #ifndef LANG_DEFAULT #define LANG_DEFAULT LANG_ENGLISH #endif /* Define the maximum length of the strings in the 'days_ml[]' array... */ #define DAY_LENGTH_MAX_CHARS 20 /* Define the maximum length of the strings in the 'lang_id[]' array... */ #define LANG_LENGTH_MAX_CHARS 20 /* If 'MAPFONTS' is defined, generate PostScript code to re-map text fonts * (cf. pcalinit.ps) according to the definitions of the specified 8-bit * character set. Note that the overhead to do this slows PostScript down -- * especially for small jobs -- so users in English-speaking countries might * prefer to leave 'MAPFONTS' undefined. * * Speakers of languages other than English may select any of the available * remappings by defining 'MAPFONTS' as described in the 'Makefile'. * * Here's a list of the supported remappings... * * Character Encoding A.K.A. Regions/Languages * ---------------------------------------------------------------- * * ISO 8859-1 Latin1 Western Europe * * (e.g. Italian, French, German, * Spanish, Finnish, Swedish, * Portuguese, Estonian, Catalan, * etc) * * ISO 8859-2 Latin2 Central European, Slavic * * (e.g. Czech, Hungarian) * * ISO 8859-3 Latin3 South European, Esperanto, * Galician, Maltest, Turkish * * ISO 8859-4 Latin4 North European, Old Baltic * * (e.g. Latvian, Lithuanian) * * ISO 8859-5 Cyrillic * * ISO 8859-7 Greek Modern Greek * * ISO 8859-9 Latin5 Turkish * * ISO 8859-10 Latin6 Nordic * * ISO 8859-11 Thai * * ISO 8859-13 Latin7 Baltic Rim * * ISO 8859-14 Latin8 Celtic * * ISO 8859-15 Latin9/Latin0 Western Europe * (Latin1 + 'Euro' symbol) * * KOI8-R Russian * * KOI8-U Ukrainian * * Roman8 * */ /* * Define enumerations for each of the available character encodings * (mappings). * * The 'Arabic', 'Hebrew', and 'Latin-10' character encodings are not enabled * because we currently (Aug 2005) have no PostScript encoding vector (see * 'pcalinit.ps') for those character sets. * * 'ISO 8859-12' is not included because that was a draft for 'Latin-7' that * was never implemented and was therefore skipped. * */ #define ENC_NONE 0 /* no re-mapping */ #define ENC_LATIN_1 1 /* ISO 8859-1 */ #define ENC_LATIN_2 2 /* ISO 8859-2 */ #define ENC_LATIN_3 3 /* ISO 8859-3 */ #define ENC_LATIN_4 4 /* ISO 8859-4 */ #define ENC_CYRILLIC 5 /* ISO 8859-5 */ #define ENC_ARABIC 6 /* ISO 8859-6 (NOT SUPPORTED) */ #define ENC_GREEK 7 /* ISO 8859-7 */ #define ENC_HEBREW 8 /* ISO 8859-8 (NOT SUPPORTED) */ #define ENC_LATIN_5 9 /* ISO 8859-9 */ #define ENC_LATIN_6 10 /* ISO 8859-10 */ #define ENC_THAI 11 /* ISO 8859-11 */ #define ENC_LATIN_7 12 /* ISO 8859-13 */ #define ENC_LATIN_8 13 /* ISO 8859-14 */ #define ENC_LATIN_9 14 /* ISO 8859-15 */ #define ENC_LATIN_10 15 /* ISO 8859-16 (NOT SUPPORTED) */ #define ENC_KOI8_R 16 /* KOI8-R */ #define ENC_KOI8_U 17 /* KOI8-U */ #define ENC_ROMAN8 18 /* Roman8 */ /* * Define the strings which can be used as values for the '-r' (remap * character set) option. */ #define MAPPING_LATIN_1 "Latin1" #define MAPPING_LATIN_2 "Latin2" #define MAPPING_LATIN_3 "Latin3" #define MAPPING_LATIN_4 "Latin4" #define MAPPING_CYRILLIC "Cyrillic" /* #define MAPPING_ARABIC "Arabic" */ #define MAPPING_GREEK "Greek" /* #define MAPPING_HEBREW "Hebrew" */ #define MAPPING_LATIN_5 "Latin5" #define MAPPING_LATIN_6 "Latin6" #define MAPPING_THAI "Thai" #define MAPPING_LATIN_7 "Latin7" #define MAPPING_LATIN_8 "Latin8" #define MAPPING_LATIN_9 "Latin9" /* #define MAPPING_LATIN_10 "Latin10" */ #define MAPPING_KOI8_R "KOI8-R" #define MAPPING_KOI8_U "KOI8-U" #define MAPPING_ROMAN8 "Roman8" /* * If 'MAPFONTS' is defined in the 'Makefile', make sure it's set to one of * the legal values or else invalidate it... */ #ifdef MAPFONTS #if ( \ (MAPFONTS != ENC_LATIN_1) && \ (MAPFONTS != ENC_LATIN_2) && \ (MAPFONTS != ENC_LATIN_3) && \ (MAPFONTS != ENC_LATIN_4) && \ (MAPFONTS != ENC_CYRILLIC) && \ /* (MAPFONTS != ENC_ARABIC) && */ \ (MAPFONTS != ENC_GREEK) && \ /* (MAPFONTS != ENC_HEBREW) && */ \ (MAPFONTS != ENC_LATIN_5) && \ (MAPFONTS != ENC_LATIN_6) && \ (MAPFONTS != ENC_THAI) && \ (MAPFONTS != ENC_LATIN_7) && \ (MAPFONTS != ENC_LATIN_8) && \ (MAPFONTS != ENC_LATIN_9) && \ /* (MAPFONTS != ENC_LATIN_10) && */ \ (MAPFONTS != ENC_KOI8_R) && \ (MAPFONTS != ENC_KOI8_U) && \ (MAPFONTS != ENC_ROMAN8) \ ) #undef MAPFONTS #define MAPFONTS ENC_NONE #endif #else #define MAPFONTS ENC_NONE #endif /* --------------------------------------------------------------------------- Macro Definitions */ /* --------------------------------------------------------------------------- Data Declarations (including externals) */ extern int input_language; extern int output_language; extern char *months_ml[NUM_LANGUAGES][12]; extern char days_ml[NUM_LANGUAGES][7][DAY_LENGTH_MAX_CHARS]; extern char days_ml_short[NUM_LANGUAGES][7][DAY_LENGTH_MAX_CHARS]; extern char lang_id[NUM_LANGUAGES][LANG_LENGTH_MAX_CHARS]; extern int lang_mapping[NUM_LANGUAGES]; /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ pcal-4.11.0/src/pcalutil.c0000644000175000001440000010342510732017670013461 0ustar wusers/* --------------------------------------------------------------------------- pcalutil.c Notes: This file contains general-purpose utility routines. Revision history: 4.11.0 B.Marr 2007-12-15 Fix long-standing bug whereby the last line of a configuration file was silently ignored if it ended without a 'line feed' (ASCII 10 character). Rename some variables, structures, and/or routines to be clearer about their purpose and/or to allow easier searching with fewer "false positives". Minor comment typo fixes. 4.10.0 B.Marr 2006-07-19 Reformatted comments and code to match my standards. B.Marr 2006-07-12 Rename old 'getline()' routine to 'get_pcal_line()' to avoid a compile-time namespace collision with the standard C library, which seems to manifest itself only in Windows+Cygwin build environments. Provide explicit casting in several spots to avoid warnings in a "gcc 3.4.2 on Solaris 8" environment, based on a report from David Mathog . Get rid of all the '#ifdef PROTOS' checks, which are pretty much obsolete these days and just needlessly clutter up the code. Drop support for obsolete platforms (Amiga, VMS, OS/2). 4.9.0 B.Marr 2005-08-08 Eliminate the hack to support Esperanto via a custom, dedicated character encoding. Esperanto is now handled generically by the 'Latin3' (ISO 8859-3) character encoding. B.Marr 2005-01-24 Fix 'off-by-one' error on buffer overflow fix from v4.8.0. 4.8.0 B.Marr 2004-12-15 Prevent potential buffer overflow attack caused by malicious calendar input file by crudely limiting amount of data copied in routine 'getline()'. This security hole was detected by Danny Lungstrom and reported by D. J. Bernstein. B.Marr 2004-11-23 Create and support concept of 'input' language versus 'output' language. B.Marr 2004-11-15 Remove Ctl-L (page eject) characters from source file. 4.7 AWR 01/25/2000 revised century() function to fix Y2K-related problems reported under some flavors of Un*x 02/24/1998 add prototypes (using PROTO macro) to function pointer declarations 12/21/1997 clean up gcc warnings in -Wall mode 07/27/1997 revise for -H (generate HTML output) support: expand SET_FONTSTYLE from macro to function; add html_escape() to convert HTML escape sequences when generating non-HTML output 4.6 AWR 05/14/1997 add century() to calculate current century (instead of assuming 1900) 12/11/1995 add support for HTML-like <{/}[BbIi]> escape sequences 11/10/1995 support -T flag to select default font style (Bold/Italic/Roman) AWR 05/09/1995 add support for \f[BIPR] escape sequences (set font to Bold, Italic, previous, or Roman respectively) 4.5 AWR 10/01/1993 add define_font() for redefining font name and/or size independently; add define_shading() (replaces old gen_shading) for date/fill shading 04/28/1993 restructure function definitions so function name appears in first column (to facilitate searching for definition by name) 4.3 AWR 11/22/1991 added special case to loadwords(): split -"" into two words removed octal/hex escape functionality from getline() to new routine cvt_escape() (for use elsewhere) 10/25/1991 added parameters to loadwords() and getline() to avoid always using same global data 10/15/1991 revised UN*X mk_filespec() to translate "~/" in path name as well as file name 4.2 AWR 10/08/1991 support -[kK] flags (cf. note_box()) 10/03/1991 added note_box(), note_day() 4.11 AWR 08/20/1991 documented find_executable() 4.02 AWR 06/07/1991 added find_executable() 4.0 AWR 02/24/1991 Revised getline() and copy_text() to handle C-style escapes of characters and octal/hex numbers 02/19/1991 Added support for negative ordinals in calc_day(), calc_year_day() 02/04/1991 Added calc_year_day() 01/15/1991 Extracted from pcal.c */ /* --------------------------------------------------------------------------- Header Files */ #include #include #include #include #include "pcaldefs.h" #include "pcallang.h" #include "protos.h" #ifdef BUILD_ENV_UNIX #include #include #include /* X_OK is a #define'd constant used by access() to determine whether or not the specified file is executable by the user. Investigation of several Un*x systems reveals that 01 appears to be the standard value, but it would be best to #include the appropriate system .h file instead of hard-coding the value (as below). (The hard-coded approach was adopted reluctantly because there does not appear to be a standardized location for X_OK: some systems put it in , others in , and others elsewhere (if at all). The access() man page may be helpful.) (AWR 08/20/91) */ #ifndef X_OK /* does user have execute permission? */ #define X_OK 01 #endif #endif /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ /* --------------------------------------------------------------------------- Constant Declarations */ /* --------------------------------------------------------------------------- Macro Definitions */ /* skip over numeric field and subsequent non-numeric characters */ #define SKIP_FIELD(p) \ do { while (*p && isdigit((int)*p)) p++; \ while (*p && !isdigit((int)*p)) p++; } while (0) /* guarantee that a path is terminated by the END_PATH character */ #define TERM_PATH(path) \ do { char *p; \ if ((p = P_LASTCHAR(path)) && *p != END_PATH) \ *++p = END_PATH, *++p = '\0'; } while (0) /* split string into two substrings at separator 'c' */ #define SPLIT(str, str1, str2, c) \ do { char *p; \ str2 = (p = strrchr(str, c)) ? (*p = '\0', ++p) : ""; \ if ((p = strchr(str1 = str, c))) *p = '\0'; } while (0) /* detect an HTML escape sequence of the form <{/}[BbIi]> */ #define HTML_ESCAPE(p) \ ((p[0] == '<') && \ ((strchr("BbIi", p[1]) && p[2] == '>') || \ (p[1] == '/' && strchr("BbIi", p[2]) && p[3] == '>'))) /* --------------------------------------------------------------------------- Data Declarations (including externals) */ static char currfont[10], prevfont[10]; /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ /* --------------------------------------------------------------------------- alloc Notes: This routine interface to 'calloc()'. It will terminate if unsuccessful. */ char *alloc (int size) { char *p; /* not all calloc()s like null requests */ if (size == 0) size = 1; if ((p = (char *)calloc(1, size)) == NULL) { fprintf(stderr, E_ALLOC_ERR, progname); exit(EXIT_FAILURE); } return p; } /* --------------------------------------------------------------------------- ci_strcmp Notes: This routine acts as the case-insensitive version of 'strcmp()'. */ int ci_strcmp (register char *s1, register char *s2) { register char c1, c2; for ( ; (c1 = tolower(*s1)) == (c2 = tolower(*s2)); s1++, s2++) { if (c1 == '\0') return 0; } return c1 - c2; } /* --------------------------------------------------------------------------- ci_strncmp Notes: This routine acts as the case-insensitive version of 'strncmp()'. */ int ci_strncmp (register char *s1, register char *s2, int n) { register char c1, c2; for (c1 = c2 = '\0'; --n >= 0 && (c1 = tolower(*s1)) == (c2 = tolower(*s2)); s1++, s2++) { if (c1 == '\0') return 0; } return n < 0 ? 0 : c1 - c2; } /* --------------------------------------------------------------------------- define_font Notes: This routine overwrites "orig_font" with the specified fields from "new_font" (or with "dflt_font" if "new_font" is NULL or null string). */ void define_font (char *orig_font, char *new_font, char *dflt_font) { char *ofont, *nfont, *osize, *nsize, tmp1[STRSIZ], tmp2[STRSIZ]; /* use default font/size if new font is null */ if (new_font == NULL || new_font[0] == '\0') { strcpy(orig_font, dflt_font); return; } /* split old and new fonts into font/size components */ SPLIT(orig_font, ofont, osize, '/'); new_font = strcpy(tmp1, new_font); SPLIT(new_font, nfont, nsize, '/'); /* use default size if new font size invalid */ if (nsize[0] && atoi(nsize) <= 0) nsize = strrchr(dflt_font, '/') + 1; /* replace fields of old font with specified fields from new */ strcpy(tmp2, nfont[0] ? nfont : ofont); strcat(tmp2, "/"); strcat(tmp2, nsize[0] ? nsize : osize); strcpy(orig_font, tmp2); return; } /* --------------------------------------------------------------------------- define_shading Notes: This routine overwrites "orig_shading" with the specified fields from "new_shading" (or with "dflt_shading" if "new_shading" is NULL or null string). */ void define_shading (char *orig_shading, char *new_shading, char *dflt_shading) { char *odate, *ndate, *ddate, *ofill, *nfill, *dfill; char tmp1[STRSIZ], tmp2[STRSIZ], tmp3[STRSIZ]; double v; /* use default date/fill if new _shading is null */ if (new_shading == NULL || new_shading[0] == '\0') { strcpy(orig_shading, dflt_shading); return; } /* split old, new, and default shadings into date/fill components */ SPLIT(orig_shading, odate, ofill, '/'); new_shading = strcpy(tmp1, new_shading); SPLIT(new_shading, ndate, nfill, '/'); dflt_shading = strcpy(tmp2, dflt_shading); SPLIT(dflt_shading, ddate, dfill, '/'); /* replace invalid fields from new shading with default values */ if (nfill[0] && strchr(nfill, RGB_CHAR) == NULL && ((v = atof(nfill)) <= 0.0 || v > 1.0)) { nfill = dfill; } if (ndate[0] && strchr(ndate, RGB_CHAR) == NULL && ((v = atof(ndate)) <= 0.0 || v > 1.0)) { ndate = ddate; } /* replace fields of old shading with specified fields from new */ strcpy(tmp3, ndate[0] ? ndate : odate); strcat(tmp3, "/"); strcat(tmp3, nfill[0] ? nfill : ofill); strcpy(orig_shading, tmp3); return; } /* --------------------------------------------------------------------------- set_fontstyle Notes: This routine copies the font style string to the output buffer (prefixed by ' ' for Postscript, '<' for * HTML). It resets the previous and current font style strings. It returns a pointer to the next position in the output buffer. */ char *set_fontstyle (char *p, char *esc) { if (output_type == OUTPUT_PS) { *p++ = ' '; strcpy(p, esc); p += strlen(esc); strcpy(prevfont, currfont); strcpy(currfont, esc); } else if (output_type == OUTPUT_HTML) { *p++ = '<'; if (strchr("rpRP", esc[1])) { sprintf(p, "/%c", currfont[1]); p += 2; strcpy(currfont, prevfont); } else { *p++ = esc[1]; strcpy(prevfont, currfont); strcpy(currfont, esc); } } return p; } /* * Date calculation routines (see also macros in pcaldefs.h) */ /* --------------------------------------------------------------------------- normalize Notes: This routine adjusts the day in case it has crossed a month (or year) boundary. The first parameter is a pointer to the date. */ void normalize (date_str *pd) { int len; /* adjust if day is in previous or following month */ while (pd->dd < 1) { pd->yy = PREV_YEAR(pd->mm, pd->yy); pd->mm = PREV_MONTH(pd->mm, pd->yy); pd->dd += LENGTH_OF(pd->mm, pd->yy); } while (pd->dd > (len = LENGTH_OF(pd->mm, pd->yy))) { pd->dd -= len; pd->yy = NEXT_YEAR(pd->mm, pd->yy); pd->mm = NEXT_MONTH(pd->mm, pd->yy); } return; } /* --------------------------------------------------------------------------- calc_day Notes: This routine calculates the calendar date from the ordinal date (e.g., "first Friday in November", "last day in October"). It returns the calendar date if it exists, 0 if it does not. */ int calc_day (int ord, int wkd, int mm) { int first, last, day, (*pfcn) (int, int, int); if (IS_WILD(wkd)) { /* "day", "weekday", "workday", or "holiday" */ pfcn = pdatefcn[wkd - WILD_FIRST]; last = LENGTH_OF(mm, curr_year); if (ord < 0) { /* search backwards */ for (day = last; day >= 1 && !((*pfcn)(mm, day, curr_year) && ++ord == 0); day--) ; } else { /* search forwards */ for (day = 1; day <= last && !((*pfcn)(mm, day, curr_year) && --ord == 0); day++) ; } return is_valid(mm, day, curr_year) ? day : 0; } else { /* fixed weekday - calculate it */ first = (wkd - FIRST_OF(mm, curr_year) + 7) % 7 + 1; if (ord < 0) { /* get last (try 5th, then 4th) */ if (!is_valid(mm, last = first + 28, curr_year)) last -= 7; if (!is_valid(mm, day = last + 7 * (ord + 1), curr_year)) day = 0; } else { if (!is_valid(mm, day = first + 7 * (ord - 1), curr_year)) day = 0; } return day; } } /* --------------------------------------------------------------------------- calc_year_day Notes: This routine calculates the calendar date from the ordinal date within year (e.g., "last Friday in year", "10th holiday in year"). If the date exists, fill in 'pdate' and return TRUE, otherwise return FALSE. */ int calc_year_day (int ord, int wkd, date_str *pdate) { int incr, (*pfcn) (int, int, int); date_str date; if (IS_WILD(wkd)) { /* "day", "weekday", "workday", or "holiday" */ pfcn = pdatefcn[wkd - WILD_FIRST]; if (ord < 0) { /* nth occurrence backwards */ MAKE_DATE(date, DEC, 31, curr_year); ord = -ord; incr = -1; } else { /* nth occurrence forwards */ MAKE_DATE(date, JAN, 1, curr_year); incr = 1; } /* search for selected occurrence of specified wildcard */ while (date.yy == curr_year && !((*pfcn)(date.mm, date.dd, date.yy) && --ord == 0)) { date.dd += incr; normalize(&date); } } else { /* fixed weekday - calculate it */ if (ord < 0) { MAKE_DATE(date, DEC, calc_day(-1, wkd, DEC) + 7 * (ord + 1), curr_year); } else { MAKE_DATE(date, JAN, calc_day(1, wkd, JAN) + 7 * (ord - 1), curr_year); } normalize(&date); } return date.yy == curr_year ? (*pdate = date, TRUE) : FALSE; } /* --------------------------------------------------------------------------- calc_weekday Notes: This routine returns the weekday (0-6) of mm/dd/yy (mm: 1-12). */ int calc_weekday (int mm, int dd, int yy) { return (yy + (yy-1)/4 - (yy-1)/100 + (yy-1)/400 + OFFSET_OF(mm, yy) + (dd-1)) % 7; } /* --------------------------------------------------------------------------- note_day Notes: This routine translates 'n' (from "note/" spec) to the appropriate note text day for mm/yy. It returns the note text day if it's in range, 0 if not. */ int note_day (int mm, int n, int yy) { int day, lastday; if (n == 0) n = NOTE_DEFAULT; /* convert 0 to appropriate default */ /* lastday depends on month length and presence (but not position) of small calendars */ lastday = LAST_NOTE_DAY - (LENGTH_OF(mm, yy) - 28) - (small_cal_pos == SC_NONE ? 0 : 2); /* count forward if n is positive, backward if negative */ day = (n > 0) ? FIRST_NOTE_DAY + n - 1 : lastday + n + 1; /* make sure result is valid for this month/year */ return (day >= FIRST_NOTE_DAY && day <= lastday) ? day : 0; } /* --------------------------------------------------------------------------- note_box Notes: This routine translates 'dd' from the note text day to 'box number' for mm/yy, adjusting for presence and position of small calendars. */ int note_box (int mm, int dd, int yy) { int startbox = START_BOX(mm, yy), pc, nc; /* move starting box to second row if conflict with small calendars */ pc = prev_cal_box[small_cal_pos]; nc = next_cal_box[small_cal_pos]; if (pc == startbox || nc == startbox) startbox += 7; dd -= FIRST_NOTE_DAY; /* convert to note box number 0..13 */ dd += (pc == 0) + (nc == 1); /* adjust for small calendars in 0, 1 */ /* position box after calendar body if no room before */ return dd < startbox ? dd : dd + LENGTH_OF(mm, yy); } /* --------------------------------------------------------------------------- is_valid Notes: This routine returns TRUE if m/d/y is a valid date. */ int is_valid (int m, int d, int y) { return m >= JAN && m <= DEC && d >= 1 && d <= LENGTH_OF(m, y); } /* --------------------------------------------------------------------------- century Notes: This routine returns the current century (CC00). It presumes the standard Unix behavior, that the 'tm_year' field of 'struct tm' (see , pcaldefs.h) represents years elapsed since 1900. */ int century (void) { static int this_century = -1; struct tm *p_tm; time_t tmp; if (this_century < 0) { /* calculate first time only */ time(&tmp); p_tm = localtime(&tmp); this_century = ((TM_YEAR + p_tm->tm_year) / 100) * 100; } return this_century; } /* * Token parsing/remerging routines: */ /* --------------------------------------------------------------------------- loadwords Notes: This routine tokenizes the buffer 'buf' into array 'words' and returns the word count. It differs from the old 'loadwords()' in that it handles quoted (" or ') strings and removes escaped quotes. */ int loadwords (char **words, char *buf) { register char *ptok; char *delim, **ap, *p1, *p2, c; int nwords; for (ptok = buf, ap = words; TRUE; ap++) { ptok += strspn(ptok, WHITESPACE); /* find next token */ if (! *ptok) { /* end of buf? */ *ap = NULL; /* add null ptr at end */ nwords = ap - words; /* number of non-null ptrs */ break; /* exit loop */ } delim = *ptok == '"' ? "\"" : /* set closing delimiter */ *ptok == '\'' ? "'" : WHITESPACE; /* split flag followed by quoted string into two words */ if (*ptok == '-' && isalpha((int)ptok[1]) && ((c = ptok[2]) == '"' || c == '\'')) { delim = c == '"' ? "\"" : "'"; *ap++ = ptok; ptok[2] = '\0'; /* terminate first token */ ptok += 3; /* start second token */ } else if (*ptok == *delim) ptok++; /* skip opening quote */ *ap = ptok; /* save token ptr */ /* find first unescaped string delimiter - handle special case where preceding backslash is itself escaped */ do { ptok += strcspn(ptok, delim); if ((c = ptok[-1]) == '\\') { if (ptok[-2] == '\\') break; /* stop on \\" or \\' */ else ptok++; } } while (c == '\\'); if (*ptok) *ptok++ = '\0'; /* terminate token */ } /* now reprocess the word list, removing remaining escapes */ for (ap = words; *ap; ap++) { for (p1 = p2 = *ap; (c = *p2 = *p1++) != '\0'; p2++) { if (c == '\\') *p2 = *p1++; } } return nwords; /* return word count */ } /* --------------------------------------------------------------------------- copy_text Notes: This routine retrieves the remaining text in 'pbuf' and copies it to the output string, separating tokens by a single blank and condensing runs of blanks (all other whitespace has been converted to blanks by now) to one blank. The first parameter is a pointer to the output buffer, which can be 'pbuf' itself. The second parameter is a pointer to first text word in "words". */ void copy_text (char *pbuf, char **ptext) { char *p, *pb; /* copy words to pbuf, separating by one blank */ for (*(pb = pbuf) = '\0'; (p = *ptext) != NULL; *pb++ = *++ptext ? ' ' : '\0') { for ( ; *p; p++) { if (! (*p == ' ' && (pb == pbuf || pb[-1] == ' '))) *pb++ = *p; } if (pb > pbuf && pb[-1] == ' ') pb--; } return; } /* --------------------------------------------------------------------------- split_date Notes: This routine extracts 1-3 numeric fields (separated by one or more non-numeric characters) from date string. It returns the number of fields. The first parameter is the input string. The last 3 parameters are the output numbers. */ int split_date (char *pstr, int *pn1, int *pn2, int *pn3) { int i, n, *pn; /* attempt to extract up to three numeric fields */ for (n = 0, i = 1; i <= 3; i++) { pn = i == 1 ? pn1 : i == 2 ? pn2 : pn3; /* crude but portable */ if (pn) *pn = *pstr ? (n++, atoi(pstr)) : 0; SKIP_FIELD(pstr); /* go to next field */ } return n; } /* * Escape sequence conversion routines: */ /* --------------------------------------------------------------------------- html_esc Notes: This routine recognizes an HTML special character ("<" etc.) and converts it back to its ASCII equivalent. It returns a pointer to the last character in the escape sequence (if found) or a pointer to the original input character. The first parameter points to the start of the string. The second parameter is the returned ASCII equivalent. */ static char *html_esc (char *p, char *val) { static struct { char *html; char ascii; } *pt, translate[] = { /* special HTML sequences */ { "<", '<' }, { ">", '>' }, { "&", '&' }, { """, '"' }, { " ", ' ' }, { NULL, 0 } }; if (*p == '&') { /* translate "&#NNN;" character sequences back to ASCII */ if (p[1] == '#' && isdigit((int)p[2]) && isdigit((int)p[3]) && isdigit((int)p[4]) && p[5] == ';') { *val = atoi(p + 2); return p + 5; } /* look up predefined special characters in table above */ for (pt = translate; pt->html; pt++) { int l = strlen(pt->html); if (ci_strncmp(p, pt->html, l) == 0) { *val = pt->ascii; return p + l - 1; } } } /* not an escape sequence - return original pointer */ *val = *p; return p; } /* --------------------------------------------------------------------------- octal_esc Notes: This routine reads up to 3 octal digits from the specified character string. It fills in the value of the octal constant and returns a pointer to last character. */ static char *octal_esc (char *buf, char *val) { int i, n, c; for (n = 0, i = 0; i < 3 && (c = buf[i]) && isodigit(c); i++) { n = n * 8 + (c - '0'); } *val = n & CHAR_MSK; /* fill in the value */ return buf + i - 1; /* return pointer to last character */ } /* --------------------------------------------------------------------------- hex_esc Notes: This routine reads 'x' or 'X' followed by 1 or 2 hex digits from the specified character string. It fills in the value of the hexadecimal constant (or letter if no hex digits follow) and returns a pointer to the last character. */ static char *hex_esc (char *buf, char *val) { int i, n, c; /* assume leading character is known to be 'x' or 'X'; skip it */ buf++; for (n = 0, i = 0; i < 2 && (c = buf[i]) && isxdigit(c); i++) { n = n * 16 + (isupper(c) ? c - 'A' + 10 : islower(c) ? c - 'a' + 10 : c - '0'); } *val = i == 0 ? buf[-1] : n & CHAR_MSK; /* fill in the value */ return buf + i - 1; /* return pointer to last character */ } /* --------------------------------------------------------------------------- cvt_escape Notes: This routine copies the string 'ibuf' to the string 'obuf', converting octal / hex / HTML / whitespace escape sequences to the appropriate equivalents. Escaped quotes and backslashes are not converted here; they need to be preserved so that 'loadwords()' can parse quoted strings correctly. */ void cvt_escape (char *obuf, char *ibuf) { char c, c2, *po, *pi, *p, *dfltfont; static char whitespace[] = "abnrtv"; /* see ANSI spec, 2.2.2 */ static char no_cvt[] = "\"'\\"; dfltfont = fontstyle[0] == BOLD ? BOLD_FONT : fontstyle[0] == ITALIC ? ITALIC_FONT : ROMAN_FONT ; strcpy(currfont, dfltfont); /* defaults for font style */ strcpy(prevfont, dfltfont); for (po = obuf, pi = ibuf; (c = *pi) != '\0'; *po++ = c, pi++) { /* handle escape sequences here: escaped whitespace and ANSI escapes (except \f) are all converted to a single space; octal and hex constants are converted in place; escaped single/double quotes are left escaped for loadwords() to handle later on; if the output is PostScript: \f[BIR] is converted to " .[bir] "; \fP is converted to the previous " .[bir] "; <[BI]> is converted to " .[bi] "; is converted to the previous " .[bir] " if the output is HTML: \f[BI] is converted to "<[BI]>"; \f[PR] is converted to the previous ""; <[BI]> and are copied intact */ if (c == '\\') { c2 = *++pi; if (isspace((int)c2) || strchr(whitespace, c2)) { c = ' '; } else if (isodigit(c2)) { /* octal */ pi = octal_esc(pi, &c); } else if (tolower(c2) == 'x') { /* hex */ pi = hex_esc(pi, &c); } else if (c2 == 'f') { /* \f[BIPR] */ c = output_type == OUTPUT_HTML ? '>' : ' '; if (*++pi == BOLD) po = set_fontstyle(po, BOLD_FONT); else if (*pi == ITALIC) po = set_fontstyle(po, ITALIC_FONT); else if (*pi == PREVFONT) po = set_fontstyle(po, prevfont); else if (*pi == ROMAN) po = set_fontstyle(po, ROMAN_FONT); else { /* unrecognized \f escape */ *po++ = ' '; c = *pi; } } else { if (strchr(no_cvt, c2)) *po++ = c; /* leave escaped */ c = c2; } } else if (output_type != OUTPUT_HTML && (p = html_esc(pi, &c2)) != pi) { /* convert special HTML character back to ASCII */ pi = p; if (c2 == '"') *po++ = '\\'; c = c2; } else if (HTML_ESCAPE(pi)) { /* convert HTML escape to PostScript */ c2 = *++pi; if ((c2 = toupper(c2)) == BOLD) po = set_fontstyle(po, BOLD_FONT); else if (c2 == ITALIC) po = set_fontstyle(po, ITALIC_FONT); else po = set_fontstyle(po, prevfont); /* */ while ((c = *++pi) != '>') ; c = output_type == OUTPUT_HTML ? '>' : ' '; } } /* if generating HTML, reset font at end of line if necessary */ if (output_type == OUTPUT_HTML && currfont[1] != dfltfont[1]) { *po++ = '<'; *po++ = '/'; *po++ = currfont[1]; *po++ = '>'; } *po = '\0'; return; } /* * File input routines: */ /* --------------------------------------------------------------------------- get_pcal_line Notes: This routine reads the next non-null line of the input file into 'buf' It returns 0 on EOF. It strips leading whitespace and trailing comments. It also handles escaped newlines and calls 'cvt_escape()' to translate other escape sequences. */ int get_pcal_line (FILE *fp, char *buf, int *pline) { register char *cp; register int c, c2; int in_comment; /* comments: from '#' to end-of-line */ char tmpbuf[LINSIZ]; /* temporary buffer to accumulate line */ cp = tmpbuf; *buf = '\0'; /* in case of premature EOF */ do { in_comment = FALSE; while ((c = getc(fp)) != '\n' && c != EOF) { if (c == COMMENT_CHAR) in_comment = TRUE; if (isspace(c)) c = ' '; /* whitespace => blank */ /* ignore comments and leading white space */ if (in_comment || (cp == tmpbuf && c == ' ')) continue; /* only handle escape newlines and '#' here; other escapes are now handled by cvt_escape() or loadwords() (q.v.) */ if (c == '\\') { if ((c2 = getc(fp)) == EOF) return FALSE; if (c2 == '\n') { c = ' '; (*pline)++; } else if (c2 == COMMENT_CHAR) c = '#'; else ungetc(c2, fp); } /* Crudely prevent buffer overflow to prevent exploit by malicious calendar input file. */ if ((cp - tmpbuf) < (LINSIZ - 1)) *cp++ = c; else return FALSE; } if (c == EOF) { /* 15 Dec 2007: Prior to the 4.11.0 release, the code just returned 'FALSE' here, with no other test being performed. That was causing a bug whereby the last line of a configuration file was silently ignored if it ended without a 'line feed' (ASCII 10 character). Adding a test, as done below, to see if anything is in the line buffer (before deciding to return 'FALSE') fixes this bug. */ if ((cp - tmpbuf) == 0) return FALSE; /* no more input lines */ } (*pline)++; /* bump line number */ } while (cp == tmpbuf); /* ignore empty lines */ *cp = '\0'; cvt_escape(buf, tmpbuf); /* convert escape sequences */ return TRUE; } /* * Routines dealing with translation of file specifications */ /* --------------------------------------------------------------------------- mk_path Notes: This routine extracts the path component from a Unix file specification. The first parameter is the output path. The second parameter is input file specification. */ char *mk_path (char *path, char *filespec) { char *p; strcpy(path, filespec); if (!(p = strrchr(path, END_PATH))) { p = path - 1; /* return null string if no path */ } *++p = '\0'; return path; } /* --------------------------------------------------------------------------- mk_filespec Notes: This routine merges the Unix path and file names, where the latter can be relative. The first parameter is the output file specification. The second parameter is input path. The third parameter is the input file name. */ char *mk_filespec (char *filespec, char *path, char *name) { char *p; *filespec = '\0'; /* copy name intact if absolute; else merge path and relative name */ /* if name starts with "~/", translate it for user */ if (strncmp(name, "~/", 2) == 0 && (p = getenv(HOME_DIR)) != NULL) { strcpy(filespec, p); TERM_PATH(filespec); name += 2; /* skip "~/" */ } else if (*name != START_PATH) { /* relative path */ /* if path starts with "~/", translate it for user */ if (strncmp(path, "~/", 2) == 0 && (p = getenv(HOME_DIR)) != NULL) { strcpy(filespec, p); TERM_PATH(filespec); path += 2; /* skip "~/"; append rest below */ } strcat(filespec, path); TERM_PATH(filespec); } return strcat(filespec, name); } #ifdef BUILD_ENV_UNIX /* --------------------------------------------------------------------------- find_executable Notes: This routine returns the full path name of the executable file. NOTE: This routine is highly Unix-dependent. Probably no other build environment can use it. */ char *find_executable (char *prog) { char *pathvar, *p, *pnext; struct stat st; static char filepath[STRSIZ]; /* if 'prog' is an absolute/relative path name or environment variable 'PATH' does not exist, return 'prog'; otherwise, search the directories specified in 'PATH' for the executable */ if (strchr(prog, END_PATH) == 0 && (p = getenv(PATH_ENV_VAR)) != 0) { pathvar = alloc(strlen(p) + 1); strcpy(pathvar, p); /* assumes PATH is of form "dir1:dir2:...:dirN"; strtok() would be handy here, but not everybody has it yet */ for (p = pathvar; *p; p = pnext) { if ((pnext = strchr(p, ':')) != NULL) *pnext++ = '\0'; else pnext = p + strlen(p); /* assume the executable lives in the path, and construct its complete file name */ filepath[0] = '\0'; if (strcmp(p, ".") != 0) { strcat(filepath, p); strcat(filepath, "/"); } strcat(filepath, prog); /* check that file a) exists, b) is a "normal" file, and c) is executable - if so, return its full path */ if (stat(filepath, &st) >= 0 && (st.st_mode & S_IFMT) == S_IFREG && access(filepath, X_OK) == 0) { free(pathvar); return filepath; } } free(pathvar); } return prog; } #else /* --------------------------------------------------------------------------- find_executable Notes: This routine returns the full path name of the executable file. NOTE: This routine is for non-Unix build environments only. */ char *find_executable (char *prog) { return prog; /* non-Un*x flavor always returns its argument */ } #endif pcal-4.11.0/src/protos.h0000644000175000001440000002132210732017670013172 0ustar wusers/* --------------------------------------------------------------------------- protos.h Notes: This file contains function prototypes for all appropriate routines used in this application. Revision history: 4.11.0 B.Marr 2007-12-15 Rename some variables, structures, and/or routines to be clearer about their purpose and/or to allow easier searching with fewer "false positives". Eliminate the now-needless "F13" ("Friday the 13th") special event trigger and the associated processing of it. 4.10.0 B.Marr 2006-07-19 Broke 'pcalglob.h' up into 2 parts. The actual declarations are now in 'pcal.c'. The external references were put in this file along with the necessary function prototypes for functions defined in 'pcal.c'. Reformatted comments and code to match my standards. B.Marr 2006-07-12 Get rid of all the '#ifdef PROTOS' checks, which are pretty much obsolete these days and just needlessly clutter up the code. 4.9.0 B.Marr 2005-08-02 Add prototype for new function 'delete_day_info()' and rename 'enter_date()' to 'process_date()', all based on a patch from Bill Bogstad. 4.8.0 B.Marr 2004-12-03 Add prototype for new function 'recalc_paper_parameters()'. B.Marr 2004-11-13 Add prototypes for new functions 'do_define_sym_val()', 'find_sym_val()', 'find_fri13th()', and 'recalc_paper_parameters()'. Rename 'find_sym()' to 'find_sym_name()' to avoid search collisions with new function. 4.7 AWR 06/19/1998 add multiple_months_html() and single_month_html() (cf. writefil.c) 02/24/1998 add prototypes for exit() and free() if not already included via 07/27/1997 add print_html(), write_htmlfile() (cf. writefil.c) and set_fontstyle() (cf. pcalutil.c) 4.6 AWR 05/14/1997 add century() (cf. pcalutil.c) 10/31/1995 add gen_lang_sym() (cf. pcal.c) 10/03/1995 revise write_psfile, write_calfile() (cf. writefil.c) 09/21/1995 add enter_date(), enter_date() (cf. readfile.c) 4.5 AWR 11/24/1993 replace find_holidays() with print_colors() (cf. writefil.c) 11/16/1993 added new routines define_font(), define_shading() (latter replaces old gen_shading()), and set_rgb() 11/16/1992 eliminated "noprotos.h" by means of PROTO() macro (q.v.) 4.4 AWR 01/15/1992 added even more routines 4.3 AWR 12/06/1991 added more routines 4.2 AWR 10/03/1991 added various routines newly incorporated into writefil.c and pcalutil.c 4.0 AWR 03/01/1991 use where possible 02/19/1991 adapted from Bill Hogsett's source */ /* Prototypes for functions defined in encvec.c: */ extern void encvec_iso8859_1 (void); extern void encvec_iso8859_2 (void); extern void encvec_iso8859_3 (void); extern void encvec_iso8859_4 (void); extern void encvec_iso8859_5 (void); extern void encvec_iso8859_6 (void); extern void encvec_iso8859_7 (void); extern void encvec_iso8859_8 (void); extern void encvec_iso8859_9 (void); extern void encvec_iso8859_10 (void); extern void encvec_iso8859_11 (void); extern void encvec_iso8859_13 (void); extern void encvec_iso8859_14 (void); extern void encvec_iso8859_15 (void); extern void encvec_iso8859_16 (void); extern void encvec_koi8_r (void); extern void encvec_koi8_u (void); extern void encvec_roman8 (void); /* Prototypes for functions defined in exprpars.c: */ extern int parse_expr (char *pbuf); /* Prototypes for functions defined in moonphas.c: */ extern double calc_phase (int month, int day, int year); extern double find_phase (int month, int day, int year, int *pquarter); extern char *find_moonfile (int year); extern int read_moonfile (int year); /* Prototypes for functions defined in pcal.c: */ extern FILE *alt_fopen (char *fullpath, char *name, char *pathlist[], char *access); extern int check_numargs (void); extern char *color_msg (void); extern char *gen_lang_sym (int); extern int get_args (char **argv, int curr_pass, char *where, int get_numargs); extern FLAG_USAGE *get_flag (char flag); extern void init_misc (void); extern int main (int argc, char **argv); extern void set_color (char *day, int col); extern void set_debug_flag (char *flag); extern void display_usage (FILE *fp, int fullmsg); extern void recalc_paper_parameters (int paper_size_idx); /* Prototypes for functions defined in pcalutil.c: */ extern char *alloc (int size); extern int calc_day (int ord, int wkd, int mm); extern int calc_weekday (int mm, int dd, int yy); extern int calc_year_day (int ord, int wkd, date_str *pdate); extern int century (void); extern int ci_strcmp (register char *s1, register char *s2); extern int ci_strncmp (register char *s1, register char *s2, int n); extern void copy_text (char *pbuf, char **ptext); extern void cvt_escape (char *obuf, char *ibuf); extern void define_font (char *orig_font, char *new_font, char *dflt_font); extern void define_shading (char *orig_shading, char *new_shading, char *dflt_shading); extern char *find_executable (char *prog); extern int get_pcal_line (FILE *fp, char *buf, int *pline); extern int is_valid (register int m, register int d, register int y); extern int loadwords (char **words, char *buf); extern char *mk_filespec (char *filespec, char *path, char *name); extern char *mk_path (char *path, char *filespec); extern void normalize (date_str *pd); extern int note_box (int mm, int dd, int yy); extern int note_day (int mm, int n, int yy); extern char *set_fontstyle (char *p, char *esc); extern int split_date (char *pstr, int *pn1, int *pn2, int *pn3); /* Prototypes for functions defined in readfile.c: */ extern void cleanup (void); extern void clear_syms (void); extern int date_type (char *cp, int *pn, int *pv); extern int do_define (char *sym); extern int do_define_sym_val (char *sym,char *val); extern int do_ifdef (char *expr); extern int do_ifndef (char *expr); extern int do_include (char *path, char *name, int noerr); extern int do_undef (char *sym); extern int enter_day_info (int m, int d, int y, int text_type, char **pword); extern int delete_day_info (int m, int d, int y, int text_type, char **pword); extern int process_event_specification (char **pword, int *ptext_type, char ***pptext); extern int enter_note (int mm, char **pword, int n); extern int find_easter (date_str *pdate); #ifndef NO_ORTHODOX extern int odox_easter_from_april1 (int year); extern int find_odox_easter (date_str *pdate); extern int find_odox_stgeorge (date_str *pdate); extern int find_odox_marcus (date_str *pdate); #endif extern int find_sym_name (char *sym); extern char *find_sym_val (char *sym); extern year_info *find_year (int year, int insert); extern int get_keywd (char *cp); extern int get_month (char *cp, int numeric_ok, int year_ok); extern int get_ordinal (char *cp, int *pval); extern int get_phase (char *cp); extern int get_prep (char *cp); extern int get_token (char *token); extern int get_weekday (char *cp, int wild_ok); extern int is_anyday (int mm, int dd, int yy); extern int is_firstq (int mm, int dd, int yy); extern int is_fullmoon (int mm, int dd, int yy); extern int is_holiday (int mm, int dd, int yy); extern int is_lastq (int mm, int dd, int yy); extern int is_newmoon (int mm, int dd, int yy); extern int is_weekday (int mm, int dd, int yy); extern int is_workday (int mm, int dd, int yy); extern int not_holiday (int mm, int dd, int yy); extern int not_weekday (int mm, int dd, int yy); extern int not_workday (int mm, int dd, int yy); extern int parse_as_non_preproc (char **pword, char *filename); extern int parse_date (char **pword, int *ptype, char ***pptext); extern int parse_ord (int ord, int val, char **pword); extern int parse_rel (int val, int wkd, char **pword, int *ptype, char ***pptext); extern void read_datefile (FILE *fp, char *filename); /* Prototypes for functions defined in writefil.c: */ extern void def_footstring (char *p, char *str); extern char *expand_fmt (char *buf, char *p); extern void find_daytext (int month, int year, int is_holiday); extern void find_noteboxes (int month, int year); extern void multiple_months_html (int first_month, int first_year, int ncols); extern void print_colors (int month, int year); extern void print_html (char *s); extern void print_dates (int month, int year); extern void print_julian_info (int month, int year); extern void print_month (int month, int year); extern void print_moon_info (int month, int year); extern void print_pstext (char *p); extern void print_text (char *p); extern char *print_word (char *p); extern int select_color (void); extern char *set_rgb (char *s); extern void single_month_html (int this_month, int this_year); extern void single_month_one_column_html (int this_month, int this_year); extern void write_calfile (void); extern void write_htmlfile (void); extern void write_psfile (void); pcal-4.11.0/src/readfile.c0000644000175000001440000020226010732017670013414 0ustar wusers/* --------------------------------------------------------------------------- readfile.c Notes: This file contains routines for reading and parsing the configuration file (aka the 'date file'). Revision history: 4.11.0 B.Marr 2007-12-15 Add support for new "on" preposition, thanks to a request from and in part to a patch from Erkki Petsalo. Eliminate the now-needless "F13" ("Friday the 13th") special event trigger and the associated processing of it. Rename some variables, structures, and/or routines to be clearer about their purpose and/or to allow easier searching with fewer "false positives". Fix some minor comment problems. 4.10.0 B.Marr 2006-07-19 Reformatted comments and code to match my standards. B.Marr 2006-07-12 Rename old 'getline()' routine to 'get_pcal_line()' to avoid a compile-time namespace collision with the standard C library, which seems to manifest itself only in Windows+Cygwin build environments. Provide explicit casting in several spots to avoid warnings in a "gcc 3.4.2 on Solaris 8" environment, based on a report from David Mathog . Get rid of all the '#ifdef PROTOS' checks, which are pretty much obsolete these days and just needlessly clutter up the code. 4.9.0 B.Marr 2005-08-02 Incorporate patch by Bill Bogstad to provide ability to delete specific events, thereby allowing one to exclude one or more events that were inserted as a group of events, by using the new 'delete' keyword. B.Marr 2005-01-23 Fix bug introduced in v4.8.0 whereby a plural specification of the day-of-week (e.g. 'all Fridays in Oct') was not being recognized. 4.8.0 B.Marr 2004-12-15 Prevent potential buffer overflow attack caused by malicious calendar input file by restructuring code to avoid a 'strcpy()' call in 'get_predef_event()'. This security hole was detected by Danny Lungstrom and reported by D. J. Bernstein. B.Marr 2004-12-05 Fix misleading references to "holiday" to instead refer to "predefined event" (i.e. not all pre-defined events are 'holidays'). Create and support concept of 'input' language versus 'output' language. Remove spaces embedded within tab fields. B.Marr 2004-11-19 Provide an enhanced capability to process not just simple symbol names but associated symbolic values too, based on a patch from (unknown). Provide support for "Friday the 13th" events, based on a patch from Don Laursen (donrl at users dot sourceforge dot net). Detect more than just 3 characters (if available in the event specification) when attempting to match a generic token to either a day-of-week name or a month name to avoid problem of misdetecting month names as day-of-week names (for languages which have such possibilities, like French) and the problem of misdetecting month names and/or day-of-week names for inactive languages. Remove Ctl-L (page eject) characters from source file. 4.7 AWR 12/15/1998 expand %y into every applicable year in "year all" mode 02/24/1998 add prototypes (using PROTO macro) to function pointer declarations 12/21/1997 clean up gcc warnings in -Wall mode 07/27/1997 delete obsolete FPR and PRT macros; minor revisions for -H (HTML) flag 4.6 AWR 05/14/1997 replace obsolete CENTURY macro with call to century() (cf. pcalutil.c) 09/13/1996 support "nearest_before" and "nearest_after" keywords 12/05/1995 fix "undef" bug (modify get_token() to return token struct index, not type type code; cf. read_datefile()) 12/02/1995 avoid generating font shift sequences in -c mode 11/29/1995 explicitly initialize calloc'd pointers to NULL 11/10/1995 support -T flag to select default font style (Bold/Italic/Roman) 10/31/1995 add preprocessor debug statements to do_define(), do_undef() 09/21/1995 added enter_date(), enter_note(), related support for "year all" AH 02/03/1995 added orthodox easter related holiday calculations 4.5 AWR 11/08/1993 accept European dates of form "dd. mm." and "dd. mon" 04/28/1993 restructure function definitions so function name appears in first column (to facilitate searching for definition by name) 03/05/1993 Propagate null text to output 02/11/1992 Support predefined holidays (strings and dispatch functions - cf. pcallang.h) 4.4 AWR 01/20/1992 Use predominant color ("logical black") in is_weekday() 12/16/1991 Avoid invalid array access in read_datefile() 4.3 AWR 10/25/1991 Support moon phase wildcards and -Z flag (debug information) 4.2 AWR 10/03/1991 Support "note/" (user-selected notes box) as per Geoff Kuenning 09/30/1991 Support "elif" in datefile 4.11 AWR 08/20/1991 Support "nearest" keyword as per Andy Fyfe 4.0 AWR 02/19/1991 Support negative ordinals 02/06/1991 Support expressions in "if{n}def" 02/04/1991 Support "even" and "odd" ordinals and ordinals > 5th; support "year" 01/15/1991 Extracted from pcal.c */ /* --------------------------------------------------------------------------- Header Files */ #include #include #include #include "pcaldefs.h" #include "pcallang.h" #include "protos.h" /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ /* --------------------------------------------------------------------------- Constant Declarations */ /* status codes returned by parse_as_non_preproc(), enter_day_info() */ #define PARSE_OK 0 /* successful date parse */ #define PARSE_INVDATE 1 /* nonexistent date */ #define PARSE_INVLINE 2 /* syntax error */ #define PARSE_NOMATCH 3 /* no match for wildcard */ /* codes for states in read_datefile() */ #define PROCESSING 0 /* currently processing datefile lines */ #define AWAITING_TRUE 1 /* awaiting first TRUE branch in "if{n}def" */ #define SKIP_TO_ENDIF 2 /* finished processing first TRUE branch */ #define BLANK_TEXT " " /* substitute for null input text */ /* --------------------------------------------------------------------------- Macro Definitions */ /* append date to list; terminate list */ #define ADD_DATE(_m, _d, _y) do { \ if (DEBUG(DEBUG_DATES)) \ fprintf(stderr, "Adding candidate date: %4d-%02d-%02d\n", _y, _m, _d); \ pdate->mm = _m, pdate->dd = _d, pdate++->yy = _y; \ } while (0) #define TERM_DATES pdate->mm = pdate->dd = pdate->yy = 0 #ifndef NO_ORTHODOX #define odox_add(offs) do { \ int mon; \ mon = APR; \ if (offs < 1) { \ mon = MAR; \ offs = 31 + offs; \ } else if (offs > 30) { \ mon = MAY; \ offs -= 30; \ } \ ADD_DATE(mon, offs, curr_year); \ } while (0); #endif /* --------------------------------------------------------------------------- Data Declarations (including externals) */ /* This array of 'date' (month, day, year) structures holds all of the "candidate" dates for a single event specification read from the configuration file. For a simple once-a-year event, this array will hold just one entry. For more complex events (those occurring more than once-a-year), this array will hold several "candidate" dates. Any dates in this array might get modified before the event is actually added to the big linked list structure (which is eventually used to output the actual calendar). For example, an event specification of "Sat on_or_before Dec 15" would cause Dec 15 (for the given year being processed) to be added to this array, but the actual date that eventually gets added to the linked list may be a day _before_ Dec 15th. Additionally, some dates in this array might get invalidated (by having the 'year' field set to -1) so that the event is not actually added to the big linked list structure. This currently only occurs with the use of the "on" preposition. For example, an event specification of "Fri on all 13" (to highlight all "Friday the 13th" days in all months) would cause 12 events (for the given year being processed) to be added to this array, one for each month's 13th day. However, any entry in this array which does NOT fall on a Friday would be marked as invalid, so that it won't actually be added to the linked list. */ static date_str candidate_dates[MAX_DATES+1]; /* array of date structures */ static char *pp_sym[MAX_PP_SYMS]; /* preprocessor defined symbols */ static char *pp_val[MAX_PP_SYMS]; /* preprocessor defined symbols' values */ static int curr_year_reset = FALSE; static int delete_entry = FALSE; /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ /* --------------------------------------------------------------------------- read_datefile Notes: This routine reads and parses the configuration file (aka 'date file'), handling preprocessor lines. This is the main routine of this module. It calls 'get_pcal_line()' to read each non-null line (stripped of leading blanks and trailing comments), 'loadwords()' to "tokenize" it, and 'get_token()' to classify it as a preprocessor directive or "other". A switch statement takes the appropriate action for each token type; "other" lines are further classified by 'parse_as_non_preproc()' which calls 'parse_date()' to parse date entries and enter them in the data structure (as described in 'pcaldefs.h'). The first parameter is a pointer to the file (assumed to be already open). The second parameter is the filename (for error messages). */ void read_datefile (FILE *fp, char *filename) { static int file_level = 0; int if_level = 0; int line = 0; int extra = 0; int pptype, ntokens, save_year, expr, (*pfcn) (char *) = NULL; char *ptok = NULL; char **pword; char msg[STRSIZ], incpath[STRSIZ], save_font; /* stack for processing nested "if{n}defs" - required for "elif" */ struct { int state; /* PROCESSING, AWAITING_TRUE, SKIP_TO_ENDIF */ int else_ok; /* is "elif" or "else" legal at this point? */ } if_state[MAX_IF_NESTING+1]; if (fp == NULL) return; /* whoops, no date file */ /* Note that there is no functional limit on file nesting. This is mostly to catch infinite loops (e.g., a includes b, b includes a). */ if (++file_level > MAX_FILE_NESTING) { ERR(E_FILE_NESTING); exit(EXIT_FAILURE); } save_year = curr_year; /* save current year... */ save_font = fontstyle[0]; /* ... and font style */ if_state[0].state = PROCESSING; /* set up initial state */ if_state[0].else_ok = FALSE; /* read lines until EOF */ while (get_pcal_line(fp, lbuf, &line)) { char suffix; if (DEBUG(DEBUG_PP)) { fprintf(stderr, "%s (%d)", filename, line); if (if_state[if_level].state == PROCESSING) fprintf(stderr, ": '%s'", lbuf); fprintf(stderr, "\n"); } ntokens = loadwords(words, lbuf); /* split line into tokens */ pword = words; /* point to the first */ /* get token type and pointers to function and name */ suffix = words[0][strlen(words[0])-1]; if ((pptype = get_token(*pword++)) != PP_OTHER) { pfcn = pp_info[pptype].pfcn; ptok = pp_info[pptype].name; pptype = pp_info[pptype].code; /* use type code */ } /* Perform symbol value substitution, but bypass it for any 'undef' preprocessor commands, otherwise there's no way to 'undef' a symbol which also had a value defined with it. */ if (pptype != PP_UNDEF) { char **ap, *nap; for (ap=words; *ap; ap++) { if ((nap = find_sym_val(*ap))) *ap=nap; } } switch (pptype) { case PP_DEFINE: if (if_state[if_level].state == PROCESSING) (void) (*pfcn)(*pword); if (ntokens == 3) do_define_sym_val(*pword,pword[1]); extra = ntokens > 3; break; case PP_UNDEF: if (if_state[if_level].state == PROCESSING) (void) (*pfcn)(*pword); extra = ntokens > 2; break; case PP_ELIF: if (!if_state[if_level].else_ok) { ERR(E_ELIF_ERR); break; } /* if a true expression has just been processed, disable processing and skip to endif; if no true expression has been found yet and the current expression is true, enable processing */ switch (if_state[if_level].state) { case PROCESSING: if_state[if_level].state = SKIP_TO_ENDIF; break; case AWAITING_TRUE: copy_text(lbuf, pword); /* reconstruct string */ if ((expr = (*pfcn)(lbuf)) == EXPR_ERR) { ERR(E_EXPR_SYNTAX); expr = FALSE; } if (expr) if_state[if_level].state = PROCESSING; break; } extra = FALSE; break; case PP_ELSE: if (!if_state[if_level].else_ok) { ERR(E_ELSE_ERR); break; } /* if a true condition has just been processed, disable processing and skip to endif; if no true condition has been found yet, enable processing */ switch (if_state[if_level].state) { case PROCESSING: if_state[if_level].state = SKIP_TO_ENDIF; break; case AWAITING_TRUE: if_state[if_level].state = PROCESSING; break; } /* subsequent "elif" or "else" forbidden */ if_state[if_level].else_ok = FALSE; extra = ntokens > 1; break; case PP_ENDIF: if (if_level < 1) { ERR(E_END_ERR); break; } if_level--; extra = ntokens > 1; break; case PP_IFDEF: case PP_IFNDEF: /* "if{n}def"s nested too deeply? */ if (++if_level > MAX_IF_NESTING) { ERR(E_IF_NESTING); exit(EXIT_FAILURE); break; } /* if processing enabled at outer level, evaluate expression and enable/disable processing for following clause; if not, skip to matching endif */ if (if_state[if_level-1].state == PROCESSING) { copy_text(lbuf, pword); /* reconstruct string */ if ((expr = (*pfcn)(lbuf)) == EXPR_ERR) { ERR(E_EXPR_SYNTAX); expr = FALSE; } if_state[if_level].state = expr ? PROCESSING : AWAITING_TRUE; } else if_state[if_level].state = SKIP_TO_ENDIF; if_state[if_level].else_ok = TRUE; extra = FALSE; break; case PP_INCLUDE: if (if_state[if_level].state == PROCESSING) { do_include(mk_path(incpath, filename), *pword, suffix == '?'); } extra = ntokens > 2; break; case PP_OTHER: /* None of the above... Parse this configuration file line as a non-preprocessor directive. This could be an event specification, an event deletion specification, a 'year' specification, an 'input language' specification, an option specification, or a 'note box' text specification. */ if (if_state[if_level].state == PROCESSING) { switch (parse_as_non_preproc(words, filename)) { case PARSE_INVDATE: ERR(E_INV_DATE); break; case PARSE_INVLINE: ERR(E_INV_LINE); break; case PARSE_NOMATCH: ERR(E_NO_MATCH); break; } } extra = FALSE; break; } /* end switch */ if (extra) { /* extraneous data? */ sprintf(msg, E_GARBAGE, ptok); ERR(msg); } } /* end while */ if (if_level > 0) fprintf(stderr, E_UNT_IFDEF, progname, filename); file_level--; curr_year = save_year; /* restore saved year and font style */ fontstyle[0] = save_font; return; } /* * Routines to free allocated data (symbol table and data structure) */ /* --------------------------------------------------------------------------- clear_syms Notes: This routine clears and deallocates the symbol table. */ /* * clear_syms - */ void clear_syms (void) { int i; for (i = 0; i < MAX_PP_SYMS; i++) { if (pp_sym[i]) { free(pp_sym[i]); pp_sym[i] = NULL; } if (pp_val[i]) { free(pp_val[i]); pp_val[i] = NULL; } } return; } /* --------------------------------------------------------------------------- cleanup Notes: This routine frees all allocated data. */ void cleanup (void) { int i, j; year_info *py, *pny; month_info *pm; day_info *pd, *pnd; for (py = head; py; py = pny) { /* main data structure */ pny = py->next; for (i = 0; i < 12; i++) { if ((pm = py->month[i]) == NULL) continue; for (j = 0; j < LAST_NOTE_DAY; j++) { for (pd = pm->day[j]; pd; pd = pnd) { pnd = pd->next; free(pd->text); free(pd); } } free(pm); } free(py); } clear_syms(); /* symbol table */ return; } /* * Preprocessor token and symbol table routines */ /* --------------------------------------------------------------------------- find_sym_name Notes: This routine looks up a symbol name. It returns the symbol table index if found or 'PP_SYM_UNDEF' if not found. */ int find_sym_name (char *sym) { int i; if (!sym) return PP_SYM_UNDEF; for (i = 0; i < MAX_PP_SYMS; i++) { if (pp_sym[i] && ci_strcmp(pp_sym[i], sym) == 0) return i; } return PP_SYM_UNDEF; } /* --------------------------------------------------------------------------- find_sym_val Notes: This routine looks up a symbol's value. It returns the symbol value table index if found or 'PP_SYM_UNDEF' if not found. */ char *find_sym_val (char *sym) { int j; return (j=find_sym_name(sym))==PP_SYM_UNDEF ? NULL : pp_val[j]; } /* --------------------------------------------------------------------------- do_ifdef Notes: This routine returns TRUE if 'expr' is true, FALSE if not, and 'EXPR_ERR' if invalid. */ int do_ifdef (char *expr) { return parse_expr(expr); } /* --------------------------------------------------------------------------- do_ifndef Notes: This routine returns FALSE if 'expr' is true, TRUE if not, and 'EXPR_ERR' if invalid. */ int do_ifndef (char *expr) { int val; return (val = parse_expr(expr)) == EXPR_ERR ? EXPR_ERR : ! val; } /* --------------------------------------------------------------------------- do_define Notes: This routine enters 'sym' into the symbol table. If 'sym' is NULL, clear the symbol table. Always returns 0 (for compatibility with other dispatch functions). */ int do_define (char *sym) { int i; if (!sym) { /* null argument - clear all definitions */ clear_syms(); return 0; } if (DEBUG(DEBUG_PP)) fprintf(stderr, "defining %s\n", sym); if (do_ifdef(sym)) return 0; /* already defined? */ for (i = 0; i < MAX_PP_SYMS; i++) { /* find room for it */ if (!pp_sym[i]) { strcpy(pp_sym[i] = alloc(strlen(sym)+1), sym); return 0; } } fprintf(stderr, E_SYMFULL, progname, sym); return 0; } /* --------------------------------------------------------------------------- do_define_sym_val Notes: This routine enters the symbol value 'val' into the symbol table for symbol 'sym'. If 'sym' is not found, return 'PP_SYM_UNDEF'. */ int do_define_sym_val (char *sym, char *val) { int i; i = find_sym_name(sym); if (i == PP_SYM_UNDEF) return PP_SYM_UNDEF; if (pp_val[i]) { free(pp_val[i]); pp_val[i]=NULL; } if (val) strcpy(pp_val[i] = alloc(strlen(val)+1), val); else pp_val[i]=NULL; return 0; } /* --------------------------------------------------------------------------- do_undef Notes: This routine undefines 'sym' and frees its space. No error occurs if 'sym' is not defined. Always return 0 (for compatibility with other dispatch functions). */ int do_undef (char *sym) { int i; if (!sym) return 0; if (DEBUG(DEBUG_PP)) fprintf(stderr, "undefining %s\n", sym); if ((i = find_sym_name(sym)) != PP_SYM_UNDEF) { if (pp_val[i]) { free(pp_val[i]); pp_val[i] = NULL; } free(pp_sym[i]); pp_sym[i] = NULL; } return 0; } /* --------------------------------------------------------------------------- do_include Notes: This routine includes the specified file (optionally in "" or <>). Always returns 0 (for compatibility with related functions returning 'int'). The first parameter is the path to the file, the second parameter is the filename, and the third parameter is a flag to ignore a nonexistent file. */ int do_include (char *path, char *name, int noerr) { FILE *fp; char *p, incfile[STRSIZ], tmpnam[STRSIZ], sv_tmpnam[STRSIZ]; int yy, yyfirst, yylast, sv_curr_year; if (!name) return 0; /* whoops, no date file */ /* copy name, stripping "" or <> */ strcpy(tmpnam, name + (*name == '"' || *name == '<')); if ((p = P_LASTCHAR(tmpnam)) && (*p == '"' || *p == '>')) *p = '\0'; /* save year and unmunged file name */ sv_curr_year = curr_year; strcpy(sv_tmpnam, tmpnam); /* set up range of years to include: '%y', if present, is normally expanded to only the current year - except in "year all" mode where it is expanded to every applicable year */ yyfirst = yylast = curr_year; if (curr_year == ALL_YEARS) { yyfirst = yylast = init_year; if ((p = strchr(tmpnam, '%')) != NULL && *(p+1) == 'y') yylast = final_year; } /* * loop over all years to be included */ for (yy = yyfirst; yy <= yylast; yy++) { strcpy(tmpnam, sv_tmpnam); /* restore unmunged name */ /* replace each instance of %y with last two digits of year */ while ((p = strchr(tmpnam, '%')) != NULL && *(p+1) == 'y') { *p++ = (yy / 10) % 10 + '0'; *p = yy % 10 + '0'; } if ((fp = fopen(mk_filespec(incfile, path, tmpnam), "r")) == NULL) { if (noerr) continue; /* silently ignore in include? mode */ fprintf(stderr, E_FOPEN_ERR, progname, incfile); exit(EXIT_FAILURE); } curr_year = yy; /* avoid infinite recursion */ read_datefile(fp, incfile); /* recursive call */ fclose(fp); } curr_year = sv_curr_year; /* restore original value */ return 0; } /* * Dispatch functions for wildcard matching */ /* --------------------------------------------------------------------------- is_anyday Notes: This routine is a dummy function which always returns TRUE. */ int is_anyday (int mm GCC_UNUSED, int dd GCC_UNUSED, int yy GCC_UNUSED) { return TRUE; } /* --------------------------------------------------------------------------- is_weekday Notes: This routine determines whether or not mm/dd/yy is a weekday (i.e. the day of the week normally prints in "logical black", the most prevalent color). */ int is_weekday (int mm, int dd, int yy) { return day_color[calc_weekday(mm, dd, yy)] == weekday_color; } /* --------------------------------------------------------------------------- is_workday Notes: This routine determines whether or not mm/dd/yy is a workday (i.e. the day of the week normally prints in black and the date is not a holiday). */ int is_workday (int mm, int dd, int yy) { return is_weekday(mm, dd, yy) && ! is_holiday(mm, dd, yy); } /* --------------------------------------------------------------------------- is_holiday Notes: This routine determines whether or not mm/dd/yy is a holiday. */ int is_holiday (int mm, int dd, int yy) { year_info *py; month_info *pm; pm = (py = find_year(yy, FALSE)) ? py->month[mm-1] : NULL; return pm ? (pm->holidays & (1L << (dd-1))) != 0 : FALSE; } /* --------------------------------------------------------------------------- not_weekday Notes: This routine is the inverse of the 'is_xxxx' function of similar name. */ int not_weekday (int mm, int dd, int yy) { return !is_weekday(mm, dd, yy); } /* --------------------------------------------------------------------------- not_workday Notes: This routine is the inverse of the 'is_xxxx' function of similar name. */ int not_workday (int mm, int dd, int yy) { return !is_workday(mm, dd, yy); } /* --------------------------------------------------------------------------- not_holiday Notes: This routine is the inverse of the 'is_xxxx' function of similar name. */ int not_holiday (int mm, int dd, int yy) { return !is_holiday(mm, dd, yy); } /* --------------------------------------------------------------------------- is_newmoon Notes: This routine determines whether or not mm/dd/yy is the date of a new moon. */ int is_newmoon (int mm, int dd, int yy) { int quarter; (void) find_phase(mm, dd, yy, &quarter); return quarter == MOON_NM; } /* --------------------------------------------------------------------------- is_firstq Notes: This routine determines whether or not mm/dd/yy is the date of a first quarter. */ int is_firstq (int mm, int dd, int yy) { int quarter; (void) find_phase(mm, dd, yy, &quarter); return quarter == MOON_1Q; } /* --------------------------------------------------------------------------- is_fullmoon Notes: This routine determines whether or not mm/dd/yy is the date of a full moon. */ int is_fullmoon (int mm, int dd, int yy) { int quarter; (void) find_phase(mm, dd, yy, &quarter); return quarter == MOON_FM; } /* --------------------------------------------------------------------------- is_lastq Notes: This routine determines whether or not mm/dd/yy is the date of a last quarter. */ int is_lastq (int mm, int dd, int yy) { int quarter; (void) find_phase(mm, dd, yy, &quarter); return quarter == MOON_3Q; } /* Routines to find predefined holidays too complicated to express as Pcal date strings. All add the matching date(s) (yes, holidays which span multiple days are allowed) to the 'candidate_dates[]' array (pointed to by pdate) and return the number of matching dates. */ /* --------------------------------------------------------------------------- find_easter Notes: This routine finds Easter of the current year; add to date array (adapted by parties unknown from Knuth's _The Art of Computer Programming_, v. 1). */ int find_easter (date_str *pdate) /* pointer into date array */ { #define METONIC 19 /* length of metonic cycle */ /* Easter is defined as the Sunday after the full moon on or after March 21. You could express that as "1st Sun after 1st full_moon ooa 21st day in March" instead of using this routine, but depending on your timezone your full moon might not fall on the same day as the "official" one. */ date_str *sv_pdate = pdate; register int epact, fm; int golden, century, nleap; golden = curr_year % METONIC + 1; century = curr_year / 100 + 1; nleap = 3 * century / 4 - 12; /* correct for moon's orbit */ epact = (11 * golden + 20 + (8 * century + 5) / 25 - 5 - nleap) % 30; if (epact < 0) epact += 30; if ((epact == 25 && golden > 11) || epact == 24) ++epact; /* find full moon on or after 3/21 */ fm = 44 - epact; if (fm < 21) fm += 30; /* find date of following Sunday */ fm += 7 - ((int)(5L * curr_year / 4) - nleap - 10 + fm) % 7; /* add Easter to date array (adjust if in April) */ ADD_DATE(fm <= 31 ? MAR : APR, fm <= 31 ? fm : fm - 31, curr_year); /* return number of dates added (always 1 in this routine) */ return pdate - sv_pdate; } #ifndef NO_ORTHODOX /* * orthodox Easter related holiday calculations (Angelo Haritsis ) */ /* --------------------------------------------------------------------------- odox_easter_from_april1 Notes: This routine determines the number of days from April 1st of given year until Orthodox Easter. */ int odox_easter_from_april1 (int year) { int a, b, leap; a = ( ( ((year-1) % METONIC) + 1 ) * METONIC + 15 ) % 30; leap = IS_LEAP(year) ? 1 : 0; b = (calc_weekday(1,1,year) + 90 + leap + a + 2) % 7; b = 7 - b + 3 + a; /* In 1923, 13 days were added to the new greek calendar */ if (year <= 1923) b -= 13; return (b); } /* --------------------------------------------------------------------------- find_odox_easter Notes: This routine finds the date for Orthodox Easter. It was almost blindly copied from PostScript source in 'gpscal'. */ int find_odox_easter (date_str *pdate) /* pointer into date array */ { date_str *sv_pdate = pdate; int offs; /* easter is days from 1st April for easter sun */ offs = odox_easter_from_april1(curr_year); odox_add(offs); /* return number of dates added (always 1 in this routine) */ return pdate - sv_pdate; } /* --------------------------------------------------------------------------- find_odox_stgeorge Notes: This routine finds the date for the Orthodox holiday. */ int find_odox_stgeorge (date_str *pdate) /* pointer into date array */ { date_str *sv_pdate = pdate; int offs; /* offs is days from 1st April for easter sun */ offs = odox_easter_from_april1(curr_year); if (offs >= 23) { /* it's before easter; will move to easter Mon */ offs++; odox_add(offs); } else ADD_DATE(APR, 23, curr_year); /* return number of dates added */ return pdate - sv_pdate; } /* --------------------------------------------------------------------------- find_odox_marcus Notes: This routine finds the date for the Orthodox holiday. */ int find_odox_marcus (date_str *pdate) /* pointer into date array */ { date_str *sv_pdate = pdate; int offs; /* offs is days from 1st April for easter sun */ offs = odox_easter_from_april1(curr_year); if (offs >= 25) { /* it's before easter; will move to easter Tue */ offs += 2; odox_add(offs); } else ADD_DATE(APR, 25, curr_year); /* return number of dates added */ return pdate - sv_pdate; } #endif /* !NO_ORTHODOX */ /* * Keyword classification routines */ /* --------------------------------------------------------------------------- get_month Notes: This routine converts an alpha (or, optionally, numeric) string to a month. It returns 1..12 if valid, 'NOT_MONTH' if not, 'ALL_MONTHS' if "all", 'ENTIRE_YEAR' if "year". The first parameter is the string to convert. The second parameter is a flag to indicate that a numeric string can be accepted. The third parameter is a flag to indicate that the string "year" can be accepted. */ int get_month (char *cp, int numeric_ok, int year_ok) { int mm; if (!cp) return NOT_MONTH; if (get_keywd(cp) == DT_ALL) return ALL_MONTHS; if (year_ok && get_keywd(cp) == DT_YEAR) return ENTIRE_YEAR; if (numeric_ok && isdigit((int)*cp)) mm = atoi(cp); else { /* accept month names in the active 'input' language only */ for (mm = JAN; mm <= DEC; mm++) { /* Need to shorten length of string compare by 1 character when the last character is '*' so that event like '2nd Sunday in May*' don't report 'no match for wildcard'. */ if ((ci_strncmp(cp, months_ml[input_language][mm-1], strlen(cp) - ((*(cp + strlen(cp) - 1) == '*') ? 1 : 0)) == 0)) break; } } return mm >= JAN && mm <= DEC ? mm : NOT_MONTH; } /* --------------------------------------------------------------------------- get_weekday Notes: This routine looks up the specified string in the weekday list. It returns 0-6 if valid, 'NOT_WEEKDAY' if not. If 'wild_ok' flag is set, accept "day", "weekday", "workday", "holiday", or moon phase and return appropriate value. */ int get_weekday (char *cp, int wild_ok) { int w; if (!cp) return NOT_WEEKDAY; if (wild_ok) { /* try wildcards first */ for (w = WILD_FIRST_WKD; w <= WILD_LAST_WKD; w++) { if (ci_strncmp(cp, days[w], strlen(days[w])) == 0) return w; } if ((w = get_phase(cp)) != MOON_OTHER) return w + WILD_FIRST_MOON; } /* accept day names in the active 'input' language only */ for (w = SUN; w <= SAT; w++) { int compare_count; /* To allow for proper detection of the day-of-week name in constructs from the configuration file like 'all Fridays in Oct' (i.e. with the plural form of the day-of-week name), we need to compare the fewest number of characters of the 2 strings. */ compare_count = (strlen(cp) < strlen(days_ml[input_language][w])) ? strlen(cp) : strlen(days_ml[input_language][w]); if (ci_strncmp(cp, days_ml[input_language][w], compare_count) == 0) return w; } return NOT_WEEKDAY; } /* --------------------------------------------------------------------------- get_keywd Notes: This routine looks up the specified string in the 'miscellaneous keyword' list. It returns the keyword code if valid, 'DT_OTHER' if not. */ int get_keywd (char *cp) { KWD *k; if (!cp) return DT_OTHER; for (k = keywds; k->name && ci_strncmp(cp, k->name, strlen(k->name)); k++) ; return k->code; } /* --------------------------------------------------------------------------- get_ordinal Notes: This routine looks up the specified string in the ordinal list. It returns the ordinal code (and fills in the ordinal value) if valid. It returns 'ORD_OTHER' if invalid. */ int get_ordinal (char *cp, int *pval) { KWD_O *o; int val; char **psuf; if (!cp) return ORD_OTHER; if (isdigit((int)*cp) || *cp == '-') { /* numeric? */ if ((val = atoi(cp)) == 0) return ORD_OTHER; if (*cp == '-') cp++; /* skip over number */ cp += strspn(cp, DIGITS); for (psuf = ord_suffix; *psuf; psuf++) { /* find suffix */ if (ci_strcmp(cp, *psuf) == 0) { *pval = val; return val < 0 ? ORD_NEGNUM : ORD_POSNUM; } } return ORD_OTHER; } /* look for word in ordinals list */ for (o = ordinals; o->name && ci_strncmp(cp, o->name, MIN_ORD_LEN); o++) ; *pval = o->value; return o->code; } /* --------------------------------------------------------------------------- get_phase Notes: This routine converts the specified 'moon phase' string to the appropriate value. */ int get_phase (char *cp) { KWD *p; if (!cp) return MOON_OTHER; for (p = phases; p->name && ci_strcmp(cp, p->name); p++) ; return p->code; } /* --------------------------------------------------------------------------- get_prep Notes: This routine looks up the specified string in the preposition list. It returns the preposition code if valid, 'PR_OTHER' if not. */ int get_prep (char *cp) { KWD *p; if (!cp) return PR_OTHER; for (p = preps; p->name && ci_strncmp(cp, p->name, MIN_PREP_LEN); p++) ; return p->code; } /* --------------------------------------------------------------------------- get_token Notes: This routine looks up the specified 'token' in the list of preprocessor tokens. It returns its index or 'PP_OTHER' if not found. */ int get_token (char *token) { KWD_F *p; for (p = pp_info; p->name; p++) { if (ci_strncmp(token, p->name, MIN_PPTOK_LEN) == 0) return p - pp_info; } return PP_OTHER; } /* --------------------------------------------------------------------------- get_predef_event Notes: This routine looks up the specified string in the predefined-event list. It returns its index if found, 'NOT_PREDEF_EVENT' if not. */ int get_predef_event (char *cp) { KWD_H *p; for (p = predef_events; p->name; p++) { if (ci_strncmp(cp, p->name, strlen(p->name)) == 0) return p - predef_events; } return NOT_PREDEF_EVENT; } /* --------------------------------------------------------------------------- date_type Notes: This routine examines the specified token and returns the date type code. If the token is a month name, an ordinal, or day-of-week name, the appropriate code (and value if an ordinal) is returned ('DT_MONTH', 'DT_ORDINAL', or 'DT_WEEKDAY'). The first parameter is a pointer to the start of the token. The second parameter is the returned token type code. The third parameter is returned ordinal value. */ int date_type (char *cp, int *pn, int *pv) { int n, v; /* look for weekdays first, to catch wildcards "1q", "3q", etc. */ if ((n = get_weekday(cp, TRUE)) != NOT_WEEKDAY) { /* weekday name? */ return (*pn = n, DT_WEEKDAY); } if ((n = get_predef_event(cp)) != NOT_PREDEF_EVENT) { /* pre-defined event? */ return (*pn = n, DT_PREDEF_EVENT); } if ((n = get_ordinal(cp, &v)) != ORD_OTHER) { /* ordinal? */ return (*pn = n, *pv = v, DT_ORDINAL); } if (isdigit((int)*cp)) { /* other digit? */ return (IS_NUMERIC(cp) || (date_style == EUR_DATES && IS_EURDATE(cp))) ? DT_EURDATE : DT_DATE; } /* "all" can be either a keyword or a month wildcard - look for the former usage first */ if ((n = get_keywd(cp)) != DT_OTHER) return n; if ((n = get_month(cp, FALSE, FALSE)) != NOT_MONTH) { /* month name? */ return (*pn = n, DT_MONTH); } return DT_OTHER; /* unrecognized keyword - give up */ } /* * Routines for entering data in the data structure (described in pcaldefs.h) */ /* --------------------------------------------------------------------------- find_year Notes: This routine finds a record in the year list. It will optionally create it (based on the second parameter) if not present. */ year_info *find_year (int year, int insert) { year_info *pyear, *plast, *p; for (plast = NULL, pyear = head; /* search linked list */ pyear && pyear->year < year; plast = pyear, pyear = pyear->next) ; if (pyear && pyear->year == year) return pyear; /* found - return it */ if (insert) { /* not found - insert it if requested */ int i; p = (year_info *) alloc((int) sizeof(year_info)); /* create new record */ p->year = year; for (i = 0; i < (int)(ARRAYSIZE(p->month)); i++) p->month[i] = NULL; p->next = pyear; /* link it in */ return *(plast ? &plast->next : &head) = p; } else return NULL; } /* --------------------------------------------------------------------------- enter_day_info Notes: This routine enters the specified text for the specified day. Avoid entering duplicates. It returns 'PARSE_INVDATE' if the specified date is invalid, 'PARSE_OK' if OK. If symbol 'FEB_29_OK' is non-zero (see 'pcaldefs.h'), it will silently ignore Feb 29 of common year. */ int enter_day_info (int m, int d, int y, int text_type, char **pword) { static year_info *pyear; static int prev_year = 0; month_info *pmonth; day_info *pday, *plast; int is_holiday = text_type == HOLIDAY_TEXT; char text[LINSIZ], *tface; if (! is_valid(m, d >= FIRST_NOTE_DAY && text_type == NOTE_TEXT ? 1 : d, y)) { return (m == FEB && d == 29 && FEB_29_OK) ? PARSE_OK : PARSE_INVDATE; } if (y != prev_year) { /* avoid unnecessary year lookup */ pyear = find_year(y, 1); } --m, --d; /* adjust for use as subscripts */ if ((pmonth = pyear->month[m]) == NULL) { /* find/create month record */ int i; pyear->month[m] = pmonth = (month_info *) alloc((int) sizeof(month_info)); for (i = 0; i < (int)(ARRAYSIZE(pmonth->day)); i++) pmonth->day[i] = NULL; } if (is_holiday) pmonth->holidays |= (1L << d); /* insert text for day at end of list (preserving the order of entry for multiple lines on same day); eliminate those differing only in spacing and capitalization from existing entries */ copy_text(text, pword); /* consolidate text from lbuf into text */ if (DEBUG(DEBUG_DATES)) { char *p; fprintf(stderr, "Adding event: %02d/%02d/%d%c '", m+1, d+1, y, is_holiday ? '*' : ' '); for (p = text; *p; p++) { fprintf(stderr, isprint((int)*p) ? "%c" : "\\%03o", *p & CHAR_MSK); } fprintf(stderr, "'\n"); } #if KEEP_NULL_LINES /* preserve blank text lines in output */ if (*text == '\0' && pmonth->day[d]) strcpy(text, BLANK_TEXT); #endif /* check that non-null text is unique */ if (*text) { for (plast = NULL, pday = pmonth->day[d]; pday; plast = pday, pday = pday->next) { if (ci_strcmp(pday->text, text) == 0 #if KEEP_NULL_LINES && strcmp(text, BLANK_TEXT) != 0 #endif ) { pday->is_holiday |= is_holiday; return PARSE_OK; } } /* unique - add to end of list */ pday = (day_info *) alloc(sizeof(day_info)); pday->is_holiday = is_holiday; if (fontstyle[0] == ROMAN || output_type != OUTPUT_PS) { /* copy text intact (no font shift) */ strcpy(pday->text = (char *) alloc(strlen(text)+1), text); } else { /* prepend font shift sequence to text */ tface = fontstyle[0] == BOLD ? BOLD_FONT : fontstyle[0] == ITALIC ? ITALIC_FONT : ""; pday->text = (char *) alloc(strlen(tface) + strlen(text) + 2); strcpy(pday->text, tface); if (*tface) strcat(pday->text, " "); strcat(pday->text, text); } pday->next = NULL; *(plast ? &plast->next : &pmonth->day[d]) = pday; } return PARSE_OK; } /* --------------------------------------------------------------------------- delete_day_info Notes: This routine deletes text for the specified day. It returns 'PARSE_INVDATE' if the specified date is invalid, 'PARSE_OK' if OK. If symbol 'FEB_29_OK' is non-zero (see 'pcaldefs.h'), it will silently ignore Feb 29 of common year. It will silently ignore attempts to remove non-existent entries. It also recalculates 'is_holiday', in case a holiday event is being deleted. */ int delete_day_info (int m, int d, int y, int text_type, char **pword) { static year_info *pyear; static int prev_year = 0; month_info *pmonth; day_info *pday, *plast, *pdel = NULL, *pldel = NULL; int is_holiday = FALSE; int found = FALSE; char text[LINSIZ]; if (! is_valid(m, d >= FIRST_NOTE_DAY && text_type == NOTE_TEXT ? 1 : d, y)) { return (m == FEB && d == 29 && FEB_29_OK) ? PARSE_OK : PARSE_INVDATE; } if (y != prev_year) { /* avoid unnecessary year lookup */ pyear = find_year(y, 1); } --m, --d; /* adjust for use as subscripts */ if ((pmonth = pyear->month[m]) == NULL) { /* ignore delete if no entries exist */ return PARSE_OK; } if (pmonth->day[d] == NULL) return PARSE_OK; /* delete text for day from list ignoring differences in only spacing and capitalization in the existing entry. */ copy_text(text, pword); /* consolidate text from lbuf into text */ if (DEBUG(DEBUG_DATES)) { char *p; fprintf(stderr, "Deleting event: %02d/%02d/%d%c '", m+1, d+1, y, is_holiday ? '*' : ' '); for (p = text; *p; p++) { fprintf(stderr, isprint((int)*p) ? "%c" : "\\%03o", *p & CHAR_MSK); } fprintf(stderr, "'\n"); } #if KEEP_NULL_LINES /* preserve blank text lines in output */ if (*text == '\0' && pmonth->day[d]) strcpy(text, BLANK_TEXT); #endif /* check if non-null and find entry to delete */ if (*text) { for (plast = NULL, pday = pmonth->day[d]; pday; plast = pday, pday = pday->next) { if (ci_strcmp(pday->text, text) == 0) { found = TRUE; pdel = pday; pldel = plast; } else is_holiday |= pday->is_holiday; } if (found) { if (pldel) pldel->next = pdel->next; else pmonth->day[d] = pdel->next; free(pdel); if (is_holiday) pmonth->holidays |= (1L << d); else pmonth->holidays &= ~(1L << d); } } return PARSE_OK; } /* --------------------------------------------------------------------------- enter_note Notes: This routine acts as a wrapper around 'enter_day_info()' for entering note text. */ int enter_note (int mm, char **pword, int n) { int valid; /* expand "note all" into all twelve months */ if (mm == ALL_MONTHS || mm == ENTIRE_YEAR) { valid = FALSE; /* is at least one note box valid? */ for (mm = JAN; mm <= DEC; mm++) { valid |= enter_day_info(mm, note_day(mm, n, curr_year), curr_year, NOTE_TEXT, pword+1) == PARSE_OK; } return valid ? PARSE_OK : PARSE_NOMATCH; } return enter_day_info(mm, note_day(mm, n, curr_year), curr_year, NOTE_TEXT, pword+1); } /* --------------------------------------------------------------------------- process_event_specification Notes: This routine adds or deletes events (including the specific date and its associated text) to/from the big linked list structure (described in greater detail in 'pcaldefs.h'). */ int process_event_specification (char **pword, int *ptext_type, char ***pptext) { int rtn, match; date_str *pd; /* parse date spec and enter information for each match */ if ((rtn = parse_date(pword, ptext_type, pptext)) == PARSE_OK) { match = FALSE; for (pd = candidate_dates; pd->mm; pd++) { if (pd->yy == -1) { if (DEBUG(DEBUG_DATES)) { fprintf(stderr, "Bypassing invalidated candidate date: yyyy-%02d-%02d.\n", pd->mm, pd->dd); } } else { if (DEBUG(DEBUG_DATES)) { fprintf(stderr, "Processing candidate date: %4d-%02d-%02d\n", pd->yy, pd->mm, pd->dd); } if (delete_entry) { match |= delete_day_info(pd->mm, pd->dd, pd->yy, *ptext_type, *pptext) == PARSE_OK; } else { match |= enter_day_info(pd->mm, pd->dd, pd->yy, *ptext_type, *pptext) == PARSE_OK; } } } rtn = match ? PARSE_OK : PARSE_NOMATCH; } return rtn; } /* * Date parsing routines: */ /* --------------------------------------------------------------------------- parse_ord Notes: This routine parses an ordinal date specification (e.g. "first Monday in September", "every Sunday in October", "last workday in all"). It returns 'PARSE_OK' if line syntax is valid, 'PARSE_INVLINE' if not. It writes all matching dates (if any) to the global array 'candidate_dates[]'. It terminates the date list with a null entry. The first parameter is a valid ordinal code (from 'get_ordinal()'). The second parameter is the ordinal value (also from 'get_ordinal()'). The third parameter is a pointer to the word after the ordinal. */ int parse_ord (int ord, int val, char **pword) { int wkd, mon, mm, dd, len, doit, (*pfcn) (int, int, int); int val_first, val_last, val_incr, mon_first, mon_last; date_str *pdate, date; if ((wkd = get_weekday(*pword, TRUE)) == NOT_WEEKDAY || /* weekday */ *++pword == NULL || /* any word */ (mon = get_month(*++pword, FALSE, TRUE)) == NOT_MONTH) { /* month */ return PARSE_INVLINE; } /* set up loop boundaries for month loop */ mon_first = mon == ALL_MONTHS || mon == ENTIRE_YEAR ? JAN : mon; mon_last = mon == ALL_MONTHS || mon == ENTIRE_YEAR ? DEC : mon; pdate = candidate_dates; /* start of 'candidate_dates[]' array */ /* special case of "all|odd|even in |all|year" */ if ((ord == ORD_ALL || ord == ORD_EVEN || ord == ORD_ODD) && IS_WILD(wkd)) { pfcn = pdatefcn[wkd - WILD_FIRST]; doit = ord != ORD_EVEN; for (mm = mon_first; mm <= mon_last; mm++) { len = LENGTH_OF(mm, curr_year); if (mon != ENTIRE_YEAR) doit = ord != ORD_EVEN; for (dd = 1; dd <= len; dd++) { if ((*pfcn)(mm, dd, curr_year)) { if (doit) ADD_DATE(mm, dd, curr_year); if (ord != ORD_ALL) doit = ! doit; } } } } /* special case of "odd|even in year" */ else if ((ord == ORD_EVEN || ord == ORD_ODD) && mon == ENTIRE_YEAR) { date.mm = JAN; /* starting date */ date.dd = calc_day(ord == ORD_EVEN ? 2 : 1, wkd, JAN); date.yy = curr_year; do { /* alternates throughout year */ ADD_DATE(date.mm, date.dd, date.yy); date.dd += 14; normalize(&date); } while (date.yy == curr_year); } /* special case of "|last | in year" */ else if ((ord == ORD_NEGNUM || ord == ORD_POSNUM) && mon == ENTIRE_YEAR) { if (calc_year_day(val, wkd, &date)) ADD_DATE(date.mm, date.dd, date.yy); } /* all other combinations of ordinal and day */ else { /* set up loop boundaries for "wildcard" ordinals */ val_first = ord == ORD_ALL || ord == ORD_ODD ? 1 : ord == ORD_EVEN ? 2 : val; val_last = ord == ORD_ALL || ord == ORD_ODD ? 5 : ord == ORD_EVEN ? 4 : val; val_incr = ord == ORD_ODD || ord == ORD_EVEN ? 2 : 1; for (mm = mon_first; mm <= mon_last; mm++) { for (val = val_first; val <= val_last; val += val_incr) { if ((dd = calc_day(val, wkd, mm)) != 0) ADD_DATE(mm, dd, curr_year); } } } TERM_DATES; /* terminate array with null entry */ return PARSE_OK; } /* --------------------------------------------------------------------------- parse_rel Notes: This routine parses a relative date specification (e.g. "Friday after fourth Thursday in November", "2nd Saturday after first Friday in all"). It returns 'PARSE_OK' if the line syntax valid, 'PARSE_INVLINE' if not. It transforms all dates that match the base date to the appropriate day, month, and year. It calls 'parse_date()' recursively in order to handle cases such as "Friday after Tuesday before last day in all". The first parameter is a valid (positive) ordinal value. The second parameter is a valid weekday code (from 'get_weekday()'). The third parameter is a pointer to the word after the weekday. The fourth parameter is a pointer to the returned text type (holiday/non-holiday). The fifth parameter is a pointer to the returned first word of text. */ int parse_rel (int val, int wkd, char **pword, int *ptype, char ***pptext) { int prep, n, rtn, base_wkd, incr = 1, (*pfcn) (int, int, int); date_str *pd; /* we have the weekday - now look for the preposition */ if ((prep = get_prep(*pword++)) == PR_OTHER) return PARSE_INVLINE; /* get the base date */ if ((rtn = parse_date(pword, ptype, pptext)) != PARSE_OK) return rtn; /* transform 'candidate_dates' array in place - note that the relative date may not be in the same month or even year */ if (IS_WILD(wkd)) { /* wildcard for weekday name? */ pfcn = pdatefcn[wkd - WILD_FIRST]; for (pd = candidate_dates; pd->mm; pd++) { /* search for nearest matching date */ switch (prep) { case PR_BEFORE: pd->dd -= 1; /* start with previous date */ normalize(pd); /* fall through */ case PR_ON_BEFORE: incr = -1; /* search backwards */ break; case PR_AFTER: pd->dd += 1; /* start with following date */ normalize(pd); /* fall through */ case PR_ON_AFTER: incr = 1; /* search forward */ break; case PR_NEAREST: /* If NEAREST_INCR (cf. pcaldefs.h) is 1, pcal will disambiguate "nearest" in favor of the later date; if -1, in favor of the earlier. "incr" will take the values 1, -2, 3, -4, ... or -1, 2, -3, 4 ... respectively during the search loop below. ("nearest_before" and "nearest_after" were added to v4.6 to allow the user to specify disambiguation of two equally near dates.) */ incr = NEAREST_INCR; val = 1; /* ordinals meaningless here */ break; case PR_NEAREST_BEFORE: incr = -1; /* start searching backward */ val = 1; /* ordinals meaningless here */ break; case PR_NEAREST_AFTER: incr = 1; /* start searching forward */ val = 1; /* ordinals meaningless here */ break; } n = val; while (!((*pfcn)(pd->mm, pd->dd, pd->yy) && --n == 0)) { pd->dd += incr; normalize(pd); /* if searching for "nearest" date, invert sign and bump magnitude of 'incr' on each pass */ if (prep == PR_NEAREST || prep == PR_NEAREST_BEFORE || prep == PR_NEAREST_AFTER) { incr -= (incr > 0) ? (2 * incr + 1) : (2 * incr - 1); } } } } else { /* explicit weekday name */ for (pd = candidate_dates; pd->mm; pd++) { /* calculate nearest matching weekday - note that "nearest_before" and "nearest_after" are synonyms for "before" and "after" */ base_wkd = calc_weekday(pd->mm, pd->dd, pd->yy); switch (prep) { case PR_BEFORE: case PR_NEAREST_BEFORE: case PR_ON_BEFORE: if (prep != PR_ON_BEFORE || wkd != base_wkd) pd->dd -= 7 - (wkd - base_wkd + 7) % 7; pd->dd -= 7 * (val - 1); break; case PR_AFTER: case PR_NEAREST_AFTER: case PR_ON_AFTER: if (prep != PR_ON_AFTER || wkd != base_wkd) pd->dd += (wkd - base_wkd + 6) % 7 + 1; pd->dd += 7 * (val - 1); break; case PR_NEAREST: /* use closer of previous and next */ val = wkd - base_wkd; pd->dd += (val > 3) ? (val - 7) : (val < -3) ? (val + 7) : val; break; case PR_ON: /* The 'on' preposition is a special case. When the conditions it specifies are not matched, we really need to actually _remove_ this entry from the 'candidate dates' array. However, for now, it's easier to just set the 'year' ('yy') field in the 'candidate dates' array to -1, as a flag to ignore this date entry entirely when later adding events to the big linked list based on entries from this 'candidate dates' array. */ if (wkd != base_wkd) { pd->yy = -1; /* invalidate this 'candidate date' entry... */ } break; default: return PARSE_INVLINE; break; } normalize(pd); /* adjust for month/year crossing */ } } return PARSE_OK; } /* --------------------------------------------------------------------------- parse_date Notes: This routine parses a date specification in any of its myriad forms. Upon return, array 'candidate_dates[]' will contain a list of all the dates that matched, terminated by a null entry. This routine also fills in the date type (holiday/non- holiday) code and the pointer to the first word of text and sets the flag 'curr_year_reset' if the date specified (e.g., dd/mm/yy) explicitly reset the year. The first parameter is a pointer to the first word to parse. The second parameter is a pointer to the returned date type (holiday/non-holiday). The third parameter is a pointer to the returned first word of the event text string from the line in the configuration file. */ int parse_date (char **pword, int *ptype, char ***pptext) { int mm, dd, yy; int token, n, v, ord, val, wkd, rtn; date_str *pdate; char *cp; pdate = candidate_dates; curr_year_reset = FALSE; /* set below if date is dd/mm/yy */ switch (token = date_type(*pword, &n, &v)) { case DT_MONTH: /* dd */ if (date_style != USA_DATES) return PARSE_INVLINE; if ((cp = *++pword) == NULL) return PARSE_INVLINE; ADD_DATE(n, atoi(cp), curr_year); TERM_DATES; break; case DT_DATE: /* mm/dd{/yy} | dd/mm{/yy} */ n = split_date(*pword, date_style == USA_DATES ? &mm : &dd, date_style == USA_DATES ? &dd : &mm, &yy); if (n > 2) { /* year present? */ if (yy < 100) yy += century(); curr_year = yy; /* reset current year */ curr_year_reset = TRUE; } ADD_DATE(mm, dd, curr_year); TERM_DATES; break; case DT_EURDATE: /* dd [ | "all" ] */ if (date_style != EUR_DATES) return PARSE_INVLINE; dd = atoi(*pword); if (get_keywd(*++pword) == DT_ALL) { for (mm = JAN; mm <= DEC; mm++) { /* wildcard */ ADD_DATE(mm, dd, curr_year); } } else { /* one month */ if ((mm = get_month(*pword, TRUE, FALSE)) == NOT_MONTH) return PARSE_INVLINE; ADD_DATE(mm, dd, curr_year); } TERM_DATES; break; case DT_ALL: /* "all" "in" [ | "all" ] or "all" " */ if ((cp = *(pword+1)) && (*(cp += strspn(cp, DIGITS)) == '\0' || *cp == '*')) { dd = atoi(*++pword); /* "all" */ for (mm = JAN; mm <= DEC; mm++) ADD_DATE(mm, dd, curr_year); TERM_DATES; break; /* leave switch */ } n = ORD_ALL; /* "all" ... */ v = 0; /* fall through */ case DT_ORDINAL: /* in [ | "all" ] or */ ord = n; val = v; /* disambiguate above cases based on preposition */ if (ord == ORD_POSNUM && pword[1] && (get_prep(pword[2]) != PR_OTHER)) { if ((wkd = get_weekday(pword[1], TRUE)) == NOT_WEEKDAY) return PARSE_INVLINE; return parse_rel(val, wkd, pword += 2, ptype, pptext); } if ((rtn = parse_ord(ord, val, pword + 1)) != PARSE_OK) return rtn; pword += 3; /* last word of date */ break; case DT_WEEKDAY: /* */ wkd = n; /* parse_rel() calls parse_date() recursively */ return parse_rel(1, wkd, ++pword, ptype, pptext); break; case DT_PREDEF_EVENT: /* predefined event */ /* predefined events will either have a redefinition string or a dispatch function - never both (cf. pcallang.h) */ if (predef_events[n].pfcn == NULL) { char redef[STRSIZ], *rwords[20], **pdum; int rtn, idum; /* tokenize local copy of redefinition string */ strcpy(redef, predef_events[n].def); (void) loadwords(rwords, redef); /* call parse_date() recursively to parse the redefinition - if OK, drop through to fill in real ptype and pptext from original string (this works basically because the holiday is always the last token before the text) */ if ((rtn = parse_date(rwords, &idum, &pdum)) != PARSE_OK) return rtn; } else { /* predefined event has a dispatch function - use it */ pdate += (*predef_events[n].pfcn)(pdate); TERM_DATES; } break; default: return PARSE_INVLINE; break; } /* at this point, pword points to the last component of the date; fill in type code and pointer to following word (start of text) */ *ptype = LASTCHAR(*pword) == '*' ? HOLIDAY_TEXT : DAY_TEXT; *pptext = ++pword; return PARSE_OK; } /* --------------------------------------------------------------------------- parse_as_non_preproc Notes: This routine parses a single non-preprocessor line from the configuration file. This includes the "year", "opt", "note", "delete", and (most frequently) event specification entries in the configuration file. For event specifications (and event deletions), this routine calls 'process_event_specification()' to parse the date specification and to enter the matching event date(s) in the global array 'candidate_dates[]'. Note: Pre-processor ('cpp'-like) directives (e.g. "include") from the configuration file are handled in 'read_datefile()'. The first parameter is a pointer to the first word to parse. The second parameter is the name of the configuration file (for error messages). */ int parse_as_non_preproc (char **pword, char *filename) { register char *cp; char **ptext; int mm, yy; int text_type, n, v, match; int token; /* Get first field and call date_type() to decode it */ cp = *pword; switch (token = date_type(cp, &n, &v)) { case DT_YEAR: if ((cp = *++pword) != NULL && (yy = atoi(cp)) > 0) { if (yy < 100) yy += century(); curr_year = yy; return PARSE_OK; } if (strcmp(cp, ALL) == 0 || strcmp(cp, "*") == 0) { curr_year = ALL_YEARS; return PARSE_OK; } return PARSE_INVLINE; /* year missing or non-numeric */ break; case DT_OPT: if (!get_args(pword, P_OPT, filename, FALSE)) { display_usage(stderr, FALSE); exit(EXIT_FAILURE); } return PARSE_OK; break; case DT_INPUT_LANGUAGE: pword++; /* point to 2-letter 'language code' string */ if (*pword) { int i; for (i = 0; i < NUM_LANGUAGES; i++) { if (ci_strncmp(lang_id[i], *pword, MIN_LANG_LEN) == 0) { input_language = i; return PARSE_OK; } } } return PARSE_INVLINE; break; case DT_NOTE: /* look for optional "/" following keyword */ n = (cp = strrchr(cp, '/')) ? atoi(++cp) : 0; if ((mm = get_month(*++pword, TRUE, TRUE)) == NOT_MONTH) return PARSE_INVLINE; /* if "year all" in effect, wildcard all applicable years */ if (curr_year == ALL_YEARS) { match = FALSE; for (curr_year = init_year; curr_year <= final_year; curr_year++) { match |= enter_note(mm, pword, n) == PARSE_OK; } curr_year = ALL_YEARS; /* reset to wildcard */ return match ? PARSE_OK : PARSE_NOMATCH; } else return enter_note(mm, pword, n); break; case DT_OTHER: /* unrecognized token */ return PARSE_INVLINE; break; case DT_DELETE: /* fall through to actually delete event entry */ pword++; delete_entry = TRUE; default: /* At this point, we assume that the configuration file line is an event specification... */ /* If the current year is a wildcard ("all" or "*" - see above), enter the date for each year covered at least partially by the calendar. Note that a "mm/dd/yy" date spec explicitly resets curr_year; parse_date() sets the 'curr_year_reset' flag when this happens so that we can quit immediately. */ if (curr_year == ALL_YEARS) { match = FALSE; /* loop over each applicable year */ for (curr_year = init_year; curr_year <= final_year; curr_year++) { match |= process_event_specification(pword, &text_type, &ptext) == PARSE_OK; if (curr_year_reset) { /* quit if year reset */ return match ? PARSE_OK : PARSE_NOMATCH; } } /* restore year to wildcard for next time */ curr_year = ALL_YEARS; delete_entry = FALSE; return match ? PARSE_OK : PARSE_NOMATCH; } match = process_event_specification(pword, &text_type, &ptext); delete_entry = FALSE; return match; break; } } pcal-4.11.0/src/writefil.c0000644000175000001440000031515510732017670013476 0ustar wusers/* --------------------------------------------------------------------------- writefil.c Notes: This file contains routines for writing the PostScript output. Revision history: 4.11.0 B.Marr 2007-12-16 Allow the drawing of moon phase icons ('-m' or '-M') and Julian dates ('-j' or '-J') on yearly-format calendars. Perform various cosmetic cleanups (mostly by adding blank lines) to the PostScript output. B.Marr 2007-12-15 Fix bug whereby use of '-J' option caused garbage text (PostScript commands) to appear in place of the number of days remaining in the year. Add support for new '-W' option, to specify horizontal alignment of the "Month/Year" title on monthly-format calendars, thanks to a patch from Todd Foster. Remove long-obsolete external 'moon file' concept. Now, we depend solely on the algorithmic determination of moon phases. Rename some variables, structures, and/or routines to be clearer about their purpose and/or to allow easier searching with fewer "false positives". 4.10.0 B.Marr 2006-07-19 Use an international (as opposed to USA-centric) date format and 2 more digits of precision in the debug output for moon phases ('-ZM' option). Add the 'pcal' website URL to the PostScript output. Eliminate 1-use macros for EPS-like output and put the code inline for clarity. Reformatted comments and code to match my standards. B.Marr 2006-07-12 Eliminate C++ style comments ('//'). Provide explicit casting in several spots to avoid warnings in a "gcc 3.4.2 on Solaris 8" environment, based on a report from David Mathog . Get rid of all the '#ifdef PROTOS' checks, which are pretty much obsolete these days and just needlessly clutter up the code. 4.9.0 B.Marr 2005-08-10 Fix a long-standing bug whereby a centered "footer" specification with 'strftime()'-like date specifiers used in an HTML yearly calendar was using/showing the correct date values for the HTML 'title' but the wrong date values for the centered header string at the start of the actual displayed (HTML) content. Eliminate the hack to support Esperanto via a custom, dedicated character encoding. Esperanto is now handled generically by the 'Latin3' (ISO 8859-3) character encoding. B.Marr 2005-08-02 Per a user's request, change the separator character from a space to a tab when using the '-c' option (to output text lines which are compatible with the Unix 'calendar' program). B.Marr 2005-01-04 Add support for several new character mappings (PostScript encoding vectors) in order to support a wider variety of languages. Rename enumerations for all encodings to be more consistent (and easily searchable). 4.8.0 B.Marr 2004-12-04 Support new paper sizes. Support specification of paper size via run-time option (command-line, etc). Create and support concept of 'input' language versus 'output' language. Use separate variables for X/Y scaling and X/Y translation done by the program to distinguish from the X/Y scaling and X/Y translation specified by the user. B.Marr 2004-11-19 Support KOI8U character encodings (for Ukrainian language support) and provide abbreviated day-of-week names, both based on a patch from Volodymyr M. Lisivka. Provide support for embedded EPS images (photos, icons, etc) for monthly PostScript calendars. Fix bug since v4.7.1 whereby use of '-q' flag required '-F 1' to prevent wrong weekday display. Remove spaces embedded within tab fields. Remove Ctl-L (page eject) characters from source file. 4.7.1 SF 01/06/2003 html output with one column per month (cf. single_month_one_column_html) 4.7 AWR 02/09/2000 document block of code responsible for forcing Letter or A4 paper tray 10/27/1999 rearrange comment block - 'sdtimage' tool (possibly others) doesn't recognize %%Orientation unless it precedes %%Pages 04/19/1999 support #if DIVIDE_BLANK_SPACE (cf. pcaldefs.h) to print each partial row of blank space at beginning/end of calendar as N one-column boxes instead of one N-column box 06/19/1998 support landscape- and portrait-mode whole-year calendars in HTML mode 03/08/1998 write additional definitions to PostScript output for use with alternate (just A4 at present) paper sizes 12/21/1997 clean up gcc warnings in -Wall mode 07/27/1997 revise for -H support (generate HTML table as output; cf. write_htmlfile() and print_html()); delete obsolete FPR and PRT macros 4.6 AWR 04/30/1996 suppress "For:" and "Routing:" comments if account name is "nobody" (typically when pcal is run from a CGI script) 04/22/1996 use alternate (taller) date box height for single-month calendars in portrait mode 12/02/1995 drop asterisks from -c output (Un*x "calendar" utility interprets them as wildcards) unless KEEP_ASTERISKS is defined 11/14/1995 if OUTLINE_BLACK is defined, display -O dates as black outlines (not the specified color) in RGB mode (cf. pcalinit.ps) 10/03/1995 use globals for initial month, year, number of months (cf. pcalglob.h, pcal.c) 05/09/1995 add support for font style escape sequences (.[bir]; cf. pcalinit.ps) AH 02/03/1995 add multiple language support 4.5 AWR 11/15/1994 select gray/RGB independently for dates and fill boxes (cf. pcalinit.ps) 04/05/1994 select real vs. dummy PostScript code within write_psfile() (cf. pcalinit.ps) 11/30/1993 pre-scale all fonts used (as suggested by Andrew Houghton; cf. pcalinit.ps) 11/24/1993 replace find_holidays() with print_colors() (cf. drawnums{} in pcalinit.ps) 11/16/1993 Add set_rgb() to handle red:green:blue values for date/fill colors 09/23/1993 Support both ROMAN-8 and LATIN-8 font mappings AWR 07/09/1993 Revised PostScript comment block AWR 03/01/1993 add optional mapping of 8-bit fonts AWR 02/05/1993 Support -# flag (multiple copies of each output page) AWR 04/22/1992 use STRSIZ for temp buffer size 4.4 AWR 04/07/1992 revise to use new PUTCHAR and PUTSTR macros (cf. pcaldefs.h) 01/20/1992 support -z and revised -[bgGO] flags AWR 01/13/1992 support optional font size in -d and -t flags; move initialization of fonts and sizes here (from pcalinit.ps) 4.3 AWR 12/03/1991 add support for -s flag (specify alternate date/fill box shading values) 4.2 AWR 10/08/1991 add support for -[kK] flags (change position of small calendars) 10/03/1991 add find_noteboxes(); revise to print text in multiple notes boxes add support for -S flag 10/02/1991 modify def_footstring() to handle all types of strings; use it to print notes header (-N flag) 09/19/1991 add write_calfile(), print_dates(), and new print_text() to generate input for Un*x "calendar" utility; renamed old print_text() as print_pstext() for clarity; revised to simplify setting working date 4.11 AWR 08/23/1991 revise expand_fmt() to write results to string instead of stdout; revise print_word() to avoid writing null strings AWR 08/21/1991 use ABBR_DAY_LEN and ABBR_MONTH_LEN (cf. pcallang.h) to print abbreviated day/month names AWR 08/21/1991 add %u and %w (calculate week number so that 1/1 is always week 1); support %[+-][DWMY] to adjust working date by +|- days/weeks/months/years 4.1 AWR 08/16/1991 Support -G flag (outlined gray dates) 4.02 AWR 07/02/1991 Added "%" expansions in text strings (cf. expand_fmt()) 4.0 AWR 01/28/1991 Support -B, -w flags and moon file 01/15/1991 Extracted from pcal.c */ /* --------------------------------------------------------------------------- Header Files */ #include #include #include #include #include "pcaldefs.h" #include "pcallang.h" #include "protos.h" /* Some headers needed for 'user account/real name' (via 'getuid()' etc) in PostScript comments */ #if defined (BUILD_ENV_UNIX) || defined (BUILD_ENV_DJGPP) #include #include #endif /* --------------------------------------------------------------------------- Type, Struct, & Enum Declarations */ /* --------------------------------------------------------------------------- Constant Declarations */ /* suffix for new 8-bit fonts */ #define NEWFONT "-8" /* maximum number of fonts to prescale */ #define MAXFONT 20 /* --------------------------------------------------------------------------- Macro Definitions */ /* make sure printf() doesn't round "ph" up to 1.0 when printing it */ #define PRT_TWEAK(ph) ((ph) >= 0.9995 ? 0.0 : (ph)) /* advance working date by n days */ #define SET_DATE(n) do { \ MAKE_DATE(date, work_month, work_day + (n), work_year); \ normalize(&date); \ work_month = date.mm, work_day = date.dd, work_year = date.yy; \ } while (0) /* prescale a font and add its name to list */ #define ADDFONT(name, size, font, isarray) do { \ char *p = alloc(strlen(name) + strlen(size) + 2); \ sprintf(allfonts[nfonts++] = p, "%s_%s", name, size); \ printf("/%s { %sfontsize ", p, font); \ if (isarray) printf("%s get ", size); \ printf("%sfont FontFind } def\n", font); \ } while (0) /* print PostScript string definition */ #define PRINT_DEF(name, value) do { \ printf("/%s ", name); \ print_word(value); \ printf(" def\n"); \ } while (0) /* add specified number of blank lines to HTML table entry */ #define BLANKLINES(n) do { \ int i; \ for (i = 0; i < n; i++) \ printf("
 "); \ } while(0) #define FOOTSTRINGS() (lfoot[0] || cfoot[0] || rfoot[0]) /* reset working date to original date */ #define RESET_DATE() \ work_month = this_month, work_day = this_day, work_year = this_year /* 'clean' output */ #define PUTCHAR_CLEAN(_fc, _c, _fp) \ fprintf((_fp), "%c", (_c) & CHAR_MSK) #define PUTSTR_CLEAN(_fc, _s, _fp) \ do { char *_p; for (_p = (_s); *_p; _p++) \ PUTCHAR_CLEAN(_fc, *_p, _fp); } while (0) /* --------------------------------------------------------------------------- Data Declarations (including externals) */ /* order of following strings must conform to #define's in pcaldefs.h (q.v.) */ static char *cond[3] = {"false", "true", "(some)"}; static int this_day, this_month, this_year; /* current day */ static int work_day, work_month, work_year; /* working day (cf. expand_fmt()) */ static char *kw_note, *kw_opt, *kw_year; /* keywords for -c output */ static int debug_text; /* generate debug output */ /* --------------------------------------------------------------------------- External Routine References & Function Prototypes */ /* --------------------------------------------------------------------------- ps_prtday_bw Notes: none */ void ps_prtday_bw (void) { printf("%% print 'day' in 'color' (black, gray, outline, or outline-gray; cf. pcaldefs.h)\n"); printf("%% using single value in 'dategray' as gray shade\n"); printf("%%\n"); printf("/prtday { %% black and white version\n"); printf(" gsave\n"); printf(" day 3 string cvs %% convert day to string\n"); printf(" [\n"); printf(" { show } %% black (0)\n"); printf(" { dategray setgray show } %% gray (1)\n"); printf(" { true charpath stroke } %% outline (2)\n"); printf(" { true charpath gsave %% outline-gray (3)\n"); printf(" dategray setgray fill\n"); printf(" grestore stroke }\n"); printf(" ] color get exec %% execute operators for color\n"); printf(" grestore\n"); printf("} bind def\n\n"); return; } /* --------------------------------------------------------------------------- write_psfile Notes: This routine writes the actual PostScript code. The actual output of the PostScript code is straightforward. This routine writes a PostScript header followed by declarations of all the PostScript variables affected by command-line flags and/or language dependencies. It then generates the PostScript boilerplate and finally calls 'print_month()' to generate the PostScript code for each requested month. */ void write_psfile (void) { int i, nfonts, nfsize, copies, dfltsize, color_dates, color_fill; char *p, tmp[STRSIZ], *allfonts[MAXFONT]; char time_str[50]; time_t curr_tyme; #if defined (BUILD_ENV_UNIX) || defined (BUILD_ENV_DJGPP) struct passwd *pw; #endif /* default date, title, weekday font sizes (small/medium/large) */ static int dsize[3] = DATEFONTSIZE; static int tsize[3] = TITLEFONTSIZE; static int wsize[3] = WEEKDAYFONTSIZE; static int fsize[3] = FOOTFONTSIZE; static int dmargin[3] = DATEMARGIN; static double gwidth[3] = GRIDLINEWIDTH; static char *calsize[3] = CALSIZE; debug_text = DEBUG(DEBUG_TEXT); /* debug text output? */ /* * Write out PostScript prolog (including version/datefile stamp) */ /* comment block at top */ printf("%%!%s\n", PS_RELEASE); /* PostScript release */ /* Get the current date/time so that we can write it into the output file as a timestamp... */ time(&curr_tyme); /* It seems that neither MS-DOS (Borland C) nor DOS+DJGPP support the '%P' (lowercase 'am'/'pm') specifier, so we'll use '%p' (uppercase 'AM'/'PM') instead. */ #if defined (BUILD_ENV_MSDOS) || defined (BUILD_ENV_DJGPP) strftime(time_str, sizeof(time_str), "%d %b %Y (%a) %I:%M:%S%p", localtime(&curr_tyme)); #else strftime(time_str, sizeof(time_str), "%d %b %Y (%a) %I:%M:%S%P", localtime(&curr_tyme)); #endif printf("%%%%CreationDate: %s\n", time_str); printf("%%%%Creator: Generated by %s %s (%s)\n", progname, version, PCAL_WEBSITE); /* Generate "For" and "Routing" comments if user name is known... */ #if defined (BUILD_ENV_UNIX) || defined (BUILD_ENV_DJGPP) if ((pw = getpwuid(getuid())) != NULL && strcmp(pw->pw_name, "nobody" /* anonymous account */) != 0) { printf("%%%%For: %s\n", pw->pw_name); #ifdef BUILD_ENV_UNIX /* The 'pw->pw_gecos' element ('real' user name) is not available in MS-DOS or DOS+DJGPP build environments... */ strcpy(tmp, pw->pw_gecos); if ((p = strchr(tmp, ',')) != NULL) *p = '\0'; printf("%%%%Routing: %s\n", tmp); #endif } #endif /* Identify the output (month/year range and input file) */ if (do_whole_year && init_month == JAN) { printf("%%%%Title: calendar for %d", init_year); if (final_year > init_year) printf(" - %d", final_year); } else { char c = date_style == EUR_DATES ? '.' : '/'; printf("%%%%Title: calendar for %02d%c%02d", init_month, c, init_year); if (nmonths > 1) printf(" - %02d%c%02d", final_month, c, final_year); } /* If a configuration file was used, show the file's name... */ if (*datefile) printf(" (from %s)", datefile); printf("\n"); /* Miscellaneous other identification */ printf("%%%%Orientation: %s\n", rotate == LANDSCAPE ? "Landscape" : "Portrait"); printf("%%%%Pages: %d\n", do_whole_year ? nmonths / 12 : nmonths); printf("%%%%PageOrder: Ascend\n"); printf("%%%%BoundingBox: 0 0 %d %d\n", page_dim_short_axis_pts, page_dim_long_axis_pts); printf("%%%%DocumentPaperSizes: %s\n", paper_info[paper_size].name); printf("%%%%ProofMode: NotifyMe\n"); printf("%%%%EndComments\n\n"); /* number of copies (from -# flag) */ if ((copies = ncopy) > MAXCOPY) copies = MAXCOPY; if (copies > 1) printf("/#copies %d def\n", copies); /* paper size (force appropriate tray if known) */ /* The following lines force the printer to select the specified paper tray (Letter or A4, as selected in the Makefile). I (AWR) added it to v4.7 to fix a problem with one particular HP printer configured for both Letter and A4 size paper: under some conditions, previous A4 jobs would leave the printer in A4 mode unless I forced it back to Letter mode. It is probably unnecessary for most users (and is known to confuse some previewers), so #ifdef it out if you like. */ #if 1 strcpy(tmp, paper_info[paper_size].name); tmp[0] = tolower(tmp[0]); printf("statusdict /%stray known { statusdict begin %stray end } if\n", tmp, tmp); #endif /* calendar sizes: to minimize number of pre-scaled fonts, whole- year calendars define 'medium' as 0 and the other sizes as -1 (not used); single-month calendars define 'large' as 0, 'small' as 1, and 'medium' as -1 (not used) */ for (i = SMALL; i <= LARGE; i++) { printf("/%s %d def\n", calsize[i], do_whole_year ? (i == MEDIUM ? 0 : -1) : (i == MEDIUM ? -1 : i == SMALL)); } /* font names and sizes */ /* v4.4 supports user override of note and large date/title sizes */ nfsize = (p = strrchr(notesfont, '/')) ? *p++ = '\0', atoi(p) : atoi(strrchr(NOTESFONT, '/') + 1); dsize[LARGE] = (p = strrchr(datefont, '/')) ? *p++ = '\0', atoi(p) : atoi(strrchr(DATEFONT, '/') + 1); tsize[LARGE] = (p = strrchr(titlefont, '/')) ? *p++ = '\0', atoi(p) : atoi(strrchr(TITLEFONT, '/') + 1); /* enlarge footer strings in whole-year/portrait mode */ if (do_whole_year && rotate == PORTRAIT) { fsize[MEDIUM] = (int)((double)fsize[MEDIUM] * 1.25); } /* if 8-bit remapping has been requested (-r flag), create new fonts with desired character remapping */ if (mapfonts != ENC_NONE) { /* include desired mapping */ switch (mapfonts) { case ENC_LATIN_1: encvec_iso8859_1(); break; case ENC_LATIN_2: encvec_iso8859_2(); break; case ENC_LATIN_3: encvec_iso8859_3(); break; case ENC_LATIN_4: encvec_iso8859_4(); break; case ENC_CYRILLIC: encvec_iso8859_5(); break; case ENC_ARABIC: encvec_iso8859_6(); break; case ENC_GREEK: encvec_iso8859_7(); break; case ENC_HEBREW: encvec_iso8859_8(); break; case ENC_LATIN_5: encvec_iso8859_9(); break; case ENC_LATIN_6: encvec_iso8859_10(); break; case ENC_THAI: encvec_iso8859_11(); break; case ENC_LATIN_7: encvec_iso8859_13(); break; case ENC_LATIN_8: encvec_iso8859_14(); break; case ENC_LATIN_9: encvec_iso8859_15(); break; case ENC_LATIN_10: encvec_iso8859_16(); break; case ENC_KOI8_R: encvec_koi8_r(); break; case ENC_KOI8_U: encvec_koi8_u(); break; case ENC_ROMAN8: encvec_roman8(); break; default: fprintf(stderr, "Unknown language encoding (%d) encountered!\n", mapfonts); break; } /* Boilerplate PostScript code to remap for 8-bit fonts... */ printf("/alt_dict 20 dict def %% Local storage\n"); printf("\n"); printf("%% remap_font => --\n"); printf("%%\n"); printf("%% create remapped font using one of the above 8-bit character remapping tables\n"); printf("%%\n"); printf("/remap_font {\n"); printf(" alt_dict begin\n"); printf(" /newName exch def\n"); printf(" /oldName exch def\n"); printf(" /oldDict oldName findfont def\n"); printf(" /newDict oldDict maxlength dict def\n"); printf(" oldDict {\n"); printf(" exch dup /FID ne {\n"); printf(" dup /Encoding eq {\n"); printf(" exch dup length array copy\n"); printf(" newDict 3 1 roll put\n"); printf(" } {\n"); printf(" exch newDict 3 1 roll put\n"); printf(" } ifelse\n"); printf(" } {\n"); printf(" pop pop\n"); printf(" } ifelse\n"); printf(" } forall\n"); printf(" newDict /FontName newName put\n"); printf(" 0 2 alt_mappings length 1 sub {\n"); printf(" dup\n"); printf(" alt_mappings exch get\n"); printf(" exch 1 add alt_mappings exch get\n"); printf(" newDict /Encoding get 3 1 roll put\n"); printf(" } for\n"); printf(" newName newDict definefont pop\n"); printf(" end\n"); printf("} bind def\n\n"); /* always generate code to remap title font */ printf("/%s /%s%s remap_font\n", titlefont, titlefont, NEWFONT); strcat(titlefont, NEWFONT); #if MAP_DATEFONT /* any text printed in date font (cf. pcaldefs.h)? */ /* generate code to remap date font if necessary */ printf("FontDirectory /%s%s known not {\n", datefont, NEWFONT); printf("/%s /%s%s remap_font\n", datefont, datefont, NEWFONT); printf("} if\n"); strcat(datefont, NEWFONT); #endif /* generate code to remap notes font if necessary */ printf("FontDirectory /%s%s known not {\n", notesfont, NEWFONT); printf("/%s /%s%s remap_font\n", notesfont, notesfont, NEWFONT); printf("} if\n"); strcat(notesfont, NEWFONT); } /* define title, notes, and date fonts */ printf("/titlefont /%s def\n", titlefont); printf("/datefont /%s def\n", datefont); printf("/notesfont /%s def\n", notesfont); /* typically defined in terms of above fonts - must define last */ printf("/weekdayfont %s def\n", WEEKDAYFONT); printf("/footfont %s def\n", FOOTFONT); printf("/headingfont %s def\n", HEADINGFONT); /* print various font sizes and line/margin widths as PostScript arrays: one element for whole-year calendars; two (large, small) for single- month calendars */ if (do_whole_year) { printf("/datemargin [ %d ] def\n", dmargin[MEDIUM]); printf("/gridlinewidth [ %.1f ] def\n", gwidth[MEDIUM]); printf("/titlefontsize [ %d ] def\n", tsize[MEDIUM]); printf("/datefontsize [ %d ] def\n", dsize[MEDIUM]); } else { printf("/datemargin [ %d %d ] def\n", dmargin[LARGE], dmargin[SMALL]); printf("/gridlinewidth [ %.1f %.1f ] def\n", gwidth[LARGE], gwidth[SMALL]); printf("/titlefontsize [ %d %d ] def\n", tsize[LARGE], tsize[SMALL]); printf("/datefontsize [ %d %d ] def\n", dsize[LARGE], dsize[SMALL]); } dfltsize = do_whole_year ? MEDIUM : LARGE; printf("/weekdayfontsize %d def\n", wsize[dfltsize]); printf("/footfontsize %d def\n", fsize[dfltsize]); /* Now that we allow Julian dates to be displayed on yearly-format calendars, we must tweak the font size of the 'notes font' accordingly, since that font is also used to display the Julian dates (if enabled by the user)... */ printf("/notesfontsize %d def\n", do_whole_year ? 24 : nfsize); printf("/headingfontsize %d def\n", HEADINGFONTSIZE); /* pre-scale all fonts used by PostScript code; try to be smart about skipping those that we know (at this point) won't be needed (whole-year calendars use either 3 or 4 fonts, while single-month calendars can use anywhere from 3 to 8). "FF" et. al. are indices into the font array (cf pcalinit.ps) for the different font types. */ printf("/FontFind { findfont exch scalefont } def\n"); nfonts = 0; printf("/FF %d def\n", nfonts); /* footers */ if (FOOTSTRINGS()) ADDFONT("ff", calsize[dfltsize], "foot", FALSE); if (do_whole_year) { printf("/TF %d def\n", nfonts); /* month/year title */ ADDFONT("tf", calsize[MEDIUM], "title", TRUE); printf("/DF %d def\n", nfonts); /* dates */ ADDFONT("df", calsize[MEDIUM], "date", TRUE); } else { printf("/HF %d def\n", nfonts); /* 'Notes' heading */ if (notes_hdr[0]) ADDFONT("hf", calsize[LARGE], "heading", FALSE); /* large/small (if used) scalings of the same font must be * contiguous and appear in that order */ printf("/TF %d def\n", nfonts); /* large/small title */ ADDFONT("tf", calsize[LARGE], "title", TRUE); if (small_cal_pos != SC_NONE) ADDFONT("tf", calsize[SMALL], "title", TRUE); printf("/DF %d def\n", nfonts); /* large/small dates */ ADDFONT("df", calsize[LARGE], "date", TRUE); if (small_cal_pos != SC_NONE) ADDFONT("df", calsize[SMALL], "date", TRUE); } printf("/NF %d def\n", nfonts); /* text for note-boxes and/or Julian dates */ ADDFONT("nf", calsize[LARGE], "notes", FALSE); printf("/WF %d def\n", nfonts); /* weekdays */ ADDFONT("wf", calsize[dfltsize], "weekday", FALSE); /* generate the font array (automatically in sync with above) */ printf("/allfonts [\n\t"); for (i = 0; i < nfonts; i++) { printf("%s ", allfonts[i]); free(allfonts[i]); } printf("\n] def\n"); /* Define various strings and numeric values used by Pcal */ /* month names */ printf("/month_names ["); for (i = JAN; i <= DEC; i++) { printf(i % 6 == 1 ? "\n\t" : " "); (void) print_word(months_ml[output_language][i-1]); } printf(" ] def\n"); /* day names - abbreviate if printing entire year on page */ printf("/day_names ["); for (i = SUN; i <= SAT; i++) { printf((i % 6 == 0 && !do_whole_year) ? "\n\t" : " "); if (do_whole_year) { strcpy(tmp, days_ml_short[output_language][(i + first_day_of_week) % 7]); } else { strcpy(tmp, days_ml[output_language][(i + first_day_of_week) % 7]); } (void) print_word(tmp); } printf(" ] def\n"); /* line separator and font change strings */ PRINT_DEF("linesep", LINE_SEP); PRINT_DEF("boldfont", BOLD_FONT); PRINT_DEF("italicfont", ITALIC_FONT); PRINT_DEF("romanfont", ROMAN_FONT); /* page width and height (always referenced to 'portrait' mode) */ printf("/pagewidth %d def\n", page_dim_short_axis_pts); printf("/pageheight %d def\n", page_dim_long_axis_pts); /* rotation, scaling, and translation factors */ printf("/rval %d def\n", rotate); printf("/xsval %.3f def\n/ysval %.3f def\n", xsval_pgm * xsval_user, ysval_pgm * ysval_user); printf("/xtval %d def\n/ytval %d def\n", xtval_pgm + xtval_user, ytval_pgm + ytval_user); printf("/ytop %d def\n", -TOP_OF_CAL_BOXES_PTS); /* date box dimensions */ printf("/daywidth %d def\n", daybox_width_pts); printf("/dayheight %d def\n", daybox_height_pts); /* moon, Julian date, and box fill flags */ printf("/draw-moons %s def\n", cond[draw_moons]); printf("/julian-dates %s def\n", cond[julian_dates]); printf("/fill-boxes %s def\n", cond[! blank_boxes]); /* position of small calendars */ printf("/prev_small_cal %d def\n", prev_cal_box[small_cal_pos]); printf("/next_small_cal %d def\n", next_cal_box[small_cal_pos]); /* date and fill box shading values */ strcpy(tmp, shading); *(p = strchr(tmp, '/')) = '\0'; printf("/dategray %s def\n", set_rgb(tmp)); color_dates = strchr(tmp, RGB_CHAR) != NULL; printf("/fillgray %s def\n", set_rgb(++p)); color_fill = strchr(p, RGB_CHAR) != NULL; /* PostScript boilerplate (part 1 of 1) */ printf("/Y0 0 def %% Y-coordinate of calendar grid origin\n"); printf("\n"); printf("/gridwidth daywidth 7 mul def\n"); printf("/gridheight dayheight 6 mul def\n"); printf("/negdaywidth daywidth neg def\n"); printf("/negdayheight dayheight neg def\n"); printf("/neggridwidth gridwidth neg def\n"); printf("/neggridheight gridheight neg def\n"); printf("\n"); printf("/textmargin 2 def %% left/right margin for text\n"); printf("/notemargin 4 def %% left/right margin for notes\n"); printf("/charlinewidth 0.1 def %% width of outline characters\n"); printf("\n"); printf("/datewidth 2 array def %% for aligning holiday text\n"); printf("\n"); printf("/moonlinewidth 0.1 def %% width of moon icon line\n"); /* Moon icon radius is actually larger (due to scaling, I suppose) for a yearly-format calendar... */ printf("/radius %d def %% radius of moon icon\n", do_whole_year ? 12 : 6); printf("/halfperiod 0.5 def %% scale factors, etc. used by 'domoon'\n"); printf("/quartperiod 0.25 def\n"); printf("/offset radius datemargin 0 get add def\n"); printf("/rect radius 2 sqrt mul quartperiod div def\n"); printf("\n"); printf("/ROMAN 0 def %% font types for text in boxes\n"); printf("/BOLD 1 def\n"); printf("/ITALIC 2 def\n"); printf("/currfonttype ROMAN def\n"); printf("/boldoffset 0.5 def %% offset for overstriking bold text\n"); printf("\n"); printf("%% simulate Italic text by slanting Roman text - note that this is properly\n"); printf("%% called 'Oblique'\n"); printf("\n"); printf("/italicangle 12 def %% angle for slanting Italic text\n"); printf("/italicmatrix %% Italic font matrix\n"); printf(" [notesfontsize 0 notesfontsize italicangle dup sin exch cos div mul\n"); printf(" notesfontsize 0 0] def\n"); printf("\n"); printf("/hangingindent ( ) def %% for indenting continued text lines\n"); printf("\n"); printf("%% disable duplex mode (if supported)\n"); printf("statusdict (duplexmode) known { statusdict begin false setduplexmode end } if\n"); printf("\n"); printf("%%\n"); printf("%% Utility functions:\n"); printf("%%\n"); printf("\n"); printf("%% FontSet => --\n"); printf("%%\n"); printf("%% set current font to element of 'allfonts' array\n"); printf("%%\n"); printf("/FontSet {\n"); printf(" allfonts exch\n"); printf(" userdict /CurrentFontSet 2 index put\n"); printf(" get setfont\n"); printf("} bind def\n\n"); printf("%% *FontSet => --\n"); printf("%%\n"); printf("%% fetch pre-scaled font (of desired calendar size) from 'allfonts' array\n"); printf("%%\n"); printf("/TitleFontSet {TF add FontSet} bind def\n"); printf("\n"); printf("/DateFontSet {DF add FontSet} bind def\n"); printf("\n"); printf("%% -- *FontSet => --\n"); printf("%%\n"); printf("%% fetch pre-scaled font (of constant size) from 'allfonts' array\n"); printf("%%\n"); printf("/WeekdayFontSet {WF FontSet} bind def\n"); printf("\n"); printf("/FootFontSet {FF FontSet} bind def\n"); printf("\n"); printf("/NotesFontSet {NF FontSet /currfonttype ROMAN def} bind def\n"); printf("\n"); printf("/HeadingFontSet {HF FontSet} bind def\n"); printf("\n"); printf("%% center => --\n"); printf("%%\n"); printf("%% display centered horizontally in \n"); printf("%%\n"); printf("/center {\n"); printf(" 1 index stringwidth pop sub 2 div 0 rmoveto show\n"); printf("} bind def\n\n"); /* These 2 routines ('left' and 'right') were added to support the '-W' option (horizontal alignment of title on monthly-format calendar). */ printf("%% left => --\n"); printf("%%\n"); printf("%% display justified left in \n"); printf("%%\n"); printf("/left {\n"); printf(" 1 index show\n"); printf("} bind def\n\n"); printf("%% right => --\n"); printf("%%\n"); printf("%% display justified right in \n"); printf("%%\n"); printf("/right {\n"); printf(" 1 index stringwidth pop sub 0 rmoveto show\n"); printf("} bind def\n\n"); printf("%% strcat => \n"); printf("%%\n"); printf("%% concatenate and ; push result onto stack\n"); printf("%%\n"); printf("/strcat {\n"); printf(" 2 copy\n"); printf(" length exch length\n"); printf(" dup 3 -1 roll add\n"); printf(" string\n"); printf(" dup 0 6 -1 roll putinterval\n"); printf(" dup 3 -1 roll 4 -1 roll putinterval\n"); printf("} bind def\n\n"); printf("%% -- nextbox => --\n"); printf("%%\n"); printf("%% move to same relative position within following day's box\n"); printf("%%\n"); printf("/nextbox {\n"); printf(" day startbox add 7 mod 0 eq %% end of week?\n"); printf(" { neggridwidth daywidth add negdayheight rmoveto } %% next row\n"); printf(" { daywidth 0 rmoveto } %% next col\n"); printf(" ifelse\n"); printf("} bind def\n\n"); printf("%% boxpos => \n"); printf("%%\n"); printf("%% calculate and push coordinates of upper-left corner of (0..41)\n"); printf("%%\n"); printf("/boxpos {\n"); printf(" dup 7 mod daywidth mul %% x-coord\n"); printf(" exch 7 idiv negdayheight mul Y0 add %% y-coord\n"); printf("} bind def\n\n"); printf("%% datepos => \n"); printf("%%\n"); printf("%% calculate and push coordinates of upper-left corner of box for \n"); printf("%%\n"); printf("/datepos {\n"); printf(" startbox add 1 sub dup 7 mod daywidth mul %% x-coord\n"); printf(" exch 7 idiv negdayheight mul Y0 add %% y-coord\n"); printf("} bind def\n\n"); printf("%%\n"); printf("%% Functions for drawing components of calendar:\n"); printf("%%\n"); printf("%% The point size of a PostScript font includes the descenders on [gjpqy],\n"); printf("%% but the Y-origin for printing text starts above any descenders (at the\n"); printf("%% bottom of the upper-case characters). The following code - and other\n"); printf("%% code concerned with vertical spacing - assumes that the descenders\n"); printf("%% occupy 1/4 of the overall point size.\n\n"); printf("%% -- drawtitle => --\n"); printf("%%\n"); printf("%% print month/year title centered at top of calendar\n"); printf("%%\n"); printf("/drawtitle {\n"); printf(" /fontsize titlefontsize calsize get def\n"); printf(" calsize TitleFontSet\n"); printf(" /month_name month_names month 1 sub get def\n"); printf(" /yearstring year 10 string cvs def\n"); printf(" 0 Y0 fontsize 0.25 mul add\n"); printf(" calsize small eq { 4 } { weekdayfontsize } ifelse\n"); printf(" 1.15 mul add moveto\n"); printf(" month_name ( ) strcat yearstring strcat gridwidth %s\n", title_align); printf("} bind def\n\n"); printf("%% -- drawdaynames => --\n"); printf("%%\n"); printf("%% print weekday names centered above respective columns\n"); printf("%%\n"); printf("/drawdaynames { \n"); printf(" WeekdayFontSet\n"); printf(" 0 1 6 {\n"); printf(" /i exch def\n"); printf(" i daywidth mul Y0 weekdayfontsize 0.4 mul add moveto\n"); printf(" day_names i get\n"); printf(" daywidth center\n"); printf(" } for\n"); printf("} bind def\n\n"); printf("%% -- drawgrid => --\n"); printf("%%\n"); printf("%% draw the grid (6 rows x 7 columns) for the calendar\n"); printf("%%\n"); printf("/drawgrid {\n"); printf(" gridlinewidth calsize get setlinewidth\n"); printf("\n"); printf(" 1 1 6 { %% inner vertical lines\n"); printf(" daywidth mul Y0 moveto\n"); printf(" 0 neggridheight rlineto\n"); printf(" stroke\n"); printf(" } for\n"); printf("\n"); printf(" 1 1 5 { %% inner horizontal lines\n"); printf(" 0 exch negdayheight mul Y0 add moveto\n"); printf(" gridwidth 0 rlineto\n"); printf(" stroke\n"); printf(" } for\n"); printf("\n"); printf(" newpath %% border (w/mitered corners)\n"); printf(" 0 Y0 moveto\n"); printf(" gridwidth 0 rlineto\n"); printf(" 0 neggridheight rlineto\n"); printf(" neggridwidth 0 rlineto\n"); printf(" closepath\n"); printf(" stroke\n"); printf("} bind def\n\n"); printf("%% -- drawnums => --\n"); printf("%%\n"); printf("%% print dates in appropriate boxes of calendar\n"); printf("%%\n"); printf("/drawnums {\n"); printf(" /fontsize datefontsize calsize get def\n"); printf(" /margin datemargin calsize get def\n"); printf(" calsize DateFontSet\n"); printf(" charlinewidth setlinewidth\n"); printf(" 1 datepos fontsize 0.75 mul margin add sub exch margin add exch moveto\n"); printf("\n"); printf(" %% calculate date widths for 'holidaytext' to use; use '2' for all\n"); printf(" %% single-digit dates and '22' for all double-digit dates\n"); printf(" calsize large eq {\n"); printf(" datewidth 0 (2) stringwidth pop margin 2 mul add put\n"); printf(" datewidth 1 (22) stringwidth pop margin 2 mul add put\n"); printf(" } if\n"); printf("\n"); printf(" calsize small eq {\n"); printf(" /color 0 def %% small calendar dates (all black)\n"); printf(" 1 1 ndays {\n"); printf(" /day exch def\n"); printf(" prtday\n"); printf(" nextbox\n"); printf(" } for\n"); printf(" } {\n"); printf(" 1 1 ndays { %% medium/large calendar dates\n"); printf(" /day exch def\n"); printf(" /color date_color day get def\n"); printf(" prtday\n"); printf(" nextbox\n"); printf(" } for\n"); printf(" } ifelse\n"); printf("} bind def\n\n"); printf("%% -- startpage => --\n"); printf("%%\n"); printf("%% initialize new physical page\n"); printf("%%\n"); printf("/startpage {\n"); printf(" rval rotate\n"); printf(" xsval ysval scale\n"); printf(" xtval ytval translate\n"); printf("} bind def\n\n"); printf("%% -- calendar => --\n"); printf("%%\n"); printf("%% draw calendar for 'month'/'year', with various features enabled/disabled\n"); printf("%% according to 'calsize'\n"); printf("%%\n"); printf("/calendar {\n"); printf(" drawtitle %% month/year\n"); printf(" calsize small ne { drawdaynames } if %% weekday names\n"); printf(" calsize large eq { footstrings } if %% footer strings\n"); printf(" drawnums %% dates\n"); /* On yearly-format calendars, eliminate the test 'calsize == large', so that Julian dates get drawn when enabled by user... */ if (do_whole_year) { printf(" julian-dates false ne { drawjnums } if %% Julian dates\n"); } else { printf(" calsize large eq %% Julian dates\n"); printf(" julian-dates false ne and { drawjnums } if\n"); } printf(" fill-boxes { drawfill } if %% fill boxes\n"); printf(" drawgrid %% grid\n"); /* On yearly-format calendars, eliminate the test 'calsize == large', so that moon icons get drawn when enabled by user... */ if (do_whole_year) { printf(" draw-moons false ne { drawmoons } if %% moon icons\n"); } else { printf(" calsize large eq %% moon icons\n"); printf(" draw-moons false ne and { drawmoons } if \n"); } printf(" 0 0 moveto\n"); printf("} bind def\n\n"); /* Additional PostScript code tailored to this calendar */ #ifdef OUTLINE_BLACK /* if OUTLINE_BLACK is defined, include an alternate prtday{} which prints outlined dates (-O) in black instead of the specified color; otherwise use the standard prtday{} */ if (color_dates) { printf("%% print 'day' in 'color' (black, gray, outline, or outline-gray; cf. pcaldefs.h)\n"); printf("%% using three values in 'dategray' as red/green/blue levels; 'gray' will\n"); printf("%% print as solid color, 'outline' as black outline; 'outline-gray' as black\n"); printf("%% outline filled with color\n"); printf("%%\n"); printf("/prtday { %% color version\n"); printf(" gsave\n"); printf(" day 3 string cvs %% convert day to string\n"); printf(" [\n"); printf(" { show } %% black (0)\n"); printf(" { dategray aload pop setrgbcolor show } %% gray (1)\n"); printf(" { true charpath stroke } %% outline (2; black)\n"); printf(" { true charpath gsave %% outline-gray (3)\n"); printf(" dategray aload pop setrgbcolor\n"); printf(" fill grestore stroke }\n"); printf(" ] color get exec %% execute operators for color\n"); printf(" grestore\n"); printf("} bind def\n\n"); } else { ps_prtday_bw(); } #else if (color_dates) { printf("%% print 'day' in 'color' (black, gray, outline, or outline-gray; cf. pcaldefs.h)\n"); printf("%% using three values in 'dategray' as red/green/blue levels; 'gray' will\n"); printf("%% print as solid color, 'outline' as color outline; 'outline-gray' as black\n"); printf("%% outline filled with color\n"); printf("%%\n"); printf("/prtday { %% color version\n"); printf(" gsave\n"); printf(" day 3 string cvs %% convert day to string\n"); printf(" [\n"); printf(" { show } %% black (0)\n"); printf(" { dategray aload pop setrgbcolor show } %% gray (1)\n"); printf(" { dategray aload pop setrgbcolor %% outline (2; color)\n"); printf(" true charpath stroke }\n"); printf(" { true charpath gsave %% outline-gray (3)\n"); printf(" dategray aload pop setrgbcolor\n"); printf(" fill grestore stroke }\n"); printf(" ] color get exec %% execute operators for color\n"); printf(" grestore\n"); printf("} bind def\n\n"); } else { ps_prtday_bw(); } #endif /* pcal will generate the appropriate flavor (B&W or color) of setfill{} depending on the shading values (gray scale or RGB triple) specified by the "-s" flag */ if (color_fill) { printf("%% set fill box color using three values in 'fillgray' as red/green/blue levels\n"); printf("%%\n"); printf("/setfill { %% color version\n"); printf(" fillgray aload pop setrgbcolor\n"); printf("} def\n\n"); } else { printf("%% set fill box shading using single value in 'fillgray'\n"); printf("%%\n"); printf("/setfill { %% black and white version\n"); printf(" fillgray setgray\n"); printf("} def\n\n"); } if (FOOTSTRINGS()) { /* at least one foot string */ printf("%% -- footstrings => --\n"); printf("%%\n"); printf("%% print foot strings ([LCR]footstring) at bottom of page\n"); printf("%%\n"); printf("/footstrings {\n"); printf(" FootFontSet\n"); printf("%% /yfoot { Y0 neggridheight add footfontsize 1.25 mul sub } bind def\n"); printf(" /yfoot { neggridheight 15 sub } bind def\n"); printf(" 0 yfoot moveto\n"); printf(" Lfootstring show\n"); printf(" gridwidth Rfootstring stringwidth pop sub yfoot moveto\n"); printf(" Rfootstring show\n"); printf(" 0 yfoot moveto\n"); printf(" Cfootstring gridwidth center\n"); printf("} bind def\n\n"); } else { /* no foot strings */ printf("/footstrings {} bind def\n\n"); } if (blank_boxes) { /* blank fill boxes */ printf("/drawfill {} bind def\n\n"); } else { /* shaded fill boxes */ printf("%% fillboxes => --\n"); printf("%%\n"); printf("%% fill empty calendar boxes in range .. (0..41)\n"); printf("%%\n"); printf("/fillboxes {\n"); printf(" /last exch def\n"); printf(" /first exch def\n"); printf("\n"); printf(" first 1 last { %% loop through range of boxes\n"); printf(" /box exch def\n"); printf(" /fillit true def\n"); printf(" calsize large eq { %% skip note and small calendar boxes\n"); printf(" noteboxes { box eq { /fillit false def } if } forall\n"); printf(" box prev_small_cal eq box next_small_cal eq or {\n"); printf(" /fillit false def\n"); printf(" } if\n"); printf(" } if\n"); printf(" fillit { %% move to position and fill the box\n"); printf(" box boxpos moveto\n"); printf(" gsave\n"); printf(" setfill\n"); printf(" daywidth 0 rlineto\n"); printf(" 0 negdayheight rlineto\n"); printf(" negdaywidth 0 rlineto\n"); printf(" closepath fill\n"); printf(" grestore\n"); printf(" } if\n"); printf(" } for\n"); printf("} bind def\n\n"); printf("%% -- drawfill => --\n"); printf("%%\n"); printf("%% fill in unused boxes before and after calendar dates\n"); printf("%%\n"); printf("/drawfill {\n"); printf(" 0 startbox 1 sub fillboxes %% fill boxes before calendar\n"); printf(" startbox ndays add 41 fillboxes %% fill boxes after calendar\n"); printf("} bind def\n\n"); } if (do_whole_year) { if (rotate == LANDSCAPE) { /* medium months (landscape) */ printf("/hspace gridwidth daywidth add def %% one date box space between calendars\n"); printf("/hscale 0.2258 def %% 1 / (4 + 3/7)\n"); printf("/vspace gridheight ytop add 135 add neg def %% vertical spacing\n"); printf("/vscale .25 def %% beats me how this was calculated\n"); printf("\n"); printf("/printmonth {\n"); printf(" /calsize medium def\n"); printf("\n"); printf(" posn 0 eq { %% assume first month printed on page is posn 0\n"); printf(" startpage\n"); printf(" footstrings\n"); printf(" } if\n"); printf("\n"); printf(" gsave %% draw medium calendar at selected position\n"); printf(" hscale vscale scale %% landscape mode - 3 rows, 4 cols\n"); printf(" posn 4 mod hspace mul\n"); printf(" posn 4 idiv vspace mul 45 add\n"); printf(" translate\n"); printf(" calendar\n"); printf(" grestore\n"); printf("} bind def\n\n"); } else { /* medium months (portrait) */ printf("/hspace gridwidth daywidth add def %% one date box space between calendars\n"); printf("/hscale 0.3043 def %% 1 / (3 + 2/7)\n"); printf("/vspace gridheight ytop add 135 add neg def %% vertical spacing\n"); printf("/vscale .194 def %% beats me how this was calculated\n"); printf("\n"); printf("/printmonth { \n"); printf(" /calsize medium def\n"); printf("\n"); printf(" posn 0 eq { %% assume first month printed on page is posn 0\n"); printf(" gsave %% print foot strings at original scale\n"); printf(" startpage\n"); printf(" 0 25 translate %% reposition footstrings slightly higher\n"); printf(" footstrings\n"); printf(" grestore\n"); printf("\n"); printf(" /sv_ysval ysval def %% re-scale Y axis to full page height\n"); printf(" /ysval xsval pageheight pagewidth div dup mul mul def\n"); printf(" startpage\n"); printf(" /ysval sv_ysval def\n"); printf(" } if\n"); printf("\n"); printf(" gsave %% draw medium calendar at selected position\n"); printf(" hscale vscale scale %% portrait mode - 4 rows, 3 cols\n"); printf(" posn 3 mod hspace mul\n"); printf(" posn 3 idiv vspace mul 155 add\n"); printf(" translate\n"); printf(" calendar\n"); printf(" grestore\n"); printf("} bind def\n\n"); } } else { if (head) { /* date text */ printf("%%\n"); printf("%% Functions for printing text (and/or images) inside boxes:\n"); printf("%%\n"); printf("\n"); printf("%% daytext => --\n"); printf("%%\n"); printf("%% print in box (below date)\n"); printf("%%\n"); printf("/daytext {\n"); printf(" /mytext exch def /day exch def\n"); printf(" NotesFontSet\n"); printf(" day datepos datefontsize large get 0.75 mul datemargin large get\n"); printf(" 2 mul add notesfontsize 0.75 mul add sub dup\n"); printf(" /ypos exch def exch textmargin add exch moveto\n"); printf(" currentpoint pop /LM exch def\n"); printf(" /RM LM daywidth textmargin 2 mul sub add def\n"); printf(" showtext\n"); printf("} bind def\n\n"); printf("%% holidaytext => --\n"); printf("%%\n"); printf("%% print in box (to right of date)\n"); printf("%%\n"); printf("/holidaytext {\n"); printf(" /mytext exch def /day exch def\n"); printf("\n"); printf(" /datesize datefontsize large get def \n"); printf(" /margin datemargin large get def\n"); printf(" /dwidth datewidth day 10 lt { 0 } { 1 } ifelse get def\n"); printf("\n"); printf(" %% display the text between the date and the moon icon (if any)\n"); printf(" NotesFontSet\n"); printf(" day datepos margin notesfontsize 0.75 mul add sub dup\n"); printf(" /ypos exch def exch dwidth add exch moveto\n"); printf(" currentpoint pop /LM exch def\n"); printf(" /mwidth do-moon-p {offset radius add} {0} ifelse def %% moon width\n"); printf(" /RM LM daywidth textmargin sub dwidth mwidth add sub add def\n"); printf(" showtext\n"); printf("} bind def\n\n"); printf("%% notetext => --\n"); printf("%%\n"); printf("%% print notes heading (if any) and in (0..41)\n"); printf("%%\n"); printf("/notetext {\n"); printf(" /mytext exch def /box exch def\n"); printf("\n"); printf(" %% skip notes box heading if null\n"); printf(" notesheading () eq {\n"); printf(" box boxpos notemargin notesfontsize 0.75 mul add sub dup\n"); printf(" } {\n"); printf(" box boxpos notemargin headingfontsize 0.75 mul add sub exch\n"); printf(" notemargin add exch moveto\n"); printf(" HeadingFontSet\n"); printf(" notesheading show\n"); printf(" box boxpos notemargin headingfontsize add\n"); printf(" notesfontsize add sub dup\n"); printf(" } ifelse\n"); printf(" /ypos exch def exch notemargin add exch moveto\n"); printf("\n"); printf(" %% display the notes text\n"); printf(" NotesFontSet\n"); printf(" /LM currentpoint pop def\n"); printf(" /RM LM daywidth notemargin 2 mul sub add def\n"); printf(" showtext\n"); printf("} bind def\n\n"); printf("%% -- crlf => --\n"); printf("%%\n"); printf("%% simulate carriage return/line feed sequence\n"); printf("%%\n"); printf("/crlf {\n"); printf(" ypos notesfontsize sub /ypos exch def LM ypos moveto\n"); printf("} bind def\n\n"); printf("%% prstr => --\n"); printf("%%\n"); printf("%% print on current line if possible; otherwise print on next line\n"); printf("%%\n"); printf("/prstr {\n"); printf(" gsave %% in case rescaling is necessary\n"); printf(" dup stringwidth pop currentpoint pop add RM gt { %% too wide?\n"); printf(" %% move to the next line (unless this is the initial word)\n"); printf(" currentpoint pop LM ne {\n"); printf(" crlf hangingindent show\n"); printf(" } if\n"); printf(" %% rescale in X dimension as necessary to make word fit\n"); printf(" dup stringwidth pop RM currentpoint pop sub gt {\n"); printf(" dup stringwidth pop RM currentpoint pop sub exch div 1\n"); printf(" scale\n"); printf(" } if\n"); printf(" } if\n"); printf(" currfonttype BOLD eq\n"); printf(" { dup currentpoint 2 index show exch 0.5 add exch moveto show }\n"); printf(" { show }\n"); printf(" ifelse\n"); printf(" currentpoint grestore moveto %% grestore alone would reset position\n"); printf("} bind def\n\n"); printf("%% -- showtext => --\n"); printf("%%\n"); printf("%% print words in 'mytext', inserting line breaks where necessary (or requested)\n"); printf("%%\n"); printf("/showtext {\n"); printf(" mytext {\n"); printf(" /word exch def\n"); printf(" /i 1 def\n"); printf(" /n 0 def\n"); printf("\n"); printf(" %% look up current word in list of special formatting strings\n"); printf(" [ linesep boldfont italicfont romanfont ] {\n"); printf(" word eq {\n"); printf(" /n i def\n"); printf(" } if\n"); printf(" /i i 1 add def\n"); printf(" } forall\n"); printf(" \n"); printf(" %% n will be 0 if current word is an ordinary word, 1..4 if it\n"); printf(" %% is a formatting string; execute corresponding block of code\n"); printf(" [\n"); printf(" { word prstr ( ) show } %% ordinary word\n"); printf("\n"); printf(" { crlf %% line separator (.p)\n"); printf(" NotesFontSet } %% reset font type\n"); printf("\n"); printf(" { NotesFontSet %% font => bold (.b)\n"); printf(" /currfonttype BOLD def }\n"); printf("\n"); printf(" { /currfonttype ITALIC def %% font => italic (.i)\n"); printf(" notesfont findfont italicmatrix makefont setfont }\n"); printf("\n"); printf(" { NotesFontSet } %% font => roman (.r)\n"); printf(" ] n get exec\n"); printf(" } forall\n"); printf("} bind def\n\n"); printf("%% epsimage => --\n"); printf("%%\n"); printf("%% print image in box (below date)\n"); printf("%%\n"); printf("/epsimage {\n"); printf(" /yoffset exch def /xoffset exch def\n"); printf(" /yscale exch def /xscale exch def\n"); printf(" /myimage exch def /mytext exch def /day exch def\n"); printf(" NotesFontSet\n"); printf(" day datepos datefontsize large get 0.75 mul datemargin large get\n"); printf(" 2 mul add\n"); printf(" sub dup\n"); printf(" /ypos exch def exch textmargin add exch\n"); printf(" moveto\n"); printf(" currentpoint\n"); printf(" \n"); printf(" gsave\n"); printf(" yoffset add exch xoffset add exch %% add the X,Y offsets\n"); printf(" translate\n"); printf(" xscale yscale scale\n"); printf("\n"); printf(" %% \n"); printf(" %% Temporarily redefine the 'showpage' operator to null so that it's\n"); printf(" %% ignored when the EPS image file is processed...\n"); printf(" %%\n"); printf(" 1 dict begin /showpage { } bind def\n"); printf(" myimage run\n"); printf(" end\n"); printf(" \n"); printf(" grestore\n"); printf("} bind def\n\n"); } /* single month */ printf("%% -- printmonth => --\n"); printf("%%\n"); printf("%% print full-size calendar for 'month'/'year' on single page\n"); printf("%%\n"); printf("/printmonth {\n"); printf(" /calsize large def\n"); printf(" startpage\n"); printf(" calendar\n"); printf(" printsmallcals %% small calendars\n"); printf(" \n"); printf("} bind def\n\n"); printf("%% scale factor (slightly < 1/7) and offset for printing small calendars\n"); printf("/scscale .138 def\n"); printf("/scoffset gridwidth gridwidth scscale 7 mul mul sub 2.0 div def\n"); printf("\n"); printf("%% -- printsmallcals => --\n"); printf("%%\n"); printf("%% print small calendars in boxes 'prev_small_cal' and 'next_small_cal'\n"); printf("%%\n"); printf("/printsmallcals {\n"); printf(" /calsize small def\n"); printf(" /sv_startbox startbox def\n"); printf("\n"); printf(" prev_small_cal 0 ge { %% previous month/year\n"); printf(" /year p_year def\n"); printf(" /month p_month def\n"); printf(" /startbox p_startbox def\n"); printf(" /ndays p_ndays def\n"); printf(" gsave\n"); printf(" prev_small_cal boxpos translate\n"); printf(" scscale dup scale\n"); printf(" scoffset ytop neg translate\n"); printf(" calendar\n"); printf(" grestore\n"); printf(" } if\n"); printf("\n"); printf(" next_small_cal 0 ge { %% next month/year\n"); printf(" /year n_year def\n"); printf(" /month n_month def\n"); printf(" /startbox n_startbox def\n"); printf(" /ndays n_ndays def\n"); printf(" gsave\n"); printf(" next_small_cal boxpos translate\n"); printf(" scscale dup scale\n"); printf(" scoffset ytop neg translate\n"); printf(" calendar\n"); printf(" grestore\n"); printf(" } if\n"); printf("\n"); printf(" /startbox sv_startbox def %% required for text boxes\n"); printf("} bind def\n\n"); } if (julian_dates == NO_JULIANS) { /* no julian dates */ printf("/drawjnums {} bind def\n\n"); } else { /* some julian dates */ printf("%% -- drawjnums => --\n"); printf("%%\n"); printf("%% print day-of-year (and, optionally, days remaining) for each date\n"); printf("%%\n"); printf("/drawjnums {\n"); printf(" NotesFontSet\n"); printf(" 1 datepos dayheight 3 sub sub exch daywidth 3 sub add exch moveto\n"); printf("\n"); printf(" 1 1 ndays {\n"); printf(" /day exch def\n"); printf(" /jday jdstart day add 1 sub def\n"); printf(" /str jday 3 string cvs def\n"); printf(" julian-dates true eq { %% print days left in year?\n"); printf(" /str str ( \\050) strcat yearlen jday sub 3 string cvs\n"); printf(" strcat (\\051) strcat def\n"); printf(" } if\n"); printf(" gsave\n"); printf(" str dup stringwidth pop 0 exch sub 0 rmoveto show\n"); printf(" grestore\n"); printf(" nextbox\n"); printf(" } for\n"); printf("} bind def\n\n"); } if (draw_moons == NO_MOONS) { /* no moons */ printf("/do-moon-p { false } bind def\n"); printf("/drawmoons {} bind def\n\n"); } else { /* moons on some or all days */ printf("%%\n"); printf("%% Moon-drawing functions:\n"); printf("%%\n\n"); printf("%% domoon => --\n"); printf("%%\n"); printf("%% draw icon showing moon at (0 = new; .25 = fq; .5 = full; .75 = lq)\n"); printf("%%\n"); printf("/domoon {\n"); printf(" /phase exch def\n"); printf("\n"); printf(" gsave\n"); printf(" currentpoint translate\n"); printf(" newpath\n"); printf("\n"); printf(" %% if moon is full, just draw unfilled circle\n"); printf("\n"); printf(" phase halfperiod .01 sub ge phase halfperiod .01 add le and {\n"); printf(" 0 0 radius\n"); printf(" 0 360 arc stroke\n"); printf(" }\n"); printf(" {\n"); printf(" %% draw the line arc now; prepare (but don't draw) the fill arc\n"); printf("\n"); printf(" 0 0 radius %% for line and fill arcs\n"); printf(" 0 0 radius \n"); printf(" phase halfperiod lt { %% phase between new and full\n"); printf(" 270 90 arc stroke %% (line on right, fill on left)\n"); printf(" 0 radius neg moveto\n"); printf(" 270 90 arcn \n"); printf(" }\n"); printf(" { %% phase between full and new\n"); printf(" 90 270 arc stroke %% (line on left, fill on right)\n"); printf(" 0 radius neg moveto\n"); printf(" 270 90 arc \n"); printf(" /phase phase halfperiod sub def\n"); printf(" } ifelse\n"); printf("\n"); printf(" %% curveto uses (x0,y0) [current point], (x1,y1), (x2,y2),\n"); printf(" %% and (x3,y3) as the control points for drawing a Bezier\n"); printf(" %% cubic section, used here as the curve dividing the moon\n"); printf(" %% icon into dark and light sections. x1 is in the range\n"); printf(" %% -R*sqrt(2) <= x1 <= R*sqrt(2) and y1 is in the range\n"); printf(" %% 0 <= y1 <= R; note that except in the degenerate case\n"); printf(" %% where x1 = y1 = x2 = y2 = 0, the curve does not actually\n"); printf(" %% pass through (x1,y1) or (x2,y2).\n"); printf("\n"); printf(" /x1 quartperiod phase sub rect mul def\n"); printf(" /y1 x1 abs 2 sqrt div def\n"); printf("\n"); printf(" %% push control points for curveto\n"); printf("\n"); printf(" %% x0 = 0 (current\n"); printf(" %% y0 = R point)\n"); printf(" x1 %% x1\n"); printf(" y1 %% y1\n"); printf(" x1 %% x2 = x1\n"); printf(" y1 neg %% y2 = -y1\n"); printf(" 0 %% x3 = 0\n"); printf(" radius neg %% y3 = -R\n"); printf("\n"); printf(" %% draw Bezier curve; fill area between curve and fill arc\n"); printf("\n"); printf(" curveto\n"); printf(" fill\n"); printf(" } ifelse\n"); printf("\n"); printf(" grestore\n"); printf("} bind def\n\n"); printf("%% -- do-moon-p => \n"); printf("%%\n"); printf("%% determine whether or not moon icon is to be drawn on 'day'; push result\n"); printf("%%\n"); printf("/do-moon-p {\n"); printf(" draw-moons (some) eq { %% printing quarter moons? look up day\n"); printf(" /p false def\n"); printf(" quarter_moons { day eq { /p true def } if } forall\n"); printf(" p\n"); printf(" }\n"); printf(" {\n"); printf(" draw-moons %% all moons or no moons\n"); printf(" } ifelse\n"); printf("} bind def\n\n"); printf("%% -- drawmoons => --\n"); printf("%%\n"); printf("%% main routine to draw moon icons on calendar\n"); printf("%%\n"); printf("/drawmoons {\n"); printf(" gsave\n"); printf(" moonlinewidth setlinewidth\n"); printf(" 1 datepos offset sub exch daywidth add offset sub exch moveto\n"); printf(" /n 0 def %% index into moon_phases\n"); printf(" 1 1 ndays {\n"); printf(" /day exch def\n"); printf(" do-moon-p { %% draw a moon today?\n"); printf(" moon_phases n get domoon\n"); printf(" /n n 1 add def\n"); printf(" } if\n"); printf(" nextbox\n"); printf(" } for\n"); printf(" grestore\n"); printf("} bind def\n\n"); } /* Write out PostScript code to print calendars... */ for (i = 0, this_month = init_month, this_year = init_year; i < nmonths; i++, BUMP_MONTH_AND_YEAR(this_month, this_year)) { print_month(this_month, this_year); } #ifdef EPS_DSC /* generate trailer at end of PostScript output */ printf("%%%%Trailer\n"); printf("clear flush\n"); printf("%%%%EOF\n"); #endif return; } /* --------------------------------------------------------------------------- write_calfile Notes: This routine writes dates in a format suitable for the old Unix "calendar" utility (and subsequent use by Pcal). */ void write_calfile (void) { KWD *k; int i; /* look up the Pcal keywords (assumed present) for the -c output file */ for (k = keywds; k->name; k++) { if (k->code == DT_NOTE) kw_note = k->name; if (k->code == DT_OPT) kw_opt = k->name; if (k->code == DT_YEAR) kw_year = k->name; } /* print the date style for subsequent use by Pcal */ printf("%s -%c\n", kw_opt, date_style == USA_DATES ? F_USA_DATES : F_EUR_DATES); for (i = 0, this_month = init_month, this_year = init_year; i < nmonths; i++, BUMP_MONTH_AND_YEAR(this_month, this_year)) { print_dates(this_month, this_year); } return; } /* --------------------------------------------------------------------------- single_month_html Notes: This routine prints the specified month and year as an HTML table. */ void single_month_html (int this_month, int this_year) { long holidays; int day, box, len; year_info *py; month_info *pm; register day_info *pd; /* table heading with month and year */ printf("\n", this_month, this_year % 100); printf("\n", BORDER); printf("\n", this_year, MONTHYEAR_POST); /* headings for weekday names */ printf(""); for (day = 0; day < 7; day++) { char buf[40]; strcpy(buf, days_ml[output_language][(day + first_day_of_week) % 7]); /* buf[ABBR_MONTH_LEN] = '\0'; */ printf(""); } printf("\n"); /* blank space at beginning (if necessary) - divide into N one-column * boxes (#if DIVIDE_BLANK_SPACE) or print as single N-column box */ printf("\n"); if ((box = START_BOX(this_month, this_year)) > 0) { #if DIVIDE_BLANK_SPACE int i; for (i = 0; i < box; i++) { printf("\n"); } #else printf("\n"); #endif } /* get pointer to text information for current month */ pm = (py = find_year(this_year, FALSE)) != NULL ? py->month[this_month-1] : NULL; /* main loop for dates */ len = LENGTH_OF(this_month, this_year); for (day = 1, holidays = pm ? pm->holidays : 0; day <= len; day++, box++, holidays >>= 1) { int nrows; if (box > 0 && box % 7 == 0) printf("\n"); /* start of row */ printf("\n"); if (box % 7 == 6) printf("\n"); /* end of row */ } /* blank space at end (if necessary) - divide into N one-column * boxes (#if DIVIDE_BLANK_SPACE) or print as single N-column box */ if ((box %= 7) != 0) { #if DIVIDE_BLANK_SPACE int i; for (i = box; i < 7; i++) { printf("\n"); } #else printf("\n"); #endif } printf("\n"); printf("
%s", MONTHYEAR_PRE); print_html(months_ml[output_language][this_month-1]); printf(" %d%s
"); print_html(buf); printf("
"); BLANKLINES(TEXTLINES); printf("", box); BLANKLINES(TEXTLINES); printf("
"); /* special HTML code for holidays (cf. pcaldefs.h) */ if (holidays & 01) printf("%s%d%s", HOLIDAY_PRE, day, HOLIDAY_POST); else printf("%d", day); /* print associated text (count lines) */ for (nrows = 0, pd = pm ? pm->day[day-1] : NULL; pd; pd = pd->next, nrows++) { /* Skip lines specifying an EPS image... */ if (ci_strncmp(pd->text, "image:", 6) == 0) continue; printf("\n
"); this_day = day; RESET_DATE(); /* reset working date */ print_html(pd->text); } /* pad first box in each row with blank lines */ if (box % 7 == 0 && nrows < TEXTLINES) BLANKLINES(TEXTLINES - nrows); printf("
"); BLANKLINES(TEXTLINES); printf("", 7 - box); BLANKLINES(TEXTLINES); printf("
\n"); /* links to other months on page */ if (nmonths > 2) { int j, m, y; char c = date_style == EUR_DATES ? '.' : '/'; printf("

"); for (j = 0, m = init_month, y = init_year; j < nmonths; j++, BUMP_MONTH_AND_YEAR(m, y)) { printf("%02d%c%02d%s\n", m, y % 100, m, c, y % 100, j % 12 == 11 ? "
" : " "); } } return; } /* --------------------------------------------------------------------------- single_month_one_column_html Notes: This routine prints the specified month and year as an HTML table in one column. */ void single_month_one_column_html (int this_month, int this_year) { long holidays; int day, box = 0, len, i; year_info *py; month_info *pm; register day_info *pd; char *text_short; /* table heading with first 5 chars of the month */ printf("\n", BORDER); printf("\n", months_ml[output_language][this_month-1]); /* get pointer to text information for current month */ pm = (py = find_year(this_year, FALSE)) != NULL ? py->month[this_month-1] : NULL; /* main loop for dates */ len = LENGTH_OF(this_month, this_year); for (day = 1, holidays = pm ? pm->holidays : 0; day <= len; day++, box++, holidays >>= 1) { int nrows; /* print only one column for the month */ printf("\n"); printf("\n"); if (box % 7 == 6) printf("\n"); /* end of row */ } printf("\n"); printf("
%s
"); /* special HTML code for holidays (cf. pcaldefs.h) */ if (holidays & 01) { printf("%s%d%s %c", HOLIDAY_PRE, day, HOLIDAY_POST, days_ml[output_language][(day + START_BOX(this_month, this_year) + first_day_of_week - 1) % 7][0]); } else { /* print Sundays in bold */ if ((day + START_BOX(this_month, this_year) + first_day_of_week - 1) % 7 == 0) { printf("%d %c", day, days_ml[output_language][(day + START_BOX(this_month, this_year) + first_day_of_week - 1) % 7][0]); } /* print Saturdays in gray */ else if ((day + START_BOX(this_month, this_year) + first_day_of_week - 1) % 7 == 6) { printf("%d %c", day, days_ml[output_language][(day + START_BOX(this_month, this_year) + first_day_of_week - 1) % 7][0]); } else { printf("%d %c", day, days_ml[output_language] [(day + START_BOX(this_month, this_year) + first_day_of_week - 1) % 7][0]); } /* print associated text (count lines), not for holidays */ for (nrows = 0, pd = pm ? pm->day[day-1] : NULL; pd; pd = pd->next, nrows++) { /* Skip lines specifying an EPS image... */ if (ci_strncmp(pd->text, "image:", 6) == 0) continue; printf("\n"); this_day = day; RESET_DATE(); /* reset working date */ text_short = pd->text; for (i=0; i < 5; i++) { if (text_short[i] == '\0') break; /* if text starts with < it is probably an HTML tag (e.g. ) -> skip three letters */ if(text_short[0] == '<' && text_short[i+3] == '\0') break; if(text_short[0] == '<') printf("%c",text_short[i+3]); else printf("%c",text_short[i]); } printf("\n"); } } /* TR-tag to end the row */ printf("
\n"); return; } /* --------------------------------------------------------------------------- multiple_months_html Notes: This routine prints an HTML table in 'ncols' (assumed to be either 3 or 4) columns, one column per month starting with the specified month and year. */ void multiple_months_html (int first_month, int first_year, int ncols) { long holidays; int day, box, len; year_info *py; month_info *pm; int i, m, d, y, w, wd1, wd2, nw; /* width of dates and spaces between months */ wd1 = 12 / ncols; wd2 = (100 - (ncols * (7 * wd1))) / (ncols - 1); /* table heading with months and year */ printf("\n", 0); printf(""); for (i = 0, m = first_month, y = first_year; i < ncols; i++, BUMP_MONTH_AND_YEAR(m, y)) { if (i > 0) printf(""); printf("\n", y, MONTHYEAR_W_POST); } printf("\n"); /* headings for weekday names */ printf(""); for (i = 0; i < ncols; i++) { if (i > 0) printf("\n", wd2); for (day = 0; day < 7; day++) { char buf[40]; strcpy(buf, days_ml[output_language][(day + first_day_of_week) % 7]); #if 0 buf[ncols == 3 ? 3 : 2] = '\0'; #else buf[2] = '\0'; /* truncate to two characters */ #endif printf(""); } } printf("\n"); #ifdef CONSISTENT_SPACING /* always print 6 weeks (to maintain consistent vertical spacing) */ nw = 6; #else /* print 5 weeks unless at least one month requires a sixth week */ nw = 5; for (i = 0, m = first_month, y = first_year; i < ncols; i++, BUMP_MONTH_AND_YEAR(m, y)) { if (START_BOX(m, y) + LENGTH_OF(m, y) > 35) nw = 6; } #endif /* main loop to print dates (one week at a time) */ for (w = 0; w < nw; w++) { printf(""); /* print one week of dates for each month */ for (i = 0, m = first_month, y = first_year; i < ncols; i++, BUMP_MONTH_AND_YEAR(m, y)) { if (i > 0) printf(""); /* get starting box, month length, holiday info */ box = START_BOX(m, y); len = LENGTH_OF(m, y); pm = (py = find_year(y, FALSE)) != NULL ? py->month[m-1] : NULL; holidays = pm ? pm->holidays : 0; /* loop over days in current week and month */ for (d = 1; d <= 7; d++) { day = (7 * w) + d - box; if (day < 1 || day > len) printf(""); else { printf(""); } } } printf("\n"); } /* end of table */ printf("

%s", MONTHYEAR_W_PRE); print_html(months_ml[output_language][m-1]); printf(" %d%s

", wd1); print_html(buf); printf("


"); if (holidays & (1L << (day - 1))) { printf("%s%d%s", HOLIDAY_PRE, day, HOLIDAY_POST); } else printf("%d", day); printf("
\n"); return; } /* --------------------------------------------------------------------------- write_htmlfile Notes: This routine generates a calendar in HTML format. */ void write_htmlfile (void) { int i; static struct { char *attribute; /* attribute name */ char *value; /* attribute value */ int numeric; /* TRUE if value is numeric */ } *pb, body_attributes[] = { /* cf. pcaldefs.h */ { "bgcolor", BGCOLOR, TRUE }, { "background", BACKGROUND, FALSE }, { "text", TEXT, TRUE }, { "link", LINK, TRUE }, { "alink", ALINK, TRUE }, { "vlink", VLINK, TRUE }, { NULL, NULL, FALSE } /* must be last */ }; this_day = 1; /* initialize working date */ this_month = init_month; this_year = init_year; RESET_DATE(); /* HTML boilerplate */ printf("\n"); printf("\n"); /* * if center footstring (-C) was specified, use it as the title; * otherwise contrive title from beginning/ending month/year */ printf(""); if (cfoot[0]) { print_html(cfoot); } else { if (do_whole_year && init_month == JAN) { printf("%d", init_year); if (final_year > init_year) printf(" - %d", final_year); } else { char c = date_style == EUR_DATES ? '.' : '/'; printf("%d%c%02d", init_month, c, init_year % 100); if (nmonths > 1) { printf(" - %d%c%02d", final_month, c, final_year % 100); } } } printf("\n"); printf("\n"); /* generate definition with attributes */ printf("attribute; pb++) { char *p = pb->value; if (p && *p) { printf(" %s=%s%s\"", pb->attribute, pb->numeric && p[0] != '#' ? "\"#" : "\"", pb->value); } } printf(">\n"); /* repeat center footstring (if specified) as heading */ if (cfoot[0]) { RESET_DATE(); printf("%s", HEADING_PRE); print_html(cfoot); printf("%s\n", HEADING_POST); } /* loop over all specified months, creating HTML table for each */ this_month = init_month; this_year = init_year; if (do_whole_year) { /* whole-year mode - generate 3- or 4-column tables */ int j, nc; nc = (rotate == LANDSCAPE) ? 4 : 3; for (i = 0; i < nmonths; i += nc) { if (i > 0) printf("

\n"); multiple_months_html(this_month, this_year, nc); for (j = 0; j < nc; j++) BUMP_MONTH_AND_YEAR(this_month, this_year); } } else { /* single-month mode - generate one month per table * either in one or several columns */ if (one_column) printf(""); for (i = 0; i < nmonths; i++) { if (one_column) { printf(""); } else { printf("
"); single_month_one_column_html(this_month, this_year); printf("",100/nmonths); if (i > 0) printf("


\n"); single_month_html(this_month, this_year); } BUMP_MONTH_AND_YEAR(this_month, this_year); } printf("

"); } /* boilerplate to terminate HTML file */ printf("\n"); printf("\n"); return; } /* * low-level utilities for PostScript generation */ /* --------------------------------------------------------------------------- set_rgb Notes: This routine converts "::" to [r g b] or "" to gray. It returns a pointer to a static buffer containing the converted string. */ char *set_rgb (char *s) { static char buf[STRSIZ]; char *p1, *p2; double val[3]; int n; val[0] = val[1] = val[2] = 0; /* defaults */ /* extract 1 - 3 floating-point values from string */ for (n = 1, p1 = s; n <= 3; n++, p1 = p2 + 1) { val[n-1] = atof(p1); if ((p2 = strchr(p1, RGB_CHAR)) == NULL) break; } /* single value is gray scale; assume anything else is [r g b] */ if (n > 1) sprintf(buf, "[%.3f %.3f %.3f]", val[0], val[1], val[2]); else sprintf(buf, "%.3f", val[0]); return buf; } /* --------------------------------------------------------------------------- select_color Notes: This routine chooses a color which contrasts with the majority of weekday colors, if the holiday color has not been explicitly selected. */ int select_color (void) { int i, min, index = BLACK; char count[NUM_COLORS]; for (i = 0; i < NUM_COLORS; i++) { /* clear counts */ count[i] = 0; } for (i = SUN; i <= SAT; i++) { /* count colors */ count[(int)day_color[i]]++; } /* find smallest non-zero count; set its index and value */ for (i = 0, min = 99; i < NUM_COLORS; i++) { if (count[i] && count[i] < min) min = count[index = i]; } /* return least-used color (or pick one if only one color used) */ return min == 7 ? index == BLACK ? GRAY : BLACK : index; } /* --------------------------------------------------------------------------- ordinal_suffix Notes: This routine translates the %o (ordinal suffix) format specifier into the appropriate string for printing. The parameter is an ordinal number, assumed positive. */ char *ordinal_suffix (int num) { static char buf[10]; int tens, units; /* Select suffix according to rules for target language. In English, the rules are as follows: tens digit units digit suffix (any) 0, 4..9 "th" 1 (any) "th" != 1 1 "st" != 1 2 "nd" != 1 3 "rd" */ tens = (num / 10) % 10; units = num % 10; strcpy(buf, ord_suffix[(units > 3 || tens == 1) ? 0 : units]); return buf; } /* --------------------------------------------------------------------------- expand_fmt Notes: This routine expands a 'strftime'-like date format specifier. Pcal supports '%[aAbBdjmUWyY]' from 'strftime()' plus '%[luwDM]' and prefixes '[0o+-]' (see below). The expanded string is placed in an output buffer and a pointer to the character following the end of format specifier is returned. Assumes working date has been initialized (via RESET_DATE() macro) prior to first call for a given text string */ char *expand_fmt (char *buf, /* output buffer (filled in) */ char *p) /* character following percent sign */ { char c; static char *prefixes = "0o+-"; int firstday, wkday; int adjust = 0, print_lz = FALSE, ordinal = FALSE, prev_num = -1; int num_present = FALSE, num_value = 0; date_str date; /* For compatibility with version 4.1, still support %[+-][bBdmY] (print the next/last month-name/day/month/year). Version 4.11 introduces %[+-][DWMY], which adjusts the working date by [+-] days/weeks/months/years; this method is preferred due to its greater flexibility. */ buf[0] = '\0'; /* initialize output to null string */ do { /* loop until format character found */ switch (c = *p++) { case 'a': /* %a : abbreviated weekday */ wkday = calc_weekday(work_month, work_day, work_year); strcpy(buf, days_ml_short[output_language][wkday]); break; case 'A': /* %A : full weekday */ wkday = calc_weekday(work_month, work_day, work_year); strcpy(buf, days_ml[output_language][wkday]); break; case 'b': /* %b : abbreviated month name */ case 'B': /* %B : full month name */ strcpy(buf, months_ml[output_language][(work_month + adjust + 11) % 12]); if (c == 'b') buf[ABBR_MONTH_LEN] = '\0'; break; case 'd': /* %d : day of month (01-31) */ prev_num = work_day; sprintf(buf, print_lz ? "%02d" : "%d", prev_num); break; case 'D': /* %D : adjust working date by days (NEW) */ if (!num_present || num_value == 0) RESET_DATE(); else SET_DATE(adjust * num_value); break; case 'j': /* %j : day of year (001-366) */ prev_num = DAY_OF_YEAR(work_month, work_day, work_year); sprintf(buf, print_lz ? "%03d" : "%d", prev_num); break; case 'l': /* %l : days left in year (000-365) (NEW) */ prev_num = YEAR_LEN(work_year) - DAY_OF_YEAR(work_month, work_day, work_year); sprintf(buf, print_lz ? "%03d" : "%d", prev_num); break; case 'm': /* %m : month (01-12) */ prev_num = (work_month + adjust + 11) % 12 + 1; sprintf(buf, print_lz ? "%02d" : "%d", prev_num); break; case 'M': /* %M : adjust date by months (NEW) */ if (!num_present || num_value == 0) { RESET_DATE(); } else { int len; work_month += adjust * num_value; while (work_month > DEC) { work_month -= 12; work_year++; } while (work_month < JAN) { work_month += 12; work_year--; } /* make sure day of new month is legal */ len = LENGTH_OF(work_month, work_year); if (work_day > len) work_day = len; } break; /* %u considers the week containing 1/1 to be week 1 and the next "logical Sunday" (the first day of the week as printed - cf. the -F option) to be the start of week 2; %U considers the first "logical Sunday" of the year to be the start of week 1. %w and %W behave like %u and %U respectively, but use the first "logical Monday" instead. */ case 'W': /* %W : week number (00-53) */ /* %W, if prefaced by [+-]N, adjusts the date by [+-]N weeks (resets if N == 0); check for this case first */ if (num_present) { if (num_value == 0) RESET_DATE(); /* N = 0: reset date */ else SET_DATE(7 * adjust * num_value); break; } /* fall through */ case 'u': /* %u : week number (01-54) (NEW) */ case 'U': /* %U : week number (00-53) */ case 'w': /* %w : week number (01-54) (NEW) */ firstday = ((tolower(c) == 'w' ? 15 : 14) - START_BOX(JAN, work_year)) % 7 + 1; prev_num = (DAY_OF_YEAR(work_month, work_day, work_year) - firstday + 7) / 7; if (islower((int)c) && firstday != 1) prev_num++; sprintf(buf, print_lz ? "%02d" : "%d", prev_num); break; case 'y': /* %y : year w/o century (00-99) */ prev_num = (work_year + adjust) % 100; sprintf(buf, "%02d", prev_num); break; case 'Y': /* %Y : year w/century */ /* %Y, if prefaced by [+-]N, adjusts the date by [+-]N years (resets if N == 0); check for this case first */ if (num_present) { if (num_value == 0) { /* N = 0: reset date */ RESET_DATE(); } else { int len; work_year += adjust * num_value; /* make sure day is legal */ len = LENGTH_OF(work_month, work_year); if (work_day > len) work_day = len; } } else { prev_num = work_year + adjust; sprintf(buf, "%d", prev_num); } break; /* prefix flags [o0+-] : set flags for next pass */ case 'o': /* %o : ordinal suffix (NEW) */ ordinal = TRUE; break; case '0': /* %0 : add leading zeroes (NEW) */ print_lz = TRUE; break; case '+': /* %+ : increment next value (NEW) */ case '-': /* %- : decrement next value (NEW) */ adjust = c == '-' ? -1 : 1; if (isdigit((int)*p)) { /* get the number */ num_present = TRUE; while (isdigit((int)*p)) { num_value = num_value * 10 + (*p++ - '0'); } } break; case '\0': /* accidental end-of-string */ case ' ': return p - 1; default: /* other - just copy it to output */ sprintf(buf, "%c", c); break; }; } while (strchr(prefixes, c) != NULL); /* append ordinal suffix if requested */ if (ordinal && prev_num >= 0) strcat(buf, ordinal_suffix(prev_num)); return p; } /* --------------------------------------------------------------------------- print_word Notes: This routine prints a single word, representing punctuation and non-ASCII characters as octal literals and expanding format specifiers. It returns a pointer to the character following the word (NULL if no word follows). */ char *print_word (char *p) { char c, buf[STRSIZ]; int first = TRUE; /* flag to avoid printing null strings */ if (*p == '\0' || *(p += strspn(p, WHITESPACE)) == '\0') return NULL; while ((c = *p) && !isspace(c & CHAR_MSK)) { if (c == '%' && p[1] != '\0') { p = expand_fmt(buf, p + 1); if (*buf && first) { printf("("); first = FALSE; } PUTSTR(isalnum, buf, stdout); } else { if (first) printf("("); first = FALSE; PUTCHAR(isalnum, c, stdout); p++; } } if (!first) printf(")"); return p; } /* --------------------------------------------------------------------------- print_db_word Notes: This routine is the debug version of 'print_word()'. It omits parentheses, does not convert punctuation to escape sequences, and writes results to stderr (not stdout). */ char *print_db_word (char *p) { char c, buf[STRSIZ]; if (*p == '\0' || *(p += strspn(p, WHITESPACE)) == '\0') return NULL; while ((c = *p) && !isspace(c & CHAR_MSK)) { if (c == '%' && p[1] != '\0') { p = expand_fmt(buf, p + 1); PUTSTR(isprint, buf, stderr); } else { PUTCHAR(isprint, c, stderr); p++; } } return p; } /* --------------------------------------------------------------------------- print_pstext Notes: This routine prints tokens in the input text (assumed separated by single blank) in PostScript format and as debugging information if requested. */ void print_pstext (char *p) { char *s = p; /* save for possible second pass */ while ((p = print_word(p)) != NULL) printf(" "); /* repeat to generate debugging info if requested */ if (debug_text) { while ((s = print_db_word(s)) != NULL) fprintf(stderr, " "); } return; } /* --------------------------------------------------------------------------- print_text Notes: This routine prints text as supplied. It expands the format specifiers but does not tokenize into words or translate punctuation to escape sequences. */ void print_text (char *p) { char c, buf[STRSIZ]; while ((c = *p) != '\0') { if (c == '%' && p[1] != '\0') { p = expand_fmt(buf, p + 1); /* AH: non-ascii for -c mode should pass clean! */ PUTSTR_CLEAN(isprint, buf, stdout); } else { PUTCHAR_CLEAN(isprint, c, stdout); p++; } } return; } /* --------------------------------------------------------------------------- def_footstring Notes: This routine prints the definition for a foot string, again converting all characters other than letters, digits, or space to octal escape and expanding format specifiers. The first parameter is the definition. The second parameter is the name of the string. */ void def_footstring (char *p, char *str) { char c, buf[STRSIZ]; this_day = 1; /* set default day in foot string */ RESET_DATE(); /* reset working date */ printf("/%s (", str); while ((c = *p) != '\0') { if (c == '%' && p[1] != '\0') { p = expand_fmt(buf, p + 1); PUTSTR(isalnum, buf, stdout); } else { PUTCHAR(isalnum, c, stdout); p++; } } printf(") def\n"); return; } /* * Routines to extract and print data */ /* --------------------------------------------------------------------------- find_daytext Notes: This routine finds and prints the day (including notes) or holiday text for the specified month/year. The third parameter acts as a flag to indicate if the holiday text should be printed. */ void find_daytext (int month, int year, int is_holiday) { register int day; year_info *py; month_info *pm; register day_info *pd; int first; char *fcn = is_holiday ? "holidaytext" : "daytext"; char hol = is_holiday ? '*' : ' '; /* if no text for this year and month, return */ if ((py = find_year(year, FALSE)) == NULL || (pm = py->month[month-1]) == NULL) { return; } /* walk array of day text pointers and linked lists of text */ for (day = 1; day <= LAST_NOTE_DAY; day++) { for (pd = pm->day[day-1], first = TRUE; pd; pd = pd->next) { if (pd->is_holiday != is_holiday) continue; /* Skip lines specifying an EPS image... */ if (ci_strncmp(pd->text, "image:", 6) == 0) continue; if (first) { printf("%d [ \n", day >= FIRST_NOTE_DAY ? note_box(month, day, year) : day); } else { printf("\n"); print_word(LINE_SEP); /* separate lines */ printf("\n"); } this_day = day >= FIRST_NOTE_DAY ? 1 : day; RESET_DATE(); /* reset working date */ if (debug_text) { if (day < FIRST_NOTE_DAY) { fprintf(stderr, "%02d/%02d/%d%c ", month, day, year, hol); } else { fprintf(stderr, "%02d[%02d]%d ", month, day - FIRST_NOTE_DAY + 1, year); } } print_pstext(pd->text); if (debug_text) fprintf(stderr, "\n"); first = FALSE; } if (! first) { /* wrap up call (if one made) */ printf("\n] %s\n", day >= FIRST_NOTE_DAY ? "notetext" : fcn); } } return; } /* --------------------------------------------------------------------------- find_images Notes: This routine finds and prints the EPS images for the specified month/year. */ void find_images (int month, int year) { register int day; year_info *py; month_info *pm; register day_info *pd; /* if no text for this year and month, return */ if ((py = find_year(year, FALSE)) == NULL || (pm = py->month[month-1]) == NULL) { return; } /* walk array of day text pointers and linked lists of text */ for (day = 1; day <= LAST_NOTE_DAY; day++) { for (pd = pm->day[day-1]; pd; pd = pd->next) { /* Determine if this is a 'daytext' or an 'image'... */ if (ci_strncmp(pd->text, "image:", 6) == 0) { char temp_str[300]; char *p; printf("%d [()] \n", day); strncpy(temp_str, pd->text, sizeof temp_str); p = strchr(pd->text, ' '); /* Isolate the EPS image filename */ strncpy(temp_str, p+1, sizeof temp_str); /* Copy the remaining parameters */ *p = '\0'; printf("(%s) %s ", pd->text+6, temp_str); this_day = 1; RESET_DATE(); /* reset working date */ printf("epsimage\n"); } } } return; } /* --------------------------------------------------------------------------- print_colors Notes: This routine prints an array specifying the color of each date in the current month (formerly calculated on the fly in drawnums{} in pcalinit.ps). */ void print_colors (int month, int year) { register int day; year_info *py; month_info *pm; unsigned long holidays; int j, len; short color[32]; len = LENGTH_OF(month, year); /* determine each date's color from its day of the week */ for (day = 1, j = FIRST_OF(month, year); day <= len; day++, j = (j + 1) % 7) { color[day] = day_color[j]; } pm = (py = find_year(year, FALSE)) ? py->month[month-1] : NULL; /* override weekday color for holidays */ for (holidays = pm ? pm->holidays : 0, day = 1; holidays; holidays >>= 1, day++) { if (holidays & 01) color[day] = holiday_color; } printf("/date_color [ -1"); /* dummy value for element 0 */ for (day = 1; day <= len; day++) { printf("%s %d", day % 10 == 1 ? " " : "", color[day]); } printf(" ] def\n"); return; } /* --------------------------------------------------------------------------- find_noteboxes Notes: This routine finds and prints the note box numbers for the specified month/year. */ void find_noteboxes (int month, int year) { register int day; year_info *py; month_info *pm; /* if no text for this year and month, print empty list and return */ if ((py = find_year(year, FALSE)) == NULL || (pm = py->month[month-1]) == NULL) { printf("/noteboxes [ ] def\n"); return; } printf("/noteboxes ["); /* start definition of list */ /* walk array of note text pointers, converting days to box numbers */ for (day = FIRST_NOTE_DAY; day <= LAST_NOTE_DAY; day++) { if (pm->day[day-1]) { printf(" %d", note_box(month, day, year)); } } printf(" ] def\n"); return; } /* --------------------------------------------------------------------------- print_dates Notes: This routine prints the dates (in "calendar" format) for the specified month and year. */ void print_dates (int month, int year) { register int day; year_info *py; month_info *pm; register day_info *pd; unsigned long holidays; int has_holiday_text; static int save_year = 0; /* if no text for this year and month, return */ if ((py = find_year(year, FALSE)) == NULL || (pm = py->month[month-1]) == NULL) { return; } /* print the year if it has changed */ if (year != save_year) printf("%s %d\n", kw_year, save_year = year); /* walk array of day text pointers and linked lists of text */ for (holidays = pm->holidays, day = 1; day < FIRST_NOTE_DAY; holidays >>= 1L, day++) { has_holiday_text = FALSE; for (pd = pm->day[day-1]; pd; pd = pd->next) { /* Bypass entries that specify an EPS image... */ if (ci_strncmp(pd->text, "image:", 6) == 0) continue; if (date_style == USA_DATES) printf("%02d/%02d", month, day); else printf("%02d/%02d", day, month); #ifdef KEEP_ASTERISKS printf(pd->is_holiday ? "*\t" : "\t"); #else printf("\t"); #endif this_day = day; RESET_DATE(); /* reset working date */ print_text(pd->text); printf("\n"); has_holiday_text |= pd->is_holiday; } #ifdef KEEP_ASTERISKS /* was date flagged as holiday w/o associated text? */ if ((holidays & 01) && !has_holiday_text) { if (date_style == USA_DATES) printf("%02d/%02d*\n", month, day); else printf("%02d/%02d*\n", day, month); } #endif } return; } /* --------------------------------------------------------------------------- print_moon_info Notes: This routine prints the information necessary to draw moons. If printing moons on all days, print the phase for each day. If printing only quarter moons, tweak the phase to an exact quarter (so the icon is printed correctly) and generate a list of the quarter-moon dates. */ void print_moon_info (int month, int year) { int n, ndays, day, quarter; unsigned long qdays; double phase; static char *q[4] = {"NM", "1Q", "FM", "3Q"}; if (draw_moons == NO_MOONS) return; /* print the phase of the moon for each day of the month */ printf("/moon_phases [\t\t%% from algorithm "); if (atof(time_zone) != 0.0) printf(" (UTC offset = %s)", time_zone); printf("\n\t"); for (n = 0, qdays = 0L, day = 1, ndays = LENGTH_OF(month, year); day <= ndays; day++) { phase = find_phase(month, day, year, &quarter); if (DEBUG(DEBUG_MOON)) { fprintf(stderr, "Moon phase on %04d-%02d-%02d: %.5f %s\n", year, month, day, phase, quarter != MOON_OTHER ? q[quarter] : ""); } /* adjust phase to exact quarter if printing only quarters */ if (draw_moons == SOME_MOONS && quarter != MOON_OTHER) phase = 0.25 * quarter; if (draw_moons == ALL_MOONS || quarter != MOON_OTHER) { printf("%.3f%s", PRT_TWEAK(phase), ++n % 10 == 0 ? "\n\t" : " "); } if (quarter != MOON_OTHER) qdays |= 1L << (day - 1); } printf("] def\n"); /* if drawing only quarter moons, print days when they occur */ if (draw_moons == SOME_MOONS) { printf("/quarter_moons [ "); for (day = 1; qdays; day++, qdays >>= 1) { if (qdays & 01) printf("%d ", day); } printf("] def\n"); } return; } /* --------------------------------------------------------------------------- print_julian_info Notes: This routine prints the information necessary to print Julian dates. */ void print_julian_info (int month, int year) { if (julian_dates != NO_JULIANS) { printf("/jdstart %d def\n", DAY_OF_YEAR(month, 1, year)); } if (julian_dates == ALL_JULIANS) { printf("/yearlen %d def\n", YEAR_LEN(year)); } return; } /* --------------------------------------------------------------------------- print_month Notes: This routine generates a calendar for the specified month/year. */ void print_month (int month, int year) { static int nmonths = 0; #ifdef EPS_DSC static int page = 0; #endif int startbox; #ifdef EPS_DSC /* start of new physical page? */ if (!do_whole_year || nmonths % 12 == 0) { page++; printf("%%%%Page: %d %d\n", page, page); printf("%%%%BeginPageSetup\n"); printf("clear flush\n"); printf("/PageNum { %d } def\n", page); printf("/PageState save def\n"); printf("%%%%EndPageSetup\n\n"); } #endif if (do_whole_year) { /* reset foot strings at start of each page */ if (nmonths % 12 == 0) { def_footstring(lfoot, "Lfootstring"); def_footstring(cfoot, "Cfootstring"); def_footstring(rfoot, "Rfootstring"); def_footstring(notes_hdr, "notesheading"); printf("\n"); } } /* set up year and month */ printf("/year %d def\n", year); printf("/month %d def\n", month); /* move starting box to second row if conflict with small calendars */ startbox = START_BOX(month, year); if (!do_whole_year && (prev_cal_box[small_cal_pos] == startbox || next_cal_box[small_cal_pos] == startbox)) { startbox += 7; } printf("/startbox %d def\n", startbox); printf("/ndays %d def\n", LENGTH_OF(month, year)); find_noteboxes(month, year); /* make list of note boxes */ print_colors(month, year); /* make list of date colors */ /* Are we printing 12 months per page or only one? */ if (do_whole_year) { printf("/posn %d def\n", nmonths % 12); /* location on page */ print_julian_info(month, year); /* Julian date info */ print_moon_info(month, year); /* moon info */ printf("printmonth\n\n"); } else { /* reset foot strings each month (may change) */ def_footstring(lfoot, "Lfootstring"); def_footstring(cfoot, "Cfootstring"); def_footstring(rfoot, "Rfootstring"); def_footstring(notes_hdr, "notesheading"); /* generate information necessary for small calendars */ if (small_cal_pos != SC_NONE) { int m, y; printf("/p_year %d def\n", y = PREV_YEAR(month, year)); printf("/p_month %d def\n", m = PREV_MONTH(month, year)); printf("/p_startbox %d def\n", START_BOX(m, y)); printf("/p_ndays %d def\n", LENGTH_OF(m, y)); printf("/n_year %d def\n", y = NEXT_YEAR(month, year)); printf("/n_month %d def\n", m = NEXT_MONTH(month, year)); printf("/n_startbox %d def\n", START_BOX(m, y)); printf("/n_ndays %d def\n", LENGTH_OF(m, y)); } print_julian_info(month, year); /* Julian date info */ print_moon_info(month, year); /* moon info */ printf("printmonth\n"); find_daytext(month, year, TRUE); /* holiday text */ find_daytext(month, year, FALSE); /* day and note text */ find_images(month, year); /* EPS images */ } /* end of physical page? */ if (!do_whole_year || ++nmonths % 12 == 0) { #ifdef EPS_DSC printf("%%%%PageTrailer\n"); printf("showpage\n"); printf("clear flush\n"); printf("PageState restore\n"); #else printf("showpage\n"); #endif } } /* --------------------------------------------------------------------------- print_html Notes: This routine prints a character string in HTML format, converting all non-printing characters to "&#NNN;" notation. */ void print_html (char *p) { char c, buf[STRSIZ]; while ((c = *p) != '\0') { if (c == '%' && p[1] != '\0') { p = expand_fmt(buf, p + 1); PUTSTR_CLEAN(isalnum, buf, stdout); } else if (c < ' ' || c > '\176') printf("&#%03d;", *p++ & CHAR_MSK); else printf("%c", *p++); } return; }