home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1608 < prev    next >
SHell self-extracting ARchive  |  1990-12-28  |  31.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: 1608

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file C source text default
98% file C source, ASCII text default
100% TrID E-Mail message (Var. 2) default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 72 6f | 67 65 72 73 40 73 75 64 |From: ro|gers@sud|
|00000010| 35 30 39 2e 65 64 2e 72 | 61 79 2e 63 6f 6d 20 28 |509.ed.r|ay.com (|
|00000020| 41 6e 64 72 65 77 20 52 | 6f 67 65 72 73 29 0a 4e |Andrew R|ogers).N|
|00000030| 65 77 73 67 72 6f 75 70 | 73 3a 20 61 6c 74 2e 73 |ewsgroup|s: alt.s|
|00000040| 6f 75 72 63 65 73 0a 53 | 75 62 6a 65 63 74 3a 20 |ources.S|ubject: |
|00000050| 59 65 74 20 61 6e 6f 74 | 68 65 72 20 50 63 61 6c |Yet anot|her Pcal|
|00000060| 20 72 65 76 69 73 69 6f | 6e 0a 4d 65 73 73 61 67 | revisio|n.Messag|
|00000070| 65 2d 49 44 3a 20 3c 31 | 38 30 33 40 73 75 64 35 |e-ID: <1|803@sud5|
|00000080| 30 39 2e 65 64 2e 72 61 | 79 2e 63 6f 6d 3e 0a 44 |09.ed.ra|y.com>.D|
|00000090| 61 74 65 3a 20 31 39 20 | 4a 75 6c 20 39 30 20 31 |ate: 19 |Jul 90 1|
|000000a0| 39 3a 33 30 3a 34 35 20 | 47 4d 54 0a 0a 54 68 69 |9:30:45 |GMT..Thi|
|000000b0| 73 20 69 73 20 61 20 6e | 65 77 2c 20 69 6d 70 72 |s is a n|ew, impr|
|000000c0| 6f 76 65 64 20 72 65 6c | 65 61 73 65 20 6f 66 20 |oved rel|ease of |
|000000d0| 70 63 61 6c 2e 20 20 41 | 6d 6f 6e 67 20 74 68 65 |pcal. A|mong the|
|000000e0| 20 6e 75 6d 65 72 6f 75 | 73 20 72 65 76 69 73 69 | numerou|s revisi|
|000000f0| 6f 6e 73 0a 28 73 69 6e | 63 65 20 74 68 65 20 6c |ons.(sin|ce the l|
|00000100| 61 73 74 20 76 65 72 73 | 69 6f 6e 20 49 20 70 6f |ast vers|ion I po|
|00000110| 73 74 65 64 29 20 61 72 | 65 3a 0a 0a 09 31 29 20 |sted) ar|e:...1) |
|00000120| 6d 6f 6e 74 68 20 61 6e | 64 20 79 65 61 72 20 61 |month an|d year a|
|00000130| 72 65 20 6e 6f 77 20 63 | 65 6e 74 65 72 65 64 20 |re now c|entered |
|00000140| 61 74 20 74 6f 70 20 6f | 66 20 63 61 6c 65 6e 64 |at top o|f calend|
|00000150| 61 72 0a 0a 09 32 29 20 | 72 65 76 69 73 65 64 20 |ar...2) |revised |
|00000160| 63 6f 6d 6d 61 6e 64 2d | 6c 69 6e 65 20 70 61 72 |command-|line par|
|00000170| 61 6d 65 74 65 72 73 3a | 20 63 6f 6e 66 75 73 69 |ameters:| confusi|
|00000180| 6e 67 20 22 2d 6d 22 20 | 61 6e 64 20 22 2d 79 22 |ng "-m" |and "-y"|
|00000190| 20 66 6c 61 67 73 0a 09 | 20 20 20 64 72 6f 70 70 | flags..| dropp|
|000001a0| 65 64 20 65 6e 74 69 72 | 65 6c 79 2c 20 61 6e 64 |ed entir|ely, and|
|000001b0| 20 73 65 76 65 72 61 6c | 20 6e 65 77 20 6f 70 74 | several| new opt|
|000001c0| 69 6f 6e 73 20 61 64 64 | 65 64 20 28 73 65 65 20 |ions add|ed (see |
|000001d0| 6d 61 6e 20 70 61 67 65 | 29 0a 0a 09 33 29 20 68 |man page|)...3) h|
|000001e0| 6f 6c 69 64 61 79 73 20 | 6e 65 65 64 20 6e 6f 74 |olidays |need not|
|000001f0| 20 61 70 70 65 61 72 20 | 69 6e 20 6f 72 64 65 72 | appear |in order|
|00000200| 0a 0a 09 34 29 20 50 6f | 73 74 53 63 72 69 70 74 |...4) Po|stScript|
|00000210| 20 62 6f 69 6c 65 72 70 | 6c 61 74 65 20 6d 6f 76 | boilerp|late mov|
|00000220| 65 64 20 74 6f 20 6e 65 | 77 20 66 69 6c 65 2c 20 |ed to ne|w file, |
|00000230| 70 63 61 6c 69 6e 69 74 | 2e 68 0a 0a 09 35 29 20 |pcalinit|.h...5) |
|00000240| 73 6f 75 72 63 65 20 69 | 73 20 63 6f 6d 70 61 74 |source i|s compat|
|00000250| 69 62 6c 65 20 77 69 74 | 68 20 56 4d 53 20 61 6e |ible wit|h VMS an|
|00000260| 64 20 55 6e 69 78 0a 0a | 09 36 29 20 63 6f 6d 70 |d Unix..|.6) comp|
|00000270| 72 65 68 65 6e 73 69 76 | 65 20 75 73 61 67 65 20 |rehensiv|e usage |
|00000280| 6d 65 73 73 61 67 65 0a | 0a 09 37 29 20 63 6f 6d |message.|..7) com|
|00000290| 6d 65 6e 74 73 20 28 27 | 23 27 20 74 68 72 6f 75 |ments ('|#' throu|
|000002a0| 67 68 20 65 6e 64 2d 6f | 66 2d 6c 69 6e 65 29 20 |gh end-o|f-line) |
|000002b0| 73 75 70 70 6f 72 74 65 | 64 20 69 6e 20 63 61 6c |supporte|d in cal|
|000002c0| 65 6e 64 61 72 20 66 69 | 6c 65 0a 0a 54 68 65 20 |endar fi|le..The |
|000002d0| 61 63 63 6f 6d 70 61 6e | 79 69 6e 67 20 66 69 6c |accompan|ying fil|
|000002e0| 65 20 63 61 6c 6c 65 64 | 20 22 52 65 61 64 4d 65 |e called| "ReadMe|
|000002f0| 2e 6f 72 69 67 22 20 63 | 61 6d 65 20 77 69 74 68 |.orig" c|ame with|
|00000300| 20 74 68 65 20 6f 72 69 | 67 69 6e 61 6c 20 64 69 | the ori|ginal di|
|00000310| 73 74 72 69 62 75 74 69 | 6f 6e 0a 61 73 20 52 45 |stributi|on.as RE|
|00000320| 41 44 4d 45 20 61 6e 64 | 20 73 74 61 74 65 73 20 |ADME and| states |
|00000330| 74 68 69 73 20 70 72 6f | 67 72 61 6d 20 69 73 20 |this pro|gram is |
|00000340| 63 6f 70 79 72 69 67 68 | 74 65 64 20 62 75 74 20 |copyrigh|ted but |
|00000350| 77 69 74 68 20 70 65 72 | 6d 69 73 73 69 6f 6e 20 |with per|mission |
|00000360| 74 6f 20 6d 6f 64 69 66 | 79 0a 61 6e 64 20 72 65 |to modif|y.and re|
|00000370| 64 69 73 74 72 69 62 75 | 74 65 2e 0a 0a 41 6e 64 |distribu|te...And|
|00000380| 72 65 77 20 57 2e 20 52 | 6f 67 65 72 73 0a 0a 41 |rew W. R|ogers..A|
|00000390| 64 64 69 74 69 6f 6e 61 | 6c 20 6e 6f 74 65 3a 20 |dditiona|l note: |
|000003a0| 54 68 69 73 20 64 69 73 | 74 72 69 62 75 74 69 6f |This dis|tributio|
|000003b0| 6e 20 69 6e 63 6c 75 64 | 65 73 20 61 20 56 4d 53 |n includ|es a VMS|
|000003c0| 20 48 45 4c 50 20 66 69 | 6c 65 20 77 72 69 74 74 | HELP fi|le writt|
|000003d0| 65 6e 20 62 79 0a 52 69 | 63 68 61 72 64 20 44 79 |en by.Ri|chard Dy|
|000003e0| 73 6f 6e 2e 20 20 54 68 | 65 20 22 73 74 72 63 61 |son. Th|e "strca|
|000003f0| 74 22 20 75 74 69 6c 69 | 74 79 20 77 61 73 20 62 |t" utili|ty was b|
|00000400| 6f 72 72 6f 77 65 64 20 | 66 72 6f 6d 20 4a 65 66 |orrowed |from Jef|
|00000410| 20 50 6f 73 6b 61 6e 7a | 65 72 27 73 0a 49 44 20 | Poskanz|er's.ID |
|00000420| 54 6f 6f 6c 6b 69 74 2e | 20 20 43 6f 75 6e 74 6c |Toolkit.| Countl|
|00000430| 65 73 73 20 6f 74 68 65 | 72 20 70 65 6f 70 6c 65 |ess othe|r people|
|00000440| 20 77 6f 72 6b 65 64 20 | 6f 6e 20 69 74 20 6c 6f | worked |on it lo|
|00000450| 6e 67 20 62 65 66 6f 72 | 65 20 6d 65 3b 20 73 65 |ng befor|e me; se|
|00000460| 65 20 74 68 65 0a 52 65 | 61 64 4d 65 2e 6f 72 69 |e the.Re|adMe.ori|
|00000470| 67 20 66 69 6c 65 20 61 | 6e 64 20 74 6f 70 6c 69 |g file a|nd topli|
|00000480| 6e 65 20 63 6f 6d 6d 65 | 6e 74 73 20 69 6e 20 70 |ne comme|nts in p|
|00000490| 63 61 6c 2e 63 2e 0a 0a | 2d 2d 2d 2d 2d 2d 2d 2d |cal.c...|--------|
|000004a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004b0| 2d 2d 2d 2d 2d 2d 2d 20 | 63 75 74 20 68 65 72 65 |------- |cut here|
|000004c0| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | -------|--------|
|000004d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000004e0| 0a 23 21 20 2f 62 69 6e | 2f 73 68 0a 23 20 54 68 |.#! /bin|/sh.# Th|
|000004f0| 69 73 20 69 73 20 61 20 | 73 68 65 6c 6c 20 61 72 |is is a |shell ar|
|00000500| 63 68 69 76 65 2c 20 6d | 65 61 6e 69 6e 67 3a 0a |chive, m|eaning:.|
|00000510| 23 20 31 2e 20 52 65 6d | 6f 76 65 20 65 76 65 72 |# 1. Rem|ove ever|
|00000520| 79 74 68 69 6e 67 20 61 | 62 6f 76 65 20 74 68 65 |ything a|bove the|
|00000530| 20 23 21 20 2f 62 69 6e | 2f 73 68 20 6c 69 6e 65 | #! /bin|/sh line|
|00000540| 2e 0a 23 20 32 2e 20 53 | 61 76 65 20 74 68 65 20 |..# 2. S|ave the |
|00000550| 72 65 73 75 6c 74 69 6e | 67 20 74 65 78 74 20 69 |resultin|g text i|
|00000560| 6e 20 61 20 66 69 6c 65 | 2e 0a 23 20 33 2e 20 45 |n a file|..# 3. E|
|00000570| 78 65 63 75 74 65 20 74 | 68 65 20 66 69 6c 65 20 |xecute t|he file |
|00000580| 77 69 74 68 20 2f 62 69 | 6e 2f 73 68 20 28 6e 6f |with /bi|n/sh (no|
|00000590| 74 20 63 73 68 29 20 74 | 6f 20 63 72 65 61 74 65 |t csh) t|o create|
|000005a0| 3a 0a 23 09 20 4d 61 6b | 65 66 69 6c 65 0a 23 09 |:.#. Mak|efile.#.|
|000005b0| 20 52 65 61 64 4d 65 0a | 23 09 20 52 65 61 64 4d | ReadMe.|#. ReadM|
|000005c0| 65 2e 6f 72 69 67 0a 23 | 09 20 63 61 6c 65 6e 64 |e.orig.#|. calend|
|000005d0| 61 72 0a 23 09 20 70 63 | 61 6c 2e 63 0a 23 09 20 |ar.#. pc|al.c.#. |
|000005e0| 70 63 61 6c 2e 68 6c 70 | 0a 23 09 20 70 63 61 6c |pcal.hlp|.#. pcal|
|000005f0| 2e 6d 61 6e 0a 23 09 20 | 70 63 61 6c 69 6e 69 74 |.man.#. |pcalinit|
|00000600| 2e 68 0a 23 20 54 68 69 | 73 20 61 72 63 68 69 76 |.h.# Thi|s archiv|
|00000610| 65 20 63 72 65 61 74 65 | 64 3a 20 54 68 75 20 4a |e create|d: Thu J|
|00000620| 75 6c 20 31 39 20 31 35 | 3a 32 36 3a 33 36 20 45 |ul 19 15|:26:36 E|
|00000630| 44 54 20 31 39 39 30 0a | 65 78 70 6f 72 74 20 50 |DT 1990.|export P|
|00000640| 41 54 48 3b 20 50 41 54 | 48 3d 2f 62 69 6e 3a 2f |ATH; PAT|H=/bin:/|
|00000650| 75 73 72 2f 62 69 6e 3a | 24 50 41 54 48 0a 69 66 |usr/bin:|$PATH.if|
|00000660| 20 74 65 73 74 20 2d 66 | 20 27 4d 61 6b 65 66 69 | test -f| 'Makefi|
|00000670| 6c 65 27 0a 74 68 65 6e | 0a 09 65 63 68 6f 20 73 |le'.then|..echo s|
|00000680| 68 61 72 3a 20 77 69 6c | 6c 20 6e 6f 74 20 6f 76 |har: wil|l not ov|
|00000690| 65 72 2d 77 72 69 74 65 | 20 65 78 69 73 74 69 6e |er-write| existin|
|000006a0| 67 20 66 69 6c 65 20 27 | 4d 61 6b 65 66 69 6c 65 |g file '|Makefile|
|000006b0| 27 0a 65 6c 73 65 0a 63 | 61 74 20 3c 3c 20 5c 53 |'.else.c|at << \S|
|000006c0| 48 41 52 5f 45 4f 46 20 | 3e 20 27 4d 61 6b 65 66 |HAR_EOF |> 'Makef|
|000006d0| 69 6c 65 27 0a 23 0a 23 | 4d 41 4e 44 49 52 3d 2f |ile'.#.#|MANDIR=/|
|000006e0| 75 73 72 31 2f 6a 61 64 | 2f 6d 61 6e 09 09 09 0a |usr1/jad|/man....|
|000006f0| 0a 70 63 61 6c 3a 09 70 | 63 61 6c 2e 63 20 70 63 |.pcal:.p|cal.c pc|
|00000700| 61 6c 69 6e 69 74 2e 68 | 0a 09 24 28 43 43 29 20 |alinit.h|..$(CC) |
|00000710| 24 28 43 46 4c 41 47 53 | 29 20 24 28 4c 44 46 4c |$(CFLAGS|) $(LDFL|
|00000720| 41 47 53 29 20 24 28 43 | 4f 50 54 53 29 20 2d 6f |AGS) $(C|OPTS) -o|
|00000730| 20 70 63 61 6c 20 70 63 | 61 6c 2e 63 0a 0a 6d 61 | pcal pc|al.c..ma|
|00000740| 6e 3a 09 70 63 61 6c 2e | 6d 61 6e 0a 09 6e 72 6f |n:.pcal.|man..nro|
|00000750| 66 66 20 2d 6d 61 6e 20 | 70 63 61 6c 2e 6d 61 6e |ff -man |pcal.man|
|00000760| 20 3e 20 70 63 61 6c 2e | 31 0a 09 70 61 63 6b 20 | > pcal.|1..pack |
|00000770| 70 63 61 6c 2e 31 0a 23 | 09 6d 76 20 70 63 61 6c |pcal.1.#|.mv pcal|
|00000780| 2e 31 2e 7a 20 24 28 4d | 41 4e 44 49 52 29 0a 53 |.1.z $(M|ANDIR).S|
|00000790| 48 41 52 5f 45 4f 46 0a | 66 69 0a 69 66 20 74 65 |HAR_EOF.|fi.if te|
|000007a0| 73 74 20 2d 66 20 27 52 | 65 61 64 4d 65 27 0a 74 |st -f 'R|eadMe'.t|
|000007b0| 68 65 6e 0a 09 65 63 68 | 6f 20 73 68 61 72 3a 20 |hen..ech|o shar: |
|000007c0| 77 69 6c 6c 20 6e 6f 74 | 20 6f 76 65 72 2d 77 72 |will not| over-wr|
|000007d0| 69 74 65 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ite exis|ting fil|
|000007e0| 65 20 27 52 65 61 64 4d | 65 27 0a 65 6c 73 65 0a |e 'ReadM|e'.else.|
|000007f0| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|00000800| 20 3e 20 27 52 65 61 64 | 4d 65 27 0a 54 68 69 73 | > 'Read|Me'.This|
|00000810| 20 69 73 20 61 20 6e 65 | 77 2c 20 69 6d 70 72 6f | is a ne|w, impro|
|00000820| 76 65 64 20 72 65 6c 65 | 61 73 65 20 6f 66 20 70 |ved rele|ase of p|
|00000830| 63 61 6c 2e 20 20 41 6d | 6f 6e 67 20 74 68 65 20 |cal. Am|ong the |
|00000840| 6e 75 6d 65 72 6f 75 73 | 20 72 65 76 69 73 69 6f |numerous| revisio|
|00000850| 6e 73 0a 28 73 69 6e 63 | 65 20 74 68 65 20 6c 61 |ns.(sinc|e the la|
|00000860| 73 74 20 76 65 72 73 69 | 6f 6e 20 49 20 70 6f 73 |st versi|on I pos|
|00000870| 74 65 64 29 20 61 72 65 | 3a 0a 0a 09 31 29 20 6d |ted) are|:...1) m|
|00000880| 6f 6e 74 68 20 61 6e 64 | 20 79 65 61 72 20 61 72 |onth and| year ar|
|00000890| 65 20 6e 6f 77 20 63 65 | 6e 74 65 72 65 64 20 61 |e now ce|ntered a|
|000008a0| 74 20 74 6f 70 20 6f 66 | 20 63 61 6c 65 6e 64 61 |t top of| calenda|
|000008b0| 72 0a 0a 09 32 29 20 72 | 65 76 69 73 65 64 20 63 |r...2) r|evised c|
|000008c0| 6f 6d 6d 61 6e 64 2d 6c | 69 6e 65 20 70 61 72 61 |ommand-l|ine para|
|000008d0| 6d 65 74 65 72 73 3a 20 | 63 6f 6e 66 75 73 69 6e |meters: |confusin|
|000008e0| 67 20 22 2d 6d 22 20 61 | 6e 64 20 22 2d 79 22 20 |g "-m" a|nd "-y" |
|000008f0| 66 6c 61 67 73 0a 09 20 | 20 20 64 72 6f 70 70 65 |flags.. | droppe|
|00000900| 64 20 65 6e 74 69 72 65 | 6c 79 2c 20 61 6e 64 20 |d entire|ly, and |
|00000910| 73 65 76 65 72 61 6c 20 | 6e 65 77 20 6f 70 74 69 |several |new opti|
|00000920| 6f 6e 73 20 61 64 64 65 | 64 20 28 73 65 65 20 6d |ons adde|d (see m|
|00000930| 61 6e 20 70 61 67 65 29 | 0a 0a 09 33 29 20 68 6f |an page)|...3) ho|
|00000940| 6c 69 64 61 79 73 20 6e | 65 65 64 20 6e 6f 74 20 |lidays n|eed not |
|00000950| 61 70 70 65 61 72 20 69 | 6e 20 6f 72 64 65 72 0a |appear i|n order.|
|00000960| 0a 09 34 29 20 50 6f 73 | 74 53 63 72 69 70 74 20 |..4) Pos|tScript |
|00000970| 62 6f 69 6c 65 72 70 6c | 61 74 65 20 6d 6f 76 65 |boilerpl|ate move|
|00000980| 64 20 74 6f 20 6e 65 77 | 20 66 69 6c 65 2c 20 70 |d to new| file, p|
|00000990| 63 61 6c 69 6e 69 74 2e | 68 0a 0a 09 35 29 20 73 |calinit.|h...5) s|
|000009a0| 6f 75 72 63 65 20 69 73 | 20 63 6f 6d 70 61 74 69 |ource is| compati|
|000009b0| 62 6c 65 20 77 69 74 68 | 20 56 4d 53 20 61 6e 64 |ble with| VMS and|
|000009c0| 20 55 6e 69 78 0a 0a 09 | 36 29 20 63 6f 6d 70 72 | Unix...|6) compr|
|000009d0| 65 68 65 6e 73 69 76 65 | 20 75 73 61 67 65 20 6d |ehensive| usage m|
|000009e0| 65 73 73 61 67 65 0a 0a | 09 37 29 20 63 6f 6d 6d |essage..|.7) comm|
|000009f0| 65 6e 74 73 20 28 27 23 | 27 20 74 68 72 6f 75 67 |ents ('#|' throug|
|00000a00| 68 20 65 6e 64 2d 6f 66 | 2d 6c 69 6e 65 29 20 73 |h end-of|-line) s|
|00000a10| 75 70 70 6f 72 74 65 64 | 20 69 6e 20 63 61 6c 65 |upported| in cale|
|00000a20| 6e 64 61 72 20 66 69 6c | 65 0a 0a 54 68 65 20 61 |ndar fil|e..The a|
|00000a30| 63 63 6f 6d 70 61 6e 79 | 69 6e 67 20 66 69 6c 65 |ccompany|ing file|
|00000a40| 20 63 61 6c 6c 65 64 20 | 22 52 65 61 64 4d 65 2e | called |"ReadMe.|
|00000a50| 6f 72 69 67 22 20 63 61 | 6d 65 20 77 69 74 68 20 |orig" ca|me with |
|00000a60| 74 68 65 20 6f 72 69 67 | 69 6e 61 6c 20 64 69 73 |the orig|inal dis|
|00000a70| 74 72 69 62 75 74 69 6f | 6e 0a 61 73 20 52 45 41 |tributio|n.as REA|
|00000a80| 44 4d 45 20 61 6e 64 20 | 73 74 61 74 65 73 20 74 |DME and |states t|
|00000a90| 68 69 73 20 70 72 6f 67 | 72 61 6d 20 69 73 20 63 |his prog|ram is c|
|00000aa0| 6f 70 79 72 69 67 68 74 | 65 64 20 62 75 74 20 77 |opyright|ed but w|
|00000ab0| 69 74 68 20 70 65 72 6d | 69 73 73 69 6f 6e 20 74 |ith perm|ission t|
|00000ac0| 6f 20 6d 6f 64 69 66 79 | 0a 61 6e 64 20 72 65 64 |o modify|.and red|
|00000ad0| 69 73 74 72 69 62 75 74 | 65 2e 0a 0a 41 6e 64 72 |istribut|e...Andr|
|00000ae0| 65 77 20 57 2e 20 52 6f | 67 65 72 73 0a 0a 41 64 |ew W. Ro|gers..Ad|
|00000af0| 64 69 74 69 6f 6e 61 6c | 20 6e 6f 74 65 3a 20 54 |ditional| note: T|
|00000b00| 68 69 73 20 64 69 73 74 | 72 69 62 75 74 69 6f 6e |his dist|ribution|
|00000b10| 20 69 6e 63 6c 75 64 65 | 73 20 61 20 56 4d 53 20 | include|s a VMS |
|00000b20| 48 45 4c 50 20 66 69 6c | 65 20 77 72 69 74 74 65 |HELP fil|e writte|
|00000b30| 6e 20 62 79 0a 52 69 63 | 68 61 72 64 20 44 79 73 |n by.Ric|hard Dys|
|00000b40| 6f 6e 2e 20 20 54 68 65 | 20 22 73 74 72 63 61 74 |on. The| "strcat|
|00000b50| 22 20 75 74 69 6c 69 74 | 79 20 77 61 73 20 62 6f |" utilit|y was bo|
|00000b60| 72 72 6f 77 65 64 20 66 | 72 6f 6d 20 4a 65 66 20 |rrowed f|rom Jef |
|00000b70| 50 6f 73 6b 61 6e 7a 65 | 72 27 73 0a 49 44 20 54 |Poskanze|r's.ID T|
|00000b80| 6f 6f 6c 6b 69 74 2e 20 | 20 43 6f 75 6e 74 6c 65 |oolkit. | Countle|
|00000b90| 73 73 20 6f 74 68 65 72 | 20 70 65 6f 70 6c 65 20 |ss other| people |
|00000ba0| 77 6f 72 6b 65 64 20 6f | 6e 20 69 74 20 6c 6f 6e |worked o|n it lon|
|00000bb0| 67 20 62 65 66 6f 72 65 | 20 6d 65 3b 20 73 65 65 |g before| me; see|
|00000bc0| 20 74 68 65 0a 52 65 61 | 64 4d 65 2e 6f 72 69 67 | the.Rea|dMe.orig|
|00000bd0| 20 66 69 6c 65 20 61 6e | 64 20 74 6f 70 6c 69 6e | file an|d toplin|
|00000be0| 65 20 63 6f 6d 6d 65 6e | 74 73 20 69 6e 20 70 63 |e commen|ts in pc|
|00000bf0| 61 6c 2e 63 2e 0a 0a 53 | 48 41 52 5f 45 4f 46 0a |al.c...S|HAR_EOF.|
|00000c00| 66 69 0a 69 66 20 74 65 | 73 74 20 2d 66 20 27 52 |fi.if te|st -f 'R|
|00000c10| 65 61 64 4d 65 2e 6f 72 | 69 67 27 0a 74 68 65 6e |eadMe.or|ig'.then|
|00000c20| 0a 09 65 63 68 6f 20 73 | 68 61 72 3a 20 77 69 6c |..echo s|har: wil|
|00000c30| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|00000c40| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 27 | existin|g file '|
|00000c50| 52 65 61 64 4d 65 2e 6f | 72 69 67 27 0a 65 6c 73 |ReadMe.o|rig'.els|
|00000c60| 65 0a 63 61 74 20 3c 3c | 20 5c 53 48 41 52 5f 45 |e.cat <<| \SHAR_E|
|00000c70| 4f 46 20 3e 20 27 52 65 | 61 64 4d 65 2e 6f 72 69 |OF > 'Re|adMe.ori|
|00000c80| 67 27 0a 22 50 63 61 6c | 22 20 69 73 20 61 20 70 |g'."Pcal|" is a p|
|00000c90| 72 6f 67 72 61 6d 20 74 | 6f 20 70 72 69 6e 74 20 |rogram t|o print |
|00000ca0| 50 6f 73 74 53 63 72 69 | 70 74 20 63 61 6c 65 6e |PostScri|pt calen|
|00000cb0| 64 61 72 73 20 66 6f 72 | 20 61 6e 79 20 6d 6f 6e |dars for| any mon|
|00000cc0| 74 68 20 61 6e 64 20 79 | 65 61 72 2e 0a 42 79 20 |th and y|ear..By |
|00000cd0| 64 65 66 61 75 6c 74 2c | 20 69 74 20 6c 6f 6f 6b |default,| it look|
|00000ce0| 73 20 66 6f 72 20 61 20 | 66 69 6c 65 20 69 6e 20 |s for a |file in |
|00000cf0| 74 68 65 20 68 6f 6d 65 | 20 64 69 72 65 63 74 6f |the home| directo|
|00000d00| 72 79 20 6e 61 6d 65 64 | 20 22 63 61 6c 65 6e 64 |ry named| "calend|
|00000d10| 61 72 22 0a 66 6f 72 20 | 65 6e 74 72 69 65 73 20 |ar".for |entries |
|00000d20| 77 69 74 68 20 6c 65 61 | 64 69 6e 67 20 64 61 74 |with lea|ding dat|
|00000d30| 65 73 20 6d 61 74 63 68 | 69 6e 67 20 64 61 74 65 |es match|ing date|
|00000d40| 73 20 6f 6e 20 74 68 65 | 20 63 61 6c 65 6e 64 61 |s on the| calenda|
|00000d50| 72 2c 20 61 6e 64 20 70 | 72 69 6e 74 73 0a 61 6e |r, and p|rints.an|
|00000d60| 79 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 74 65 78 74 |y follow|ing text|
|00000d70| 20 75 6e 64 65 72 20 74 | 68 65 20 61 70 70 72 6f | under t|he appro|
|00000d80| 70 72 69 61 74 65 20 64 | 61 79 2e 0a 0a 54 68 65 |priate d|ay...The|
|00000d90| 20 70 72 6f 67 72 61 6d | 20 6d 61 79 20 62 65 20 | program| may be |
|00000da0| 61 20 6c 69 74 74 6c 65 | 20 53 79 73 74 65 6d 20 |a little| System |
|00000db0| 56 20 66 6c 61 76 6f 72 | 65 64 20 28 67 65 74 6f |V flavor|ed (geto|
|00000dc0| 70 74 2c 20 74 69 6d 65 | 20 72 6f 75 74 69 6e 65 |pt, time| routine|
|00000dd0| 73 29 0a 62 75 74 20 73 | 68 6f 75 6c 64 20 62 65 |s).but s|hould be|
|00000de0| 20 65 61 73 69 6c 79 20 | 70 6f 72 74 61 62 6c 65 | easily |portable|
|00000df0| 20 74 6f 20 6f 74 68 65 | 72 20 76 69 6e 74 61 67 | to othe|r vintag|
|00000e00| 65 73 20 6f 66 20 55 4e | 49 58 2e 0a 0a 50 63 61 |es of UN|IX...Pca|
|00000e10| 6c 20 69 73 20 74 68 65 | 20 63 6f 6d 62 69 6e 65 |l is the| combine|
|00000e20| 64 20 65 66 66 6f 72 74 | 20 6f 66 20 73 65 76 65 |d effort| of seve|
|00000e30| 72 61 6c 20 70 65 6f 70 | 6c 65 2c 20 6d 6f 73 74 |ral peop|le, most|
|00000e40| 20 6e 6f 74 61 62 6c 79 | 20 50 61 74 72 69 63 6b | notably| Patrick|
|00000e50| 20 57 6f 6f 64 0a 6f 66 | 20 50 69 70 65 6c 69 6e | Wood.of| Pipelin|
|00000e60| 65 20 41 73 73 6f 63 69 | 61 74 65 73 2c 20 49 6e |e Associ|ates, In|
|00000e70| 63 2e 20 66 6f 72 20 74 | 68 65 20 6f 72 69 67 69 |c. for t|he origi|
|00000e80| 6e 61 6c 20 50 6f 73 74 | 53 63 72 69 70 74 20 63 |nal Post|Script c|
|00000e90| 6f 64 65 20 61 6e 64 20 | 42 69 6c 6c 0a 56 6f 67 |ode and |Bill.Vog|
|00000ea0| 65 6c 20 6f 66 20 41 54 | 26 54 20 66 6f 72 20 74 |el of AT|&T for t|
|00000eb0| 68 65 20 63 61 6c 65 6e | 64 61 72 20 66 69 6c 65 |he calen|dar file|
|00000ec0| 20 6d 65 63 68 61 6e 69 | 73 6d 2e 20 20 4d 79 20 | mechani|sm. My |
|00000ed0| 70 61 72 74 20 77 61 73 | 20 73 69 6d 70 6c 65 0a |part was| simple.|
|00000ee0| 74 72 61 6e 73 6c 61 74 | 69 6f 6e 20 74 6f 20 61 |translat|ion to a|
|00000ef0| 20 22 43 22 20 70 72 6f | 67 72 61 6d 2c 20 74 68 | "C" pro|gram, th|
|00000f00| 65 20 61 64 64 69 74 69 | 6f 6e 20 6f 66 20 61 20 |e additi|on of a |
|00000f10| 63 6f 75 70 6c 65 20 6f | 70 74 69 6f 6e 73 20 61 |couple o|ptions a|
|00000f20| 6e 64 20 61 20 6d 6f 72 | 65 0a 67 65 6e 65 72 61 |nd a mor|e.genera|
|00000f30| 6c 69 7a 65 64 20 64 61 | 74 65 20 73 65 61 72 63 |lized da|te searc|
|00000f40| 68 69 6e 67 20 72 6f 75 | 74 69 6e 65 20 28 6f 68 |hing rou|tine (oh|
|00000f50| 20 79 65 73 2c 20 61 6e | 64 20 61 20 6d 61 6e 75 | yes, an|d a manu|
|00000f60| 61 6c 20 70 61 67 65 20 | 3a 2d 29 2e 0a 0a 54 68 |al page |:-)...Th|
|00000f70| 65 20 6f 72 69 67 69 6e | 61 6c 20 63 61 6c 65 6e |e origin|al calen|
|00000f80| 64 61 72 20 50 6f 73 74 | 53 63 72 69 70 74 20 77 |dar Post|Script w|
|00000f90| 61 73 20 43 6f 70 79 72 | 69 67 68 74 20 28 63 29 |as Copyr|ight (c)|
|00000fa0| 20 31 39 38 37 20 62 79 | 20 50 61 74 72 69 63 6b | 1987 by| Patrick|
|00000fb0| 20 57 6f 6f 64 0a 61 6e | 64 20 50 69 70 65 6c 69 | Wood.an|d Pipeli|
|00000fc0| 6e 65 20 41 73 73 6f 63 | 69 61 74 65 73 2c 20 49 |ne Assoc|iates, I|
|00000fd0| 6e 63 2e 20 77 69 74 68 | 20 70 65 72 6d 69 73 73 |nc. with| permiss|
|00000fe0| 69 6f 6e 20 74 6f 20 6d | 6f 64 69 66 79 20 61 6e |ion to m|odify an|
|00000ff0| 64 20 72 65 64 69 73 74 | 72 69 62 75 74 65 2e 0a |d redist|ribute..|
|00001000| 50 6c 65 61 73 65 20 72 | 65 74 61 69 6e 20 74 68 |Please r|etain th|
|00001010| 69 73 20 52 45 41 44 4d | 45 20 66 69 6c 65 20 77 |is READM|E file w|
|00001020| 69 74 68 20 74 68 65 20 | 70 61 63 6b 61 67 65 2e |ith the |package.|
|00001030| 0a 0a 0a 4b 65 6e 20 4b | 65 69 72 6e 61 6e 0a 50 |...Ken K|eirnan.P|
|00001040| 61 63 69 66 69 63 20 42 | 65 6c 6c 0a 53 61 6e 20 |acific B|ell.San |
|00001050| 52 61 6d 6f 6e 2c 20 43 | 41 2e 0a 53 48 41 52 5f |Ramon, C|A..SHAR_|
|00001060| 45 4f 46 0a 66 69 0a 69 | 66 20 74 65 73 74 20 2d |EOF.fi.i|f test -|
|00001070| 66 20 27 63 61 6c 65 6e | 64 61 72 27 0a 74 68 65 |f 'calen|dar'.the|
|00001080| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 77 69 |n..echo |shar: wi|
|00001090| 6c 6c 20 6e 6f 74 20 6f | 76 65 72 2d 77 72 69 74 |ll not o|ver-writ|
|000010a0| 65 20 65 78 69 73 74 69 | 6e 67 20 66 69 6c 65 20 |e existi|ng file |
|000010b0| 27 63 61 6c 65 6e 64 61 | 72 27 0a 65 6c 73 65 0a |'calenda|r'.else.|
|000010c0| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|000010d0| 20 3e 20 27 63 61 6c 65 | 6e 64 61 72 27 0a 23 20 | > 'cale|ndar'.# |
|000010e0| 53 61 6d 70 6c 65 20 63 | 61 6c 65 6e 64 61 72 20 |Sample c|alendar |
|000010f0| 66 69 6c 65 20 66 6f 72 | 20 70 63 61 6c 0a 23 0a |file for| pcal.#.|
|00001100| 23 20 54 68 69 73 20 73 | 68 6f 75 6c 64 20 62 65 |# This s|hould be|
|00001110| 20 7e 2f 63 61 6c 65 6e | 64 61 72 20 6f 6e 20 55 | ~/calen|dar on U|
|00001120| 6e 69 78 2c 20 53 59 53 | 24 4c 4f 47 49 4e 3a 43 |nix, SYS|$LOGIN:C|
|00001130| 41 4c 45 4e 44 41 52 2e | 44 41 54 20 6f 6e 20 56 |ALENDAR.|DAT on V|
|00001140| 4d 53 0a 0a 79 65 61 72 | 20 31 39 39 30 09 09 09 |MS..year| 1990...|
|00001150| 09 23 20 73 65 74 20 79 | 65 61 72 20 65 78 70 6c |.# set y|ear expl|
|00001160| 69 63 69 74 6c 79 0a 0a | 35 2f 32 38 2a 20 4d 65 |icitly..|5/28* Me|
|00001170| 6d 6f 72 69 61 6c 20 44 | 61 79 20 28 6f 62 73 65 |morial D|ay (obse|
|00001180| 72 76 65 64 29 09 09 23 | 20 27 2a 27 20 70 72 69 |rved)..#| '*' pri|
|00001190| 6e 74 73 20 68 6f 6c 69 | 64 61 79 20 69 6e 20 67 |nts holi|day in g|
|000011a0| 72 61 79 0a 35 2f 33 31 | 20 4d 65 6d 6f 72 69 61 |ray.5/31| Memoria|
|000011b0| 6c 20 44 61 79 0a 0a 37 | 2f 34 2f 39 30 2a 20 49 |l Day..7|/4/90* I|
|000011c0| 6e 64 65 70 65 6e 64 65 | 6e 63 65 20 44 61 79 09 |ndepende|nce Day.|
|000011d0| 09 23 20 66 75 6c 6c 20 | 64 61 74 65 20 66 6f 72 |.# full |date for|
|000011e0| 6d 61 74 0a 0a 53 65 70 | 20 33 2a 20 4c 61 62 6f |mat..Sep| 3* Labo|
|000011f0| 72 20 44 61 79 09 09 09 | 23 20 6d 6f 6e 74 68 20 |r Day...|# month |
|00001200| 77 72 69 74 74 65 6e 20 | 6f 75 74 0a 0a 31 30 2f |written |out..10/|
|00001210| 38 2a 20 43 6f 6c 75 6d | 62 75 73 20 44 61 79 20 |8* Colum|bus Day |
|00001220| 28 6f 62 73 65 72 76 65 | 64 29 0a 31 30 2f 31 32 |(observe|d).10/12|
|00001230| 20 43 6f 6c 75 6d 62 75 | 73 20 44 61 79 0a 0a 31 | Columbu|s Day..1|
|00001240| 31 2f 32 32 2a 20 54 68 | 61 6e 6b 73 67 69 76 69 |1/22* Th|anksgivi|
|00001250| 6e 67 0a 31 31 2f 32 33 | 2a 09 09 09 09 09 23 20 |ng.11/23|*.....# |
|00001260| 68 6f 6c 69 64 61 79 20 | 77 69 74 68 6f 75 74 20 |holiday |without |
|00001270| 74 65 78 74 0a 0a 31 32 | 2f 32 34 2a 20 43 68 72 |text..12|/24* Chr|
|00001280| 69 73 74 6d 61 73 0a 31 | 32 2f 32 35 2a 0a 0a 31 |istmas.1|2/25*..1|
|00001290| 2f 31 2f 39 31 2a 20 4e | 65 77 20 59 65 61 72 27 |/1/91* N|ew Year'|
|000012a0| 73 20 44 61 79 09 09 09 | 23 20 73 65 74 20 6e 65 |s Day...|# set ne|
|000012b0| 77 20 79 65 61 72 20 69 | 6d 70 6c 69 63 69 74 6c |w year i|mplicitl|
|000012c0| 79 0a 53 48 41 52 5f 45 | 4f 46 0a 66 69 0a 69 66 |y.SHAR_E|OF.fi.if|
|000012d0| 20 74 65 73 74 20 2d 66 | 20 27 70 63 61 6c 2e 63 | test -f| 'pcal.c|
|000012e0| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|000012f0| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|00001300| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|00001310| 66 69 6c 65 20 27 70 63 | 61 6c 2e 63 27 0a 65 6c |file 'pc|al.c'.el|
|00001320| 73 65 0a 63 61 74 20 3c | 3c 20 5c 53 48 41 52 5f |se.cat <|< \SHAR_|
|00001330| 45 4f 46 20 3e 20 27 70 | 63 61 6c 2e 63 27 0a 2f |EOF > 'p|cal.c'./|
|00001340| 2a 0a 20 2a 20 70 63 61 | 6c 2e 63 20 2d 20 67 65 |*. * pca|l.c - ge|
|00001350| 6e 65 72 61 74 65 20 50 | 6f 73 74 53 63 72 69 70 |nerate P|ostScrip|
|00001360| 74 20 66 69 6c 65 20 74 | 6f 20 70 72 69 6e 74 20 |t file t|o print |
|00001370| 63 61 6c 65 6e 64 61 72 | 20 66 6f 72 20 61 6e 79 |calendar| for any|
|00001380| 20 6d 6f 6e 74 68 20 61 | 6e 64 20 79 65 61 72 0a | month a|nd year.|
|00001390| 20 2a 0a 20 2a 20 54 68 | 65 20 6f 72 69 67 69 6e | *. * Th|e origin|
|000013a0| 61 6c 20 50 6f 73 74 53 | 63 72 69 70 74 20 63 6f |al PostS|cript co|
|000013b0| 64 65 20 74 6f 20 67 65 | 6e 65 72 61 74 65 20 74 |de to ge|nerate t|
|000013c0| 68 65 20 63 61 6c 65 6e | 64 61 72 73 20 77 61 73 |he calen|dars was|
|000013d0| 20 77 72 69 74 74 65 6e | 20 62 79 0a 20 2a 20 50 | written| by. * P|
|000013e0| 61 74 72 69 63 6b 20 57 | 6f 6f 64 20 28 43 6f 70 |atrick W|ood (Cop|
|000013f0| 79 77 72 69 74 65 20 28 | 63 29 20 31 39 38 37 20 |ywrite (|c) 1987 |
|00001400| 62 79 20 50 61 74 72 69 | 63 6b 20 57 6f 6f 64 20 |by Patri|ck Wood |
|00001410| 6f 66 20 50 69 70 65 6c | 69 6e 65 20 41 73 73 6f |of Pipel|ine Asso|
|00001420| 63 69 61 74 65 73 2c 0a | 20 2a 20 49 6e 63 2e 29 |ciates,.| * Inc.)|
|00001430| 2c 20 61 6e 64 20 61 75 | 74 68 6f 72 69 7a 65 64 |, and au|thorized|
|00001440| 20 66 6f 72 20 6d 6f 64 | 69 66 69 63 61 74 69 6f | for mod|ificatio|
|00001450| 6e 20 61 6e 64 20 72 65 | 64 69 73 74 72 69 62 75 |n and re|distribu|
|00001460| 74 69 6f 6e 2e 20 20 54 | 68 65 20 63 61 6c 65 6e |tion. T|he calen|
|00001470| 64 61 72 0a 20 2a 20 66 | 69 6c 65 20 69 6e 63 6c |dar. * f|ile incl|
|00001480| 75 73 69 6f 6e 20 63 6f | 64 65 20 77 61 73 20 6f |usion co|de was o|
|00001490| 72 69 67 69 6e 61 6c 6c | 79 20 77 72 69 74 74 65 |riginall|y writte|
|000014a0| 6e 20 69 6e 20 22 62 73 | 28 31 29 22 20 62 79 20 |n in "bs|(1)" by |
|000014b0| 42 69 6c 6c 20 56 6f 67 | 65 6c 20 6f 66 0a 20 2a |Bill Vog|el of. *|
|000014c0| 20 41 54 26 54 2e 20 20 | 50 61 74 72 69 63 6b 27 | AT&T. |Patrick'|
|000014d0| 73 20 6f 72 69 67 69 6e | 61 6c 20 50 6f 73 74 53 |s origin|al PostS|
|000014e0| 63 72 69 70 74 20 77 61 | 73 20 6d 6f 64 69 66 69 |cript wa|s modifi|
|000014f0| 65 64 20 61 6e 64 20 65 | 6e 68 61 6e 63 65 64 20 |ed and e|nhanced |
|00001500| 73 65 76 65 72 61 6c 0a | 20 2a 20 74 69 6d 65 73 |several.| * times|
|00001510| 20 62 79 20 6f 74 68 65 | 72 73 20 77 68 6f 73 65 | by othe|rs whose|
|00001520| 20 6e 61 6d 65 73 20 68 | 61 76 65 20 72 65 67 72 | names h|ave regr|
|00001530| 65 74 74 61 62 6c 79 20 | 62 65 65 6e 20 6c 6f 73 |ettably |been los|
|00001540| 74 2e 20 20 54 68 69 73 | 20 43 20 76 65 72 73 69 |t. This| C versi|
|00001550| 6f 6e 0a 20 2a 20 77 61 | 73 20 6f 72 69 67 69 6e |on. * wa|s origin|
|00001560| 61 6c 6c 79 20 63 72 65 | 61 74 65 64 20 62 79 20 |ally cre|ated by |
|00001570| 4b 65 6e 20 4b 65 69 72 | 6e 61 6e 20 6f 66 20 50 |Ken Keir|nan of P|
|00001580| 61 63 69 66 69 63 20 42 | 65 6c 6c 3b 20 61 64 64 |acific B|ell; add|
|00001590| 69 74 69 6f 6e 61 6c 0a | 20 2a 20 65 6e 68 61 6e |itional.| * enhan|
|000015a0| 63 65 6d 65 6e 74 73 20 | 62 79 20 4a 6f 73 65 70 |cements |by Josep|
|000015b0| 68 20 50 2e 20 4c 61 72 | 73 6f 6e 2c 20 45 64 20 |h P. Lar|son, Ed |
|000015c0| 48 61 6e 64 2c 20 61 6e | 64 20 41 6e 64 72 65 77 |Hand, an|d Andrew|
|000015d0| 20 52 6f 67 65 72 73 20 | 28 77 68 6f 20 61 6c 73 | Rogers |(who als|
|000015e0| 6f 0a 20 2a 20 64 69 64 | 20 74 68 65 20 56 4d 53 |o. * did| the VMS|
|000015f0| 20 70 6f 72 74 29 2e 0a | 20 2a 0a 20 2a 09 50 61 | port)..| *. *.Pa|
|00001600| 72 61 6d 65 74 65 72 73 | 3a 0a 20 2a 0a 20 2a 09 |rameters|:. *. *.|
|00001610| 09 70 63 61 6c 20 5b 6f | 70 74 73 5d 09 09 67 65 |.pcal [o|pts]..ge|
|00001620| 6e 65 72 61 74 65 20 63 | 61 6c 65 6e 64 61 72 20 |nerate c|alendar |
|00001630| 66 6f 72 20 63 75 72 72 | 65 6e 74 20 6d 6f 6e 74 |for curr|ent mont|
|00001640| 68 2f 79 65 61 72 0a 20 | 2a 0a 20 2a 09 09 70 63 |h/year. |*. *..pc|
|00001650| 61 6c 20 5b 6f 70 74 73 | 5d 20 79 79 09 09 67 65 |al [opts|] yy..ge|
|00001660| 6e 65 72 61 74 65 20 63 | 61 6c 65 6e 64 61 72 20 |nerate c|alendar |
|00001670| 66 6f 72 20 65 6e 74 69 | 72 65 20 79 65 61 72 20 |for enti|re year |
|00001680| 79 79 0a 20 2a 0a 20 2a | 09 09 70 63 61 6c 20 5b |yy. *. *|..pcal [|
|00001690| 6f 70 74 73 5d 20 6d 6d | 20 79 79 09 67 65 6e 65 |opts] mm| yy.gene|
|000016a0| 72 61 74 65 20 63 61 6c | 65 6e 64 61 72 20 66 6f |rate cal|endar fo|
|000016b0| 72 20 6d 6f 6e 74 68 20 | 6d 6d 0a 20 2a 09 09 09 |r month |mm. *...|
|000016c0| 09 09 28 4a 61 6e 20 3d | 20 31 29 2c 20 79 65 61 |..(Jan =| 1), yea|
|000016d0| 72 20 79 79 20 28 31 39 | 79 79 20 69 66 20 79 79 |r yy (19|yy if yy|
|000016e0| 20 3c 20 31 30 30 29 0a | 20 2a 0a 20 2a 09 09 70 | < 100).| *. *..p|
|000016f0| 63 61 6c 20 5b 6f 70 74 | 73 5d 20 6d 6d 20 79 79 |cal [opt|s] mm yy|
|00001700| 20 6e 09 61 73 20 61 62 | 6f 76 65 2c 20 66 6f 72 | n.as ab|ove, for|
|00001710| 20 6e 20 63 6f 6e 73 65 | 63 75 74 69 76 65 20 6d | n conse|cutive m|
|00001720| 6f 6e 74 68 73 0a 20 2a | 0a 20 2a 09 4f 75 74 70 |onths. *|. *.Outp|
|00001730| 75 74 3a 0a 20 2a 0a 20 | 2a 09 09 50 6f 73 74 53 |ut:. *. |*..PostS|
|00001740| 63 72 69 70 74 20 66 69 | 6c 65 20 74 6f 20 70 72 |cript fi|le to pr|
|00001750| 69 6e 74 20 63 61 6c 65 | 6e 64 61 72 73 20 66 6f |int cale|ndars fo|
|00001760| 72 20 61 6c 6c 20 73 65 | 6c 65 63 74 65 64 20 6d |r all se|lected m|
|00001770| 6f 6e 74 68 73 2e 0a 20 | 2a 0a 20 2a 09 4f 70 74 |onths.. |*. *.Opt|
|00001780| 69 6f 6e 73 3a 0a 20 2a | 0a 20 2a 09 09 2d 64 20 |ions:. *|. *..-d |
|00001790| 3c 46 4f 4e 54 3e 09 73 | 70 65 63 69 66 79 20 61 |<FONT>.s|pecify a|
|000017a0| 6c 74 65 72 6e 61 74 65 | 20 66 6f 6e 74 20 66 6f |lternate| font fo|
|000017b0| 72 20 64 61 79 20 6e 61 | 6d 65 73 0a 20 2a 09 09 |r day na|mes. *..|
|000017c0| 09 09 28 64 65 66 61 75 | 6c 74 3a 20 54 69 6d 65 |..(defau|lt: Time|
|000017d0| 73 2d 42 6f 6c 64 29 0a | 20 2a 0a 20 2a 09 09 2d |s-Bold).| *. *..-|
|000017e0| 65 09 09 67 65 6e 65 72 | 61 74 65 20 65 6d 70 74 |e..gener|ate empt|
|000017f0| 79 20 63 61 6c 65 6e 64 | 61 72 20 28 69 67 6e 6f |y calend|ar (igno|
|00001800| 72 65 20 64 61 74 65 20 | 66 69 6c 65 29 0a 20 2a |re date |file). *|
|00001810| 0a 20 2a 09 09 2d 66 20 | 3c 46 49 4c 45 3e 09 73 |. *..-f |<FILE>.s|
|00001820| 70 65 63 69 66 79 20 61 | 6c 74 65 72 6e 61 74 65 |pecify a|lternate|
|00001830| 20 64 61 74 65 20 66 69 | 6c 65 20 28 64 65 66 61 | date fi|le (defa|
|00001840| 75 6c 74 3a 0a 20 2a 09 | 09 09 09 7e 2f 63 61 6c |ult:. *.|...~/cal|
|00001850| 65 6e 64 61 72 20 6f 6e | 20 55 6e 69 78 2c 20 53 |endar on| Unix, S|
|00001860| 59 53 24 4c 4f 47 49 4e | 3a 43 41 4c 45 4e 44 41 |YS$LOGIN|:CALENDA|
|00001870| 52 2e 44 41 54 0a 20 2a | 09 09 09 09 6f 6e 20 56 |R.DAT. *|....on V|
|00001880| 4d 53 29 0a 20 2a 0a 20 | 2a 09 09 2d 6f 20 3c 46 |MS). *. |*..-o <F|
|00001890| 49 4c 45 3e 09 73 70 65 | 63 69 66 79 20 61 6c 74 |ILE>.spe|cify alt|
|000018a0| 65 72 6e 61 74 65 20 6f | 75 74 70 75 74 20 66 69 |ernate o|utput fi|
|000018b0| 6c 65 20 28 64 65 66 61 | 75 6c 74 3a 0a 20 2a 09 |le (defa|ult:. *.|
|000018c0| 09 09 09 73 74 64 6f 75 | 74 20 6f 6e 20 55 6e 69 |...stdou|t on Uni|
|000018d0| 78 2c 20 43 41 4c 45 4e | 44 41 52 2e 50 53 20 6f |x, CALEN|DAR.PS o|
|000018e0| 6e 20 56 4d 53 29 0a 20 | 2a 0a 20 2a 09 09 2d 72 |n VMS). |*. *..-r|
|000018f0| 09 09 67 65 6e 65 72 61 | 74 65 20 70 6f 72 74 72 |..genera|te portr|
|00001900| 61 69 74 2d 73 74 79 6c | 65 20 63 61 6c 65 6e 64 |ait-styl|e calend|
|00001910| 61 72 73 0a 20 2a 09 09 | 09 09 28 64 65 66 61 75 |ars. *..|..(defau|
|00001920| 6c 74 3a 20 6c 61 6e 64 | 73 63 61 70 65 29 0a 20 |lt: land|scape). |
|00001930| 2a 0a 20 2a 09 09 2d 73 | 09 09 70 72 69 6e 74 20 |*. *..-s|..print |
|00001940| 53 61 74 75 72 64 61 79 | 73 20 69 6e 20 62 6c 61 |Saturday|s in bla|
|00001950| 63 6b 0a 20 2a 09 09 2d | 53 09 09 70 72 69 6e 74 |ck. *..-|S..print|
|00001960| 20 53 61 74 75 72 64 61 | 79 73 20 61 6e 64 20 53 | Saturda|ys and S|
|00001970| 75 6e 64 61 79 73 20 69 | 6e 20 62 6c 61 63 6b 0a |undays i|n black.|
|00001980| 20 2a 09 09 09 09 28 64 | 65 66 61 75 6c 74 3a 20 | *....(d|efault: |
|00001990| 70 72 69 6e 74 20 53 61 | 74 75 72 64 61 79 73 20 |print Sa|turdays |
|000019a0| 61 6e 64 20 53 75 6e 64 | 61 79 73 20 69 6e 20 67 |and Sund|ays in g|
|000019b0| 72 61 79 29 0a 20 2a 09 | 09 0a 20 2a 09 09 2d 74 |ray). *.|.. *..-t|
|000019c0| 20 3c 46 4f 4e 54 3e 09 | 73 70 65 63 69 66 79 20 | <FONT>.|specify |
|000019d0| 61 6c 74 65 72 6e 61 74 | 65 20 66 6f 6e 74 20 66 |alternat|e font f|
|000019e0| 6f 72 20 74 69 74 6c 65 | 73 0a 20 2a 09 09 09 09 |or title|s. *....|
|000019f0| 28 64 65 66 61 75 6c 74 | 3a 20 54 69 6d 65 73 2d |(default|: Times-|
|00001a00| 42 6f 6c 64 29 0a 20 2a | 0a 20 2a 09 09 50 61 72 |Bold). *|. *..Par|
|00001a10| 61 6d 65 74 65 72 73 20 | 61 6e 64 20 66 6c 61 67 |ameters |and flag|
|00001a20| 73 20 6d 61 79 20 62 65 | 20 6d 69 78 65 64 20 6f |s may be| mixed o|
|00001a30| 6e 20 74 68 65 20 63 6f | 6d 6d 61 6e 64 20 6c 69 |n the co|mmand li|
|00001a40| 6e 65 2e 0a 20 2a 2f 0a | 0a 23 69 6e 63 6c 75 64 |ne.. */.|.#includ|
|00001a50| 65 20 3c 73 74 64 69 6f | 2e 68 3e 0a 23 69 6e 63 |e <stdio|.h>.#inc|
|00001a60| 6c 75 64 65 20 3c 63 74 | 79 70 65 2e 68 3e 0a 23 |lude <ct|ype.h>.#|
|00001a70| 69 6e 63 6c 75 64 65 20 | 3c 74 69 6d 65 2e 68 3e |include |<time.h>|
|00001a80| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 72 69 6e |.#includ|e <strin|
|00001a90| 67 2e 68 3e 0a 0a 23 69 | 66 64 65 66 20 56 4d 53 |g.h>..#i|fdef VMS|
|00001aa0| 0a 23 64 65 66 69 6e 65 | 20 49 4e 46 49 4c 45 20 |.#define| INFILE |
|00001ab0| 20 22 53 59 53 24 4c 4f | 47 49 4e 3a 43 41 4c 45 | "SYS$LO|GIN:CALE|
|00001ac0| 4e 44 41 52 2e 44 41 54 | 22 0a 23 64 65 66 69 6e |NDAR.DAT|".#defin|
|00001ad0| 65 20 4f 55 54 46 49 4c | 45 20 22 43 41 4c 45 4e |e OUTFIL|E "CALEN|
|00001ae0| 44 41 52 2e 50 53 22 0a | 23 64 65 66 69 6e 65 20 |DAR.PS".|#define |
|00001af0| 53 5f 4f 50 54 20 22 5c | 22 53 5c 22 22 0a 23 64 |S_OPT "\|"S\"".#d|
|00001b00| 65 66 69 6e 65 20 45 4e | 44 5f 50 41 54 48 20 27 |efine EN|D_PATH '|
|00001b10| 5d 27 0a 23 64 65 66 69 | 6e 65 20 45 58 49 54 5f |]'.#defi|ne EXIT_|
|00001b20| 53 55 43 43 45 53 53 20 | 31 0a 23 64 65 66 69 6e |SUCCESS |1.#defin|
|00001b30| 65 20 45 58 49 54 5f 46 | 41 49 4c 55 52 45 20 33 |e EXIT_F|AILURE 3|
|00001b40| 0a 23 65 6c 73 65 0a 23 | 64 65 66 69 6e 65 20 49 |.#else.#|define I|
|00001b50| 4e 46 49 4c 45 20 20 22 | 7e 2f 63 61 6c 65 6e 64 |NFILE "|~/calend|
|00001b60| 61 72 22 0a 23 64 65 66 | 69 6e 65 20 4f 55 54 46 |ar".#def|ine OUTF|
|00001b70| 49 4c 45 20 28 28 63 68 | 61 72 20 2a 29 30 29 0a |ILE ((ch|ar *)0).|
|00001b80| 23 64 65 66 69 6e 65 20 | 53 5f 4f 50 54 20 22 53 |#define |S_OPT "S|
|00001b90| 22 0a 23 64 65 66 69 6e | 65 20 45 4e 44 5f 50 41 |".#defin|e END_PA|
|00001ba0| 54 48 20 27 2f 27 0a 23 | 64 65 66 69 6e 65 20 45 |TH '/'.#|define E|
|00001bb0| 58 49 54 5f 53 55 43 43 | 45 53 53 20 30 0a 23 64 |XIT_SUCC|ESS 0.#d|
|00001bc0| 65 66 69 6e 65 20 45 58 | 49 54 5f 46 41 49 4c 55 |efine EX|IT_FAILU|
|00001bd0| 52 45 20 31 0a 23 65 6e | 64 69 66 0a 0a 23 64 65 |RE 1.#en|dif..#de|
|00001be0| 66 69 6e 65 20 44 41 59 | 46 4f 4e 54 20 20 20 22 |fine DAY|FONT "|
|00001bf0| 54 69 6d 65 73 2d 42 6f | 6c 64 22 0a 23 64 65 66 |Times-Bo|ld".#def|
|00001c00| 69 6e 65 20 54 49 54 4c | 45 46 4f 4e 54 20 22 54 |ine TITL|EFONT "T|
|00001c10| 69 6d 65 73 2d 42 6f 6c | 64 22 0a 0a 23 64 65 66 |imes-Bol|d"..#def|
|00001c20| 69 6e 65 20 46 41 4c 53 | 45 09 30 0a 23 64 65 66 |ine FALS|E.0.#def|
|00001c30| 69 6e 65 20 54 52 55 45 | 09 31 0a 0a 23 64 65 66 |ine TRUE|.1..#def|
|00001c40| 69 6e 65 20 50 52 54 09 | 28 76 6f 69 64 29 70 72 |ine PRT.|(void)pr|
|00001c50| 69 6e 74 66 0a 23 64 65 | 66 69 6e 65 20 46 50 52 |intf.#de|fine FPR|
|00001c60| 09 28 76 6f 69 64 29 66 | 70 72 69 6e 74 66 0a 0a |.(void)f|printf..|
|00001c70| 23 64 65 66 69 6e 65 20 | 4d 49 4e 5f 59 52 09 31 |#define |MIN_YR.1|
|00001c80| 39 30 30 0a 23 64 65 66 | 69 6e 65 20 4d 41 58 5f |900.#def|ine MAX_|
|00001c90| 59 52 09 39 39 39 39 0a | 0a 23 64 65 66 69 6e 65 |YR.9999.|.#define|
|00001ca0| 20 4d 41 58 41 52 47 53 | 20 33 0a 23 64 65 66 69 | MAXARGS| 3.#defi|
|00001cb0| 6e 65 20 48 4f 4c 49 44 | 41 59 09 28 31 20 3c 3c |ne HOLID|AY.(1 <<|
|00001cc0| 20 36 29 09 2f 2a 20 62 | 69 74 20 73 65 74 20 74 | 6)./* b|it set t|
|00001cd0| 6f 20 66 6c 61 67 20 64 | 61 79 20 61 73 20 68 6f |o flag d|ay as ho|
|00001ce0| 6c 69 64 61 79 20 2a 2f | 0a 0a 63 68 61 72 20 2a |liday */|..char *|
|00001cf0| 77 6f 72 64 73 5b 31 30 | 30 5d 3b 09 2f 2a 20 6d |words[10|0];./* m|
|00001d00| 61 78 69 6d 75 6d 20 6e | 75 6d 62 65 72 20 6f 66 |aximum n|umber of|
|00001d10| 20 77 6f 72 64 73 20 6f | 6e 20 61 20 6c 69 6e 65 | words o|n a line|
|00001d20| 20 2a 2f 0a 63 68 61 72 | 20 6c 62 75 66 5b 35 31 | */.char| lbuf[51|
|00001d30| 32 5d 3b 09 09 2f 2a 20 | 6d 61 78 69 6d 75 6d 20 |2];../* |maximum |
|00001d40| 6c 69 6e 65 20 73 69 7a | 65 20 2a 2f 0a 0a 63 68 |line siz|e */..ch|
|00001d50| 61 72 20 2a 6d 6f 6e 74 | 68 73 5b 5d 20 3d 20 7b |ar *mont|hs[] = {|
|00001d60| 09 2f 2a 20 75 73 65 64 | 20 74 6f 20 6d 61 74 63 |./* used| to matc|
|00001d70| 68 20 61 6c 70 68 61 20 | 6d 6f 6e 74 68 73 20 2a |h alpha |months *|
|00001d80| 2f 0a 09 22 6a 61 6e 22 | 2c 20 22 66 65 62 22 2c |/.."jan"|, "feb",|
|00001d90| 20 22 6d 61 72 22 2c 20 | 22 61 70 72 22 2c 20 22 | "mar", |"apr", "|
|00001da0| 6d 61 79 22 2c 20 22 6a | 75 6e 22 2c 0a 09 22 6a |may", "j|un",.."j|
|00001db0| 75 6c 22 2c 20 22 61 75 | 67 22 2c 20 22 73 65 70 |ul", "au|g", "sep|
|00001dc0| 22 2c 20 22 6f 63 74 22 | 2c 20 22 6e 6f 76 22 2c |", "oct"|, "nov",|
|00001dd0| 20 22 64 65 63 22 2c 0a | 09 28 63 68 61 72 20 2a | "dec",.|.(char *|
|00001de0| 29 30 2c 0a 7d 3b 0a 0a | 23 69 6e 63 6c 75 64 65 |)0,.};..|#include|
|00001df0| 20 22 70 63 61 6c 69 6e | 69 74 2e 68 22 09 2f 2a | "pcalin|it.h"./*|
|00001e00| 20 50 6f 73 74 53 63 72 | 69 70 74 20 62 6f 69 6c | PostScr|ipt boil|
|00001e10| 65 72 70 6c 61 74 65 20 | 2a 2f 0a 0a 46 49 4c 45 |erplate |*/..FILE|
|00001e20| 20 2a 63 66 70 20 3d 20 | 4e 55 4c 4c 3b 0a 69 6e | *cfp = |NULL;.in|
|00001e30| 74 20 63 75 72 72 5f 79 | 65 61 72 3b 0a 0a 0c 0a |t curr_y|ear;....|
|00001e40| 6d 61 69 6e 28 61 72 67 | 63 2c 20 61 72 67 76 29 |main(arg|c, argv)|
|00001e50| 0a 09 69 6e 74 20 61 72 | 67 63 3b 0a 09 63 68 61 |..int ar|gc;..cha|
|00001e60| 72 20 2a 2a 61 72 67 76 | 3b 0a 7b 0a 0a 2f 2a 20 |r **argv|;.{../* |
|00001e70| 4c 6f 6f 6b 20 66 6f 72 | 20 74 68 65 20 61 72 67 |Look for| the arg|
|00001e80| 75 6d 65 6e 74 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |ument fo|llowing |
|00001e90| 61 20 66 6c 61 67 20 2d | 20 6d 61 79 20 62 65 20 |a flag -| may be |
|00001ea0| 73 65 70 61 72 61 74 65 | 64 20 62 79 20 73 70 61 |separate|d by spa|
|00001eb0| 63 65 73 20 6f 72 0a 20 | 2a 20 6e 6f 74 2e 20 20 |ces or. |* not. |
|00001ec0| 49 66 20 6e 6f 20 61 72 | 67 75 6d 65 6e 74 20 61 |If no ar|gument a|
|00001ed0| 70 70 65 61 72 73 2c 20 | 6c 65 61 76 65 20 22 61 |ppears, |leave "a|
|00001ee0| 72 67 22 20 61 6c 6f 6e | 65 0a 20 2a 2f 0a 23 64 |rg" alon|e. */.#d|
|00001ef0| 65 66 69 6e 65 20 47 45 | 54 41 52 47 28 61 72 67 |efine GE|TARG(arg|
|00001f00| 29 20 69 66 20 28 28 70 | 61 72 67 20 3d 20 2a 2b |) if ((p|arg = *+|
|00001f10| 2b 6f 70 74 20 3f 20 6f | 70 74 20 3a 20 5c 0a 09 |+opt ? o|pt : \..|
|00001f20| 09 09 28 2a 28 61 72 67 | 76 2b 31 29 20 26 26 20 |..(*(arg|v+1) && |
|00001f30| 2a 2a 28 61 72 67 76 2b | 31 29 20 21 3d 20 27 2d |**(argv+|1) != '-|
|00001f40| 27 20 3f 20 2a 2b 2b 61 | 72 67 76 20 3a 20 4e 55 |' ? *++a|rgv : NU|
|00001f50| 4c 4c 29 20 29 20 5c 0a | 09 09 09 21 3d 20 4e 55 |LL) ) \.|...!= NU|
|00001f60| 4c 4c 29 20 61 72 67 20 | 3d 20 70 61 72 67 3b 20 |LL) arg |= parg; |
|00001f70| 65 6c 73 65 0a 0a 2f 2a | 20 4c 6f 6f 70 20 74 68 |else../*| Loop th|
|00001f80| 72 6f 75 67 68 20 6f 6e | 65 20 6f 66 20 74 68 65 |rough on|e of the|
|00001f90| 20 68 65 61 64 65 72 20 | 73 65 63 74 69 6f 6e 73 | header |sections|
|00001fa0| 20 69 6e 20 70 63 61 6c | 69 6e 69 74 2e 68 20 2a | in pcal|init.h *|
|00001fb0| 2f 0a 23 64 65 66 69 6e | 65 20 44 4f 48 45 41 44 |/.#defin|e DOHEAD|
|00001fc0| 45 52 28 70 68 64 72 29 | 20 66 6f 72 20 28 61 70 |ER(phdr)| for (ap|
|00001fd0| 20 3d 20 70 68 64 72 3b | 20 2a 61 70 3b 20 61 70 | = phdr;| *ap; ap|
|00001fe0| 2b 2b 29 20 50 52 54 28 | 22 25 73 5c 6e 22 2c 20 |++) PRT(|"%s\n", |
|00001ff0| 2a 61 70 29 0a 0a 09 63 | 68 61 72 20 2a 70 72 6f |*ap)...c|har *pro|
|00002000| 67 6e 61 6d 65 20 3d 20 | 2a 2a 61 72 67 76 20 3f |gname = |**argv ?|
|00002010| 20 2a 61 72 67 76 20 3a | 20 22 70 63 61 6c 22 3b | *argv :| "pcal";|
|00002020| 0a 09 73 74 72 75 63 74 | 20 74 6d 20 2a 70 5f 74 |..struct| tm *p_t|
|00002030| 6d 3b 0a 09 72 65 67 69 | 73 74 65 72 20 63 68 61 |m;..regi|ster cha|
|00002040| 72 20 2a 2a 61 70 3b 0a | 09 72 65 67 69 73 74 65 |r **ap;.|.registe|
|00002050| 72 20 63 68 61 72 20 2a | 63 70 3b 0a 09 63 68 61 |r char *|cp;..cha|
|00002060| 72 20 2a 64 61 74 65 5f | 66 69 6c 65 20 3d 20 4e |r *date_|file = N|
|00002070| 55 4c 4c 3b 0a 09 63 68 | 61 72 20 2a 6f 70 74 2c |ULL;..ch|ar *opt,|
|00002080| 20 2a 70 6e 75 6d 2c 20 | 2a 70 61 72 67 2c 20 2a | *pnum, |*parg, *|
|00002090| 70 3b 0a 09 6c 6f 6e 67 | 20 74 6d 70 3b 0a 09 69 |p;..long| tmp;..i|
|000020a0| 6e 74 20 6e 6f 63 61 6c | 20 3d 20 46 41 4c 53 45 |nt nocal| = FALSE|
|000020b0| 3b 0a 09 69 6e 74 20 73 | 61 74 5f 67 72 61 79 20 |;..int s|at_gray |
|000020c0| 3d 20 54 52 55 45 3b 0a | 09 69 6e 74 20 73 75 6e |= TRUE;.|.int sun|
|000020d0| 5f 67 72 61 79 20 3d 20 | 54 52 55 45 3b 0a 20 09 |_gray = |TRUE;. .|
|000020e0| 63 68 61 72 20 2a 74 69 | 74 6c 65 66 6f 6e 74 20 |char *ti|tlefont |
|000020f0| 3d 20 54 49 54 4c 45 46 | 4f 4e 54 3b 0a 20 09 63 |= TITLEF|ONT;. .c|
|00002100| 68 61 72 20 2a 64 61 79 | 66 6f 6e 74 20 3d 20 44 |har *day|font = D|
|00002110| 41 59 46 4f 4e 54 3b 0a | 09 63 68 61 72 20 2a 6f |AYFONT;.|.char *o|
|00002120| 75 74 66 69 6c 65 20 3d | 20 4f 55 54 46 49 4c 45 |utfile =| OUTFILE|
|00002130| 3b 0a 20 09 69 6e 74 20 | 72 6f 74 61 74 65 20 3d |;. .int |rotate =|
|00002140| 20 39 30 3b 0a 20 09 69 | 6e 74 20 6d 6f 6e 74 68 | 90;. .i|nt month|
|00002150| 2c 20 79 65 61 72 2c 20 | 6e 6d 6f 6e 74 68 73 3b |, year, |nmonths;|
|00002160| 0a 09 69 6e 74 20 62 61 | 64 6f 70 74 20 3d 20 46 |..int ba|dopt = F|
|00002170| 41 4c 53 45 3b 09 09 2f | 2a 20 66 6c 61 67 20 73 |ALSE;../|* flag s|
|00002180| 65 74 20 69 66 20 62 61 | 64 20 6f 70 74 69 6f 6e |et if ba|d option|
|00002190| 20 20 2a 2f 0a 09 69 6e | 74 20 62 61 64 70 61 72 | */..in|t badpar|
|000021a0| 20 3d 20 46 41 4c 53 45 | 3b 09 09 2f 2a 20 66 6c | = FALSE|;../* fl|
|000021b0| 61 67 20 73 65 74 20 69 | 66 20 62 61 64 20 70 61 |ag set i|f bad pa|
|000021c0| 72 61 6d 20 20 20 2a 2f | 0a 09 69 6e 74 20 6e 61 |ram */|..int na|
|000021d0| 72 67 73 20 3d 20 30 3b | 09 09 09 2f 2a 20 63 6f |rgs = 0;|.../* co|
|000021e0| 75 6e 74 20 6f 66 20 6e | 6f 6e 2d 66 6c 61 67 20 |unt of n|on-flag |
|000021f0| 61 72 67 73 20 20 2a 2f | 0a 09 69 6e 74 20 6e 75 |args */|..int nu|
|00002200| 6d 61 72 67 73 5b 4d 41 | 58 41 52 47 53 5d 3b 09 |margs[MA|XARGS];.|
|00002210| 09 2f 2a 20 6e 6f 6e 2d | 66 6c 61 67 20 28 6e 75 |./* non-|flag (nu|
|00002220| 6d 65 72 69 63 29 20 61 | 72 67 73 20 2a 2f 0a 0a |meric) a|rgs */..|
|00002230| 09 2f 2a 20 69 73 6f 6c | 61 74 65 20 72 6f 6f 74 |./* isol|ate root|
|00002240| 20 70 72 6f 67 72 61 6d | 20 6e 61 6d 65 20 28 66 | program| name (f|
|00002250| 6f 72 20 75 73 65 20 69 | 6e 20 65 72 72 6f 72 20 |or use i|n error |
|00002260| 6d 65 73 73 61 67 65 73 | 29 20 2a 2f 0a 0a 09 69 |messages|) */...i|
|00002270| 66 20 28 28 70 20 3d 20 | 73 74 72 72 63 68 72 28 |f ((p = |strrchr(|
|00002280| 70 72 6f 67 6e 61 6d 65 | 2c 20 45 4e 44 5f 50 41 |progname|, END_PA|
|00002290| 54 48 29 29 20 21 3d 20 | 4e 55 4c 4c 29 0a 09 09 |TH)) != |NULL)...|
|000022a0| 70 72 6f 67 6e 61 6d 65 | 20 3d 20 2b 2b 70 3b 0a |progname| = ++p;.|
|000022b0| 09 69 66 20 28 28 70 20 | 3d 20 73 74 72 63 68 72 |.if ((p |= strchr|
|000022c0| 28 70 72 6f 67 6e 61 6d | 65 2c 20 27 2e 27 29 29 |(prognam|e, '.'))|
|000022d0| 20 21 3d 20 4e 55 4c 4c | 29 0a 09 09 2a 70 20 3d | != NULL|)...*p =|
|000022e0| 20 27 5c 30 27 3b 0a 0a | 09 2f 2a 20 77 61 6c 6b | '\0';..|./* walk|
|000022f0| 20 74 68 72 6f 75 67 68 | 20 63 6f 6d 6d 61 6e 64 | through| command|
|00002300| 2d 6c 69 6e 65 20 61 72 | 67 75 6d 65 6e 74 73 20 |-line ar|guments |
|00002310| 2a 2f 0a 0a 20 09 77 68 | 69 6c 65 20 28 2a 2b 2b |*/.. .wh|ile (*++|
|00002320| 61 72 67 76 29 20 7b 0a | 0a 09 09 69 66 20 28 2a |argv) {.|...if (*|
|00002330| 2a 61 72 67 76 20 21 3d | 20 27 2d 27 29 20 7b 09 |*argv !=| '-') {.|
|00002340| 2f 2a 20 61 73 73 75 6d | 65 20 6e 75 6d 65 72 69 |/* assum|e numeri|
|00002350| 63 20 61 72 67 75 6d 65 | 6e 74 20 2a 2f 0a 09 09 |c argume|nt */...|
|00002360| 20 20 20 20 09 69 66 20 | 28 6e 61 72 67 73 20 3c | .if |(nargs <|
|00002370| 20 4d 41 58 41 52 47 53 | 29 0a 09 09 09 09 6e 75 | MAXARGS|).....nu|
|00002380| 6d 61 72 67 73 5b 6e 61 | 72 67 73 2b 2b 5d 20 3d |margs[na|rgs++] =|
|00002390| 20 61 74 6f 69 28 2a 61 | 72 67 76 29 3b 0a 09 09 | atoi(*a|rgv);...|
|000023a0| 09 63 6f 6e 74 69 6e 75 | 65 3b 0a 09 09 09 7d 0a |.continu|e;....}.|
|000023b0| 0a 09 09 6f 70 74 20 3d | 20 28 2a 61 72 67 76 29 |...opt =| (*argv)|
|000023c0| 20 2b 20 31 3b 0a 09 09 | 73 77 69 74 63 68 20 28 | + 1;...|switch (|
|000023d0| 2a 6f 70 74 29 20 7b 0a | 0a 20 09 09 63 61 73 65 |*opt) {.|. ..case|
|000023e0| 20 27 64 27 3a 09 09 2f | 2a 20 73 70 65 63 69 66 | 'd':../|* specif|
|000023f0| 79 20 61 6c 74 65 72 6e | 61 74 65 20 64 61 79 20 |y altern|ate day |
|00002400| 66 6f 6e 74 20 2a 2f 0a | 20 09 09 09 47 45 54 41 |font */.| ...GETA|
|00002410| 52 47 28 64 61 79 66 6f | 6e 74 29 3b 0a 20 09 09 |RG(dayfo|nt);. ..|
|00002420| 09 62 72 65 61 6b 3b 0a | 0a 09 09 63 61 73 65 20 |.break;.|...case |
|00002430| 27 65 27 3a 09 09 2f 2a | 20 67 65 6e 65 72 61 74 |'e':../*| generat|
|00002440| 65 20 65 6d 70 74 79 20 | 63 61 6c 65 6e 64 61 72 |e empty |calendar|
|00002450| 20 2a 2f 0a 09 09 09 6e | 6f 63 61 6c 20 3d 20 54 | */....n|ocal = T|
|00002460| 52 55 45 3b 0a 09 09 09 | 64 61 74 65 5f 66 69 6c |RUE;....|date_fil|
|00002470| 65 20 3d 20 4e 55 4c 4c | 3b 0a 09 09 09 62 72 65 |e = NULL|;....bre|
|00002480| 61 6b 3b 0a 0a 09 09 63 | 61 73 65 20 27 66 27 3a |ak;....c|ase 'f':|
|00002490| 09 09 2f 2a 20 73 70 65 | 63 69 66 79 20 61 6c 74 |../* spe|cify alt|
|000024a0| 65 72 6e 61 74 65 20 63 | 61 6c 65 6e 64 61 72 20 |ernate c|alendar |
|000024b0| 66 69 6c 65 20 2a 2f 0a | 09 09 09 47 45 54 41 52 |file */.|...GETAR|
|000024c0| 47 28 64 61 74 65 5f 66 | 69 6c 65 29 3b 0a 09 09 |G(date_f|ile);...|
|000024d0| 09 6e 6f 63 61 6c 20 3d | 20 46 41 4c 53 45 3b 0a |.nocal =| FALSE;.|
|000024e0| 09 09 09 62 72 65 61 6b | 3b 0a 0a 09 09 63 61 73 |...break|;....cas|
|000024f0| 65 20 27 6f 27 3a 09 09 | 2f 2a 20 73 70 65 63 69 |e 'o':..|/* speci|
|00002500| 66 79 20 61 6c 74 65 72 | 6e 61 74 65 20 6f 75 74 |fy alter|nate out|
|00002510| 70 75 74 20 66 69 6c 65 | 20 2a 2f 0a 09 09 09 47 |put file| */....G|
|00002520| 45 54 41 52 47 28 6f 75 | 74 66 69 6c 65 29 3b 0a |ETARG(ou|tfile);.|
|00002530| 09 09 09 62 72 65 61 6b | 3b 0a 0a 20 09 09 63 61 |...break|;.. ..ca|
|00002540| 73 65 20 27 72 27 3a 09 | 09 2f 2a 20 67 65 6e 65 |se 'r':.|./* gene|
|00002550| 72 61 74 65 20 70 6f 72 | 74 72 61 69 74 20 63 61 |rate por|trait ca|
|00002560| 6c 65 6e 64 61 72 20 2a | 2f 0a 20 09 09 09 72 6f |lendar *|/. ...ro|
|00002570| 74 61 74 65 20 3d 20 30 | 3b 0a 20 09 09 09 62 72 |tate = 0|;. ...br|
|00002580| 65 61 6b 3b 0a 20 0a 09 | 09 63 61 73 65 20 27 53 |eak;. ..|.case 'S|
|00002590| 27 3a 09 09 2f 2a 20 53 | 61 74 75 72 64 61 79 73 |':../* S|aturdays|
|000025a0| 20 61 6e 64 20 53 75 6e | 64 61 79 73 20 69 6e 20 | and Sun|days in |
|000025b0| 62 6c 61 63 6b 20 2a 2f | 0a 09 09 09 73 75 6e 5f |black */|....sun_|
|000025c0| 67 72 61 79 20 3d 20 46 | 41 4c 53 45 3b 0a 09 09 |gray = F|ALSE;...|
|000025d0| 63 61 73 65 20 27 73 27 | 3a 09 09 2f 2a 20 53 61 |case 's'|:../* Sa|
|000025e0| 74 75 72 64 61 79 73 20 | 69 6e 20 62 6c 61 63 6b |turdays |in black|
|000025f0| 20 2a 2f 0a 09 09 09 73 | 61 74 5f 67 72 61 79 20 | */....s|at_gray |
|00002600| 3d 20 46 41 4c 53 45 3b | 0a 09 09 09 62 72 65 61 |= FALSE;|....brea|
|00002610| 6b 3b 0a 0a 20 09 09 63 | 61 73 65 20 27 74 27 3a |k;.. ..c|ase 't':|
|00002620| 09 09 2f 2a 20 73 70 65 | 63 69 66 79 20 61 6c 74 |../* spe|cify alt|
|00002630| 65 72 6e 61 74 65 20 74 | 69 74 6c 65 20 66 6f 6e |ernate t|itle fon|
|00002640| 74 20 2a 2f 0a 20 09 09 | 09 47 45 54 41 52 47 28 |t */. ..|.GETARG(|
|00002650| 74 69 74 6c 65 66 6f 6e | 74 29 3b 0a 20 09 09 09 |titlefon|t);. ...|
|00002660| 62 72 65 61 6b 3b 0a 0a | 09 09 64 65 66 61 75 6c |break;..|..defaul|
|00002670| 74 3a 0a 09 09 09 46 50 | 52 28 73 74 64 65 72 72 |t:....FP|R(stderr|
|00002680| 2c 20 22 25 73 3a 20 69 | 6c 6c 65 67 61 6c 20 6f |, "%s: i|llegal o|
|00002690| 70 74 69 6f 6e 20 2d 25 | 73 5c 6e 22 2c 20 70 72 |ption -%|s\n", pr|
|000026a0| 6f 67 6e 61 6d 65 2c 20 | 6f 70 74 29 3b 0a 09 09 |ogname, |opt);...|
|000026b0| 09 62 61 64 6f 70 74 20 | 3d 20 54 52 55 45 3b 0a |.badopt |= TRUE;.|
|000026c0| 09 09 09 62 72 65 61 6b | 3b 0a 09 09 7d 0a 20 20 |...break|;...}. |
|000026d0| 20 20 20 20 20 20 7d 0a | 0a 09 2f 2a 20 47 65 74 | }.|../* Get|
|000026e0| 20 61 6e 64 20 76 61 6c | 69 64 61 74 65 20 6e 6f | and val|idate no|
|000026f0| 6e 2d 66 6c 61 67 20 28 | 6e 75 6d 65 72 69 63 29 |n-flag (|numeric)|
|00002700| 20 70 61 72 61 6d 65 74 | 65 72 73 20 2a 2f 0a 0a | paramet|ers */..|
|00002710| 09 73 77 69 74 63 68 20 | 28 6e 61 72 67 73 29 20 |.switch |(nargs) |
|00002720| 7b 0a 09 63 61 73 65 20 | 30 3a 09 09 2f 2a 20 6e |{..case |0:../* n|
|00002730| 6f 20 61 72 67 75 6d 65 | 6e 74 73 20 2d 20 70 72 |o argume|nts - pr|
|00002740| 69 6e 74 20 63 75 72 72 | 65 6e 74 20 6d 6f 6e 74 |int curr|ent mont|
|00002750| 68 2f 79 65 61 72 20 2a | 2f 0a 09 09 74 69 6d 65 |h/year *|/...time|
|00002760| 28 26 74 6d 70 29 3b 0a | 09 09 70 5f 74 6d 20 3d |(&tmp);.|..p_tm =|
|00002770| 20 6c 6f 63 61 6c 74 69 | 6d 65 28 26 74 6d 70 29 | localti|me(&tmp)|
|00002780| 3b 0a 09 09 6d 6f 6e 74 | 68 20 3d 20 70 5f 74 6d |;...mont|h = p_tm|
|00002790| 2d 3e 74 6d 5f 6d 6f 6e | 20 2b 20 31 3b 0a 09 09 |->tm_mon| + 1;...|
|000027a0| 79 65 61 72 20 3d 20 70 | 5f 74 6d 2d 3e 74 6d 5f |year = p|_tm->tm_|
|000027b0| 79 65 61 72 3b 0a 09 09 | 6e 6d 6f 6e 74 68 73 20 |year;...|nmonths |
|000027c0| 3d 20 31 3b 0a 09 09 62 | 72 65 61 6b 3b 09 09 09 |= 1;...b|reak;...|
|000027d0| 0a 09 63 61 73 65 20 31 | 3a 09 09 2f 2a 20 6f 6e |..case 1|:../* on|
|000027e0| 65 20 61 72 67 75 6d 65 | 6e 74 20 2d 20 70 72 69 |e argume|nt - pri|
|000027f0| 6e 74 20 65 6e 74 69 72 | 65 20 79 65 61 72 20 2a |nt entir|e year *|
|00002800| 2f 0a 09 09 6d 6f 6e 74 | 68 20 3d 20 31 3b 0a 09 |/...mont|h = 1;..|
|00002810| 09 79 65 61 72 20 3d 20 | 6e 75 6d 61 72 67 73 5b |.year = |numargs[|
|00002820| 30 5d 3b 0a 09 09 6e 6d | 6f 6e 74 68 73 20 3d 20 |0];...nm|onths = |
|00002830| 31 32 3b 0a 09 09 62 72 | 65 61 6b 3b 0a 09 64 65 |12;...br|eak;..de|
|00002840| 66 61 75 6c 74 3a 09 2f | 2a 20 74 77 6f 20 6f 72 |fault:./|* two or|
|00002850| 20 74 68 72 65 65 20 61 | 72 67 75 6d 65 6e 74 73 | three a|rguments|
|00002860| 20 2d 20 70 72 69 6e 74 | 20 6f 6e 65 20 6f 72 20 | - print| one or |
|00002870| 6d 6f 72 65 20 6d 6f 6e | 74 68 73 20 2a 2f 0a 09 |more mon|ths */..|
|00002880| 09 6d 6f 6e 74 68 20 3d | 20 6e 75 6d 61 72 67 73 |.month =| numargs|
|00002890| 5b 30 5d 3b 0a 09 09 79 | 65 61 72 20 3d 20 6e 75 |[0];...y|ear = nu|
|000028a0| 6d 61 72 67 73 5b 31 5d | 3b 0a 09 09 6e 6d 6f 6e |margs[1]|;...nmon|
|000028b0| 74 68 73 20 3d 20 6e 61 | 72 67 73 20 3e 20 32 20 |ths = na|rgs > 2 |
|000028c0| 3f 20 6e 75 6d 61 72 67 | 73 5b 32 5d 20 3a 20 31 |? numarg|s[2] : 1|
|000028d0| 3b 0a 09 09 62 72 65 61 | 6b 3b 0a 09 7d 0a 0a 09 |;...brea|k;..}...|
|000028e0| 69 66 20 28 79 65 61 72 | 20 3e 20 30 20 26 26 20 |if (year| > 0 && |
|000028f0| 79 65 61 72 20 3c 20 31 | 30 30 29 09 2f 2a 20 74 |year < 1|00)./* t|
|00002900| 72 65 61 74 20 6e 6e 20 | 61 73 20 31 39 6e 6e 20 |reat nn |as 19nn |
|00002910| 2a 2f 0a 09 09 79 65 61 | 72 20 2b 3d 20 31 39 30 |*/...yea|r += 190|
|00002920| 30 3b 0a 09 0a 09 69 66 | 20 28 6e 6d 6f 6e 74 68 |0;....if| (nmonth|
|00002930| 73 20 3c 20 31 29 09 09 | 2f 2a 20 65 6e 73 75 72 |s < 1)..|/* ensur|
|00002940| 65 20 61 74 20 6c 65 61 | 73 74 20 6f 6e 65 20 6d |e at lea|st one m|
|00002950| 6f 6e 74 68 20 2a 2f 0a | 09 09 6e 6d 6f 6e 74 68 |onth */.|..nmonth|
|00002960| 73 20 3d 20 31 3b 0a 09 | 0a 09 69 66 20 28 6d 6f |s = 1;..|..if (mo|
|00002970| 6e 74 68 20 3c 20 31 20 | 7c 7c 20 6d 6f 6e 74 68 |nth < 1 ||| month|
|00002980| 20 3e 20 31 32 29 20 7b | 09 2f 2a 20 63 68 65 63 | > 12) {|./* chec|
|00002990| 6b 20 72 61 6e 67 65 20 | 6f 66 20 6d 6f 6e 74 68 |k range |of month|
|000029a0| 20 61 6e 64 20 79 65 61 | 72 20 2a 2f 0a 09 09 46 | and yea|r */...F|
|000029b0| 50 52 28 73 74 64 65 72 | 72 2c 20 22 25 73 3a 20 |PR(stder|r, "%s: |
|000029c0| 6d 6f 6e 74 68 20 25 64 | 20 6e 6f 74 20 69 6e 20 |month %d| not in |
|000029d0| 72 61 6e 67 65 20 31 20 | 2e 2e 20 31 32 5c 6e 22 |range 1 |.. 12\n"|
|000029e0| 2c 20 70 72 6f 67 6e 61 | 6d 65 2c 0a 09 09 09 6d |, progna|me,....m|
|000029f0| 6f 6e 74 68 29 3b 0a 09 | 09 62 61 64 70 61 72 20 |onth);..|.badpar |
|00002a00| 3d 20 54 52 55 45 3b 0a | 09 7d 0a 09 0a 09 69 66 |= TRUE;.|.}....if|
|00002a10| 20 28 79 65 61 72 20 3c | 20 4d 49 4e 5f 59 52 20 | (year <| MIN_YR |
|00002a20| 7c 7c 20 79 65 61 72 20 | 3e 20 4d 41 58 5f 59 52 ||| year |> MAX_YR|
|00002a30| 29 20 7b 0a 09 09 46 50 | 52 28 73 74 64 65 72 72 |) {...FP|R(stderr|
|00002a40| 2c 20 22 25 73 20 79 65 | 61 72 20 25 64 20 6e 6f |, "%s ye|ar %d no|
|00002a50| 74 20 69 6e 20 72 61 6e | 67 65 20 25 64 20 2e 2e |t in ran|ge %d ..|
|00002a60| 20 25 64 5c 6e 22 2c 20 | 70 72 6f 67 6e 61 6d 65 | %d\n", |progname|
|00002a70| 2c 0a 09 09 09 79 65 61 | 72 2c 20 4d 49 4e 5f 59 |,....yea|r, MIN_Y|
|00002a80| 52 2c 20 4d 41 58 5f 59 | 52 29 3b 0a 09 09 62 61 |R, MAX_Y|R);...ba|
|00002a90| 64 70 61 72 20 3d 20 54 | 52 55 45 3b 0a 09 7d 0a |dpar = T|RUE;..}.|
|00002aa0| 0a 09 2f 2a 20 63 6f 6d | 6d 61 6e 64 2d 6c 69 6e |../* com|mand-lin|
|00002ab0| 65 20 65 72 72 6f 72 73 | 3f 20 20 67 65 6e 65 72 |e errors|? gener|
|00002ac0| 61 74 65 20 75 73 61 67 | 65 20 6d 65 73 73 61 67 |ate usag|e messag|
|00002ad0| 65 20 61 6e 64 20 71 75 | 69 74 20 2a 2f 0a 09 20 |e and qu|it */.. |
|00002ae0| 20 20 0a 09 69 66 20 28 | 62 61 64 70 61 72 20 7c | ..if (|badpar ||
|00002af0| 7c 20 62 61 64 6f 70 74 | 29 20 7b 0a 09 09 75 73 || badopt|) {...us|
|00002b00| 61 67 65 28 70 72 6f 67 | 6e 61 6d 65 29 3b 0a 09 |age(prog|name);..|
|00002b10| 09 65 78 69 74 28 45 58 | 49 54 5f 46 41 49 4c 55 |.exit(EX|IT_FAILU|
|00002b20| 52 45 29 3b 0a 09 09 7d | 0a 0a 09 2f 2a 20 66 6c |RE);...}|.../* fl|
|00002b30| 61 67 20 61 6e 64 20 6e | 75 6d 65 72 69 63 20 70 |ag and n|umeric p|
|00002b40| 61 72 61 6d 65 74 65 72 | 73 20 4f 4b 20 2d 20 6e |arameter|s OK - n|
|00002b50| 6f 77 20 74 72 79 20 74 | 6f 20 6f 70 65 6e 20 74 |ow try t|o open t|
|00002b60| 68 65 20 66 69 6c 65 73 | 20 2a 2f 0a 0a 09 69 66 |he files| */...if|
|00002b70| 20 28 6f 75 74 66 69 6c | 65 20 26 26 20 66 72 65 | (outfil|e && fre|
|00002b80| 6f 70 65 6e 28 6f 75 74 | 66 69 6c 65 2c 20 22 77 |open(out|file, "w|
|00002b90| 22 2c 20 73 74 64 6f 75 | 74 29 20 3d 3d 20 28 46 |", stdou|t) == (F|
|00002ba0| 49 4c 45 20 2a 29 20 4e | 55 4c 4c 29 20 7b 0a 09 |ILE *) N|ULL) {..|
|00002bb0| 09 46 50 52 28 73 74 64 | 65 72 72 2c 20 22 25 73 |.FPR(std|err, "%s|
|00002bc0| 3a 20 63 61 6e 27 74 20 | 6f 70 65 6e 20 66 69 6c |: can't |open fil|
|00002bd0| 65 20 25 73 5c 6e 22 2c | 20 70 72 6f 67 6e 61 6d |e %s\n",| prognam|
|00002be0| 65 2c 20 6f 75 74 66 69 | 6c 65 29 3b 0a 09 09 65 |e, outfi|le);...e|
|00002bf0| 78 69 74 28 45 58 49 54 | 5f 46 41 49 4c 55 52 45 |xit(EXIT|_FAILURE|
|00002c00| 29 3b 0a 09 09 7d 0a 0a | 09 2f 2a 0a 09 20 2a 20 |);...}..|./*.. * |
|00002c10| 49 6e 20 63 61 73 65 20 | 77 65 20 64 6f 6e 27 74 |In case |we don't|
|00002c20| 20 65 6e 63 6f 75 6e 74 | 65 72 20 61 6e 79 20 79 | encount|er any y|
|00002c30| 65 61 72 20 64 61 74 61 | 20 69 6e 20 74 68 65 0a |ear data| in the.|
|00002c40| 09 20 2a 20 63 61 6c 65 | 6e 64 61 72 20 66 69 6c |. * cale|ndar fil|
|00002c50| 65 2c 20 61 73 73 75 6d | 65 20 74 68 65 20 63 75 |e, assum|e the cu|
|00002c60| 72 72 65 6e 74 20 79 65 | 61 72 2e 0a 09 20 2a 2f |rrent ye|ar... */|
|00002c70| 0a 09 63 75 72 72 5f 79 | 65 61 72 20 3d 20 79 65 |..curr_y|ear = ye|
|00002c80| 61 72 3b 0a 0a 09 2f 2a | 0a 09 20 2a 20 41 74 74 |ar;.../*|.. * Att|
|00002c90| 65 6d 70 74 20 74 6f 20 | 6f 70 65 6e 20 75 73 65 |empt to |open use|
|00002ca0| 72 2d 73 70 65 63 69 66 | 69 65 64 20 63 61 6c 65 |r-specif|ied cale|
|00002cb0| 6e 64 61 72 20 66 69 6c | 65 20 66 69 72 73 74 0a |ndar fil|e first.|
|00002cc0| 09 20 2a 2f 0a 09 69 66 | 20 28 64 61 74 65 5f 66 |. */..if| (date_f|
|00002cd0| 69 6c 65 20 21 3d 20 4e | 55 4c 4c 29 20 7b 0a 09 |ile != N|ULL) {..|
|00002ce0| 09 69 66 20 28 28 63 66 | 70 20 3d 20 66 6f 70 65 |.if ((cf|p = fope|
|00002cf0| 6e 28 64 61 74 65 5f 66 | 69 6c 65 2c 20 22 72 22 |n(date_f|ile, "r"|
|00002d00| 29 29 20 3d 3d 20 4e 55 | 4c 4c 29 20 7b 0a 09 09 |)) == NU|LL) {...|
|00002d10| 09 46 50 52 28 73 74 64 | 65 72 72 2c 20 22 25 73 |.FPR(std|err, "%s|
|00002d20| 3a 20 63 61 6e 27 74 20 | 6f 70 65 6e 20 66 69 6c |: can't |open fil|
|00002d30| 65 20 25 73 5c 6e 22 2c | 20 70 72 6f 67 6e 61 6d |e %s\n",| prognam|
|00002d40| 65 2c 20 0a 09 09 09 09 | 64 61 74 65 5f 66 69 6c |e, .....|date_fil|
|00002d50| 65 29 3b 0a 09 09 09 65 | 78 69 74 28 45 58 49 54 |e);....e|xit(EXIT|
|00002d60| 5f 46 41 49 4c 55 52 45 | 29 3b 0a 09 09 7d 0a 09 |_FAILURE|);...}..|
|00002d70| 7d 0a 0a 09 2f 2a 0a 09 | 20 2a 20 45 6c 73 65 20 |}.../*..| * Else |
|00002d80| 73 65 65 20 69 66 20 74 | 68 65 20 64 65 66 61 75 |see if t|he defau|
|00002d90| 6c 74 20 63 61 6c 65 6e | 64 61 72 20 66 69 6c 65 |lt calen|dar file|
|00002da0| 20 65 78 69 73 74 73 20 | 28 6e 6f 20 65 72 72 6f | exists |(no erro|
|00002db0| 72 20 69 66 0a 09 20 2a | 20 6e 6f 6e 65 78 69 73 |r if.. *| nonexis|
|00002dc0| 74 65 6e 74 3b 20 70 72 | 6f 67 72 61 6d 20 77 69 |tent; pr|ogram wi|
|00002dd0| 6c 6c 20 6a 75 73 74 20 | 70 72 69 6e 74 20 65 6d |ll just |print em|
|00002de0| 70 74 79 20 63 61 6c 65 | 6e 64 61 72 29 0a 09 20 |pty cale|ndar).. |
|00002df0| 2a 2f 0a 09 65 6c 73 65 | 20 69 66 20 28 6e 6f 63 |*/..else| if (noc|
|00002e00| 61 6c 20 3d 3d 20 46 41 | 4c 53 45 29 0a 09 09 63 |al == FA|LSE)...c|
|00002e10| 66 70 20 3d 20 66 6f 70 | 65 6e 28 49 4e 46 49 4c |fp = fop|en(INFIL|
|00002e20| 45 2c 20 22 72 22 29 3b | 0a 0a 09 2f 2a 0a 09 20 |E, "r");|.../*.. |
|00002e30| 2a 20 57 72 69 74 65 20 | 6f 75 74 20 50 6f 73 74 |* Write |out Post|
|00002e40| 53 63 72 69 70 74 20 70 | 72 6f 6c 6f 67 0a 09 20 |Script p|rolog.. |
|00002e50| 2a 2f 0a 20 09 50 52 54 | 28 22 25 25 21 5c 6e 22 |*/. .PRT|("%%!\n"|
|00002e60| 29 3b 0a 20 09 50 52 54 | 28 22 2f 74 69 74 6c 65 |);. .PRT|("/title|
|00002e70| 66 6f 6e 74 20 2f 25 73 | 20 64 65 66 5c 6e 2f 64 |font /%s| def\n/d|
|00002e80| 61 79 66 6f 6e 74 20 2f | 25 73 20 64 65 66 5c 6e |ayfont /|%s def\n|
|00002e90| 22 2c 20 74 69 74 6c 65 | 66 6f 6e 74 2c 20 64 61 |", title|font, da|
|00002ea0| 79 66 6f 6e 74 29 3b 0a | 0a 09 44 4f 48 45 41 44 |yfont);.|..DOHEAD|
|00002eb0| 45 52 28 68 65 61 64 65 | 72 5f 31 29 3b 0a 09 69 |ER(heade|r_1);..i|
|00002ec0| 66 20 28 73 75 6e 5f 67 | 72 61 79 29 20 7b 0a 09 |f (sun_g|ray) {..|
|00002ed0| 09 50 52 54 28 22 5c 74 | 5c 74 5c 74 64 61 79 20 |.PRT("\t|\t\tday |
|00002ee0| 73 74 61 72 74 20 61 64 | 64 20 37 20 6d 6f 64 20 |start ad|d 7 mod |
|00002ef0| 31 20 25 73 20 7b 5c 6e | 22 2c 0a 09 09 09 73 61 |1 %s {\n|",....sa|
|00002f00| 74 5f 67 72 61 79 20 3f | 20 22 6c 65 22 20 3a 20 |t_gray ?| "le" : |
|00002f10| 22 65 71 22 20 29 3b 0a | 20 20 09 09 50 52 54 28 |"eq" );.| ..PRT(|
|00002f20| 22 5c 74 5c 74 5c 74 5c | 74 2e 38 20 73 65 74 67 |"\t\t\t\|t.8 setg|
|00002f30| 72 61 79 5c 6e 22 29 3b | 0a 20 20 09 09 50 52 54 |ray\n");|. ..PRT|
|00002f40| 28 22 5c 74 5c 74 5c 74 | 7d 20 69 66 5c 6e 22 29 |("\t\t\t|} if\n")|
|00002f50| 3b 0a 09 09 7d 0a 09 44 | 4f 48 45 41 44 45 52 28 |;...}..D|OHEADER(|
|00002f60| 68 65 61 64 65 72 5f 32 | 29 3b 0a 0a 20 09 50 52 |header_2|);.. .PR|
|00002f70| 54 28 22 5c 74 25 64 20 | 72 6f 74 61 74 65 5c 6e |T("\t%d |rotate\n|
|00002f80| 22 2c 20 72 6f 74 61 74 | 65 29 3b 0a 20 09 69 66 |", rotat|e);. .if|
|00002f90| 20 28 72 6f 74 61 74 65 | 29 0a 20 09 09 50 52 54 | (rotate|). ..PRT|
|00002fa0| 28 22 5c 74 35 30 20 2d | 31 32 30 20 74 72 61 6e |("\t50 -|120 tran|
|00002fb0| 73 6c 61 74 65 5c 6e 22 | 29 3b 0a 20 09 65 6c 73 |slate\n"|);. .els|
|00002fc0| 65 0a 20 09 09 50 52 54 | 28 22 5c 74 30 2e 37 35 |e. ..PRT|("\t0.75|
|00002fd0| 20 30 2e 37 35 20 73 63 | 61 6c 65 5c 6e 5c 74 35 | 0.75 sc|ale\n\t5|
|00002fe0| 30 20 34 36 30 20 74 72 | 61 6e 73 6c 61 74 65 5c |0 460 tr|anslate\|
|00002ff0| 6e 22 29 3b 0a 0a 09 44 | 4f 48 45 41 44 45 52 28 |n");...D|OHEADER(|
|00003000| 68 65 61 64 65 72 5f 33 | 29 3b 0a 0a 09 77 68 69 |header_3|);...whi|
|00003010| 6c 65 20 28 6e 6d 6f 6e | 74 68 73 2d 2d 29 20 7b |le (nmon|ths--) {|
|00003020| 0a 09 09 70 6d 6f 6e 74 | 68 28 6d 6f 6e 74 68 2c |...pmont|h(month,|
|00003030| 20 79 65 61 72 29 3b 0a | 09 09 69 66 20 28 2b 2b | year);.|..if (++|
|00003040| 6d 6f 6e 74 68 20 3e 20 | 31 32 29 20 7b 0a 09 09 |month > |12) {...|
|00003050| 09 6d 6f 6e 74 68 20 3d | 20 31 3b 0a 09 09 09 79 |.month =| 1;....y|
|00003060| 65 61 72 2b 2b 3b 0a 09 | 09 7d 0a 09 7d 0a 0a 09 |ear++;..|.}..}...|
|00003070| 69 66 20 28 6f 75 74 66 | 69 6c 65 29 0a 09 09 46 |if (outf|ile)...F|
|00003080| 50 52 28 73 74 64 65 72 | 72 2c 20 22 4f 75 74 70 |PR(stder|r, "Outp|
|00003090| 75 74 20 69 73 20 69 6e | 20 66 69 6c 65 20 25 73 |ut is in| file %s|
|000030a0| 5c 6e 22 2c 20 6f 75 74 | 66 69 6c 65 29 3b 0a 0a |\n", out|file);..|
|000030b0| 09 65 78 69 74 28 45 58 | 49 54 5f 53 55 43 43 45 |.exit(EX|IT_SUCCE|
|000030c0| 53 53 29 3b 0a 7d 0a 0a | 0a 2f 2a 0a 20 2a 09 50 |SS);.}..|./*. *.P|
|000030d0| 72 69 6e 74 20 6d 65 73 | 73 61 67 65 20 65 78 70 |rint mes|sage exp|
|000030e0| 6c 61 69 6e 69 6e 67 20 | 63 6f 72 72 65 63 74 20 |laining |correct |
|000030f0| 75 73 61 67 65 20 6f 66 | 20 74 68 65 20 63 6f 6d |usage of| the com|
|00003100| 6d 61 6e 64 2d 6c 69 6e | 65 0a 20 2a 09 61 72 67 |mand-lin|e. *.arg|
|00003110| 75 6d 65 6e 74 73 20 61 | 6e 64 20 66 6c 61 67 73 |uments a|nd flags|
|00003120| 0a 20 2a 2f 0a 75 73 61 | 67 65 28 70 72 6f 67 29 |. */.usa|ge(prog)|
|00003130| 0a 09 63 68 61 72 20 2a | 70 72 6f 67 3b 0a 7b 0a |..char *|prog;.{.|
|00003140| 09 46 50 52 28 73 74 64 | 65 72 72 2c 20 22 5c 6e |.FPR(std|err, "\n|
|00003150| 55 73 61 67 65 3a 5c 6e | 5c 6e 22 29 3b 0a 09 46 |Usage:\n|\n");..F|
|00003160| 50 52 28 73 74 64 65 72 | 72 2c 20 22 5c 74 25 73 |PR(stder|r, "\t%s|
|00003170| 20 5b 2d 64 20 46 4f 4e | 54 5d 20 5b 2d 65 20 7c | [-d FON|T] [-e ||
|00003180| 20 2d 66 20 46 49 4c 45 | 5d 20 5b 2d 6f 20 46 49 | -f FILE|] [-o FI|
|00003190| 4c 45 5d 20 5b 2d 72 5d | 20 5b 2d 73 20 7c 20 2d |LE] [-r]| [-s | -|
|000031a0| 25 73 5d 20 5b 2d 74 20 | 46 4f 4e 54 5d 5c 6e 22 |%s] [-t |FONT]\n"|
|000031b0| 2c 0a 09 09 70 72 6f 67 | 2c 20 53 5f 4f 50 54 29 |,...prog|, S_OPT)|
|000031c0| 3b 0a 09 46 50 52 28 73 | 74 64 65 72 72 2c 20 22 |;..FPR(s|tderr, "|
|000031d0| 5c 74 5c 74 5b 20 5b 20 | 5b 6d 6d 5d 20 79 79 20 |\t\t[ [ |[mm] yy |
|000031e0| 5d 20 7c 20 5b 6d 6d 20 | 79 79 20 6e 5d 20 5d 5c |] | [mm |yy n] ]\|
|000031f0| 6e 5c 6e 22 29 3b 0a 09 | 46 50 52 28 73 74 64 65 |n\n");..|FPR(stde|
|00003200| 72 72 2c 20 22 5c 74 5c | 74 2d 64 20 46 4f 4e 54 |rr, "\t\|t-d FONT|
|00003210| 5c 74 5c 74 73 70 65 63 | 69 66 79 20 61 6c 74 65 |\t\tspec|ify alte|
|00003220| 72 6e 61 74 65 20 66 6f | 6e 74 20 66 6f 72 20 64 |rnate fo|nt for d|
|00003230| 61 79 20 6e 61 6d 65 73 | 5c 6e 22 29 3b 0a 09 46 |ay names|\n");..F|
|00003240| 50 52 28 73 74 64 65 72 | 72 2c 20 22 5c 74 5c 74 |PR(stder|r, "\t\t|
|00003250| 5c 74 5c 74 28 64 65 66 | 61 75 6c 74 3a 20 25 73 |\t\t(def|ault: %s|
|00003260| 29 5c 6e 22 2c 20 44 41 | 59 46 4f 4e 54 29 3b 0a |)\n", DA|YFONT);.|
|00003270| 09 46 50 52 28 73 74 64 | 65 72 72 2c 20 22 5c 6e |.FPR(std|err, "\n|
|00003280| 22 29 3b 0a 09 46 50 52 | 28 73 74 64 65 72 72 2c |");..FPR|(stderr,|
|00003290| 20 22 5c 74 5c 74 2d 65 | 5c 74 5c 74 67 65 6e 65 | "\t\t-e|\t\tgene|
|000032a0| 72 61 74 65 20 65 6d 70 | 74 79 20 63 61 6c 65 6e |rate emp|ty calen|
|000032b0| 64 61 72 20 28 69 67 6e | 6f 72 65 20 64 61 74 65 |dar (ign|ore date|
|000032c0| 20 66 69 6c 65 29 5c 6e | 22 29 3b 0a 09 46 50 52 | file)\n|");..FPR|
|000032d0| 28 73 74 64 65 72 72 2c | 20 22 5c 6e 22 29 3b 0a |(stderr,| "\n");.|
|000032e0| 09 46 50 52 28 73 74 64 | 65 72 72 2c 20 22 5c 74 |.FPR(std|err, "\t|
|000032f0| 5c 74 2d 66 20 46 49 4c | 45 5c 74 5c 74 73 70 65 |\t-f FIL|E\t\tspe|
|00003300| 63 69 66 79 20 61 6c 74 | 65 72 6e 61 74 65 20 64 |cify alt|ernate d|
|00003310| 61 74 65 20 66 69 6c 65 | 5c 6e 22 29 3b 0a 09 46 |ate file|\n");..F|
|00003320| 50 52 28 73 74 64 65 72 | 72 2c 20 22 5c 74 5c 74 |PR(stder|r, "\t\t|
|00003330| 5c 74 5c 74 28 64 65 66 | 61 75 6c 74 3a 20 25 73 |\t\t(def|ault: %s|
|00003340| 29 5c 6e 22 2c 20 49 4e | 46 49 4c 45 29 3b 0a 09 |)\n", IN|FILE);..|
|00003350| 46 50 52 28 73 74 64 65 | 72 72 2c 20 22 5c 6e 22 |FPR(stde|rr, "\n"|
|00003360| 29 3b 0a 09 46 50 52 28 | 73 74 64 65 72 72 2c 20 |);..FPR(|stderr, |
|00003370| 22 5c 74 5c 74 2d 6f 20 | 46 49 4c 45 5c 74 5c 74 |"\t\t-o |FILE\t\t|
|00003380| 73 70 65 63 69 66 79 20 | 61 6c 74 65 72 6e 61 74 |specify |alternat|
|00003390| 65 20 6f 75 74 70 75 74 | 20 66 69 6c 65 5c 6e 22 |e output| file\n"|
|000033a0| 29 3b 0a 09 46 50 52 28 | 73 74 64 65 72 72 2c 20 |);..FPR(|stderr, |
|000033b0| 22 5c 74 5c 74 5c 74 5c | 74 28 64 65 66 61 75 6c |"\t\t\t\|t(defaul|
|000033c0| 74 3a 20 25 73 29 5c 6e | 22 2c 20 4f 55 54 46 49 |t: %s)\n|", OUTFI|
|000033d0| 4c 45 20 3f 20 4f 55 54 | 46 49 4c 45 20 3a 20 22 |LE ? OUT|FILE : "|
|000033e0| 73 74 64 6f 75 74 22 29 | 3b 0a 09 46 50 52 28 73 |stdout")|;..FPR(s|
|000033f0| 74 64 65 72 72 2c 20 22 | 5c 6e 22 29 3b 0a 09 46 |tderr, "|\n");..F|
|00003400| 50 52 28 73 74 64 65 72 | 72 2c 20 22 5c 74 5c 74 |PR(stder|r, "\t\t|
|00003410| 2d 72 5c 74 5c 74 67 65 | 6e 65 72 61 74 65 20 70 |-r\t\tge|nerate p|
|00003420| 6f 72 74 72 61 69 74 2d | 73 74 79 6c 65 20 63 61 |ortrait-|style ca|
|00003430| 6c 65 6e 64 61 72 73 5c | 6e 22 29 3b 0a 09 46 50 |lendars\|n");..FP|
|00003440| 52 28 73 74 64 65 72 72 | 2c 20 22 5c 74 5c 74 5c |R(stderr|, "\t\t\|
|00003450| 74 5c 74 28 64 65 66 61 | 75 6c 74 3a 20 6c 61 6e |t\t(defa|ult: lan|
|00003460| 64 73 63 61 70 65 29 5c | 6e 22 29 3b 0a 09 46 50 |dscape)\|n");..FP|
|00003470| 52 28 73 74 64 65 72 72 | 2c 20 22 5c 6e 22 29 3b |R(stderr|, "\n");|
|00003480| 0a 09 46 50 52 28 73 74 | 64 65 72 72 2c 20 22 5c |..FPR(st|derr, "\|
|00003490| 74 5c 74 2d 73 5c 74 5c | 74 70 72 69 6e 74 20 53 |t\t-s\t\|tprint S|
|000034a0| 61 74 75 72 64 61 79 73 | 20 69 6e 20 62 6c 61 63 |aturdays| in blac|
|000034b0| 6b 5c 6e 22 29 3b 0a 09 | 46 50 52 28 73 74 64 65 |k\n");..|FPR(stde|
|000034c0| 72 72 2c 20 22 5c 74 5c | 74 2d 25 73 5c 74 5c 74 |rr, "\t\|t-%s\t\t|
|000034d0| 70 72 69 6e 74 20 53 61 | 74 75 72 64 61 79 73 20 |print Sa|turdays |
|000034e0| 61 6e 64 20 53 75 6e 64 | 61 79 73 20 69 6e 20 62 |and Sund|ays in b|
|000034f0| 6c 61 63 6b 5c 6e 22 2c | 20 53 5f 4f 50 54 29 3b |lack\n",| S_OPT);|
|00003500| 0a 09 46 50 52 28 73 74 | 64 65 72 72 2c 20 22 5c |..FPR(st|derr, "\|
|00003510| 74 5c 74 5c 74 5c 74 28 | 64 65 66 61 75 6c 74 3a |t\t\t\t(|default:|
|00003520| 20 70 72 69 6e 74 20 53 | 61 74 75 72 64 61 79 73 | print S|aturdays|
|00003530| 20 61 6e 64 20 53 75 6e | 64 61 79 73 20 69 6e 20 | and Sun|days in |
|00003540| 67 72 61 79 29 5c 6e 22 | 29 3b 0a 09 46 50 52 28 |gray)\n"|);..FPR(|
|00003550| 73 74 64 65 72 72 2c 20 | 22 5c 6e 22 29 3b 0a 09 |stderr, |"\n");..|
|00003560| 46 50 52 28 73 74 64 65 | 72 72 2c 20 22 5c 74 5c |FPR(stde|rr, "\t\|
|00003570| 74 2d 74 20 46 4f 4e 54 | 5c 74 5c 74 73 70 65 63 |t-t FONT|\t\tspec|
|00003580| 69 66 79 20 61 6c 74 65 | 72 6e 61 74 65 20 66 6f |ify alte|rnate fo|
|00003590| 6e 74 20 66 6f 72 20 74 | 69 74 6c 65 73 5c 6e 22 |nt for t|itles\n"|
|000035a0| 29 3b 0a 09 46 50 52 28 | 73 74 64 65 72 72 2c 20 |);..FPR(|stderr, |
|000035b0| 22 5c 74 5c 74 5c 74 5c | 74 28 64 65 66 61 75 6c |"\t\t\t\|t(defaul|
|000035c0| 74 3a 20 25 73 29 5c 6e | 22 2c 20 54 49 54 4c 45 |t: %s)\n|", TITLE|
|000035d0| 46 4f 4e 54 29 3b 0a 09 | 46 50 52 28 73 74 64 65 |FONT);..|FPR(stde|
|000035e0| 72 72 2c 20 22 5c 6e 22 | 29 3b 0a 09 46 50 52 28 |rr, "\n"|);..FPR(|
|000035f0| 73 74 64 65 72 72 2c 20 | 22 5c 74 25 73 20 5b 6f |stderr, |"\t%s [o|
|00003600| 70 74 73 5d 5c 74 5c 74 | 67 65 6e 65 72 61 74 65 |pts]\t\t|generate|
|00003610| 20 63 61 6c 65 6e 64 61 | 72 20 66 6f 72 20 63 75 | calenda|r for cu|
|00003620| 72 72 65 6e 74 20 6d 6f | 6e 74 68 2f 79 65 61 72 |rrent mo|nth/year|
|00003630| 5c 6e 22 2c 0a 09 09 70 | 72 6f 67 29 3b 0a 09 46 |\n",...p|rog);..F|
|00003640| 50 52 28 73 74 64 65 72 | 72 2c 20 22 5c 6e 22 29 |PR(stder|r, "\n")|
|00003650| 3b 0a 09 46 50 52 28 73 | 74 64 65 72 72 2c 20 22 |;..FPR(s|tderr, "|
|00003660| 5c 74 25 73 20 5b 6f 70 | 74 73 5d 20 79 79 5c 74 |\t%s [op|ts] yy\t|
|00003670| 5c 74 67 65 6e 65 72 61 | 74 65 20 63 61 6c 65 6e |\tgenera|te calen|
|00003680| 64 61 72 20 66 6f 72 20 | 65 6e 74 69 72 65 20 79 |dar for |entire y|
|00003690| 65 61 72 20 79 79 5c 6e | 22 2c 0a 09 09 70 72 6f |ear yy\n|",...pro|
|000036a0| 67 29 3b 0a 09 46 50 52 | 28 73 74 64 65 72 72 2c |g);..FPR|(stderr,|
|000036b0| 20 22 5c 6e 22 29 3b 0a | 09 46 50 52 28 73 74 64 | "\n");.|.FPR(std|
|000036c0| 65 72 72 2c 20 22 5c 74 | 25 73 20 5b 6f 70 74 73 |err, "\t|%s [opts|
|000036d0| 5d 20 6d 6d 20 79 79 5c | 74 67 65 6e 65 72 61 74 |] mm yy\|tgenerat|
|000036e0| 65 20 63 61 6c 65 6e 64 | 61 72 20 66 6f 72 20 6d |e calend|ar for m|
|000036f0| 6f 6e 74 68 20 6d 6d 5c | 6e 22 2c 20 70 72 6f 67 |onth mm\|n", prog|
|00003700| 29 3b 0a 09 46 50 52 28 | 73 74 64 65 72 72 2c 20 |);..FPR(|stderr, |
|00003710| 22 5c 74 5c 74 5c 74 5c | 74 28 4a 61 6e 20 3d 20 |"\t\t\t\|t(Jan = |
|00003720| 31 29 2c 20 79 65 61 72 | 20 79 79 20 28 31 39 79 |1), year| yy (19y|
|00003730| 79 20 69 66 20 79 79 20 | 3c 20 31 30 30 29 5c 6e |y if yy |< 100)\n|
|00003740| 22 29 3b 0a 09 46 50 52 | 28 73 74 64 65 72 72 2c |");..FPR|(stderr,|
|00003750| 20 22 5c 6e 22 29 3b 0a | 09 46 50 52 28 73 74 64 | "\n");.|.FPR(std|
|00003760| 65 72 72 2c 20 22 5c 74 | 25 73 20 5b 6f 70 74 73 |err, "\t|%s [opts|
|00003770| 5d 20 6d 6d 20 79 79 20 | 6e 5c 74 61 73 20 61 62 |] mm yy |n\tas ab|
|00003780| 6f 76 65 2c 20 66 6f 72 | 20 6e 20 63 6f 6e 73 65 |ove, for| n conse|
|00003790| 63 75 74 69 76 65 20 6d | 6f 6e 74 68 73 5c 6e 22 |cutive m|onths\n"|
|000037a0| 2c 0a 09 09 70 72 6f 67 | 29 3b 0a 09 46 50 52 28 |,...prog|);..FPR(|
|000037b0| 73 74 64 65 72 72 2c 20 | 22 5c 6e 22 29 3b 0a 7d |stderr, |"\n");.}|
|000037c0| 0a 0a 0a 2f 2a 0a 20 2a | 20 42 72 6f 77 73 65 20 |.../*. *| Browse |
|000037d0| 74 68 72 6f 75 67 68 20 | 74 68 65 20 63 61 6c 65 |through |the cale|
|000037e0| 6e 64 61 72 20 66 69 6c | 65 20 6c 6f 6f 6b 69 6e |ndar fil|e lookin|
|000037f0| 67 20 66 6f 72 20 64 61 | 79 20 69 6e 66 6f 20 69 |g for da|y info i|
|00003800| 6e 20 63 75 72 72 65 6e | 74 20 6d 6f 6e 74 68 0a |n curren|t month.|
|00003810| 20 2a 2f 0a 66 69 6e 64 | 5f 64 61 79 74 65 78 74 | */.find|_daytext|
|00003820| 28 6d 2c 20 79 29 0a 09 | 69 6e 74 20 6d 2c 20 79 |(m, y)..|int m, y|
|00003830| 3b 0a 7b 0a 09 72 65 67 | 69 73 74 65 72 20 63 68 |;.{..reg|ister ch|
|00003840| 61 72 20 2a 2a 73 3b 0a | 09 72 65 67 69 73 74 65 |ar **s;.|.registe|
|00003850| 72 20 69 6e 74 20 6f 6c | 64 64 61 79 20 3d 20 2d |r int ol|dday = -|
|00003860| 31 3b 0a 09 72 65 67 69 | 73 74 65 72 20 69 6e 74 |1;..regi|ster int|
|00003870| 20 64 61 79 3b 0a 0a 09 | 66 6f 72 20 28 64 61 79 | day;...|for (day|
|00003880| 20 3d 20 67 65 74 64 61 | 79 28 6d 2c 20 79 2c 20 | = getda|y(m, y, |
|00003890| 54 52 55 45 29 3b 20 64 | 61 79 20 21 3d 20 30 3b |TRUE); d|ay != 0;|
|000038a0| 20 64 61 79 20 3d 20 67 | 65 74 64 61 79 28 6d 2c | day = g|etday(m,|
|000038b0| 20 79 2c 20 46 41 4c 53 | 45 29 29 0a 09 09 69 66 | y, FALS|E))...if|
|000038c0| 20 28 2a 77 6f 72 64 73 | 29 20 7b 0a 09 09 09 64 | (*words|) {....d|
|000038d0| 61 79 20 26 3d 20 7e 48 | 4f 4c 49 44 41 59 3b 0a |ay &= ~H|OLIDAY;.|
|000038e0| 09 09 09 69 66 20 28 64 | 61 79 20 21 3d 20 6f 6c |...if (d|ay != ol|
|000038f0| 64 64 61 79 29 20 7b 0a | 09 09 09 09 69 66 20 28 |dday) {.|....if (|
|00003900| 6f 6c 64 64 61 79 20 3d | 3d 20 2d 31 29 0a 09 09 |oldday =|= -1)...|
|00003910| 09 09 09 50 52 54 28 22 | 25 64 20 5b 20 5c 6e 22 |...PRT("|%d [ \n"|
|00003920| 2c 20 64 61 79 29 3b 0a | 09 09 09 09 65 6c 73 65 |, day);.|....else|
|00003930| 0a 09 09 09 09 09 50 52 | 54 28 22 5d 20 64 61 79 |......PR|T("] day|
|00003940| 74 65 78 74 5c 6e 25 64 | 20 5b 20 5c 6e 22 2c 20 |text\n%d| [ \n", |
|00003950| 64 61 79 29 3b 0a 09 09 | 09 09 6f 6c 64 64 61 79 |day);...|..oldday|
|00003960| 20 3d 20 64 61 79 3b 0a | 09 09 09 7d 20 65 6c 73 | = day;.|...} els|
|00003970| 65 0a 09 09 09 09 50 52 | 54 28 22 28 2e 70 29 5c |e.....PR|T("(.p)\|
|00003980| 6e 22 29 3b 0a 09 09 09 | 66 6f 72 20 28 73 20 3d |n");....|for (s =|
|00003990| 20 77 6f 72 64 73 3b 20 | 2a 73 3b 20 73 2b 2b 29 | words; |*s; s++)|
|000039a0| 0a 09 09 09 09 50 52 54 | 28 22 28 25 73 29 5c 6e |.....PRT|("(%s)\n|
|000039b0| 22 2c 20 2a 73 29 3b 0a | 09 09 7d 0a 0a 09 69 66 |", *s);.|..}...if|
|000039c0| 20 28 6f 6c 64 64 61 79 | 20 21 3d 20 2d 31 29 09 | (oldday| != -1).|
|000039d0| 09 2f 2a 20 74 65 72 6d | 69 6e 61 74 65 20 63 61 |./* term|inate ca|
|000039e0| 6c 6c 20 74 6f 20 64 61 | 79 74 65 78 74 20 2a 2f |ll to da|ytext */|
|000039f0| 0a 09 09 50 52 54 28 22 | 5d 20 64 61 79 74 65 78 |...PRT("|] daytex|
|00003a00| 74 5c 6e 22 29 3b 0a 7d | 0a 0a 0a 2f 2a 0a 20 2a |t\n");.}|.../*. *|
|00003a10| 20 42 72 6f 77 73 65 20 | 74 68 72 6f 75 67 68 20 | Browse |through |
|00003a20| 74 68 65 20 63 61 6c 65 | 6e 64 61 72 20 66 69 6c |the cale|ndar fil|
|00003a30| 65 20 6c 6f 6f 6b 69 6e | 67 20 66 6f 72 20 68 6f |e lookin|g for ho|
|00003a40| 6c 69 64 61 79 73 20 69 | 6e 20 63 75 72 72 65 6e |lidays i|n curren|
|00003a50| 74 20 6d 6f 6e 74 68 0a | 20 2a 2f 0a 66 69 6e 64 |t month.| */.find|
|00003a60| 5f 68 6f 6c 69 64 61 79 | 73 28 6d 2c 20 79 29 0a |_holiday|s(m, y).|
|00003a70| 09 69 6e 74 20 6d 2c 20 | 79 3b 0a 7b 0a 09 72 65 |.int m, |y;.{..re|
|00003a80| 67 69 73 74 65 72 20 69 | 6e 74 20 64 61 79 3b 0a |gister i|nt day;.|
|00003a90| 09 75 6e 73 69 67 6e 65 | 64 20 6c 6f 6e 67 20 68 |.unsigne|d long h|
|00003aa0| 6f 6c 69 64 61 79 73 20 | 3d 20 30 3b 0a 0a 09 2f |olidays |= 0;.../|
|00003ab0| 2a 20 73 6f 72 74 20 68 | 6f 6c 69 64 61 79 73 20 |* sort h|olidays |
|00003ac0| 62 79 20 73 65 74 74 69 | 6e 67 20 62 69 74 73 20 |by setti|ng bits |
|00003ad0| 69 6e 20 66 6c 61 67 20 | 77 6f 72 64 20 2a 2f 0a |in flag |word */.|
|00003ae0| 09 66 6f 72 20 28 64 61 | 79 20 3d 20 67 65 74 64 |.for (da|y = getd|
|00003af0| 61 79 28 6d 2c 20 79 2c | 20 54 52 55 45 29 3b 20 |ay(m, y,| TRUE); |
|00003b00| 64 61 79 20 21 3d 20 30 | 3b 20 64 61 79 20 3d 20 |day != 0|; day = |
|00003b10| 67 65 74 64 61 79 28 6d | 2c 20 79 2c 20 46 41 4c |getday(m|, y, FAL|
|00003b20| 53 45 29 29 0a 09 09 69 | 66 20 28 64 61 79 20 26 |SE))...i|f (day &|
|00003b30| 20 48 4f 4c 49 44 41 59 | 29 0a 09 09 09 68 6f 6c | HOLIDAY|)....hol|
|00003b40| 69 64 61 79 73 20 7c 3d | 20 31 20 3c 3c 20 28 64 |idays |=| 1 << (d|
|00003b50| 61 79 20 26 20 7e 48 4f | 4c 49 44 41 59 29 3b 0a |ay & ~HO|LIDAY);.|
|00003b60| 0a 09 50 52 54 28 22 2f | 68 6f 6c 69 64 61 79 73 |..PRT("/|holidays|
|00003b70| 20 5b 22 29 3b 09 2f 2a | 20 73 74 61 72 74 20 64 | [");./*| start d|
|00003b80| 65 66 69 6e 69 74 69 6f | 6e 20 6f 66 20 6c 69 73 |efinitio|n of lis|
|00003b90| 74 20 2a 2f 0a 09 66 6f | 72 20 28 64 61 79 20 3d |t */..fo|r (day =|
|00003ba0| 20 31 3b 20 64 61 79 20 | 3c 3d 20 33 31 3b 20 64 | 1; day |<= 31; d|
|00003bb0| 61 79 2b 2b 29 0a 09 09 | 69 66 20 28 68 6f 6c 69 |ay++)...|if (holi|
|00003bc0| 64 61 79 73 20 26 20 28 | 31 20 3c 3c 20 64 61 79 |days & (|1 << day|
|00003bd0| 29 29 0a 09 09 09 50 52 | 54 28 22 20 25 64 22 2c |))....PR|T(" %d",|
|00003be0| 20 64 61 79 29 3b 0a 09 | 50 52 54 28 22 20 39 39 | day);..|PRT(" 99|
|00003bf0| 20 5d 20 64 65 66 5c 6e | 22 29 3b 09 2f 2a 20 74 | ] def\n|");./* t|
|00003c00| 65 72 6d 69 6e 61 74 65 | 20 77 69 74 68 20 64 75 |erminate| with du|
|00003c10| 6d 6d 79 20 65 6e 74 72 | 79 20 2a 2f 0a 7d 0a 0a |mmy entr|y */.}..|
|00003c20| 0a 2f 2a 0a 20 2a 20 70 | 6d 6f 6e 74 68 20 2d 20 |./*. * p|month - |
|00003c30| 64 6f 20 63 61 6c 65 6e | 64 61 72 20 66 6f 72 20 |do calen|dar for |
|00003c40| 6d 6f 6e 74 68 20 22 6d | 22 0a 20 2a 2f 0a 70 6d |month "m|". */.pm|
|00003c50| 6f 6e 74 68 28 6d 2c 20 | 79 29 0a 09 69 6e 74 20 |onth(m, |y)..int |
|00003c60| 6d 2c 20 79 3b 0a 7b 0a | 0a 09 50 52 54 28 22 2f |m, y;.{.|..PRT("/|
|00003c70| 79 65 61 72 20 25 64 20 | 64 65 66 5c 6e 22 2c 20 |year %d |def\n", |
|00003c80| 79 29 3b 09 2f 2a 20 73 | 65 74 20 75 70 20 79 65 |y);./* s|et up ye|
|00003c90| 61 72 20 61 6e 64 20 6d | 6f 6e 74 68 20 2a 2f 0a |ar and m|onth */.|
|00003ca0| 09 50 52 54 28 22 2f 6d | 6f 6e 74 68 20 25 64 20 |.PRT("/m|onth %d |
|00003cb0| 64 65 66 5c 6e 22 2c 20 | 6d 29 3b 0a 09 66 69 6e |def\n", |m);..fin|
|00003cc0| 64 5f 68 6f 6c 69 64 61 | 79 73 28 6d 2c 20 79 29 |d_holida|ys(m, y)|
|00003cd0| 3b 09 09 2f 2a 20 66 69 | 72 73 74 20 70 61 73 73 |;../* fi|rst pass|
|00003ce0| 20 2d 20 6d 61 6b 65 20 | 6c 69 73 74 20 6f 66 20 | - make |list of |
|00003cf0| 68 6f 6c 69 64 61 79 73 | 20 2a 2f 0a 09 50 52 54 |holidays| */..PRT|
|00003d00| 28 22 70 72 69 6e 74 6d | 6f 6e 74 68 5c 6e 22 29 |("printm|onth\n")|
|00003d10| 3b 0a 09 66 69 6e 64 5f | 64 61 79 74 65 78 74 28 |;..find_|daytext(|
|00003d20| 6d 2c 20 79 29 3b 09 09 | 2f 2a 20 73 65 63 6f 6e |m, y);..|/* secon|
|00003d30| 64 20 70 61 73 73 20 2d | 20 61 64 64 20 74 65 78 |d pass -| add tex|
|00003d40| 74 20 74 6f 20 62 6f 78 | 65 73 20 2a 2f 0a 09 50 |t to box|es */..P|
|00003d50| 52 54 28 22 73 68 6f 77 | 70 61 67 65 5c 6e 22 29 |RT("show|page\n")|
|00003d60| 3b 0a 7d 0a 0a 0a 2f 2a | 0a 20 2a 20 67 65 74 64 |;.}.../*|. * getd|
|00003d70| 61 79 20 2d 20 66 69 6e | 64 20 6e 65 78 74 20 64 |ay - fin|d next d|
|00003d80| 61 79 20 65 6e 74 72 79 | 20 66 6f 72 20 64 65 73 |ay entry| for des|
|00003d90| 69 72 65 64 20 6d 6f 6e | 74 68 20 69 6e 20 74 68 |ired mon|th in th|
|00003da0| 65 20 63 61 6c 65 6e 64 | 61 72 20 66 69 6c 65 0a |e calend|ar file.|
|00003db0| 20 2a 2f 0a 69 6e 74 20 | 67 65 74 64 61 79 28 6d | */.int |getday(m|
|00003dc0| 2c 20 79 2c 20 72 65 73 | 65 74 29 0a 09 72 65 67 |, y, res|et)..reg|
|00003dd0| 69 73 74 65 72 20 69 6e | 74 20 6d 2c 20 79 3b 0a |ister in|t m, y;.|
|00003de0| 09 69 6e 74 20 72 65 73 | 65 74 3b 0a 7b 0a 09 73 |.int res|et;.{..s|
|00003df0| 74 61 74 69 63 20 65 6f | 66 20 3d 20 30 3b 0a 09 |tatic eo|f = 0;..|
|00003e00| 72 65 67 69 73 74 65 72 | 20 63 68 61 72 20 2a 63 |register| char *c|
|00003e10| 70 3b 0a 09 72 65 67 69 | 73 74 65 72 20 63 3b 0a |p;..regi|ster c;.|
|00003e20| 09 69 6e 74 20 69 6e 5f | 63 6f 6d 6d 65 6e 74 3b |.int in_|comment;|
|00003e30| 09 09 2f 2a 20 63 6f 6d | 6d 65 6e 74 73 3a 20 66 |../* com|ments: f|
|00003e40| 72 6f 6d 20 27 23 27 20 | 74 6f 20 65 6e 64 2d 6f |rom '#' |to end-o|
|00003e50| 66 2d 6c 69 6e 65 20 2a | 2f 0a 0a 09 69 66 20 28 |f-line *|/...if (|
|00003e60| 63 66 70 20 3d 3d 20 4e | 55 4c 4c 29 09 2f 2a 20 |cfp == N|ULL)./* |
|00003e70| 77 68 6f 6f 70 73 2c 20 | 6e 6f 20 63 61 6c 65 6e |whoops, |no calen|
|00003e80| 64 61 72 20 66 69 6c 65 | 20 2a 2f 0a 09 09 72 65 |dar file| */...re|
|00003e90| 74 75 72 6e 28 30 29 3b | 0a 0a 09 69 66 20 28 72 |turn(0);|...if (r|
|00003ea0| 65 73 65 74 29 20 7b 09 | 09 2f 2a 20 6e 65 77 20 |eset) {.|./* new |
|00003eb0| 6d 6f 6e 74 68 2c 20 72 | 65 77 69 6e 64 20 2a 2f |month, r|ewind */|
|00003ec0| 0a 09 09 72 65 77 69 6e | 64 28 63 66 70 29 3b 0a |...rewin|d(cfp);.|
|00003ed0| 09 09 65 6f 66 20 3d 20 | 30 3b 0a 09 7d 0a 09 69 |..eof = |0;..}..i|
|00003ee0| 66 20 28 65 6f 66 29 0a | 09 09 72 65 74 75 72 6e |f (eof).|..return|
|00003ef0| 28 30 29 3b 0a 0a 09 64 | 6f 20 7b 0a 09 09 63 70 |(0);...d|o {...cp|
|00003f00| 20 3d 20 6c 62 75 66 3b | 0a 09 09 64 6f 20 7b 0a | = lbuf;|...do {.|
|00003f10| 09 09 09 69 6e 5f 63 6f | 6d 6d 65 6e 74 20 3d 20 |...in_co|mment = |
|00003f20| 46 41 4c 53 45 3b 0a 09 | 09 09 77 68 69 6c 65 20 |FALSE;..|..while |
|00003f30| 28 28 63 20 3d 20 67 65 | 74 63 28 63 66 70 29 29 |((c = ge|tc(cfp))|
|00003f40| 20 21 3d 20 27 5c 6e 27 | 20 26 26 20 63 20 21 3d | != '\n'| && c !=|
|00003f50| 20 45 4f 46 29 20 7b 0a | 09 09 09 09 69 66 20 28 | EOF) {.|....if (|
|00003f60| 63 20 3d 3d 20 27 23 27 | 29 0a 09 09 09 09 09 69 |c == '#'|)......i|
|00003f70| 6e 5f 63 6f 6d 6d 65 6e | 74 20 3d 20 54 52 55 45 |n_commen|t = TRUE|
|00003f80| 3b 0a 09 09 09 09 2f 2a | 20 69 67 6e 6f 72 65 20 |;...../*| ignore |
|00003f90| 63 6f 6d 6d 65 6e 74 73 | 20 61 6e 64 20 6c 65 61 |comments| and lea|
|00003fa0| 64 69 6e 67 20 77 68 69 | 74 65 20 73 70 61 63 65 |ding whi|te space|
|00003fb0| 20 2a 2f 0a 09 09 09 09 | 69 66 20 28 69 6e 5f 63 | */.....|if (in_c|
|00003fc0| 6f 6d 6d 65 6e 74 20 7c | 7c 0a 09 09 09 09 20 20 |omment |||..... |
|00003fd0| 20 20 28 63 70 20 3d 3d | 20 6c 62 75 66 20 26 26 | (cp ==| lbuf &&|
|00003fe0| 20 28 63 20 3d 3d 20 27 | 20 27 20 7c 7c 20 63 20 | (c == '| ' || c |
|00003ff0| 3d 3d 20 27 5c 74 27 29 | 29 29 0a 09 09 09 09 09 |== '\t')|))......|
|00004000| 63 6f 6e 74 69 6e 75 65 | 3b 0a 09 09 09 09 2a 63 |continue|;.....*c|
|00004010| 70 2b 2b 20 3d 20 63 3b | 0a 09 09 09 7d 0a 09 09 |p++ = c;|....}...|
|00004020| 09 69 66 20 28 63 20 3d | 3d 20 45 4f 46 29 20 7b |.if (c =|= EOF) {|
|00004030| 0a 09 09 09 09 65 6f 66 | 20 3d 20 31 3b 0a 09 09 |.....eof| = 1;...|
|00004040| 09 09 72 65 74 75 72 6e | 28 30 29 3b 0a 09 09 09 |..return|(0);....|
|00004050| 7d 0a 09 09 7d 20 77 68 | 69 6c 65 20 28 63 70 20 |}...} wh|ile (cp |
|00004060| 3d 3d 20 6c 62 75 66 29 | 3b 09 2f 2a 20 69 67 6e |== lbuf)|;./* ign|
|00004070| 6f 72 65 20 65 6d 70 74 | 79 20 6c 69 6e 65 73 20 |ore empt|y lines |
|00004080| 2a 2f 0a 09 09 2a 63 70 | 20 3d 20 30 3b 0a 0a 09 |*/...*cp| = 0;...|
|00004090| 2f 2a 20 65 78 61 6d 69 | 6e 65 20 74 68 65 20 6c |/* exami|ne the l|
|000040a0| 69 6e 65 2c 20 73 65 65 | 20 69 66 20 69 74 73 20 |ine, see| if its |
|000040b0| 6f 6e 65 20 77 65 20 77 | 61 6e 74 20 2a 2f 0a 09 |one we w|ant */..|
|000040c0| 7d 20 77 68 69 6c 65 20 | 28 20 28 63 20 3d 20 70 |} while |( (c = p|
|000040d0| 61 72 73 65 28 6d 2c 20 | 79 29 29 20 3d 3d 20 30 |arse(m, |y)) == 0|
|000040e0| 29 3b 0a 0a 09 72 65 74 | 75 72 6e 28 63 29 3b 0a |);...ret|urn(c);.|
|000040f0| 7d 0a 0a 2f 2a 0a 20 2a | 20 70 61 72 73 65 20 2d |}../*. *| parse -|
|00004100| 20 63 68 65 63 6b 20 63 | 61 6c 65 6e 64 61 72 20 | check c|alendar |
|00004110| 65 6e 74 72 79 20 66 6f | 72 20 64 65 73 69 72 65 |entry fo|r desire|
|00004120| 64 20 6d 6f 6e 74 68 2c | 20 62 72 65 61 6b 20 6c |d month,| break l|
|00004130| 69 6e 65 20 69 6e 74 6f | 20 66 69 65 6c 64 73 0a |ine into| fields.|
|00004140| 20 2a 2f 0a 70 61 72 73 | 65 28 6d 2c 20 79 29 0a | */.pars|e(m, y).|
|00004150| 09 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 6d 2c |.registe|r int m,|
|00004160| 20 79 3b 0a 7b 0a 09 72 | 65 67 69 73 74 65 72 20 | y;.{..r|egister |
|00004170| 63 68 61 72 20 2a 63 70 | 3b 0a 09 72 65 67 69 73 |char *cp|;..regis|
|00004180| 74 65 72 20 69 3b 0a 09 | 69 6e 74 20 69 73 5f 68 |ter i;..|int is_h|
|00004190| 6f 6c 69 64 61 79 20 3d | 20 30 3b 09 09 2f 2a 20 |oliday =| 0;../* |
|000041a0| 27 2a 27 20 61 66 74 65 | 72 20 64 61 74 65 20 66 |'*' afte|r date f|
|000041b0| 6c 61 67 73 20 69 74 20 | 61 73 20 68 6f 6c 69 64 |lags it |as holid|
|000041c0| 61 79 20 2a 2f 0a 09 69 | 6e 74 20 76 61 6c 69 64 |ay */..i|nt valid|
|000041d0| 20 3d 20 31 3b 0a 0a 09 | 63 70 20 3d 20 73 74 72 | = 1;...|cp = str|
|000041e0| 74 6f 6b 28 6c 62 75 66 | 2c 20 22 20 5c 74 22 29 |tok(lbuf|, " \t")|
|000041f0| 3b 09 2f 2a 20 67 65 74 | 20 66 69 72 73 74 20 66 |;./* get| first f|
|00004200| 69 65 6c 64 20 2a 2f 0a | 0a 09 77 68 69 6c 65 20 |ield */.|..while |
|00004210| 28 2a 63 70 29 20 7b 0a | 09 09 69 66 20 28 69 73 |(*cp) {.|..if (is|
|00004220| 75 70 70 65 72 28 2a 63 | 70 29 29 0a 09 09 09 2a |upper(*c|p))....*|
|00004230| 63 70 20 3d 20 74 6f 6c | 6f 77 65 72 28 2a 63 70 |cp = tol|ower(*cp|
|00004240| 29 3b 0a 09 09 63 70 2b | 2b 3b 0a 09 7d 0a 09 63 |);...cp+|+;..}..c|
|00004250| 70 20 3d 20 6c 62 75 66 | 3b 0a 0a 09 2f 2a 0a 09 |p = lbuf|;.../*..|
|00004260| 20 2a 20 43 68 65 63 6b | 20 66 6f 72 20 22 79 65 | * Check| for "ye|
|00004270| 61 72 22 20 6c 69 6e 65 | 0a 09 20 2a 2f 0a 09 69 |ar" line|.. */..i|
|00004280| 66 20 28 73 74 72 63 6d | 70 28 63 70 2c 20 22 79 |f (strcm|p(cp, "y|
|00004290| 65 61 72 22 29 20 3d 3d | 20 30 29 20 7b 0a 09 09 |ear") ==| 0) {...|
|000042a0| 63 70 20 3d 20 73 74 72 | 74 6f 6b 28 28 63 68 61 |cp = str|tok((cha|
|000042b0| 72 20 2a 29 30 2c 20 22 | 20 5c 74 22 29 3b 0a 09 |r *)0, "| \t");..|
|000042c0| 09 69 66 20 28 28 69 20 | 3d 20 61 74 6f 69 28 63 |.if ((i |= atoi(c|
|000042d0| 70 29 29 20 3e 20 30 29 | 20 7b 0a 09 09 09 69 66 |p)) > 0)| {....if|
|000042e0| 20 28 69 20 3c 20 31 30 | 30 29 0a 09 09 09 09 69 | (i < 10|0).....i|
|000042f0| 20 2b 3d 20 31 39 30 30 | 3b 0a 09 09 09 63 75 72 | += 1900|;....cur|
|00004300| 72 5f 79 65 61 72 20 3d | 20 69 3b 0a 09 09 7d 0a |r_year =| i;...}.|
|00004310| 09 09 72 65 74 75 72 6e | 28 30 29 3b 0a 09 7d 0a |..return|(0);..}.|
|00004320| 0a 09 2f 2a 0a 09 20 2a | 20 49 66 20 66 69 65 6c |../*.. *| If fiel|
|00004330| 64 20 62 65 67 69 6e 73 | 20 77 69 74 68 20 61 6c |d begins| with al|
|00004340| 70 68 61 2c 20 74 72 79 | 20 74 6f 20 64 65 63 6f |pha, try| to deco|
|00004350| 64 65 20 6d 6f 6e 74 68 | 20 6e 61 6d 65 0a 09 20 |de month| name.. |
|00004360| 2a 2f 0a 09 69 66 20 28 | 69 73 61 6c 70 68 61 28 |*/..if (|isalpha(|
|00004370| 2a 63 70 29 29 20 7b 0a | 09 09 69 66 20 28 63 75 |*cp)) {.|..if (cu|
|00004380| 72 72 5f 79 65 61 72 20 | 21 3d 20 79 29 0a 09 09 |rr_year |!= y)...|
|00004390| 09 72 65 74 75 72 6e 28 | 30 29 3b 0a 0a 09 09 66 |.return(|0);....f|
|000043a0| 6f 72 20 28 69 20 3d 20 | 30 3b 20 6d 6f 6e 74 68 |or (i = |0; month|
|000043b0| 73 5b 69 5d 3b 20 69 2b | 2b 29 0a 09 09 09 69 66 |s[i]; i+|+)....if|
|000043c0| 20 28 73 74 72 6e 63 6d | 70 28 63 70 2c 20 6d 6f | (strncm|p(cp, mo|
|000043d0| 6e 74 68 73 5b 69 5d 2c | 20 33 29 20 3d 3d 20 30 |nths[i],| 3) == 0|
|000043e0| 29 20 7b 0a 09 09 09 09 | 69 66 20 28 2b 2b 69 20 |) {.....|if (++i |
|000043f0| 21 3d 20 6d 29 0a 09 09 | 09 09 09 72 65 74 75 72 |!= m)...|...retur|
|00004400| 6e 28 30 29 3b 0a 0a 09 | 09 09 09 2f 2a 20 6d 6f |n(0);...|.../* mo|
|00004410| 6e 74 68 20 66 6f 75 6e | 64 2c 20 67 65 74 20 64 |nth foun|d, get d|
|00004420| 61 79 20 2a 2f 0a 0a 09 | 09 09 09 69 66 20 28 28 |ay */...|...if ((|
|00004430| 63 70 20 3d 20 73 74 72 | 74 6f 6b 28 28 63 68 61 |cp = str|tok((cha|
|00004440| 72 20 2a 29 30 2c 20 22 | 20 5c 74 22 29 29 20 3d |r *)0, "| \t")) =|
|00004450| 3d 20 4e 55 4c 4c 29 0a | 09 09 09 09 09 72 65 74 |= NULL).|.....ret|
|00004460| 75 72 6e 28 30 29 3b 0a | 09 09 09 09 69 66 20 28 |urn(0);.|....if (|
|00004470| 28 69 20 3d 20 61 74 6f | 69 28 63 70 29 29 20 3c |(i = ato|i(cp)) <|
|00004480| 20 31 20 7c 7c 20 69 20 | 3e 20 33 31 29 0a 09 09 | 1 || i |> 31)...|
|00004490| 09 09 09 72 65 74 75 72 | 6e 28 30 29 3b 0a 09 09 |...retur|n(0);...|
|000044a0| 09 09 77 68 69 6c 65 20 | 28 69 73 64 69 67 69 74 |..while |(isdigit|
|000044b0| 28 2a 63 70 29 29 09 2f | 2a 20 73 6b 69 70 20 6f |(*cp))./|* skip o|
|000044c0| 76 65 72 20 64 61 79 20 | 66 69 65 6c 64 20 2a 2f |ver day |field */|
|000044d0| 0a 09 09 09 09 09 63 70 | 2b 2b 3b 0a 09 09 09 09 |......cp|++;.....|
|000044e0| 69 66 20 28 2a 63 70 20 | 3d 3d 20 27 2a 27 29 09 |if (*cp |== '*').|
|000044f0| 09 2f 2a 20 68 6f 6c 69 | 64 61 79 3f 20 2a 2f 0a |./* holi|day? */.|
|00004500| 09 09 09 09 09 69 73 5f | 68 6f 6c 69 64 61 79 20 |.....is_|holiday |
|00004510| 3d 20 31 3b 0a 09 09 09 | 09 69 66 20 28 6c 6f 61 |= 1;....|.if (loa|
|00004520| 64 77 6f 72 64 73 28 29 | 20 7c 7c 20 69 73 5f 68 |dwords()| || is_h|
|00004530| 6f 6c 69 64 61 79 29 0a | 09 09 09 09 09 72 65 74 |oliday).|.....ret|
|00004540| 75 72 6e 28 69 20 7c 20 | 69 73 5f 68 6f 6c 69 64 |urn(i | |is_holid|
|00004550| 61 79 20 2a 20 48 4f 4c | 49 44 41 59 29 3b 0a 09 |ay * HOL|IDAY);..|
|00004560| 09 09 09 72 65 74 75 72 | 6e 28 30 29 3b 0a 09 09 |...retur|n(0);...|
|00004570| 09 7d 0a 09 09 72 65 74 | 75 72 6e 28 30 29 3b 0a |.}...ret|urn(0);.|
|00004580| 09 7d 0a 09 2f 2a 0a 09 | 20 2a 20 4e 6f 74 20 61 |.}../*..| * Not a|
|00004590| 6c 70 68 61 20 6d 6f 6e | 74 68 2c 20 74 72 79 20 |lpha mon|th, try |
|000045a0| 6e 75 6d 65 72 69 63 20 | 28 70 61 72 73 65 20 66 |numeric |(parse f|
|000045b0| 75 6c 6c 20 64 61 74 65 | 20 74 6f 20 73 65 65 20 |ull date| to see |
|000045c0| 69 66 20 79 65 61 72 20 | 4f 4b 29 0a 09 20 2a 2f |if year |OK).. */|
|000045d0| 0a 09 69 66 20 28 28 69 | 20 3d 20 61 74 6f 69 28 |..if ((i| = atoi(|
|000045e0| 63 70 29 29 20 21 3d 20 | 6d 29 0a 09 09 76 61 6c |cp)) != |m)...val|
|000045f0| 69 64 20 3d 20 30 3b 0a | 09 77 68 69 6c 65 20 28 |id = 0;.|.while (|
|00004600| 69 73 64 69 67 69 74 28 | 2a 63 70 29 29 0a 09 09 |isdigit(|*cp))...|
|00004610| 63 70 2b 2b 3b 0a 09 77 | 68 69 6c 65 20 28 2a 63 |cp++;..w|hile (*c|
|00004620| 70 20 26 26 20 21 69 73 | 64 69 67 69 74 28 2a 63 |p && !is|digit(*c|
|00004630| 70 29 29 0a 09 09 63 70 | 2b 2b 3b 0a 0a 09 2f 2a |p))...cp|++;.../*|
|00004640| 20 6e 6f 77 20 67 65 74 | 20 64 61 79 20 2a 2f 0a | now get| day */.|
|00004650| 0a 09 69 66 20 28 28 69 | 20 3d 20 61 74 6f 69 28 |..if ((i| = atoi(|
|00004660| 63 70 29 29 20 3c 20 31 | 20 7c 7c 20 69 20 3e 20 |cp)) < 1| || i > |
|00004670| 33 31 29 0a 09 09 76 61 | 6c 69 64 20 3d 20 30 3b |31)...va|lid = 0;|
|00004680| 0a 0a 09 20 2f 2a 20 4e | 75 6d 65 72 69 63 20 64 |... /* N|umeric d|
|00004690| 61 74 65 73 20 6d 61 79 | 20 68 61 76 65 20 61 20 |ates may| have a |
|000046a0| 79 65 61 72 20 2a 2f 0a | 0a 09 77 68 69 6c 65 20 |year */.|..while |
|000046b0| 28 69 73 64 69 67 69 74 | 28 2a 63 70 29 29 09 09 |(isdigit|(*cp))..|
|000046c0| 2f 2a 20 73 6b 69 70 20 | 6f 76 65 72 20 64 61 79 |/* skip |over day|
|000046d0| 20 66 69 65 6c 64 20 2a | 2f 0a 09 09 63 70 2b 2b | field *|/...cp++|
|000046e0| 3b 0a 09 69 66 20 28 2a | 63 70 20 3d 3d 20 27 2a |;..if (*|cp == '*|
|000046f0| 27 29 09 09 09 2f 2a 20 | 68 6f 6c 69 64 61 79 3f |').../* |holiday?|
|00004700| 20 2a 2f 0a 09 09 69 73 | 5f 68 6f 6c 69 64 61 79 | */...is|_holiday|
|00004710| 20 3d 20 31 3b 0a 09 77 | 68 69 6c 65 20 28 2a 63 | = 1;..w|hile (*c|
|00004720| 70 20 26 26 20 21 69 73 | 64 69 67 69 74 28 2a 63 |p && !is|digit(*c|
|00004730| 70 29 29 0a 09 09 63 70 | 2b 2b 3b 0a 09 69 66 20 |p))...cp|++;..if |
|00004740| 28 28 6d 20 3d 20 61 74 | 6f 69 28 63 70 29 29 20 |((m = at|oi(cp)) |
|00004750| 3e 20 30 29 20 7b 0a 09 | 09 69 66 20 28 6d 20 3c |> 0) {..|.if (m <|
|00004760| 20 31 30 30 29 0a 09 09 | 09 6d 20 2b 3d 20 31 39 | 100)...|.m += 19|
|00004770| 30 30 3b 0a 09 09 63 75 | 72 72 5f 79 65 61 72 20 |00;...cu|rr_year |
|00004780| 3d 20 6d 3b 0a 09 09 77 | 68 69 6c 65 20 28 69 73 |= m;...w|hile (is|
|00004790| 64 69 67 69 74 28 2a 63 | 70 29 29 09 2f 2a 20 73 |digit(*c|p))./* s|
|000047a0| 6b 69 70 20 6f 76 65 72 | 20 79 65 61 72 20 66 69 |kip over| year fi|
|000047b0| 65 6c 64 20 2a 2f 0a 09 | 09 09 63 70 2b 2b 3b 0a |eld */..|..cp++;.|
|000047c0| 09 09 69 66 20 28 2a 63 | 70 20 3d 3d 20 27 2a 27 |..if (*c|p == '*'|
|000047d0| 29 09 09 2f 2a 20 68 6f | 6c 69 64 61 79 3f 20 2a |)../* ho|liday? *|
|000047e0| 2f 0a 09 09 09 69 73 5f | 68 6f 6c 69 64 61 79 20 |/....is_|holiday |
|000047f0| 3d 20 31 3b 0a 09 7d 0a | 0a 09 69 66 20 28 21 76 |= 1;..}.|..if (!v|
|00004800| 61 6c 69 64 20 7c 7c 20 | 63 75 72 72 5f 79 65 61 |alid || |curr_yea|
|00004810| 72 20 21 3d 20 79 29 09 | 2f 2a 20 64 61 74 65 20 |r != y).|/* date |
|00004820| 6e 6f 74 20 61 70 70 6c | 69 63 61 62 6c 65 20 2d |not appl|icable -|
|00004830| 20 72 65 74 75 72 6e 20 | 30 20 2a 2f 0a 09 09 72 | return |0 */...r|
|00004840| 65 74 75 72 6e 28 30 29 | 3b 0a 0a 09 69 66 20 28 |eturn(0)|;...if (|
|00004850| 6c 6f 61 64 77 6f 72 64 | 73 28 29 20 7c 7c 20 69 |loadword|s() || i|
|00004860| 73 5f 68 6f 6c 69 64 61 | 79 29 09 2f 2a 20 64 61 |s_holida|y)./* da|
|00004870| 74 65 20 6f 66 20 73 6f | 6d 65 20 73 69 67 6e 69 |te of so|me signi|
|00004880| 66 69 63 61 6e 63 65 20 | 2a 2f 0a 09 09 72 65 74 |ficance |*/...ret|
|00004890| 75 72 6e 28 69 20 7c 20 | 69 73 5f 68 6f 6c 69 64 |urn(i | |is_holid|
|000048a0| 61 79 20 2a 20 48 4f 4c | 49 44 41 59 29 3b 0a 09 |ay * HOL|IDAY);..|
|000048b0| 72 65 74 75 72 6e 28 30 | 29 3b 0a 7d 0a 0a 0a 2f |return(0|);.}.../|
|000048c0| 2a 0a 20 2a 20 6c 6f 61 | 64 77 6f 72 64 73 20 2d |*. * loa|dwords -|
|000048d0| 20 74 6f 6b 65 6e 69 7a | 65 20 6c 69 6e 65 20 62 | tokeniz|e line b|
|000048e0| 75 66 66 65 72 20 69 6e | 74 6f 20 77 6f 72 64 20 |uffer in|to word |
|000048f0| 61 72 72 61 79 2c 20 72 | 65 74 75 72 6e 20 77 6f |array, r|eturn wo|
|00004900| 72 64 20 63 6f 75 6e 74 | 0a 20 2a 2f 0a 6c 6f 61 |rd count|. */.loa|
|00004910| 64 77 6f 72 64 73 28 29 | 0a 7b 0a 09 72 65 67 69 |dwords()|.{..regi|
|00004920| 73 74 65 72 20 63 68 61 | 72 20 2a 2a 61 70 20 3d |ster cha|r **ap =|
|00004930| 20 77 6f 72 64 73 3b 0a | 09 72 65 67 69 73 74 65 | words;.|.registe|
|00004940| 72 20 69 3b 0a 0a 09 66 | 6f 72 20 28 69 20 3d 20 |r i;...f|or (i = |
|00004950| 30 3b 20 2a 61 70 20 3d | 20 73 74 72 74 6f 6b 28 |0; *ap =| strtok(|
|00004960| 28 63 68 61 72 20 2a 29 | 30 2c 20 22 20 5c 74 22 |(char *)|0, " \t"|
|00004970| 29 20 3b 20 61 70 2b 2b | 2c 20 69 2b 2b 29 20 3b |) ; ap++|, i++) ;|
|00004980| 0a 09 72 65 74 75 72 6e | 28 69 29 3b 0a 7d 0a 0a |..return|(i);.}..|
|00004990| 53 48 41 52 5f 45 4f 46 | 0a 66 69 0a 69 66 20 74 |SHAR_EOF|.fi.if t|
|000049a0| 65 73 74 20 2d 66 20 27 | 70 63 61 6c 2e 68 6c 70 |est -f '|pcal.hlp|
|000049b0| 27 0a 74 68 65 6e 0a 09 | 65 63 68 6f 20 73 68 61 |'.then..|echo sha|
|000049c0| 72 3a 20 77 69 6c 6c 20 | 6e 6f 74 20 6f 76 65 72 |r: will |not over|
|000049d0| 2d 77 72 69 74 65 20 65 | 78 69 73 74 69 6e 67 20 |-write e|xisting |
|000049e0| 66 69 6c 65 20 27 70 63 | 61 6c 2e 68 6c 70 27 0a |file 'pc|al.hlp'.|
|000049f0| 65 6c 73 65 0a 63 61 74 | 20 3c 3c 20 5c 53 48 41 |else.cat| << \SHA|
|00004a00| 52 5f 45 4f 46 20 3e 20 | 27 70 63 61 6c 2e 68 6c |R_EOF > |'pcal.hl|
|00004a10| 70 27 0a 31 20 50 43 41 | 4c 0a 20 20 20 20 20 20 |p'.1 PCA|L. |
|00004a20| 20 20 50 63 61 6c 20 20 | 67 65 6e 65 72 61 74 65 | Pcal |generate|
|00004a30| 73 20 20 50 6f 73 74 53 | 63 72 69 70 74 20 20 74 |s PostS|cript t|
|00004a40| 6f 20 70 72 6f 64 75 63 | 65 20 6c 61 6e 64 73 63 |o produc|e landsc|
|00004a50| 61 70 65 20 6f 72 20 20 | 70 6f 72 74 72 61 69 74 |ape or |portrait|
|00004a60| 0a 20 20 20 20 6f 72 69 | 65 6e 74 61 74 65 64 20 |. ori|entated |
|00004a70| 63 61 6c 65 6e 64 61 72 | 73 20 66 6f 72 20 20 61 |calendar|s for a|
|00004a80| 6e 79 20 20 6d 6f 6e 74 | 68 20 20 61 6e 64 20 20 |ny mont|h and |
|00004a90| 79 65 61 72 2e 20 20 54 | 68 65 20 64 65 66 61 75 |year. T|he defau|
|00004aa0| 6c 74 73 20 66 6f 72 0a | 20 20 20 20 6d 6f 6e 74 |lts for.| mont|
|00004ab0| 68 20 61 6e 64 20 79 65 | 61 72 20 61 72 65 20 74 |h and ye|ar are t|
|00004ac0| 68 65 20 63 75 72 72 65 | 6e 74 20 6d 6f 6e 74 68 |he curre|nt month|
|00004ad0| 20 61 6e 64 20 79 65 61 | 72 2e 0a 0a 20 20 20 20 | and yea|r... |
|00004ae0| 20 20 20 20 56 4d 53 20 | 56 65 72 73 69 6f 6e 0a | VMS |Version.|
|00004af0| 20 20 20 20 20 20 20 20 | 45 78 65 63 75 74 69 6f | |Executio|
|00004b00| 6e 20 66 6f 72 6d 61 74 | 3a 0a 20 20 20 20 0a 20 |n format|:. . |
|00004b10| 20 20 20 20 20 20 20 20 | 20 20 20 70 63 61 6c 20 | | pcal |
|00004b20| 5b 6f 70 74 69 6f 6e 73 | 5d 6d 20 79 79 5d 20 5b |[options|]m yy] [|
|00004b30| 6e 5d 0a 0a 20 20 20 20 | 20 20 20 20 49 66 20 61 |n].. | If a|
|00004b40| 20 66 69 6c 65 20 6e 61 | 6d 65 64 20 63 61 6c 65 | file na|med cale|
|00004b50| 6e 64 61 72 2e 64 61 74 | 20 20 72 65 73 69 64 65 |ndar.dat| reside|
|00004b60| 73 20 20 69 6e 20 20 74 | 68 65 20 20 63 61 6c 6c |s in t|he call|
|00004b70| 65 72 27 73 20 20 68 6f | 6d 65 0a 20 20 20 20 64 |er's ho|me. d|
|00004b80| 69 72 65 63 74 6f 72 79 | 2c 20 69 74 20 20 77 69 |irectory|, it wi|
|00004b90| 6c 6c 20 20 62 65 20 20 | 73 65 61 72 63 68 65 64 |ll be |searched|
|00004ba0| 20 20 66 6f 72 20 20 6c | 69 6e 65 73 20 20 77 69 | for l|ines wi|
|00004bb0| 74 68 20 20 6c 65 61 64 | 69 6e 67 20 64 61 74 65 |th lead|ing date|
|00004bc0| 73 0a 20 20 20 20 6d 61 | 74 63 68 69 6e 67 20 74 |s. ma|tching t|
|00004bd0| 68 65 20 72 65 71 75 65 | 73 74 65 64 20 20 6d 6f |he reque|sted mo|
|00004be0| 6e 74 68 20 20 61 6e 64 | 20 79 65 61 72 20 28 63 |nth and| year (c|
|00004bf0| 75 72 72 65 6e 74 20 62 | 79 20 64 65 66 61 75 6c |urrent b|y defaul|
|00004c00| 74 29 2e 20 20 41 6e 79 | 0a 20 20 20 20 74 65 78 |t). Any|. tex|
|00004c10| 74 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 74 68 65 20 |t follow|ing the |
|00004c20| 64 61 74 65 20 20 77 69 | 6c 6c 20 62 65 20 70 72 |date wi|ll be pr|
|00004c30| 69 6e 74 65 64 20 6f 6e | 20 74 68 65 20 63 61 6c |inted on| the cal|
|00004c40| 65 6e 64 61 72 20 75 6e | 64 65 72 20 74 68 65 0a |endar un|der the.|
|00004c50| 20 20 20 20 61 70 70 72 | 6f 70 72 69 61 74 65 20 | appr|opriate |
|00004c60| 64 61 79 20 6f 66 20 74 | 68 65 20 6d 6f 6e 74 68 |day of t|he month|
|00004c70| 2e 20 20 20 44 61 74 65 | 73 20 69 6e 20 74 68 65 |. Date|s in the|
|00004c80| 20 63 61 6c 65 6e 64 61 | 72 2e 64 61 74 20 66 69 | calenda|r.dat fi|
|00004c90| 6c 65 20 6d 61 79 0a 20 | 20 20 20 63 6f 6e 73 69 |le may. | consi|
|00004ca0| 73 74 20 20 6f 66 20 20 | 61 20 20 6e 75 6d 65 72 |st of |a numer|
|00004cb0| 69 63 20 6f 72 20 61 6c | 70 68 61 20 20 6d 6f 6e |ic or al|pha mon|
|00004cc0| 74 68 20 20 28 61 74 20 | 20 6c 65 61 73 74 20 20 |th (at | least |
|00004cd0| 74 68 65 20 20 66 69 72 | 73 74 20 20 33 0a 20 20 |the fir|st 3. |
|00004ce0| 20 20 63 68 61 72 61 63 | 74 65 72 73 20 20 66 6f | charac|ters fo|
|00004cf0| 72 20 20 6d 6f 6e 74 68 | 20 20 6e 61 6d 65 73 29 |r month| names)|
|00004d00| 20 20 66 6f 6c 6c 6f 77 | 65 64 20 20 62 79 20 20 | follow|ed by |
|00004d10| 61 20 20 6e 75 6d 65 72 | 69 63 20 20 64 61 79 20 |a numer|ic day |
|00004d20| 20 61 6e 64 0a 20 20 20 | 20 6f 70 74 69 6f 6e 61 | and. | optiona|
|00004d30| 6c 6c 79 20 20 66 6f 6c | 6c 6f 77 65 64 20 20 62 |lly fol|lowed b|
|00004d40| 79 20 20 61 20 79 65 61 | 72 2e 20 20 41 6e 79 20 |y a yea|r. Any |
|00004d50| 6e 6f 6e 2d 6e 75 6d 65 | 72 69 63 20 20 63 68 61 |non-nume|ric cha|
|00004d60| 72 61 63 74 65 72 20 20 | 6d 61 79 0a 20 20 20 20 |racter |may. |
|00004d70| 73 65 70 61 72 61 74 65 | 20 6e 75 6d 65 72 69 63 |separate| numeric|
|00004d80| 20 64 61 74 65 73 2e 20 | 20 48 6f 6c 69 64 61 79 | dates. | Holiday|
|00004d90| 73 20 6d 61 79 20 62 65 | 20 66 6c 61 67 67 65 64 |s may be| flagged|
|00004da0| 20 62 79 20 20 66 6f 6c | 6c 6f 77 69 6e 67 20 74 | by fol|lowing t|
|00004db0| 68 65 0a 20 20 20 20 64 | 61 74 65 20 69 6d 6d 65 |he. d|ate imme|
|00004dc0| 64 69 61 74 65 6c 79 20 | 77 69 74 68 20 27 2a 27 |diately |with '*'|
|00004dd0| 3b 20 20 74 68 69 73 20 | 77 69 6c 6c 20 63 61 75 |; this |will cau|
|00004de0| 73 65 20 74 68 65 20 64 | 61 74 65 20 74 6f 20 62 |se the d|ate to b|
|00004df0| 65 20 70 72 69 6e 74 65 | 64 0a 20 20 20 20 69 6e |e printe|d. in|
|00004e00| 20 67 72 61 79 2e 20 20 | 4c 69 6e 65 73 20 69 6e | gray. |Lines in|
|00004e10| 20 74 68 65 20 63 61 6c | 65 6e 64 61 72 2e 64 61 | the cal|endar.da|
|00004e20| 74 20 66 69 6c 65 20 63 | 6f 6e 73 69 73 74 69 6e |t file c|onsistin|
|00004e30| 67 20 6f 66 20 22 79 65 | 61 72 20 78 78 78 78 22 |g of "ye|ar xxxx"|
|00004e40| 0a 20 20 20 20 28 77 68 | 65 72 65 20 20 78 78 78 |. (wh|ere xxx|
|00004e50| 78 20 20 69 73 20 61 20 | 6e 75 6d 65 72 69 63 20 |x is a |numeric |
|00004e60| 79 65 61 72 29 20 63 61 | 6e 20 62 65 20 75 73 65 |year) ca|n be use|
|00004e70| 64 20 74 6f 20 73 65 74 | 20 74 68 65 20 20 79 65 |d to set| the ye|
|00004e80| 61 72 20 20 66 6f 72 0a | 20 20 20 20 66 6f 6c 6c |ar for.| foll|
|00004e90| 6f 77 69 6e 67 20 65 6e | 74 72 69 65 73 2e 20 20 |owing en|tries. |
|00004ea0| 54 68 69 73 20 61 73 73 | 75 6d 65 73 20 74 68 61 |This ass|umes tha|
|00004eb0| 74 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |t the fo|llowing |
|00004ec0| 65 6e 74 72 69 65 73 20 | 64 6f 20 6e 6f 74 0a 20 |entries |do not. |
|00004ed0| 20 20 20 63 6f 6e 74 61 | 69 6e 20 61 20 79 65 61 | conta|in a yea|
|00004ee0| 72 3b 20 20 61 6e 79 20 | 64 61 74 65 20 65 6e 74 |r; any |date ent|
|00004ef0| 72 69 65 73 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |ries con|taining |
|00004f00| 79 65 61 72 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |year inf|ormation|
|00004f10| 20 77 69 6c 6c 0a 20 20 | 20 20 73 65 74 20 74 68 | will. | set th|
|00004f20| 65 20 72 65 6d 65 6d 62 | 65 72 65 64 20 79 65 61 |e rememb|ered yea|
|00004f30| 72 20 74 6f 20 20 74 68 | 61 74 20 79 65 61 72 2e |r to th|at year.|
|00004f40| 20 20 43 6f 6d 6d 65 6e | 74 73 20 28 27 23 27 20 | Commen|ts ('#' |
|00004f50| 74 68 72 6f 75 67 68 20 | 65 6e 64 2d 0a 20 20 20 |through |end-. |
|00004f60| 20 6f 66 2d 6c 69 6e 65 | 29 20 61 72 65 20 70 65 | of-line|) are pe|
|00004f70| 72 6d 69 74 74 65 64 2e | 0a 0a 32 20 70 61 72 61 |rmitted.|..2 para|
|00004f80| 6d 65 74 65 72 73 0a 20 | 20 6d 6d 20 79 79 20 6e |meters. | mm yy n|
|00004f90| 0a 20 20 20 20 20 20 20 | 20 22 6d 6d 22 20 61 6e |. | "mm" an|
|00004fa0| 64 20 22 79 79 22 20 20 | 61 72 65 20 6e 75 6d 65 |d "yy" |are nume|
|00004fb0| 72 69 63 20 76 61 6c 75 | 65 73 20 6f 66 20 74 68 |ric valu|es of th|
|00004fc0| 65 20 6d 6f 6e 74 68 20 | 28 31 2d 31 32 29 20 61 |e month |(1-12) a|
|00004fd0| 6e 64 20 79 65 61 72 0a | 20 20 20 20 28 30 2d 39 |nd year.| (0-9|
|00004fe0| 39 29 20 28 69 2e 65 2e | 2c 20 4a 75 6c 79 20 31 |9) (i.e.|, July 1|
|00004ff0| 39 39 30 20 20 77 6f 75 | 6c 64 20 20 62 65 20 37 |990 wou|ld be 7|
|00005000| 20 39 30 29 2e 20 20 49 | 66 20 79 6f 75 20 6a 75 | 90). I|f you ju|
|00005010| 73 74 20 69 6e 63 6c 75 | 64 65 20 74 68 65 0a 20 |st inclu|de the. |
|00005020| 20 20 20 22 79 79 22 20 | 6f 70 74 69 6f 6e 2c 20 | "yy" |option, |
|00005030| 61 6e 20 65 6e 74 69 72 | 65 20 31 32 20 20 6d 6f |an entir|e 12 mo|
|00005040| 6e 74 68 73 20 20 6f 66 | 20 63 61 6c 65 6e 64 61 |nths of| calenda|
|00005050| 72 73 20 77 69 6c 6c 20 | 62 65 20 67 65 6e 65 72 |rs will |be gener|
|00005060| 61 74 65 64 2e 0a 20 20 | 20 20 41 20 73 70 65 63 |ated.. | A spec|
|00005070| 69 66 69 63 20 6d 6f 6e | 74 68 20 63 61 6e 20 62 |ific mon|th can b|
|00005080| 65 20 70 72 6f 64 75 63 | 65 64 20 20 62 79 20 69 |e produc|ed by i|
|00005090| 6e 63 6c 75 64 69 6e 67 | 20 74 68 65 20 22 6d 6d |ncluding| the "mm|
|000050a0| 22 20 70 61 72 61 6d 65 | 74 65 72 2e 0a 20 20 20 |" parame|ter.. |
|000050b0| 20 54 68 65 20 20 22 6e | 22 20 20 70 61 72 61 6d | The "n|" param|
|000050c0| 65 74 65 72 20 77 69 6c | 6c 20 70 72 6f 64 75 63 |eter wil|l produc|
|000050d0| 65 20 74 68 65 20 22 6e | 22 20 20 63 6f 6e 73 65 |e the "n|" conse|
|000050e0| 63 74 75 74 69 76 65 20 | 20 6d 6f 6e 74 68 73 20 |ctutive | months |
|000050f0| 20 6f 66 0a 20 20 20 20 | 63 61 6c 65 6e 64 61 72 | of. |calendar|
|00005100| 73 20 73 74 61 72 74 69 | 6e 67 20 77 69 74 68 20 |s starti|ng with |
|00005110| 74 68 65 20 72 65 71 75 | 65 73 74 65 64 20 6d 6f |the requ|ested mo|
|00005120| 6e 74 68 2e 0a 0a 32 20 | 2d 65 0a 20 20 20 20 20 |nth...2 |-e. |
|00005130| 20 20 20 50 72 69 6e 74 | 20 61 6e 20 20 65 6d 70 | Print| an emp|
|00005140| 74 79 20 20 63 61 6c 65 | 6e 64 61 72 2e 20 20 20 |ty cale|ndar. |
|00005150| 20 44 6f 20 20 6e 6f 74 | 20 20 70 72 69 6e 74 20 | Do not| print |
|00005160| 20 65 6e 74 72 69 65 73 | 20 20 66 72 6f 6d 20 20 | entries| from |
|00005170| 61 0a 20 20 20 20 63 61 | 6c 65 6e 64 61 72 2e 64 |a. ca|lendar.d|
|00005180| 61 74 20 66 69 6c 65 2e | 0a 0a 32 20 2d 66 20 3c |at file.|..2 -f <|
|00005190| 46 49 4c 45 3e 0a 20 20 | 20 20 20 20 20 20 44 69 |FILE>. | Di|
|000051a0| 72 65 63 74 73 20 70 63 | 61 6c 20 74 6f 20 75 73 |rects pc|al to us|
|000051b0| 65 20 74 68 65 20 20 66 | 69 6c 65 20 6e 61 6d 65 |e the f|ile name|
|000051c0| 20 5b 31 6d 3c 46 49 4c | 45 3e 5b 6d 20 61 73 20 | [1m<FIL|E>[m as |
|000051d0| 74 68 65 20 69 6e 70 75 | 74 20 66 69 6c 65 20 69 |the inpu|t file i|
|000051e0| 6e 0a 20 20 20 20 70 6c | 61 63 65 20 20 6f 66 20 |n. pl|ace of |
|000051f0| 74 68 65 20 20 64 65 66 | 61 75 6c 74 20 20 63 61 |the def|ault ca|
|00005200| 6c 65 6e 64 61 72 2e 64 | 61 74 20 20 66 69 6c 65 |lendar.d|at file|
|00005210| 20 20 69 6e 20 20 74 68 | 65 20 20 63 61 6c 6c 65 | in th|e calle|
|00005220| 72 73 20 20 68 6f 6d 65 | 0a 20 20 20 20 64 69 72 |rs home|. dir|
|00005230| 65 63 74 6f 72 79 2e 0a | 32 20 2d 6f 20 3c 46 49 |ectory..|2 -o <FI|
|00005240| 4c 45 3e 0a 20 20 20 20 | 20 20 20 20 44 69 72 65 |LE>. | Dire|
|00005250| 63 74 73 20 70 63 61 6c | 20 74 6f 20 77 72 69 74 |cts pcal| to writ|
|00005260| 65 20 74 68 65 20 50 6f | 73 74 53 63 72 69 70 74 |e the Po|stScript|
|00005270| 20 63 61 6c 65 6e 64 61 | 72 20 69 6e 74 6f 20 5b | calenda|r into [|
|00005280| 31 6d 46 49 4c 45 5b 6d | 2e 0a 32 20 2d 72 0a 20 |1mFILE[m|..2 -r. |
|00005290| 20 20 20 20 20 20 20 54 | 68 69 73 20 77 69 6c 6c | T|his will|
|000052a0| 20 63 61 75 73 65 20 20 | 74 68 65 20 20 6f 75 74 | cause |the out|
|000052b0| 70 75 74 20 20 74 6f 20 | 20 63 6f 6d 65 20 20 6f |put to | come o|
|000052c0| 75 74 20 20 69 6e 20 20 | 70 6f 72 74 72 61 69 74 |ut in |portrait|
|000052d0| 20 6d 6f 64 65 0a 20 20 | 20 20 69 6e 73 74 65 61 | mode. | instea|
|000052e0| 64 20 6f 66 20 6c 61 6e | 64 73 63 61 70 65 20 6d |d of lan|dscape m|
|000052f0| 6f 64 65 2e 0a 32 20 2d | 73 0a 20 20 20 20 20 20 |ode..2 -|s. |
|00005300| 20 20 54 68 69 73 20 77 | 69 6c 6c 20 20 63 61 75 | This w|ill cau|
|00005310| 73 65 20 20 53 61 74 75 | 72 64 61 79 73 20 20 74 |se Satu|rdays t|
|00005320| 6f 20 62 65 20 70 72 69 | 6e 74 65 64 20 69 6e 20 |o be pri|nted in |
|00005330| 62 6c 61 63 6b 20 69 6e | 73 74 65 61 64 20 6f 66 |black in|stead of|
|00005340| 0a 20 20 20 20 67 72 61 | 79 2e 0a 32 20 2d 22 53 |. gra|y..2 -"S|
|00005350| 22 0a 20 20 20 20 20 20 | 20 20 54 68 69 73 20 77 |". | This w|
|00005360| 69 6c 6c 20 63 61 75 73 | 65 20 20 53 61 74 75 72 |ill caus|e Satur|
|00005370| 64 61 79 73 20 20 61 6e | 64 20 53 75 6e 64 61 79 |days an|d Sunday|
|00005380| 73 20 74 6f 20 62 65 20 | 70 72 69 6e 74 65 64 20 |s to be |printed |
|00005390| 69 6e 20 62 6c 61 63 6b | 0a 20 20 20 20 69 6e 73 |in black|. ins|
|000053a0| 74 65 61 64 20 6f 66 20 | 67 72 61 79 2e 0a 32 20 |tead of |gray..2 |
|000053b0| 2d 74 20 3c 46 4f 4e 54 | 3e 0a 20 20 20 20 20 20 |-t <FONT|>. |
|000053c0| 20 20 54 68 69 73 20 6f | 70 74 69 6f 6e 20 63 61 | This o|ption ca|
|000053d0| 6e 20 62 65 20 75 73 65 | 64 20 20 74 6f 20 20 63 |n be use|d to c|
|000053e0| 68 61 6e 67 65 20 20 74 | 68 65 20 20 66 6f 6e 74 |hange t|he font|
|000053f0| 20 20 74 68 65 20 20 74 | 69 74 6c 65 20 20 69 73 | the t|itle is|
|00005400| 0a 20 20 20 20 70 72 69 | 6e 74 65 64 20 20 77 69 |. pri|nted wi|
|00005410| 74 68 20 20 28 69 65 2e | 20 20 20 20 70 63 61 6c |th (ie.| pcal|
|00005420| 20 20 2d 74 54 69 6d 65 | 73 2d 52 6f 6d 61 6e 29 | -tTime|s-Roman)|
|00005430| 2e 20 20 20 20 20 20 54 | 68 65 20 20 64 65 66 61 |. T|he defa|
|00005440| 75 6c 74 20 20 69 73 0a | 20 20 20 20 54 69 6d 65 |ult is.| Time|
|00005450| 73 2d 42 6f 6c 64 2e 0a | 32 20 2d 64 20 3c 46 4f |s-Bold..|2 -d <FO|
|00005460| 4e 54 3e 0a 20 20 20 20 | 20 20 20 20 54 68 69 73 |NT>. | This|
|00005470| 20 6f 70 74 69 6f 6e 20 | 69 73 20 74 68 65 20 73 | option |is the s|
|00005480| 61 6d 65 20 61 73 20 20 | 2d 74 20 20 65 78 63 65 |ame as |-t exce|
|00005490| 70 74 20 20 74 68 61 74 | 20 20 74 68 65 20 66 6f |pt that| the fo|
|000054a0| 6e 74 20 75 73 65 64 20 | 74 6f 0a 20 20 20 20 70 |nt used |to. p|
|000054b0| 72 69 6e 74 20 74 68 65 | 20 64 61 79 20 6e 75 6d |rint the| day num|
|000054c0| 62 65 72 73 20 69 73 20 | 63 68 61 6e 67 65 64 2e |bers is |changed.|
|000054d0| 0a 32 20 43 41 56 45 41 | 54 53 0a 20 20 20 20 20 |.2 CAVEA|TS. |
|000054e0| 20 20 20 54 68 65 20 6f | 72 69 67 69 6e 61 6c 20 | The o|riginal |
|000054f0| 50 6f 73 74 53 63 72 69 | 70 74 20 63 6f 64 65 20 |PostScri|pt code |
|00005500| 20 74 6f 20 20 67 65 6e | 65 72 61 74 65 20 20 74 | to gen|erate t|
|00005510| 68 65 20 20 63 61 6c 65 | 6e 64 61 72 73 20 77 61 |he cale|ndars wa|
|00005520| 73 0a 20 20 20 20 77 72 | 69 74 74 65 6e 20 62 79 |s. wr|itten by|
|00005530| 20 50 61 74 72 69 63 6b | 20 57 6f 6f 64 20 28 43 | Patrick| Wood (C|
|00005540| 6f 70 79 77 72 69 74 65 | 20 20 28 63 29 20 20 31 |opywrite| (c) 1|
|00005550| 39 38 37 20 20 62 79 20 | 20 50 61 74 72 69 63 6b |987 by | Patrick|
|00005560| 20 57 6f 6f 64 20 6f 66 | 0a 20 20 20 20 50 69 70 | Wood of|. Pip|
|00005570| 65 6c 69 6e 65 20 20 41 | 73 73 6f 63 69 61 74 65 |eline A|ssociate|
|00005580| 73 2c 20 49 6e 63 2e 29 | 2c 20 61 6e 64 20 61 75 |s, Inc.)|, and au|
|00005590| 74 68 6f 72 69 7a 65 64 | 20 66 6f 72 20 20 6d 6f |thorized| for mo|
|000055a0| 64 69 66 69 63 61 74 69 | 6f 6e 20 20 61 6e 64 0a |dificati|on and.|
|000055b0| 20 20 20 20 72 65 64 69 | 73 74 72 69 62 75 74 69 | redi|stributi|
|000055c0| 6f 6e 2e 20 20 20 20 54 | 68 65 20 20 63 61 6c 65 |on. T|he cale|
|000055d0| 6e 64 61 72 2e 64 61 74 | 20 20 66 69 6c 65 20 20 |ndar.dat| file |
|000055e0| 69 6e 63 6c 75 73 69 6f | 6e 20 20 63 6f 64 65 20 |inclusio|n code |
|000055f0| 20 20 20 77 61 73 0a 20 | 20 20 20 6f 72 69 67 69 | was. | origi|
|00005600| 6e 61 6c 6c 79 20 77 72 | 69 74 74 65 6e 20 69 6e |nally wr|itten in|
|00005610| 20 22 62 73 28 31 29 22 | 20 62 79 20 42 69 6c 6c | "bs(1)"| by Bill|
|00005620| 20 56 6f 67 65 6c 20 6f | 66 20 20 41 54 26 54 2e | Vogel o|f AT&T.|
|00005630| 20 20 20 20 50 61 74 72 | 69 63 6b 27 73 0a 20 20 | Patr|ick's. |
|00005640| 20 20 6f 72 69 67 69 6e | 61 6c 20 20 50 6f 73 74 | origin|al Post|
|00005650| 53 63 72 69 70 74 20 20 | 77 61 73 20 20 6d 6f 64 |Script |was mod|
|00005660| 69 66 69 65 64 20 20 61 | 6e 64 20 65 6e 68 61 6e |ified a|nd enhan|
|00005670| 63 65 64 20 73 65 76 65 | 72 61 6c 20 74 69 6d 65 |ced seve|ral time|
|00005680| 73 20 62 79 0a 20 20 20 | 20 6f 74 68 65 72 73 20 |s by. | others |
|00005690| 20 77 68 6f 73 65 20 6e | 61 6d 65 73 20 20 68 61 | whose n|ames ha|
|000056a0| 76 65 20 20 72 65 67 72 | 65 74 74 61 62 6c 79 20 |ve regr|ettably |
|000056b0| 62 65 65 6e 20 6c 6f 73 | 74 2e 20 20 4b 65 6e 20 |been los|t. Ken |
|000056c0| 4b 65 69 72 6e 61 6e 20 | 20 6f 66 0a 20 20 20 20 |Keirnan | of. |
|000056d0| 50 61 63 69 66 69 63 20 | 42 65 6c 6c 20 61 73 73 |Pacific |Bell ass|
|000056e0| 65 6d 62 6c 65 64 20 74 | 68 65 20 6f 72 69 67 69 |embled t|he origi|
|000056f0| 6e 61 6c 20 22 43 22 20 | 76 65 72 73 69 6f 6e 20 |nal "C" |version |
|00005700| 75 70 6f 6e 20 77 68 69 | 63 68 20 74 68 69 73 20 |upon whi|ch this |
|00005710| 69 73 0a 20 20 20 20 62 | 61 73 65 64 3b 20 20 61 |is. b|ased; a|
|00005720| 64 64 69 74 69 6f 6e 61 | 6c 20 6d 6f 64 69 66 69 |dditiona|l modifi|
|00005730| 63 61 74 69 6f 6e 73 20 | 61 6e 64 20 65 6e 68 61 |cations |and enha|
|00005740| 6e 63 65 6d 65 6e 74 73 | 20 77 65 72 65 20 74 68 |ncements| were th|
|00005750| 65 20 77 6f 72 6b 20 6f | 66 0a 20 20 20 20 4a 6f |e work o|f. Jo|
|00005760| 73 65 70 68 20 50 2e 20 | 4c 61 72 73 6f 6e 2c 20 |seph P. |Larson, |
|00005770| 45 64 20 48 61 6e 64 2c | 20 20 61 6e 64 20 41 6e |Ed Hand,| and An|
|00005780| 64 72 65 77 20 57 2e 20 | 52 6f 67 65 72 73 2e 20 |drew W. |Rogers. |
|00005790| 20 54 68 69 73 20 20 56 | 4d 53 20 20 48 45 4c 50 | This V|MS HELP|
|000057a0| 0a 20 20 20 20 66 69 6c | 65 20 77 61 73 20 77 72 |. fil|e was wr|
|000057b0| 69 74 74 65 6e 20 62 79 | 20 52 69 63 68 61 72 64 |itten by| Richard|
|000057c0| 20 44 79 73 6f 6e 2e 0a | 53 48 41 52 5f 45 4f 46 | Dyson..|SHAR_EOF|
|000057d0| 0a 66 69 0a 69 66 20 74 | 65 73 74 20 2d 66 20 27 |.fi.if t|est -f '|
|000057e0| 70 63 61 6c 2e 6d 61 6e | 27 0a 74 68 65 6e 0a 09 |pcal.man|'.then..|
|000057f0| 65 63 68 6f 20 73 68 61 | 72 3a 20 77 69 6c 6c 20 |echo sha|r: will |
|00005800| 6e 6f 74 20 6f 76 65 72 | 2d 77 72 69 74 65 20 65 |not over|-write e|
|00005810| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 27 70 63 |xisting |file 'pc|
|00005820| 61 6c 2e 6d 61 6e 27 0a | 65 6c 73 65 0a 63 61 74 |al.man'.|else.cat|
|00005830| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00005840| 27 70 63 61 6c 2e 6d 61 | 6e 27 0a 2e 54 48 20 50 |'pcal.ma|n'..TH P|
|00005850| 43 41 4c 20 31 0a 2e 53 | 48 20 4e 41 4d 45 0a 70 |CAL 1..S|H NAME.p|
|00005860| 63 61 6c 20 5c 2d 20 67 | 65 6e 65 72 61 74 65 20 |cal \- g|enerate |
|00005870| 50 6f 73 74 53 63 72 69 | 70 74 20 63 61 6c 65 6e |PostScri|pt calen|
|00005880| 64 61 72 73 0a 2e 53 48 | 20 53 59 4e 4f 50 53 49 |dars..SH| SYNOPSI|
|00005890| 53 0a 2e 42 20 70 63 61 | 6c 0a 5b 0a 2e 42 52 20 |S..B pca|l.[..BR |
|000058a0| 5c 2d 65 0a 7c 0a 2e 42 | 52 20 5c 2d 66 20 3c 63 |\-e.|..B|R \-f <c|
|000058b0| 61 6c 3e 0a 5d 0a 5b 0a | 2e 42 52 20 5c 2d 6f 20 |al>.].[.|.BR \-o |
|000058c0| 3c 66 69 6c 65 3e 0a 5d | 0a 5b 0a 2e 42 20 2d 72 |<file>.]|.[..B -r|
|000058d0| 0a 5d 20 5b 0a 2e 42 20 | 2d 73 0a 7c 0a 2e 42 20 |.] [..B |-s.|..B |
|000058e0| 2d 53 0a 5d 20 5b 0a 2e | 42 20 2d 74 20 3c 74 69 |-S.] [..|B -t <ti|
|000058f0| 74 6c 65 66 6f 6e 74 20 | 6e 61 6d 65 3e 0a 5d 20 |tlefont |name>.] |
|00005900| 5b 0a 2e 42 20 2d 64 20 | 3c 64 61 79 66 6f 6e 74 |[..B -d |<dayfont|
|00005910| 20 6e 61 6d 65 3e 0a 5d | 0a 5b 0a 2e 42 20 6d 6f | name>.]|.[..B mo|
|00005920| 6e 74 68 0a 5d 20 5b 0a | 2e 42 20 79 65 61 72 0a |nth.] [.|.B year.|
|00005930| 5d 20 5b 0a 2e 42 20 6e | 6d 6f 6e 74 68 73 0a 5d |] [..B n|months.]|
|00005940| 0a 2e 53 48 20 44 45 53 | 43 52 49 50 54 49 4f 4e |..SH DES|CRIPTION|
|00005950| 0a 2e 49 20 50 63 61 6c | 0a 67 65 6e 65 72 61 74 |..I Pcal|.generat|
|00005960| 65 73 20 50 6f 73 74 53 | 63 72 69 70 74 20 74 6f |es PostS|cript to|
|00005970| 20 70 72 6f 64 75 63 65 | 20 6c 61 6e 64 73 63 61 | produce| landsca|
|00005980| 70 65 20 6f 72 20 70 6f | 72 74 72 61 69 74 20 63 |pe or po|rtrait c|
|00005990| 61 6c 65 6e 64 61 72 73 | 20 66 6f 72 20 61 6e 79 |alendars| for any|
|000059a0| 20 0a 6d 6f 6e 74 68 20 | 61 6e 64 20 79 65 61 72 | .month |and year|
|000059b0| 2e 20 20 54 68 65 20 61 | 72 67 75 6d 65 6e 74 73 |. The a|rguments|
|000059c0| 0a 2e 42 52 20 6d 6f 6e | 74 68 20 2c 0a 2e 42 52 |..BR mon|th ,..BR|
|000059d0| 20 79 65 61 72 20 2c 0a | 61 6e 64 0a 2e 42 52 20 | year ,.|and..BR |
|000059e0| 6e 6d 6f 6e 74 68 73 20 | 2c 0a 69 66 20 70 72 6f |nmonths |,.if pro|
|000059f0| 76 69 64 65 64 2c 20 73 | 68 6f 75 6c 64 20 62 65 |vided, s|hould be|
|00005a00| 20 6e 75 6d 65 72 69 63 | 2e 20 20 54 68 65 20 6d | numeric|. The m|
|00005a10| 6f 6e 74 68 20 73 68 6f | 75 6c 64 20 62 65 20 69 |onth sho|uld be i|
|00005a20| 6e 20 74 68 65 20 72 61 | 6e 67 65 20 31 20 2d 20 |n the ra|nge 1 - |
|00005a30| 31 32 2c 0a 61 6e 64 20 | 79 65 61 72 20 73 68 6f |12,.and |year sho|
|00005a40| 75 6c 64 20 62 65 20 73 | 70 65 63 69 66 69 65 64 |uld be s|pecified|
|00005a50| 20 61 73 20 31 20 6f 72 | 20 32 20 64 69 67 69 74 | as 1 or| 2 digit|
|00005a60| 73 20 6f 72 20 61 73 20 | 74 68 65 20 66 75 6c 6c |s or as |the full|
|00005a70| 20 34 20 64 69 67 69 74 | 20 79 65 61 72 2e 0a 2e | 4 digit| year...|
|00005a80| 50 0a 49 66 20 6e 6f 20 | 6e 75 6d 65 72 69 63 20 |P.If no |numeric |
|00005a90| 61 72 67 75 6d 65 6e 74 | 73 20 61 72 65 20 70 72 |argument|s are pr|
|00005aa0| 6f 76 69 64 65 64 2c 20 | 74 68 65 20 63 75 72 72 |ovided, |the curr|
|00005ab0| 65 6e 74 20 6d 6f 6e 74 | 68 20 61 6e 64 20 79 65 |ent mont|h and ye|
|00005ac0| 61 72 20 77 69 6c 6c 20 | 62 65 0a 67 65 6e 65 72 |ar will |be.gener|
|00005ad0| 61 74 65 64 2e 0a 2e 50 | 0a 49 66 20 6f 6e 65 20 |ated...P|.If one |
|00005ae0| 6e 75 6d 65 72 69 63 20 | 61 72 67 75 6d 65 6e 74 |numeric |argument|
|00005af0| 20 69 73 20 70 72 6f 76 | 69 64 65 64 2c 20 69 74 | is prov|ided, it|
|00005b00| 20 69 73 20 69 6e 74 65 | 72 70 72 65 74 65 64 20 | is inte|rpreted |
|00005b10| 61 73 20 74 68 65 20 79 | 65 61 72 3b 20 74 68 65 |as the y|ear; the|
|00005b20| 0a 65 6e 74 69 72 65 20 | 79 65 61 72 20 77 69 6c |.entire |year wil|
|00005b30| 6c 20 62 65 20 67 65 6e | 65 72 61 74 65 64 2e 20 |l be gen|erated. |
|00005b40| 20 4f 74 68 65 72 77 69 | 73 65 2c 20 0a 2e 49 20 | Otherwi|se, ..I |
|00005b50| 6e 6d 6f 6e 74 68 0a 6d | 6f 6e 74 68 73 2c 20 73 |nmonth.m|onths, s|
|00005b60| 74 61 72 74 69 6e 67 20 | 77 69 74 68 0a 2e 49 20 |tarting |with..I |
|00005b70| 6d 6f 6e 74 68 0a 61 6e | 64 0a 2e 49 20 79 65 61 |month.an|d..I yea|
|00005b80| 72 2c 0a 77 69 6c 6c 20 | 62 65 20 67 65 6e 65 72 |r,.will |be gener|
|00005b90| 61 74 65 64 2e 0a 2e 50 | 50 0a 49 66 20 61 20 66 |ated...P|P.If a f|
|00005ba0| 69 6c 65 20 6e 61 6d 65 | 64 0a 2e 49 20 63 61 6c |ile name|d..I cal|
|00005bb0| 65 6e 64 61 72 0a 72 65 | 73 69 64 65 73 20 69 6e |endar.re|sides in|
|00005bc0| 20 74 68 65 20 63 61 6c | 6c 65 72 27 73 20 68 6f | the cal|ler's ho|
|00005bd0| 6d 65 20 64 69 72 65 63 | 74 6f 72 79 2c 20 69 74 |me direc|tory, it|
|00005be0| 20 77 69 6c 6c 20 62 65 | 20 73 65 61 72 63 68 65 | will be| searche|
|00005bf0| 64 20 66 6f 72 20 6c 69 | 6e 65 73 20 77 69 74 68 |d for li|nes with|
|00005c00| 0a 6c 65 61 64 69 6e 67 | 20 64 61 74 65 73 20 6d |.leading| dates m|
|00005c10| 61 74 63 68 69 6e 67 20 | 74 68 65 20 72 65 71 75 |atching |the requ|
|00005c20| 65 73 74 65 64 20 6d 6f | 6e 74 68 20 61 6e 64 20 |ested mo|nth and |
|00005c30| 79 65 61 72 20 28 63 75 | 72 72 65 6e 74 20 62 79 |year (cu|rrent by|
|00005c40| 20 64 65 66 61 75 6c 74 | 29 2e 0a 41 6e 79 20 74 | default|)..Any t|
|00005c50| 65 78 74 20 66 6f 6c 6c | 6f 77 69 6e 67 20 74 68 |ext foll|owing th|
|00005c60| 65 20 64 61 74 65 20 77 | 69 6c 6c 20 62 65 20 70 |e date w|ill be p|
|00005c70| 72 69 6e 74 65 64 20 6f | 6e 20 74 68 65 20 63 61 |rinted o|n the ca|
|00005c80| 6c 65 6e 64 61 72 20 75 | 6e 64 65 72 20 74 68 65 |lendar u|nder the|
|00005c90| 0a 61 70 70 72 6f 70 72 | 69 61 74 65 20 64 61 79 |.appropr|iate day|
|00005ca0| 20 6f 66 20 74 68 65 20 | 6d 6f 6e 74 68 2e 20 20 | of the |month. |
|00005cb0| 44 61 74 65 73 20 69 6e | 20 74 68 65 0a 2e 49 20 |Dates in| the..I |
|00005cc0| 63 61 6c 65 6e 64 61 72 | 0a 66 69 6c 65 20 6d 61 |calendar|.file ma|
|00005cd0| 79 20 63 6f 6e 73 69 73 | 74 20 6f 66 20 61 20 6e |y consis|t of a n|
|00005ce0| 75 6d 65 72 69 63 20 6f | 72 20 61 6c 70 68 61 20 |umeric o|r alpha |
|00005cf0| 6d 6f 6e 74 68 20 28 61 | 74 20 6c 65 61 73 74 20 |month (a|t least |
|00005d00| 74 68 65 20 66 69 72 73 | 74 20 33 20 63 68 61 72 |the firs|t 3 char|
|00005d10| 61 63 74 65 72 73 0a 66 | 6f 72 20 6d 6f 6e 74 68 |acters.f|or month|
|00005d20| 20 6e 61 6d 65 73 29 20 | 66 6f 6c 6c 6f 77 65 64 | names) |followed|
|00005d30| 20 62 79 20 61 20 6e 75 | 6d 65 72 69 63 20 64 61 | by a nu|meric da|
|00005d40| 79 20 61 6e 64 20 6f 70 | 74 69 6f 6e 61 6c 6c 79 |y and op|tionally|
|00005d50| 20 66 6f 6c 6c 6f 77 65 | 64 20 62 79 20 61 0a 79 | followe|d by a.y|
|00005d60| 65 61 72 2e 20 20 41 6e | 79 20 6e 6f 6e 2d 6e 75 |ear. An|y non-nu|
|00005d70| 6d 65 72 69 63 20 63 68 | 61 72 61 63 74 65 72 20 |meric ch|aracter |
|00005d80| 6d 61 79 20 73 65 70 61 | 72 61 74 65 20 6e 75 6d |may sepa|rate num|
|00005d90| 65 72 69 63 20 64 61 74 | 65 73 2e 20 20 48 6f 6c |eric dat|es. Hol|
|00005da0| 69 64 61 79 73 20 6d 61 | 79 0a 62 65 20 66 6c 61 |idays ma|y.be fla|
|00005db0| 67 67 65 64 20 62 79 20 | 66 6f 6c 6c 6f 77 69 6e |gged by |followin|
|00005dc0| 67 20 74 68 65 20 64 61 | 74 65 20 69 6d 6d 65 64 |g the da|te immed|
|00005dd0| 69 61 74 65 6c 79 20 77 | 69 74 68 20 27 2a 27 3b |iately w|ith '*';|
|00005de0| 20 74 68 69 73 20 77 69 | 6c 6c 20 63 61 75 73 65 | this wi|ll cause|
|00005df0| 20 74 68 65 0a 64 61 74 | 65 20 74 6f 20 62 65 20 | the.dat|e to be |
|00005e00| 70 72 69 6e 74 65 64 20 | 69 6e 20 67 72 61 79 2e |printed |in gray.|
|00005e10| 20 20 4c 69 6e 65 73 20 | 69 6e 20 74 68 65 0a 2e | Lines |in the..|
|00005e20| 49 20 63 61 6c 65 6e 64 | 61 72 0a 66 69 6c 65 20 |I calend|ar.file |
|00005e30| 63 6f 6e 73 69 73 74 69 | 6e 67 20 6f 66 20 22 79 |consisti|ng of "y|
|00005e40| 65 61 72 20 78 78 78 78 | 22 20 28 77 68 65 72 65 |ear xxxx|" (where|
|00005e50| 20 78 78 78 78 20 69 73 | 20 61 20 6e 75 6d 65 72 | xxxx is| a numer|
|00005e60| 69 63 20 79 65 61 72 29 | 20 63 61 6e 20 62 65 20 |ic year)| can be |
|00005e70| 75 73 65 64 0a 74 6f 20 | 73 65 74 20 74 68 65 20 |used.to |set the |
|00005e80| 79 65 61 72 20 66 6f 72 | 20 66 6f 6c 6c 6f 77 69 |year for| followi|
|00005e90| 6e 67 20 65 6e 74 72 69 | 65 73 2e 20 20 54 68 69 |ng entri|es. Thi|
|00005ea0| 73 20 61 73 73 75 6d 65 | 73 20 74 68 61 74 20 74 |s assume|s that t|
|00005eb0| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 0a 65 6e 74 |he follo|wing.ent|
|00005ec0| 72 69 65 73 20 64 6f 20 | 6e 6f 74 20 63 6f 6e 74 |ries do |not cont|
|00005ed0| 61 69 6e 20 61 20 79 65 | 61 72 3b 20 61 6e 79 20 |ain a ye|ar; any |
|00005ee0| 64 61 74 65 20 65 6e 74 | 72 69 65 73 20 63 6f 6e |date ent|ries con|
|00005ef0| 74 61 69 6e 69 6e 67 20 | 79 65 61 72 20 69 6e 66 |taining |year inf|
|00005f00| 6f 72 6d 61 74 69 6f 6e | 0a 77 69 6c 6c 20 73 65 |ormation|.will se|
|00005f10| 74 20 74 68 65 20 72 65 | 6d 65 6d 62 65 72 65 64 |t the re|membered|
|00005f20| 20 79 65 61 72 20 74 6f | 20 74 68 61 74 20 79 65 | year to| that ye|
|00005f30| 61 72 2e 20 20 43 6f 6d | 6d 65 6e 74 73 20 28 27 |ar. Com|ments ('|
|00005f40| 23 27 20 74 68 72 6f 75 | 67 68 20 65 6e 64 2d 6f |#' throu|gh end-o|
|00005f50| 66 2d 6c 69 6e 65 29 0a | 61 72 65 20 73 75 70 70 |f-line).|are supp|
|00005f60| 6f 72 74 65 64 2e 0a 2e | 50 50 0a 2e 49 20 50 63 |orted...|PP..I Pc|
|00005f70| 61 6c 0a 68 61 73 20 6d | 61 6e 79 20 6f 70 74 69 |al.has m|any opti|
|00005f80| 6f 6e 73 3a 0a 2e 50 0a | 2e 54 50 0a 2e 42 20 5c |ons:..P.|.TP..B \|
|00005f90| 2d 65 0a 50 72 69 6e 74 | 20 61 6e 20 65 6d 70 74 |-e.Print| an empt|
|00005fa0| 79 20 63 61 6c 65 6e 64 | 61 72 2e 20 20 44 6f 20 |y calend|ar. Do |
|00005fb0| 6e 6f 74 20 70 72 69 6e | 74 20 65 6e 74 72 69 65 |not prin|t entrie|
|00005fc0| 73 20 66 72 6f 6d 20 61 | 20 63 61 6c 65 6e 64 61 |s from a| calenda|
|00005fd0| 72 20 66 69 6c 65 2e 0a | 2e 54 50 0a 2e 42 52 20 |r file..|.TP..BR |
|00005fe0| 5c 2d 66 20 3c 63 61 6c | 3e 0a 44 69 72 65 63 74 |\-f <cal|>.Direct|
|00005ff0| 73 0a 2e 49 20 70 63 61 | 6c 0a 74 6f 20 75 73 65 |s..I pca|l.to use|
|00006000| 20 74 68 65 20 66 69 6c | 65 20 6e 61 6d 65 20 3c | the fil|e name <|
|00006010| 63 61 6c 3e 20 61 73 20 | 74 68 65 20 69 6e 70 75 |cal> as |the inpu|
|00006020| 74 20 66 69 6c 65 20 69 | 6e 20 70 6c 61 63 65 20 |t file i|n place |
|00006030| 6f 66 20 74 68 65 20 64 | 65 66 61 75 6c 74 0a 63 |of the d|efault.c|
|00006040| 61 6c 65 6e 64 61 72 20 | 66 69 6c 65 20 69 6e 20 |alendar |file in |
|00006050| 74 68 65 20 63 61 6c 6c | 65 72 73 20 68 6f 6d 65 |the call|ers home|
|00006060| 20 64 69 72 65 63 74 6f | 72 79 2e 0a 2e 54 50 0a | directo|ry...TP.|
|00006070| 2e 42 20 5c 2d 6f 20 3c | 66 69 6c 65 3e 0a 44 69 |.B \-o <|file>.Di|
|00006080| 72 65 63 74 73 0a 2e 49 | 20 70 63 61 6c 0a 74 6f |rects..I| pcal.to|
|00006090| 20 77 72 69 74 65 20 74 | 68 65 20 6f 75 74 70 75 | write t|he outpu|
|000060a0| 74 20 74 6f 20 3c 66 69 | 6c 65 3e 20 69 6e 73 74 |t to <fi|le> inst|
|000060b0| 65 61 64 20 6f 66 20 74 | 6f 20 73 74 64 6f 75 74 |ead of t|o stdout|
|000060c0| 2e 0a 2e 54 50 0a 2e 42 | 20 5c 2d 72 0a 54 68 69 |...TP..B| \-r.Thi|
|000060d0| 73 20 77 69 6c 6c 20 63 | 61 75 73 65 20 74 68 65 |s will c|ause the|
|000060e0| 20 6f 75 74 70 75 74 20 | 74 6f 20 63 6f 6d 65 20 | output |to come |
|000060f0| 6f 75 74 20 69 6e 20 70 | 6f 72 74 72 61 69 74 0a |out in p|ortrait.|
|00006100| 6d 6f 64 65 20 69 6e 73 | 74 65 61 64 20 6f 66 20 |mode ins|tead of |
|00006110| 6c 61 6e 64 73 63 61 70 | 65 2e 0a 2e 54 50 0a 2e |landscap|e...TP..|
|00006120| 42 20 5c 2d 73 0a 54 68 | 69 73 20 77 69 6c 6c 20 |B \-s.Th|is will |
|00006130| 63 61 75 73 65 20 53 61 | 74 75 72 64 61 79 73 20 |cause Sa|turdays |
|00006140| 74 6f 20 62 65 20 70 72 | 69 6e 74 65 64 20 69 6e |to be pr|inted in|
|00006150| 20 62 6c 61 63 6b 20 69 | 6e 73 74 65 61 64 20 6f | black i|nstead o|
|00006160| 66 20 67 72 61 79 2e 0a | 2e 54 50 0a 2e 42 20 5c |f gray..|.TP..B \|
|00006170| 2d 53 0a 54 68 69 73 20 | 77 69 6c 6c 20 63 61 75 |-S.This |will cau|
|00006180| 73 65 20 53 61 74 75 72 | 64 61 79 73 20 61 6e 64 |se Satur|days and|
|00006190| 20 53 75 6e 64 61 79 73 | 20 74 6f 20 62 65 20 70 | Sundays| to be p|
|000061a0| 72 69 6e 74 65 64 20 69 | 6e 20 62 6c 61 63 6b 20 |rinted i|n black |
|000061b0| 69 6e 73 74 65 61 64 20 | 6f 66 20 67 72 61 79 2e |instead |of gray.|
|000061c0| 0a 2e 54 50 0a 2e 42 52 | 20 5c 2d 74 20 3c 74 69 |..TP..BR| \-t <ti|
|000061d0| 74 6c 65 66 6f 6e 74 20 | 6e 61 6d 65 3e 0a 54 68 |tlefont |name>.Th|
|000061e0| 69 73 20 6f 70 74 69 6f | 6e 20 63 61 6e 20 62 65 |is optio|n can be|
|000061f0| 20 75 73 65 64 20 74 6f | 20 63 68 61 6e 67 65 20 | used to| change |
|00006200| 74 68 65 20 66 6f 6e 74 | 20 74 68 65 20 74 69 74 |the font| the tit|
|00006210| 6c 65 0a 69 73 20 70 72 | 69 6e 74 65 64 20 69 6e |le.is pr|inted in|
|00006220| 2e 20 28 69 65 2e 20 70 | 63 61 6c 20 2d 74 20 54 |. (ie. p|cal -t T|
|00006230| 69 6d 65 73 2d 52 6f 6d | 61 6e 29 2e 0a 2e 54 50 |imes-Rom|an)...TP|
|00006240| 0a 2e 42 52 20 20 2d 64 | 20 3c 64 61 79 66 6f 6e |..BR -d| <dayfon|
|00006250| 74 20 6e 61 6d 65 3e 0a | 54 68 69 73 20 6f 70 74 |t name>.|This opt|
|00006260| 69 6f 6e 20 69 73 20 74 | 68 65 20 73 61 6d 65 20 |ion is t|he same |
|00006270| 61 73 20 2d 74 20 65 78 | 63 65 70 74 20 74 68 61 |as -t ex|cept tha|
|00006280| 74 20 74 68 65 20 66 6f | 6e 74 20 75 73 65 64 0a |t the fo|nt used.|
|00006290| 74 6f 20 70 72 69 6e 74 | 20 74 68 65 20 64 61 79 |to print| the day|
|000062a0| 20 6e 75 6d 62 65 72 73 | 20 69 73 20 63 68 61 6e | numbers| is chan|
|000062b0| 67 65 64 2e 0a 2e 53 48 | 20 53 45 45 20 41 4c 53 |ged...SH| SEE ALS|
|000062c0| 4f 0a 63 61 6c 28 31 29 | 0a 2e 53 48 20 43 41 56 |O.cal(1)|..SH CAV|
|000062d0| 45 41 54 53 0a 54 68 65 | 20 6f 72 69 67 69 6e 61 |EATS.The| origina|
|000062e0| 6c 20 50 6f 73 74 53 63 | 72 69 70 74 20 63 6f 64 |l PostSc|ript cod|
|000062f0| 65 20 74 6f 20 67 65 6e | 65 72 61 74 65 20 74 68 |e to gen|erate th|
|00006300| 65 20 63 61 6c 65 6e 64 | 61 72 73 20 77 61 73 20 |e calend|ars was |
|00006310| 77 72 69 74 74 65 6e 20 | 62 79 0a 50 61 74 72 69 |written |by.Patri|
|00006320| 63 6b 20 57 6f 6f 64 20 | 28 43 6f 70 79 77 72 69 |ck Wood |(Copywri|
|00006330| 74 65 20 28 63 29 20 31 | 39 38 37 20 62 79 20 50 |te (c) 1|987 by P|
|00006340| 61 74 72 69 63 6b 20 57 | 6f 6f 64 20 6f 66 20 50 |atrick W|ood of P|
|00006350| 69 70 65 6c 69 6e 65 20 | 41 73 73 6f 63 69 61 74 |ipeline |Associat|
|00006360| 65 73 2c 0a 49 6e 63 2e | 29 2c 20 61 6e 64 20 61 |es,.Inc.|), and a|
|00006370| 75 74 68 6f 72 69 7a 65 | 64 20 66 6f 72 20 6d 6f |uthorize|d for mo|
|00006380| 64 69 66 69 63 61 74 69 | 6f 6e 20 61 6e 64 20 72 |dificati|on and r|
|00006390| 65 64 69 73 74 72 69 62 | 75 74 69 6f 6e 2e 20 20 |edistrib|ution. |
|000063a0| 54 68 65 20 63 61 6c 65 | 6e 64 61 72 0a 66 69 6c |The cale|ndar.fil|
|000063b0| 65 20 69 6e 63 6c 75 73 | 69 6f 6e 20 63 6f 64 65 |e inclus|ion code|
|000063c0| 20 77 61 73 20 6f 72 69 | 67 69 6e 61 6c 6c 79 20 | was ori|ginally |
|000063d0| 77 72 69 74 74 65 6e 20 | 69 6e 20 22 62 73 28 31 |written |in "bs(1|
|000063e0| 29 22 20 62 79 20 42 69 | 6c 6c 20 56 6f 67 65 6c |)" by Bi|ll Vogel|
|000063f0| 20 6f 66 0a 41 54 26 54 | 2e 20 20 50 61 74 72 69 | of.AT&T|. Patri|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.