home *** CD-ROM | disk | FTP | other *** search
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: 1412
Confidence | Program | Detection | Match Type | Support
|
---|
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, ASCII text
| default
| |
100%
| TrID
| E-Mail message (Var. 2)
| default
| |
100%
| checkBytes
| Printable ASCII
| 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 63 6f 6d 70 2e |ewsgroup|s: comp.|
|00000040| 6c 61 6e 67 2e 70 6f 73 | 74 73 63 72 69 70 74 2c |lang.pos|tscript,|
|00000050| 61 6c 74 2e 73 6f 75 72 | 63 65 73 0a 53 75 62 6a |alt.sour|ces.Subj|
|00000060| 65 63 74 3a 20 52 65 3a | 20 50 63 61 6c 3a 20 70 |ect: Re:| Pcal: p|
|00000070| 6f 73 74 73 63 72 69 70 | 74 2f 63 20 63 61 6c 65 |ostscrip|t/c cale|
|00000080| 6e 64 61 72 20 70 72 69 | 6e 74 65 72 0a 4d 65 73 |ndar pri|nter.Mes|
|00000090| 73 61 67 65 2d 49 44 3a | 20 3c 31 33 34 30 40 73 |sage-ID:| <1340@s|
|000000a0| 75 64 35 30 39 2e 65 64 | 2e 72 61 79 2e 63 6f 6d |ud509.ed|.ray.com|
|000000b0| 3e 0a 44 61 74 65 3a 20 | 34 20 4a 75 6e 20 39 30 |>.Date: |4 Jun 90|
|000000c0| 20 31 36 3a 33 31 3a 34 | 34 20 47 4d 54 0a 0a 4f | 16:31:4|4 GMT..O|
|000000d0| 4b 2c 20 49 20 68 61 76 | 65 20 61 20 66 65 77 20 |K, I hav|e a few |
|000000e0| 6f 66 20 6d 79 20 6f 77 | 6e 20 63 6f 6e 74 72 69 |of my ow|n contri|
|000000f0| 62 75 74 69 6f 6e 73 20 | 74 6f 20 61 64 64 20 74 |butions |to add t|
|00000100| 6f 20 74 68 69 73 20 70 | 72 6f 67 72 61 6d 2e 2e |o this p|rogram..|
|00000110| 2e 0a 0a 09 31 29 20 4e | 65 77 20 2d 73 20 66 6c |....1) N|ew -s fl|
|00000120| 61 67 20 74 6f 20 70 72 | 69 6e 74 20 53 61 74 75 |ag to pr|int Satu|
|00000130| 72 64 61 79 73 20 69 6e | 20 62 6c 61 63 6b 20 69 |rdays in| black i|
|00000140| 6e 73 74 65 61 64 20 6f | 66 20 67 72 61 79 0a 0a |nstead o|f gray..|
|00000150| 09 32 29 20 48 6f 6c 69 | 64 61 79 73 20 70 72 69 |.2) Holi|days pri|
|00000160| 6e 74 20 69 6e 20 67 72 | 61 79 20 69 66 20 74 68 |nt in gr|ay if th|
|00000170| 65 20 64 61 74 65 20 69 | 73 20 66 6f 6c 6c 6f 77 |e date i|s follow|
|00000180| 65 64 20 62 79 20 27 2a | 27 20 69 6e 20 74 68 65 |ed by '*|' in the|
|00000190| 0a 09 20 20 20 63 61 6c | 65 6e 64 61 72 20 66 69 |.. cal|endar fi|
|000001a0| 6c 65 20 28 65 2e 67 2e | 20 22 37 2f 34 2a 20 49 |le (e.g.| "7/4* I|
|000001b0| 6e 64 65 70 65 6e 64 65 | 6e 63 65 20 44 61 79 22 |ndepende|nce Day"|
|000001c0| 29 0a 0a 09 33 29 20 54 | 68 65 20 69 6c 6c 65 67 |)...3) T|he illeg|
|000001d0| 69 62 6c 65 20 77 65 65 | 6b 64 61 79 20 6e 61 6d |ible wee|kday nam|
|000001e0| 65 73 20 6f 6e 20 74 68 | 65 20 73 6d 61 6c 6c 20 |es on th|e small |
|000001f0| 63 61 6c 65 6e 64 61 72 | 73 20 61 72 65 20 73 75 |calendar|s are su|
|00000200| 70 70 72 65 73 73 65 64 | 0a 0a 09 34 29 20 54 68 |ppressed|...4) Th|
|00000210| 65 20 63 6f 64 65 20 68 | 61 73 20 62 65 65 6e 20 |e code h|as been |
|00000220| 72 65 76 69 73 65 64 20 | 74 68 72 6f 75 67 68 6f |revised |througho|
|00000230| 75 74 20 66 6f 72 20 74 | 69 67 68 74 6e 65 73 73 |ut for t|ightness|
|00000240| 20 61 6e 64 20 63 6c 61 | 72 69 74 79 2e 0a 0a 54 | and cla|rity...T|
|00000250| 68 65 20 76 65 72 73 69 | 6f 6e 20 62 65 6c 6f 77 |he versi|on below|
|00000260| 20 61 6c 73 6f 20 69 6e | 63 6f 72 70 6f 72 61 74 | also in|corporat|
|00000270| 65 73 20 74 68 65 20 72 | 65 63 65 6e 74 20 70 61 |es the r|ecent pa|
|00000280| 74 63 68 20 70 6f 73 74 | 65 64 20 62 79 20 45 64 |tch post|ed by Ed|
|00000290| 20 48 61 6e 64 20 61 73 | 20 77 65 6c 6c 0a 61 73 | Hand as| well.as|
|000002a0| 20 74 68 65 20 72 65 76 | 69 73 65 64 20 6d 61 6e | the rev|ised man|
|000002b0| 20 70 61 67 65 20 70 6f | 73 74 65 64 20 62 79 20 | page po|sted by |
|000002c0| 4d 61 74 74 68 69 65 75 | 20 48 65 72 72 62 2e 20 |Matthieu| Herrb. |
|000002d0| 20 45 6e 6a 6f 79 21 0a | 0a 41 6e 64 72 65 77 20 | Enjoy!.|.Andrew |
|000002e0| 57 2e 20 52 6f 67 65 72 | 73 0a 28 50 53 3a 20 73 |W. Roger|s.(PS: s|
|000002f0| 65 6e 64 20 45 6d 61 69 | 6c 20 69 66 20 79 6f 75 |end Emai|l if you|
|00000300| 27 64 20 6c 69 6b 65 20 | 61 20 56 4d 53 20 76 65 |'d like |a VMS ve|
|00000310| 72 73 69 6f 6e 20 6f 66 | 20 74 68 69 73 2e 2e 2e |rsion of| this...|
|00000320| 29 0a 0a 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |)..-----|--------|
|00000330| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |--------|------- |
|00000340| 63 75 74 20 68 65 72 65 | 20 2d 2d 2d 2d 2d 2d 2d |cut here| -------|
|00000350| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000360| 2d 2d 2d 2d 2d 2d 0a 23 | 21 20 2f 62 69 6e 2f 73 |------.#|! /bin/s|
|00000370| 68 0a 23 20 54 68 69 73 | 20 69 73 20 61 20 73 68 |h.# This| is a sh|
|00000380| 65 6c 6c 20 61 72 63 68 | 69 76 65 2c 20 6d 65 61 |ell arch|ive, mea|
|00000390| 6e 69 6e 67 3a 0a 23 20 | 31 2e 20 52 65 6d 6f 76 |ning:.# |1. Remov|
|000003a0| 65 20 65 76 65 72 79 74 | 68 69 6e 67 20 61 62 6f |e everyt|hing abo|
|000003b0| 76 65 20 74 68 65 20 23 | 21 20 2f 62 69 6e 2f 73 |ve the #|! /bin/s|
|000003c0| 68 20 6c 69 6e 65 2e 0a | 23 20 32 2e 20 53 61 76 |h line..|# 2. Sav|
|000003d0| 65 20 74 68 65 20 72 65 | 73 75 6c 74 69 6e 67 20 |e the re|sulting |
|000003e0| 74 65 78 74 20 69 6e 20 | 61 20 66 69 6c 65 2e 0a |text in |a file..|
|000003f0| 23 20 33 2e 20 45 78 65 | 63 75 74 65 20 74 68 65 |# 3. Exe|cute the|
|00000400| 20 66 69 6c 65 20 77 69 | 74 68 20 2f 62 69 6e 2f | file wi|th /bin/|
|00000410| 73 68 20 28 6e 6f 74 20 | 63 73 68 29 20 74 6f 20 |sh (not |csh) to |
|00000420| 63 72 65 61 74 65 3a 0a | 23 09 4d 61 6b 65 66 69 |create:.|#.Makefi|
|00000430| 6c 65 0a 23 09 52 65 61 | 64 4d 65 0a 23 09 52 65 |le.#.Rea|dMe.#.Re|
|00000440| 61 64 4d 65 2e 6f 72 69 | 67 0a 23 09 70 63 61 6c |adMe.ori|g.#.pcal|
|00000450| 2e 63 0a 23 09 70 63 61 | 6c 2e 6d 61 6e 0a 23 20 |.c.#.pca|l.man.# |
|00000460| 54 68 69 73 20 61 72 63 | 68 69 76 65 20 63 72 65 |This arc|hive cre|
|00000470| 61 74 65 64 3a 20 4d 6f | 6e 20 4a 75 6e 20 20 34 |ated: Mo|n Jun 4|
|00000480| 20 31 32 3a 31 30 3a 30 | 34 20 31 39 39 30 0a 65 | 12:10:0|4 1990.e|
|00000490| 78 70 6f 72 74 20 50 41 | 54 48 3b 20 50 41 54 48 |xport PA|TH; PATH|
|000004a0| 3d 2f 62 69 6e 3a 2f 75 | 73 72 2f 62 69 6e 3a 24 |=/bin:/u|sr/bin:$|
|000004b0| 50 41 54 48 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |PATH.if |test -f |
|000004c0| 27 4d 61 6b 65 66 69 6c | 65 27 0a 74 68 65 6e 0a |'Makefil|e'.then.|
|000004d0| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 22 77 69 6c |.echo sh|ar: "wil|
|000004e0| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|000004f0| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 27 | existin|g file '|
|00000500| 4d 61 6b 65 66 69 6c 65 | 27 22 0a 65 6c 73 65 0a |Makefile|'".else.|
|00000510| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|00000520| 20 3e 20 27 4d 61 6b 65 | 66 69 6c 65 27 0a 23 0a | > 'Make|file'.#.|
|00000530| 4d 41 4e 44 49 52 3d 2f | 75 73 72 31 2f 6a 61 64 |MANDIR=/|usr1/jad|
|00000540| 2f 6d 61 6e 09 09 09 23 | 20 6d 75 73 74 20 63 68 |/man...#| must ch|
|00000550| 61 6e 67 65 20 74 68 69 | 73 0a 0a 70 63 61 6c 3a |ange thi|s..pcal:|
|00000560| 09 70 63 61 6c 2e 63 0a | 09 24 28 43 43 29 20 24 |.pcal.c.|.$(CC) $|
|00000570| 28 43 46 4c 41 47 53 29 | 20 24 28 4c 44 46 4c 41 |(CFLAGS)| $(LDFLA|
|00000580| 47 53 29 20 24 28 43 4f | 50 54 53 29 20 2d 6f 20 |GS) $(CO|PTS) -o |
|00000590| 70 63 61 6c 20 70 63 61 | 6c 2e 63 0a 0a 6d 61 6e |pcal pca|l.c..man|
|000005a0| 3a 09 70 63 61 6c 2e 6d | 61 6e 0a 09 6e 72 6f 66 |:.pcal.m|an..nrof|
|000005b0| 66 20 2d 6d 61 6e 20 70 | 63 61 6c 2e 6d 61 6e 20 |f -man p|cal.man |
|000005c0| 3e 20 70 63 61 6c 2e 31 | 0a 09 70 61 63 6b 20 70 |> pcal.1|..pack p|
|000005d0| 63 61 6c 2e 31 0a 09 6d | 76 20 70 63 61 6c 2e 31 |cal.1..m|v pcal.1|
|000005e0| 2e 7a 20 24 28 4d 41 4e | 44 49 52 29 0a 53 48 41 |.z $(MAN|DIR).SHA|
|000005f0| 52 5f 45 4f 46 0a 66 69 | 0a 69 66 20 74 65 73 74 |R_EOF.fi|.if test|
|00000600| 20 2d 66 20 27 52 65 61 | 64 4d 65 27 0a 74 68 65 | -f 'Rea|dMe'.the|
|00000610| 6e 0a 09 65 63 68 6f 20 | 73 68 61 72 3a 20 22 77 |n..echo |shar: "w|
|00000620| 69 6c 6c 20 6e 6f 74 20 | 6f 76 65 72 2d 77 72 69 |ill not |over-wri|
|00000630| 74 65 20 65 78 69 73 74 | 69 6e 67 20 66 69 6c 65 |te exist|ing file|
|00000640| 20 27 52 65 61 64 4d 65 | 27 22 0a 65 6c 73 65 0a | 'ReadMe|'".else.|
|00000650| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|00000660| 20 3e 20 27 52 65 61 64 | 4d 65 27 0a 54 68 69 73 | > 'Read|Me'.This|
|00000670| 20 69 73 20 70 63 61 6c | 20 61 73 20 70 6f 73 74 | is pcal| as post|
|00000680| 65 64 20 73 6f 6d 65 20 | 74 69 6d 65 20 61 67 6f |ed some |time ago|
|00000690| 2e 20 20 48 6f 77 65 76 | 65 72 2c 20 74 68 65 20 |. Howev|er, the |
|000006a0| 22 66 6f 72 22 20 6c 6f | 6f 70 73 20 64 69 64 6e |"for" lo|ops didn|
|000006b0| 27 74 20 61 6c 77 61 79 | 73 0a 75 73 65 20 74 68 |'t alway|s.use th|
|000006c0| 65 69 72 20 61 72 67 75 | 6d 65 6e 74 73 2e 20 20 |eir argu|ments. |
|000006d0| 49 20 66 6f 75 6e 64 20 | 74 68 69 73 20 77 68 65 |I found |this whe|
|000006e0| 6e 20 49 20 74 72 69 65 | 64 20 74 6f 20 61 6c 6c |n I trie|d to all|
|000006f0| 6f 77 20 61 20 66 75 6c | 6c 2d 79 65 61 72 20 74 |ow a ful|l-year t|
|00000700| 6f 20 62 65 0a 64 75 6d | 70 65 64 20 61 74 20 6f |o be.dum|ped at o|
|00000710| 6e 63 65 2e 20 20 49 27 | 64 20 67 65 74 20 74 68 |nce. I'|d get th|
|00000720| 72 6f 75 67 68 20 33 20 | 6d 6f 6e 74 68 73 20 61 |rough 3 |months a|
|00000730| 6e 64 20 2a 77 68 61 6d | 2a 3a 20 73 74 61 63 6b |nd *wham|*: stack|
|00000740| 20 6f 76 65 72 66 6c 6f | 77 2e 0a 53 75 72 70 72 | overflo|w..Surpr|
|00000750| 69 73 65 21 0a 0a 41 6e | 79 77 61 79 73 2c 20 49 |ise!..An|yways, I|
|00000760| 20 70 75 74 20 69 6e 20 | 61 20 63 6f 75 70 6c 65 | put in |a couple|
|00000770| 20 6f 66 20 70 6f 70 27 | 73 2c 20 6d 6f 64 69 66 | of pop'|s, modif|
|00000780| 69 65 64 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 20 |ied the |command |
|00000790| 6c 69 6e 65 20 61 20 6c | 69 74 74 6c 65 0a 61 6e |line a l|ittle.an|
|000007a0| 64 20 68 6f 70 65 66 75 | 6c 6c 79 2c 20 74 68 65 |d hopefu|lly, the|
|000007b0| 20 6d 61 6e 20 70 61 67 | 65 20 65 6e 6f 75 67 68 | man pag|e enough|
|000007c0| 2c 20 61 6e 64 20 68 65 | 72 65 20 69 74 20 69 73 |, and he|re it is|
|000007d0| 2e 20 20 54 68 65 20 61 | 63 63 6f 6d 70 61 6e 79 |. The a|ccompany|
|000007e0| 69 6e 67 20 66 69 6c 65 | 0a 63 61 6c 6c 65 64 20 |ing file|.called |
|000007f0| 22 52 65 61 64 4d 65 2e | 6f 72 69 67 22 20 63 61 |"ReadMe.|orig" ca|
|00000800| 6d 65 20 77 69 74 68 20 | 74 68 65 20 6f 72 69 67 |me with |the orig|
|00000810| 69 6e 61 6c 20 64 69 73 | 74 72 69 62 75 74 69 6f |inal dis|tributio|
|00000820| 6e 20 61 73 20 52 45 41 | 44 4d 45 20 61 6e 64 0a |n as REA|DME and.|
|00000830| 73 74 61 74 65 73 20 74 | 68 69 73 20 70 72 6f 67 |states t|his prog|
|00000840| 72 61 6d 20 69 73 20 63 | 6f 70 79 72 69 67 68 74 |ram is c|opyright|
|00000850| 65 64 20 62 75 74 20 77 | 69 74 68 20 70 65 72 6d |ed but w|ith perm|
|00000860| 69 73 73 69 6f 6e 20 74 | 6f 20 6d 6f 64 69 66 79 |ission t|o modify|
|00000870| 20 61 6e 64 0a 72 65 64 | 69 73 74 72 69 62 75 74 | and.red|istribut|
|00000880| 65 2e 0a 0a 4e 6f 74 65 | 3a 20 69 66 20 49 20 68 |e...Note|: if I h|
|00000890| 61 64 20 74 68 65 20 74 | 69 6d 65 2c 20 49 27 64 |ad the t|ime, I'd|
|000008a0| 20 70 75 6c 6c 20 74 68 | 65 20 50 6f 73 74 53 63 | pull th|e PostSc|
|000008b0| 72 69 70 74 20 63 6f 64 | 65 20 62 61 63 6b 20 6f |ript cod|e back o|
|000008c0| 75 74 20 6f 66 20 74 68 | 65 0a 70 72 6f 67 72 61 |ut of th|e.progra|
|000008d0| 6d 20 61 6e 64 20 69 6e | 63 6c 75 64 65 20 61 20 |m and in|clude a |
|000008e0| 50 53 20 70 72 6f 6c 6f | 67 20 66 69 6c 65 3b 20 |PS prolo|g file; |
|000008f0| 61 73 20 69 73 2c 20 74 | 68 69 73 20 69 73 20 75 |as is, t|his is u|
|00000900| 67 6c 79 20 61 6e 64 20 | 61 20 6c 69 74 74 6c 65 |gly and |a little|
|00000910| 0a 6d 6f 72 65 20 64 69 | 66 66 69 63 75 6c 74 20 |.more di|fficult |
|00000920| 74 6f 20 6d 6f 64 69 66 | 79 2e 20 20 41 68 20 77 |to modif|y. Ah w|
|00000930| 65 6c 6c 2e 20 20 49 74 | 20 6d 61 79 20 62 65 20 |ell. It| may be |
|00000940| 65 61 73 69 65 72 20 73 | 6f 6d 65 74 69 6d 65 73 |easier s|ometimes|
|00000950| 20 74 6f 20 69 6e 63 6c | 75 64 65 0a 6c 6f 67 20 | to incl|ude.log |
|00000960| 70 72 6f 6c 6f 67 20 69 | 6e 73 69 64 65 20 74 68 |prolog i|nside th|
|00000970| 65 20 43 20 70 72 6f 67 | 72 61 6d 2c 20 62 75 74 |e C prog|ram, but|
|00000980| 20 69 74 27 73 20 61 6e | 20 61 77 66 75 6c 20 6c | it's an| awful l|
|00000990| 6f 74 20 65 61 73 69 65 | 72 20 74 6f 20 6d 6f 64 |ot easie|r to mod|
|000009a0| 69 66 79 0a 74 68 65 20 | 70 72 6f 6c 6f 67 20 77 |ify.the |prolog w|
|000009b0| 68 65 6e 20 69 74 27 73 | 20 61 20 73 65 70 61 72 |hen it's| a separ|
|000009c0| 61 74 65 20 66 69 6c 65 | 2e 20 20 57 68 61 74 65 |ate file|. Whate|
|000009d0| 76 65 72 2e 0a 0a 2d 4a | 6f 65 0a 0a 41 64 64 69 |ver...-J|oe..Addi|
|000009e0| 74 69 6f 6e 61 6c 20 6e | 6f 74 65 3a 20 54 68 69 |tional n|ote: Thi|
|000009f0| 73 20 76 65 72 73 69 6f | 6e 20 69 6e 63 6f 72 70 |s versio|n incorp|
|00000a00| 6f 72 61 74 65 73 20 73 | 65 76 65 72 61 6c 20 6e |orates s|everal n|
|00000a10| 65 77 20 63 6f 6d 6d 61 | 6e 64 2d 6c 69 6e 65 20 |ew comma|nd-line |
|00000a20| 6f 70 74 69 6f 6e 73 0a | 61 6e 64 20 72 65 6c 61 |options.|and rela|
|00000a30| 74 65 64 20 66 65 61 74 | 75 72 65 73 20 69 6d 70 |ted feat|ures imp|
|00000a40| 6c 65 6d 65 6e 74 65 64 | 20 62 79 20 45 64 20 48 |lemented| by Ed H|
|00000a50| 61 6e 64 20 61 6e 64 20 | 6d 79 73 65 6c 66 2e 20 |and and |myself. |
|00000a60| 20 52 65 61 64 20 74 68 | 65 20 27 6d 61 6e 27 20 | Read th|e 'man' |
|00000a70| 70 61 67 65 0a 66 6f 72 | 20 66 75 72 74 68 65 72 |page.for| further|
|00000a80| 20 64 65 74 61 69 6c 73 | 2e 0a 0a 2d 41 6e 64 72 | details|...-Andr|
|00000a90| 65 77 0a 53 48 41 52 5f | 45 4f 46 0a 66 69 0a 69 |ew.SHAR_|EOF.fi.i|
|00000aa0| 66 20 74 65 73 74 20 2d | 66 20 27 52 65 61 64 4d |f test -|f 'ReadM|
|00000ab0| 65 2e 6f 72 69 67 27 0a | 74 68 65 6e 0a 09 65 63 |e.orig'.|then..ec|
|00000ac0| 68 6f 20 73 68 61 72 3a | 20 22 77 69 6c 6c 20 6e |ho shar:| "will n|
|00000ad0| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|00000ae0| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 27 52 65 61 |isting f|ile 'Rea|
|00000af0| 64 4d 65 2e 6f 72 69 67 | 27 22 0a 65 6c 73 65 0a |dMe.orig|'".else.|
|00000b00| 63 61 74 20 3c 3c 20 5c | 53 48 41 52 5f 45 4f 46 |cat << \|SHAR_EOF|
|00000b10| 20 3e 20 27 52 65 61 64 | 4d 65 2e 6f 72 69 67 27 | > 'Read|Me.orig'|
|00000b20| 0a 22 50 63 61 6c 22 20 | 69 73 20 61 20 70 72 6f |."Pcal" |is a pro|
|00000b30| 67 72 61 6d 20 74 6f 20 | 70 72 69 6e 74 20 50 6f |gram to |print Po|
|00000b40| 73 74 53 63 72 69 70 74 | 20 63 61 6c 65 6e 64 61 |stScript| calenda|
|00000b50| 72 73 20 66 6f 72 20 61 | 6e 79 20 6d 6f 6e 74 68 |rs for a|ny month|
|00000b60| 20 61 6e 64 20 79 65 61 | 72 2e 0a 42 79 20 64 65 | and yea|r..By de|
|00000b70| 66 61 75 6c 74 2c 20 69 | 74 20 6c 6f 6f 6b 73 20 |fault, i|t looks |
|00000b80| 66 6f 72 20 61 20 66 69 | 6c 65 20 69 6e 20 74 68 |for a fi|le in th|
|00000b90| 65 20 68 6f 6d 65 20 64 | 69 72 65 63 74 6f 72 79 |e home d|irectory|
|00000ba0| 20 6e 61 6d 65 64 20 22 | 63 61 6c 65 6e 64 61 72 | named "|calendar|
|00000bb0| 22 0a 66 6f 72 20 65 6e | 74 72 69 65 73 20 77 69 |".for en|tries wi|
|00000bc0| 74 68 20 6c 65 61 64 69 | 6e 67 20 64 61 74 65 73 |th leadi|ng dates|
|00000bd0| 20 6d 61 74 63 68 69 6e | 67 20 64 61 74 65 73 20 | matchin|g dates |
|00000be0| 6f 6e 20 74 68 65 20 63 | 61 6c 65 6e 64 61 72 2c |on the c|alendar,|
|00000bf0| 20 61 6e 64 20 70 72 69 | 6e 74 73 0a 61 6e 79 20 | and pri|nts.any |
|00000c00| 66 6f 6c 6c 6f 77 69 6e | 67 20 74 65 78 74 20 75 |followin|g text u|
|00000c10| 6e 64 65 72 20 74 68 65 | 20 61 70 70 72 6f 70 72 |nder the| appropr|
|00000c20| 69 61 74 65 20 64 61 79 | 2e 0a 0a 54 68 65 20 70 |iate day|...The p|
|00000c30| 72 6f 67 72 61 6d 20 6d | 61 79 20 62 65 20 61 20 |rogram m|ay be a |
|00000c40| 6c 69 74 74 6c 65 20 53 | 79 73 74 65 6d 20 56 20 |little S|ystem V |
|00000c50| 66 6c 61 76 6f 72 65 64 | 20 28 67 65 74 6f 70 74 |flavored| (getopt|
|00000c60| 2c 20 74 69 6d 65 20 72 | 6f 75 74 69 6e 65 73 29 |, time r|outines)|
|00000c70| 0a 62 75 74 20 73 68 6f | 75 6c 64 20 62 65 20 65 |.but sho|uld be e|
|00000c80| 61 73 69 6c 79 20 70 6f | 72 74 61 62 6c 65 20 74 |asily po|rtable t|
|00000c90| 6f 20 6f 74 68 65 72 20 | 76 69 6e 74 61 67 65 73 |o other |vintages|
|00000ca0| 20 6f 66 20 55 4e 49 58 | 2e 0a 0a 50 63 61 6c 20 | of UNIX|...Pcal |
|00000cb0| 69 73 20 74 68 65 20 63 | 6f 6d 62 69 6e 65 64 20 |is the c|ombined |
|00000cc0| 65 66 66 6f 72 74 20 6f | 66 20 73 65 76 65 72 61 |effort o|f severa|
|00000cd0| 6c 20 70 65 6f 70 6c 65 | 2c 20 6d 6f 73 74 20 6e |l people|, most n|
|00000ce0| 6f 74 61 62 6c 79 20 50 | 61 74 72 69 63 6b 20 57 |otably P|atrick W|
|00000cf0| 6f 6f 64 0a 6f 66 20 50 | 69 70 65 6c 69 6e 65 20 |ood.of P|ipeline |
|00000d00| 41 73 73 6f 63 69 61 74 | 65 73 2c 20 49 6e 63 2e |Associat|es, Inc.|
|00000d10| 20 66 6f 72 20 74 68 65 | 20 6f 72 69 67 69 6e 61 | for the| origina|
|00000d20| 6c 20 50 6f 73 74 53 63 | 72 69 70 74 20 63 6f 64 |l PostSc|ript cod|
|00000d30| 65 20 61 6e 64 20 42 69 | 6c 6c 0a 56 6f 67 65 6c |e and Bi|ll.Vogel|
|00000d40| 20 6f 66 20 41 54 26 54 | 20 66 6f 72 20 74 68 65 | of AT&T| for the|
|00000d50| 20 63 61 6c 65 6e 64 61 | 72 20 66 69 6c 65 20 6d | calenda|r file m|
|00000d60| 65 63 68 61 6e 69 73 6d | 2e 20 20 4d 79 20 70 61 |echanism|. My pa|
|00000d70| 72 74 20 77 61 73 20 73 | 69 6d 70 6c 65 0a 74 72 |rt was s|imple.tr|
|00000d80| 61 6e 73 6c 61 74 69 6f | 6e 20 74 6f 20 61 20 22 |anslatio|n to a "|
|00000d90| 43 22 20 70 72 6f 67 72 | 61 6d 2c 20 74 68 65 20 |C" progr|am, the |
|00000da0| 61 64 64 69 74 69 6f 6e | 20 6f 66 20 61 20 63 6f |addition| of a co|
|00000db0| 75 70 6c 65 20 6f 70 74 | 69 6f 6e 73 20 61 6e 64 |uple opt|ions and|
|00000dc0| 20 61 20 6d 6f 72 65 0a | 67 65 6e 65 72 61 6c 69 | a more.|generali|
|00000dd0| 7a 65 64 20 64 61 74 65 | 20 73 65 61 72 63 68 69 |zed date| searchi|
|00000de0| 6e 67 20 72 6f 75 74 69 | 6e 65 20 28 6f 68 20 79 |ng routi|ne (oh y|
|00000df0| 65 73 2c 20 61 6e 64 20 | 61 20 6d 61 6e 75 61 6c |es, and |a manual|
|00000e00| 20 70 61 67 65 20 3a 2d | 29 2e 0a 0a 54 68 65 20 | page :-|)...The |
|00000e10| 6f 72 69 67 69 6e 61 6c | 20 63 61 6c 65 6e 64 61 |original| calenda|
|00000e20| 72 20 50 6f 73 74 53 63 | 72 69 70 74 20 77 61 73 |r PostSc|ript was|
|00000e30| 20 43 6f 70 79 72 69 67 | 68 74 20 28 63 29 20 31 | Copyrig|ht (c) 1|
|00000e40| 39 38 37 20 62 79 20 50 | 61 74 72 69 63 6b 20 57 |987 by P|atrick W|
|00000e50| 6f 6f 64 0a 61 6e 64 20 | 50 69 70 65 6c 69 6e 65 |ood.and |Pipeline|
|00000e60| 20 41 73 73 6f 63 69 61 | 74 65 73 2c 20 49 6e 63 | Associa|tes, Inc|
|00000e70| 2e 20 77 69 74 68 20 70 | 65 72 6d 69 73 73 69 6f |. with p|ermissio|
|00000e80| 6e 20 74 6f 20 6d 6f 64 | 69 66 79 20 61 6e 64 20 |n to mod|ify and |
|00000e90| 72 65 64 69 73 74 72 69 | 62 75 74 65 2e 0a 50 6c |redistri|bute..Pl|
|00000ea0| 65 61 73 65 20 72 65 74 | 61 69 6e 20 74 68 69 73 |ease ret|ain this|
|00000eb0| 20 52 45 41 44 4d 45 20 | 66 69 6c 65 20 77 69 74 | README |file wit|
|00000ec0| 68 20 74 68 65 20 70 61 | 63 6b 61 67 65 2e 0a 0a |h the pa|ckage...|
|00000ed0| 0a 4b 65 6e 20 4b 65 69 | 72 6e 61 6e 0a 50 61 63 |.Ken Kei|rnan.Pac|
|00000ee0| 69 66 69 63 20 42 65 6c | 6c 0a 53 61 6e 20 52 61 |ific Bel|l.San Ra|
|00000ef0| 6d 6f 6e 2c 20 43 41 2e | 0a 53 48 41 52 5f 45 4f |mon, CA.|.SHAR_EO|
|00000f00| 46 0a 66 69 0a 69 66 20 | 74 65 73 74 20 2d 66 20 |F.fi.if |test -f |
|00000f10| 27 70 63 61 6c 2e 63 27 | 0a 74 68 65 6e 0a 09 65 |'pcal.c'|.then..e|
|00000f20| 63 68 6f 20 73 68 61 72 | 3a 20 22 77 69 6c 6c 20 |cho shar|: "will |
|00000f30| 6e 6f 74 20 6f 76 65 72 | 2d 77 72 69 74 65 20 65 |not over|-write e|
|00000f40| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 27 70 63 |xisting |file 'pc|
|00000f50| 61 6c 2e 63 27 22 0a 65 | 6c 73 65 0a 63 61 74 20 |al.c'".e|lse.cat |
|00000f60| 3c 3c 20 5c 53 48 41 52 | 5f 45 4f 46 20 3e 20 27 |<< \SHAR|_EOF > '|
|00000f70| 70 63 61 6c 2e 63 27 0a | 2f 2a 0a 20 2a 20 70 63 |pcal.c'.|/*. * pc|
|00000f80| 61 6c 2e 63 20 2d 20 67 | 65 6e 65 72 61 74 65 20 |al.c - g|enerate |
|00000f90| 50 6f 73 74 53 63 72 69 | 70 74 20 66 69 6c 65 20 |PostScri|pt file |
|00000fa0| 74 6f 20 70 72 69 6e 74 | 20 63 61 6c 65 6e 64 61 |to print| calenda|
|00000fb0| 72 20 66 6f 72 20 61 6e | 79 20 6d 6f 6e 74 68 2f |r for an|y month/|
|00000fc0| 79 65 61 72 0a 20 2a 0a | 20 2a 20 54 68 65 20 6f |year. *.| * The o|
|00000fd0| 72 69 67 69 6e 61 6c 20 | 50 6f 73 74 53 63 72 69 |riginal |PostScri|
|00000fe0| 70 74 20 63 6f 64 65 20 | 74 6f 20 67 65 6e 65 72 |pt code |to gener|
|00000ff0| 61 74 65 20 74 68 65 20 | 63 61 6c 65 6e 64 61 72 |ate the |calendar|
|00001000| 73 20 77 61 73 20 77 72 | 69 74 74 65 6e 20 62 79 |s was wr|itten by|
|00001010| 0a 20 2a 20 50 61 74 72 | 69 63 6b 20 57 6f 6f 64 |. * Patr|ick Wood|
|00001020| 20 28 43 6f 70 79 77 72 | 69 74 65 20 28 63 29 20 | (Copywr|ite (c) |
|00001030| 31 39 38 37 20 62 79 20 | 50 61 74 72 69 63 6b 20 |1987 by |Patrick |
|00001040| 57 6f 6f 64 20 6f 66 20 | 50 69 70 65 6c 69 6e 65 |Wood of |Pipeline|
|00001050| 20 41 73 73 6f 63 69 61 | 74 65 73 2c 0a 20 2a 20 | Associa|tes,. * |
|00001060| 49 6e 63 2e 29 2c 20 61 | 6e 64 20 61 75 74 68 6f |Inc.), a|nd autho|
|00001070| 72 69 7a 65 64 20 66 6f | 72 20 6d 6f 64 69 66 69 |rized fo|r modifi|
|00001080| 63 61 74 69 6f 6e 20 61 | 6e 64 20 72 65 64 69 73 |cation a|nd redis|
|00001090| 74 72 69 62 75 74 69 6f | 6e 2e 20 20 54 68 65 20 |tributio|n. The |
|000010a0| 63 61 6c 65 6e 64 61 72 | 0a 20 2a 20 66 69 6c 65 |calendar|. * file|
|000010b0| 20 69 6e 63 6c 75 73 69 | 6f 6e 20 63 6f 64 65 20 | inclusi|on code |
|000010c0| 77 61 73 20 6f 72 69 67 | 69 6e 61 6c 6c 79 20 77 |was orig|inally w|
|000010d0| 72 69 74 74 65 6e 20 69 | 6e 20 22 62 73 28 31 29 |ritten i|n "bs(1)|
|000010e0| 22 20 62 79 20 42 69 6c | 6c 20 56 6f 67 65 6c 20 |" by Bil|l Vogel |
|000010f0| 6f 66 0a 20 2a 20 41 54 | 26 54 2e 20 20 50 61 74 |of. * AT|&T. Pat|
|00001100| 72 69 63 6b 27 73 20 6f | 72 69 67 69 6e 61 6c 20 |rick's o|riginal |
|00001110| 50 6f 73 74 53 63 72 69 | 70 74 20 77 61 73 20 6d |PostScri|pt was m|
|00001120| 6f 64 69 66 69 65 64 20 | 61 6e 64 20 65 6e 68 61 |odified |and enha|
|00001130| 6e 63 65 64 20 73 65 76 | 65 72 61 6c 0a 20 2a 20 |nced sev|eral. * |
|00001140| 74 69 6d 65 73 20 62 79 | 20 6f 74 68 65 72 73 20 |times by| others |
|00001150| 77 68 6f 73 65 20 6e 61 | 6d 65 73 20 68 61 76 65 |whose na|mes have|
|00001160| 20 72 65 67 72 65 74 74 | 61 62 6c 79 20 62 65 65 | regrett|ably bee|
|00001170| 6e 20 6c 6f 73 74 2e 20 | 20 54 68 69 73 20 43 20 |n lost. | This C |
|00001180| 76 65 72 73 69 6f 6e 0a | 20 2a 20 77 61 73 20 6f |version.| * was o|
|00001190| 72 69 67 69 6e 61 6c 6c | 79 20 63 72 65 61 74 65 |riginall|y create|
|000011a0| 64 20 62 79 20 4b 65 6e | 20 4b 65 69 72 6e 61 6e |d by Ken| Keirnan|
|000011b0| 20 6f 66 20 50 61 63 69 | 66 69 63 20 42 65 6c 6c | of Paci|fic Bell|
|000011c0| 3b 20 61 64 64 69 74 69 | 6f 6e 61 6c 0a 20 2a 20 |; additi|onal. * |
|000011d0| 65 6e 68 61 6e 63 65 6d | 65 6e 74 73 20 62 79 20 |enhancem|ents by |
|000011e0| 4a 6f 73 65 70 68 20 50 | 2e 20 4c 61 72 73 6f 6e |Joseph P|. Larson|
|000011f0| 2c 20 45 64 20 48 61 6e | 64 2c 20 61 6e 64 20 41 |, Ed Han|d, and A|
|00001200| 6e 64 72 65 77 20 57 2e | 20 52 6f 67 65 72 73 2e |ndrew W.| Rogers.|
|00001210| 0a 20 2a 2f 0a 0a 23 69 | 6e 63 6c 75 64 65 20 3c |. */..#i|nclude <|
|00001220| 73 74 64 69 6f 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |stdio.h>|.#includ|
|00001230| 65 20 3c 63 74 79 70 65 | 2e 68 3e 0a 23 69 6e 63 |e <ctype|.h>.#inc|
|00001240| 6c 75 64 65 20 3c 74 69 | 6d 65 2e 68 3e 0a 23 69 |lude <ti|me.h>.#i|
|00001250| 6e 63 6c 75 64 65 20 3c | 73 74 72 69 6e 67 2e 68 |nclude <|string.h|
|00001260| 3e 0a 0a 23 64 65 66 69 | 6e 65 20 50 52 54 09 28 |>..#defi|ne PRT.(|
|00001270| 76 6f 69 64 29 70 72 69 | 6e 74 66 0a 23 64 65 66 |void)pri|ntf.#def|
|00001280| 69 6e 65 20 46 50 52 09 | 28 76 6f 69 64 29 66 70 |ine FPR.|(void)fp|
|00001290| 72 69 6e 74 66 0a 0a 23 | 64 65 66 69 6e 65 20 48 |rintf..#|define H|
|000012a0| 4f 4c 49 44 41 59 09 28 | 31 20 3c 3c 20 36 29 09 |OLIDAY.(|1 << 6).|
|000012b0| 2f 2a 20 62 69 74 20 73 | 65 74 20 74 6f 20 66 6c |/* bit s|et to fl|
|000012c0| 61 67 20 64 61 79 20 61 | 73 20 68 6f 6c 69 64 61 |ag day a|s holida|
|000012d0| 79 20 2a 2f 0a 0a 63 68 | 61 72 20 2a 77 6f 72 64 |y */..ch|ar *word|
|000012e0| 73 5b 31 30 30 5d 3b 09 | 2f 2a 20 6d 61 78 69 6d |s[100];.|/* maxim|
|000012f0| 75 6d 20 6e 75 6d 62 65 | 72 20 6f 66 20 77 6f 72 |um numbe|r of wor|
|00001300| 64 73 20 6f 6e 20 61 20 | 6c 69 6e 65 20 2a 2f 0a |ds on a |line */.|
|00001310| 63 68 61 72 20 6c 62 75 | 66 5b 35 31 32 5d 3b 09 |char lbu|f[512];.|
|00001320| 09 2f 2a 20 6d 61 78 69 | 6d 75 6d 20 6c 69 6e 65 |./* maxi|mum line|
|00001330| 20 73 69 7a 65 20 2a 2f | 0a 0a 63 68 61 72 20 2a | size */|..char *|
|00001340| 6d 6f 6e 74 68 73 5b 5d | 20 3d 20 7b 09 2f 2a 20 |months[]| = {./* |
|00001350| 75 73 65 64 20 74 6f 20 | 6d 61 74 63 68 20 61 6c |used to |match al|
|00001360| 70 68 61 20 6d 6f 6e 74 | 68 73 20 2a 2f 0a 09 22 |pha mont|hs */.."|
|00001370| 6a 61 6e 22 2c 20 22 66 | 65 62 22 2c 20 22 6d 61 |jan", "f|eb", "ma|
|00001380| 72 22 2c 20 22 61 70 72 | 22 2c 20 22 6d 61 79 22 |r", "apr|", "may"|
|00001390| 2c 20 22 6a 75 6e 22 2c | 0a 09 22 6a 75 6c 22 2c |, "jun",|.."jul",|
|000013a0| 20 22 61 75 67 22 2c 20 | 22 73 65 70 22 2c 20 22 | "aug", |"sep", "|
|000013b0| 6f 63 74 22 2c 20 22 6e | 6f 76 22 2c 20 22 64 65 |oct", "n|ov", "de|
|000013c0| 63 22 2c 0a 09 28 63 68 | 61 72 20 2a 29 30 2c 0a |c",..(ch|ar *)0,.|
|000013d0| 7d 3b 0a 0a 2f 2a 0a 20 | 2a 20 74 68 65 20 50 6f |};../*. |* the Po|
|000013e0| 73 74 53 63 72 69 70 74 | 20 72 6f 75 74 69 6e 65 |stScript| routine|
|000013f0| 73 20 66 6f 72 20 70 63 | 61 6c 2e 63 0a 20 2a 2f |s for pc|al.c. */|
|00001400| 0a 0a 2f 2a 20 6d 6f 64 | 69 66 69 65 64 20 62 79 |../* mod|ified by|
|00001410| 20 41 57 52 20 74 6f 20 | 73 6b 69 70 20 70 72 69 | AWR to |skip pri|
|00001420| 6e 74 69 6e 67 20 64 61 | 79 73 20 6f 66 20 77 65 |nting da|ys of we|
|00001430| 65 6b 20 6f 6e 20 73 6d | 61 6c 6c 20 63 61 6c 65 |ek on sm|all cale|
|00001440| 6e 64 61 72 73 20 2a 2f | 0a 0a 63 68 61 72 20 2a |ndars */|..char *|
|00001450| 68 65 61 64 65 72 5f 31 | 5b 5d 20 3d 20 7b 0a 20 |header_1|[] = {. |
|00001460| 20 22 2f 6d 6f 6e 74 68 | 5f 6e 61 6d 65 73 20 5b | "/month|_names [|
|00001470| 20 28 4a 61 6e 75 61 72 | 79 29 20 28 46 65 62 72 | (Januar|y) (Febr|
|00001480| 75 61 72 79 29 20 28 4d | 61 72 63 68 29 20 28 41 |uary) (M|arch) (A|
|00001490| 70 72 69 6c 29 20 28 4d | 61 79 29 20 28 4a 75 6e |pril) (M|ay) (Jun|
|000014a0| 65 29 20 28 4a 75 6c 79 | 29 22 2c 0a 20 20 22 5c |e) (July|)",. "\|
|000014b0| 74 5c 74 28 41 75 67 75 | 73 74 29 20 28 53 65 70 |t\t(Augu|st) (Sep|
|000014c0| 74 65 6d 62 65 72 29 20 | 28 4f 63 74 6f 62 65 72 |tember) |(October|
|000014d0| 29 20 28 4e 6f 76 65 6d | 62 65 72 29 20 28 44 65 |) (Novem|ber) (De|
|000014e0| 63 65 6d 62 65 72 29 20 | 5d 20 64 65 66 22 2c 0a |cember) |] def",.|
|000014f0| 20 20 22 2f 70 72 74 6e | 75 6d 20 7b 20 33 20 73 | "/prtn|um { 3 s|
|00001500| 74 72 69 6e 67 20 63 76 | 73 20 73 68 6f 77 7d 20 |tring cv|s show} |
|00001510| 64 65 66 22 2c 0a 20 20 | 22 2f 64 72 61 77 67 72 |def",. |"/drawgr|
|00001520| 69 64 20 7b 5c 74 5c 74 | 25 20 64 72 61 77 20 63 |id {\t\t|% draw c|
|00001530| 61 6c 65 6e 64 61 72 20 | 62 6f 78 65 73 22 2c 0a |alendar |boxes",.|
|00001540| 20 20 22 5c 74 64 61 79 | 66 6f 6e 74 20 66 69 6e | "\tday|font fin|
|00001550| 64 66 6f 6e 74 20 31 30 | 20 73 63 61 6c 65 66 6f |dfont 10| scalefo|
|00001560| 6e 74 20 73 65 74 66 6f | 6e 74 22 2c 0a 20 20 22 |nt setfo|nt",. "|
|00001570| 5c 74 30 20 31 20 36 20 | 7b 22 2c 0a 20 20 22 5c |\t0 1 6 |{",. "\|
|00001580| 74 5c 74 2f 69 20 65 78 | 63 68 20 64 65 66 22 2c |t\t/i ex|ch def",|
|00001590| 0a 20 20 22 5c 74 5c 74 | 73 75 62 6d 6f 6e 74 68 |. "\t\t|submonth|
|000015a0| 20 30 20 65 71 20 7b 22 | 2c 0a 20 20 22 5c 74 5c | 0 eq {"|,. "\t\|
|000015b0| 74 5c 74 69 20 31 30 30 | 20 6d 75 6c 20 34 30 20 |t\ti 100| mul 40 |
|000015c0| 6d 6f 76 65 74 6f 22 2c | 0a 20 20 22 5c 74 5c 74 |moveto",|. "\t\t|
|000015d0| 5c 74 5b 20 28 53 75 6e | 64 61 79 29 20 28 4d 6f |\t[ (Sun|day) (Mo|
|000015e0| 6e 64 61 79 29 20 28 54 | 75 65 73 64 61 79 29 20 |nday) (T|uesday) |
|000015f0| 28 57 65 64 6e 65 73 64 | 61 79 29 20 28 54 68 75 |(Wednesd|ay) (Thu|
|00001600| 72 73 64 61 79 29 20 28 | 46 72 69 64 61 79 29 20 |rsday) (|Friday) |
|00001610| 28 53 61 74 75 72 64 61 | 79 29 20 5d 20 69 20 67 |(Saturda|y) ] i g|
|00001620| 65 74 22 2c 0a 20 20 22 | 5c 74 5c 74 5c 74 31 30 |et",. "|\t\t\t10|
|00001630| 30 20 63 65 6e 74 65 72 | 22 2c 0a 20 20 22 5c 74 |0 center|",. "\t|
|00001640| 5c 74 7d 20 69 66 22 2c | 0a 20 20 22 5c 74 5c 74 |\t} if",|. "\t\t|
|00001650| 69 20 31 30 30 20 6d 75 | 6c 20 33 35 20 6d 6f 76 |i 100 mu|l 35 mov|
|00001660| 65 74 6f 22 2c 0a 20 20 | 22 5c 74 5c 74 31 2e 30 |eto",. |"\t\t1.0|
|00001670| 20 73 65 74 6c 69 6e 65 | 77 69 64 74 68 22 2c 0a | setline|width",.|
|00001680| 20 20 22 5c 74 5c 74 30 | 20 31 20 35 20 7b 22 2c | "\t\t0| 1 5 {",|
|00001690| 0a 20 20 22 5c 74 5c 74 | 5c 74 67 73 61 76 65 22 |. "\t\t|\tgsave"|
|000016a0| 2c 0a 20 20 22 5c 74 5c | 74 5c 74 31 30 30 20 30 |,. "\t\|t\t100 0|
|000016b0| 20 72 6c 69 6e 65 74 6f | 20 22 2c 0a 20 20 22 5c | rlineto| ",. "\|
|000016c0| 74 5c 74 5c 74 30 20 2d | 38 30 20 72 6c 69 6e 65 |t\t\t0 -|80 rline|
|000016d0| 74 6f 22 2c 0a 20 20 22 | 5c 74 5c 74 5c 74 2d 31 |to",. "|\t\t\t-1|
|000016e0| 30 30 20 30 20 72 6c 69 | 6e 65 74 6f 22 2c 0a 20 |00 0 rli|neto",. |
|000016f0| 20 22 5c 74 5c 74 5c 74 | 63 6c 6f 73 65 70 61 74 | "\t\t\t|closepat|
|00001700| 68 20 73 74 72 6f 6b 65 | 22 2c 0a 20 20 22 5c 74 |h stroke|",. "\t|
|00001710| 5c 74 5c 74 67 72 65 73 | 74 6f 72 65 22 2c 0a 20 |\t\tgres|tore",. |
|00001720| 20 22 5c 74 5c 74 5c 74 | 30 20 2d 38 30 20 72 6d | "\t\t\t|0 -80 rm|
|00001730| 6f 76 65 74 6f 22 2c 0a | 20 20 22 5c 74 5c 74 20 |oveto",.| "\t\t |
|00001740| 70 6f 70 20 7d 20 66 6f | 72 22 2c 0a 20 20 22 5c |pop } fo|r",. "\|
|00001750| 74 7d 20 66 6f 72 22 2c | 0a 20 20 22 7d 20 64 65 |t} for",|. "} de|
|00001760| 66 22 2c 0a 20 20 22 2f | 64 72 61 77 6e 75 6d 73 |f",. "/|drawnums|
|00001770| 20 7b 5c 74 5c 74 25 20 | 70 6c 61 63 65 20 64 61 | {\t\t% |place da|
|00001780| 79 20 6e 75 6d 62 65 72 | 73 20 6f 6e 20 63 61 6c |y number|s on cal|
|00001790| 65 6e 64 61 72 22 2c 0a | 20 20 22 5c 74 64 61 79 |endar",.| "\tday|
|000017a0| 66 6f 6e 74 20 66 69 6e | 64 66 6f 6e 74 20 33 30 |font fin|dfont 30|
|000017b0| 20 73 63 61 6c 65 66 6f | 6e 74 20 73 65 74 66 6f | scalefo|nt setfo|
|000017c0| 6e 74 22 2c 0a 20 20 22 | 5c 74 2f 73 74 61 72 74 |nt",. "|\t/start|
|000017d0| 20 73 74 61 72 74 64 61 | 79 20 64 65 66 22 2c 0a | startda|y def",.|
|000017e0| 20 20 22 5c 74 2f 64 61 | 79 73 20 6e 64 61 79 73 | "\t/da|ys ndays|
|000017f0| 20 64 65 66 22 2c 0a 20 | 20 22 5c 74 2f 6e 20 30 | def",. | "\t/n 0|
|00001800| 20 64 65 66 22 2c 0a 20 | 20 22 5c 74 73 74 61 72 | def",. | "\tstar|
|00001810| 74 20 31 30 30 20 6d 75 | 6c 20 35 20 61 64 64 20 |t 100 mu|l 5 add |
|00001820| 31 30 20 72 6d 6f 76 65 | 74 6f 22 2c 0a 20 20 22 |10 rmove|to",. "|
|00001830| 5c 74 31 20 31 20 64 61 | 79 73 20 7b 22 2c 0a 20 |\t1 1 da|ys {",. |
|00001840| 20 22 5c 74 5c 74 2f 64 | 61 79 20 65 78 63 68 20 | "\t\t/d|ay exch |
|00001850| 64 65 66 22 2c 0a 20 20 | 22 5c 74 5c 74 67 73 61 |def",. |"\t\tgsa|
|00001860| 76 65 22 2c 0a 20 20 22 | 5c 74 5c 74 73 75 62 6d |ve",. "|\t\tsubm|
|00001870| 6f 6e 74 68 20 30 20 65 | 71 20 7b 22 2c 0a 20 20 |onth 0 e|q {",. |
|00001880| 28 63 68 61 72 20 2a 29 | 30 0a 20 20 7d 3b 0a 0a |(char *)|0. };..|
|00001890| 2f 2a 20 6d 6f 64 69 66 | 69 65 64 20 62 79 20 41 |/* modif|ied by A|
|000018a0| 57 52 3a 20 63 68 6f 69 | 63 65 20 6f 66 20 62 6c |WR: choi|ce of bl|
|000018b0| 61 63 6b 20 6f 72 20 67 | 72 61 79 20 53 61 74 75 |ack or g|ray Satu|
|000018c0| 72 64 61 79 73 20 6e 6f | 77 20 63 6f 6d 6d 61 6e |rdays no|w comman|
|000018d0| 64 2d 6c 69 6e 65 20 6f | 70 74 69 6f 6e 20 2a 2f |d-line o|ption */|
|000018e0| 0a 0a 63 68 61 72 20 2a | 68 65 61 64 65 72 5f 32 |..char *|header_2|
|000018f0| 5b 5d 20 3d 20 7b 09 09 | 09 2f 2a 20 73 65 74 20 |[] = {..|./* set |
|00001900| 53 61 74 75 72 64 61 79 | 73 20 74 6f 20 67 72 61 |Saturday|s to gra|
|00001910| 79 20 2a 2f 0a 20 20 22 | 5c 74 5c 74 5c 74 64 61 |y */. "|\t\t\tda|
|00001920| 79 20 73 74 61 72 74 20 | 61 64 64 20 37 20 6d 6f |y start |add 7 mo|
|00001930| 64 20 30 20 65 71 20 7b | 22 2c 0a 20 20 22 5c 74 |d 0 eq {|",. "\t|
|00001940| 5c 74 5c 74 5c 74 2e 38 | 20 73 65 74 67 72 61 79 |\t\t\t.8| setgray|
|00001950| 22 2c 0a 20 20 22 5c 74 | 5c 74 5c 74 7d 20 69 66 |",. "\t|\t\t} if|
|00001960| 22 2c 0a 20 20 28 63 68 | 61 72 20 2a 29 30 0a 20 |",. (ch|ar *)0. |
|00001970| 20 7d 3b 0a 0a 2f 2a 20 | 6d 6f 64 69 66 69 65 64 | };../* |modified|
|00001980| 20 62 79 20 41 57 52 3a | 20 63 61 6c 63 75 6c 61 | by AWR:| calcula|
|00001990| 74 65 20 6c 65 61 70 20 | 79 65 61 72 73 20 63 6f |te leap |years co|
|000019a0| 72 72 65 63 74 6c 79 2c | 20 70 72 69 6e 74 20 68 |rrectly,| print h|
|000019b0| 6f 6c 69 64 61 79 73 20 | 69 6e 20 67 72 61 79 20 |olidays |in gray |
|000019c0| 2a 2f 0a 0a 63 68 61 72 | 20 2a 68 65 61 64 65 72 |*/..char| *header|
|000019d0| 5f 33 5b 5d 20 3d 20 7b | 0a 20 20 22 5c 74 5c 74 |_3[] = {|. "\t\t|
|000019e0| 5c 74 64 61 79 20 73 74 | 61 72 74 20 61 64 64 20 |\tday st|art add |
|000019f0| 37 20 6d 6f 64 20 31 20 | 65 71 20 7b 22 2c 0a 20 |7 mod 1 |eq {",. |
|00001a00| 20 22 5c 74 5c 74 5c 74 | 5c 74 2e 38 20 73 65 74 | "\t\t\t|\t.8 set|
|00001a10| 67 72 61 79 22 2c 0a 20 | 20 22 5c 74 5c 74 5c 74 |gray",. | "\t\t\t|
|00001a20| 7d 20 69 66 22 2c 0a 20 | 20 22 5c 74 5c 74 5c 74 |} if",. | "\t\t\t|
|00001a30| 64 61 79 20 68 6f 6c 69 | 64 61 79 73 20 6e 20 67 |day holi|days n g|
|00001a40| 65 74 20 65 71 20 7b 22 | 2c 0a 20 20 22 5c 74 5c |et eq {"|,. "\t\|
|00001a50| 74 5c 74 5c 74 2e 38 20 | 73 65 74 67 72 61 79 22 |t\t\t.8 |setgray"|
|00001a60| 2c 0a 20 20 22 5c 74 5c | 74 5c 74 5c 74 2f 6e 20 |,. "\t\|t\t\t/n |
|00001a70| 6e 20 31 20 61 64 64 20 | 64 65 66 22 2c 0a 20 20 |n 1 add |def",. |
|00001a80| 22 5c 74 5c 74 5c 74 7d | 20 69 66 22 2c 0a 20 20 |"\t\t\t}| if",. |
|00001a90| 22 5c 74 5c 74 7d 20 69 | 66 22 2c 0a 20 20 22 5c |"\t\t} i|f",. "\|
|00001aa0| 74 5c 74 64 61 79 20 70 | 72 74 6e 75 6d 22 2c 0a |t\tday p|rtnum",.|
|00001ab0| 20 20 22 5c 74 5c 74 67 | 72 65 73 74 6f 72 65 22 | "\t\tg|restore"|
|00001ac0| 2c 0a 20 20 22 5c 74 5c | 74 64 61 79 20 73 74 61 |,. "\t\|tday sta|
|00001ad0| 72 74 20 61 64 64 20 37 | 20 6d 6f 64 20 30 20 65 |rt add 7| mod 0 e|
|00001ae0| 71 22 2c 0a 20 20 22 5c | 74 5c 74 7b 22 2c 0a 20 |q",. "\|t\t{",. |
|00001af0| 20 22 5c 74 5c 74 5c 74 | 63 75 72 72 65 6e 74 70 | "\t\t\t|currentp|
|00001b00| 6f 69 6e 74 20 65 78 63 | 68 20 70 6f 70 20 38 30 |oint exc|h pop 80|
|00001b10| 20 73 75 62 20 35 20 65 | 78 63 68 20 6d 6f 76 65 | sub 5 e|xch move|
|00001b20| 74 6f 22 2c 0a 20 20 22 | 5c 74 5c 74 7d 22 2c 0a |to",. "|\t\t}",.|
|00001b30| 20 20 22 5c 74 5c 74 7b | 22 2c 0a 20 20 22 5c 74 | "\t\t{|",. "\t|
|00001b40| 5c 74 5c 74 31 30 30 20 | 30 20 72 6d 6f 76 65 74 |\t\t100 |0 rmovet|
|00001b50| 6f 22 2c 0a 20 20 22 5c | 74 5c 74 7d 20 69 66 65 |o",. "\|t\t} ife|
|00001b60| 6c 73 65 22 2c 0a 20 20 | 22 5c 74 7d 20 66 6f 72 |lse",. |"\t} for|
|00001b70| 22 2c 0a 20 20 22 7d 20 | 64 65 66 22 2c 0a 20 20 |",. "} |def",. |
|00001b80| 22 2f 64 72 61 77 66 69 | 6c 6c 20 7b 5c 74 5c 74 |"/drawfi|ll {\t\t|
|00001b90| 25 20 70 6c 61 63 65 20 | 66 69 6c 6c 20 73 71 75 |% place |fill squ|
|00001ba0| 61 72 65 73 20 6f 6e 20 | 63 61 6c 65 6e 64 61 72 |ares on |calendar|
|00001bb0| 22 2c 0a 20 20 22 5c 74 | 2f 73 74 61 72 74 20 73 |",. "\t|/start s|
|00001bc0| 74 61 72 74 64 61 79 20 | 64 65 66 22 2c 0a 20 20 |tartday |def",. |
|00001bd0| 22 5c 74 2f 64 61 79 73 | 20 6e 64 61 79 73 20 64 |"\t/days| ndays d|
|00001be0| 65 66 22 2c 0a 20 20 22 | 5c 74 30 20 33 35 20 72 |ef",. "|\t0 35 r|
|00001bf0| 6d 6f 76 65 74 6f 22 2c | 0a 20 20 22 5c 74 31 2e |moveto",|. "\t1.|
|00001c00| 30 20 73 65 74 6c 69 6e | 65 77 69 64 74 68 22 2c |0 setlin|ewidth",|
|00001c10| 0a 20 20 22 5c 74 30 20 | 31 20 73 74 61 72 74 20 |. "\t0 |1 start |
|00001c20| 31 20 73 75 62 20 7b 22 | 2c 0a 20 20 22 5c 74 5c |1 sub {"|,. "\t\|
|00001c30| 74 67 73 61 76 65 22 2c | 0a 20 20 22 5c 74 5c 74 |tgsave",|. "\t\t|
|00001c40| 2e 39 20 73 65 74 67 72 | 61 79 22 2c 0a 20 20 22 |.9 setgr|ay",. "|
|00001c50| 5c 74 5c 74 31 30 30 20 | 30 20 72 6c 69 6e 65 74 |\t\t100 |0 rlinet|
|00001c60| 6f 20 22 2c 0a 20 20 22 | 5c 74 5c 74 30 20 2d 38 |o ",. "|\t\t0 -8|
|00001c70| 30 20 72 6c 69 6e 65 74 | 6f 22 2c 0a 20 20 22 5c |0 rlinet|o",. "\|
|00001c80| 74 5c 74 2d 31 30 30 20 | 30 20 72 6c 69 6e 65 74 |t\t-100 |0 rlinet|
|00001c90| 6f 22 2c 0a 20 20 22 5c | 74 5c 74 63 6c 6f 73 65 |o",. "\|t\tclose|
|00001ca0| 70 61 74 68 20 66 69 6c | 6c 22 2c 0a 20 20 22 5c |path fil|l",. "\|
|00001cb0| 74 5c 74 67 72 65 73 74 | 6f 72 65 22 2c 0a 20 20 |t\tgrest|ore",. |
|00001cc0| 22 5c 74 5c 74 31 30 30 | 20 30 20 72 6d 6f 76 65 |"\t\t100| 0 rmove|
|00001cd0| 74 6f 22 2c 0a 20 20 22 | 5c 74 70 6f 70 20 7d 20 |to",. "|\tpop } |
|00001ce0| 66 6f 72 22 2c 0a 20 20 | 22 5c 74 73 75 62 6d 6f |for",. |"\tsubmo|
|00001cf0| 6e 74 68 20 31 20 65 71 | 22 2c 0a 20 20 22 5c 74 |nth 1 eq|",. "\t|
|00001d00| 7b 22 2c 0a 20 20 22 5c | 74 5c 74 2f 6c 61 73 74 |{",. "\|t\t/last|
|00001d10| 64 61 79 20 34 32 20 64 | 65 66 22 2c 0a 20 20 22 |day 42 d|ef",. "|
|00001d20| 5c 74 5c 74 36 30 30 20 | 2d 33 36 35 20 6d 6f 76 |\t\t600 |-365 mov|
|00001d30| 65 74 6f 22 2c 0a 20 20 | 22 5c 74 7d 22 2c 0a 20 |eto",. |"\t}",. |
|00001d40| 20 22 5c 74 7b 22 2c 0a | 20 20 22 5c 74 5c 74 2f | "\t{",.| "\t\t/|
|00001d50| 6c 61 73 74 64 61 79 20 | 34 30 20 64 65 66 22 2c |lastday |40 def",|
|00001d60| 0a 20 20 22 5c 74 5c 74 | 34 30 30 20 2d 33 36 35 |. "\t\t|400 -365|
|00001d70| 20 6d 6f 76 65 74 6f 22 | 2c 0a 20 20 22 5c 74 7d | moveto"|,. "\t}|
|00001d80| 20 69 66 65 6c 73 65 22 | 2c 0a 20 20 22 5c 74 6c | ifelse"|,. "\tl|
|00001d90| 61 73 74 64 61 79 20 2d | 31 20 6e 64 61 79 73 20 |astday -|1 ndays |
|00001da0| 73 74 61 72 74 20 31 20 | 61 64 64 20 61 64 64 22 |start 1 |add add"|
|00001db0| 2c 0a 20 20 22 5c 74 7b | 22 2c 0a 20 20 22 5c 74 |,. "\t{|",. "\t|
|00001dc0| 5c 74 2f 64 61 79 20 65 | 78 63 68 20 64 65 66 22 |\t/day e|xch def"|
|00001dd0| 2c 0a 20 20 22 5c 74 5c | 74 67 73 61 76 65 22 2c |,. "\t\|tgsave",|
|00001de0| 0a 20 20 22 5c 74 5c 74 | 2e 39 20 73 65 74 67 72 |. "\t\t|.9 setgr|
|00001df0| 61 79 22 2c 0a 20 20 22 | 5c 74 5c 74 31 30 30 20 |ay",. "|\t\t100 |
|00001e00| 30 20 72 6c 69 6e 65 74 | 6f 20 22 2c 0a 20 20 22 |0 rlinet|o ",. "|
|00001e10| 5c 74 5c 74 30 20 2d 38 | 30 20 72 6c 69 6e 65 74 |\t\t0 -8|0 rlinet|
|00001e20| 6f 22 2c 0a 20 20 22 5c | 74 5c 74 2d 31 30 30 20 |o",. "\|t\t-100 |
|00001e30| 30 20 72 6c 69 6e 65 74 | 6f 22 2c 0a 20 20 22 5c |0 rlinet|o",. "\|
|00001e40| 74 5c 74 63 6c 6f 73 65 | 70 61 74 68 20 66 69 6c |t\tclose|path fil|
|00001e50| 6c 22 2c 0a 20 20 22 5c | 74 5c 74 67 72 65 73 74 |l",. "\|t\tgrest|
|00001e60| 6f 72 65 22 2c 0a 20 20 | 22 5c 74 5c 74 64 61 79 |ore",. |"\t\tday|
|00001e70| 20 37 20 6d 6f 64 20 31 | 20 65 71 22 2c 0a 20 20 | 7 mod 1| eq",. |
|00001e80| 22 5c 74 5c 74 7b 22 2c | 0a 20 20 22 5c 74 5c 74 |"\t\t{",|. "\t\t|
|00001e90| 5c 74 36 30 30 20 2d 33 | 36 35 20 38 30 20 61 64 |\t600 -3|65 80 ad|
|00001ea0| 64 20 6d 6f 76 65 74 6f | 22 2c 0a 20 20 22 5c 74 |d moveto|",. "\t|
|00001eb0| 5c 74 7d 22 2c 0a 20 20 | 22 5c 74 5c 74 7b 22 2c |\t}",. |"\t\t{",|
|00001ec0| 0a 20 20 22 5c 74 5c 74 | 5c 74 2d 31 30 30 20 30 |. "\t\t|\t-100 0|
|00001ed0| 20 72 6d 6f 76 65 74 6f | 22 2c 0a 20 20 22 5c 74 | rmoveto|",. "\t|
|00001ee0| 5c 74 7d 20 69 66 65 6c | 73 65 22 2c 0a 20 20 22 |\t} ifel|se",. "|
|00001ef0| 5c 74 7d 20 66 6f 72 22 | 2c 0a 20 20 22 7d 20 64 |\t} for"|,. "} d|
|00001f00| 65 66 22 2c 0a 20 20 22 | 2f 69 73 6c 65 61 70 20 |ef",. "|/isleap |
|00001f10| 7b 5c 74 5c 74 25 20 69 | 73 20 74 68 69 73 20 61 |{\t\t% i|s this a|
|00001f20| 20 6c 65 61 70 20 79 65 | 61 72 3f 22 2c 0a 20 20 | leap ye|ar?",. |
|00001f30| 22 5c 74 79 65 61 72 20 | 34 20 6d 6f 64 20 30 20 |"\tyear |4 mod 0 |
|00001f40| 65 71 5c 74 5c 74 25 20 | 6d 75 6c 74 69 70 6c 65 |eq\t\t% |multiple|
|00001f50| 20 6f 66 20 34 22 2c 0a | 20 20 22 5c 74 79 65 61 | of 4",.| "\tyea|
|00001f60| 72 20 31 30 30 20 6d 6f | 64 20 30 20 6e 65 20 5c |r 100 mo|d 0 ne \|
|00001f70| 74 25 20 6e 6f 74 20 63 | 65 6e 74 75 72 79 22 2c |t% not c|entury",|
|00001f80| 0a 20 20 22 5c 74 79 65 | 61 72 20 34 30 30 20 6d |. "\tye|ar 400 m|
|00001f90| 6f 64 20 30 20 65 71 20 | 6f 72 20 61 6e 64 5c 74 |od 0 eq |or and\t|
|00001fa0| 25 20 6f 72 20 64 69 76 | 69 73 69 62 6c 65 20 62 |% or div|isible b|
|00001fb0| 79 20 34 30 30 22 2c 0a | 20 20 22 7d 20 64 65 66 |y 400",.| "} def|
|00001fc0| 22 2c 0a 20 20 22 2f 64 | 61 79 73 5f 6d 6f 6e 74 |",. "/d|ays_mont|
|00001fd0| 68 20 5b 20 33 31 20 32 | 38 20 33 31 20 33 30 20 |h [ 31 2|8 31 30 |
|00001fe0| 33 31 20 33 30 20 33 31 | 20 33 31 20 33 30 20 33 |31 30 31| 31 30 3|
|00001ff0| 31 20 33 30 20 33 31 20 | 5d 20 64 65 66 22 2c 0a |1 30 31 |] def",.|
|00002000| 20 20 22 2f 6e 64 61 79 | 73 20 7b 5c 74 5c 74 25 | "/nday|s {\t\t%|
|00002010| 20 6e 75 6d 62 65 72 20 | 6f 66 20 64 61 79 73 20 | number |of days |
|00002020| 69 6e 20 74 68 69 73 20 | 6d 6f 6e 74 68 22 2c 0a |in this |month",.|
|00002030| 20 20 22 5c 74 64 61 79 | 73 5f 6d 6f 6e 74 68 20 | "\tday|s_month |
|00002040| 6d 6f 6e 74 68 20 31 20 | 73 75 62 20 67 65 74 22 |month 1 |sub get"|
|00002050| 2c 0a 20 20 22 5c 74 6d | 6f 6e 74 68 20 32 20 65 |,. "\tm|onth 2 e|
|00002060| 71 5c 74 25 20 46 65 62 | 22 2c 0a 20 20 22 5c 74 |q\t% Feb|",. "\t|
|00002070| 69 73 6c 65 61 70 20 61 | 6e 64 22 2c 0a 20 20 22 |isleap a|nd",. "|
|00002080| 5c 74 7b 22 2c 0a 20 20 | 22 5c 74 5c 74 31 20 61 |\t{",. |"\t\t1 a|
|00002090| 64 64 22 2c 0a 20 20 22 | 5c 74 7d 20 69 66 22 2c |dd",. "|\t} if",|
|000020a0| 0a 20 20 22 7d 20 64 65 | 66 22 2c 0a 20 20 22 2f |. "} de|f",. "/|
|000020b0| 73 74 61 72 74 64 61 79 | 20 7b 5c 74 5c 74 25 20 |startday| {\t\t% |
|000020c0| 73 74 61 72 74 69 6e 67 | 20 64 61 79 2d 6f 66 2d |starting| day-of-|
|000020d0| 77 65 65 6b 20 66 6f 72 | 20 74 68 69 73 20 6d 6f |week for| this mo|
|000020e0| 6e 74 68 22 2c 0a 20 20 | 22 5c 74 2f 6f 66 66 20 |nth",. |"\t/off |
|000020f0| 79 65 61 72 20 32 30 30 | 30 20 73 75 62 20 64 65 |year 200|0 sub de|
|00002100| 66 5c 74 25 20 6f 66 66 | 73 65 74 20 66 72 6f 6d |f\t% off|set from|
|00002110| 20 73 74 61 72 74 20 6f | 66 20 65 70 6f 63 68 22 | start o|f epoch"|
|00002120| 2c 0a 20 20 22 5c 74 6f | 66 66 22 2c 0a 20 20 22 |,. "\to|ff",. "|
|00002130| 5c 74 6f 66 66 20 34 20 | 69 64 69 76 20 61 64 64 |\toff 4 |idiv add|
|00002140| 5c 74 5c 74 25 20 6e 75 | 6d 62 65 72 20 6f 66 20 |\t\t% nu|mber of |
|00002150| 6c 65 61 70 20 79 65 61 | 72 73 22 2c 0a 20 20 22 |leap yea|rs",. "|
|00002160| 5c 74 6f 66 66 20 31 30 | 30 20 69 64 69 76 20 73 |\toff 10|0 idiv s|
|00002170| 75 62 5c 74 25 20 6e 75 | 6d 62 65 72 20 6f 66 20 |ub\t% nu|mber of |
|00002180| 63 65 6e 74 75 72 69 65 | 73 22 2c 0a 20 20 22 5c |centurie|s",. "\|
|00002190| 74 6f 66 66 20 34 30 30 | 20 69 64 69 76 20 61 64 |toff 400| idiv ad|
|000021a0| 64 5c 74 25 20 6e 75 6d | 62 65 72 20 6f 66 20 79 |d\t% num|ber of y|
|000021b0| 65 61 72 73 20 64 69 76 | 69 73 69 62 6c 65 20 62 |ears div|isible b|
|000021c0| 79 20 34 30 30 22 2c 0a | 20 20 22 5c 74 36 20 61 |y 400",.| "\t6 a|
|000021d0| 64 64 20 37 20 6d 6f 64 | 20 37 20 61 64 64 20 5c |dd 7 mod| 7 add \|
|000021e0| 74 25 20 6f 66 66 73 65 | 74 20 66 72 6f 6d 20 4a |t% offse|t from J|
|000021f0| 61 6e 20 31 20 32 30 30 | 30 22 2c 0a 20 20 22 5c |an 1 200|0",. "\|
|00002200| 74 2f 6f 66 66 20 65 78 | 63 68 20 64 65 66 22 2c |t/off ex|ch def",|
|00002210| 0a 20 20 22 5c 74 31 20 | 31 20 6d 6f 6e 74 68 20 |. "\t1 |1 month |
|00002220| 31 20 73 75 62 20 7b 22 | 2c 0a 20 20 22 5c 74 5c |1 sub {"|,. "\t\|
|00002230| 74 2f 69 64 78 20 65 78 | 63 68 20 64 65 66 22 2c |t/idx ex|ch def",|
|00002240| 0a 20 20 22 5c 74 5c 74 | 64 61 79 73 5f 6d 6f 6e |. "\t\t|days_mon|
|00002250| 74 68 20 69 64 78 20 31 | 20 73 75 62 20 67 65 74 |th idx 1| sub get|
|00002260| 22 2c 0a 20 20 22 5c 74 | 5c 74 69 64 78 20 32 20 |",. "\t|\tidx 2 |
|00002270| 65 71 22 2c 0a 20 20 22 | 5c 74 5c 74 69 73 6c 65 |eq",. "|\t\tisle|
|00002280| 61 70 20 61 6e 64 22 2c | 0a 20 20 22 5c 74 5c 74 |ap and",|. "\t\t|
|00002290| 7b 22 2c 0a 20 20 22 5c | 74 5c 74 5c 74 31 20 61 |{",. "\|t\t\t1 a|
|000022a0| 64 64 22 2c 0a 20 20 22 | 5c 74 5c 74 7d 20 69 66 |dd",. "|\t\t} if|
|000022b0| 22 2c 0a 20 20 22 5c 74 | 5c 74 2f 6f 66 66 20 65 |",. "\t|\t/off e|
|000022c0| 78 63 68 20 6f 66 66 20 | 61 64 64 20 64 65 66 22 |xch off |add def"|
|000022d0| 2c 0a 20 20 22 5c 74 7d | 20 66 6f 72 22 2c 0a 20 |,. "\t}| for",. |
|000022e0| 20 22 5c 74 6f 66 66 20 | 37 20 6d 6f 64 5c 74 5c | "\toff |7 mod\t\|
|000022f0| 74 25 20 30 2d 2d 53 75 | 6e 64 61 79 2c 20 31 2d |t% 0--Su|nday, 1-|
|00002300| 2d 6d 6f 6e 64 61 79 2c | 20 65 74 63 2e 22 2c 0a |-monday,| etc.",.|
|00002310| 20 20 22 7d 20 64 65 66 | 22 2c 0a 20 20 22 2f 63 | "} def|",. "/c|
|00002320| 65 6e 74 65 72 20 7b 5c | 74 5c 74 25 20 63 65 6e |enter {\|t\t% cen|
|00002330| 74 65 72 20 73 74 72 69 | 6e 67 20 69 6e 20 67 69 |ter stri|ng in gi|
|00002340| 76 65 6e 20 77 69 64 74 | 68 22 2c 0a 20 20 22 5c |ven widt|h",. "\|
|00002350| 74 2f 77 69 64 74 68 20 | 65 78 63 68 20 64 65 66 |t/width |exch def|
|00002360| 22 2c 0a 20 20 22 5c 74 | 2f 73 74 72 20 65 78 63 |",. "\t|/str exc|
|00002370| 68 20 64 65 66 20 77 69 | 64 74 68 20 73 74 72 20 |h def wi|dth str |
|00002380| 22 2c 0a 20 20 22 5c 74 | 73 74 72 69 6e 67 77 69 |",. "\t|stringwi|
|00002390| 64 74 68 20 70 6f 70 20 | 73 75 62 20 32 20 64 69 |dth pop |sub 2 di|
|000023a0| 76 20 30 20 72 6d 6f 76 | 65 74 6f 20 73 74 72 20 |v 0 rmov|eto str |
|000023b0| 73 68 6f 77 22 2c 0a 20 | 20 22 7d 20 64 65 66 22 |show",. | "} def"|
|000023c0| 2c 0a 20 20 22 2f 63 61 | 6c 65 6e 64 61 72 22 2c |,. "/ca|lendar",|
|000023d0| 0a 20 20 22 7b 22 2c 0a | 20 20 22 5c 74 74 69 74 |. "{",.| "\ttit|
|000023e0| 6c 65 66 6f 6e 74 20 66 | 69 6e 64 66 6f 6e 74 20 |lefont f|indfont |
|000023f0| 34 38 20 73 63 61 6c 65 | 66 6f 6e 74 20 73 65 74 |48 scale|font set|
|00002400| 66 6f 6e 74 22 2c 0a 20 | 20 22 5c 74 30 20 36 30 |font",. | "\t0 60|
|00002410| 20 6d 6f 76 65 74 6f 22 | 2c 0a 20 20 22 5c 74 2f | moveto"|,. "\t/|
|00002420| 6d 6f 6e 74 68 5f 6e 61 | 6d 65 20 6d 6f 6e 74 68 |month_na|me month|
|00002430| 5f 6e 61 6d 65 73 20 6d | 6f 6e 74 68 20 31 20 73 |_names m|onth 1 s|
|00002440| 75 62 20 67 65 74 20 64 | 65 66 22 2c 0a 20 20 22 |ub get d|ef",. "|
|00002450| 5c 74 6d 6f 6e 74 68 5f | 6e 61 6d 65 20 73 68 6f |\tmonth_|name sho|
|00002460| 77 22 2c 0a 20 20 22 5c | 74 2f 79 65 61 72 73 74 |w",. "\|t/yearst|
|00002470| 72 69 6e 67 20 79 65 61 | 72 20 31 30 20 73 74 72 |ring yea|r 10 str|
|00002480| 69 6e 67 20 63 76 73 20 | 64 65 66 22 2c 0a 20 20 |ing cvs |def",. |
|00002490| 22 5c 74 37 30 30 20 79 | 65 61 72 73 74 72 69 6e |"\t700 y|earstrin|
|000024a0| 67 20 73 74 72 69 6e 67 | 77 69 64 74 68 20 70 6f |g string|width po|
|000024b0| 70 20 73 75 62 20 36 30 | 20 6d 6f 76 65 74 6f 22 |p sub 60| moveto"|
|000024c0| 2c 0a 20 20 22 5c 74 79 | 65 61 72 73 74 72 69 6e |,. "\ty|earstrin|
|000024d0| 67 20 73 68 6f 77 22 2c | 0a 20 20 22 5c 74 30 20 |g show",|. "\t0 |
|000024e0| 30 20 6d 6f 76 65 74 6f | 22 2c 0a 20 20 22 5c 74 |0 moveto|",. "\t|
|000024f0| 64 72 61 77 6e 75 6d 73 | 22 2c 0a 20 20 22 5c 74 |drawnums|",. "\t|
|00002500| 30 20 30 20 6d 6f 76 65 | 74 6f 22 2c 0a 20 20 22 |0 0 move|to",. "|
|00002510| 5c 74 64 72 61 77 66 69 | 6c 6c 22 2c 0a 20 20 22 |\tdrawfi|ll",. "|
|00002520| 5c 74 30 20 30 20 6d 6f | 76 65 74 6f 22 2c 0a 20 |\t0 0 mo|veto",. |
|00002530| 20 22 5c 74 64 72 61 77 | 67 72 69 64 22 2c 0a 20 | "\tdraw|grid",. |
|00002540| 20 22 7d 20 64 65 66 22 | 2c 0a 20 20 22 2f 64 61 | "} def"|,. "/da|
|00002550| 79 74 65 78 74 20 7b 22 | 2c 0a 20 20 22 5c 74 2f |ytext {"|,. "\t/|
|00002560| 48 65 6c 76 65 74 69 63 | 61 2d 4e 61 72 72 6f 77 |Helvetic|a-Narrow|
|00002570| 20 66 69 6e 64 66 6f 6e | 74 20 36 20 73 63 61 6c | findfon|t 6 scal|
|00002580| 65 66 6f 6e 74 20 73 65 | 74 66 6f 6e 74 22 2c 0a |efont se|tfont",.|
|00002590| 20 20 22 5c 74 2f 6d 79 | 74 65 78 74 5c 74 65 78 | "\t/my|text\tex|
|000025a0| 63 68 20 64 65 66 20 2f | 6d 79 64 61 79 20 65 78 |ch def /|myday ex|
|000025b0| 63 68 20 64 65 66 22 2c | 0a 20 20 22 5c 74 73 74 |ch def",|. "\tst|
|000025c0| 61 72 74 64 61 79 20 6d | 79 64 61 79 20 31 20 73 |artday m|yday 1 s|
|000025d0| 75 62 20 61 64 64 20 64 | 75 70 20 37 20 6d 6f 64 |ub add d|up 7 mod|
|000025e0| 20 31 30 30 20 6d 75 6c | 20 35 20 61 64 64 20 25 | 100 mul| 5 add %|
|000025f0| 20 67 69 76 65 73 20 63 | 6f 6c 75 6d 6e 22 2c 0a | gives c|olumn",.|
|00002600| 20 20 22 5c 74 65 78 63 | 68 20 37 20 69 64 69 76 | "\texc|h 7 idiv|
|00002610| 20 2d 38 30 20 6d 75 6c | 20 25 20 67 69 76 65 73 | -80 mul| % gives|
|00002620| 20 72 6f 77 22 2c 0a 20 | 20 22 5c 74 64 75 70 20 | row",. | "\tdup |
|00002630| 2f 79 70 6f 73 20 65 78 | 63 68 20 64 65 66 20 6d |/ypos ex|ch def m|
|00002640| 6f 76 65 74 6f 22 2c 0a | 20 20 22 5c 74 2f 4c 4d |oveto",.| "\t/LM|
|00002650| 20 63 75 72 72 65 6e 74 | 70 6f 69 6e 74 20 70 6f | current|point po|
|00002660| 70 20 64 65 66 20 2f 52 | 4d 20 4c 4d 20 39 35 20 |p def /R|M LM 95 |
|00002670| 61 64 64 20 64 65 66 22 | 2c 0a 20 20 22 20 20 20 |add def"|,. " |
|00002680| 20 20 20 20 20 6d 79 74 | 65 78 74 20 7b 20 64 75 | myt|ext { du|
|00002690| 70 20 28 2e 70 29 20 65 | 71 20 7b 20 63 72 6c 66 |p (.p) e|q { crlf|
|000026a0| 20 70 6f 70 7d 20 7b 70 | 72 73 74 72 20 28 20 29 | pop} {p|rstr ( )|
|000026b0| 20 73 68 6f 77 7d 20 69 | 66 65 6c 73 65 20 7d 20 | show} i|felse } |
|000026c0| 66 6f 72 61 6c 6c 22 2c | 0a 20 20 22 7d 20 64 65 |forall",|. "} de|
|000026d0| 66 22 2c 0a 20 20 22 2f | 63 72 6c 66 20 7b 22 2c |f",. "/|crlf {",|
|000026e0| 0a 20 20 22 20 20 20 20 | 79 70 6f 73 20 38 20 73 |. " |ypos 8 s|
|000026f0| 75 62 20 2f 79 70 6f 73 | 20 65 78 63 68 20 64 65 |ub /ypos| exch de|
|00002700| 66 20 4c 4d 20 79 70 6f | 73 20 6d 6f 76 65 74 6f |f LM ypo|s moveto|
|00002710| 22 2c 0a 20 20 22 7d 20 | 64 65 66 22 2c 0a 20 20 |",. "} |def",. |
|00002720| 22 2f 70 72 73 74 72 20 | 7b 22 2c 0a 20 20 22 20 |"/prstr |{",. " |
|00002730| 20 20 20 64 75 70 20 73 | 74 72 69 6e 67 77 69 64 | dup s|tringwid|
|00002740| 74 68 20 70 6f 70 20 63 | 75 72 72 65 6e 74 70 6f |th pop c|urrentpo|
|00002750| 69 6e 74 20 70 6f 70 22 | 2c 0a 20 20 22 20 20 20 |int pop"|,. " |
|00002760| 20 61 64 64 20 52 4d 20 | 67 74 20 7b 63 72 6c 66 | add RM |gt {crlf|
|00002770| 7d 20 69 66 20 73 68 6f | 77 22 2c 0a 20 20 22 7d |} if sho|w",. "}|
|00002780| 20 64 65 66 22 2c 0a 20 | 20 22 2f 70 72 69 6e 74 | def",. | "/print|
|00002790| 6d 6f 6e 74 68 20 7b 22 | 2c 0a 20 20 20 28 63 68 |month {"|,. (ch|
|000027a0| 61 72 20 2a 29 30 2c 0a | 20 7d 3b 0a 20 0a 20 63 |ar *)0,.| };. . c|
|000027b0| 68 61 72 20 2a 68 65 61 | 64 65 72 5f 34 5b 5d 20 |har *hea|der_4[] |
|000027c0| 3d 20 7b 0a 20 20 22 5c | 74 2f 73 75 62 6d 6f 6e |= {. "\|t/submon|
|000027d0| 74 68 20 30 20 64 65 66 | 22 2c 0a 20 20 22 5c 74 |th 0 def|",. "\t|
|000027e0| 63 61 6c 65 6e 64 61 72 | 22 2c 0a 20 20 22 5c 74 |calendar|",. "\t|
|000027f0| 6d 6f 6e 74 68 20 31 20 | 73 75 62 20 30 20 65 71 |month 1 |sub 0 eq|
|00002800| 22 2c 0a 20 20 22 5c 74 | 7b 22 2c 0a 20 20 22 5c |",. "\t|{",. "\|
|00002810| 74 5c 74 2f 6c 6d 6f 6e | 74 68 20 31 32 20 64 65 |t\t/lmon|th 12 de|
|00002820| 66 22 2c 0a 20 20 22 5c | 74 5c 74 2f 6c 79 65 61 |f",. "\|t\t/lyea|
|00002830| 72 20 79 65 61 72 20 31 | 20 73 75 62 20 64 65 66 |r year 1| sub def|
|00002840| 22 2c 0a 20 20 22 5c 74 | 7d 22 2c 0a 20 20 22 5c |",. "\t|}",. "\|
|00002850| 74 7b 22 2c 0a 20 20 22 | 5c 74 5c 74 2f 6c 6d 6f |t{",. "|\t\t/lmo|
|00002860| 6e 74 68 20 6d 6f 6e 74 | 68 20 31 20 73 75 62 20 |nth mont|h 1 sub |
|00002870| 64 65 66 22 2c 0a 20 20 | 22 5c 74 5c 74 2f 6c 79 |def",. |"\t\t/ly|
|00002880| 65 61 72 20 79 65 61 72 | 20 64 65 66 22 2c 0a 20 |ear year| def",. |
|00002890| 20 22 5c 74 7d 20 69 66 | 65 6c 73 65 22 2c 0a 20 | "\t} if|else",. |
|000028a0| 20 22 5c 74 6d 6f 6e 74 | 68 20 31 20 61 64 64 20 | "\tmont|h 1 add |
|000028b0| 31 33 20 65 71 22 2c 0a | 20 20 22 5c 74 7b 22 2c |13 eq",.| "\t{",|
|000028c0| 0a 20 20 22 5c 74 5c 74 | 2f 6e 6d 6f 6e 74 68 20 |. "\t\t|/nmonth |
|000028d0| 31 20 64 65 66 22 2c 0a | 20 20 22 5c 74 5c 74 2f |1 def",.| "\t\t/|
|000028e0| 6e 79 65 61 72 20 79 65 | 61 72 20 31 20 61 64 64 |nyear ye|ar 1 add|
|000028f0| 20 64 65 66 22 2c 0a 20 | 20 22 5c 74 7d 20 22 2c | def",. | "\t} ",|
|00002900| 0a 20 20 22 5c 74 7b 22 | 2c 0a 20 20 22 5c 74 5c |. "\t{"|,. "\t\|
|00002910| 74 2f 6e 6d 6f 6e 74 68 | 20 6d 6f 6e 74 68 20 31 |t/nmonth| month 1|
|00002920| 20 61 64 64 20 64 65 66 | 22 2c 0a 20 20 22 5c 74 | add def|",. "\t|
|00002930| 5c 74 2f 6e 79 65 61 72 | 20 79 65 61 72 20 64 65 |\t/nyear| year de|
|00002940| 66 22 2c 0a 20 20 22 5c | 74 7d 20 69 66 65 6c 73 |f",. "\|t} ifels|
|00002950| 65 22 2c 0a 20 20 22 5c | 74 2f 73 61 76 65 6d 6f |e",. "\|t/savemo|
|00002960| 6e 74 68 20 6d 6f 6e 74 | 68 20 64 65 66 22 2c 0a |nth mont|h def",.|
|00002970| 20 20 22 5c 74 2f 73 61 | 76 65 79 65 61 72 20 79 | "\t/sa|veyear y|
|00002980| 65 61 72 20 64 65 66 22 | 2c 0a 20 20 22 5c 74 2f |ear def"|,. "\t/|
|00002990| 73 75 62 6d 6f 6e 74 68 | 20 31 20 64 65 66 22 2c |submonth| 1 def",|
|000029a0| 0a 20 20 22 5c 74 2f 79 | 65 61 72 20 6c 79 65 61 |. "\t/y|ear lyea|
|000029b0| 72 20 64 65 66 22 2c 0a | 20 20 22 5c 74 2f 6d 6f |r def",.| "\t/mo|
|000029c0| 6e 74 68 20 6c 6d 6f 6e | 74 68 20 64 65 66 22 2c |nth lmon|th def",|
|000029d0| 0a 20 20 22 5c 74 67 73 | 61 76 65 22 2c 0a 20 20 |. "\tgs|ave",. |
|000029e0| 22 5c 74 35 30 30 20 2d | 33 36 35 20 74 72 61 6e |"\t500 -|365 tran|
|000029f0| 73 6c 61 74 65 22 2c 0a | 20 20 22 5c 74 67 73 61 |slate",.| "\tgsa|
|00002a00| 76 65 22 2c 0a 20 20 22 | 5c 74 2e 31 33 38 20 2e |ve",. "|\t.138 .|
|00002a10| 31 33 38 20 73 63 61 6c | 65 22 2c 0a 20 20 22 5c |138 scal|e",. "\|
|00002a20| 74 31 30 20 2d 31 32 30 | 20 74 72 61 6e 73 6c 61 |t10 -120| transla|
|00002a30| 74 65 22 2c 0a 20 20 22 | 5c 74 63 61 6c 65 6e 64 |te",. "|\tcalend|
|00002a40| 61 72 22 2c 0a 20 20 22 | 5c 74 67 72 65 73 74 6f |ar",. "|\tgresto|
|00002a50| 72 65 22 2c 0a 20 20 22 | 5c 74 2f 73 75 62 6d 6f |re",. "|\t/submo|
|00002a60| 6e 74 68 20 31 20 64 65 | 66 22 2c 0a 20 20 22 5c |nth 1 de|f",. "\|
|00002a70| 74 2f 79 65 61 72 20 6e | 79 65 61 72 20 64 65 66 |t/year n|year def|
|00002a80| 22 2c 0a 20 20 22 5c 74 | 2f 6d 6f 6e 74 68 20 6e |",. "\t|/month n|
|00002a90| 6d 6f 6e 74 68 20 64 65 | 66 22 2c 0a 20 20 22 5c |month de|f",. "\|
|00002aa0| 74 31 30 30 20 30 20 74 | 72 61 6e 73 6c 61 74 65 |t100 0 t|ranslate|
|00002ab0| 22 2c 0a 20 20 22 5c 74 | 67 73 61 76 65 22 2c 0a |",. "\t|gsave",.|
|00002ac0| 20 20 22 5c 74 2e 31 33 | 38 20 2e 31 33 38 20 73 | "\t.13|8 .138 s|
|00002ad0| 63 61 6c 65 22 2c 0a 20 | 20 22 5c 74 31 30 20 2d |cale",. | "\t10 -|
|00002ae0| 31 32 30 20 74 72 61 6e | 73 6c 61 74 65 22 2c 0a |120 tran|slate",.|
|00002af0| 20 20 22 5c 74 63 61 6c | 65 6e 64 61 72 22 2c 0a | "\tcal|endar",.|
|00002b00| 20 20 22 5c 74 67 72 65 | 73 74 6f 72 65 22 2c 0a | "\tgre|store",.|
|00002b10| 20 20 22 5c 74 2f 6d 6f | 6e 74 68 20 73 61 76 65 | "\t/mo|nth save|
|00002b20| 6d 6f 6e 74 68 20 64 65 | 66 22 2c 0a 20 20 22 5c |month de|f",. "\|
|00002b30| 74 2f 79 65 61 72 20 73 | 61 76 65 79 65 61 72 20 |t/year s|aveyear |
|00002b40| 64 65 66 22 2c 0a 20 20 | 22 5c 74 2f 73 75 62 6d |def",. |"\t/subm|
|00002b50| 6f 6e 74 68 20 30 20 64 | 65 66 22 2c 0a 20 20 22 |onth 0 d|ef",. "|
|00002b60| 5c 74 67 72 65 73 74 6f | 72 65 22 2c 0a 20 20 22 |\tgresto|re",. "|
|00002b70| 7d 20 64 65 66 22 2c 0a | 20 20 28 63 68 61 72 20 |} def",.| (char |
|00002b80| 2a 29 30 2c 0a 7d 3b 0a | 0a 46 49 4c 45 20 2a 63 |*)0,.};.|.FILE *c|
|00002b90| 66 70 20 3d 20 4e 55 4c | 4c 3b 0a 69 6e 74 20 79 |fp = NUL|L;.int y|
|00002ba0| 65 61 72 3b 0a 69 6e 74 | 20 63 79 65 61 72 3b 0a |ear;.int| cyear;.|
|00002bb0| 0a 76 6f 69 64 20 65 78 | 69 74 28 29 3b 0a 63 68 |.void ex|it();.ch|
|00002bc0| 61 72 20 2a 67 65 74 65 | 6e 76 28 29 3b 0a 0a 6d |ar *gete|nv();..m|
|00002bd0| 61 69 6e 28 61 72 67 63 | 2c 20 61 72 67 76 29 0a |ain(argc|, argv).|
|00002be0| 69 6e 74 20 61 72 67 63 | 3b 0a 63 68 61 72 20 2a |int argc|;.char *|
|00002bf0| 2a 61 72 67 76 3b 0a 7b | 0a 09 65 78 74 65 72 6e |*argv;.{|..extern|
|00002c00| 20 63 68 61 72 20 2a 6f | 70 74 61 72 67 3b 0a 09 | char *o|ptarg;..|
|00002c10| 65 78 74 65 72 6e 20 69 | 6e 74 20 6f 70 74 69 6e |extern i|nt optin|
|00002c20| 64 3b 0a 09 72 65 67 69 | 73 74 65 72 20 73 74 72 |d;..regi|ster str|
|00002c30| 75 63 74 20 74 6d 20 2a | 6c 74 3b 0a 09 72 65 67 |uct tm *|lt;..reg|
|00002c40| 69 73 74 65 72 20 63 68 | 61 72 20 2a 2a 61 70 3b |ister ch|ar **ap;|
|00002c50| 0a 09 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 |..regist|er char |
|00002c60| 2a 63 70 3b 0a 09 63 68 | 61 72 20 2a 63 66 69 6c |*cp;..ch|ar *cfil|
|00002c70| 65 20 3d 20 4e 55 4c 4c | 3b 0a 09 63 68 61 72 20 |e = NULL|;..char |
|00002c80| 63 62 75 66 5b 38 30 5d | 3b 0a 09 6c 6f 6e 67 20 |cbuf[80]|;..long |
|00002c90| 74 2c 20 74 69 6d 65 28 | 29 3b 0a 09 69 6e 74 20 |t, time(|);..int |
|00002ca0| 65 72 72 66 6c 67 20 3d | 20 30 3b 0a 09 69 6e 74 |errflg =| 0;..int|
|00002cb0| 20 6e 6f 63 61 6c 20 3d | 20 30 3b 0a 09 69 6e 74 | nocal =| 0;..int|
|00002cc0| 20 73 61 74 20 3d 20 30 | 3b 0a 09 63 68 61 72 20 | sat = 0|;..char |
|00002cd0| 2a 74 69 74 6c 65 66 6f | 6e 74 20 3d 20 22 54 69 |*titlefo|nt = "Ti|
|00002ce0| 6d 65 73 2d 42 6f 6c 64 | 22 3b 0a 20 09 63 68 61 |mes-Bold|";. .cha|
|00002cf0| 72 20 2a 64 61 79 66 6f | 6e 74 20 3d 20 22 54 69 |r *dayfo|nt = "Ti|
|00002d00| 6d 65 73 2d 42 6f 6c 64 | 22 3b 0a 20 09 69 6e 74 |mes-Bold|";. .int|
|00002d10| 20 72 6f 74 61 74 65 20 | 3d 20 39 30 3b 0a 20 09 | rotate |= 90;. .|
|00002d20| 69 6e 74 20 6d 6f 6e 74 | 68 20 3d 20 30 3b 0a 09 |int mont|h = 0;..|
|00002d30| 69 6e 74 20 6d 3b 0a 09 | 63 68 61 72 20 64 6f 79 |int m;..|char doy|
|00002d40| 65 61 72 20 3d 20 30 3b | 0a 0a 23 64 65 66 69 6e |ear = 0;|..#defin|
|00002d50| 65 20 44 4f 48 45 41 44 | 45 52 28 70 68 64 72 29 |e DOHEAD|ER(phdr)|
|00002d60| 20 66 6f 72 28 61 70 20 | 3d 20 70 68 64 72 3b 20 | for(ap |= phdr; |
|00002d70| 2a 61 70 3b 20 61 70 2b | 2b 29 20 50 52 54 28 22 |*ap; ap+|+) PRT("|
|00002d80| 25 73 5c 6e 22 2c 20 2a | 61 70 29 3b 0a 0a 09 77 |%s\n", *|ap);...w|
|00002d90| 68 69 6c 65 20 28 28 6d | 20 3d 20 67 65 74 6f 70 |hile ((m| = getop|
|00002da0| 74 28 61 72 67 63 2c 20 | 61 72 67 76 2c 20 22 64 |t(argc, |argv, "d|
|00002db0| 3a 65 66 3a 6d 3a 72 73 | 74 3a 79 3a 22 29 29 20 |:ef:m:rs|t:y:")) |
|00002dc0| 21 3d 20 45 4f 46 29 0a | 0a 09 09 73 77 69 74 63 |!= EOF).|...switc|
|00002dd0| 68 20 28 6d 29 20 7b 0a | 0a 09 09 63 61 73 65 20 |h (m) {.|...case |
|00002de0| 27 64 27 3a 09 09 2f 2a | 20 73 65 6c 65 63 74 20 |'d':../*| select |
|00002df0| 66 6f 6e 74 20 66 6f 72 | 20 64 61 79 20 6e 61 6d |font for| day nam|
|00002e00| 65 73 2f 6e 75 6d 62 65 | 72 73 20 2a 2f 0a 09 09 |es/numbe|rs */...|
|00002e10| 09 64 61 79 66 6f 6e 74 | 20 3d 20 6f 70 74 61 72 |.dayfont| = optar|
|00002e20| 67 3b 0a 09 09 09 62 72 | 65 61 6b 3b 0a 0a 09 09 |g;....br|eak;....|
|00002e30| 63 61 73 65 20 27 65 27 | 3a 09 09 2f 2a 20 70 72 |case 'e'|:../* pr|
|00002e40| 69 6e 74 20 65 6d 70 74 | 79 20 63 61 6c 65 6e 64 |int empt|y calend|
|00002e50| 61 72 20 2a 2f 0a 09 09 | 09 6e 6f 63 61 6c 2b 2b |ar */...|.nocal++|
|00002e60| 3b 0a 09 09 09 63 66 69 | 6c 65 20 3d 20 4e 55 4c |;....cfi|le = NUL|
|00002e70| 4c 3b 0a 09 09 09 62 72 | 65 61 6b 3b 0a 0a 09 09 |L;....br|eak;....|
|00002e80| 63 61 73 65 20 27 66 27 | 3a 09 09 2f 2a 20 75 73 |case 'f'|:../* us|
|00002e90| 65 20 61 6c 74 65 72 6e | 61 74 65 20 63 61 6c 65 |e altern|ate cale|
|00002ea0| 6e 64 61 72 20 66 69 6c | 65 20 2a 2f 0a 09 09 09 |ndar fil|e */....|
|00002eb0| 63 66 69 6c 65 20 3d 20 | 6f 70 74 61 72 67 3b 0a |cfile = |optarg;.|
|00002ec0| 09 09 09 6e 6f 63 61 6c | 20 3d 20 30 3b 0a 09 09 |...nocal| = 0;...|
|00002ed0| 09 62 72 65 61 6b 3b 0a | 0a 09 09 63 61 73 65 20 |.break;.|...case |
|00002ee0| 27 6d 27 3a 09 09 2f 2a | 20 73 65 6c 65 63 74 20 |'m':../*| select |
|00002ef0| 6d 6f 6e 74 68 20 2a 2f | 0a 09 09 09 6d 6f 6e 74 |month */|....mont|
|00002f00| 68 20 3d 20 61 74 6f 69 | 28 6f 70 74 61 72 67 29 |h = atoi|(optarg)|
|00002f10| 3b 0a 09 09 09 69 66 20 | 28 21 6d 6f 6e 74 68 29 |;....if |(!month)|
|00002f20| 20 64 6f 79 65 61 72 20 | 3d 20 31 3b 0a 09 09 09 | doyear |= 1;....|
|00002f30| 62 72 65 61 6b 3b 0a 0a | 09 09 63 61 73 65 20 27 |break;..|..case '|
|00002f40| 72 27 3a 09 09 2f 2a 20 | 67 65 6e 65 72 61 74 65 |r':../* |generate|
|00002f50| 20 70 6f 72 74 72 61 69 | 74 20 63 61 6c 65 6e 64 | portrai|t calend|
|00002f60| 61 72 20 2a 2f 0a 09 09 | 09 72 6f 74 61 74 65 20 |ar */...|.rotate |
|00002f70| 3d 20 30 3b 0a 09 09 09 | 62 72 65 61 6b 3b 0a 0a |= 0;....|break;..|
|00002f80| 09 09 63 61 73 65 20 27 | 73 27 3a 09 09 2f 2a 20 |..case '|s':../* |
|00002f90| 70 72 69 6e 74 20 53 61 | 74 75 72 64 61 79 73 20 |print Sa|turdays |
|00002fa0| 69 6e 20 62 6c 61 63 6b | 20 2a 2f 0a 09 09 09 73 |in black| */....s|
|00002fb0| 61 74 2b 2b 3b 0a 09 09 | 09 62 72 65 61 6b 3b 0a |at++;...|.break;.|
|00002fc0| 0a 09 09 63 61 73 65 20 | 27 74 27 3a 09 09 2f 2a |...case |'t':../*|
|00002fd0| 20 73 65 6c 65 63 74 20 | 66 6f 6e 74 20 66 6f 72 | select |font for|
|00002fe0| 20 6d 6f 6e 74 68 2f 79 | 65 61 72 20 2a 2f 0a 09 | month/y|ear */..|
|00002ff0| 09 09 74 69 74 6c 65 66 | 6f 6e 74 20 3d 20 6f 70 |..titlef|ont = op|
|00003000| 74 61 72 67 3b 0a 09 09 | 09 62 72 65 61 6b 3b 0a |targ;...|.break;.|
|00003010| 0a 09 09 63 61 73 65 20 | 27 79 27 3a 09 09 2f 2a |...case |'y':../*|
|00003020| 20 73 65 6c 65 63 74 20 | 79 65 61 72 20 2a 2f 0a | select |year */.|
|00003030| 09 09 09 79 65 61 72 20 | 3d 20 61 74 6f 69 28 6f |...year |= atoi(o|
|00003040| 70 74 61 72 67 29 3b 0a | 09 09 09 69 66 20 28 79 |ptarg);.|...if (y|
|00003050| 65 61 72 20 26 26 20 79 | 65 61 72 20 3c 20 31 39 |ear && y|ear < 19|
|00003060| 30 30 29 20 79 65 61 72 | 20 3d 20 79 65 61 72 20 |00) year| = year |
|00003070| 25 20 31 30 30 20 2b 20 | 31 39 30 30 3b 0a 09 09 |% 100 + |1900;...|
|00003080| 09 62 72 65 61 6b 3b 0a | 0a 09 09 63 61 73 65 20 |.break;.|...case |
|00003090| 27 3f 27 3a 0a 09 09 09 | 65 72 72 66 6c 67 20 3d |'?':....|errflg =|
|000030a0| 20 31 3b 0a 09 09 09 62 | 72 65 61 6b 3b 0a 09 09 | 1;....b|reak;...|
|000030b0| 7d 0a 0a 09 69 66 20 28 | 65 72 72 66 6c 67 29 20 |}...if (|errflg) |
|000030c0| 7b 0a 09 09 46 50 52 28 | 73 74 64 65 72 72 2c 0a |{...FPR(|stderr,.|
|000030d0| 09 09 09 22 55 73 61 67 | 65 3a 20 70 63 61 6c 20 |..."Usag|e: pcal |
|000030e0| 5b 20 2d 72 20 5d 20 5b | 20 2d 73 20 5d 20 5b 20 |[ -r ] [| -s ] [ |
|000030f0| 2d 65 20 7c 20 2d 66 20 | 3c 63 61 6c 3e 20 5d 20 |-e | -f |<cal> ] |
|00003100| 5b 20 2d 6d 20 6d 6f 6e | 74 68 5d 20 5b 20 2d 79 |[ -m mon|th] [ -y|
|00003110| 20 3c 79 65 61 72 3e 20 | 5d 5c 6e 22 29 3b 0a 09 | <year> |]\n");..|
|00003120| 09 46 50 52 28 73 74 64 | 65 72 72 2c 20 0a 09 09 |.FPR(std|err, ...|
|00003130| 09 22 5c 74 5c 74 5b 20 | 2d 74 20 3c 74 69 74 6c |."\t\t[ |-t <titl|
|00003140| 65 20 66 6f 6e 74 3e 20 | 5d 20 5b 20 2d 64 20 3c |e font> |] [ -d <|
|00003150| 64 61 79 20 66 6f 6e 74 | 3e 20 5d 5c 6e 22 29 3b |day font|> ]\n");|
|00003160| 0a 09 09 65 78 69 74 28 | 31 29 3b 0a 09 7d 0a 09 |...exit(|1);..}..|
|00003170| 74 20 3d 20 74 69 6d 65 | 28 28 6c 6f 6e 67 20 2a |t = time|((long *|
|00003180| 29 30 29 3b 0a 09 6c 74 | 20 3d 20 6c 6f 63 61 6c |)0);..lt| = local|
|00003190| 74 69 6d 65 28 26 74 29 | 3b 0a 0a 09 69 66 20 28 |time(&t)|;...if (|
|000031a0| 21 6d 6f 6e 74 68 20 26 | 26 20 21 64 6f 79 65 61 |!month &|& !doyea|
|000031b0| 72 29 0a 09 09 6d 6f 6e | 74 68 20 3d 20 6c 74 2d |r)...mon|th = lt-|
|000031c0| 3e 74 6d 5f 6d 6f 6e 20 | 2b 20 31 3b 0a 09 69 66 |>tm_mon |+ 1;..if|
|000031d0| 20 28 21 79 65 61 72 29 | 0a 09 09 79 65 61 72 20 | (!year)|...year |
|000031e0| 3d 20 6c 74 2d 3e 74 6d | 5f 79 65 61 72 20 2b 20 |= lt->tm|_year + |
|000031f0| 31 39 30 30 3b 0a 0a 09 | 2f 2a 0a 09 20 2a 20 49 |1900;...|/*.. * I|
|00003200| 6e 20 63 61 73 65 20 77 | 65 20 64 6f 6e 27 74 20 |n case w|e don't |
|00003210| 65 6e 63 6f 75 6e 74 65 | 72 20 61 6e 79 20 79 65 |encounte|r any ye|
|00003220| 61 72 20 64 61 74 61 20 | 69 6e 20 74 68 65 0a 09 |ar data |in the..|
|00003230| 20 2a 20 63 61 6c 65 6e | 64 61 72 20 66 69 6c 65 | * calen|dar file|
|00003240| 2c 20 61 73 73 75 6d 65 | 20 74 68 65 20 63 75 72 |, assume| the cur|
|00003250| 72 65 6e 74 20 79 65 61 | 72 2e 0a 09 20 2a 2f 0a |rent yea|r... */.|
|00003260| 09 63 79 65 61 72 20 3d | 20 79 65 61 72 3b 0a 0a |.cyear =| year;..|
|00003270| 09 2f 2a 0a 09 20 2a 20 | 4f 70 65 6e 20 61 20 73 |./*.. * |Open a s|
|00003280| 75 70 70 6c 69 65 64 20 | 63 61 6c 65 6e 64 61 72 |upplied |calendar|
|00003290| 20 66 69 6c 65 20 28 69 | 66 20 61 6e 79 29 0a 09 | file (i|f any)..|
|000032a0| 20 2a 2f 0a 09 69 66 20 | 28 63 66 69 6c 65 20 21 | */..if |(cfile !|
|000032b0| 3d 20 4e 55 4c 4c 29 20 | 7b 0a 09 09 69 66 20 28 |= NULL) |{...if (|
|000032c0| 28 63 66 70 20 3d 20 66 | 6f 70 65 6e 28 63 66 69 |(cfp = f|open(cfi|
|000032d0| 6c 65 2c 20 22 72 22 29 | 29 20 3d 3d 20 4e 55 4c |le, "r")|) == NUL|
|000032e0| 4c 29 20 7b 0a 09 09 09 | 46 50 52 28 73 74 64 65 |L) {....|FPR(stde|
|000032f0| 72 72 2c 20 22 70 63 61 | 6c 3a 20 63 61 6e 27 74 |rr, "pca|l: can't|
|00003300| 20 6f 70 65 6e 20 66 69 | 6c 65 3a 20 25 73 5c 6e | open fi|le: %s\n|
|00003310| 22 2c 20 63 66 69 6c 65 | 29 3b 0a 09 09 09 65 78 |", cfile|);....ex|
|00003320| 69 74 28 31 29 3b 0a 09 | 09 7d 0a 09 7d 0a 09 2f |it(1);..|.}..}../|
|00003330| 2a 0a 09 20 2a 20 45 6c | 73 65 20 73 65 65 20 69 |*.. * El|se see i|
|00003340| 66 20 61 20 63 61 6c 65 | 6e 64 61 72 20 66 69 6c |f a cale|ndar fil|
|00003350| 65 20 65 78 69 73 74 73 | 20 69 6e 20 74 68 65 20 |e exists| in the |
|00003360| 68 6f 6d 65 20 64 69 72 | 65 63 74 6f 72 79 0a 09 |home dir|ectory..|
|00003370| 20 2a 2f 0a 09 65 6c 73 | 65 20 69 66 20 28 6e 6f | */..els|e if (no|
|00003380| 63 61 6c 20 3d 3d 20 30 | 20 26 26 20 28 63 70 20 |cal == 0| && (cp |
|00003390| 3d 20 67 65 74 65 6e 76 | 28 22 48 4f 4d 45 22 29 |= getenv|("HOME")|
|000033a0| 29 20 21 3d 20 4e 55 4c | 4c 29 20 7b 0a 09 09 28 |) != NUL|L) {...(|
|000033b0| 76 6f 69 64 29 73 74 72 | 63 70 79 28 63 62 75 66 |void)str|cpy(cbuf|
|000033c0| 2c 20 63 70 29 3b 0a 09 | 09 28 76 6f 69 64 29 73 |, cp);..|.(void)s|
|000033d0| 74 72 63 61 74 28 63 62 | 75 66 2c 20 22 2f 63 61 |trcat(cb|uf, "/ca|
|000033e0| 6c 65 6e 64 61 72 22 29 | 3b 0a 09 09 63 66 70 20 |lendar")|;...cfp |
|000033f0| 3d 20 66 6f 70 65 6e 28 | 63 62 75 66 2c 20 22 72 |= fopen(|cbuf, "r|
|00003400| 22 29 3b 0a 09 7d 0a 0a | 09 2f 2a 0a 09 20 2a 20 |");..}..|./*.. * |
|00003410| 57 72 69 74 65 20 6f 75 | 74 20 50 6f 73 74 53 63 |Write ou|t PostSc|
|00003420| 72 69 70 74 20 70 72 6f | 6c 6f 67 0a 09 20 2a 2f |ript pro|log.. */|
|00003430| 0a 20 09 50 52 54 28 22 | 25 25 21 5c 6e 22 29 3b |. .PRT("|%%!\n");|
|00003440| 0a 20 09 50 52 54 28 22 | 2f 74 69 74 6c 65 66 6f |. .PRT("|/titlefo|
|00003450| 6e 74 20 2f 25 73 20 64 | 65 66 5c 6e 2f 64 61 79 |nt /%s d|ef\n/day|
|00003460| 66 6f 6e 74 20 2f 25 73 | 20 64 65 66 5c 6e 22 2c |font /%s| def\n",|
|00003470| 20 74 69 74 6c 65 66 6f | 6e 74 2c 20 64 61 79 66 | titlefo|nt, dayf|
|00003480| 6f 6e 74 29 3b 0a 0a 09 | 44 4f 48 45 41 44 45 52 |ont);...|DOHEADER|
|00003490| 28 68 65 61 64 65 72 5f | 31 29 3b 0a 09 69 66 20 |(header_|1);..if |
|000034a0| 28 73 61 74 20 3d 3d 20 | 30 29 0a 09 09 44 4f 48 |(sat == |0)...DOH|
|000034b0| 45 41 44 45 52 28 68 65 | 61 64 65 72 5f 32 29 3b |EADER(he|ader_2);|
|000034c0| 0a 09 44 4f 48 45 41 44 | 45 52 28 68 65 61 64 65 |..DOHEAD|ER(heade|
|000034d0| 72 5f 33 29 3b 0a 0a 20 | 09 50 52 54 28 22 5c 74 |r_3);.. |.PRT("\t|
|000034e0| 25 64 20 72 6f 74 61 74 | 65 5c 6e 22 2c 20 72 6f |%d rotat|e\n", ro|
|000034f0| 74 61 74 65 29 3b 0a 20 | 09 69 66 20 28 72 6f 74 |tate);. |.if (rot|
|00003500| 61 74 65 29 0a 20 09 09 | 50 52 54 28 22 5c 74 35 |ate). ..|PRT("\t5|
|00003510| 30 20 2d 31 32 30 20 74 | 72 61 6e 73 6c 61 74 65 |0 -120 t|ranslate|
|00003520| 5c 6e 22 29 3b 0a 20 09 | 65 6c 73 65 0a 20 09 09 |\n");. .|else. ..|
|00003530| 50 52 54 28 22 5c 74 30 | 2e 37 35 20 30 2e 37 35 |PRT("\t0|.75 0.75|
|00003540| 20 73 63 61 6c 65 5c 6e | 5c 74 35 30 20 34 36 30 | scale\n|\t50 460|
|00003550| 20 74 72 61 6e 73 6c 61 | 74 65 5c 6e 22 29 3b 0a | transla|te\n");.|
|00003560| 0a 09 44 4f 48 45 41 44 | 45 52 28 68 65 61 64 65 |..DOHEAD|ER(heade|
|00003570| 72 5f 34 29 3b 0a 0a 09 | 69 66 20 28 6d 6f 6e 74 |r_4);...|if (mont|
|00003580| 68 29 0a 09 09 70 6d 6f | 6e 74 68 28 6d 6f 6e 74 |h)...pmo|nth(mont|
|00003590| 68 29 3b 0a 09 65 6c 73 | 65 0a 09 09 66 6f 72 20 |h);..els|e...for |
|000035a0| 28 6d 6f 6e 74 68 20 3d | 20 31 3b 20 6d 6f 6e 74 |(month =| 1; mont|
|000035b0| 68 20 3c 3d 20 31 32 3b | 20 6d 6f 6e 74 68 2b 2b |h <= 12;| month++|
|000035c0| 29 0a 09 09 09 70 6d 6f | 6e 74 68 28 6d 6f 6e 74 |)....pmo|nth(mont|
|000035d0| 68 29 3b 0a 0a 09 65 78 | 69 74 28 30 29 3b 0a 7d |h);...ex|it(0);.}|
|000035e0| 0a 0a 2f 2a 0a 20 2a 20 | 42 72 6f 77 73 65 20 74 |../*. * |Browse t|
|000035f0| 68 72 6f 75 67 68 20 74 | 68 65 20 63 61 6c 65 6e |hrough t|he calen|
|00003600| 64 61 72 20 66 69 6c 65 | 20 6c 6f 6f 6b 69 6e 67 |dar file| looking|
|00003610| 20 66 6f 72 20 64 61 79 | 20 69 6e 66 6f 20 69 6e | for day| info in|
|00003620| 20 63 75 72 72 65 6e 74 | 20 6d 6f 6e 74 68 0a 20 | current| month. |
|00003630| 2a 2f 0a 66 69 6e 64 5f | 64 61 79 74 65 78 74 28 |*/.find_|daytext(|
|00003640| 6d 29 0a 69 6e 74 20 6d | 3b 0a 7b 0a 09 72 65 67 |m).int m|;.{..reg|
|00003650| 69 73 74 65 72 20 63 68 | 61 72 20 2a 2a 73 3b 0a |ister ch|ar **s;.|
|00003660| 09 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 6f 6c |.registe|r int ol|
|00003670| 64 64 61 79 20 3d 20 2d | 31 3b 0a 09 72 65 67 69 |dday = -|1;..regi|
|00003680| 73 74 65 72 20 69 6e 74 | 20 64 61 79 3b 0a 09 69 |ster int| day;..i|
|00003690| 6e 74 20 72 65 73 65 74 | 3b 0a 0a 09 66 6f 72 20 |nt reset|;...for |
|000036a0| 28 72 65 73 65 74 20 3d | 20 31 3b 20 28 64 61 79 |(reset =| 1; (day|
|000036b0| 20 3d 20 67 65 74 64 61 | 79 28 6d 2c 20 72 65 73 | = getda|y(m, res|
|000036c0| 65 74 29 29 20 21 3d 20 | 30 3b 20 72 65 73 65 74 |et)) != |0; reset|
|000036d0| 20 3d 20 30 29 0a 09 09 | 69 66 20 28 2a 77 6f 72 | = 0)...|if (*wor|
|000036e0| 64 73 29 20 7b 0a 09 09 | 09 64 61 79 20 26 3d 20 |ds) {...|.day &= |
|000036f0| 7e 48 4f 4c 49 44 41 59 | 3b 0a 09 09 09 69 66 20 |~HOLIDAY|;....if |
|00003700| 28 64 61 79 20 21 3d 20 | 6f 6c 64 64 61 79 29 20 |(day != |oldday) |
|00003710| 7b 0a 09 09 09 09 69 66 | 20 28 6f 6c 64 64 61 79 |{.....if| (oldday|
|00003720| 20 3d 3d 20 2d 31 29 0a | 09 09 09 09 09 50 52 54 | == -1).|.....PRT|
|00003730| 28 22 25 64 20 5b 20 5c | 6e 22 2c 20 64 61 79 29 |("%d [ \|n", day)|
|00003740| 3b 0a 09 09 09 09 65 6c | 73 65 0a 09 09 09 09 09 |;.....el|se......|
|00003750| 50 52 54 28 22 5d 20 64 | 61 79 74 65 78 74 5c 6e |PRT("] d|aytext\n|
|00003760| 25 64 20 5b 20 5c 6e 22 | 2c 20 64 61 79 29 3b 0a |%d [ \n"|, day);.|
|00003770| 09 09 09 09 6f 6c 64 64 | 61 79 20 3d 20 64 61 79 |....oldd|ay = day|
|00003780| 3b 0a 09 09 09 7d 20 65 | 6c 73 65 0a 09 09 09 09 |;....} e|lse.....|
|00003790| 50 52 54 28 22 28 2e 70 | 29 5c 6e 22 29 3b 0a 09 |PRT("(.p|)\n");..|
|000037a0| 09 09 66 6f 72 20 28 73 | 20 3d 20 77 6f 72 64 73 |..for (s| = words|
|000037b0| 3b 20 2a 73 3b 20 73 2b | 2b 29 0a 09 09 09 09 50 |; *s; s+|+).....P|
|000037c0| 52 54 28 22 28 25 73 29 | 5c 6e 22 2c 20 2a 73 29 |RT("(%s)|\n", *s)|
|000037d0| 3b 0a 09 09 7d 0a 0a 09 | 69 66 20 28 6f 6c 64 64 |;...}...|if (oldd|
|000037e0| 61 79 20 21 3d 20 2d 31 | 29 09 09 2f 2a 20 74 65 |ay != -1|)../* te|
|000037f0| 72 6d 69 6e 61 74 65 20 | 63 61 6c 6c 20 74 6f 20 |rminate |call to |
|00003800| 64 61 79 74 65 78 74 20 | 2a 2f 0a 09 09 50 52 54 |daytext |*/...PRT|
|00003810| 28 22 5d 20 64 61 79 74 | 65 78 74 5c 6e 22 29 3b |("] dayt|ext\n");|
|00003820| 0a 7d 0a 0a 0a 2f 2a 0a | 20 2a 20 42 72 6f 77 73 |.}.../*.| * Brows|
|00003830| 65 20 74 68 72 6f 75 67 | 68 20 74 68 65 20 63 61 |e throug|h the ca|
|00003840| 6c 65 6e 64 61 72 20 66 | 69 6c 65 20 6c 6f 6f 6b |lendar f|ile look|
|00003850| 69 6e 67 20 66 6f 72 20 | 68 6f 6c 69 64 61 79 73 |ing for |holidays|
|00003860| 20 69 6e 20 63 75 72 72 | 65 6e 74 20 6d 6f 6e 74 | in curr|ent mont|
|00003870| 68 0a 20 2a 2f 0a 66 69 | 6e 64 5f 68 6f 6c 69 64 |h. */.fi|nd_holid|
|00003880| 61 79 73 28 6d 29 0a 69 | 6e 74 20 6d 3b 0a 7b 0a |ays(m).i|nt m;.{.|
|00003890| 09 72 65 67 69 73 74 65 | 72 20 69 6e 74 20 6f 6c |.registe|r int ol|
|000038a0| 64 64 61 79 20 3d 20 2d | 31 3b 0a 09 72 65 67 69 |dday = -|1;..regi|
|000038b0| 73 74 65 72 20 69 6e 74 | 20 64 61 79 3b 0a 09 69 |ster int| day;..i|
|000038c0| 6e 74 20 72 65 73 65 74 | 3b 0a 0a 09 50 52 54 28 |nt reset|;...PRT(|
|000038d0| 22 2f 68 6f 6c 69 64 61 | 79 73 20 5b 22 29 3b 09 |"/holida|ys [");.|
|000038e0| 2f 2a 20 73 74 61 72 74 | 20 64 65 66 69 6e 69 74 |/* start| definit|
|000038f0| 69 6f 6e 20 6f 66 20 6c | 69 73 74 20 2a 2f 0a 0a |ion of l|ist */..|
|00003900| 09 66 6f 72 20 28 72 65 | 73 65 74 20 3d 20 31 3b |.for (re|set = 1;|
|00003910| 20 28 64 61 79 20 3d 20 | 67 65 74 64 61 79 28 6d | (day = |getday(m|
|00003920| 2c 20 72 65 73 65 74 29 | 29 20 21 3d 20 30 3b 20 |, reset)|) != 0; |
|00003930| 72 65 73 65 74 20 3d 20 | 30 29 0a 09 09 69 66 20 |reset = |0)...if |
|00003940| 28 64 61 79 20 26 20 48 | 4f 4c 49 44 41 59 29 20 |(day & H|OLIDAY) |
|00003950| 7b 0a 09 09 09 64 61 79 | 20 26 3d 20 7e 48 4f 4c |{....day| &= ~HOL|
|00003960| 49 44 41 59 3b 0a 09 09 | 09 69 66 20 28 64 61 79 |IDAY;...|.if (day|
|00003970| 20 21 3d 20 6f 6c 64 64 | 61 79 29 20 7b 0a 09 09 | != oldd|ay) {...|
|00003980| 09 09 50 52 54 28 22 20 | 25 64 22 2c 20 64 61 79 |..PRT(" |%d", day|
|00003990| 29 3b 0a 09 09 09 09 6f | 6c 64 64 61 79 20 3d 20 |);.....o|ldday = |
|000039a0| 64 61 79 3b 0a 09 09 09 | 7d 0a 09 09 7d 0a 0a 09 |day;....|}...}...|
|000039b0| 50 52 54 28 22 20 39 39 | 20 5d 20 64 65 66 5c 6e |PRT(" 99| ] def\n|
|000039c0| 22 29 3b 09 2f 2a 20 74 | 65 72 6d 69 6e 61 74 65 |");./* t|erminate|
|000039d0| 20 77 69 74 68 20 64 75 | 6d 6d 79 20 65 6e 74 72 | with du|mmy entr|
|000039e0| 79 20 2a 2f 0a 7d 0a 0a | 0a 2f 2a 0a 20 2a 20 70 |y */.}..|./*. * p|
|000039f0| 6d 6f 6e 74 68 20 2d 20 | 64 6f 20 63 61 6c 65 6e |month - |do calen|
|00003a00| 64 61 72 20 66 6f 72 20 | 6d 6f 6e 74 68 20 22 6d |dar for |month "m|
|00003a10| 22 0a 20 2a 2f 0a 70 6d | 6f 6e 74 68 28 6d 29 0a |". */.pm|onth(m).|
|00003a20| 69 6e 74 20 6d 3b 0a 7b | 0a 0a 09 50 52 54 28 22 |int m;.{|...PRT("|
|00003a30| 2f 79 65 61 72 20 25 64 | 20 64 65 66 5c 6e 22 2c |/year %d| def\n",|
|00003a40| 20 79 65 61 72 29 3b 09 | 2f 2a 20 73 65 74 20 75 | year);.|/* set u|
|00003a50| 70 20 79 65 61 72 20 61 | 6e 64 20 6d 6f 6e 74 68 |p year a|nd month|
|00003a60| 20 2a 2f 0a 09 50 52 54 | 28 22 2f 6d 6f 6e 74 68 | */..PRT|("/month|
|00003a70| 20 25 64 20 64 65 66 5c | 6e 22 2c 20 6d 29 3b 0a | %d def\|n", m);.|
|00003a80| 09 66 69 6e 64 5f 68 6f | 6c 69 64 61 79 73 28 6d |.find_ho|lidays(m|
|00003a90| 29 3b 09 09 2f 2a 20 66 | 69 72 73 74 20 70 61 73 |);../* f|irst pas|
|00003aa0| 73 20 2d 20 6d 61 6b 65 | 20 6c 69 73 74 20 6f 66 |s - make| list of|
|00003ab0| 20 68 6f 6c 69 64 61 79 | 73 20 2a 2f 0a 09 50 52 | holiday|s */..PR|
|00003ac0| 54 28 22 70 72 69 6e 74 | 6d 6f 6e 74 68 5c 6e 22 |T("print|month\n"|
|00003ad0| 29 3b 0a 09 66 69 6e 64 | 5f 64 61 79 74 65 78 74 |);..find|_daytext|
|00003ae0| 28 6d 29 3b 09 09 2f 2a | 20 73 65 63 6f 6e 64 20 |(m);../*| second |
|00003af0| 70 61 73 73 20 2d 20 61 | 64 64 20 74 65 78 74 20 |pass - a|dd text |
|00003b00| 74 6f 20 62 6f 78 65 73 | 20 2a 2f 0a 09 50 52 54 |to boxes| */..PRT|
|00003b10| 28 22 73 68 6f 77 70 61 | 67 65 5c 6e 22 29 3b 0a |("showpa|ge\n");.|
|00003b20| 7d 0a 0a 0a 2f 2a 0a 20 | 2a 20 67 65 74 64 61 79 |}.../*. |* getday|
|00003b30| 20 2d 20 66 69 6e 64 20 | 6e 65 78 74 20 64 61 79 | - find |next day|
|00003b40| 20 65 6e 74 72 79 20 66 | 6f 72 20 64 65 73 69 72 | entry f|or desir|
|00003b50| 65 64 20 6d 6f 6e 74 68 | 20 69 6e 20 74 68 65 20 |ed month| in the |
|00003b60| 63 61 6c 65 6e 64 61 72 | 20 66 69 6c 65 0a 20 2a |calendar| file. *|
|00003b70| 2f 0a 69 6e 74 20 67 65 | 74 64 61 79 28 6d 2c 20 |/.int ge|tday(m, |
|00003b80| 72 65 73 65 74 29 0a 72 | 65 67 69 73 74 65 72 20 |reset).r|egister |
|00003b90| 69 6e 74 20 6d 3b 0a 69 | 6e 74 20 72 65 73 65 74 |int m;.i|nt reset|
|00003ba0| 3b 0a 7b 0a 09 73 74 61 | 74 69 63 20 65 6f 66 20 |;.{..sta|tic eof |
|00003bb0| 3d 20 30 3b 0a 09 72 65 | 67 69 73 74 65 72 20 63 |= 0;..re|gister c|
|00003bc0| 68 61 72 20 2a 63 70 3b | 0a 09 72 65 67 69 73 74 |har *cp;|..regist|
|00003bd0| 65 72 20 63 3b 0a 0a 09 | 69 66 20 28 63 66 70 20 |er c;...|if (cfp |
|00003be0| 3d 3d 20 4e 55 4c 4c 29 | 09 2f 2a 20 77 68 6f 6f |== NULL)|./* whoo|
|00003bf0| 70 73 2c 20 6e 6f 20 63 | 61 6c 65 6e 64 61 72 20 |ps, no c|alendar |
|00003c00| 66 69 6c 65 20 2a 2f 0a | 09 09 72 65 74 75 72 6e |file */.|..return|
|00003c10| 28 30 29 3b 0a 0a 09 69 | 66 20 28 72 65 73 65 74 |(0);...i|f (reset|
|00003c20| 29 20 7b 09 09 2f 2a 20 | 6e 65 77 20 6d 6f 6e 74 |) {../* |new mont|
|00003c30| 68 2c 20 72 65 77 69 6e | 64 20 2a 2f 0a 09 09 72 |h, rewin|d */...r|
|00003c40| 65 77 69 6e 64 28 63 66 | 70 29 3b 0a 09 09 65 6f |ewind(cf|p);...eo|
|00003c50| 66 20 3d 20 30 3b 0a 09 | 7d 0a 09 69 66 20 28 65 |f = 0;..|}..if (e|
|00003c60| 6f 66 29 0a 09 09 72 65 | 74 75 72 6e 28 30 29 3b |of)...re|turn(0);|
|00003c70| 0a 6e 65 78 74 6c 69 6e | 65 3a 0a 09 63 70 20 3d |.nextlin|e:..cp =|
|00003c80| 20 6c 62 75 66 3b 0a 09 | 64 6f 20 7b 0a 09 09 77 | lbuf;..|do {...w|
|00003c90| 68 69 6c 65 20 28 28 63 | 20 3d 20 67 65 74 63 28 |hile ((c| = getc(|
|00003ca0| 63 66 70 29 29 20 21 3d | 20 27 5c 6e 27 20 26 26 |cfp)) !=| '\n' &&|
|00003cb0| 20 63 20 21 3d 20 45 4f | 46 29 20 7b 0a 09 09 09 | c != EO|F) {....|
|00003cc0| 2f 2a 20 69 67 6e 6f 72 | 65 20 6c 65 61 64 69 6e |/* ignor|e leadin|
|00003cd0| 67 20 77 68 69 74 65 20 | 73 70 61 63 65 20 2a 2f |g white |space */|
|00003ce0| 0a 09 09 09 69 66 20 28 | 63 70 20 3d 3d 20 6c 62 |....if (|cp == lb|
|00003cf0| 75 66 20 26 26 20 28 63 | 20 3d 3d 20 27 20 27 20 |uf && (c| == ' ' |
|00003d00| 7c 7c 20 63 20 3d 3d 20 | 27 5c 74 27 29 29 0a 09 ||| c == |'\t'))..|
|00003d10| 09 09 09 63 6f 6e 74 69 | 6e 75 65 3b 0a 09 09 09 |...conti|nue;....|
|00003d20| 2a 63 70 2b 2b 20 3d 20 | 63 3b 0a 09 09 7d 0a 09 |*cp++ = |c;...}..|
|00003d30| 09 69 66 20 28 63 20 3d | 3d 20 45 4f 46 29 20 7b |.if (c =|= EOF) {|
|00003d40| 0a 09 09 09 65 6f 66 20 | 3d 20 31 3b 0a 09 09 09 |....eof |= 1;....|
|00003d50| 72 65 74 75 72 6e 28 30 | 29 3b 0a 09 09 7d 0a 09 |return(0|);...}..|
|00003d60| 7d 20 77 68 69 6c 65 20 | 28 63 70 20 3d 3d 20 6c |} while |(cp == l|
|00003d70| 62 75 66 29 3b 09 2f 2a | 20 69 67 6e 6f 72 65 20 |buf);./*| ignore |
|00003d80| 65 6d 70 74 79 20 6c 69 | 6e 65 73 20 2a 2f 0a 09 |empty li|nes */..|
|00003d90| 2a 63 70 20 3d 20 30 3b | 0a 0a 09 2f 2a 20 65 78 |*cp = 0;|.../* ex|
|00003da0| 61 6d 69 6e 65 20 74 68 | 65 20 6c 69 6e 65 2c 20 |amine th|e line, |
|00003db0| 73 65 65 20 69 66 20 69 | 74 73 20 6f 6e 65 20 77 |see if i|ts one w|
|00003dc0| 65 20 77 61 6e 74 20 2a | 2f 0a 09 69 66 20 28 28 |e want *|/..if ((|
|00003dd0| 63 20 3d 20 70 61 72 73 | 65 28 6d 29 29 20 3d 3d |c = pars|e(m)) ==|
|00003de0| 20 30 29 0a 09 09 67 6f | 74 6f 20 6e 65 78 74 6c | 0)...go|to nextl|
|00003df0| 69 6e 65 3b 0a 0a 09 72 | 65 74 75 72 6e 28 63 29 |ine;...r|eturn(c)|
|00003e00| 3b 0a 7d 0a 0a 2f 2a 0a | 20 2a 20 70 61 72 73 65 |;.}../*.| * parse|
|00003e10| 20 2d 20 63 68 65 63 6b | 20 63 61 6c 65 6e 64 61 | - check| calenda|
|00003e20| 72 20 65 6e 74 72 79 20 | 66 6f 72 20 64 65 73 69 |r entry |for desi|
|00003e30| 72 65 64 20 6d 6f 6e 74 | 68 2c 20 62 72 65 61 6b |red mont|h, break|
|00003e40| 20 6c 69 6e 65 20 69 6e | 74 6f 20 66 69 65 6c 64 | line in|to field|
|00003e50| 73 0a 20 2a 2f 0a 70 61 | 72 73 65 28 6d 29 0a 72 |s. */.pa|rse(m).r|
|00003e60| 65 67 69 73 74 65 72 20 | 6d 3b 0a 7b 0a 09 72 65 |egister |m;.{..re|
|00003e70| 67 69 73 74 65 72 20 63 | 68 61 72 20 2a 63 70 3b |gister c|har *cp;|
|00003e80| 0a 09 72 65 67 69 73 74 | 65 72 20 69 3b 0a 09 69 |..regist|er i;..i|
|00003e90| 6e 74 20 69 73 5f 68 6f | 6c 69 64 61 79 20 3d 20 |nt is_ho|liday = |
|00003ea0| 30 3b 09 09 2f 2a 20 27 | 2a 27 20 61 66 74 65 72 |0;../* '|*' after|
|00003eb0| 20 64 61 74 65 20 66 6c | 61 67 73 20 69 74 20 61 | date fl|ags it a|
|00003ec0| 73 20 68 6f 6c 69 64 61 | 79 20 2a 2f 0a 09 69 6e |s holida|y */..in|
|00003ed0| 74 20 76 61 6c 69 64 20 | 3d 20 31 3b 0a 0a 09 63 |t valid |= 1;...c|
|00003ee0| 70 20 3d 20 73 74 72 74 | 6f 6b 28 6c 62 75 66 2c |p = strt|ok(lbuf,|
|00003ef0| 20 22 20 5c 74 22 29 3b | 09 2f 2a 20 67 65 74 20 | " \t");|./* get |
|00003f00| 66 69 72 73 74 20 66 69 | 65 6c 64 20 2a 2f 0a 0a |first fi|eld */..|
|00003f10| 09 77 68 69 6c 65 20 28 | 2a 63 70 29 20 7b 0a 09 |.while (|*cp) {..|
|00003f20| 09 69 66 20 28 69 73 75 | 70 70 65 72 28 2a 63 70 |.if (isu|pper(*cp|
|00003f30| 29 29 0a 09 09 09 2a 63 | 70 20 3d 20 74 6f 6c 6f |))....*c|p = tolo|
|00003f40| 77 65 72 28 2a 63 70 29 | 3b 0a 09 09 63 70 2b 2b |wer(*cp)|;...cp++|
|00003f50| 3b 0a 09 7d 0a 09 63 70 | 20 3d 20 6c 62 75 66 3b |;..}..cp| = lbuf;|
|00003f60| 0a 0a 09 2f 2a 0a 09 20 | 2a 20 43 68 65 63 6b 20 |.../*.. |* Check |
|00003f70| 66 6f 72 20 22 79 65 61 | 72 22 20 6c 69 6e 65 0a |for "yea|r" line.|
|00003f80| 09 20 2a 2f 0a 09 69 66 | 20 28 73 74 72 63 6d 70 |. */..if| (strcmp|
|00003f90| 28 63 70 2c 20 22 79 65 | 61 72 22 29 20 3d 3d 20 |(cp, "ye|ar") == |
|00003fa0| 30 29 20 7b 0a 09 09 63 | 70 20 3d 20 73 74 72 74 |0) {...c|p = strt|
|00003fb0| 6f 6b 28 28 63 68 61 72 | 20 2a 29 30 2c 20 22 20 |ok((char| *)0, " |
|00003fc0| 5c 74 22 29 3b 0a 09 09 | 69 66 20 28 28 69 20 3d |\t");...|if ((i =|
|00003fd0| 20 61 74 6f 69 28 63 70 | 29 29 20 3e 20 30 29 20 | atoi(cp|)) > 0) |
|00003fe0| 7b 0a 09 09 09 69 66 20 | 28 69 20 3c 20 31 30 30 |{....if |(i < 100|
|00003ff0| 29 0a 09 09 09 09 69 20 | 2b 3d 20 31 39 30 30 3b |).....i |+= 1900;|
|00004000| 0a 09 09 09 63 79 65 61 | 72 20 3d 20 69 3b 0a 09 |....cyea|r = i;..|
|00004010| 09 7d 0a 09 09 72 65 74 | 75 72 6e 28 30 29 3b 0a |.}...ret|urn(0);.|
|00004020| 09 7d 0a 0a 09 2f 2a 0a | 09 20 2a 20 49 66 20 66 |.}.../*.|. * If f|
|00004030| 69 65 6c 64 20 62 65 67 | 69 6e 73 20 77 69 74 68 |ield beg|ins with|
|00004040| 20 61 6c 70 68 61 2c 20 | 74 72 79 20 74 6f 20 64 | alpha, |try to d|
|00004050| 65 63 6f 64 65 20 6d 6f | 6e 74 68 20 6e 61 6d 65 |ecode mo|nth name|
|00004060| 0a 09 20 2a 2f 0a 09 69 | 66 20 28 69 73 61 6c 70 |.. */..i|f (isalp|
|00004070| 68 61 28 2a 63 70 29 29 | 20 7b 0a 09 09 69 66 20 |ha(*cp))| {...if |
|00004080| 28 63 79 65 61 72 20 21 | 3d 20 79 65 61 72 29 0a |(cyear !|= year).|
|00004090| 09 09 09 72 65 74 75 72 | 6e 28 30 29 3b 0a 0a 09 |...retur|n(0);...|
|000040a0| 09 66 6f 72 20 28 69 20 | 3d 20 30 3b 20 6d 6f 6e |.for (i |= 0; mon|
|000040b0| 74 68 73 5b 69 5d 3b 20 | 69 2b 2b 29 0a 09 09 09 |ths[i]; |i++)....|
|000040c0| 69 66 20 28 73 74 72 6e | 63 6d 70 28 63 70 2c 20 |if (strn|cmp(cp, |
|000040d0| 6d 6f 6e 74 68 73 5b 69 | 5d 2c 20 33 29 20 3d 3d |months[i|], 3) ==|
|000040e0| 20 30 29 20 7b 0a 09 09 | 09 09 69 66 20 28 2b 2b | 0) {...|..if (++|
|000040f0| 69 20 21 3d 20 6d 29 0a | 09 09 09 09 09 72 65 74 |i != m).|.....ret|
|00004100| 75 72 6e 28 30 29 3b 0a | 0a 09 09 09 09 2f 2a 20 |urn(0);.|...../* |
|00004110| 6d 6f 6e 74 68 20 66 6f | 75 6e 64 2c 20 67 65 74 |month fo|und, get|
|00004120| 20 64 61 79 20 2a 2f 0a | 0a 09 09 09 09 69 66 20 | day */.|.....if |
|00004130| 28 28 63 70 20 3d 20 73 | 74 72 74 6f 6b 28 28 63 |((cp = s|trtok((c|
|00004140| 68 61 72 20 2a 29 30 2c | 20 22 20 5c 74 22 29 29 |har *)0,| " \t"))|
|00004150| 20 3d 3d 20 4e 55 4c 4c | 29 0a 09 09 09 09 09 72 | == NULL|)......r|
|00004160| 65 74 75 72 6e 28 30 29 | 3b 0a 09 09 09 09 69 66 |eturn(0)|;.....if|
|00004170| 20 28 28 69 20 3d 20 61 | 74 6f 69 28 63 70 29 29 | ((i = a|toi(cp))|
|00004180| 20 3c 20 31 20 7c 7c 20 | 69 20 3e 20 33 31 29 0a | < 1 || |i > 31).|
|00004190| 09 09 09 09 09 72 65 74 | 75 72 6e 28 30 29 3b 0a |.....ret|urn(0);.|
|000041a0| 09 09 09 09 77 68 69 6c | 65 20 28 69 73 64 69 67 |....whil|e (isdig|
|000041b0| 69 74 28 2a 63 70 29 29 | 09 2f 2a 20 73 6b 69 70 |it(*cp))|./* skip|
|000041c0| 20 6f 76 65 72 20 64 61 | 79 20 66 69 65 6c 64 20 | over da|y field |
|000041d0| 2a 2f 0a 09 09 09 09 09 | 63 70 2b 2b 3b 0a 09 09 |*/......|cp++;...|
|000041e0| 09 09 69 66 20 28 2a 63 | 70 20 3d 3d 20 27 2a 27 |..if (*c|p == '*'|
|000041f0| 29 09 09 2f 2a 20 68 6f | 6c 69 64 61 79 3f 20 2a |)../* ho|liday? *|
|00004200| 2f 0a 09 09 09 09 09 69 | 73 5f 68 6f 6c 69 64 61 |/......i|s_holida|
|00004210| 79 20 3d 20 31 3b 0a 09 | 09 09 09 69 66 20 28 6c |y = 1;..|...if (l|
|00004220| 6f 61 64 77 6f 72 64 73 | 28 29 20 7c 7c 20 69 73 |oadwords|() || is|
|00004230| 5f 68 6f 6c 69 64 61 79 | 29 0a 09 09 09 09 09 72 |_holiday|)......r|
|00004240| 65 74 75 72 6e 28 69 20 | 7c 20 69 73 5f 68 6f 6c |eturn(i || is_hol|
|00004250| 69 64 61 79 20 2a 20 48 | 4f 4c 49 44 41 59 29 3b |iday * H|OLIDAY);|
|00004260| 0a 09 09 09 09 72 65 74 | 75 72 6e 28 30 29 3b 0a |.....ret|urn(0);.|
|00004270| 09 09 09 7d 0a 09 09 72 | 65 74 75 72 6e 28 30 29 |...}...r|eturn(0)|
|00004280| 3b 0a 09 7d 0a 09 2f 2a | 0a 09 20 2a 20 4e 6f 74 |;..}../*|.. * Not|
|00004290| 20 61 6c 70 68 61 20 6d | 6f 6e 74 68 2c 20 74 72 | alpha m|onth, tr|
|000042a0| 79 20 6e 75 6d 65 72 69 | 63 20 28 70 61 72 73 65 |y numeri|c (parse|
|000042b0| 20 66 75 6c 6c 20 64 61 | 74 65 20 74 6f 20 73 65 | full da|te to se|
|000042c0| 65 20 69 66 20 79 65 61 | 72 20 68 61 73 20 63 68 |e if yea|r has ch|
|000042d0| 61 6e 67 65 64 29 0a 09 | 20 2a 2f 0a 09 69 66 20 |anged)..| */..if |
|000042e0| 28 28 69 20 3d 20 61 74 | 6f 69 28 63 70 29 29 20 |((i = at|oi(cp)) |
|000042f0| 21 3d 20 6d 29 0a 09 09 | 76 61 6c 69 64 20 3d 20 |!= m)...|valid = |
|00004300| 30 3b 0a 09 77 68 69 6c | 65 20 28 69 73 64 69 67 |0;..whil|e (isdig|
|00004310| 69 74 28 2a 63 70 29 29 | 0a 09 09 63 70 2b 2b 3b |it(*cp))|...cp++;|
|00004320| 0a 09 77 68 69 6c 65 20 | 28 2a 63 70 20 26 26 20 |..while |(*cp && |
|00004330| 21 69 73 64 69 67 69 74 | 28 2a 63 70 29 29 0a 09 |!isdigit|(*cp))..|
|00004340| 09 63 70 2b 2b 3b 0a 0a | 09 2f 2a 20 6e 6f 77 20 |.cp++;..|./* now |
|00004350| 67 65 74 20 64 61 79 20 | 2a 2f 0a 0a 09 69 66 20 |get day |*/...if |
|00004360| 28 28 69 20 3d 20 61 74 | 6f 69 28 63 70 29 29 20 |((i = at|oi(cp)) |
|00004370| 3c 20 31 20 7c 7c 20 69 | 20 3e 20 33 31 29 0a 09 |< 1 || i| > 31)..|
|00004380| 09 76 61 6c 69 64 20 3d | 20 30 3b 0a 0a 09 20 2f |.valid =| 0;... /|
|00004390| 2a 20 4e 75 6d 65 72 69 | 63 20 64 61 74 65 73 20 |* Numeri|c dates |
|000043a0| 6d 61 79 20 68 61 76 65 | 20 61 20 79 65 61 72 20 |may have| a year |
|000043b0| 2a 2f 0a 0a 09 77 68 69 | 6c 65 20 28 69 73 64 69 |*/...whi|le (isdi|
|000043c0| 67 69 74 28 2a 63 70 29 | 29 09 09 2f 2a 20 73 6b |git(*cp)|)../* sk|
|000043d0| 69 70 20 6f 76 65 72 20 | 64 61 79 20 66 69 65 6c |ip over |day fiel|
|000043e0| 64 20 2a 2f 0a 09 09 63 | 70 2b 2b 3b 0a 09 69 66 |d */...c|p++;..if|
|000043f0| 20 28 2a 63 70 20 3d 3d | 20 27 2a 27 29 09 09 09 | (*cp ==| '*')...|
|00004400| 2f 2a 20 68 6f 6c 69 64 | 61 79 3f 20 2a 2f 0a 09 |/* holid|ay? */..|
|00004410| 09 69 73 5f 68 6f 6c 69 | 64 61 79 20 3d 20 31 3b |.is_holi|day = 1;|
|00004420| 0a 09 77 68 69 6c 65 20 | 28 2a 63 70 20 26 26 20 |..while |(*cp && |
|00004430| 21 69 73 64 69 67 69 74 | 28 2a 63 70 29 29 0a 09 |!isdigit|(*cp))..|
|00004440| 09 63 70 2b 2b 3b 0a 09 | 69 66 20 28 28 6d 20 3d |.cp++;..|if ((m =|
|00004450| 20 61 74 6f 69 28 63 70 | 29 29 20 3e 20 30 29 20 | atoi(cp|)) > 0) |
|00004460| 7b 0a 09 09 69 66 20 28 | 6d 20 3c 20 31 30 30 29 |{...if (|m < 100)|
|00004470| 0a 09 09 09 6d 20 2b 3d | 20 31 39 30 30 3b 0a 09 |....m +=| 1900;..|
|00004480| 09 63 79 65 61 72 20 3d | 20 6d 3b 0a 09 09 77 68 |.cyear =| m;...wh|
|00004490| 69 6c 65 20 28 69 73 64 | 69 67 69 74 28 2a 63 70 |ile (isd|igit(*cp|
|000044a0| 29 29 09 2f 2a 20 73 6b | 69 70 20 6f 76 65 72 20 |))./* sk|ip over |
|000044b0| 79 65 61 72 20 66 69 65 | 6c 64 20 2a 2f 0a 09 09 |year fie|ld */...|
|000044c0| 09 63 70 2b 2b 3b 0a 09 | 09 69 66 20 28 2a 63 70 |.cp++;..|.if (*cp|
|000044d0| 20 3d 3d 20 27 2a 27 29 | 09 09 2f 2a 20 68 6f 6c | == '*')|../* hol|
|000044e0| 69 64 61 79 3f 20 2a 2f | 0a 09 09 09 69 73 5f 68 |iday? */|....is_h|
|000044f0| 6f 6c 69 64 61 79 20 3d | 20 31 3b 0a 09 7d 0a 0a |oliday =| 1;..}..|
|00004500| 09 69 66 20 28 21 76 61 | 6c 69 64 20 7c 7c 20 63 |.if (!va|lid || c|
|00004510| 79 65 61 72 20 21 3d 20 | 79 65 61 72 29 09 2f 2a |year != |year)./*|
|00004520| 20 64 61 74 65 20 6e 6f | 74 20 61 70 70 6c 69 63 | date no|t applic|
|00004530| 61 62 6c 65 20 2d 20 72 | 65 74 75 72 6e 20 30 20 |able - r|eturn 0 |
|00004540| 2a 2f 0a 09 09 72 65 74 | 75 72 6e 28 30 29 3b 0a |*/...ret|urn(0);.|
|00004550| 0a 09 69 66 20 28 6c 6f | 61 64 77 6f 72 64 73 28 |..if (lo|adwords(|
|00004560| 29 20 7c 7c 20 69 73 5f | 68 6f 6c 69 64 61 79 29 |) || is_|holiday)|
|00004570| 09 2f 2a 20 64 61 74 65 | 20 6f 66 20 73 6f 6d 65 |./* date| of some|
|00004580| 20 73 69 67 6e 69 66 69 | 63 61 6e 63 65 20 2a 2f | signifi|cance */|
|00004590| 0a 09 09 72 65 74 75 72 | 6e 28 69 20 7c 20 69 73 |...retur|n(i | is|
|000045a0| 5f 68 6f 6c 69 64 61 79 | 20 2a 20 48 4f 4c 49 44 |_holiday| * HOLID|
|000045b0| 41 59 29 3b 0a 09 72 65 | 74 75 72 6e 28 30 29 3b |AY);..re|turn(0);|
|000045c0| 0a 7d 0a 0a 0a 2f 2a 0a | 20 2a 20 6c 6f 61 64 77 |.}.../*.| * loadw|
|000045d0| 6f 72 64 73 20 2d 20 74 | 6f 6b 65 6e 69 7a 65 20 |ords - t|okenize |
|000045e0| 6c 69 6e 65 20 62 75 66 | 66 65 72 20 69 6e 74 6f |line buf|fer into|
|000045f0| 20 77 6f 72 64 20 61 72 | 72 61 79 2c 20 72 65 74 | word ar|ray, ret|
|00004600| 75 72 6e 20 77 6f 72 64 | 20 63 6f 75 6e 74 0a 20 |urn word| count. |
|00004610| 2a 2f 0a 6c 6f 61 64 77 | 6f 72 64 73 28 29 0a 7b |*/.loadw|ords().{|
|00004620| 0a 09 72 65 67 69 73 74 | 65 72 20 63 68 61 72 20 |..regist|er char |
|00004630| 2a 2a 61 70 20 3d 20 77 | 6f 72 64 73 3b 0a 09 72 |**ap = w|ords;..r|
|00004640| 65 67 69 73 74 65 72 20 | 69 3b 0a 0a 09 66 6f 72 |egister |i;...for|
|00004650| 20 28 69 20 3d 20 30 3b | 20 2a 61 70 20 3d 20 73 | (i = 0;| *ap = s|
|00004660| 74 72 74 6f 6b 28 28 63 | 68 61 72 20 2a 29 30 2c |trtok((c|har *)0,|
|00004670| 20 22 20 5c 74 22 29 20 | 3b 20 61 70 2b 2b 2c 20 | " \t") |; ap++, |
|00004680| 69 2b 2b 29 20 3b 0a 09 | 72 65 74 75 72 6e 28 69 |i++) ;..|return(i|
|00004690| 29 3b 0a 7d 0a 0a 53 48 | 41 52 5f 45 4f 46 0a 66 |);.}..SH|AR_EOF.f|
|000046a0| 69 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 70 63 |i.if tes|t -f 'pc|
|000046b0| 61 6c 2e 6d 61 6e 27 0a | 74 68 65 6e 0a 09 65 63 |al.man'.|then..ec|
|000046c0| 68 6f 20 73 68 61 72 3a | 20 22 77 69 6c 6c 20 6e |ho shar:| "will n|
|000046d0| 6f 74 20 6f 76 65 72 2d | 77 72 69 74 65 20 65 78 |ot over-|write ex|
|000046e0| 69 73 74 69 6e 67 20 66 | 69 6c 65 20 27 70 63 61 |isting f|ile 'pca|
|000046f0| 6c 2e 6d 61 6e 27 22 0a | 65 6c 73 65 0a 63 61 74 |l.man'".|else.cat|
|00004700| 20 3c 3c 20 5c 53 48 41 | 52 5f 45 4f 46 20 3e 20 | << \SHA|R_EOF > |
|00004710| 27 70 63 61 6c 2e 6d 61 | 6e 27 0a 2e 54 48 20 50 |'pcal.ma|n'..TH P|
|00004720| 43 41 4c 20 31 0a 2e 53 | 48 20 4e 41 4d 45 0a 70 |CAL 1..S|H NAME.p|
|00004730| 63 61 6c 20 5c 2d 20 67 | 65 6e 65 72 61 74 65 20 |cal \- g|enerate |
|00004740| 50 6f 73 74 53 63 72 69 | 70 74 20 63 61 6c 65 6e |PostScri|pt calen|
|00004750| 64 61 72 73 0a 2e 53 48 | 20 53 59 4e 4f 50 53 49 |dars..SH| SYNOPSI|
|00004760| 53 0a 2e 42 20 70 63 61 | 6c 0a 5b 0a 2e 42 52 20 |S..B pca|l.[..BR |
|00004770| 5c 2d 65 0a 7c 0a 2e 42 | 52 20 5c 2d 66 20 3c 63 |\-e.|..B|R \-f <c|
|00004780| 61 6c 3e 0a 5d 20 5b 0a | 2e 42 20 5c 2d 6d 20 3c |al>.] [.|.B \-m <|
|00004790| 6d 6f 6e 74 68 3e 0a 5b | 0a 2e 42 20 5c 2d 79 20 |month>.[|..B \-y |
|000047a0| 3c 79 65 61 72 3e 0a 5d | 5d 20 5b 0a 2e 42 20 2d |<year>.]|] [..B -|
|000047b0| 72 0a 5d 20 5b 0a 2e 42 | 20 2d 73 0a 5d 20 5b 0a |r.] [..B| -s.] [.|
|000047c0| 2e 42 20 2d 74 20 3c 74 | 69 74 6c 65 66 6f 6e 74 |.B -t <t|itlefont|
|000047d0| 20 6e 61 6d 65 3e 0a 5d | 20 5b 0a 2e 42 20 2d 64 | name>.]| [..B -d|
|000047e0| 20 3c 64 61 79 66 6f 6e | 74 20 6e 61 6d 65 3e 0a | <dayfon|t name>.|
|000047f0| 5d 0a 2e 53 48 20 44 45 | 53 43 52 49 50 54 49 4f |]..SH DE|SCRIPTIO|
|00004800| 4e 0a 2e 49 20 50 63 61 | 6c 0a 67 65 6e 65 72 61 |N..I Pca|l.genera|
|00004810| 74 65 73 20 50 6f 73 74 | 53 63 72 69 70 74 20 74 |tes Post|Script t|
|00004820| 6f 20 70 72 6f 64 75 63 | 65 20 6c 61 6e 64 73 63 |o produc|e landsc|
|00004830| 61 70 65 20 6f 72 20 70 | 6f 72 74 72 61 69 74 20 |ape or p|ortrait |
|00004840| 63 61 6c 65 6e 64 61 72 | 73 20 66 6f 72 20 61 6e |calendar|s for an|
|00004850| 79 20 0a 6d 6f 6e 74 68 | 20 61 6e 64 20 79 65 61 |y .month| and yea|
|00004860| 72 2e 20 20 54 68 65 20 | 61 72 67 75 6d 65 6e 74 |r. The |argument|
|00004870| 73 0a 2e 42 20 3c 6d 6f | 6e 74 68 3e 0a 61 6e 64 |s..B <mo|nth>.and|
|00004880| 0a 2e 42 52 20 3c 79 65 | 61 72 3e 20 2c 0a 69 66 |..BR <ye|ar> ,.if|
|00004890| 20 70 72 6f 76 69 64 65 | 64 2c 20 73 68 6f 75 6c | provide|d, shoul|
|000048a0| 64 20 62 65 20 6e 75 6d | 65 72 69 63 2e 20 20 54 |d be num|eric. T|
|000048b0| 68 65 20 6d 6f 6e 74 68 | 20 73 68 6f 75 6c 64 20 |he month| should |
|000048c0| 62 65 20 69 6e 20 74 68 | 65 20 72 61 6e 67 65 20 |be in th|e range |
|000048d0| 31 20 2d 20 31 32 2c 0a | 61 6e 64 20 79 65 61 72 |1 - 12,.|and year|
|000048e0| 20 73 68 6f 75 6c 64 20 | 62 65 20 73 70 65 63 69 | should |be speci|
|000048f0| 66 69 65 64 20 61 73 20 | 31 20 6f 72 20 32 20 64 |fied as |1 or 2 d|
|00004900| 69 67 69 74 73 20 6f 72 | 20 61 73 20 74 68 65 20 |igits or| as the |
|00004910| 66 75 6c 6c 20 34 20 64 | 69 67 69 74 20 79 65 61 |full 4 d|igit yea|
|00004920| 72 2e 0a 54 68 65 20 64 | 65 66 61 75 6c 74 73 20 |r..The d|efaults |
|00004930| 66 6f 72 20 6d 6f 6e 74 | 68 20 61 6e 64 20 79 65 |for mont|h and ye|
|00004940| 61 72 20 61 72 65 20 74 | 68 65 20 63 75 72 72 65 |ar are t|he curre|
|00004950| 6e 74 20 6d 6f 6e 74 68 | 20 61 6e 64 20 79 65 61 |nt month| and yea|
|00004960| 72 2e 0a 49 66 20 6d 6f | 6e 74 68 20 69 73 20 70 |r..If mo|nth is p|
|00004970| 72 6f 76 69 64 65 64 2c | 20 62 75 74 20 7a 65 72 |rovided,| but zer|
|00004980| 6f 2c 20 74 68 65 20 65 | 6e 74 69 72 65 20 79 65 |o, the e|ntire ye|
|00004990| 61 72 20 69 73 20 70 72 | 69 6e 74 65 64 2e 0a 2e |ar is pr|inted...|
|000049a0| 50 0a 49 66 20 61 20 66 | 69 6c 65 20 6e 61 6d 65 |P.If a f|ile name|
|000049b0| 64 0a 2e 49 20 63 61 6c | 65 6e 64 61 72 0a 72 65 |d..I cal|endar.re|
|000049c0| 73 69 64 65 73 20 69 6e | 20 74 68 65 20 63 61 6c |sides in| the cal|
|000049d0| 6c 65 72 27 73 20 68 6f | 6d 65 20 64 69 72 65 63 |ler's ho|me direc|
|000049e0| 74 6f 72 79 2c 20 69 74 | 20 77 69 6c 6c 20 62 65 |tory, it| will be|
|000049f0| 20 73 65 61 72 63 68 65 | 64 20 66 6f 72 20 6c 69 | searche|d for li|
|00004a00| 6e 65 73 20 77 69 74 68 | 0a 6c 65 61 64 69 6e 67 |nes with|.leading|
|00004a10| 20 64 61 74 65 73 20 6d | 61 74 63 68 69 6e 67 20 | dates m|atching |
|00004a20| 74 68 65 20 72 65 71 75 | 65 73 74 65 64 20 6d 6f |the requ|ested mo|
|00004a30| 6e 74 68 20 61 6e 64 20 | 79 65 61 72 20 28 63 75 |nth and |year (cu|
|00004a40| 72 72 65 6e 74 20 62 79 | 20 64 65 66 61 75 6c 74 |rrent by| default|
|00004a50| 29 2e 0a 41 6e 79 20 74 | 65 78 74 20 66 6f 6c 6c |)..Any t|ext foll|
|00004a60| 6f 77 69 6e 67 20 74 68 | 65 20 64 61 74 65 20 77 |owing th|e date w|
|00004a70| 69 6c 6c 20 62 65 20 70 | 72 69 6e 74 65 64 20 6f |ill be p|rinted o|
|00004a80| 6e 20 74 68 65 20 63 61 | 6c 65 6e 64 61 72 20 75 |n the ca|lendar u|
|00004a90| 6e 64 65 72 20 74 68 65 | 0a 61 70 70 72 6f 70 72 |nder the|.appropr|
|00004aa0| 69 61 74 65 20 64 61 79 | 20 6f 66 20 74 68 65 20 |iate day| of the |
|00004ab0| 6d 6f 6e 74 68 2e 20 20 | 44 61 74 65 73 20 69 6e |month. |Dates in|
|00004ac0| 20 74 68 65 0a 2e 49 20 | 63 61 6c 65 6e 64 61 72 | the..I |calendar|
|00004ad0| 0a 66 69 6c 65 20 6d 61 | 79 20 63 6f 6e 73 69 73 |.file ma|y consis|
|00004ae0| 74 20 6f 66 20 61 20 6e | 75 6d 65 72 69 63 20 6f |t of a n|umeric o|
|00004af0| 72 20 61 6c 70 68 61 20 | 6d 6f 6e 74 68 20 28 61 |r alpha |month (a|
|00004b00| 74 20 6c 65 61 73 74 20 | 74 68 65 20 66 69 72 73 |t least |the firs|
|00004b10| 74 20 33 20 63 68 61 72 | 61 63 74 65 72 73 0a 66 |t 3 char|acters.f|
|00004b20| 6f 72 20 6d 6f 6e 74 68 | 20 6e 61 6d 65 73 29 20 |or month| names) |
|00004b30| 66 6f 6c 6c 6f 77 65 64 | 20 62 79 20 61 20 6e 75 |followed| by a nu|
|00004b40| 6d 65 72 69 63 20 64 61 | 79 20 61 6e 64 20 6f 70 |meric da|y and op|
|00004b50| 74 69 6f 6e 61 6c 6c 79 | 20 66 6f 6c 6c 6f 77 65 |tionally| followe|
|00004b60| 64 20 62 79 20 61 0a 79 | 65 61 72 2e 20 20 41 6e |d by a.y|ear. An|
|00004b70| 79 20 6e 6f 6e 2d 6e 75 | 6d 65 72 69 63 20 63 68 |y non-nu|meric ch|
|00004b80| 61 72 61 63 74 65 72 20 | 6d 61 79 20 73 65 70 61 |aracter |may sepa|
|00004b90| 72 61 74 65 20 6e 75 6d | 65 72 69 63 20 64 61 74 |rate num|eric dat|
|00004ba0| 65 73 2e 20 20 48 6f 6c | 69 64 61 79 73 20 6d 61 |es. Hol|idays ma|
|00004bb0| 79 0a 62 65 20 66 6c 61 | 67 67 65 64 20 62 79 20 |y.be fla|gged by |
|00004bc0| 66 6f 6c 6c 6f 77 69 6e | 67 20 74 68 65 20 64 61 |followin|g the da|
|00004bd0| 74 65 20 69 6d 6d 65 64 | 69 61 74 65 6c 79 20 77 |te immed|iately w|
|00004be0| 69 74 68 20 27 2a 27 3b | 20 74 68 69 73 20 77 69 |ith '*';| this wi|
|00004bf0| 6c 6c 20 63 61 75 73 65 | 20 74 68 65 0a 64 61 74 |ll cause| the.dat|
|00004c00| 65 20 74 6f 20 62 65 20 | 70 72 69 6e 74 65 64 20 |e to be |printed |
|00004c10| 69 6e 20 67 72 61 79 2e | 20 20 4c 69 6e 65 73 20 |in gray.| Lines |
|00004c20| 69 6e 20 74 68 65 0a 2e | 49 20 63 61 6c 65 6e 64 |in the..|I calend|
|00004c30| 61 72 0a 66 69 6c 65 20 | 63 6f 6e 73 69 73 74 69 |ar.file |consisti|
|00004c40| 6e 67 20 6f 66 20 22 79 | 65 61 72 20 78 78 78 78 |ng of "y|ear xxxx|
|00004c50| 22 20 28 77 68 65 72 65 | 20 78 78 78 78 20 69 73 |" (where| xxxx is|
|00004c60| 20 61 20 6e 75 6d 65 72 | 69 63 20 79 65 61 72 29 | a numer|ic year)|
|00004c70| 20 63 61 6e 20 62 65 20 | 75 73 65 64 0a 74 6f 20 | can be |used.to |
|00004c80| 73 65 74 20 74 68 65 20 | 79 65 61 72 20 66 6f 72 |set the |year for|
|00004c90| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 65 6e 74 72 69 | followi|ng entri|
|00004ca0| 65 73 2e 20 20 54 68 69 | 73 20 61 73 73 75 6d 65 |es. Thi|s assume|
|00004cb0| 73 20 74 68 61 74 20 74 | 68 65 20 66 6f 6c 6c 6f |s that t|he follo|
|00004cc0| 77 69 6e 67 0a 65 6e 74 | 72 69 65 73 20 64 6f 20 |wing.ent|ries do |
|00004cd0| 6e 6f 74 20 63 6f 6e 74 | 61 69 6e 20 61 20 79 65 |not cont|ain a ye|
|00004ce0| 61 72 3b 20 61 6e 79 20 | 64 61 74 65 20 65 6e 74 |ar; any |date ent|
|00004cf0| 72 69 65 73 20 63 6f 6e | 74 61 69 6e 69 6e 67 20 |ries con|taining |
|00004d00| 79 65 61 72 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |year inf|ormation|
|00004d10| 0a 77 69 6c 6c 20 73 65 | 74 20 74 68 65 20 72 65 |.will se|t the re|
|00004d20| 6d 65 6d 62 65 72 65 64 | 20 79 65 61 72 20 74 6f |membered| year to|
|00004d30| 20 74 68 61 74 20 79 65 | 61 72 2e 0a 2e 50 0a 2e | that ye|ar...P..|
|00004d40| 49 20 50 63 61 6c 20 68 | 61 73 20 6d 61 6e 79 20 |I Pcal h|as many |
|00004d50| 6f 70 74 69 6f 6e 73 3a | 0a 2e 50 0a 2e 54 50 0a |options:|..P..TP.|
|00004d60| 2e 42 20 5c 2d 65 0a 50 | 72 69 6e 74 20 61 6e 20 |.B \-e.P|rint an |
|00004d70| 65 6d 70 74 79 20 63 61 | 6c 65 6e 64 61 72 2e 20 |empty ca|lendar. |
|00004d80| 20 44 6f 20 6e 6f 74 20 | 70 72 69 6e 74 20 65 6e | Do not |print en|
|00004d90| 74 72 69 65 73 20 66 72 | 6f 6d 20 61 20 63 61 6c |tries fr|om a cal|
|00004da0| 65 6e 64 61 72 20 66 69 | 6c 65 2e 0a 2e 54 50 0a |endar fi|le...TP.|
|00004db0| 2e 42 52 20 5c 2d 66 20 | 3c 63 61 6c 3e 0a 44 69 |.BR \-f |<cal>.Di|
|00004dc0| 72 65 63 74 73 0a 2e 49 | 20 70 63 61 6c 0a 74 6f |rects..I| pcal.to|
|00004dd0| 20 75 73 65 20 74 68 65 | 20 66 69 6c 65 20 6e 61 | use the| file na|
|00004de0| 6d 65 20 3c 63 61 6c 3e | 20 61 73 20 74 68 65 20 |me <cal>| as the |
|00004df0| 69 6e 70 75 74 20 66 69 | 6c 65 20 69 6e 20 70 6c |input fi|le in pl|
|00004e00| 61 63 65 20 6f 66 20 74 | 68 65 20 64 65 66 61 75 |ace of t|he defau|
|00004e10| 6c 74 0a 63 61 6c 65 6e | 64 61 72 20 66 69 6c 65 |lt.calen|dar file|
|00004e20| 20 69 6e 20 74 68 65 20 | 63 61 6c 6c 65 72 73 20 | in the |callers |
|00004e30| 68 6f 6d 65 20 64 69 72 | 65 63 74 6f 72 79 2e 0a |home dir|ectory..|
|00004e40| 2e 54 50 0a 2e 42 20 5c | 2d 72 0a 54 68 69 73 20 |.TP..B \|-r.This |
|00004e50| 77 69 6c 6c 20 63 61 75 | 73 65 20 74 68 65 20 6f |will cau|se the o|
|00004e60| 75 74 70 75 74 20 74 6f | 20 63 6f 6d 65 20 6f 75 |utput to| come ou|
|00004e70| 74 20 69 6e 20 70 6f 72 | 74 72 61 69 74 0a 6d 6f |t in por|trait.mo|
|00004e80| 64 65 20 69 6e 73 74 65 | 61 64 20 6f 66 20 6c 61 |de inste|ad of la|
|00004e90| 6e 64 73 63 61 70 65 2e | 0a 2e 54 50 0a 2e 42 20 |ndscape.|..TP..B |
|00004ea0| 5c 2d 73 0a 54 68 69 73 | 20 77 69 6c 6c 20 63 61 |\-s.This| will ca|
|00004eb0| 75 73 65 20 53 61 74 75 | 72 64 61 79 73 20 74 6f |use Satu|rdays to|
|00004ec0| 20 62 65 20 70 72 69 6e | 74 65 64 20 69 6e 20 62 | be prin|ted in b|
|00004ed0| 6c 61 63 6b 20 69 6e 73 | 74 65 61 64 20 6f 66 20 |lack ins|tead of |
|00004ee0| 67 72 61 79 2e 0a 2e 54 | 50 0a 2e 42 52 20 5c 2d |gray...T|P..BR \-|
|00004ef0| 74 20 3c 74 69 74 6c 65 | 66 6f 6e 74 20 6e 61 6d |t <title|font nam|
|00004f00| 65 3e 0a 54 68 69 73 20 | 6f 70 74 69 6f 6e 20 63 |e>.This |option c|
|00004f10| 61 6e 20 62 65 20 75 73 | 65 64 20 74 6f 20 63 68 |an be us|ed to ch|
|00004f20| 61 6e 67 65 20 74 68 65 | 20 66 6f 6e 74 20 74 68 |ange the| font th|
|00004f30| 65 20 74 69 74 6c 65 0a | 69 73 20 70 72 69 6e 74 |e title.|is print|
|00004f40| 65 64 20 69 6e 2e 20 28 | 69 65 2e 20 70 63 61 6c |ed in. (|ie. pcal|
|00004f50| 20 2d 74 20 54 69 6d 65 | 73 2d 52 6f 6d 61 6e 29 | -t Time|s-Roman)|
|00004f60| 2e 0a 2e 54 50 0a 2e 42 | 52 20 20 2d 64 20 3c 64 |...TP..B|R -d <d|
|00004f70| 61 79 66 6f 6e 74 20 6e | 61 6d 65 3e 0a 54 68 69 |ayfont n|ame>.Thi|
|00004f80| 73 20 6f 70 74 69 6f 6e | 20 69 73 20 74 68 65 20 |s option| is the |
|00004f90| 73 61 6d 65 20 61 73 20 | 2d 74 20 65 78 63 65 70 |same as |-t excep|
|00004fa0| 74 20 74 68 61 74 20 74 | 68 65 20 66 6f 6e 74 20 |t that t|he font |
|00004fb0| 75 73 65 64 0a 74 6f 20 | 70 72 69 6e 74 20 74 68 |used.to |print th|
|00004fc0| 65 20 64 61 79 20 6e 75 | 6d 62 65 72 73 20 69 73 |e day nu|mbers is|
|00004fd0| 20 63 68 61 6e 67 65 64 | 2e 0a 2e 53 48 20 53 45 | changed|...SH SE|
|00004fe0| 45 20 41 4c 53 4f 0a 63 | 61 6c 28 31 29 0a 2e 53 |E ALSO.c|al(1)..S|
|00004ff0| 48 20 43 41 56 45 41 54 | 53 0a 54 68 65 20 6f 72 |H CAVEAT|S.The or|
|00005000| 69 67 69 6e 61 6c 20 50 | 6f 73 74 53 63 72 69 70 |iginal P|ostScrip|
|00005010| 74 20 63 6f 64 65 20 74 | 6f 20 67 65 6e 65 72 61 |t code t|o genera|
|00005020| 74 65 20 74 68 65 20 63 | 61 6c 65 6e 64 61 72 73 |te the c|alendars|
|00005030| 20 77 61 73 20 77 72 69 | 74 74 65 6e 20 62 79 0a | was wri|tten by.|
|00005040| 50 61 74 72 69 63 6b 20 | 57 6f 6f 64 20 28 43 6f |Patrick |Wood (Co|
|00005050| 70 79 77 72 69 74 65 20 | 28 63 29 20 31 39 38 37 |pywrite |(c) 1987|
|00005060| 20 62 79 20 50 61 74 72 | 69 63 6b 20 57 6f 6f 64 | by Patr|ick Wood|
|00005070| 20 6f 66 20 50 69 70 65 | 6c 69 6e 65 20 41 73 73 | of Pipe|line Ass|
|00005080| 6f 63 69 61 74 65 73 2c | 0a 49 6e 63 2e 29 2c 20 |ociates,|.Inc.), |
|00005090| 61 6e 64 20 61 75 74 68 | 6f 72 69 7a 65 64 20 66 |and auth|orized f|
|000050a0| 6f 72 20 6d 6f 64 69 66 | 69 63 61 74 69 6f 6e 20 |or modif|ication |
|000050b0| 61 6e 64 20 72 65 64 69 | 73 74 72 69 62 75 74 69 |and redi|stributi|
|000050c0| 6f 6e 2e 20 20 54 68 65 | 20 63 61 6c 65 6e 64 61 |on. The| calenda|
|000050d0| 72 0a 66 69 6c 65 20 69 | 6e 63 6c 75 73 69 6f 6e |r.file i|nclusion|
|000050e0| 20 63 6f 64 65 20 77 61 | 73 20 6f 72 69 67 69 6e | code wa|s origin|
|000050f0| 61 6c 6c 79 20 77 72 69 | 74 74 65 6e 20 69 6e 20 |ally wri|tten in |
|00005100| 22 62 73 28 31 29 22 20 | 62 79 20 42 69 6c 6c 20 |"bs(1)" |by Bill |
|00005110| 56 6f 67 65 6c 20 6f 66 | 0a 41 54 26 54 2e 20 20 |Vogel of|.AT&T. |
|00005120| 50 61 74 72 69 63 6b 27 | 73 20 6f 72 69 67 69 6e |Patrick'|s origin|
|00005130| 61 6c 20 50 6f 73 74 53 | 63 72 69 70 74 20 77 61 |al PostS|cript wa|
|00005140| 73 20 6d 6f 64 69 66 69 | 65 64 20 61 6e 64 20 65 |s modifi|ed and e|
|00005150| 6e 68 61 6e 63 65 64 20 | 73 65 76 65 72 61 6c 0a |nhanced |several.|
|00005160| 74 69 6d 65 73 20 62 79 | 20 6f 74 68 65 72 73 20 |times by| others |
|00005170| 77 68 6f 73 20 6e 61 6d | 65 73 20 68 61 76 65 20 |whos nam|es have |
|00005180| 72 65 67 72 65 74 74 61 | 62 6c 79 20 62 65 65 6e |regretta|bly been|
|00005190| 20 6c 6f 73 74 2e 20 20 | 4b 65 6e 20 4b 65 69 72 | lost. |Ken Keir|
|000051a0| 6e 61 6e 20 6f 66 0a 50 | 61 63 69 66 69 63 20 42 |nan of.P|acific B|
|000051b0| 65 6c 6c 20 61 73 73 65 | 6d 62 6c 65 64 20 74 68 |ell asse|mbled th|
|000051c0| 65 20 6f 72 69 67 69 6e | 61 6c 20 22 43 22 20 76 |e origin|al "C" v|
|000051d0| 65 72 73 69 6f 6e 20 75 | 70 6f 6e 20 77 68 69 63 |ersion u|pon whic|
|000051e0| 68 20 74 68 69 73 20 69 | 73 20 62 61 73 65 64 3b |h this i|s based;|
|000051f0| 0a 61 64 64 69 74 69 6f | 6e 61 6c 20 6d 6f 64 69 |.additio|nal modi|
|00005200| 66 69 63 61 74 69 6f 6e | 73 20 61 6e 64 20 65 6e |fication|s and en|
|00005210| 68 61 6e 63 65 6d 65 6e | 74 73 20 77 65 72 65 20 |hancemen|ts were |
|00005220| 74 68 65 20 77 6f 72 6b | 20 6f 66 20 4a 6f 73 65 |the work| of Jose|
|00005230| 70 68 20 50 2e 0a 4c 61 | 72 73 6f 6e 2c 20 45 64 |ph P..La|rson, Ed|
|00005240| 20 48 61 6e 64 2c 20 61 | 6e 64 20 41 6e 64 72 65 | Hand, a|nd Andre|
|00005250| 77 20 57 2e 20 52 6f 67 | 65 72 73 2e 0a 53 48 41 |w W. Rog|ers..SHA|
|00005260| 52 5f 45 4f 46 0a 66 69 | 0a 65 78 69 74 20 30 0a |R_EOF.fi|.exit 0.|
|00005270| 23 09 45 6e 64 20 6f 66 | 20 73 68 65 6c 6c 20 61 |#.End of| shell a|
|00005280| 72 63 68 69 76 65 0a | |rchive. | |
+--------+-------------------------+-------------------------+--------+--------+